[llvm-commits] [llvm] r137672 - /llvm/trunk/lib/Transforms/InstCombine/InstructionCombining.cpp
Bill Wendling
isanbard at gmail.com
Mon Aug 15 16:15:04 PDT 2011
On Aug 15, 2011, at 4:00 PM, Eli Friedman wrote:
> On Mon, Aug 15, 2011 at 3:53 PM, Bill Wendling <isanbard at gmail.com> wrote:
>> Author: void
>> Date: Mon Aug 15 17:53:05 2011
>> New Revision: 137672
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=137672&view=rev
>> Log:
>> Don't sink the instruction to before a landingpad instruction.
>>
>> Modified:
>> llvm/trunk/lib/Transforms/InstCombine/InstructionCombining.cpp
>>
>> Modified: llvm/trunk/lib/Transforms/InstCombine/InstructionCombining.cpp
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstructionCombining.cpp?rev=137672&r1=137671&r2=137672&view=diff
>> ==============================================================================
>> --- llvm/trunk/lib/Transforms/InstCombine/InstructionCombining.cpp (original)
>> +++ llvm/trunk/lib/Transforms/InstCombine/InstructionCombining.cpp Mon Aug 15 17:53:05 2011
>> @@ -1436,7 +1436,7 @@
>> }
>>
>> BasicBlock::iterator InsertPos = DestBlock->getFirstNonPHI();
>> -
>> + if (isa<LandingPadInst>(InsertPos)) ++InsertPos; // Skip landingpad inst.
>> I->moveBefore(InsertPos);
>> ++NumSunkInst;
>> return true;
>
> Is it legal to sink an arbitrary load past a LandingPadInst?
>
Sure. It's not illegal, at least. The optimizer should be aware that it's taking a 'load' from before an 'invoke' and sinking it into the 'unwind' edge. If it's aware that it's doing that and okay with it, then I don't have a problem allowing it. :)
-bw
More information about the llvm-commits
mailing list