Skip to content

Commit 6e94007

Browse files
authored
[llvm] Remove br i1 undef in some llvm/test/CodeGen tests (#127368)
This PR replaces some instances of `br i1 undef` with function argument value in several tests under `llvm/test/CodeGen/ `directory. This PR is a continuation of PR #125460
1 parent 6812fc0 commit 6e94007

12 files changed

+32
-32
lines changed

llvm/test/CodeGen/AArch64/arm64-storebytesmerge.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@
1414
@q = external dso_local unnamed_addr global ptr, align 8
1515

1616
; Function Attrs: nounwind
17-
define void @test() local_unnamed_addr #0 {
17+
define void @test(i1 %arg) local_unnamed_addr #0 {
1818
entry:
1919
br label %for.body453.i
2020

2121
for.body453.i: ; preds = %for.body453.i, %entry
22-
br i1 undef, label %for.body453.i, label %for.end705.i
22+
br i1 %arg, label %for.body453.i, label %for.end705.i
2323

2424
for.end705.i: ; preds = %for.body453.i
2525
%0 = load ptr, ptr @q, align 8

llvm/test/CodeGen/AArch64/br-to-eh-lpad.ll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@
77
; that case, the machine verifier, which relies on analyzing branches for this
88
; kind of verification, is unable to check anything, so accepts the CFG.
99

10-
define void @test_branch_to_landingpad() personality ptr @__objc_personality_v0 {
10+
define void @test_branch_to_landingpad(i1 %arg) personality ptr @__objc_personality_v0 {
1111
entry:
12-
br i1 undef, label %if.end50.thread, label %if.then6
12+
br i1 %arg, label %if.end50.thread, label %if.then6
1313

1414
lpad:
1515
%0 = landingpad { ptr, i32 }
1616
catch ptr @"OBJC_EHTYPE_$_NSString"
1717
catch ptr @OBJC_EHTYPE_id
1818
catch ptr null
19-
br i1 undef, label %invoke.cont33, label %catch.fallthrough
19+
br i1 %arg, label %invoke.cont33, label %catch.fallthrough
2020

2121
catch.fallthrough:
2222
%matches31 = icmp eq i32 undef, 0

llvm/test/CodeGen/AArch64/br-undef-cond.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ declare void @bar(ptr)
99

1010
define void @foo(ptr %m, i32 %off0) {
1111
.thread1653:
12-
br i1 undef, label %0, label %.thread1880
12+
br i1 poison, label %0, label %.thread1880
1313

1414
%1 = icmp eq i32 undef, 0
1515
%.not = xor i1 %1, true

llvm/test/CodeGen/AArch64/gep-nullptr.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ target triple = "aarch64--linux-gnu"
66
%unionMV = type { i32 }
77

88
; Function Attrs: nounwind
9-
define void @test(ptr %mi_block) {
9+
define void @test(ptr %mi_block, i1 %arg) {
1010
entry:
11-
br i1 undef, label %for.body13.us, label %if.else
11+
br i1 %arg, label %for.body13.us, label %if.else
1212

1313
; Just make sure we don't get a compiler ICE due to dereferncing a nullptr.
1414
; CHECK-LABEL: test

llvm/test/CodeGen/AArch64/machine-sink-getmemoperandwithoffset.mir

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# RUN: llc -mtriple=aarch64-none-linux-gnu -run-pass machine-sink -o - %s | FileCheck %s
22
--- |
3-
define i8 @g() {
3+
define i8 @g(i1 %arg) {
44
else.7:
5-
br i1 undef, label %then.8, label %else.8, !make.implicit !0
5+
br i1 %arg, label %then.8, label %else.8, !make.implicit !0
66

77
then.8: ; preds = %else.8, %else.7
88
%merge = phi i8 [ 1, %else.7 ], [ 0, %else.8 ]

llvm/test/CodeGen/AArch64/madd-combiner.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ define void @mul_add_imm2() {
5353
entry:
5454
br label %for.body
5555
for.body:
56-
br i1 undef, label %for.body, label %for.body8
56+
br i1 poison, label %for.body, label %for.body8
5757
for.body8:
5858
%0 = mul i64 undef, -3
5959
%mul1971 = add i64 %0, -3

llvm/test/CodeGen/AArch64/optimize-cond-branch.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ define void @func() uwtable {
3838
br i1 %c0, label %b1, label %b6
3939

4040
b1:
41-
br i1 undef, label %b3, label %b2
41+
br i1 poison, label %b3, label %b2
4242

4343
b2:
4444
%v0 = tail call i32 @extfunc()

llvm/test/CodeGen/AArch64/shrink-wrap.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ declare fastcc i32 @foo()
3131

3232
declare fastcc i32 @bar()
3333

34-
define internal fastcc i32 @func(i32 %alpha, i32 %beta) {
34+
define internal fastcc i32 @func(i32 %alpha, i32 %beta, i1 %arg) {
3535
entry:
3636
%v1 = alloca [2 x [11 x i32]], align 4
3737
%v2 = alloca [11 x i32], align 16
@@ -69,7 +69,7 @@ for.body:
6969
%a.0983 = phi i32 [ 1, %if.end.9 ], [ %a.1, %for.inc ]
7070
%arrayidx = getelementptr inbounds [62 x i32], ptr @g17, i64 0, i64 undef
7171
%tmp5 = load i32, ptr %arrayidx, align 4
72-
br i1 undef, label %for.inc, label %if.else.51
72+
br i1 %arg, label %for.inc, label %if.else.51
7373

7474
if.else.51:
7575
%idxprom53 = sext i32 %tmp5 to i64

llvm/test/CodeGen/AArch64/tail-call-unused-zext.ll

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
; the attributes of the caller and the callee match.
77

88
declare zeroext i1 @zcallee()
9-
define void @zcaller() {
9+
define void @zcaller(i1 %arg) {
1010
; CHECK-LABEL: name: zcaller
1111
entry:
12-
br i1 undef, label %calllabel, label %retlabel
12+
br i1 %arg, label %calllabel, label %retlabel
1313
calllabel:
1414
; CHECK: bb.1.calllabel:
1515
; CHECK-NOT: BL @zcallee
@@ -21,10 +21,10 @@ retlabel:
2121
}
2222

2323
declare signext i1 @scallee()
24-
define void @scaller() {
24+
define void @scaller(i1 %arg) {
2525
; CHECK-LABEL: name: scaller
2626
entry:
27-
br i1 undef, label %calllabel, label %retlabel
27+
br i1 %arg, label %calllabel, label %retlabel
2828
calllabel:
2929
; CHECK: bb.1.calllabel:
3030
; CHECK-NOT: BL @scallee

llvm/test/CodeGen/AArch64/tailcall-ssp-split-debug.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
; RUN: llc -mtriple=arm64-apple-ios %s -o - | FileCheck %s
22

3-
define swifttailcc void @foo(ptr %call) ssp {
3+
define swifttailcc void @foo(ptr %call, i1 %arg) ssp {
44
; CHECK-LABEL: foo:
55
%var = alloca [28 x i8], align 16
6-
br i1 undef, label %if.then, label %if.end
6+
br i1 %arg, label %if.then, label %if.end
77

88
if.then:
99
ret void

0 commit comments

Comments
 (0)