[PATCH] D140069: [DAGCombiner] Scalarize vectorized loads that are splatted

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 22 02:10:21 PST 2022


RKSimon added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:22843
+
+  EVT VecVT = Shuf->getOperand(0).getValueType();
+  SDValue SplattedOp;
----------------
Cleaner to use Shuf->getValueType(0) - result/operands will have matching types in DAG.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:22848
+  else
+    SplattedOp = Shuf->getOperand(1);
+
----------------
Please check the operand numbers -
LHS (Op0) = 0 <= Idx < NumElts
RHS (Op1) = NumElts <= Idx < 2*NumElts


================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:22859
+  SDValue SplatIdx =
+      DAG.getConstant(Shuf->getSplatIndex(), SDLoc(Shuf), MVT::i32);
+  SDValue NewPtr =
----------------
Pull out repeated Shuf->getSplatIndex() calls


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D140069



More information about the llvm-commits mailing list