From: Tim Northover Date: Mon, 5 Dec 2016 21:25:33 +0000 (+0000) Subject: GlobalISel: handle 1-element aggregates during ABI lowering. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d1fd383b281ea6c4f645b28178066839eace0b37;p=platform%2Fupstream%2Fllvm.git GlobalISel: handle 1-element aggregates during ABI lowering. llvm-svn: 288706 --- diff --git a/llvm/lib/Target/AArch64/AArch64CallLowering.cpp b/llvm/lib/Target/AArch64/AArch64CallLowering.cpp index 3d92942..d9dd658 100644 --- a/llvm/lib/Target/AArch64/AArch64CallLowering.cpp +++ b/llvm/lib/Target/AArch64/AArch64CallLowering.cpp @@ -168,8 +168,10 @@ void AArch64CallLowering::splitToValueTypes(const ArgInfo &OrigArg, 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; } diff --git a/llvm/test/CodeGen/AArch64/GlobalISel/arm64-callingconv.ll b/llvm/test/CodeGen/AArch64/GlobalISel/arm64-callingconv.ll index e2e91af..95b2ea2 100644 --- a/llvm/test/CodeGen/AArch64/GlobalISel/arm64-callingconv.ll +++ b/llvm/test/CodeGen/AArch64/GlobalISel/arm64-callingconv.ll @@ -49,3 +49,10 @@ define i8* @args_ptrs(i8* %x0, i16* %x1, <2 x i8>* %x2, {i8, i16, i32}* %x3, [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 +}