mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-14 14:24:05 +00:00
Make sure we don't emit instructions before a landingpad instruction.
PR14782 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171846 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -124,7 +124,12 @@ AllocaInst *llvm::DemotePHIToStack(PHINode *P, Instruction *AllocaPoint) {
|
||||
}
|
||||
|
||||
// Insert a load in place of the PHI and replace all uses.
|
||||
Value *V = new LoadInst(Slot, P->getName()+".reload", P);
|
||||
BasicBlock::iterator InsertPt = P;
|
||||
|
||||
for (; isa<PHINode>(InsertPt) || isa<LandingPadInst>(InsertPt); ++InsertPt)
|
||||
/* empty */; // Don't insert before PHI nodes or landingpad instrs.
|
||||
|
||||
Value *V = new LoadInst(Slot, P->getName()+".reload", InsertPt);
|
||||
P->replaceAllUsesWith(V);
|
||||
|
||||
// Delete PHI.
|
||||
|
Reference in New Issue
Block a user