[llvm] [InstCombine] Canonicalize xor with disjoint ops to or disjoint (PR #133139)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 26 22:26:27 PDT 2025
================
@@ -4993,6 +4993,11 @@ Instruction *InstCombinerImpl::visitXor(BinaryOperator &I) {
if (Instruction *Abs = canonicalizeAbs(I, Builder))
return Abs;
+ if (KnownBits::haveNoCommonBitsSet(
+ computeKnownBits(I.getOperand(0), /*Depth=*/0, &I),
+ computeKnownBits(I.getOperand(1), /*Depth=*/0, &I)))
----------------
arsenm wrote:
Can try to short circuit the first operand query if the second is unknown
https://github.com/llvm/llvm-project/pull/133139
More information about the llvm-commits
mailing list