diff options
author | Craig Topper <craig.topper@intel.com> | 2017-08-02 20:30:27 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@intel.com> | 2017-08-02 20:30:27 +0000 |
commit | 4068e4eec5c63b8ee1dfc92c6c74c9c12f4a592c (patch) | |
tree | 54b6f5f5043d483e268bfd8436b93f0e3c67a25f | |
parent | c9da8f0f64671557f8f29af01a32f22878cfdaa9 (diff) | |
download | bcm5719-llvm-4068e4eec5c63b8ee1dfc92c6c74c9c12f4a592c.tar.gz bcm5719-llvm-4068e4eec5c63b8ee1dfc92c6c74c9c12f4a592c.zip |
[InstCombine] Remove explicit code for folding (xor(zext(cmp)), 1) and (xor(sext(cmp)), -1) to ext(!cmp).
As far as I can tell this should be handled by foldCastedBitwiseLogic which is called later in visitXor.
Differential Revision: https://reviews.llvm.org/D36214
llvm-svn: 309882
-rw-r--r-- | llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp b/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp index 87678f3777c..62a73cca4b7 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp @@ -2439,21 +2439,6 @@ Instruction *InstCombiner::visitXor(BinaryOperator &I) { } if (ConstantInt *RHSC = dyn_cast<ConstantInt>(Op1)) { - // fold (xor(zext(cmp)), 1) and (xor(sext(cmp)), -1) to ext(!cmp). - if (CastInst *Op0C = dyn_cast<CastInst>(Op0)) { - if (CmpInst *CI = dyn_cast<CmpInst>(Op0C->getOperand(0))) { - if (CI->hasOneUse() && Op0C->hasOneUse()) { - Instruction::CastOps Opcode = Op0C->getOpcode(); - if ((Opcode == Instruction::ZExt || Opcode == Instruction::SExt) && - (RHSC == ConstantExpr::getCast(Opcode, Builder.getTrue(), - Op0C->getDestTy()))) { - CI->setPredicate(CI->getInversePredicate()); - return CastInst::Create(Opcode, CI, Op0C->getType()); - } - } - } - } - if (BinaryOperator *Op0I = dyn_cast<BinaryOperator>(Op0)) { // ~(c-X) == X-c-1 == X+(-c-1) if (Op0I->getOpcode() == Instruction::Sub && RHSC->isMinusOne()) |