15
15
; RUN: opt -passes='memprof-use<profile-filename=memprof.profdata>' -memprof-annotate-static-data-prefix \
16
16
; RUN: -debug-only=memprof -S input.ll -o - 2>&1 | FileCheck %s --check-prefixes=LOG,PREFIX
17
17
18
-
19
18
; RUN: opt -passes='memprof-use<profile-filename=memprof.profdata>' -memprof-annotate-static-data-prefix=false \
20
19
; RUN: -debug-only=memprof -S input.ll -o - 2>&1 | FileCheck %s --implicit-check-not="section_prefix"
21
20
24
23
; LOG: Global variable var2.llvm.125 is annotated as hot
25
24
; LOG: Global variable bar is not annotated
26
25
; LOG: Global variable foo is annotated as unlikely
26
+ ; LOG: Global variable var3 has explicit section name. Skip annotating.
27
+ ; LOG: Global variable var4 has explicit section name. Skip annotating.
27
28
28
29
;; String literals are not annotated.
29
30
; PREFIX: @.str = unnamed_addr constant [5 x i8] c"abcde"
42
43
;; @foo is unlikely.
43
44
; PREFIX-NEXT: @foo = global i8 2, !section_prefix !1
44
45
46
+ ; PREFIX-NEXT: @var3 = constant [2 x i32] [i32 12345, i32 6789], section "sec1"
47
+ ; PREFIX-NEXT: @var4 = constant [1 x i64] [i64 98765] #0
45
48
49
+ ; PREFIX: attributes #0 = { "rodata-section"="sec2" }
46
50
47
51
; PREFIX: !0 = !{!"section_prefix", !"hot"}
48
52
; PREFIX-NEXT: !1 = !{!"section_prefix", !"unlikely"}
@@ -87,6 +91,8 @@ target triple = "x86_64-unknown-linux-gnu"
87
91
@var2.llvm.125 = global i64 0
88
92
@bar = global i16 3
89
93
@foo = global i8 2
94
+ @var3 = constant [2 x i32 ][i32 12345 , i32 6789 ], section "sec1"
95
+ @var4 = constant [1 x i64 ][i64 98765 ] #0
90
96
91
97
define i32 @func () {
92
98
%a = load i32 , ptr @var1
@@ -96,6 +102,9 @@ define i32 @func() {
96
102
}
97
103
98
104
declare i32 @func_taking_arbitrary_param (...)
105
+
106
+ attributes #0 = { "rodata-section" ="sec2" }
107
+
99
108
;--- funcless-module.ll
100
109
101
110
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"
@@ -106,4 +115,7 @@ target triple = "x86_64-unknown-linux-gnu"
106
115
@var2.llvm.125 = global i64 0
107
116
@bar = global i16 3
108
117
@foo = global i8 2
118
+ @var3 = constant [2 x i32 ][i32 12345 , i32 6789 ], section "sec1"
119
+ @var4 = constant [1 x i64 ][i64 98765 ] #0
109
120
121
+ attributes #0 = { "rodata-section" ="sec2" }
0 commit comments