64 lines · plain
1Date: Fri, 1 Jun 2001 16:38:17 -0500 (CDT)2From: Chris Lattner <sabre@nondot.org>3To: Vikram S. Adve <vadve@cs.uiuc.edu>4Subject: Interesting: GCC passes5 6 7Take a look at this document (which describes the order of optimizations8that GCC performs):9 10http://gcc.gnu.org/onlinedocs/gcc_17.html11 12The rundown is that after RTL generation, the following happens:13 141 . [t] jump optimization (jumps to jumps, etc)152 . [t] Delete unreachable code163 . Compute live ranges for CSE174 . [t] Jump threading (jumps to jumps with identical or inverse conditions)185 . [t] CSE196 . *** Conversion to SSA 207 . [t] SSA Based DCE218 . *** Conversion to LLVM229 . UnSSA2310. GCSE2411. LICM2512. Strength Reduction2613. Loop unrolling2714. [t] CSE2815. [t] DCE2916. Instruction combination, register movement, scheduling... etc.30 31I've marked optimizations with a [t] to indicate things that I believe to32be relatively trivial to implement in LLVM itself. The time consuming33things to reimplement would be SSA based PRE, Strength reduction & loop34unrolling... these would be the major things we would miss out on if we35did LLVM creation from tree code [inlining and other high level36optimizations are done on the tree representation].37 38Given the lack of "strong" optimizations that would take a long time to39reimplement, I am leaning a bit more towards creating LLVM from the tree40code. Especially given that SGI has GPL'd their compiler, including many41SSA based optimizations that could be adapted (besides the fact that their42code looks MUCH nicer than GCC :)43 44Even if we choose to do LLVM code emission from RTL, we will almost45certainly want to move LLVM emission from step 8 down until at least CSE46has been rerun... which causes me to wonder if the SSA generation code47will still work (due to global variable dependencies and stuff). I assume48that it can be made to work, but might be a little more involved than we49would like.50 51I'm continuing to look at the Tree -> RTL code. It is pretty gross52because they do some of the translation a statement at a time, and some53of it a function at a time... I'm not quite clear why and how the54distinction is drawn, but it does not appear that there is a wonderful55place to attach extra info.56 57Anyways, I'm proceeding with the RTL -> LLVM conversion phase for now. We58can talk about this more on Monday.59 60Wouldn't it be nice if there were a obvious decision to be made? :)61 62-Chris63 64