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

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 7 17:18:31 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) {
+    return Src;
+  }
+
+  auto dest = N->getOperand(0);
----------------
topperc wrote:

Capitalize all variable names.

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


More information about the llvm-commits mailing list