[llvm] [GlobalISel] Fix buildCopyFromRegs for split vectors (PR #77448)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 9 05:17:38 PST 2024


================
@@ -478,9 +478,43 @@ static void buildCopyFromRegs(MachineIRBuilder &B, ArrayRef<Register> OrigRegs,
   } else {
     // Vector was split, and elements promoted to a wider type.
     // FIXME: Should handle floating point promotions.
-    LLT BVType = LLT::fixed_vector(LLTy.getNumElements(), PartLLT);
-    auto BV = B.buildBuildVector(BVType, Regs);
-    B.buildTrunc(OrigRegs[0], BV);
+    unsigned NumElts = LLTy.getNumElements();
+    LLT BVType = LLT::fixed_vector(NumElts, PartLLT);
+
----------------
arsenm wrote:

Does MachineIRBuilder::buildPadVectorWithUndefElts or buildDeleteTrailingVectorElements help simplify this at all?

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


More information about the llvm-commits mailing list