mirror of
https://github.com/RPCS3/llvm.git
synced 2026-01-31 01:25:19 +01:00
On SystemZ we need to provide a register save area of 160 bytes to any called function. This size needs to be added when allocating stack in the function prologue. However, it was not accounted for as part of MachineFrameInfo::getStackSize(); instead the back-end used a private routine getAllocatedStackSize(). This is OK for code-gen purposes, but it breaks other users of the getStackSize() routine, in particular it breaks the recently- added -stack-size-section feature. Fix this by updating the main stack size tracked by common code (in emitPrologue) instead of using the private routine. No change in code generation intended. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326610 91177308-0d34-0410-b5e6-96231b3b80d8
39 lines
857 B
LLVM
39 lines
857 B
LLVM
; RUN: llc < %s -mtriple=s390x-linux-gnu -stack-size-section | FileCheck %s
|
|
|
|
; CHECK-LABEL: func1:
|
|
; CHECK: .section .stack_sizes,"",@progbits
|
|
; CHECK-NEXT: .quad func1
|
|
; CHECK-NEXT: .byte 0
|
|
define void @func1(i32, i32) #0 {
|
|
ret void
|
|
}
|
|
|
|
; CHECK-LABEL: func2:
|
|
; CHECK: .section .stack_sizes,"",@progbits
|
|
; CHECK-NEXT: .quad func2
|
|
; CHECK-NEXT: .ascii "\250\001"
|
|
define void @func2(i32, i32) #0 {
|
|
alloca i32, align 4
|
|
alloca i32, align 4
|
|
ret void
|
|
}
|
|
|
|
; CHECK-LABEL: func3:
|
|
; CHECK: .section .stack_sizes,"",@progbits
|
|
; CHECK-NEXT: .quad func3
|
|
; CHECK-NEXT: .ascii "\250\001"
|
|
define void @func3() #0 {
|
|
alloca i32, align 4
|
|
call void @func1(i32 1, i32 2)
|
|
ret void
|
|
}
|
|
|
|
; CHECK-LABEL: dynalloc:
|
|
; CHECK-NOT: .section .stack_sizes
|
|
define void @dynalloc(i32 %N) #0 {
|
|
alloca i32, i32 %N
|
|
ret void
|
|
}
|
|
|
|
attributes #0 = { "no-frame-pointer-elim"="true" }
|