[llvm-commits] [llvm] r50382 - in /llvm/trunk: include/llvm/LinkAllPasses.h include/llvm/Transforms/Scalar.h lib/Transforms/Scalar/DeadLoopElimination.cpp

Chris Lattner clattner at apple.com
Tue Apr 29 14:41:35 PDT 2008


On Apr 29, 2008, at 1:09 PM, Owen Anderson wrote:

>
> On Apr 29, 2008, at 1:36 PM, Chris Lattner wrote:
>>> +bool DeadLoopElimination::IsLoopInvariantInst(Instruction *I, Loop*
>>> L)  {
>>
>> Can Loop::isLoopInvariant be used for this?
>
> Unfortunately, no.  isLoopInvariant never considers an instruction  
> defined within the loop to be invariant.  I tried using it  
> initially, and found that i eliminated very few loops.  The code I'm  
> using here is the same logic that LICM uses as well.

Maybe there should be a new predicate on Loop?

-Chris



More information about the llvm-commits mailing list