diff options
author | Evan Cheng <evan.cheng@apple.com> | 2009-04-22 22:45:37 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2009-04-22 22:45:37 +0000 |
commit | 1abe64663e0865cf9bdc23de734df49acea2b0d4 (patch) | |
tree | 8cf2fb3ad9733301ea675367b367846a4f83d4ba /lib/Transforms/Scalar | |
parent | 5654613a013b94a92f9ed65e1a2f34e0a8d9cfdf (diff) | |
download | external_llvm-1abe64663e0865cf9bdc23de734df49acea2b0d4.zip external_llvm-1abe64663e0865cf9bdc23de734df49acea2b0d4.tar.gz external_llvm-1abe64663e0865cf9bdc23de734df49acea2b0d4.tar.bz2 |
Avoid deferencing use_begin() if value does not have a use.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69836 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar')
-rw-r--r-- | lib/Transforms/Scalar/IndVarSimplify.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/Transforms/Scalar/IndVarSimplify.cpp b/lib/Transforms/Scalar/IndVarSimplify.cpp index 3e944d3..b1cde41 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(); |