Skip to content

Commit b6feb03

Browse files
committed
Remove br i1 undef in LoopSimplify directory
1 parent a67b2d0 commit b6feb03

File tree

8 files changed

+43
-43
lines changed

8 files changed

+43
-43
lines changed

llvm/test/Transforms/LoopSimplify/2010-07-15-IncorrectDomFrontierUpdate.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
; RUN: opt < %s -passes='require<domfrontier>,loop-simplify,require<domfrontier>' -verify-dom-info
22

33

4-
define void @a() nounwind {
4+
define void @a(i1 %arg) nounwind {
55
entry:
6-
br i1 undef, label %bb37, label %bb1.i
6+
br i1 %arg, label %bb37, label %bb1.i
77

88
bb1.i: ; preds = %bb1.i, %bb
99
%indvar = phi i64 [ %indvar.next, %bb1.i ], [ 0, %entry ] ; <i64> [#uses=1]

llvm/test/Transforms/LoopSimplify/2010-12-26-PHIInfiniteLoop.ll

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,19 @@ target triple = "x86_64-unknown-freebsd9.0"
55

66
declare void @foo(i32 %x)
77

8-
define fastcc void @inm_merge() nounwind {
8+
define fastcc void @inm_merge(i1 %arg) nounwind {
99
entry:
1010
br label %for.cond
1111

1212
for.cond: ; preds = %while.cond36.i, %entry
13-
br i1 undef, label %do.body, label %for.body
13+
br i1 %arg, label %do.body, label %for.body
1414

1515
for.body: ; preds = %for.cond
16-
br i1 undef, label %while.cond36.i, label %if.end44
16+
br i1 %arg, label %while.cond36.i, label %if.end44
1717

1818
if.end44: ; preds = %for.body
1919
%call49 = call fastcc i32 @inm_get_source()
20-
br i1 undef, label %if.end54, label %for.cond64
20+
br i1 %arg, label %if.end54, label %for.cond64
2121

2222
if.end54: ; preds = %if.end44
2323
br label %while.cond36.i
@@ -28,10 +28,10 @@ while.cond36.i: ; preds = %if.end54, %for.body
2828
for.cond64: ; preds = %if.end88, %for.cond64, %if.end44
2929
%error.161 = phi i32 [ %error.161, %for.cond64 ], [ %error.161, %if.end88 ], [ %call49, %if.end44 ]
3030
call void @foo(i32 %error.161)
31-
br i1 undef, label %for.cond64, label %if.end88
31+
br i1 %arg, label %for.cond64, label %if.end88
3232

3333
if.end88: ; preds = %for.cond64
34-
br i1 undef, label %for.cond64, label %if.end98
34+
br i1 %arg, label %for.cond64, label %if.end98
3535

3636
if.end98: ; preds = %if.end88
3737
unreachable

llvm/test/Transforms/LoopSimplify/dup-preds.ll

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,21 @@
22
target datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-f128:128:128-v128:128:128-n32:64"
33
target triple = "powerpc64le-unknown-linux"
44

5-
define fastcc void @do_update_md(ptr nocapture readonly %x) #0 {
5+
define fastcc void @do_update_md(ptr nocapture readonly %x, i1 %arg, i16 %arg2) #0 {
66
entry:
7-
br i1 undef, label %if.end365, label %lor.lhs.false134
7+
br i1 %arg, label %if.end365, label %lor.lhs.false134
88

99
lor.lhs.false134: ; preds = %entry
10-
br i1 undef, label %lor.lhs.false138, label %if.end365
10+
br i1 %arg, label %lor.lhs.false138, label %if.end365
1111

1212
lor.lhs.false138: ; preds = %lor.lhs.false134
13-
br i1 undef, label %lor.lhs.false142, label %if.end365
13+
br i1 %arg, label %lor.lhs.false142, label %if.end365
1414

1515
lor.lhs.false142: ; preds = %lor.lhs.false138
16-
br i1 undef, label %for.body276.lr.ph, label %if.end365
16+
br i1 %arg, label %for.body276.lr.ph, label %if.end365
1717

1818
for.body276.lr.ph: ; preds = %lor.lhs.false142
19-
switch i16 undef, label %if.then288 [
19+
switch i16 %arg2, label %if.then288 [
2020
i16 4, label %for.body344
2121
i16 2, label %for.body344
2222
]

llvm/test/Transforms/LoopSimplify/indirectbr.ll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,15 +82,15 @@ L1:
8282
ret i64 %y
8383
}
8484

85-
define void @pr5502() nounwind {
85+
define void @pr5502(ptr %arg, i1 %arg2) nounwind {
8686
entry:
8787
br label %while.cond
8888

8989
while.cond:
90-
br i1 undef, label %while.body, label %while.end
90+
br i1 %arg2, label %while.body, label %while.end
9191

9292
while.body:
93-
indirectbr ptr undef, [label %end_opcode, label %end_opcode]
93+
indirectbr ptr %arg, [label %end_opcode, label %end_opcode]
9494

9595
end_opcode:
9696
br i1 false, label %end_opcode, label %while.cond

llvm/test/Transforms/LoopSimplify/notify-scev.ll

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ target triple = "x86_64-apple-darwin"
1717
; CHECK-LABEL: for.cond127.preheader:
1818
; CHECK-NOT: for.cond127:
1919
; CHECK-LABEL: for.body129:
20-
define void @t() {
20+
define void @t(i1 %arg) {
2121
entry:
2222
br label %for.body102
2323

2424
for.body102:
25-
br i1 undef, label %for.cond127.preheader, label %for.inc203
25+
br i1 %arg, label %for.cond127.preheader, label %for.inc203
2626

2727
for.cond127.preheader:
2828
br label %for.body129
@@ -34,10 +34,10 @@ for.cond127:
3434
for.body129:
3535
%uv.013 = phi i32 [ 0, %for.cond127.preheader ], [ %inc191, %for.cond127 ]
3636
%idxprom130 = sext i32 %uv.013 to i64
37-
br i1 undef, label %for.cond135.preheader.lr.ph, label %for.end185
37+
br i1 %arg, label %for.cond135.preheader.lr.ph, label %for.end185
3838

3939
for.cond135.preheader.lr.ph:
40-
br i1 undef, label %for.cond135.preheader.lr.ph.split.us, label %for.cond135.preheader.lr.ph.split_crit_edge
40+
br i1 %arg, label %for.cond135.preheader.lr.ph.split.us, label %for.cond135.preheader.lr.ph.split_crit_edge
4141

4242
for.cond135.preheader.lr.ph.split_crit_edge:
4343
br label %for.cond135.preheader.lr.ph.split
@@ -51,17 +51,17 @@ for.cond135.preheader.us:
5151

5252
for.end178.us:
5353
%add184.us = add nsw i32 %block_y.09.us, 4
54-
br i1 undef, label %for.end185split.us-lcssa.us, label %for.cond132.us
54+
br i1 %arg, label %for.end185split.us-lcssa.us, label %for.cond132.us
5555

5656
for.end174.us:
57-
br i1 undef, label %for.cond138.preheader.us, label %for.cond135.for.end178_crit_edge.us
57+
br i1 %arg, label %for.cond138.preheader.us, label %for.cond135.for.end178_crit_edge.us
5858

5959
for.inc172.us:
60-
br i1 undef, label %for.cond142.preheader.us, label %for.end174.us
60+
br i1 %arg, label %for.cond142.preheader.us, label %for.end174.us
6161

6262
for.body145.us:
6363
%arrayidx163.us = getelementptr inbounds %struct.Params, ptr undef, i64 0, i32 0, i64 %idxprom130, i64 %idxprom146.us
64-
br i1 undef, label %for.body145.us, label %for.inc172.us
64+
br i1 %arg, label %for.body145.us, label %for.inc172.us
6565

6666
for.cond142.preheader.us:
6767
%j.04.us = phi i32 [ %block_y.09.us, %for.cond138.preheader.us ], [ undef, %for.inc172.us ]
@@ -72,7 +72,7 @@ for.cond138.preheader.us:
7272
br label %for.cond142.preheader.us
7373

7474
for.cond132.us:
75-
br i1 undef, label %for.cond135.preheader.us, label %for.cond132.for.end185_crit_edge.us-lcssa.us
75+
br i1 %arg, label %for.cond135.preheader.us, label %for.cond132.for.end185_crit_edge.us-lcssa.us
7676

7777
for.cond138.preheader.lr.ph.us:
7878
br label %for.cond138.preheader.us

llvm/test/Transforms/LoopSimplify/pr28272.ll

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ target triple = "x86_64-unknown-linux-gnu"
88
; after loop-simplify, we crash on assertion.
99

1010
; CHECK-LABEL: @foo
11-
define void @foo() {
11+
define void @foo(i1 %arg) {
1212
entry:
1313
br label %header
1414

@@ -37,7 +37,7 @@ bb54:
3737
}
3838

3939
; CHECK-LABEL: @foo2
40-
define void @foo2() {
40+
define void @foo2(i1 %arg) {
4141
entry:
4242
br label %outer
4343

@@ -66,7 +66,7 @@ loop2.if:
6666
i32 1, label %bb]
6767

6868
loop2.if.true:
69-
br i1 undef, label %loop2, label %bb
69+
br i1 %arg, label %loop2, label %bb
7070

7171
loop2.if.false:
7272
br label %loop2
@@ -78,29 +78,29 @@ bb:
7878
; When LoopSimplify separates nested loops, it might break LCSSA form: values
7979
; from the original loop might be used in exit blocks of the outer loop.
8080
; CHECK-LABEL: @foo3
81-
define void @foo3() {
81+
define void @foo3(i1 %arg) {
8282
entry:
8383
br label %bb1
8484

8585
bb1:
86-
br i1 undef, label %bb2, label %bb1
86+
br i1 %arg, label %bb2, label %bb1
8787

8888
bb2:
8989
%a = phi i32 [ undef, %bb1 ], [ %a, %bb3 ], [ undef, %bb5 ]
90-
br i1 undef, label %bb3, label %bb1
90+
br i1 %arg, label %bb3, label %bb1
9191

9292
bb3:
9393
%b = load ptr, ptr undef
94-
br i1 undef, label %bb2, label %bb4
94+
br i1 %arg, label %bb2, label %bb4
9595

9696
bb4:
97-
br i1 undef, label %bb5, label %bb6
97+
br i1 %arg, label %bb5, label %bb6
9898

9999
bb5:
100-
br i1 undef, label %bb2, label %bb4
100+
br i1 %arg, label %bb2, label %bb4
101101

102102
bb6:
103-
br i1 undef, label %bb_end, label %bb1
103+
br i1 %arg, label %bb_end, label %bb1
104104

105105
bb_end:
106106
%x = getelementptr i32, ptr %b
@@ -112,7 +112,7 @@ bb_end:
112112
; original loop (before separating it was a subloop of the original loop, and
113113
; thus didn't require an lcssa phi nodes).
114114
; CHECK-LABEL: @foo4
115-
define void @foo4() {
115+
define void @foo4(i1 %arg) {
116116
bb1:
117117
br label %bb2
118118

@@ -126,7 +126,7 @@ bb2.loopexit: ; preds = %bb3
126126
bb2: ; preds = %bb2.loopexit, %bb2, %bb1
127127
%i = phi i32 [ 0, %bb1 ], [ %i, %bb2 ], [ %i.ph, %bb2.loopexit ]
128128
%x = load i32, ptr undef, align 8
129-
br i1 undef, label %bb2, label %bb3.preheader
129+
br i1 %arg, label %bb2, label %bb3.preheader
130130

131131
; CHECK: bb3.preheader:
132132
bb3.preheader: ; preds = %bb2

llvm/test/Transforms/LoopSimplify/pr30454.ll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,18 @@ declare i8 @bar()
77

88
; Test that we preserve LCSSA form when removing edges from unreachable blocks.
99
; CHECK-LABEL: @foo
10-
define void @foo() {
10+
define void @foo(i1 %arg) {
1111
entry:
1212
br label %for.cond
1313

1414
for.cond:
1515
%x = phi i8 [ undef, %entry ], [ %y, %for.latch ]
16-
br i1 undef, label %for.latch, label %exit
16+
br i1 %arg, label %for.latch, label %exit
1717

1818
; CHECK: unreachable.bb:
1919
; CHECK-NEXT: unreachable
2020
unreachable.bb:
21-
br i1 undef, label %exit, label %for.latch
21+
br i1 %arg, label %exit, label %for.latch
2222

2323
for.latch:
2424
%y = call i8 @bar()

llvm/test/Transforms/LoopSimplify/unreachable-loop-pred.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55
; block to the enclosing loop and not get confused by the unreachable
66
; bogus loop entry.
77

8-
define void @is_extract_cab() nounwind {
8+
define void @is_extract_cab(i1 %arg) nounwind {
99
entry:
1010
br label %header
1111

1212
header: ; preds = %if.end206, %cond.end66, %if.end23
1313
br label %while.body115
1414

1515
while.body115: ; preds = %9, %if.end192, %if.end101
16-
br i1 undef, label %header, label %while.body115
16+
br i1 %arg, label %header, label %while.body115
1717

1818
foo:
1919
br label %while.body115

0 commit comments

Comments
 (0)