diff options
Diffstat (limited to 'lib/Analysis/ValueTracking.cpp')
-rw-r--r-- | lib/Analysis/ValueTracking.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Analysis/ValueTracking.cpp b/lib/Analysis/ValueTracking.cpp index b4c9884a20..cf20e07040 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(); |