Скачать презентацию ICD-C Compiler Framework Dr Heiko Falk ICD-C Скачать презентацию ICD-C Compiler Framework Dr Heiko Falk ICD-C

dda7042ca2f07ea2035de87bc1c3a435.ppt

  • Количество слайдов: 17

ICD-C Compiler Framework Dr. Heiko Falk ICD-C Compiler Framework Dr. Heiko Falk

ICD-C Compiler Framework 1. 2. 3. 4. 5. Highlights and Features Basic Concepts Extensions ICD-C Compiler Framework 1. 2. 3. 4. 5. Highlights and Features Basic Concepts Extensions Use Cases Availability H. Falk, ICD/ES, 2008 - 2 -

Highlights and Features of ICD-C • ANSI-C Compiler Frontend § C 89 + C Highlights and Features of ICD-C • ANSI-C Compiler Frontend § C 89 + C 99 Standards § GNU Inline Assembler • Intuitive Internal Structures and Concepts § C++ Class Design & Linkable Libraries • Powerful Analyses & Optimizations § Control Flow, Data Flow & Loop Analyses § 21 Built-In Standard Optimizations • Flexible Usage § Pre-Pass Source-Level Optimizer § High-Level IR(*) in stand-alone Compiler (*) IR = Intermediate Representation H. Falk, ICD/ES, 2008 - 3 -

ICD-C Compiler Framework 1. 2. Highlights and Features Basic Concepts – – 3. 4. ICD-C Compiler Framework 1. 2. Highlights and Features Basic Concepts – – 3. 4. 5. Class Hierarchy Documentation and Testing Extensions Use Cases Availability H. Falk, ICD/ES, 2008 - 4 -

ICD-C Class Hierarchy IR Global ST Compilation Unit File ST Function Funct. ST Statement ICD-C Class Hierarchy IR Global ST Compilation Unit File ST Function Funct. ST Statement Expression § § § § Basic Block Loop Statements (for, do-while, while-do) Selection Statements (if, if-else, switch) Local ST Jump Statements (return, break, continue, …) … Binary & Unary Expressions (+, -, *, /, …) Assignment Expressions (=, +=, -=, …) Index & Component Accesses (a[x], a. x, …) … H. Falk, ICD/ES, 2008 - 5 -

Documentation & Testing • Documentation Testing § User’s and Developer Manual Built-In & External Documentation & Testing • Documentation Testing § User’s and Developer Manual Built-In & External Testbenches • > 3, 100 ANSI-C Test Files § Browsable HTML Reference Manual • > 700, 000 Lines of ANSI-C Test Code § Fully Automated Test Procedures • Various Test Environments (Sun Sparc Solaris, Su. SE Linux, Tri. Core 1. 3, …) H. Falk, ICD/ES, 2008 - 6 -

ICD-C Compiler Framework 1. 2. 3. Highlights and Features Basic Concepts Extensions – – ICD-C Compiler Framework 1. 2. 3. Highlights and Features Basic Concepts Extensions – – – 4. 5. Analyses & Optimizations Backend-Interface Retargetability Use Cases Availability H. Falk, ICD/ES, 2008 - 7 -

Built-In Analyses § Control Flow Analyses • • Basic Block & Statement Level Domination Built-In Analyses § Control Flow Analyses • • Basic Block & Statement Level Domination / Post-Domination Reachability Analysis Function Call Graph Analysis § Data Flow Analyses • DEF / USE Analysis • Def & Use Chains • Address Taken Analysis § Loop Analyses • Induction Variable Analysis • Number of Loop Iterations H. Falk, ICD/ES, 2008 - 8 -

ICD-C Optimizations String Constants Loop Collapsing Loop Deindexing Tail Recursion Function Inlining -O 1 ICD-C Optimizations String Constants Loop Collapsing Loop Deindexing Tail Recursion Function Inlining -O 1 Dead Code Elimination Value Propagation Constant Folding Simplify Code Unused Symbols Return Val. Elimination Function Specializat. Loop Unrolling Loop Unswitch. Head-Ctrl. Loops Simplify Code Redundant Load El. Life Range Splitting Local CSE Struct Scalarizat. Constant Folding Value Propagation Dead Code Elimination Function Arguments Unused Symbols H. Falk, ICD/ES, 2008 -O 2 -O 3 Function Exit Points - 9 -

