aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/IVUsers.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-11-05 19:41:37 +0000
committerDan Gohman <gohman@apple.com>2009-11-05 19:41:37 +0000
commita6a4aaefeea8622e022723f27b7e845997b81f64 (patch)
tree9aa092d044982f00e5a7c46c90e2af511f4ced6e /lib/Analysis/IVUsers.cpp
parent6890584ab16d425865cb4b833fd809313d28e566 (diff)
Fix IVUsers to avoid assuming that the loop has a unique backedge.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86161 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/IVUsers.cpp')
-rw-r--r--lib/Analysis/IVUsers.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/Analysis/IVUsers.cpp b/lib/Analysis/IVUsers.cpp
index 543e017fc9..20b69f2a7c 100644
--- a/lib/Analysis/IVUsers.cpp
+++ b/lib/Analysis/IVUsers.cpp
@@ -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.