forked from OSchip/llvm-project
Fix IVUsers to avoid assuming that the loop has a unique backedge.
llvm-svn: 86161
This commit is contained in:
parent
885c46e387
commit
2267f8aa72
|
@ -151,6 +151,8 @@ static bool IVUseShouldUsePostIncValue(Instruction *User, Instruction *IV,
|
|||
if (L->contains(User->getParent())) return false;
|
||||
|
||||
BasicBlock *LatchBlock = L->getLoopLatch();
|
||||
if (!LatchBlock)
|
||||
return false;
|
||||
|
||||
// Ok, the user is outside of the loop. If it is dominated by the latch
|
||||
// block, use the post-inc value.
|
||||
|
|
Loading…
Reference in New Issue