mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-05 13:26:55 +00:00
LSR: teach isSimplifiedLoopNest to handle PHI IVUsers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153132 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -148,7 +148,14 @@ bool IVUsers::AddUsersIfInteresting(Instruction *I,
|
||||
|
||||
// Only consider IVUsers that are dominated by simplified loop
|
||||
// headers. Otherwise, SCEVExpander will crash.
|
||||
if (!isSimplifiedLoopNest(User->getParent(), DT, LI, SimpleLoopNests))
|
||||
BasicBlock *UseBB = User->getParent();
|
||||
// A phi's use is live out of its predecessor block.
|
||||
if (PHINode *PHI = dyn_cast<PHINode>(User)) {
|
||||
unsigned OperandNo = UI.getOperandNo();
|
||||
unsigned ValNo = PHINode::getIncomingValueNumForOperand(OperandNo);
|
||||
UseBB = PHI->getIncomingBlock(ValNo);
|
||||
}
|
||||
if (!isSimplifiedLoopNest(UseBB, DT, LI, SimpleLoopNests))
|
||||
return false;
|
||||
|
||||
// Descend recursively, but not into PHI nodes outside the current loop.
|
||||
|
Reference in New Issue
Block a user