[llvm] [InstCombine] Optimize x * !x to 0 for vector #84608 (PR #84792)

Yingwei Zheng via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 12 10:58:16 PDT 2024


================
@@ -198,6 +198,20 @@ Instruction *InstCombinerImpl::visitMul(BinaryOperator &I) {
   if (SimplifyAssociativeOrCommutative(I))
     return &I;
 
+  // mul (sext X)), Y -> select X, -Y, 0
----------------
dtcxzyw wrote:

Could you please move the logic after the following code? Then the regression should be fixed :)

https://github.com/llvm/llvm-project/blob/f1ca2a09671e4d4acc2bea362b39268ed7883b6d/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp#L423-L449

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


More information about the llvm-commits mailing list