[llvm-commits] [llvm] r42075 - in /llvm/trunk: lib/Transforms/Scalar/LICM.cpp test/Transforms/LICM/2007-09-17-PrompteValue.ll

Chris Lattner clattner at apple.com
Wed Sep 19 10:58:33 PDT 2007


On Sep 19, 2007, at 10:49 AM, Devang Patel wrote:

>>
>> In the second form, code hoisted/sunk/promoted out of the loop will
>> still be under the guard of the if. Also see tree-ssa-loop-ch.c in
>> GCC,
>> for example.
>
> In llvm, loop-rotation pass does this. However, what if LICM input is
> not processed by loop rotation pass ? One conservative approach is to
> check whether StoreInst and LoadInst in question dominates loop
> exit(s) or not. I'll try it and see if it affects performance for
> nightly tester benchmarks or not.

LICM should verify that the loop is in the right form and disable the  
xform if not.  We should arrange for the optimizer to run loop rotate  
before licm (as we currently do), but it's not always profitable to  
rotate the loop (e.g. if the condition is large).

-Chris



More information about the llvm-commits mailing list