diff --git a/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp b/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp index d92586f7d05d0..3b85a6ac0371e 100644 --- a/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp +++ b/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp @@ -1923,7 +1923,7 @@ SystemZTargetLowering::LowerCall(CallLoweringInfo &CLI, unsigned N = getNumRegistersForCallingConv(Ctx, CLI.CallConv, OrigArgVT); SlotVT = EVT::getIntegerVT(Ctx, PartVT.getSizeInBits() * N); } else { - SlotVT = Outs[I].ArgVT; + SlotVT = Outs[I].VT; } SDValue SpillSlot = DAG.CreateStackTemporary(SlotVT); int FI = cast(SpillSlot)->getIndex(); diff --git a/llvm/test/CodeGen/SystemZ/frame-29.ll b/llvm/test/CodeGen/SystemZ/frame-29.ll new file mode 100644 index 0000000000000..6cc0d9e985e16 --- /dev/null +++ b/llvm/test/CodeGen/SystemZ/frame-29.ll @@ -0,0 +1,18 @@ +; RUN: llc %s -o - -mtriple=s390x-linux-gnu -mcpu=z16 -print-after=finalize-isel 2>&1 | FileCheck %s +; +; Test that the correct space is allocated for the outgoing stack argument. + +declare void @bar(i72 %Arg); + +define void @foo() { +; CHECK-LABEL: # Machine code for function foo: IsSSA, TracksLiveness +; CHECK-NEXT: Frame Objects: +; CHECK-NEXT: fi#0: size=1, align=2, at location [SP] +; CHECK-NEXT: fi#1: size=16, align=8, at location [SP] + +; CHECK-LABEL: foo: +; CHECK: aghi %r15, -184 + %1 = alloca i8, align 2 + tail call fastcc void @bar(i72 2097168) + ret void +}