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

Yingwei Zheng via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 11 09:49:37 PDT 2024


================
@@ -198,6 +198,22 @@ Instruction *InstCombinerImpl::visitMul(BinaryOperator &I) {
   if (SimplifyAssociativeOrCommutative(I))
     return &I;
 
+  // mul (sext (icmp eq x, 0)), x -> 0
----------------
dtcxzyw wrote:

Example: https://github.com/llvm/llvm-project/blob/9a9aa41dea83039154601082b1aa2c56e35a5a17/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp#L444-L449

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


More information about the llvm-commits mailing list