[LLVMdev] Area for improvement

Vikram S. Adve vadve at cs.uiuc.edu
Tue Feb 22 07:36:38 PST 2005


On Feb 22, 2005, at 9:09 AM, Vikram S. Adve wrote:

>> The only way to make preselection or lowermultidimrefs work is to 
>> duplication all of the knowledge of how the instruction selector will 
>> select the code (e.g. the advice about allowing constant indices to 
>> be grouped together).
>
> This is why you need a separate, low-level optimization framework - 
> the kind you were describing.

Incidentally, for those interested in the big picture, the issues 
raised by Jeff and Chris are a fundamental trade-off between the 
so-called "low-level" model of compilation (like GCC and I believe 
IBM's  XL compiler family), and the mid-level model we chose for LLVM.  
In GCC and other low-level systems, code is lowered to expose all the 
detailed operations needed on a specific target early in the 
compilation process, so that they are all exposed to optimization.  Of 
course, doing this in a single IR capable of supporting multiple 
targets can lead to horrendously complex representations.  The 
mid-level model does not expose architecture-specific operations in the 
IR but this means that a separate back-end optimization framework is 
needed, in addition to the primary mid-level, architecture-neutral, 
framework.

My point is that this is a fundamental trade-off made very early on in 
the LLVM design, and I think it was the right one.  It greatly 
simplifies the higher-level optimizations, which are by far the most 
complex, and can even make more optimizations possible (if the 
mid-level IR is able to expose types and reference patterns that are 
obscured in the low-level IR).

--Vikram
http://www.cs.uiuc.edu/~vadve
http://llvm.cs.uiuc.edu/




More information about the llvm-dev mailing list