[llvm-commits] [llvm] r56286 - in /llvm/trunk: lib/Transforms/Utils/SimplifyCFG.cpp test/Transforms/SimplifyCFG/2008-09-17-SpeculativeHoist.ll

Devang Patel dpatel at apple.com
Thu Sep 18 10:12:32 PDT 2008


On Sep 18, 2008, at 9:57 AM, Evan Cheng wrote:

>> -  // If we get here, we can hoist the instruction. Try to place it
>> before the
>> -  // icmp instruction preceeding the conditional branch.
>> -  BasicBlock::iterator InsertPos = BI;
>> -  if (InsertPos != BIParent->begin())
>> -    --InsertPos;
>> -  if (InsertPos == BrCond && !isa<PHINode>(BrCond))
>> -    BIParent->getInstList().splice(InsertPos, BB1->getInstList(),  
>> I);
>> -  else
>> -    BIParent->getInstList().splice(BI, BB1->getInstList(), I);
>> +  // If we get here, we can hoist the instruction.
>> +  BIParent->getInstList().splice(BI, BB1->getInstList(), I);
>
> Rather than removing the logic, why not check if the instruction uses
> the branch condition?

What's the advantage of hoisting this instruction by one  additional  
instruction in some cases ?
-
Devang



More information about the llvm-commits mailing list