[llvm] [llvm] Adding scalarization of `llvm.vector.insert` (PR #71614)

Rob Suderman via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 7 17:25:42 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) {
----------------
rsuderman wrote:

I am not certain, it would depend where the type propagation occurs. My assumption is that this could iteratively come from a previously operation now scalarized without the result type necessarily being updated (which is only an asumption). Do you have a suggestion for how to verify this?

https://github.com/llvm/llvm-project/pull/71614


More information about the llvm-commits mailing list