ICD-C Compiler Backend Interface reg: tpm_Binary. Exp. PLUS(reg, reg) { $cost[0] = $cost[2] + ICD-C Compiler Backend Interface reg: tpm_Binary. Exp. PLUS(reg, reg) { $cost[0] = $cost[2] + $cost[3] + COST_ADD; }={ cout << “add “ << target << “, ” << $action[2]() << “, ” << $action[3]() << endl; }; C++ Compiler ICD-CG Technology int sumdiff( int a, int b ) { return a + b; }; H. Falk, ICD/ES, 2008 Code Selector ICD-C Core Library ICD-C TPM Library sumdiff: add R 1, R 2, R 3 ret - 10 -

Retargetability of ICD-C • Configurable Target Architecture Parameters § Bit Widths & Memory Alignments Retargetability of ICD-C • Configurable Target Architecture Parameters § Bit Widths & Memory Alignments § Configuration of ANSI-C Fuzzyness • Arithmetic vs. Logic Right Shifts • Signedness of Type char § Transformation for Auto-Increment Addressing § Optimization: Speed vs. Code Size • Supported Target Architectures § ARM 7 § Tri. Core 1. 3 § PP 32 V 2 § Sun Sparc, x 86 H. Falk, ICD/ES, 2008 - 11 -

ICD-C Compiler Framework 1. 2. 3. 4. Highlights and Features Basic Concepts Extensions Use ICD-C Compiler Framework 1. 2. 3. 4. Highlights and Features Basic Concepts Extensions Use Cases – – 5. Source-Level Multi-Process Scratchpad Allocation Real-Time Compiler WCC Availability H. Falk, ICD/ES, 2008 - 12 -

Use Case 1: Source-Level Memory Optimizer App. 1 App. 2 Standard Compiler (GCC) Compile-time Use Case 1: Source-Level Memory Optimizer App. 1 App. 2 Standard Compiler (GCC) Compile-time Transformations App. n Profit values / Allocation hints C Code Lock. Gen / etc. Prepared C Profit Annotator ICD-C Technology Allocation Manager Operating System GCC Adapted C RTEMS. o SPMM. o Opt Sys. Image © R. Pyka [Operating system integrated energy aware scratchpad allocation, SCOPES ‘ 07] H. Falk, ICD/ES, 2008 - 13 -

Use Case 2: Real-Time Compiler WCC ICD-C Technology ICD-LLIR Technology © H. Falk, P. Use Case 2: Real-Time Compiler WCC ICD-C Technology ICD-LLIR Technology © H. Falk, P. Lokuciejewski [Design of a WCET-Aware C Compiler, ESTIMedia ‘ 06] H. Falk, ICD/ES, 2008 - 14 -

ICD-C Compiler Framework 1. 2. 3. 4. 5. Highlights and Features Basic Concepts Extensions ICD-C Compiler Framework 1. 2. 3. 4. 5. Highlights and Features Basic Concepts Extensions Use Cases Availability – – Supported Host Platforms Licensing Schemes H. Falk, ICD/ES, 2008 - 15 -

Technical Availability of ICD-C • Supported Host Platforms § Sparc Sun Solaris 5. 8 Technical Availability of ICD-C • Supported Host Platforms § Sparc Sun Solaris 5. 8 – 5. 10 § x 86 Su. SE Linux 9. x – 10. x § x 86 Debian Linux § x 86 Microsoft Windows 2000, XP § x 86 Microsoft 2003 Server H. Falk, ICD/ES, 2008 - 16 -

ICD-C Software Licenses • Supported Licensing Schemes § Restricted Evaluation License § Academic Research ICD-C Software Licenses • Supported Licensing Schemes § Restricted Evaluation License § Academic Research License § Commercial License • Binary License w/o Optimizations • Binary License with Optimizations • Full Source Code License H. Falk, ICD/ES, 2008 - 17 -