aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Transforms')
-rw-r--r--lib/Transforms/Scalar/IndVarSimplify.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/Transforms/Scalar/IndVarSimplify.cpp b/lib/Transforms/Scalar/IndVarSimplify.cpp
index 3e944d3857..b1cde4177b 100644
--- a/lib/Transforms/Scalar/IndVarSimplify.cpp
+++ b/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();