summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2009-04-22 22:45:37 +0000
committerEvan Cheng <evan.cheng@apple.com>2009-04-22 22:45:37 +0000
commitcbfe9df0966e333d78b2eb972171cd00856f45f0 (patch)
tree6936703a6dfa887827a12a594a7a2ecf16dae293 /llvm/lib/Transforms
parenta57c3abf3709f7849154adf78d13cb849cd7e4c2 (diff)
downloadbcm5719-llvm-cbfe9df0966e333d78b2eb972171cd00856f45f0.tar.gz
bcm5719-llvm-cbfe9df0966e333d78b2eb972171cd00856f45f0.zip
Avoid deferencing use_begin() if value does not have a use.
llvm-svn: 69836
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Scalar/IndVarSimplify.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp b/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
index 3e944d3857a..b1cde4177bf 100644
--- a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
+++ b/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
@@ -806,6 +806,7 @@ bool IndVarSimplify::runOnLoop(Loop *L, LPPassManager &LPM) {
// (RHS doesn't have to be constant. There should be a better approach
// than bottom-up pattern matching for this...)
if (UInst && UInst->getOpcode()==Instruction::And &&
+ !UInst->use_empty() &&
allUsesAreSameTyped(Instruction::ZExt, UInst) &&
isa<ConstantInt>(UInst->getOperand(1))) {
uint64_t newBitSize = LargestType->getPrimitiveSizeInBits();
OpenPOWER on IntegriCloud