[llvm-commits] [llvm] r45620 - /llvm/trunk/lib/Target/X86/X86InstrInfo.cpp

Evan Cheng evan.cheng at apple.com
Sat Jan 5 00:53:50 PST 2008

On Jan 5, 2008, at 12:28 AM, Chris Lattner wrote:

> On Jan 4, 2008, at 11:21 PM, Bill Wendling wrote:
>> On Jan 4, 2008, at 11:02 PM, Chris Lattner wrote:
>>> You aren't looking for loads *from the global*, you're looking for
>>> loads from the *stub for the global*, which are always invariant.
>>> You
>>> just need to know whether the load is from a global or from its  
>>> stub.
>> Okay. I just don't know how to check that it's a load from a *stub*
>> for the global. :-)
> I am not 100% sure, but I think that X86Subtarget::GVRequiresExtraLoad
> is the place to start looking.

Right. If it's a load from GV and GVRequiresExtraLoad() returns true  
then it's a load from a stub.

Here is something to consider for further enhancement. There are  
potentially other GV loads which can be side effect free though. As  
the comment says, if the value in the GV isn't redefined (in the  
loop), then it can be moved. Should there be some kind of callback  
function provided by caller of isReallySideEffectFree() that checks  
if a register or a GV operand is considered side effect free? In the  
case of LICM, if a register or GV operand is considered a loop  
invariant, then the instruction is really side effect free. In the  
case of remat, if an operand is "available", then it's side effect  
free, etc. etc.

BTW, what do we do about volatile loads? I don't think the property  
is transferred to target instructions. Or perhaps volatile property  
should be on the location (GV) instead of the instruction?


> -Chris
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

More information about the llvm-commits mailing list