aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Analysis
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-06-17 01:22:39 +0000
committerDan Gohman <gohman@apple.com>2009-06-17 01:22:39 +0000
commite49ae43f045ef3be584a5d1440379563b6f07ff1 (patch)
tree4e1805da4c29f4aa2e122d8da92dbe272d2bdad9 /lib/Analysis
parent6d1a7bc8baabd7752a219128a7dd88004d4dc010 (diff)
downloadexternal_llvm-e49ae43f045ef3be584a5d1440379563b6f07ff1.zip
external_llvm-e49ae43f045ef3be584a5d1440379563b6f07ff1.tar.gz
external_llvm-e49ae43f045ef3be584a5d1440379563b6f07ff1.tar.bz2
Fix ScalarEvolution's Xor handling to not assume that an And
that gets recognized with a SCEVZeroExtendExpr must be an And with a low-bits mask. With r73540, this is no longer the case. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73594 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis')
-rw-r--r--lib/Analysis/ScalarEvolution.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/Analysis/ScalarEvolution.cpp b/lib/Analysis/ScalarEvolution.cpp
index 3731fdf..2546e81 100644
--- a/lib/Analysis/ScalarEvolution.cpp
+++ b/lib/Analysis/ScalarEvolution.cpp
@@ -2453,9 +2453,12 @@ SCEVHandle ScalarEvolution::createSCEV(Value *V) {
if (BO->getOpcode() == Instruction::And &&
LCI->getValue() == CI->getValue())
if (const SCEVZeroExtendExpr *Z =
- dyn_cast<SCEVZeroExtendExpr>(getSCEV(U->getOperand(0))))
- return getZeroExtendExpr(getNotSCEV(Z->getOperand()),
- U->getType());
+ dyn_cast<SCEVZeroExtendExpr>(getSCEV(U->getOperand(0)))) {
+ SCEVHandle ZO = Z->getOperand();
+ if (APIntOps::isMask(getTypeSizeInBits(ZO->getType()),
+ CI->getValue()))
+ return getZeroExtendExpr(getNotSCEV(ZO), U->getType());
+ }
}
break;