Handle PHI nodes prefacing EH pads too

llvm-svn: 244274
This commit is contained in:
David Majnemer
2015-08-06 21:08:32 +00:00
parent fb7a737a72
commit ac6b298850
2 changed files with 89 additions and 15 deletions

View File

@@ -135,7 +135,7 @@ AllocaInst *llvm::DemotePHIToStack(PHINode *P, Instruction *AllocaPoint) {
// Insert a load in place of the PHI and replace all uses.
BasicBlock::iterator InsertPt = P;
for (; isa<PHINode>(InsertPt) || isa<LandingPadInst>(InsertPt); ++InsertPt)
for (; isa<PHINode>(InsertPt) || InsertPt->isEHPad(); ++InsertPt)
/* empty */; // Don't insert before PHI nodes or landingpad instrs.
Value *V = new LoadInst(Slot, P->getName()+".reload", InsertPt);