[llvm] [InstCombine] Combine or-disjoint (and->mul), (and->mul) to and->mul (PR #136013)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Wed May 21 13:23:55 PDT 2025


================
@@ -3641,6 +3707,22 @@ Instruction *InstCombinerImpl::visitOr(BinaryOperator &I) {
             foldAddLikeCommutative(I.getOperand(1), I.getOperand(0),
                                    /*NSW=*/true, /*NUW=*/true))
       return R;
+
+    auto Decomp0 = matchBitmaskMul(I.getOperand(0));
+    auto Decomp1 = matchBitmaskMul(I.getOperand(1));
----------------
arsenm wrote:

Avoid the second call if the first already failed (and try op 1 first)

https://github.com/llvm/llvm-project/pull/136013


More information about the llvm-commits mailing list