[llvm-commits] [llvm] r108351 - /llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp

Chris Lattner clattner at apple.com
Thu Jul 15 09:35:15 PDT 2010


On Jul 15, 2010, at 9:28 AM, Eli Friedman wrote:

> On Thu, Jul 15, 2010 at 7:59 AM, Owen Anderson <resistor at mac.com> wrote:
>> 
>> On Jul 15, 2010, at 12:12 AM, Duncan Sands wrote:
>> 
>> +  Instruction *BonusInst = 0;
>> 
>> +  if (&*FrontIt != Cond&&
>> 
>> +      (*FrontIt).hasOneUse()&&  *(*FrontIt).use_begin() == Cond&&
>> 
>> +      (*FrontIt).isSafeToSpeculativelyExecute()&&
>> 
>> +      !(*FrontIt).mayReadFromMemory()) {
>> 
>> Why the check on mayReadFromMemory?
>> 
>> We don't want to speculatively execute a load before a null check.
> 
> isSafeToSpeculativelyExecute will handle this for you.

Also, please use X->y instead of (*X).y

-Chris



More information about the llvm-commits mailing list