aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Analysis
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-08-18 04:28:19 +0000
committerChris Lattner <sabre@nondot.org>2010-08-18 04:28:19 +0000
commit4087563f497e3506dc63b4eee64a2c9b7cc45d7f (patch)
tree0b7b08dcecc5d39f7f317f28b9b45576d10b1f10 /lib/Analysis
parent03ad9dcb3ac11ef88d6dbbd9f8d63a118e446cb3 (diff)
downloadexternal_llvm-4087563f497e3506dc63b4eee64a2c9b7cc45d7f.zip
external_llvm-4087563f497e3506dc63b4eee64a2c9b7cc45d7f.tar.gz
external_llvm-4087563f497e3506dc63b4eee64a2c9b7cc45d7f.tar.bz2
fix PR7589: In brief:
gep P, (zext x) != gep P, (sext x) DecomposeGEPExpression was getting this wrong, confusing basicaa. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111352 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis')
-rw-r--r--lib/Analysis/ValueTracking.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Analysis/ValueTracking.cpp b/lib/Analysis/ValueTracking.cpp
index b4c9884..cf20e07 100644
--- a/lib/Analysis/ValueTracking.cpp
+++ b/lib/Analysis/ValueTracking.cpp
@@ -1018,9 +1018,9 @@ static Value *GetLinearExpression(Value *V, APInt &Scale, APInt &Offset,
}
}
- // Since clients don't care about the high bits of the value, just scales and
- // offsets, we can look through extensions.
- if (isa<SExtInst>(V) || isa<ZExtInst>(V)) {
+ // Since GEP indices are sign extended anyway, we don't care about the high
+ // bits of a sign extended value - just scales and offsets.
+ if (isa<SExtInst>(V)) {
Value *CastOp = cast<CastInst>(V)->getOperand(0);
unsigned OldWidth = Scale.getBitWidth();
unsigned SmallWidth = CastOp->getType()->getPrimitiveSizeInBits();