Skip to content

Commit 8ee638f

Browse files
authored
[llvm] Remove br i1 undef from some regression tests [NFC] (#116161)
This PR removes tests with `br i1 undef` under `llvm/tests/Transforms/HotColdSplit` and `llvm/tests/Transforms/I*`.
1 parent fa5a10d commit 8ee638f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+375
-360
lines changed

llvm/test/Transforms/HotColdSplit/X86/do-not-split.ll

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ target triple = "x86_64-apple-macosx10.14.0"
99
; The cold region is too small to split.
1010
; CHECK-LABEL: @foo
1111
; CHECK-NOT: foo.cold.1
12-
define void @foo() {
12+
define void @foo(i1 %arg) {
1313
entry:
14-
br i1 undef, label %if.then, label %if.end
14+
br i1 %arg, label %if.then, label %if.end
1515

1616
if.then: ; preds = %entry
1717
unreachable
@@ -23,9 +23,9 @@ if.end: ; preds = %entry
2323
; The cold region is still too small to split.
2424
; CHECK-LABEL: @bar
2525
; CHECK-NOT: bar.cold.1
26-
define void @bar() {
26+
define void @bar(i1 %arg) {
2727
entry:
28-
br i1 undef, label %if.then, label %if.end
28+
br i1 %arg, label %if.then, label %if.end
2929

3030
if.then: ; preds = %entry
3131
call void @sink()
@@ -38,9 +38,9 @@ if.end: ; preds = %entry
3838
; Make sure we don't try to outline the entire function.
3939
; CHECK-LABEL: @fun
4040
; CHECK-NOT: fun.cold.1
41-
define void @fun() {
41+
define void @fun(i1 %arg) {
4242
entry:
43-
br i1 undef, label %if.then, label %if.end
43+
br i1 %arg, label %if.then, label %if.end
4444

4545
if.then: ; preds = %entry
4646
call void @sink()
@@ -63,9 +63,9 @@ entry:
6363
; Do not split `noinline` functions.
6464
; CHECK-LABEL: @noinline_func
6565
; CHECK-NOT: noinline_func.cold.1
66-
define void @noinline_func() noinline {
66+
define void @noinline_func(i1 %arg) noinline {
6767
entry:
68-
br i1 undef, label %if.then, label %if.end
68+
br i1 %arg, label %if.then, label %if.end
6969

7070
if.then: ; preds = %entry
7171
call void @sink()
@@ -78,9 +78,9 @@ if.end: ; preds = %entry
7878
; Do not split `alwaysinline` functions.
7979
; CHECK-LABEL: @alwaysinline_func
8080
; CHECK-NOT: alwaysinline_func.cold.1
81-
define void @alwaysinline_func() alwaysinline {
81+
define void @alwaysinline_func(i1 %arg) alwaysinline {
8282
entry:
83-
br i1 undef, label %if.then, label %if.end
83+
br i1 %arg, label %if.then, label %if.end
8484

8585
if.then: ; preds = %entry
8686
call void @sink()
@@ -105,10 +105,10 @@ loop:
105105
; Don't count debug intrinsics towards the outlining threshold.
106106
; CHECK-LABEL: @dont_count_debug_intrinsics
107107
; CHECK-NOT: dont_count_debug_intrinsics.cold.1
108-
define void @dont_count_debug_intrinsics(i32 %arg1) !dbg !6 {
108+
define void @dont_count_debug_intrinsics(i32 %arg1, i1 %arg) !dbg !6 {
109109
entry:
110110
%var = add i32 0, 0, !dbg !11
111-
br i1 undef, label %if.then, label %if.end
111+
br i1 %arg, label %if.then, label %if.end
112112

113113
if.then: ; preds = %entry
114114
ret void
@@ -122,9 +122,9 @@ if.end: ; preds = %entry
122122

123123
; CHECK-LABEL: @sanitize_address
124124
; CHECK-NOT: sanitize_address.cold.1
125-
define void @sanitize_address() sanitize_address {
125+
define void @sanitize_address(i1 %arg) sanitize_address {
126126
entry:
127-
br i1 undef, label %if.then, label %if.end
127+
br i1 %arg, label %if.then, label %if.end
128128

129129
if.then: ; preds = %entry
130130
call void @sink()
@@ -136,9 +136,9 @@ if.end: ; preds = %entry
136136

137137
; CHECK-LABEL: @sanitize_hwaddress
138138
; CHECK-NOT: sanitize_hwaddress.cold.1
139-
define void @sanitize_hwaddress() sanitize_hwaddress {
139+
define void @sanitize_hwaddress(i1 %arg) sanitize_hwaddress {
140140
entry:
141-
br i1 undef, label %if.then, label %if.end
141+
br i1 %arg, label %if.then, label %if.end
142142

143143
if.then: ; preds = %entry
144144
call void @sink()
@@ -150,9 +150,9 @@ if.end: ; preds = %entry
150150

151151
; CHECK-LABEL: @sanitize_thread
152152
; CHECK-NOT: sanitize_thread.cold.1
153-
define void @sanitize_thread() sanitize_thread {
153+
define void @sanitize_thread(i1 %arg) sanitize_thread {
154154
entry:
155-
br i1 undef, label %if.then, label %if.end
155+
br i1 %arg, label %if.then, label %if.end
156156

157157
if.then: ; preds = %entry
158158
call void @sink()
@@ -164,9 +164,9 @@ if.end: ; preds = %entry
164164

165165
; CHECK-LABEL: @sanitize_memory
166166
; CHECK-NOT: sanitize_memory.cold.1
167-
define void @sanitize_memory() sanitize_memory {
167+
define void @sanitize_memory(i1 %arg) sanitize_memory {
168168
entry:
169-
br i1 undef, label %if.then, label %if.end
169+
br i1 %arg, label %if.then, label %if.end
170170

171171
if.then: ; preds = %entry
172172
call void @sink()
@@ -180,9 +180,9 @@ declare void @llvm.trap() cold noreturn
180180

181181
; CHECK-LABEL: @nosanitize_call
182182
; CHECK-NOT: nosanitize_call.cold.1
183-
define void @nosanitize_call() sanitize_memory {
183+
define void @nosanitize_call(i1 %arg) sanitize_memory {
184184
entry:
185-
br i1 undef, label %if.then, label %if.end
185+
br i1 %arg, label %if.then, label %if.end
186186

187187
if.then: ; preds = %entry
188188
call void @llvm.trap(), !nosanitize !2

llvm/test/Transforms/HotColdSplit/addr-taken.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ define void @foo() noreturn cold {
99
}
1010

1111
; CHECK: define {{.*}} @bar.cold.1{{.*}}#[[outlined_func_attr]]
12-
define void @bar() {
13-
br i1 undef, label %normal, label %exit
12+
define void @bar(i1 %arg) {
13+
br i1 %arg, label %normal, label %exit
1414

1515
normal:
1616
unreachable

llvm/test/Transforms/HotColdSplit/apply-noreturn-bonus.ll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33

44
declare void @sink() cold
55

6-
define void @foo(i32 %arg) {
6+
define void @foo(i32 %arg, i1 %arg2) {
77
entry:
8-
br i1 undef, label %cold1, label %exit
8+
br i1 %arg2, label %cold1, label %exit
99

1010
cold1:
1111
; CHECK: Applying bonus for: 4 non-returning terminators
1212
call void @sink()
13-
br i1 undef, label %cold2, label %cold3
13+
br i1 %arg2, label %cold2, label %cold3
1414

1515
cold2:
1616
br label %cold4

llvm/test/Transforms/HotColdSplit/apply-penalty-for-inputs.ll

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ declare void @sink(ptr, i32, i32) cold
55

66
@g = global i32 0
77

8-
define void @foo(i32 %arg) {
8+
define void @foo(i32 %arg, i1 %arg2) {
99
%local = load i32, ptr @g
10-
br i1 undef, label %cold, label %exit
10+
br i1 %arg2, label %cold, label %exit
1111

1212
cold:
1313
; CHECK: Applying penalty for splitting: 2
@@ -21,8 +21,8 @@ exit:
2121
ret void
2222
}
2323

24-
define void @bar(ptr %p1, i32 %p2, i32 %p3) {
25-
br i1 undef, label %cold, label %exit
24+
define void @bar(ptr %p1, i32 %p2, i32 %p3, i1 %arg) {
25+
br i1 %arg, label %cold, label %exit
2626

2727
cold:
2828
; CHECK: Applying penalty for splitting: 2

llvm/test/Transforms/HotColdSplit/apply-penalty-for-outputs.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ declare void @sink() cold
55

66
@g = global i32 0
77

8-
define i32 @foo(i32 %arg) {
8+
define i32 @foo(i32 %arg, i1 %arg2) {
99
entry:
10-
br i1 undef, label %cold, label %exit
10+
br i1 %arg2, label %cold, label %exit
1111

1212
cold:
1313
; CHECK: Applying penalty for splitting: 2

llvm/test/Transforms/HotColdSplit/eh-typeid-for.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66

77
; CHECK-LABEL: @fun
88
; CHECK-NOT: call {{.*}}@fun.cold.1
9-
define void @fun() {
9+
define void @fun(i1 %arg) {
1010
entry:
11-
br i1 undef, label %if.then, label %if.else
11+
br i1 %arg, label %if.then, label %if.else
1212

1313
if.then:
1414
ret void

llvm/test/Transforms/HotColdSplit/forward-dfs-reaches-marked-block.ll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ target triple = "x86_64-apple-macosx10.14.0"
55

66
; CHECK-LABEL: define {{.*}}@fun
77
; CHECK: call {{.*}}@fun.cold.1(
8-
define void @fun() {
8+
define void @fun(i1 %arg) {
99
entry:
10-
br i1 undef, label %if.then, label %if.else
10+
br i1 %arg, label %if.then, label %if.else
1111

1212
if.then:
1313
; This will be marked by the inverse DFS on sink-predecesors.
@@ -17,7 +17,7 @@ sink:
1717
call void @sink()
1818

1919
; Do not allow the forward-DFS on sink-successors to mark the block again.
20-
br i1 undef, label %if.then, label %if.then.exit
20+
br i1 %arg, label %if.then, label %if.then.exit
2121

2222
if.then.exit:
2323
ret void

llvm/test/Transforms/HotColdSplit/lifetime-markers-on-inputs-2.ll

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@ declare void @use(ptr)
3434
; \ /
3535
; exit
3636
; (lt.end)
37-
define void @only_lifetime_start_is_cold() {
37+
define void @only_lifetime_start_is_cold(i1 %arg) {
3838
; CHECK-LABEL: @only_lifetime_start_is_cold(
3939
; CHECK-NEXT: entry:
40-
; CHECK-NEXT: [[LOCAL1:%.*]] = alloca i256
41-
; CHECK-NEXT: br i1 undef, label [[CODEREPL:%.*]], label [[NO_EXTRACT1:%.*]]
40+
; CHECK-NEXT: [[LOCAL1:%.*]] = alloca i256, align 8
41+
; CHECK-NEXT: br i1 [[ARG:%.*]], label [[CODEREPL:%.*]], label [[NO_EXTRACT1:%.*]]
4242
; CHECK: codeRepl:
4343
; CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 -1, ptr [[LOCAL1]])
44-
; CHECK-NEXT: [[TARGETBLOCK:%.*]] = call i1 @only_lifetime_start_is_cold.cold.1(ptr [[LOCAL1]]) #3
44+
; CHECK-NEXT: [[TARGETBLOCK:%.*]] = call i1 @only_lifetime_start_is_cold.cold.1(ptr [[LOCAL1]], i1 [[ARG]]) #[[ATTR3:[0-9]+]]
4545
; CHECK-NEXT: br i1 [[TARGETBLOCK]], label [[NO_EXTRACT1]], label [[EXIT:%.*]]
4646
; CHECK: no-extract1:
4747
; CHECK-NEXT: br label [[EXIT]]
@@ -51,13 +51,13 @@ define void @only_lifetime_start_is_cold() {
5151
;
5252
entry:
5353
%local1 = alloca i256
54-
br i1 undef, label %extract1, label %no-extract1
54+
br i1 %arg, label %extract1, label %no-extract1
5555

5656
extract1:
5757
; lt.start
5858
call void @llvm.lifetime.start.p0(i64 1, ptr %local1)
5959
call void @cold_use(ptr %local1)
60-
br i1 undef, label %extract2, label %no-extract1
60+
br i1 %arg, label %extract2, label %no-extract1
6161

6262
extract2:
6363
br label %exit
@@ -92,17 +92,17 @@ exit:
9292
; (lt.end)
9393
; \ /
9494
; exit
95-
define void @only_lifetime_end_is_cold() {
95+
define void @only_lifetime_end_is_cold(i1 %arg) {
9696
; CHECK-LABEL: @only_lifetime_end_is_cold(
9797
; CHECK-NEXT: entry:
98-
; CHECK-NEXT: [[LOCAL1:%.*]] = alloca i256
98+
; CHECK-NEXT: [[LOCAL1:%.*]] = alloca i256, align 8
9999
; CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 1, ptr [[LOCAL1]])
100-
; CHECK-NEXT: br i1 undef, label [[NO_EXTRACT1:%.*]], label [[CODEREPL:%.*]]
100+
; CHECK-NEXT: br i1 [[ARG:%.*]], label [[NO_EXTRACT1:%.*]], label [[CODEREPL:%.*]]
101101
; CHECK: no-extract1:
102102
; CHECK-NEXT: call void @llvm.lifetime.end.p0(i64 1, ptr [[LOCAL1]])
103103
; CHECK-NEXT: br label [[EXIT:%.*]]
104104
; CHECK: codeRepl:
105-
; CHECK-NEXT: call void @only_lifetime_end_is_cold.cold.1(ptr [[LOCAL1]]) #3
105+
; CHECK-NEXT: call void @only_lifetime_end_is_cold.cold.1(ptr [[LOCAL1]]) #[[ATTR3]]
106106
; CHECK-NEXT: br label [[EXIT]]
107107
; CHECK: exit:
108108
; CHECK-NEXT: ret void
@@ -111,7 +111,7 @@ entry:
111111
; lt.start
112112
%local1 = alloca i256
113113
call void @llvm.lifetime.start.p0(i64 1, ptr %local1)
114-
br i1 undef, label %no-extract1, label %extract1
114+
br i1 %arg, label %no-extract1, label %extract1
115115

116116
no-extract1:
117117
; lt.end
@@ -130,17 +130,17 @@ exit:
130130

131131
; In this CFG, splitting will extract the blocks extract{1,2,3}. Lifting the
132132
; lifetime.end marker would be a miscompile.
133-
define void @do_not_lift_lifetime_end() {
133+
define void @do_not_lift_lifetime_end(i1 %arg) {
134134
; CHECK-LABEL: @do_not_lift_lifetime_end(
135135
; CHECK-NEXT: entry:
136-
; CHECK-NEXT: [[LOCAL1:%.*]] = alloca i256
136+
; CHECK-NEXT: [[LOCAL1:%.*]] = alloca i256, align 8
137137
; CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 1, ptr [[LOCAL1]])
138138
; CHECK-NEXT: br label [[HEADER:%.*]]
139139
; CHECK: header:
140140
; CHECK-NEXT: call void @use(ptr [[LOCAL1]])
141-
; CHECK-NEXT: br i1 undef, label [[EXIT:%.*]], label [[CODEREPL:%.*]]
141+
; CHECK-NEXT: br i1 [[ARG:%.*]], label [[EXIT:%.*]], label [[CODEREPL:%.*]]
142142
; CHECK: codeRepl:
143-
; CHECK-NEXT: [[TARGETBLOCK:%.*]] = call i1 @do_not_lift_lifetime_end.cold.1(ptr [[LOCAL1]]) #3
143+
; CHECK-NEXT: [[TARGETBLOCK:%.*]] = call i1 @do_not_lift_lifetime_end.cold.1(ptr [[LOCAL1]], i1 [[ARG]]) #[[ATTR3]]
144144
; CHECK-NEXT: br i1 [[TARGETBLOCK]], label [[HEADER]], label [[EXIT]]
145145
; CHECK: exit:
146146
; CHECK-NEXT: ret void
@@ -155,11 +155,11 @@ header:
155155
; If the lifetime.end marker is lifted, this use becomes dead the second time
156156
; the header block is executed.
157157
call void @use(ptr %local1)
158-
br i1 undef, label %exit, label %extract1
158+
br i1 %arg, label %exit, label %extract1
159159

160160
extract1:
161161
call void @cold_use(ptr %local1)
162-
br i1 undef, label %extract2, label %extract3
162+
br i1 %arg, label %extract2, label %extract3
163163

164164
extract2:
165165
; Backedge.

llvm/test/Transforms/HotColdSplit/lifetime-markers-on-inputs-3.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ declare void @use(ptr, ptr)
1212
declare void @use2(ptr, ptr) cold
1313

1414
; CHECK-LABEL: define {{.*}}@foo(
15-
define void @foo() {
15+
define void @foo(i1 %arg) {
1616
entry:
1717
%local1 = alloca ptr
1818
%local2 = alloca ptr
19-
br i1 undef, label %normalPath, label %outlinedPath
19+
br i1 %arg, label %normalPath, label %outlinedPath
2020

2121
normalPath:
2222
call void @use(ptr %local1, ptr %local2)

llvm/test/Transforms/HotColdSplit/minsize.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ target triple = "x86_64-apple-macosx10.14.0"
55

66
; CHECK-LABEL: @fun
77
; CHECK: call void @fun.cold.1
8-
define void @fun() {
8+
define void @fun(i1 %arg) {
99
entry:
10-
br i1 undef, label %if.then, label %if.else
10+
br i1 %arg, label %if.then, label %if.else
1111

1212
if.then:
1313
ret void

llvm/test/Transforms/HotColdSplit/outline-cold-asm.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ target triple = "x86_64-apple-macosx10.14.0"
99
; CHECK-LABEL: define {{.*}}@fun.cold.1(
1010
; CHECK: asm ""
1111

12-
define void @fun() {
12+
define void @fun(i1 %arg) {
1313
entry:
14-
br i1 undef, label %if.then, label %if.else
14+
br i1 %arg, label %if.then, label %if.else
1515

1616
if.then:
1717
ret void

0 commit comments

Comments
 (0)