[llvm-commits] [llvm] r141569 - in /llvm/trunk: lib/CodeGen/MachineLICM.cpp test/CodeGen/ARM/lsr-unfolded-offset.ll test/CodeGen/X86/licm-dominance.ll test/CodeGen/X86/licm-nested.ll

Evan Cheng evan.cheng at apple.com
Mon Oct 10 13:36:58 PDT 2011


On Oct 10, 2011, at 1:32 PM, Devang Patel wrote:

> 
> On Oct 10, 2011, at 1:20 PM, Evan Cheng wrote:
> 
>> On Oct 10, 2011, at 12:09 PM, Devang Patel wrote:
>> 
>>> 
>>> /// Hoist - When an instruction is found to use only loop invariant operands
>>> /// that are safe to hoist, this instruction is called to do the dirty work.
>>> ///
>>> @@ -1139,6 +1167,8 @@
>>>    MI = ExtractHoistableLoad(MI);
>>>    if (!MI) return false;
>>>  }
>>> +  if (!IsGuaranteedToExecute(MI))
>>> +    return false;
>> 
>> Why is the check here? Shouldn't the check be in IsLICMCandidate()?
> 
> I put, potentially compile time expensive, dominator check in the end.

You should only do the check when the instruction being considered is not side-effect free. That should eliminate some of the concerns about compile time. Putting the check not only is the wrong (from the design aspect), it also means LICM is doing unnecessary work in IsLoopInvariantInst, IsProfitableToHoist, and ExtractHoistableLoad.

Evan

> -
> Devang

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20111010/05fa4a6a/attachment.html>


More information about the llvm-commits mailing list