mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-17 21:29:20 +00:00
Fix DemoteRegToStack on an invoke. This fixes PR634.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23618 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
27d404ccd1
commit
ab55698349
@ -77,6 +77,7 @@ AllocaInst* llvm::DemoteRegToStack(Instruction &I, bool VolatileLoads) {
|
||||
BasicBlock::iterator InsertPt;
|
||||
if (!isa<TerminatorInst>(I)) {
|
||||
InsertPt = &I;
|
||||
++InsertPt;
|
||||
} else {
|
||||
// We cannot demote invoke instructions to the stack if their normal edge
|
||||
// is critical.
|
||||
@ -86,7 +87,7 @@ AllocaInst* llvm::DemoteRegToStack(Instruction &I, bool VolatileLoads) {
|
||||
InsertPt = II.getNormalDest()->begin();
|
||||
}
|
||||
|
||||
for (++InsertPt; isa<PHINode>(InsertPt); ++InsertPt)
|
||||
for (; isa<PHINode>(InsertPt); ++InsertPt)
|
||||
/* empty */; // Don't insert before any PHI nodes.
|
||||
new StoreInst(&I, Slot, InsertPt);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user