[llvm] [llvm] Adding scalarization of `llvm.vector.insert` (PR #71614)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 7 18:18:17 PST 2023
================
@@ -766,6 +769,22 @@ SDValue DAGTypeLegalizer::ScalarizeVecOp_BITCAST(SDNode *N) {
N->getValueType(0), Elt);
}
+/// If the value to subvector is a vector that needs to be scalarized, it must
+/// be <1 x ty>. Return the element instead.
+SDValue DAGTypeLegalizer::ScalarizeVecOp_INSERT_SUBVECTOR(SDNode *N,
+ unsigned OpNo) {
+ // If the destination vector is unary, we can just return the source vector
+ auto Src = GetScalarizedVector(N->getOperand(1));
+ if (OpNo == 0) {
----------------
arsenm wrote:
Result types are always legalized first and need to update the first operand along with them. You could try just asserting OpNo == 1
https://github.com/llvm/llvm-project/pull/71614
More information about the llvm-commits
mailing list