1 / 26

WHIRL SSA: A New Optimization Infrastructure for Open64

WHIRL SSA: A New Optimization Infrastructure for Open64. Keqiao Yang, Zhemin Yang Parallel Processing Institute, Fudan University, Shanghai Hui Shi, Yiran Wang Global Delivery China Center, Hewlett-Packard, Shanghai. Motivation Overview Implementation Uses of WHIRL SSA

ollie
Download Presentation

WHIRL SSA: A New Optimization Infrastructure for Open64

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. WHIRL SSA: A New Optimization Infrastructure for Open64 Keqiao Yang, Zhemin Yang Parallel Processing Institute, Fudan University, Shanghai Hui Shi, Yiran Wang Global Delivery China Center, Hewlett-Packard, Shanghai

  2. Motivation Overview Implementation Uses of WHIRL SSA Current Status and Future Work Agenda WHIRL SSA - Open64 Workshop 2010

  3. No explicit data flow information on WHIRL HSSA used in Pre_OPT and Main_OPT Data flow analysis in LNO and IPA Depends on DU manager provided by Pre_OPT Incomplete in presence of aliases Difficult to update DU manager Becomes imprecise due to the updates  WHIRL SSA: a better way to facilitate the data flow analysis on WHIRL Motivation WHIRL SSA - Open64 Workshop 2010

  4. A better “DU manager” Factored UD chain Reduced traversing overhead Keeping alias information Handle both direct and indirect access Eliminate ‘incomplete DU/UD chain’ Easy to use STL-style iterator to traverse the DU/UD chain A flexible Infrastructure Available from H WHIRL to L WHIRL Lightweight, demand-driven Precise and updatable Goal WHIRL SSA - Open64 Workshop 2010

  5. No explicit CFG High level structured control flow, e.g. DO_LOOP Update of the SSA information To deal with LNO/IPA transformation of WHIRL Ease incremental implementation Challenges WHIRL SSA - Open64 Workshop 2010

  6. Motivation Overview Implementation Uses of WHIRL SSA Current Status and Future Work Agenda WHIRL SSA - Open64 Workshop 2010

  7. Stored in side data tructure No new operators introduced to WHIRL No changes to the existing components Alias Alias are represented by χ and μ Virtual Symbol Live-range of versions doesn’t overlap Available from H WHIRL to L WHIRL H WHIRL: High level SCF available L WHIRL: Target information exposed Design Decisions WHIRL SSA - Open64 Workshop 2010

  8. For SCF, φ nodes are mapped on the root WN For GOTO-LABEL, φ nodes are placed on the LABEL PHI Placement WHIRL SSA - Open64 Workshop 2010

  9. An Example (tempo highlights) WHIRL SSA - Open64 Workshop 2010

  10. Motivation Overview Implementation Uses WHIRL SSA Current Status and Future Work Agenda WHIRL SSA - Open64 Workshop 2010

  11. Major components Components Overview WHIRL SSA - Open64 Workshop 2010

  12. Manage the SSA information Interface to access the SSA information Manage the SSA nodes (φ, χ, μ) Manage the maps to look up the SSA nodes Use hash_map, key is WHIRL node’s map_id and value is index to the table Manage the WHIRL SSA symbol table Build DU on demand SSA Manager WHIRL SSA - Open64 Workshop 2010

  13. SSA information is converted from Pre_OPT/Main_OPT emitter Instead of constructing from WHIRL directly for rapid implementation Pre_OPT emitter: H WHIRL SSA Main_OPT emitter: L WHIRL SSA The standalone SSA constructor is under development SSA Emitter WHIRL SSA - Open64 Workshop 2010

  14. Update SSA within a small region Requirements on the region Single Entry, Multiple Exits Control flow in/out of the region is not changed No new entry/exit introduced by the transformation Steps Build new CFG within the region Insert φ, χ and μ nodes Rename variables, the version starts from the current max value in current PU Merge the region back by renaming the versions in entry and exit nodes or inserting assignments SSA Updater WHIRL SSA - Open64 Workshop 2010

  15. Motivation Overview Implementation Uses of WHIRL SSA Current Status and Future Work Agenda WHIRL SSA - Open64 Workshop 2010

  16. In LNO Most transformations in LNO will change the CFG Difficult to maintain the SSA information But, LNO transformations only change the CFG within a small region (like a DO-LOOP or the BLOCK contains the DO-LOOP) Satisfy the SSA updater’s requirements Able to keep the data flow information up-to-date Uses of H WHIRL SSA WHIRL SSA - Open64 Workshop 2010

  17. In IPA Context-sensitive and flow-sensitive call graph Benefit to inter-procedural alias analysis Possible to build a scalable, context-sensitive and flow-sensitive alias analyzer with the help of WHIRL SSA Uses of H WHIRL SSA WHIRL SSA - Open64 Workshop 2010

  18. LWOPT: Low Whirl OPTimizer Target-specific optimizations Target-specific information exposed ABI, such as parameter passing and return value PREGs are created by register promotion Move transformations from CG EBO to LWOPT Better data flow analysis High level operators available, like ADD, SUB Type information available, I1, I2, I4, I8 Uses of L WHIRL SSA WHIRL SSA - Open64 Workshop 2010

  19. Motivation Overview Implementation Uses of WHIRL SSA Current Status and Future Work Agenda WHIRL SSA - Open64 Workshop 2010

  20. Completed WHIRL SSA Manager, SSA based DU manager Pre_OPT Emitter Reader/Writer Utilities ir_b2a, whirl2c, etc Ongoing SSA verifier SSA updater Get the branch from Open64 SVN https://svn.open64.net/svnroot/open64/branches/open64-ssa Current Status WHIRL SSA - Open64 Workshop 2010

  21. Standalone SSA Constructor Build SSA on top of WHIRL Remove dependency on Pre_OPT/Main_OPT emitter Encapsulate CFG/SSA builder as utilities Invoked on demand Enable optimizations based on WHIRL SSA LNO IPA L WHIRL optimizer Register TN SSA in CG? Future Work WHIRL SSA - Open64 Workshop 2010

  22. Thanks to Fred Chow and Sun Chan who spent a lot of time in discussions with us and who provided a lot of suggestions, design review and code review. Thanks to Xiaomi An for help with applying WHIRL SSA to flow-sensitive alias analysis Thanks to Min Zhao for help with extending SSA to L WHIRL Acknowledgements WHIRL SSA - Open64 Workshop 2010

  23. Any questions?Thank you very much! WHIRL SSA - Open64 Workshop 2010

  24. Backup Slides WHIRL SSA - Open64 Workshop 2010

  25. Associate WN with SSA by map_id Access the SSA information by map_id SSA Representation WHIRL SSA - Open64 Workshop 2010

  26. DU Representation • Based on underlying SSA information • Built-in UD chain in SSA • Construct DU chain on demand WHIRL SSA - Open64 Workshop 2010

More Related