[PATCH] D102501: [CodeGen] Add support for widening INSERT_SUBVECTOR operands

Fraser Cormack via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 17 03:59:50 PDT 2021


frasercrmck added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp:4839
+SDValue DAGTypeLegalizer::WidenVecOp_INSERT_SUBVECTOR(SDNode *N) {
+  ConstantSDNode *CstIdx = dyn_cast<ConstantSDNode>(N->getOperand(2));
+  bool IsZeroIdx = CstIdx && CstIdx->isNullValue();
----------------
david-arm wrote:
> frasercrmck wrote:
> > The index operand is required to be a constant. Perhaps we can be stricter here?
> Ah ok, you mean we can simply use cast<ConstantSDNode> here?
Yeah, then even simplified to `N->getConstantOperandVal(2) == 0`. There's precedent for that elsewhere so it sounds reasonable to me.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D102501



More information about the llvm-commits mailing list