mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-24 23:28:41 +00:00
Simplify the logic of getting hold of a PHI predecessor block.
There is now a direct way from value-use-iterator to incoming block in PHINode's API. This way we avoid the iterator->index->iterator trip, and especially the costly getOperandNo() invocation. Additionally there is now an assertion that the iterator really refers to one of the PHI's Uses. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62869 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -175,8 +175,7 @@ void LCSSA::ProcessInstruction(Instruction *Instr,
|
||||
UI != E;) {
|
||||
BasicBlock *UserBB = cast<Instruction>(*UI)->getParent();
|
||||
if (PHINode *P = dyn_cast<PHINode>(*UI)) {
|
||||
unsigned OperandNo = UI.getOperandNo();
|
||||
UserBB = P->getIncomingBlock(OperandNo/2);
|
||||
UserBB = P->getIncomingBlock(UI);
|
||||
}
|
||||
|
||||
// If the user is in the loop, don't rewrite it!
|
||||
@@ -212,8 +211,7 @@ void LCSSA::getLoopValuesUsedOutsideLoop(Loop *L,
|
||||
++UI) {
|
||||
BasicBlock *UserBB = cast<Instruction>(*UI)->getParent();
|
||||
if (PHINode* p = dyn_cast<PHINode>(*UI)) {
|
||||
unsigned OperandNo = UI.getOperandNo();
|
||||
UserBB = p->getIncomingBlock(OperandNo/2);
|
||||
UserBB = p->getIncomingBlock(UI);
|
||||
}
|
||||
|
||||
if (*BB != UserBB && !inLoop(UserBB)) {
|
||||
|
Reference in New Issue
Block a user