Skip to content

Commit f350ba2

Browse files
committed
Remove br i1 undef tests
1 parent d0dc53a commit f350ba2

Some content is hidden

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

41 files changed

+164
-169
lines changed

llvm/test/CodeGen/X86/2011-06-03-x87chain.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ entry:
3030
ret float %conv
3131
}
3232

33-
define void @PR17495() {
33+
define void @PR17495(i1 %arg) {
3434
entry:
35-
br i1 undef, label %while.end, label %while.body
35+
br i1 %arg, label %while.end, label %while.body
3636

3737
while.body: ; preds = %while.body, %entry
3838
%x.1.copyload = load i24, ptr undef, align 1

llvm/test/CodeGen/X86/2020_12_02_decrementing_loop.ll

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ failure: ; preds = %backedge
165165
unreachable
166166
}
167167

168-
define void @test_04() {
168+
define void @test_04(i32 %arg) {
169169
; CHECK-LABEL: test_04:
170170
; CHECK: ## %bb.0: ## %bb
171171
; CHECK-NEXT: ud2
@@ -175,7 +175,7 @@ bb:
175175
bb1: ; preds = %bb10, %bb
176176
%tmp = phi i64 [ 1, %bb ], [ %tmp2, %bb10 ]
177177
%tmp2 = add nuw nsw i64 %tmp, 1
178-
br i1 undef, label %bb21, label %bb7
178+
br i1 poison, label %bb21, label %bb7
179179

180180
bb7: ; preds = %bb1
181181
%tmp8 = add nsw i64 %tmp, -1
@@ -187,7 +187,7 @@ bb10: ; preds = %bb16
187187
br label %bb1
188188

189189
bb11: ; preds = %bb16, %bb7
190-
switch i32 undef, label %bb19 [
190+
switch i32 %arg, label %bb19 [
191191
i32 0, label %bb17
192192
i32 1, label %bb16
193193
i32 2, label %bb15
@@ -205,7 +205,7 @@ bb15: ; preds = %bb11
205205
unreachable
206206

207207
bb16: ; preds = %bb11
208-
br i1 undef, label %bb10, label %bb11
208+
br i1 poison, label %bb10, label %bb11
209209

210210
bb17: ; preds = %bb11
211211
unreachable

llvm/test/CodeGen/X86/StackColoring.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ entry:
135135
%t3 = call i32 @foo(i32 %in, ptr %a3)
136136
%t4 = call i32 @foo(i32 %in, ptr %a3)
137137
call void @llvm.lifetime.end.p0(i64 -1, ptr %a3)
138-
br i1 undef, label %bb2, label %bb3
138+
br i1 poison, label %bb2, label %bb3
139139
bb2:
140140
call void @llvm.lifetime.start.p0(i64 -1, ptr %a4)
141141
%t11 = call i32 @foo(i32 %in, ptr %a4)

llvm/test/CodeGen/X86/asm-label.ll

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@
1212
; SAVETEMP: jne {{.*}} <.LBB0_1>
1313
; SAVETEMP-LABEL: <.LBB0_1>:
1414

15-
define void @foo() {
15+
define void @foo(i1 %arg, i32 %arg2) {
1616
entry:
17-
br i1 undef, label %land.lhs.true, label %if.end11
17+
br i1 %arg, label %land.lhs.true, label %if.end11
1818

1919
land.lhs.true: ; preds = %entry
20-
br i1 undef, label %if.then, label %if.end11
20+
br i1 %arg, label %if.then, label %if.end11
2121

2222
if.then: ; preds = %land.lhs.true
23-
br i1 undef, label %if.then9, label %if.end
23+
br i1 %arg, label %if.then9, label %if.end
2424

2525
if.then9: ; preds = %if.then
2626
br label %cleanup
@@ -29,7 +29,7 @@ if.end: ; preds = %if.then
2929
br label %cleanup
3030

3131
cleanup: ; preds = %if.end, %if.then9
32-
switch i32 undef, label %default [
32+
switch i32 %arg2, label %default [
3333
i32 0, label %cleanup.cont
3434
i32 1, label %if.end11
3535
]

llvm/test/CodeGen/X86/avx-select.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ head:
8484
%isneg = icmp slt <4 x i32> %v3, zeroinitializer
8585
%or0 = select <4 x i1> %isneg, <4 x i32> <i32 26146, i32 -1257, i32 -2, i32 -3052>, <4 x i32> <i32 -24947, i32 7802, i32 29242, i32 15858>
8686
%or1 = shufflevector <4 x i32> %or0, <4 x i32> <i32 29361, i32 -16094, i32 -3080, i32 -26286>, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
87-
br i1 undef, label %exit, label %head
87+
br i1 poison, label %exit, label %head
8888

8989
exit:
9090
store <8 x i32> %or1, ptr addrspace(1) undef, align 32

llvm/test/CodeGen/X86/avx512-i1test.ll

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,20 @@ define void @func() {
2121
; CHECK-NEXT: testb %al, %al
2222
; CHECK-NEXT: jmp .LBB0_2
2323
bb1:
24-
br i1 undef, label %L_10, label %L_10
24+
br i1 poison, label %L_10, label %L_10
2525

2626
L_10: ; preds = %bb1, %bb1
27-
br i1 undef, label %L_30, label %bb56
27+
br i1 poison, label %L_30, label %bb56
2828

2929
bb56: ; preds = %L_10
3030
br label %bb33
3131

3232
bb33: ; preds = %bb51, %bb56
3333
%r111 = load i64, ptr undef, align 8
34-
br i1 undef, label %bb51, label %bb35
34+
br i1 poison, label %bb51, label %bb35
3535

3636
bb35: ; preds = %bb33
37-
br i1 undef, label %L_19, label %bb37
37+
br i1 poison, label %L_19, label %bb37
3838

3939
bb37: ; preds = %bb35
4040
%r128 = and i64 %r111, 576460752303423488
@@ -43,7 +43,7 @@ bb37: ; preds = %bb35
4343

4444
L_19: ; preds = %bb37, %bb35
4545
%"$V_S25.0" = phi i1 [ %phitmp, %bb37 ], [ true, %bb35 ]
46-
br i1 undef, label %bb51, label %bb42
46+
br i1 poison, label %bb51, label %bb42
4747

4848
bb42: ; preds = %L_19
4949
%r136 = select i1 %"$V_S25.0", ptr undef, ptr undef

llvm/test/CodeGen/X86/block-placement.ll

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ exit:
312312
ret i32 %sum
313313
}
314314

315-
define void @unnatural_cfg1() {
315+
define void @unnatural_cfg1(i1 %arg) {
316316
; Test that we can handle a loop with an inner unnatural loop at the end of
317317
; a function. This is a gross CFG reduced out of the single source GCC.
318318
; CHECK-LABEL: unnatural_cfg1
@@ -327,7 +327,7 @@ loop.header:
327327
br label %loop.body1
328328

329329
loop.body1:
330-
br i1 undef, label %loop.body3, label %loop.body2
330+
br i1 %arg, label %loop.body3, label %loop.body2
331331

332332
loop.body2:
333333
%ptr = load ptr, ptr undef, align 4
@@ -341,14 +341,14 @@ loop.body3:
341341
br i1 %comp, label %loop.body4, label %loop.body5
342342

343343
loop.body4:
344-
br i1 undef, label %loop.header, label %loop.body5
344+
br i1 %arg, label %loop.header, label %loop.body5
345345

346346
loop.body5:
347347
%ptr2 = load ptr, ptr undef, align 4
348348
br label %loop.body3
349349
}
350350

351-
define void @unnatural_cfg2(ptr %p0, i32 %a0) {
351+
define void @unnatural_cfg2(ptr %p0, i32 %a0, i1 %arg) {
352352
; Test that we can handle a loop with a nested natural loop *and* an unnatural
353353
; loop. This was reduced from a crash on block placement when run over
354354
; single-source GCC.
@@ -372,10 +372,10 @@ loop.header:
372372

373373
loop.body1:
374374
%val0 = load ptr, ptr undef, align 4
375-
br i1 undef, label %loop.body2, label %loop.inner1.begin
375+
br i1 %arg, label %loop.body2, label %loop.inner1.begin
376376

377377
loop.body2:
378-
br i1 undef, label %loop.body4, label %loop.body3
378+
br i1 %arg, label %loop.body4, label %loop.body3
379379

380380
loop.body3:
381381
%ptr1 = getelementptr inbounds i32, ptr %val0, i32 0
@@ -467,7 +467,7 @@ exit:
467467
ret i32 %merge
468468
}
469469

470-
define void @fpcmp_unanalyzable_branch(i1 %cond, double %a0) {
470+
define void @fpcmp_unanalyzable_branch(i1 %cond, double %a0, i1 %arg) {
471471
; This function's CFG contains an once-unanalyzable branch (une on floating
472472
; points). As now it becomes analyzable, we should get best layout in which each
473473
; edge in 'entry' -> 'entry.if.then_crit_edge' -> 'if.then' -> 'if.end' is
@@ -493,7 +493,7 @@ entry.if.then_crit_edge:
493493
br label %if.then
494494

495495
lor.lhs.false:
496-
br i1 undef, label %if.end, label %exit
496+
br i1 %arg, label %if.end, label %exit
497497

498498
exit:
499499
%cmp.i = fcmp une double 0.000000e+00, %a0
@@ -516,7 +516,7 @@ declare i32 @f()
516516
declare i32 @g()
517517
declare i32 @h(i32 %x)
518518

519-
define i32 @test_global_cfg_break_profitability() {
519+
define i32 @test_global_cfg_break_profitability(i1 %arg) {
520520
; Check that our metrics for the profitability of a CFG break are global rather
521521
; than local. A successor may be very hot, but if the current block isn't, it
522522
; doesn't matter. Within this test the 'then' block is slightly warmer than the
@@ -530,7 +530,7 @@ define i32 @test_global_cfg_break_profitability() {
530530
; CHECK: ret
531531

532532
entry:
533-
br i1 undef, label %then, label %else, !prof !2
533+
br i1 %arg, label %then, label %else, !prof !2
534534

535535
then:
536536
%then.result = call i32 @f()
@@ -600,7 +600,7 @@ cleanup:
600600
unreachable
601601
}
602602

603-
define void @test_unnatural_cfg_backwards_inner_loop() {
603+
define void @test_unnatural_cfg_backwards_inner_loop(i1 %arg) {
604604
; Test that when we encounter an unnatural CFG structure after having formed
605605
; a chain for an inner loop which happened to be laid out backwards we don't
606606
; attempt to merge onto the wrong end of the inner loop just because we find it
@@ -612,7 +612,7 @@ define void @test_unnatural_cfg_backwards_inner_loop() {
612612
; CHECK: %loop3
613613

614614
entry:
615-
br i1 undef, label %loop2a, label %body
615+
br i1 %arg, label %loop2a, label %body
616616

617617
body:
618618
br label %loop2a
@@ -692,7 +692,7 @@ exit:
692692
ret void
693693
}
694694

695-
define void @unanalyzable_branch_to_free_block(float %x) {
695+
define void @unanalyzable_branch_to_free_block(float %x, i1 %arg) {
696696
; Ensure that we can handle unanalyzable branches where the destination block
697697
; gets selected as the best free block in the CFG.
698698
;
@@ -704,7 +704,7 @@ define void @unanalyzable_branch_to_free_block(float %x) {
704704
; CHECK: %exit
705705

706706
entry:
707-
br i1 undef, label %a, label %b
707+
br i1 %arg, label %a, label %b
708708

709709
a:
710710
call i32 @f()

llvm/test/CodeGen/X86/clobber_frame_ptr.ll

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ define ghccc void @test5() {
173173
; CHECK-NEXT: .cfi_def_cfa %rsp, 8
174174
; CHECK-NEXT: jmp tail@PLT # TAILCALL
175175
entry:
176-
br i1 undef, label %then, label %else
176+
br i1 poison, label %then, label %else
177177

178178
then:
179179
store i64 0, ptr undef
@@ -186,4 +186,3 @@ else:
186186
exit:
187187
ret void
188188
}
189-

llvm/test/CodeGen/X86/codegen-prepare-replacephi.mir

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# "Replacement PHI node is already replaced."
77

88
--- |
9-
define void @f1() {
9+
define void @f1(i1 %arg) {
1010
entry:
1111
%arrayidx = getelementptr inbounds [2 x i16], ptr undef, i16 0, i16 2
1212
br label %for.cond
@@ -30,10 +30,10 @@
3030
%5 = phi ptr [ %4, %for.body ], [ %5, %if.then5 ], [ undef, %for.cond2 ]
3131
%6 = phi ptr [ %3, %for.body ], [ %6, %if.then5 ], [ undef, %for.cond2 ]
3232
%7 = phi ptr [ %2, %for.body ], [ %6, %if.then5 ], [ undef, %for.cond2 ]
33-
br i1 undef, label %for.cond2, label %if.then5
33+
br i1 %arg, label %for.cond2, label %if.then5
3434

3535
if.then5:
36-
br i1 undef, label %cleanup, label %for.cond2
36+
br i1 %arg, label %cleanup, label %for.cond2
3737

3838
cleanup:
3939
br i1 true, label %for.cond, label %for.body

llvm/test/CodeGen/X86/codegen-prepare-replacephi2.mir

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

88
--- |
99

10-
define void @f1() {
10+
define void @f1(i1 %arg) {
1111
entry:
1212
%arrayidx = getelementptr inbounds [2 x i16], ptr undef, i16 0, i16 2
1313
br label %for.cond
@@ -24,7 +24,7 @@
2424
%2 = phi ptr [ %1, %for.cond ], [ %12, %cleanup ]
2525
%3 = phi ptr [ %0, %for.cond ], [ %11, %cleanup ]
2626
%4 = phi ptr [ %0, %for.cond ], [ %10, %cleanup ]
27-
br i1 undef, label %for.cond2.preheader, label %if.then
27+
br i1 %arg, label %for.cond2.preheader, label %if.then
2828

2929
for.cond2.preheader:
3030
br label %for.cond2
@@ -37,7 +37,7 @@
3737
%5 = phi ptr [ %8, %for.inc ], [ %4, %for.cond2.preheader ]
3838
%6 = phi ptr [ %9, %for.inc ], [ %3, %for.cond2.preheader ]
3939
%7 = phi ptr [ %9, %for.inc ], [ %2, %for.cond2.preheader ]
40-
br i1 undef, label %for.inc, label %if.then5
40+
br i1 %arg, label %for.inc, label %if.then5
4141

4242
if.then5:
4343
br i1 true, label %cleanup.loopexit, label %if.end

0 commit comments

Comments
 (0)