[PATCH] D132658: [InstCombine] Distributive or+mul with const operand

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 28 09:22:42 PDT 2022


spatel added a comment.

Please pre-commit the baseline tests. If something is not transforming, you can add a comment in this patch to make it clear that it is a negative test or TODO item.



================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp:234
       // C1*MulC simplifies to a tidier constant.
       Value *NewC = Builder.CreateMul(C1, MulC);
       auto *BOp0 = cast<BinaryOperator>(Op0);
----------------
Is there a reason to not use the more direct ConstExpr::getMul() API and make it explicit that NewC is a Constant *?


================
Comment at: llvm/test/Transforms/InstCombine/mul.ll:746
+;
+  %shl = shl nuw <2 x i32> %v1, <i32 2, i32 undef>
+  %add = or <2 x i32> %shl, <i32 3, i32 undef>
----------------
Replace "undef" with "poison" in this test - we are transitioning away from undef in IR.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D132658/new/

https://reviews.llvm.org/D132658



More information about the llvm-commits mailing list