1
1
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 4
2
2
; RUN: opt < %s -passes='function(lower-allow-check)' -S | FileCheck %s --check-prefixes=NOPROFILE
3
- ; RUN: opt < %s -passes='function(lower-allow-check)' -lower-allow-check-random-rate=1 -S | FileCheck %s --check-prefixes=ALL
3
+ ; RUN: opt < %s -passes='function(lower-allow-check)' -lower-allow-check-random-rate=0 -S | FileCheck %s --check-prefixes=NONE
4
4
; RUN: opt < %s -passes='require<profile-summary>,function(lower-allow-check)' -lower-allow-check-percentile-cutoff-hot=990000 -S | FileCheck %s --check-prefixes=HOT99
5
5
; RUN: opt < %s -passes='require<profile-summary>,function(lower-allow-check)' -lower-allow-check-percentile-cutoff-hot=700000 -S | FileCheck %s --check-prefixes=HOT70
6
6
@@ -23,18 +23,18 @@ define dso_local noundef i32 @simple(ptr noundef readonly %0) {
23
23
; NOPROFILE-NEXT: [[TMP5:%.*]] = load i32, ptr [[TMP0]], align 4
24
24
; NOPROFILE-NEXT: ret i32 [[TMP5]]
25
25
;
26
- ; ALL -LABEL: define dso_local noundef i32 @simple(
27
- ; ALL -SAME: ptr noundef readonly [[TMP0:%.*]]) {
28
- ; ALL -NEXT: [[TMP2:%.*]] = icmp eq ptr [[TMP0]], null
29
- ; ALL -NEXT: [[HOT:%.*]] = xor i1 false, true
30
- ; ALL -NEXT: [[TMP6:%.*]] = or i1 [[TMP2]], [[HOT]]
31
- ; ALL -NEXT: br i1 [[TMP6]], label [[TMP3:%.*]], label [[TMP4:%.*]]
32
- ; ALL : 3:
33
- ; ALL -NEXT: tail call void @llvm.ubsantrap(i8 22)
34
- ; ALL -NEXT: unreachable
35
- ; ALL : 4:
36
- ; ALL -NEXT: [[TMP5:%.*]] = load i32, ptr [[TMP0]], align 4
37
- ; ALL -NEXT: ret i32 [[TMP5]]
26
+ ; NONE -LABEL: define dso_local noundef i32 @simple(
27
+ ; NONE -SAME: ptr noundef readonly [[TMP0:%.*]]) {
28
+ ; NONE -NEXT: [[TMP2:%.*]] = icmp eq ptr [[TMP0]], null
29
+ ; NONE -NEXT: [[HOT:%.*]] = xor i1 false, true
30
+ ; NONE -NEXT: [[TMP6:%.*]] = or i1 [[TMP2]], [[HOT]]
31
+ ; NONE -NEXT: br i1 [[TMP6]], label [[TMP3:%.*]], label [[TMP4:%.*]]
32
+ ; NONE : 3:
33
+ ; NONE -NEXT: tail call void @llvm.ubsantrap(i8 22)
34
+ ; NONE -NEXT: unreachable
35
+ ; NONE : 4:
36
+ ; NONE -NEXT: [[TMP5:%.*]] = load i32, ptr [[TMP0]], align 4
37
+ ; NONE -NEXT: ret i32 [[TMP5]]
38
38
;
39
39
; HOT99-LABEL: define dso_local noundef i32 @simple(
40
40
; HOT99-SAME: ptr noundef readonly [[TMP0:%.*]]) {
@@ -92,18 +92,18 @@ define dso_local noundef i32 @hot(ptr noundef readonly %0) !prof !36 {
92
92
; NOPROFILE-NEXT: [[TMP5:%.*]] = load i32, ptr [[TMP0]], align 4
93
93
; NOPROFILE-NEXT: ret i32 [[TMP5]]
94
94
;
95
- ; ALL -LABEL: define dso_local noundef i32 @hot(
96
- ; ALL -SAME: ptr noundef readonly [[TMP0:%.*]]) !prof [[PROF16:![0-9]+]] {
97
- ; ALL -NEXT: [[TMP2:%.*]] = icmp eq ptr [[TMP0]], null
98
- ; ALL -NEXT: [[HOT:%.*]] = xor i1 false, true
99
- ; ALL -NEXT: [[TMP6:%.*]] = or i1 [[TMP2]], [[HOT]]
100
- ; ALL -NEXT: br i1 [[TMP6]], label [[TMP3:%.*]], label [[TMP4:%.*]]
101
- ; ALL : 3:
102
- ; ALL -NEXT: tail call void @llvm.ubsantrap(i8 22)
103
- ; ALL -NEXT: unreachable
104
- ; ALL : 4:
105
- ; ALL -NEXT: [[TMP5:%.*]] = load i32, ptr [[TMP0]], align 4
106
- ; ALL -NEXT: ret i32 [[TMP5]]
95
+ ; NONE -LABEL: define dso_local noundef i32 @hot(
96
+ ; NONE -SAME: ptr noundef readonly [[TMP0:%.*]]) !prof [[PROF16:![0-9]+]] {
97
+ ; NONE -NEXT: [[TMP2:%.*]] = icmp eq ptr [[TMP0]], null
98
+ ; NONE -NEXT: [[HOT:%.*]] = xor i1 false, true
99
+ ; NONE -NEXT: [[TMP6:%.*]] = or i1 [[TMP2]], [[HOT]]
100
+ ; NONE -NEXT: br i1 [[TMP6]], label [[TMP3:%.*]], label [[TMP4:%.*]]
101
+ ; NONE : 3:
102
+ ; NONE -NEXT: tail call void @llvm.ubsantrap(i8 22)
103
+ ; NONE -NEXT: unreachable
104
+ ; NONE : 4:
105
+ ; NONE -NEXT: [[TMP5:%.*]] = load i32, ptr [[TMP0]], align 4
106
+ ; NONE -NEXT: ret i32 [[TMP5]]
107
107
;
108
108
; HOT99-LABEL: define dso_local noundef i32 @hot(
109
109
; HOT99-SAME: ptr noundef readonly [[TMP0:%.*]]) !prof [[PROF16:![0-9]+]] {
@@ -160,18 +160,18 @@ define dso_local noundef i32 @veryHot(ptr noundef readonly %0) !prof !39 {
160
160
; NOPROFILE-NEXT: [[TMP5:%.*]] = load i32, ptr [[TMP0]], align 4
161
161
; NOPROFILE-NEXT: ret i32 [[TMP5]]
162
162
;
163
- ; ALL -LABEL: define dso_local noundef i32 @veryHot(
164
- ; ALL -SAME: ptr noundef readonly [[TMP0:%.*]]) !prof [[PROF17:![0-9]+]] {
165
- ; ALL -NEXT: [[TMP2:%.*]] = icmp eq ptr [[TMP0]], null
166
- ; ALL -NEXT: [[HOT:%.*]] = xor i1 false, true
167
- ; ALL -NEXT: [[TMP6:%.*]] = or i1 [[TMP2]], [[HOT]]
168
- ; ALL -NEXT: br i1 [[TMP6]], label [[TMP3:%.*]], label [[TMP4:%.*]]
169
- ; ALL : 3:
170
- ; ALL -NEXT: tail call void @llvm.ubsantrap(i8 22)
171
- ; ALL -NEXT: unreachable
172
- ; ALL : 4:
173
- ; ALL -NEXT: [[TMP5:%.*]] = load i32, ptr [[TMP0]], align 4
174
- ; ALL -NEXT: ret i32 [[TMP5]]
163
+ ; NONE -LABEL: define dso_local noundef i32 @veryHot(
164
+ ; NONE -SAME: ptr noundef readonly [[TMP0:%.*]]) !prof [[PROF17:![0-9]+]] {
165
+ ; NONE -NEXT: [[TMP2:%.*]] = icmp eq ptr [[TMP0]], null
166
+ ; NONE -NEXT: [[HOT:%.*]] = xor i1 false, true
167
+ ; NONE -NEXT: [[TMP6:%.*]] = or i1 [[TMP2]], [[HOT]]
168
+ ; NONE -NEXT: br i1 [[TMP6]], label [[TMP3:%.*]], label [[TMP4:%.*]]
169
+ ; NONE : 3:
170
+ ; NONE -NEXT: tail call void @llvm.ubsantrap(i8 22)
171
+ ; NONE -NEXT: unreachable
172
+ ; NONE : 4:
173
+ ; NONE -NEXT: [[TMP5:%.*]] = load i32, ptr [[TMP0]], align 4
174
+ ; NONE -NEXT: ret i32 [[TMP5]]
175
175
;
176
176
; HOT99-LABEL: define dso_local noundef i32 @veryHot(
177
177
; HOT99-SAME: ptr noundef readonly [[TMP0:%.*]]) !prof [[PROF17:![0-9]+]] {
@@ -235,24 +235,24 @@ define dso_local noundef i32 @branchColdFnHot(i32 noundef %0, ptr noundef readon
235
235
; NOPROFILE-NEXT: [[TMP10:%.*]] = phi i32 [ [[TMP8]], [[TMP7]] ], [ 0, [[TMP2:%.*]] ]
236
236
; NOPROFILE-NEXT: ret i32 [[TMP10]]
237
237
;
238
- ; ALL -LABEL: define dso_local noundef i32 @branchColdFnHot(
239
- ; ALL -SAME: i32 noundef [[TMP0:%.*]], ptr noundef readonly [[TMP1:%.*]]) !prof [[PROF17]] {
240
- ; ALL -NEXT: [[TMP3:%.*]] = icmp eq i32 [[TMP0]], 0
241
- ; ALL -NEXT: br i1 [[TMP3]], label [[TMP9:%.*]], label [[TMP4:%.*]], !prof [[PROF18:![0-9]+]]
242
- ; ALL : 4:
243
- ; ALL -NEXT: [[TMP5:%.*]] = icmp eq ptr [[TMP1]], null
244
- ; ALL -NEXT: [[HOT:%.*]] = xor i1 false, true
245
- ; ALL -NEXT: [[TMP11:%.*]] = or i1 [[TMP5]], [[HOT]]
246
- ; ALL -NEXT: br i1 [[TMP11]], label [[TMP6:%.*]], label [[TMP7:%.*]]
247
- ; ALL : 6:
248
- ; ALL -NEXT: tail call void @llvm.ubsantrap(i8 22)
249
- ; ALL -NEXT: unreachable
250
- ; ALL : 7:
251
- ; ALL -NEXT: [[TMP8:%.*]] = load i32, ptr [[TMP1]], align 4
252
- ; ALL -NEXT: br label [[TMP9]]
253
- ; ALL : 9:
254
- ; ALL -NEXT: [[TMP10:%.*]] = phi i32 [ [[TMP8]], [[TMP7]] ], [ 0, [[TMP2:%.*]] ]
255
- ; ALL -NEXT: ret i32 [[TMP10]]
238
+ ; NONE -LABEL: define dso_local noundef i32 @branchColdFnHot(
239
+ ; NONE -SAME: i32 noundef [[TMP0:%.*]], ptr noundef readonly [[TMP1:%.*]]) !prof [[PROF17]] {
240
+ ; NONE -NEXT: [[TMP3:%.*]] = icmp eq i32 [[TMP0]], 0
241
+ ; NONE -NEXT: br i1 [[TMP3]], label [[TMP9:%.*]], label [[TMP4:%.*]], !prof [[PROF18:![0-9]+]]
242
+ ; NONE : 4:
243
+ ; NONE -NEXT: [[TMP5:%.*]] = icmp eq ptr [[TMP1]], null
244
+ ; NONE -NEXT: [[HOT:%.*]] = xor i1 false, true
245
+ ; NONE -NEXT: [[TMP11:%.*]] = or i1 [[TMP5]], [[HOT]]
246
+ ; NONE -NEXT: br i1 [[TMP11]], label [[TMP6:%.*]], label [[TMP7:%.*]]
247
+ ; NONE : 6:
248
+ ; NONE -NEXT: tail call void @llvm.ubsantrap(i8 22)
249
+ ; NONE -NEXT: unreachable
250
+ ; NONE : 7:
251
+ ; NONE -NEXT: [[TMP8:%.*]] = load i32, ptr [[TMP1]], align 4
252
+ ; NONE -NEXT: br label [[TMP9]]
253
+ ; NONE : 9:
254
+ ; NONE -NEXT: [[TMP10:%.*]] = phi i32 [ [[TMP8]], [[TMP7]] ], [ 0, [[TMP2:%.*]] ]
255
+ ; NONE -NEXT: ret i32 [[TMP10]]
256
256
;
257
257
; HOT99-LABEL: define dso_local noundef i32 @branchColdFnHot(
258
258
; HOT99-SAME: i32 noundef [[TMP0:%.*]], ptr noundef readonly [[TMP1:%.*]]) !prof [[PROF17]] {
@@ -335,24 +335,24 @@ define dso_local noundef i32 @branchHotFnCold(i32 noundef %0, ptr noundef readon
335
335
; NOPROFILE-NEXT: [[TMP10:%.*]] = phi i32 [ [[TMP8]], [[TMP7]] ], [ 0, [[TMP2:%.*]] ]
336
336
; NOPROFILE-NEXT: ret i32 [[TMP10]]
337
337
;
338
- ; ALL -LABEL: define dso_local noundef i32 @branchHotFnCold(
339
- ; ALL -SAME: i32 noundef [[TMP0:%.*]], ptr noundef readonly [[TMP1:%.*]]) !prof [[PROF16]] {
340
- ; ALL -NEXT: [[TMP3:%.*]] = icmp eq i32 [[TMP0]], 0
341
- ; ALL -NEXT: br i1 [[TMP3]], label [[TMP9:%.*]], label [[TMP4:%.*]], !prof [[PROF19:![0-9]+]]
342
- ; ALL : 4:
343
- ; ALL -NEXT: [[TMP5:%.*]] = icmp eq ptr [[TMP1]], null
344
- ; ALL -NEXT: [[HOT:%.*]] = xor i1 false, true
345
- ; ALL -NEXT: [[TMP11:%.*]] = or i1 [[TMP5]], [[HOT]]
346
- ; ALL -NEXT: br i1 [[TMP11]], label [[TMP6:%.*]], label [[TMP7:%.*]]
347
- ; ALL : 6:
348
- ; ALL -NEXT: tail call void @llvm.ubsantrap(i8 22)
349
- ; ALL -NEXT: unreachable
350
- ; ALL : 7:
351
- ; ALL -NEXT: [[TMP8:%.*]] = load i32, ptr [[TMP1]], align 4
352
- ; ALL -NEXT: br label [[TMP9]]
353
- ; ALL : 9:
354
- ; ALL -NEXT: [[TMP10:%.*]] = phi i32 [ [[TMP8]], [[TMP7]] ], [ 0, [[TMP2:%.*]] ]
355
- ; ALL -NEXT: ret i32 [[TMP10]]
338
+ ; NONE -LABEL: define dso_local noundef i32 @branchHotFnCold(
339
+ ; NONE -SAME: i32 noundef [[TMP0:%.*]], ptr noundef readonly [[TMP1:%.*]]) !prof [[PROF16]] {
340
+ ; NONE -NEXT: [[TMP3:%.*]] = icmp eq i32 [[TMP0]], 0
341
+ ; NONE -NEXT: br i1 [[TMP3]], label [[TMP9:%.*]], label [[TMP4:%.*]], !prof [[PROF19:![0-9]+]]
342
+ ; NONE : 4:
343
+ ; NONE -NEXT: [[TMP5:%.*]] = icmp eq ptr [[TMP1]], null
344
+ ; NONE -NEXT: [[HOT:%.*]] = xor i1 false, true
345
+ ; NONE -NEXT: [[TMP11:%.*]] = or i1 [[TMP5]], [[HOT]]
346
+ ; NONE -NEXT: br i1 [[TMP11]], label [[TMP6:%.*]], label [[TMP7:%.*]]
347
+ ; NONE : 6:
348
+ ; NONE -NEXT: tail call void @llvm.ubsantrap(i8 22)
349
+ ; NONE -NEXT: unreachable
350
+ ; NONE : 7:
351
+ ; NONE -NEXT: [[TMP8:%.*]] = load i32, ptr [[TMP1]], align 4
352
+ ; NONE -NEXT: br label [[TMP9]]
353
+ ; NONE : 9:
354
+ ; NONE -NEXT: [[TMP10:%.*]] = phi i32 [ [[TMP8]], [[TMP7]] ], [ 0, [[TMP2:%.*]] ]
355
+ ; NONE -NEXT: ret i32 [[TMP10]]
356
356
;
357
357
; HOT99-LABEL: define dso_local noundef i32 @branchHotFnCold(
358
358
; HOT99-SAME: i32 noundef [[TMP0:%.*]], ptr noundef readonly [[TMP1:%.*]]) !prof [[PROF16]] {
@@ -445,10 +445,10 @@ define dso_local noundef i32 @branchHotFnCold(i32 noundef %0, ptr noundef readon
445
445
; NOPROFILE: [[PROF18]] = !{!"branch_weights", i32 1000, i32 1}
446
446
; NOPROFILE: [[PROF19]] = !{!"branch_weights", i32 1, i32 1000}
447
447
;.
448
- ; ALL : [[PROF16]] = !{!"function_entry_count", i64 1000}
449
- ; ALL : [[PROF17]] = !{!"function_entry_count", i64 7000}
450
- ; ALL : [[PROF18]] = !{!"branch_weights", i32 1000, i32 1}
451
- ; ALL : [[PROF19]] = !{!"branch_weights", i32 1, i32 1000}
448
+ ; NONE : [[PROF16]] = !{!"function_entry_count", i64 1000}
449
+ ; NONE : [[PROF17]] = !{!"function_entry_count", i64 7000}
450
+ ; NONE : [[PROF18]] = !{!"branch_weights", i32 1000, i32 1}
451
+ ; NONE : [[PROF19]] = !{!"branch_weights", i32 1, i32 1000}
452
452
;.
453
453
; HOT99: [[PROF16]] = !{!"function_entry_count", i64 1000}
454
454
; HOT99: [[PROF17]] = !{!"function_entry_count", i64 7000}
0 commit comments