[llvm] 074f7c2 - [InstCombine] Remove redundant fold (NFCI)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 12 00:55:02 PST 2024
Author: Nikita Popov
Date: 2024-02-12T09:54:32+01:00
New Revision: 074f7c2235a7d39f59f5c4d85b8fb87d3459b90d
URL: https://github.com/llvm/llvm-project/commit/074f7c2235a7d39f59f5c4d85b8fb87d3459b90d
DIFF: https://github.com/llvm/llvm-project/commit/074f7c2235a7d39f59f5c4d85b8fb87d3459b90d.diff
LOG: [InstCombine] Remove redundant fold (NFCI)
This has been subsumed by simplifyAndOrWithOpReplaced().
Added:
Modified:
llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp b/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
index a53eb39ad5b0e4..4465eb8992fbbf 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
@@ -3660,19 +3660,6 @@ Instruction *InstCombinerImpl::visitOr(BinaryOperator &I) {
}
}
- // A | ~(A | B) -> A | ~B
- // A | ~(A ^ B) -> A | ~B
- if (match(Op1, m_Not(m_Value(A))))
- if (BinaryOperator *B = dyn_cast<BinaryOperator>(A))
- if ((Op0 == B->getOperand(0) || Op0 == B->getOperand(1)) &&
- Op1->hasOneUse() && (B->getOpcode() == Instruction::Or ||
- B->getOpcode() == Instruction::Xor)) {
- Value *NotOp = Op0 == B->getOperand(0) ? B->getOperand(1) :
- B->getOperand(0);
- Value *Not = Builder.CreateNot(NotOp, NotOp->getName() + ".not");
- return BinaryOperator::CreateOr(Not, Op0);
- }
-
if (SwappedForXor)
std::swap(Op0, Op1);
More information about the llvm-commits
mailing list