1 / 18

Investigation of flow graphs optimization methods used in optimizing compilers

Investigation of flow graphs optimization methods used in optimizing compilers. Eugene Gavrin – MSc student. Universal compiler back-end. Tasks. Develop an universal internal representation of the program based on formal computational model

jenn
Download Presentation

Investigation of flow graphs optimization methods used in optimizing compilers

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. Investigation of flow graphs optimization methods used in optimizing compilers Eugene Gavrin – MSc student

  2. Universal compiler back-end

  3. Tasks • Develop an universal internal representation of the program based on formal computational model • Implement the set of common compiler optimizations

  4. Internal representation • AST • Control flow graph • Data flow graph • Call graph • Dependency graph • ...

  5. Internal representation • AST • Control flow graph • Data flow graph • Call graph • Dependency graph • ...

  6. Internal representation • AST • Control flow graph • Data flow graph • Call graph • Dependency graph • ...

  7. Internal representation • AST • Control flow graph • Data flow graph • Call graph • Dependency graph • ...

  8. Internal representation • AST • Control flow graph • Data flow graph • Call graph • Dependency graph • ...

  9. Internal representation • AST • Control flow graph • Data flow graph • Call graph • Dependency graph • ...

  10. Internal representation • Oriented graph • Nodes are functional operators • Vertexes are data dependencies • Each operator stores: • Operation name • Input and output data links • Meta data

  11. Internal representation (branching) • Extended data flow model by Davis & Keller • Selector and Distributor represents conditional statements • Enough to represent any control operator • If / Switch • For / While

  12. Optimizing transformations • Constant folding; • Sub-expression evaluation; • Strength reduction; • Null sequences; • Combine operators; • Loop optimizations; • Branch Elimination;

  13. Constant folding Before After

  14. Sub-expression evaluation Before After

  15. Dead code elimination Before After

  16. Direct conversion Before After

  17. Future plans • СIL processing (.NET assembly) • Load • Unload • Compare results with MSFT .NET compiler • Static program analysis

  18. Q&A

More Related