[PATCH] D123112: [VP] Legalize the stride operand for EXPERIMENTAL_VP_STRIDED SDNodes

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 10 09:37:55 PDT 2022


craig.topper added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp:2242
+SDValue DAGTypeLegalizer::PromoteIntOp_VP_STRIDED(SDNode *N, unsigned OpNo) {
+  if (N->getOpcode() == ISD::EXPERIMENTAL_VP_STRIDED_LOAD)
+    assert(OpNo == 3 && "Unexpected operand for promotion");
----------------
frasercrmck wrote:
> Would this be at all nicer if it was a single `assert`? `assert((opc == load && opno == 3) || (opno == store && opno == 4))`? Having explicit if/else just filled with asserts is a little odd to me.
+1


================
Comment at: llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp:5037
+
+  SDValue Hi;
+  SmallVector<SDValue, 8> NewOps(N->op_begin(), N->op_end());
----------------
Probably worth a comment calling out that we drop the upper half.


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

https://reviews.llvm.org/D123112



More information about the llvm-commits mailing list