diff options
author | Sanjay Patel <spatel@rotateright.com> | 2016-08-04 17:48:04 +0000 |
---|---|---|
committer | Sanjay Patel <spatel@rotateright.com> | 2016-08-04 17:48:04 +0000 |
commit | bcaf6f39dd28ee563afb2719cd001d506de7ca2d (patch) | |
tree | 8db9bcb7084b56a94c357bb5a5c9626d50a16ecd /llvm/lib/Transforms | |
parent | 3dbce52c16959942229875b3b070c42a6ea7e56e (diff) | |
download | bcm5719-llvm-bcaf6f39dd28ee563afb2719cd001d506de7ca2d.tar.gz bcm5719-llvm-bcaf6f39dd28ee563afb2719cd001d506de7ca2d.zip |
[InstCombine] use m_APInt to allow icmp eq (op X, Y), C folds for splat constant vectors
I'm removing a misplaced pair of more specific folds from InstCombine in this patch as well,
so we know where those folds are happening in InstSimplify.
llvm-svn: 277738
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r-- | llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp | 11 |
1 files changed, 0 insertions, 11 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp index 4dc1bb0f83c..9cc7fe568b5 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp @@ -2277,14 +2277,8 @@ Instruction *InstCombiner::foldICmpEqualityWithConstant(ICmpInst &ICI) { } break; case Instruction::Or: - // If bits are being or'd in that are not present in the constant we - // are comparing against, then the comparison could never succeed! // FIXME: Vectors are excluded by ConstantInt. if (ConstantInt *BOC = dyn_cast<ConstantInt>(BOp1)) { - Constant *NotCI = ConstantExpr::getNot(RHS); - if (!ConstantExpr::getAnd(BOC, NotCI)->isNullValue()) - return replaceInstUsesWith(ICI, Builder->getInt1(isICMP_NE)); - // Comparing if all bits outside of a constant mask are set? // Replace (X | C) == -1 with (X & ~C) == ~C. // This removes the -1 constant. @@ -2299,11 +2293,6 @@ Instruction *InstCombiner::foldICmpEqualityWithConstant(ICmpInst &ICI) { case Instruction::And: // FIXME: Vectors are excluded by ConstantInt. if (ConstantInt *BOC = dyn_cast<ConstantInt>(BOp1)) { - // If bits are being compared against that are and'd out, then the - // comparison can never succeed! - if ((*RHSV & ~BOC->getValue()) != 0) - return replaceInstUsesWith(ICI, Builder->getInt1(isICMP_NE)); - // If we have ((X & C) == C), turn it into ((X & C) != 0). if (RHS == BOC && RHSV->isPowerOf2()) return new ICmpInst(isICMP_NE ? ICmpInst::ICMP_EQ : ICmpInst::ICMP_NE, |