[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 15:09:07 PDT 2008


On Apr 29, 2008, at 2:47 PM, Owen Anderson wrote:

>
> On Apr 29, 2008, at 4:41 PM, Chris Lattner wrote:
>
>>
>> On Apr 29, 2008, at 1:09 PM, Owen Anderson wrote:
>>>
>>>
>>> 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?
>>
>
> I think it's just a difference in assumed meaning.   
> isLoopInvariant() makes the fewest assumptions about the client,  
> whereas IsLoopInvariantInst() assumes that the client is willing and/ 
> or able to handle hoisting loop-invariant instructions for themselves.

IsHoistableFromLoop?

-Chris



More information about the llvm-commits mailing list