1 / 13

A Complete Compilation System

A Complete Compilation System. Conventional Approach. Input Source. Intermediate Code. Output Assembly. Compiler Frontend analysis & optimization. Compiler Backend analysis & optimization. Frontends Parafrase-2 Polaris PFA …. Backends MIPSPro FORTRAN Visual C++ GCC.

aaralyn
Télécharger la présentation

A Complete Compilation System

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. A Complete Compilation System

  2. Conventional Approach Input Source Intermediate Code Output Assembly Compiler Frontend analysis & optimization Compiler Backend analysis & optimization • Frontends • Parafrase-2 • Polaris • PFA • … • Backends • MIPSPro FORTRAN • Visual C++ • GCC • ... Lose Analysis Information!

  3. The PROMIS Approach • LUIR lowering • Simplify to 3-addr code • In-place to maintain analysis • Opcode tagging • Tag stmts w/ possible opcodes • In place to maintain analysis HUIR LUIR IUIR SS F77 EPIC Analysis Data, Control, Cost Symbolic, etc. Standard Opt. Strength Reduct., CSE, CP, etc. Machine Specific Optimizations C SMT Transformations Distribution, Fusion, Interchange, Unroll, etc. C++ Resource Allocation ILP Opt. … NUMA Java NOW Instruction Scheduling/ Packing Parallelization Loop and Functional . . . Machine Indep. Peephole Opt. . . UMD

  4. The PROMIS HTG • Acyclic Task Graph (at its core) • Single statement nodes • CFE, DDE, CDE • Hierarchical Blocks • Loops become SESE compound nodes • HtgBBlock - may contain compound nodes • Hierarchical Edges • Don’t cross levels of hierarchy • Edges with higher levels source/sink into fake start/stop nodes • Edges with lower levels source/sink into compound nodes

  5. Block Start Start HtgBBlock CDE Branch DDE Stop HtgBBlock HtgBBlock CFE Start  HtgBBlock Loop Stop Stop

  6. Loop Start HtgBBlock Start a[i] = b + c  i-assign Branch p-add i-mult Stop v-addr i-var i-var i-var Stop a i b c

  7. Retargeting PROMIS -- UMD • All high and many low level optimizations and analyses operate on machine independent internal representation • All machine specific information contained within the UMD description • Code Generator and optimization parameters are retargeted simply by changing the UMD description

  8. .c .cpp PE PE M M PE PE PE PE M M M M Retargetable & Reconfigurable Source files MD files Target VLIW MD PE Vector Unit ??? Multi- proc Multi- threaded Register Allocator NOW Thread Unit Instruction Scheduler

  9. Information Provided by the UMD • High Level • Types of parallelism available: multiprocessor, multithreading, vector units, etc. • Intrinsic function mappings • Intermediate Level • Intrinsic function lowering • Low Level • Opcode mapping, Instruction Formats, etc. • Resource usage, pipelines, latencies, etc.

  10. Saving the PROMISInternal Representation • Can easily save and restore a program’s Internal Representation to a file • Avoid re-executing the same passes on the same programs by saving intermediate results at the desired location • More Comprehensive, less Destructive, and much Faster than generating C code • NO analysis information is recomputed!

  11. Common Uses:Repeated Experiments, Debugging • Setup: Run initial passes and dump to file • Setup: Run initial passes and dump to file • Use: Load from file and run experiment Run first N-1 Passes .PIR File Unload .PIR File Run experiment on (or debug) Pass N No need to repeat First N-1passes Load

  12. Potential Uses • Interface to connect PROMIS to other compilers, such as a back-end optimizer • This interface is more expressive than dumping source code (e.g. can represent Data Dependence Analysis)

  13. Main Issues • Each class in the Internal Representation must implement Unload and Load functions • Basic data types are written by value • Objects are serialized and tokenized before being written to file

More Related