[LLVMdev] Area for improvement
Chris Lattner
sabre at nondot.org
Tue Feb 22 08:34:11 PST 2005
On Tue, 22 Feb 2005, Jeff Cohen wrote:
> Sounds reasonable to me. It seems to me it would be best if LSR was part of
> the low-level optimization framework, otherwise it would be forced to
> duplicate too much work on its own.
>
> There is still probably a need for a mid-level LSR that handles the explicit
> multiplications, divisions, etc...
You're right: strength reduction is the #1 gray area between the LLVM
level and the code generator level. Doing it in the backend has several
nice advantages (e.g. handling explicit multiplies and gep instructions is
same analysis, you have a better understanding of register pressure, etc),
but doing it at the llvm level also has advantages (higher level
information is available, the xform is faster and cheaper to do, etc).
Currently we also have the infrastructure available to do the
transformation on the LLVM level, but don't really have it available in
the code generator.
> Also, some of what LSR needs to decide is architecture dependent. For
> example, it may not want to strength reduce a multiplication which multiplies
> by a small power of two, as this is handled by addressing modes on some
> architectures.
You're right. However, we can choose to expose information about target
parameters through the Target* interfaces that llvm->llvm passes can use
as well, so at least this aspect is not a killer issue.
-Chris
--
http://nondot.org/sabre/
http://llvm.cs.uiuc.edu/
More information about the llvm-dev
mailing list