Skip to content

Commit

Permalink
[test] Remove occurences of br undef in Transform/Util tests [NFC]
Browse files Browse the repository at this point in the history
Differential Revision: https://reviews.llvm.org/D143770
  • Loading branch information
kritgpt authored and nunoplopes committed Feb 12, 2023
1 parent 069dd87 commit febe740
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions llvm/test/Transforms/Util/PredicateInfo/ordering.ll
Expand Up @@ -6,7 +6,7 @@ declare void @use.i1(i1)

; Make sure we are visiting the values to build predicate infos for in a
; deterministic order.
define i32 @test12(i32 %x, i32 %y) {
define i32 @test12(i32 %x, i32 %y, i1 %c1) {
; CHECK: Visiting %lcmp = icmp eq i32 %x, 0
; CHECK: Visiting i32 %x
; CHECK: Visiting %lcmp2 = icmp slt i32 %y, 1000
Expand All @@ -18,7 +18,7 @@ define i32 @test12(i32 %x, i32 %y) {
; CHECK: Visiting %lcmp7 = icmp slt i32 %y.0.1.2.3.4, 700
; CHECK: Visiting %rcmp = icmp eq i32 %x, 0
entry:
br i1 undef, label %left, label %right
br i1 %c1, label %left, label %right

left:
%lcmp = icmp eq i32 %x, 0
Expand Down
24 changes: 12 additions & 12 deletions llvm/test/Transforms/Util/lowerswitch.ll
Expand Up @@ -64,9 +64,9 @@ exit:
}

; Test that we don't crash.
define void @test2(i32 %mode) {
define void @test2(i32 %mode, i1 %c1, i1 %c2, i1 %c3, i1 %c4, i1 %c5, i1 %c6) {
; CHECK-LABEL: @test2
br i1 undef, label %1, label %._crit_edge
br i1 %c1, label %1, label %._crit_edge

; <label>:1 ; preds = %0
switch i32 %mode, label %33 [
Expand Down Expand Up @@ -118,7 +118,7 @@ define void @test2(i32 %mode) {
br label %34

; <label>:10 ; preds = %1
br i1 undef, label %11, label %12
br i1 %c2, label %11, label %12

; <label>:11 ; preds = %10
br label %13
Expand All @@ -130,7 +130,7 @@ define void @test2(i32 %mode) {
br label %34

; <label>:14 ; preds = %1
br i1 undef, label %15, label %16
br i1 %c3, label %15, label %16

; <label>:15 ; preds = %14
br label %17
Expand All @@ -142,7 +142,7 @@ define void @test2(i32 %mode) {
br label %34

; <label>:18 ; preds = %1
br i1 undef, label %19, label %20
br i1 %c4, label %19, label %20

; <label>:19 ; preds = %18
br label %21
Expand All @@ -154,7 +154,7 @@ define void @test2(i32 %mode) {
br label %34

; <label>:22 ; preds = %1
br i1 undef, label %23, label %24
br i1 %c5, label %23, label %24

; <label>:23 ; preds = %22
br label %25
Expand All @@ -169,7 +169,7 @@ define void @test2(i32 %mode) {
br label %34

; <label>:27 ; preds = %1
br i1 undef, label %28, label %29
br i1 %c6, label %28, label %29

; <label>:28 ; preds = %27
br label %30
Expand Down Expand Up @@ -200,7 +200,7 @@ define void @test2(i32 %mode) {
; Test that the PHI node in for.cond should have one entry for each predecessor
; of its parent basic block after lowerswitch merged several cases into a new
; default block.
define void @test3(i32 %mode) {
define void @test3(i32 %mode, i1 %c1, i1 %c2) {
; CHECK-LABEL: @test3
entry:
br label %lbl1
Expand All @@ -224,7 +224,7 @@ for.cond1: ; preds = %for.inc, %for.cond
br i1 %tobool, label %for.body, label %for.end

for.body: ; preds = %for.cond1
br i1 undef, label %if.then, label %for.inc
br i1 %c1, label %if.then, label %for.inc

if.then: ; preds = %for.body
br label %cleanup
Expand All @@ -233,7 +233,7 @@ for.inc: ; preds = %for.body
br label %for.cond1

for.end: ; preds = %for.cond1
br i1 undef, label %if.then4, label %for.body7
br i1 %c2, label %if.then4, label %for.body7

if.then4: ; preds = %for.end
br label %cleanup
Expand Down Expand Up @@ -277,10 +277,10 @@ return:

; Test that the PHI node in for.inc is updated correctly as the switch is
; replaced with a single branch to for.inc
define void @test5(i32 %mode) {
define void @test5(i32 %mode, i1 %c1) {
; CHECK-LABEL: @test5
entry:
br i1 undef, label %cleanup10, label %cleanup10.thread
br i1 %c1, label %cleanup10, label %cleanup10.thread

cleanup10.thread:
br label %for.inc
Expand Down
4 changes: 2 additions & 2 deletions llvm/test/Transforms/Util/simplify-dbg-declare-load.ll
Expand Up @@ -11,12 +11,12 @@ declare void @llvm.dbg.declare(metadata, metadata, metadata) #0
declare void @llvm.dbg.value(metadata, metadata, metadata) #0

; Function Attrs: sspreq
define void @julia_fastshortest_6256() #1 {
define void @julia_fastshortest_6256(i1 %c1) #1 {
top:
%cp = alloca %foo, align 8
%sink = alloca %foo, align 8
call void @llvm.dbg.declare(metadata ptr %cp, metadata !1, metadata !16), !dbg !17
br i1 undef, label %idxend, label %fail
br i1 %c1, label %idxend, label %fail

fail: ; preds = %top
unreachable
Expand Down

0 comments on commit febe740

Please sign in to comment.