Skip to content

Commit ce46b40

Browse files
committed
[NFC][UBSAN] Similar to #87687 for UBSAN
1 parent 7e87d03 commit ce46b40

File tree

1 file changed

+64
-64
lines changed

1 file changed

+64
-64
lines changed

llvm/test/Transforms/RemoveTraps/remove-traps.ll

Lines changed: 64 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 4
22
; RUN: opt < %s -passes='function(remove-traps)' -S | FileCheck %s --check-prefixes=NOPROFILE
33
; RUN: opt < %s -passes='function(remove-traps)' -remove-traps-random-rate=1 -S | FileCheck %s --check-prefixes=ALL
4-
; RUN: opt < %s -passes='require<profile-summary>,function(remove-traps)' -S | FileCheck %s --check-prefixes=HOT
4+
; RUN: opt < %s -passes='require<profile-summary>,function(remove-traps)' -S | FileCheck %s --check-prefixes=HOT99
55
; RUN: opt < %s -passes='require<profile-summary>,function(remove-traps)' -remove-traps-percentile-cutoff-hot=700000 -S | FileCheck %s --check-prefixes=HOT70
66

77
target triple = "x86_64-pc-linux-gnu"
@@ -30,16 +30,16 @@ define dso_local noundef i32 @simple(ptr noundef readonly %0) {
3030
; ALL-NEXT: [[TMP5:%.*]] = load i32, ptr [[TMP0]], align 4
3131
; ALL-NEXT: ret i32 [[TMP5]]
3232
;
33-
; HOT-LABEL: define dso_local noundef i32 @simple(
34-
; HOT-SAME: ptr noundef readonly [[TMP0:%.*]]) {
35-
; HOT-NEXT: [[TMP2:%.*]] = icmp eq ptr [[TMP0]], null
36-
; HOT-NEXT: br i1 [[TMP2]], label [[TMP3:%.*]], label [[TMP4:%.*]]
37-
; HOT: 3:
38-
; HOT-NEXT: tail call void @llvm.ubsantrap(i8 22)
39-
; HOT-NEXT: unreachable
40-
; HOT: 4:
41-
; HOT-NEXT: [[TMP5:%.*]] = load i32, ptr [[TMP0]], align 4
42-
; HOT-NEXT: ret i32 [[TMP5]]
33+
; HOT99-LABEL: define dso_local noundef i32 @simple(
34+
; HOT99-SAME: ptr noundef readonly [[TMP0:%.*]]) {
35+
; HOT99-NEXT: [[TMP2:%.*]] = icmp eq ptr [[TMP0]], null
36+
; HOT99-NEXT: br i1 [[TMP2]], label [[TMP3:%.*]], label [[TMP4:%.*]]
37+
; HOT99: 3:
38+
; HOT99-NEXT: tail call void @llvm.ubsantrap(i8 22)
39+
; HOT99-NEXT: unreachable
40+
; HOT99: 4:
41+
; HOT99-NEXT: [[TMP5:%.*]] = load i32, ptr [[TMP0]], align 4
42+
; HOT99-NEXT: ret i32 [[TMP5]]
4343
;
4444
; HOT70-LABEL: define dso_local noundef i32 @simple(
4545
; HOT70-SAME: ptr noundef readonly [[TMP0:%.*]]) {
@@ -87,15 +87,15 @@ define dso_local noundef i32 @hot(ptr noundef readonly %0) !prof !36 {
8787
; ALL-NEXT: [[TMP5:%.*]] = load i32, ptr [[TMP0]], align 4
8888
; ALL-NEXT: ret i32 [[TMP5]]
8989
;
90-
; HOT-LABEL: define dso_local noundef i32 @hot(
91-
; HOT-SAME: ptr noundef readonly [[TMP0:%.*]]) !prof [[PROF16:![0-9]+]] {
92-
; HOT-NEXT: [[TMP2:%.*]] = icmp eq ptr [[TMP0]], null
93-
; HOT-NEXT: br i1 [[TMP2]], label [[TMP3:%.*]], label [[TMP4:%.*]]
94-
; HOT: 3:
95-
; HOT-NEXT: unreachable
96-
; HOT: 4:
97-
; HOT-NEXT: [[TMP5:%.*]] = load i32, ptr [[TMP0]], align 4
98-
; HOT-NEXT: ret i32 [[TMP5]]
90+
; HOT99-LABEL: define dso_local noundef i32 @hot(
91+
; HOT99-SAME: ptr noundef readonly [[TMP0:%.*]]) !prof [[PROF16:![0-9]+]] {
92+
; HOT99-NEXT: [[TMP2:%.*]] = icmp eq ptr [[TMP0]], null
93+
; HOT99-NEXT: br i1 [[TMP2]], label [[TMP3:%.*]], label [[TMP4:%.*]]
94+
; HOT99: 3:
95+
; HOT99-NEXT: unreachable
96+
; HOT99: 4:
97+
; HOT99-NEXT: [[TMP5:%.*]] = load i32, ptr [[TMP0]], align 4
98+
; HOT99-NEXT: ret i32 [[TMP5]]
9999
;
100100
; HOT70-LABEL: define dso_local noundef i32 @hot(
101101
; HOT70-SAME: ptr noundef readonly [[TMP0:%.*]]) !prof [[PROF16:![0-9]+]] {
@@ -142,15 +142,15 @@ define dso_local noundef i32 @veryHot(ptr noundef readonly %0) !prof !39 {
142142
; ALL-NEXT: [[TMP5:%.*]] = load i32, ptr [[TMP0]], align 4
143143
; ALL-NEXT: ret i32 [[TMP5]]
144144
;
145-
; HOT-LABEL: define dso_local noundef i32 @veryHot(
146-
; HOT-SAME: ptr noundef readonly [[TMP0:%.*]]) !prof [[PROF17:![0-9]+]] {
147-
; HOT-NEXT: [[TMP2:%.*]] = icmp eq ptr [[TMP0]], null
148-
; HOT-NEXT: br i1 [[TMP2]], label [[TMP3:%.*]], label [[TMP4:%.*]]
149-
; HOT: 3:
150-
; HOT-NEXT: unreachable
151-
; HOT: 4:
152-
; HOT-NEXT: [[TMP5:%.*]] = load i32, ptr [[TMP0]], align 4
153-
; HOT-NEXT: ret i32 [[TMP5]]
145+
; HOT99-LABEL: define dso_local noundef i32 @veryHot(
146+
; HOT99-SAME: ptr noundef readonly [[TMP0:%.*]]) !prof [[PROF17:![0-9]+]] {
147+
; HOT99-NEXT: [[TMP2:%.*]] = icmp eq ptr [[TMP0]], null
148+
; HOT99-NEXT: br i1 [[TMP2]], label [[TMP3:%.*]], label [[TMP4:%.*]]
149+
; HOT99: 3:
150+
; HOT99-NEXT: unreachable
151+
; HOT99: 4:
152+
; HOT99-NEXT: [[TMP5:%.*]] = load i32, ptr [[TMP0]], align 4
153+
; HOT99-NEXT: ret i32 [[TMP5]]
154154
;
155155
; HOT70-LABEL: define dso_local noundef i32 @veryHot(
156156
; HOT70-SAME: ptr noundef readonly [[TMP0:%.*]]) !prof [[PROF17:![0-9]+]] {
@@ -209,22 +209,22 @@ define dso_local noundef i32 @branchColdFnHot(i32 noundef %0, ptr noundef readon
209209
; ALL-NEXT: [[TMP10:%.*]] = phi i32 [ [[TMP8]], [[TMP7]] ], [ 0, [[TMP2:%.*]] ]
210210
; ALL-NEXT: ret i32 [[TMP10]]
211211
;
212-
; HOT-LABEL: define dso_local noundef i32 @branchColdFnHot(
213-
; HOT-SAME: i32 noundef [[TMP0:%.*]], ptr noundef readonly [[TMP1:%.*]]) !prof [[PROF17]] {
214-
; HOT-NEXT: [[TMP3:%.*]] = icmp eq i32 [[TMP0]], 0
215-
; HOT-NEXT: br i1 [[TMP3]], label [[TMP9:%.*]], label [[TMP4:%.*]], !prof [[PROF18:![0-9]+]]
216-
; HOT: 4:
217-
; HOT-NEXT: [[TMP5:%.*]] = icmp eq ptr [[TMP1]], null
218-
; HOT-NEXT: br i1 [[TMP5]], label [[TMP6:%.*]], label [[TMP7:%.*]]
219-
; HOT: 6:
220-
; HOT-NEXT: tail call void @llvm.ubsantrap(i8 22)
221-
; HOT-NEXT: unreachable
222-
; HOT: 7:
223-
; HOT-NEXT: [[TMP8:%.*]] = load i32, ptr [[TMP1]], align 4
224-
; HOT-NEXT: br label [[TMP9]]
225-
; HOT: 9:
226-
; HOT-NEXT: [[TMP10:%.*]] = phi i32 [ [[TMP8]], [[TMP7]] ], [ 0, [[TMP2:%.*]] ]
227-
; HOT-NEXT: ret i32 [[TMP10]]
212+
; HOT99-LABEL: define dso_local noundef i32 @branchColdFnHot(
213+
; HOT99-SAME: i32 noundef [[TMP0:%.*]], ptr noundef readonly [[TMP1:%.*]]) !prof [[PROF17]] {
214+
; HOT99-NEXT: [[TMP3:%.*]] = icmp eq i32 [[TMP0]], 0
215+
; HOT99-NEXT: br i1 [[TMP3]], label [[TMP9:%.*]], label [[TMP4:%.*]], !prof [[PROF18:![0-9]+]]
216+
; HOT99: 4:
217+
; HOT99-NEXT: [[TMP5:%.*]] = icmp eq ptr [[TMP1]], null
218+
; HOT99-NEXT: br i1 [[TMP5]], label [[TMP6:%.*]], label [[TMP7:%.*]]
219+
; HOT99: 6:
220+
; HOT99-NEXT: tail call void @llvm.ubsantrap(i8 22)
221+
; HOT99-NEXT: unreachable
222+
; HOT99: 7:
223+
; HOT99-NEXT: [[TMP8:%.*]] = load i32, ptr [[TMP1]], align 4
224+
; HOT99-NEXT: br label [[TMP9]]
225+
; HOT99: 9:
226+
; HOT99-NEXT: [[TMP10:%.*]] = phi i32 [ [[TMP8]], [[TMP7]] ], [ 0, [[TMP2:%.*]] ]
227+
; HOT99-NEXT: ret i32 [[TMP10]]
228228
;
229229
; HOT70-LABEL: define dso_local noundef i32 @branchColdFnHot(
230230
; HOT70-SAME: i32 noundef [[TMP0:%.*]], ptr noundef readonly [[TMP1:%.*]]) !prof [[PROF17]] {
@@ -297,21 +297,21 @@ define dso_local noundef i32 @branchHotFnCold(i32 noundef %0, ptr noundef readon
297297
; ALL-NEXT: [[TMP10:%.*]] = phi i32 [ [[TMP8]], [[TMP7]] ], [ 0, [[TMP2:%.*]] ]
298298
; ALL-NEXT: ret i32 [[TMP10]]
299299
;
300-
; HOT-LABEL: define dso_local noundef i32 @branchHotFnCold(
301-
; HOT-SAME: i32 noundef [[TMP0:%.*]], ptr noundef readonly [[TMP1:%.*]]) !prof [[PROF16]] {
302-
; HOT-NEXT: [[TMP3:%.*]] = icmp eq i32 [[TMP0]], 0
303-
; HOT-NEXT: br i1 [[TMP3]], label [[TMP9:%.*]], label [[TMP4:%.*]], !prof [[PROF19:![0-9]+]]
304-
; HOT: 4:
305-
; HOT-NEXT: [[TMP5:%.*]] = icmp eq ptr [[TMP1]], null
306-
; HOT-NEXT: br i1 [[TMP5]], label [[TMP6:%.*]], label [[TMP7:%.*]]
307-
; HOT: 6:
308-
; HOT-NEXT: unreachable
309-
; HOT: 7:
310-
; HOT-NEXT: [[TMP8:%.*]] = load i32, ptr [[TMP1]], align 4
311-
; HOT-NEXT: br label [[TMP9]]
312-
; HOT: 9:
313-
; HOT-NEXT: [[TMP10:%.*]] = phi i32 [ [[TMP8]], [[TMP7]] ], [ 0, [[TMP2:%.*]] ]
314-
; HOT-NEXT: ret i32 [[TMP10]]
300+
; HOT99-LABEL: define dso_local noundef i32 @branchHotFnCold(
301+
; HOT99-SAME: i32 noundef [[TMP0:%.*]], ptr noundef readonly [[TMP1:%.*]]) !prof [[PROF16]] {
302+
; HOT99-NEXT: [[TMP3:%.*]] = icmp eq i32 [[TMP0]], 0
303+
; HOT99-NEXT: br i1 [[TMP3]], label [[TMP9:%.*]], label [[TMP4:%.*]], !prof [[PROF19:![0-9]+]]
304+
; HOT99: 4:
305+
; HOT99-NEXT: [[TMP5:%.*]] = icmp eq ptr [[TMP1]], null
306+
; HOT99-NEXT: br i1 [[TMP5]], label [[TMP6:%.*]], label [[TMP7:%.*]]
307+
; HOT99: 6:
308+
; HOT99-NEXT: unreachable
309+
; HOT99: 7:
310+
; HOT99-NEXT: [[TMP8:%.*]] = load i32, ptr [[TMP1]], align 4
311+
; HOT99-NEXT: br label [[TMP9]]
312+
; HOT99: 9:
313+
; HOT99-NEXT: [[TMP10:%.*]] = phi i32 [ [[TMP8]], [[TMP7]] ], [ 0, [[TMP2:%.*]] ]
314+
; HOT99-NEXT: ret i32 [[TMP10]]
315315
;
316316
; HOT70-LABEL: define dso_local noundef i32 @branchHotFnCold(
317317
; HOT70-SAME: i32 noundef [[TMP0:%.*]], ptr noundef readonly [[TMP1:%.*]]) !prof [[PROF16]] {
@@ -385,10 +385,10 @@ define dso_local noundef i32 @branchHotFnCold(i32 noundef %0, ptr noundef readon
385385
; ALL: [[PROF18]] = !{!"branch_weights", i32 1000, i32 1}
386386
; ALL: [[PROF19]] = !{!"branch_weights", i32 1, i32 1000}
387387
;.
388-
; HOT: [[PROF16]] = !{!"function_entry_count", i64 1000}
389-
; HOT: [[PROF17]] = !{!"function_entry_count", i64 7000}
390-
; HOT: [[PROF18]] = !{!"branch_weights", i32 1000, i32 1}
391-
; HOT: [[PROF19]] = !{!"branch_weights", i32 1, i32 1000}
388+
; HOT99: [[PROF16]] = !{!"function_entry_count", i64 1000}
389+
; HOT99: [[PROF17]] = !{!"function_entry_count", i64 7000}
390+
; HOT99: [[PROF18]] = !{!"branch_weights", i32 1000, i32 1}
391+
; HOT99: [[PROF19]] = !{!"branch_weights", i32 1, i32 1000}
392392
;.
393393
; HOT70: [[PROF16]] = !{!"function_entry_count", i64 1000}
394394
; HOT70: [[PROF17]] = !{!"function_entry_count", i64 7000}

0 commit comments

Comments
 (0)