Skip to content

Commit 9c0e45d

Browse files
authored
[SystemZ] Use VT (not ArgVT) for SlotVT in LowerCall(). (#82475)
When an integer argument is promoted and *not* split (like i72 -> i128 on a new machine with vector support), the SlotVT should be i128, which is stored in VT - not ArgVT. Fixes #81417
1 parent 7318585 commit 9c0e45d

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

llvm/lib/Target/SystemZ/SystemZISelLowering.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1923,7 +1923,7 @@ SystemZTargetLowering::LowerCall(CallLoweringInfo &CLI,
19231923
unsigned N = getNumRegistersForCallingConv(Ctx, CLI.CallConv, OrigArgVT);
19241924
SlotVT = EVT::getIntegerVT(Ctx, PartVT.getSizeInBits() * N);
19251925
} else {
1926-
SlotVT = Outs[I].ArgVT;
1926+
SlotVT = Outs[I].VT;
19271927
}
19281928
SDValue SpillSlot = DAG.CreateStackTemporary(SlotVT);
19291929
int FI = cast<FrameIndexSDNode>(SpillSlot)->getIndex();

llvm/test/CodeGen/SystemZ/frame-29.ll

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
; RUN: llc %s -o - -mtriple=s390x-linux-gnu -mcpu=z16 -print-after=finalize-isel 2>&1 | FileCheck %s
2+
;
3+
; Test that the correct space is allocated for the outgoing stack argument.
4+
5+
declare void @bar(i72 %Arg);
6+
7+
define void @foo() {
8+
; CHECK-LABEL: # Machine code for function foo: IsSSA, TracksLiveness
9+
; CHECK-NEXT: Frame Objects:
10+
; CHECK-NEXT: fi#0: size=1, align=2, at location [SP]
11+
; CHECK-NEXT: fi#1: size=16, align=8, at location [SP]
12+
13+
; CHECK-LABEL: foo:
14+
; CHECK: aghi %r15, -184
15+
%1 = alloca i8, align 2
16+
tail call fastcc void @bar(i72 2097168)
17+
ret void
18+
}

0 commit comments

Comments
 (0)