[llvm-branch-commits] [llvm] [AArch64][GlobalISel] Add support for lowering trunc stores of vector bools. (PR #121169)

Amara Emerson via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Fri Dec 27 17:17:02 PST 2024


================
@@ -4142,9 +4142,40 @@ LegalizerHelper::LegalizeResult LegalizerHelper::lowerStore(GStore &StoreMI) {
   }
 
   if (MemTy.isVector()) {
-    // TODO: Handle vector trunc stores
-    if (MemTy != SrcTy)
+    LLT MemScalarTy = MemTy.getElementType();
+    if (MemTy != SrcTy) {
+      if (!MemScalarTy.isByteSized()) {
+        // We need to build an integer scalar of the vector bit pattern.
+        // It's not legal for us to add padding when storing a vector.
+        unsigned NumBits = MemTy.getSizeInBits();
+        LLT IntTy = LLT::scalar(NumBits);
+        auto CurrVal = MIRBuilder.buildConstant(IntTy, 0);
+        LLT IdxTy = getLLTForMVT(TLI.getVectorIdxTy(MF.getDataLayout()));
----------------
aemerson wrote:

I'd rather make that change separately since it'll make sense otherwise convert all of our existing uses of the MVT version over.

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


More information about the llvm-branch-commits mailing list