diff options
author | Chris Lattner <sabre@nondot.org> | 2007-07-16 04:15:34 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-07-16 04:15:34 +0000 |
commit | cb7122bb7d6f8191904c3d6e646bffc0282afa68 (patch) | |
tree | d0d85f42e841faf7bac935b6431b38c92aa4aeab | |
parent | e2ece3f479765eaccbb6480bfe7840de43063670 (diff) |
Repair a regression in Transforms/InstCombine/mul.ll that Reid noticed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@39896 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Transforms/Scalar/InstructionCombining.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp index f5a85751ea..77cb18584f 100644 --- a/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/lib/Transforms/Scalar/InstructionCombining.cpp @@ -2286,9 +2286,22 @@ static bool isSignBitCheck(ICmpInst::Predicate pred, ConstantInt *RHS, case ICmpInst::ICMP_SLT: // True if LHS s< 0 TrueIfSigned = true; return RHS->isZero(); + case ICmpInst::ICMP_SLE: // True if LHS s<= RHS and RHS == -1 + TrueIfSigned = true; + return RHS->isAllOnesValue(); case ICmpInst::ICMP_SGT: // True if LHS s> -1 TrueIfSigned = false; return RHS->isAllOnesValue(); + case ICmpInst::ICMP_UGT: + // True if LHS u> RHS and RHS == high-bit-mask - 1 + TrueIfSigned = true; + return RHS->getValue() == + APInt::getSignedMaxValue(RHS->getType()->getPrimitiveSizeInBits()); + case ICmpInst::ICMP_UGE: + // True if LHS u>= RHS and RHS == high-bit-mask (2^7, 2^15, 2^31, etc) + TrueIfSigned = true; + return RHS->getValue() == + APInt::getSignBit(RHS->getType()->getPrimitiveSizeInBits()); default: return false; } |