[LLVMdev] some llvm/clang missed optimizations
eli.friedman at gmail.com
Tue Jan 26 14:57:46 PST 2010
On Tue, Jan 26, 2010 at 12:36 PM, John Regehr <regehr at cs.utah.edu> wrote:
> Sometimes not:
The primary issue here is that scalar evolution doesn't know how to
deal with loops using "sle" for the exit condition. Shouldn't be too
hard to fix now that we have overflow flags for addition.
> Repetitive code with lots of bitwise operations is compiled by LLVM into
> much larger code than the other compilers:
> Note that this is straight-line code, so LLVM's output will run 4-5
> times longer than everyone else's.
> I'll be interested to learn the source of this one.
This looks like a one-off case; instcombine destroys the symmetry of
the code that the test harness duplicated by reducing the masking
constants. Probably too complicated for too little gain to be worth
> Sometimes a function modifies globals but even so has no net effect:
> Somehow gcc3 sees these but everyone else including gcc4 fails.
> Here llvm-gcc and gcc, but not clang, exploit undefinedness of integer
> overflow to eliminate most of the code in a function:
> Most likely this is not what the authors of the code intended, but the
> compilers are correct.
LLVM doesn't handle correlated expressions at the moment.
More information about the llvm-dev