forked from OSchip/llvm-project
[LCSSA] Don't insert tokens into the worklist at all.
We're gonna skip them anyway, so there's no point in inserting them in the first place. llvm-svn: 300452
This commit is contained in:
parent
d588b56d9c
commit
ce161a7812
|
@ -85,6 +85,7 @@ bool llvm::formLCSSAForInstructions(SmallVectorImpl<Instruction *> &Worklist,
|
||||||
UsesToRewrite.clear();
|
UsesToRewrite.clear();
|
||||||
|
|
||||||
Instruction *I = Worklist.pop_back_val();
|
Instruction *I = Worklist.pop_back_val();
|
||||||
|
assert(!I->getType()->isTokenTy() && "Tokens shouldn't be in the worklist");
|
||||||
BasicBlock *InstBB = I->getParent();
|
BasicBlock *InstBB = I->getParent();
|
||||||
Loop *L = LI.getLoopFor(InstBB);
|
Loop *L = LI.getLoopFor(InstBB);
|
||||||
assert(L && "Instruction belongs to a BB that's not part of a loop");
|
assert(L && "Instruction belongs to a BB that's not part of a loop");
|
||||||
|
@ -96,13 +97,6 @@ bool llvm::formLCSSAForInstructions(SmallVectorImpl<Instruction *> &Worklist,
|
||||||
if (ExitBlocks.empty())
|
if (ExitBlocks.empty())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// Tokens cannot be used in PHI nodes, so we skip over them.
|
|
||||||
// We can run into tokens which are live out of a loop with catchswitch
|
|
||||||
// instructions in Windows EH if the catchswitch has one catchpad which
|
|
||||||
// is inside the loop and another which is not.
|
|
||||||
if (I->getType()->isTokenTy())
|
|
||||||
continue;
|
|
||||||
|
|
||||||
for (Use &U : I->uses()) {
|
for (Use &U : I->uses()) {
|
||||||
Instruction *User = cast<Instruction>(U.getUser());
|
Instruction *User = cast<Instruction>(U.getUser());
|
||||||
BasicBlock *UserBB = User->getParent();
|
BasicBlock *UserBB = User->getParent();
|
||||||
|
@ -311,6 +305,13 @@ bool llvm::formLCSSA(Loop &L, DominatorTree &DT, LoopInfo *LI,
|
||||||
!isa<PHINode>(I.user_back())))
|
!isa<PHINode>(I.user_back())))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
// Tokens cannot be used in PHI nodes, so we skip over them.
|
||||||
|
// We can run into tokens which are live out of a loop with catchswitch
|
||||||
|
// instructions in Windows EH if the catchswitch has one catchpad which
|
||||||
|
// is inside the loop and another which is not.
|
||||||
|
if (I.getType()->isTokenTy())
|
||||||
|
continue;
|
||||||
|
|
||||||
Worklist.push_back(&I);
|
Worklist.push_back(&I);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue