[PATCH] D121187: [DAGCombiner][VP] Add DAGCombine for VP_MUL.

Jianjian Guan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 9 01:22:00 PST 2022


jacquesguan added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:22804
+
+  auto ConstValue1 = isConstOrConstSplat(N1);
+
----------------
craig.topper wrote:
> RKSimon wrote:
> > (style) Don't use auto unless the type is obvious (i.e. a cast<>)
> Don't call isConstOrConstSplat(N1) twice
Done.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:22806
+
+  // fold vp_mul X, (splat -1), Mask, EVL -> vp_sub (splat 0), X, Mask, EVL
+  if (ConstValue1 && ConstValue1->isAllOnes()) {
----------------
craig.topper wrote:
> What about mul by positive 1 or 0?
Done.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D121187



More information about the llvm-commits mailing list