17
17
; DEFAULT: .section .rodata.func_without_profile,"a",@progbits
18
18
; DEFAULT: .LJTI1_0:
19
19
; DEFAULT: .section .rodata.bar_prefix.bar,"a",@progbits
20
- ; DEFAULT: .LJTI2_0
21
-
22
- ; RUN: llc -mtriple=aarch64-unknown-linux-gnu -enable-split-machine-functions \
23
- ; RUN: -partition-static-data-sections=true -function-sections=true \
20
+ ; DEFAULT: .LJTI2_0
21
+
22
+ ; Test that section names are uniqufied by numbers but not function names with
23
+ ; {-function-sections, -unique-section-names=false}. Specifically, @foo jump
24
+ ; tables are emitted in two sections, one with unique ID 2 and the other with
25
+ ; unique ID 3.
26
+ ; RUN: llc -mtriple=aarch64-unknown-linux-gnu -partition-static-data-sections \
27
+ ; RUN: -function-sections -unique-section-names=false \
24
28
; RUN: -aarch64-enable-atomic-cfg-tidy=false -aarch64-min-jump-table-entries=2 \
25
- ; RUN: -unique-section-names=false %s -o - 2>&1 | FileCheck %s --check-prefixes=NUM,JT
29
+ ; RUN: %s -o - 2>&1 | FileCheck %s --check-prefixes=NUM,JT
26
30
27
- ; Section names will optionally have `.<func>` if -function-sections is enabled .
28
- ; RUN: llc -mtriple=aarch64-unknown-linux-gnu -enable-split-machine-functions \
29
- ; RUN: -partition-static-data- sections=true -function-sections=true \
31
+ ; Section names will optionally have `.<func>` with { -function-sections, -unique-section-names} .
32
+ ; RUN: llc -mtriple=aarch64-unknown-linux-gnu -partition-static-data-sections \
33
+ ; RUN: -function- sections -unique-section-names \
30
34
; RUN: -aarch64-enable-atomic-cfg-tidy=false -aarch64-min-jump-table-entries=2 \
31
35
; RUN: %s -o - 2>&1 | FileCheck %s --check-prefixes=FUNC,JT
32
36
33
- ; RUN: llc -mtriple=aarch64-unknown-linux-gnu -enable-split-machine-functions \
34
- ; RUN: -partition-static-data-sections=true -function-sections=false \
37
+ ; Test that section names won't have `.<func>` with -function-sections=false.
38
+ ; RUN: llc -mtriple=aarch64-unknown-linux-gnu -partition-static-data-sections \
39
+ ; RUN: -function-sections=false \
35
40
; RUN: -aarch64-enable-atomic-cfg-tidy=false -aarch64-min-jump-table-entries=2 \
36
41
; RUN: %s -o - 2>&1 | FileCheck %s --check-prefixes=FUNCLESS,JT
37
42
38
- ; A function's section prefix is used for all jump tables of this function.
39
- ; @foo is hot so its jump table data section has a hot prefix.
40
- ; NUM: .section .rodata.hot.,"a",@progbits,unique,2
41
- ; FUNC: .section .rodata.hot.foo,"a",@progbits
42
- ; FUNCLESS: .section .rodata.hot.,"a",@progbits
43
- ; JT: .LJTI0_0:
44
- ; JT: .LJTI0_1:
45
- ; JT: .LJTI0_2:
46
- ; JT: .LJTI0_3:
47
-
48
- ; func_without_profile doesn't have profiles, so its jumptable doesn't have
49
- ; hotness-based prefix.
50
- ; NUM: .section .rodata,"a",@progbits,unique,4
51
- ; FUNC: .section .rodata.func_without_profile,"a",@progbits
52
- ; FUNCLESS: .section .rodata,"a",@progbits
53
- ; JT: .LJTI1_0:
54
-
55
- ; @bar doesn't have profile information and it has a section prefix.
56
- ; Tests that its jump tables are placed in sections with function prefixes.
57
- ; NUM: .section .rodata.bar_prefix.,"a",@progbits,unique,
58
- ; FUNC: .section .rodata.bar_prefix.bar
59
- ; FUNCLESS: .section .rodata.bar_prefix.,"a"
60
- ; JT: .LJTI2_0
61
-
62
43
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
63
44
target triple = "aarch64-unknown-linux-gnu"
64
45
@@ -71,6 +52,19 @@ target triple = "aarch64-unknown-linux-gnu"
71
52
@default = private constant [8 x i8 ] c "default\00 "
72
53
@jt3 = private constant [4 x i8 ] c "jt3\00 "
73
54
55
+ ; A function's section prefix is used for all jump tables of this function.
56
+ ; @foo is hot so its jump table data section has a hot prefix.
57
+ ; NUM: .section .rodata.hot.,"a",@progbits,unique,2
58
+ ; FUNC: .section .rodata.hot.foo,"a",@progbits
59
+ ; FUNCLESS: .section .rodata.hot.,"a",@progbits
60
+ ; JT: .LJTI0_0:
61
+ ; JT: .LJTI0_2:
62
+ ; NUM: .section .rodata.hot.,"a",@progbits,unique,3
63
+ ; FUNC-NOT: .section .rodata.hot.foo
64
+ ; FUNCLESS-NOT: .section .rodata.hot.,"a",@progbits
65
+ ; JT: .LJTI0_1:
66
+ ; JT: .LJTI0_3:
67
+
74
68
; jt0 and jt2 are hot. jt1 and jt3 are cold.
75
69
define i32 @foo (i32 %num ) !prof !13 {
76
70
entry:
@@ -168,6 +162,12 @@ return:
168
162
ret i32 %mod3
169
163
}
170
164
165
+ ; @func_without_profile doesn't have profiles, so its jumptable doesn't have
166
+ ; hotness-based prefix.
167
+ ; NUM: .section .rodata,"a",@progbits,unique,5
168
+ ; FUNC: .section .rodata.func_without_profile,"a",@progbits
169
+ ; FUNCLESS: .section .rodata,"a",@progbits
170
+ ; JT: .LJTI1_0:
171
171
define void @func_without_profile (i32 %num ) {
172
172
entry:
173
173
switch i32 %num , label %sw.default [
@@ -191,6 +191,12 @@ sw.epilog:
191
191
ret void
192
192
}
193
193
194
+ ; @bar doesn't have profile information and it has a section prefix.
195
+ ; Tests that its jump tables are placed in sections with function prefixes.
196
+ ; NUM: .section .rodata.bar_prefix.,"a",@progbits,unique,7
197
+ ; FUNC: .section .rodata.bar_prefix.bar
198
+ ; FUNCLESS: .section .rodata.bar_prefix.,"a"
199
+ ; JT: .LJTI2_0
194
200
define void @bar (i32 %num ) !section_prefix !20 {
195
201
entry:
196
202
switch i32 %num , label %sw.default [
0 commit comments