1 Date: Fri, 1 Jun 2001 16:38:17 -0500 (CDT)
2 From: Chris Lattner <sabre@nondot.org>
3 To: Vikram S. Adve <vadve@cs.uiuc.edu>
4 Subject: Interesting: GCC passes
7 Take a look at this document (which describes the order of optimizations
10 http://gcc.gnu.org/onlinedocs/gcc_17.html
12 The rundown is that after RTL generation, the following happens:
14 1 . [t] jump optimization (jumps to jumps, etc)
15 2 . [t] Delete unreachable code
16 3 . Compute live ranges for CSE
17 4 . [t] Jump threading (jumps to jumps with identical or inverse conditions)
19 6 . *** Conversion to SSA
21 8 . *** Conversion to LLVM
25 12. Strength Reduction
29 16. Instruction combination, register movement, scheduling... etc.
31 I've marked optimizations with a [t] to indicate things that I believe to
32 be relatively trivial to implement in LLVM itself. The time consuming
33 things to reimplement would be SSA based PRE, Strength reduction & loop
34 unrolling... these would be the major things we would miss out on if we
35 did LLVM creation from tree code [inlining and other high level
36 optimizations are done on the tree representation].
38 Given the lack of "strong" optimizations that would take a long time to
39 reimplement, I am leaning a bit more towards creating LLVM from the tree
40 code. Especially given that SGI has GPL'd their compiler, including many
41 SSA based optimizations that could be adapted (besides the fact that their
42 code looks MUCH nicer than GCC :)
44 Even if we choose to do LLVM code emission from RTL, we will almost
45 certainly want to move LLVM emission from step 8 down until at least CSE
46 has been rerun... which causes me to wonder if the SSA generation code
47 will still work (due to global variable dependencies and stuff). I assume
48 that it can be made to work, but might be a little more involved than we
51 I'm continuing to look at the Tree -> RTL code. It is pretty gross
52 because they do some of the translation a statement at a time, and some
53 of it a function at a time... I'm not quite clear why and how the
54 distinction is drawn, but it does not appear that there is a wonderful
55 place to attach extra info.
57 Anyways, I'm proceeding with the RTL -> LLVM conversion phase for now. We
58 can talk about this more on Monday.
60 Wouldn't it be nice if there were a obvious decision to be made? :)