[llvm] r288706 - GlobalISel: handle 1-element aggregates during ABI lowering.

Tim Northover via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 5 13:25:34 PST 2016


Author: tnorthover
Date: Mon Dec  5 15:25:33 2016
New Revision: 288706

URL: http://llvm.org/viewvc/llvm-project?rev=288706&view=rev
Log:
GlobalISel: handle 1-element aggregates during ABI lowering.

Modified:
    llvm/trunk/lib/Target/AArch64/AArch64CallLowering.cpp
    llvm/trunk/test/CodeGen/AArch64/GlobalISel/arm64-callingconv.ll

Modified: llvm/trunk/lib/Target/AArch64/AArch64CallLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AArch64CallLowering.cpp?rev=288706&r1=288705&r2=288706&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AArch64/AArch64CallLowering.cpp (original)
+++ llvm/trunk/lib/Target/AArch64/AArch64CallLowering.cpp Mon Dec  5 15:25:33 2016
@@ -168,8 +168,10 @@ void AArch64CallLowering::splitToValueTy
   ComputeValueVTs(TLI, DL, OrigArg.Ty, SplitVTs, &Offsets, 0);
 
   if (SplitVTs.size() == 1) {
-    // No splitting to do, just forward the input directly.
-    SplitArgs.push_back(OrigArg);
+    // No splitting to do, but we want to replace the original type (e.g. [1 x
+    // double] -> double).
+    SplitArgs.emplace_back(OrigArg.Reg, SplitVTs[0].getTypeForEVT(Ctx),
+                           OrigArg.Flags);
     return;
   }
 

Modified: llvm/trunk/test/CodeGen/AArch64/GlobalISel/arm64-callingconv.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AArch64/GlobalISel/arm64-callingconv.ll?rev=288706&r1=288705&r2=288706&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/AArch64/GlobalISel/arm64-callingconv.ll (original)
+++ llvm/trunk/test/CodeGen/AArch64/GlobalISel/arm64-callingconv.ll Mon Dec  5 15:25:33 2016
@@ -49,3 +49,10 @@ define i8* @args_ptrs(i8* %x0, i16* %x1,
                       [3 x float]* %x4, double* %x5, i8* %x6, i8* %x7) {
   ret i8* %x0
 }
+
+; CHECK-LABEL: name: args_arr
+; CHECK: %[[ARG0:[0-9]+]](s64) = COPY %d0
+; CHECK: %d0 = COPY %[[ARG0]]
+define [1 x double] @args_arr([1 x double] %d0) {
+  ret [1 x double] %d0
+}




More information about the llvm-commits mailing list