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

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 8 09:21:49 PST 2022


craig.topper added inline comments.


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


================
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()) {
----------------
What about mul by positive 1 or 0?


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