Presentation is loading. Please wait.

Presentation is loading. Please wait.

3/6/20161 WHIRL SSA: A New Optimization Infrastructure for Open64 Keqiao Yang, Zhemin Yang Parallel Processing Institute, Fudan University, Shanghai Hui.

Similar presentations


Presentation on theme: "3/6/20161 WHIRL SSA: A New Optimization Infrastructure for Open64 Keqiao Yang, Zhemin Yang Parallel Processing Institute, Fudan University, Shanghai Hui."— Presentation transcript:

1 3/6/20161 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 WHIRL SSA - Open64 Workshop 2010 23/6/2016 Agenda Motivation Overview Implementation Uses of WHIRL SSA Current Status and Future Work

3 WHIRL SSA - Open64 Workshop 2010 33/6/2016 Motivation 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

4 WHIRL SSA - Open64 Workshop 2010 43/6/2016 Goal 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

5 WHIRL SSA - Open64 Workshop 2010 53/6/2016 Challenges 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

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

7 WHIRL SSA - Open64 Workshop 2010 73/6/2016 Design Decisions 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

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

9 WHIRL SSA - Open64 Workshop 2010 93/6/2016 An Example (tempo highlights)

10 WHIRL SSA - Open64 Workshop 2010 103/6/2016 Agenda Motivation Overview Implementation Uses WHIRL SSA Current Status and Future Work

11 WHIRL SSA - Open64 Workshop 2010 113/6/2016 Components Overview Major components

12 WHIRL SSA - Open64 Workshop 2010 123/6/2016 SSA Manager 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

13 WHIRL SSA - Open64 Workshop 2010 133/6/2016 SSA Emitter 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

14 WHIRL SSA - Open64 Workshop 2010 143/6/2016 SSA Updater 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

15 WHIRL SSA - Open64 Workshop 2010 153/6/2016 Agenda Motivation Overview Implementation Uses of WHIRL SSA Current Status and Future Work

16 WHIRL SSA - Open64 Workshop 2010 163/6/2016 Uses of H WHIRL SSA 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

17 WHIRL SSA - Open64 Workshop 2010 173/6/2016 Uses of H WHIRL SSA 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

18 WHIRL SSA - Open64 Workshop 2010 183/6/2016 Uses of L WHIRL SSA 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

19 WHIRL SSA - Open64 Workshop 2010 193/6/2016 Agenda Motivation Overview Implementation Uses of WHIRL SSA Current Status and Future Work

20 WHIRL SSA - Open64 Workshop 2010 203/6/2016 Current Status 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

21 WHIRL SSA - Open64 Workshop 2010 213/6/2016 Future Work 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?

22 WHIRL SSA - Open64 Workshop 2010 223/6/2016 Acknowledgements 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

23 WHIRL SSA - Open64 Workshop 2010 233/6/2016 Any questions? Thank you very much!

24 WHIRL SSA - Open64 Workshop 2010 243/6/2016 Backup Slides

25 WHIRL SSA - Open64 Workshop 2010 253/6/2016 SSA Representation Associate WN with SSA by map_id –Access the SSA information by map_id

26 WHIRL SSA - Open64 Workshop 2010 263/6/2016 DU Representation Based on underlying SSA information –Built-in UD chain in SSA –Construct DU chain on demand


Download ppt "3/6/20161 WHIRL SSA: A New Optimization Infrastructure for Open64 Keqiao Yang, Zhemin Yang Parallel Processing Institute, Fudan University, Shanghai Hui."

Similar presentations


Ads by Google