[PATCH] D110059: [SelectionDAG] Add PromoteIntOp_INSERT_SUBVECTOR.

Sander de Smalen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 21 02:58:22 PDT 2021


sdesmalen added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp:5089
+  SDValue Idx = N->getOperand(2);
+  EVT PromVT = V0.getValueType().changeVectorElementType(
+      V1.getValueType().getVectorElementType());
----------------
craig.topper wrote:
> I have a bit of distrust for changeVectorElementType. If V0.getValueType() is representable as an MVT, but the promoted type isn't, it will fail. It branches a between an MVT code path and EVT path internally. The MVT path would require an LLVMContext to produce an EVT which it can't get so it will assert.
That's a good point, we should probably change the interface by requiring a Context and then calling getVectorVT in it's implementation, which handles the case of 'Simple' vs 'Extended' correctly. However, that is a big change which is separate to this patch, so I'll just use getVectorVT for now.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D110059



More information about the llvm-commits mailing list