mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-25 04:02:41 +01:00
d23004c21c
With compilation fix. Original commit message: D39788 added a '.stack-size' section containing metadata on function stack sizes to output ELF files behind the new -stack-size-section flag. This change does following two things on top: 1) Imagine the case when there are -ffunction-sections flag given and there are text sections in COMDATs. The patch adds a '.stack-size' section into corresponding COMDAT group, so that linker will be able to eliminate them fast during resolving the COMDATs. 2) Patch sets a SHF_LINK_ORDER flag and links '.stack-size' with the corresponding .text. With that linker will be able to do -gc-sections on dead stack sizes sections. Differential revision: https://reviews.llvm.org/D46874 llvm-svn: 335336
33 lines
776 B
LLVM
33 lines
776 B
LLVM
; RUN: llc < %s -mtriple=armv7-linux -stack-size-section | FileCheck %s
|
|
|
|
; CHECK-LABEL: func1:
|
|
; CHECK-NEXT: .Lfunc_begin0:
|
|
; CHECK: .section .stack_sizes,"o",%progbits,.text,unique,0
|
|
; CHECK-NEXT: .long .Lfunc_begin0
|
|
; CHECK-NEXT: .byte 8
|
|
define void @func1(i32, i32) #0 {
|
|
alloca i32, align 4
|
|
alloca i32, align 4
|
|
ret void
|
|
}
|
|
|
|
; CHECK-LABEL: func2:
|
|
; CHECK-NEXT: .Lfunc_begin1:
|
|
; CHECK: .section .stack_sizes,"o",%progbits,.text,unique,0
|
|
; CHECK-NEXT: .long .Lfunc_begin1
|
|
; CHECK-NEXT: .byte 16
|
|
define void @func2() #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" }
|