summaryrefslogtreecommitdiffstats
path: root/llvm/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
commitb50f5a46e06e82bd7b0f2f63e4eae1d7b6ea6868 (patch)
tree0d74b3727d8e59c0fd6a1d909cd283c9e3c70a36 /llvm/lib/Analysis
parent722848dc0186b66568d8bb0c2b5c41360d8a0162 (diff)
downloadbcm5719-llvm-b50f5a46e06e82bd7b0f2f63e4eae1d7b6ea6868.tar.gz
bcm5719-llvm-b50f5a46e06e82bd7b0f2f63e4eae1d7b6ea6868.zip
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. llvm-svn: 73594
Diffstat (limited to 'llvm/lib/Analysis')
-rw-r--r--llvm/lib/Analysis/ScalarEvolution.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp
index 3731fdfc712..2546e81952b 100644
--- a/llvm/lib/Analysis/ScalarEvolution.cpp
+++ b/llvm/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;
OpenPOWER on IntegriCloud