[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 14:21:31 PDT 2011


On Oct 10, 2011, at 2:00 PM, Devang Patel wrote:

> 
> On Oct 10, 2011, at 1:38 PM, Evan Cheng wrote:
> 
>> Also note, the fix as it is, has performance impact. We do want to speculate when the instructions are cheap and register pressure is low.
> 
> 
> BTW, If I put the check in IsLICMCandidate() as you suggested earlier then also we'll skip hoisting for cheap instructions when register pressure is low. 

We won't because the check should only be made for the candidates known to be side-effect-free. It's a correctness check. Later on when the code is checking for profitability, it should do the check (if not done already) for other candidates when register pressure is high.

Also note, the check should only be made once per basic block. There is no need to check it for every instruction.

To check for side-effect, look for mayLoad(), mayStore(), and hasUnmodeledSideEffects(). See MCInstrDesc.h.

Evan

> 
> Stay tuned, I'll update the patch.
> -
> Devang

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


More information about the llvm-commits mailing list