summaryrefslogtreecommitdiff
path: root/lib/Transforms/Scalar/IndVarSimplify.cpp
diff options
context:
space:
mode:
authorAndrew Trick <atrick@apple.com>2011-06-29 03:13:40 +0000
committerAndrew Trick <atrick@apple.com>2011-06-29 03:13:40 +0000
commit11745d4c0276ccb5c64f83d6954b54c8ff2aec98 (patch)
tree11be986620f4d7240e0e489bc6eeca6f44925ce3 /lib/Transforms/Scalar/IndVarSimplify.cpp
parent2c0cbce763a258ac58590a8ca3c28ff722093fef (diff)
downloadllvm-11745d4c0276ccb5c64f83d6954b54c8ff2aec98.tar.gz
llvm-11745d4c0276ccb5c64f83d6954b54c8ff2aec98.tar.bz2
llvm-11745d4c0276ccb5c64f83d6954b54c8ff2aec98.tar.xz
indvars -disable-iv-rewrite: just because SCEV ignores casts doesn't
mean they can be removed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134054 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/IndVarSimplify.cpp')
-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 8986dbb785..919da3587a 100644
--- a/lib/Transforms/Scalar/IndVarSimplify.cpp
+++ b/lib/Transforms/Scalar/IndVarSimplify.cpp
@@ -1007,6 +1007,7 @@ bool IndVarSimplify::EliminateIVUser(Instruction *UseInst,
// Eliminate any operation that SCEV can prove is an identity function.
if (!SE->isSCEVable(UseInst->getType()) ||
+ (UseInst->getType() != IVOperand->getType()) ||
(SE->getSCEV(UseInst) != SE->getSCEV(IVOperand)))
return false;