[PATCH] D153300: [AArch64][GlobalISel] IR translate support for a return instruction of type <1 x i8> or <1 x i16> when using GlobalISel.

niwin anto via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 19 13:33:48 PDT 2023


niwinanto marked an inline comment as done.
niwinanto added inline comments.


================
Comment at: llvm/lib/Target/AArch64/GISel/AArch64CallLowering.cpp:424-425
               }
-            } else if (NewLLT.getNumElements() == 2) {
-              // We need to pad a <1 x S> type to <2 x S>. Since we don't have
-              // <1 x S> vector types in GISel we use a build_vector instead
-              // of a vector merge/concat.
-              auto Undef = MIRBuilder.buildUndef({OldLLT});
+            } else if (NewLLT.getNumElements() >= 2 &&
+                       NewLLT.getNumElements() <= 8) {
+              // We need to pad a <1 x S> type to <2/4/8 x S>. Since we don't
----------------
arsenm wrote:
> This whole function is bad and I'd prefer to stop making the situation worse. Can you try switching to the helpers in MachineIRBuilder? e.g. buildPadVectorWithUndefElements
Thank you for this suggestion, there is already `buildPadVectorWithUndefElements` I did update it to accept scalar type.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D153300/new/

https://reviews.llvm.org/D153300



More information about the llvm-commits mailing list