diff options
Diffstat (limited to 'lib/Analysis/ValueTracking.cpp')
-rw-r--r-- | lib/Analysis/ValueTracking.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Analysis/ValueTracking.cpp b/lib/Analysis/ValueTracking.cpp index 33fb1e8cdc..6c33d2d508 100644 --- a/lib/Analysis/ValueTracking.cpp +++ b/lib/Analysis/ValueTracking.cpp @@ -431,7 +431,8 @@ void llvm::ComputeMaskedBits(Value *V, const APInt &Mask, } // Are we still trying to solve for the sign bit? - if (Mask.isNegative() && !KnownZero.isNegative() && !KnownOne.isNegative()){ + if (I->getOpcode() == Instruction::Add && + Mask.isNegative() && !KnownZero.isNegative() && !KnownOne.isNegative()){ OverflowingBinaryOperator *OBO = cast<OverflowingBinaryOperator>(I); if (OBO->hasNoSignedWrap()) { // Adding two positive numbers can't wrap into negative ... |