diff options
| author | Chris Lattner <sabre@nondot.org> | 2007-11-22 23:47:13 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2007-11-22 23:47:13 +0000 |
| commit | eec8b9a7d6630d45985e72f5fa396b48ba490d68 (patch) | |
| tree | 6c2fc28410f640eb5c4a35bea2036ac09d2481e9 /lib/Transforms | |
| parent | c2bfadb9df4e5d580d1cbcaa45206f0ec63422d0 (diff) | |
Fix PR1817.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44284 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
| -rw-r--r-- | lib/Transforms/Scalar/InstructionCombining.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp index e8cd86778a..c8df412864 100644 --- a/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/lib/Transforms/Scalar/InstructionCombining.cpp @@ -3463,7 +3463,12 @@ Instruction *InstCombiner::visitAnd(BinaryOperator &I) { LHSCC != ICmpInst::ICMP_UGE && LHSCC != ICmpInst::ICMP_ULE && RHSCC != ICmpInst::ICMP_UGE && RHSCC != ICmpInst::ICMP_ULE && LHSCC != ICmpInst::ICMP_SGE && LHSCC != ICmpInst::ICMP_SLE && - RHSCC != ICmpInst::ICMP_SGE && RHSCC != ICmpInst::ICMP_SLE) { + RHSCC != ICmpInst::ICMP_SGE && RHSCC != ICmpInst::ICMP_SLE && + + // Don't try to fold ICMP_SLT + ICMP_ULT. + (ICmpInst::isEquality(LHSCC) || ICmpInst::isEquality(RHSCC) || + ICmpInst::isSignedPredicate(LHSCC) == + ICmpInst::isSignedPredicate(RHSCC))) { // Ensure that the larger constant is on the RHS. ICmpInst::Predicate GT = ICmpInst::isSignedPredicate(LHSCC) ? ICmpInst::ICMP_SGT : ICmpInst::ICMP_UGT; |
