[LLVMdev] Proposal for new Legalization framework
Diego Novillo
dnovillo at google.com
Fri Apr 26 12:14:41 PDT 2013
On 2013-04-26 14:43 , Chris Lattner wrote:
> There definitely are strong advantages to using one datastructure to represent multiple levels of IR: you have less code in the compiler, more shared concepts, etc. I have seen and work with several compilers that tried to do this. Even GCC does this (in the opposite direction) with "treessa" which repurposes some front-end data structures for their mid-level IR.
Note that this was a transitional step only. Nowadays GIMPLE is its own
data structure. It still keeps pointers to the tree data structure for
symbols and types. But eventually, if the existing plans materialize,
these will be converted into proper indexes into symbol and type tables.
Over time, we have found that there is a distinct advantage in having
different internal types represent different IRs. The division of
responsibilities is easier to express. Making this distinction in GCC's
codebase is less than trivial, however.
There are some data structures that are advantageous to share across
IRs. Mostly container types like CFG, call graph, loop structures, etc.
Diego.
More information about the llvm-dev
mailing list