[llvm] [InstCombine] Explicitly set disjoint flag when converting xor to or. (PR #74229)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Sun Dec 3 00:35:21 PST 2023
================
@@ -4462,8 +4462,11 @@ Instruction *InstCombinerImpl::visitXor(BinaryOperator &I) {
Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1);
Value *M;
if (match(&I, m_c_Xor(m_c_And(m_Not(m_Value(M)), m_Value()),
- m_c_And(m_Deferred(M), m_Value()))))
- return BinaryOperator::CreateOr(Op0, Op1);
+ m_c_And(m_Deferred(M), m_Value())))) {
+ auto *Or = BinaryOperator::CreateOr(Op0, Op1);
----------------
nikic wrote:
We should add a `BinaryOperator::CreateDisjointOr` API, similar to how we have `CreateNUWAdd` and so on.
https://github.com/llvm/llvm-project/pull/74229
More information about the llvm-commits
mailing list