[PATCH] D91362: [SelectionDAG] Add llvm.vector.{extract,insert} intrinsics
Paul Walker via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 17 10:40:07 PST 2020
paulwalker-arm added inline comments.
================
Comment at: llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp:6898-6899
+
+ SDValue SubVec = getValue(I.getOperand(0));
+ SDValue Vec = getValue(I.getOperand(1));
+ SDValue Index = getValue(I.getOperand(2));
----------------
These look reversed to me. The operand order should match that used by the ISD node.
================
Comment at: llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp:6912-6915
+ Type *ElementTy = I.getOperand(0)->getType()->getScalarType();
+ unsigned VecWidth =
+ Vec.getValueType().getVectorElementCount().getKnownMinValue();
+ EVT ResultVT = EVT::getEVT(FixedVectorType::get(ElementTy, VecWidth));
----------------
The result type for both extract and insert should be based on the intrinsic's return type. Something like `EVT VT = TLI.getValueType(DAG.getDataLayout(), I.getType())`
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D91362/new/
https://reviews.llvm.org/D91362
More information about the llvm-commits
mailing list