[llvm] fe9a5a8 - [LoopUnroll] Make some tests more robust (NFC)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Sat Apr 17 11:59:30 PDT 2021


Author: Nikita Popov
Date: 2021-04-17T20:59:20+02:00
New Revision: fe9a5a806e83063d0a39cefded39ab40c8e546ba

URL: https://github.com/llvm/llvm-project/commit/fe9a5a806e83063d0a39cefded39ab40c8e546ba
DIFF: https://github.com/llvm/llvm-project/commit/fe9a5a806e83063d0a39cefded39ab40c8e546ba.diff

LOG: [LoopUnroll] Make some tests more robust (NFC)

Replace branch on undef by branch on unknown condition.

Added: 
    

Modified: 
    llvm/test/Transforms/LoopUnroll/pr31718.ll
    llvm/test/Transforms/LoopUnroll/runtime-li.ll
    llvm/test/Transforms/LoopUnroll/runtime-loop-multiexit-dom-verify.ll

Removed: 
    


################################################################################
diff  --git a/llvm/test/Transforms/LoopUnroll/pr31718.ll b/llvm/test/Transforms/LoopUnroll/pr31718.ll
index 014ef7e501ec6..a06e67ace7403 100644
--- a/llvm/test/Transforms/LoopUnroll/pr31718.ll
+++ b/llvm/test/Transforms/LoopUnroll/pr31718.ll
@@ -13,7 +13,7 @@ target triple = "x86_64-unknown-linux-gnu"
 ; CHECK: {{.*}} = phi i32 [ %d.0, %h3.1 ]
 ; CHECK: br label %exit
 
-define void @main() local_unnamed_addr #0 {
+define void @main(i1 %c) local_unnamed_addr #0 {
 ph1:
   br label %h1
 
@@ -29,7 +29,7 @@ h2:
   br label %h3
 
 h3:
-  br i1 undef, label %latch3, label %exit
+  br i1 %c, label %latch3, label %exit
 
 latch3:
   br i1 false, label %exit3, label %h3
@@ -43,7 +43,7 @@ latch2:
   br i1 %cmp, label %h2, label %exit2
 
 exit2:
-  br i1 undef, label %latch1, label %ph2
+  br i1 %c, label %latch1, label %ph2
 
 latch1:                 ; preds = %exit2
   %1 = load i32, i32* @b, align 4

diff  --git a/llvm/test/Transforms/LoopUnroll/runtime-li.ll b/llvm/test/Transforms/LoopUnroll/runtime-li.ll
index a4a9b92028916..cc7150480cb6e 100644
--- a/llvm/test/Transforms/LoopUnroll/runtime-li.ll
+++ b/llvm/test/Transforms/LoopUnroll/runtime-li.ll
@@ -8,7 +8,7 @@ target triple = "x86_64-unknown-linux-gnu"
 ; CHECK: remark: {{.*}}: unrolled loop by a factor of 2 with run-time trip count
 ; CHECK: @widget
 ; CHECK: ret void
-define void @widget(double* %arg, double* %arg1, double* %p, i64* %q1, i64* %q2) local_unnamed_addr {
+define void @widget(double* %arg, double* %arg1, double* %p, i64* %q1, i64* %q2, i1 %c) local_unnamed_addr {
 entry:
   br label %header.outer
 
@@ -19,10 +19,10 @@ header.outer:                                     ; preds = %latch.outer, %entry
 header.inner:                                     ; preds = %latch.inner, %header.outer
   %tmp5 = load i64, i64* %q1, align 8
   %tmp6 = icmp eq double* %p, %arg
-  br i1 undef, label %exiting.inner, label %latch.outer
+  br i1 %c, label %exiting.inner, label %latch.outer
 
 exiting.inner:                                     ; preds = %latch.inner, %header.outer
-  br i1 undef, label %latch.inner, label %latch.outer
+  br i1 %c, label %latch.inner, label %latch.outer
 
 latch.inner:                                      ; preds = %header.inner
   store i64 %tmp5, i64* %q2, align 8

diff  --git a/llvm/test/Transforms/LoopUnroll/runtime-loop-multiexit-dom-verify.ll b/llvm/test/Transforms/LoopUnroll/runtime-loop-multiexit-dom-verify.ll
index d354d6842c7ff..5b8e5ef7fd1f4 100644
--- a/llvm/test/Transforms/LoopUnroll/runtime-loop-multiexit-dom-verify.ll
+++ b/llvm/test/Transforms/LoopUnroll/runtime-loop-multiexit-dom-verify.ll
@@ -174,7 +174,7 @@ otherexit:                                           ; preds = %exiting
 
 ; exit block (%exitB) has an exiting block and another exit block as predecessors.
 ; exiting block comes from inner loop.
-define void @test5() {
+define void @test5(i1 %c) {
 ; CHECK-LABEL: test5
 ; CHECK-LABEL: bb1:
 ; CHECK-NEXT:   br i1 false, label %outerH.prol.preheader, label %outerH.prol.loopexit
@@ -198,10 +198,10 @@ outerH:                                              ; preds = %outerLatch, %bb1
   br label %innerH
 
 innerH:                                              ; preds = %innerLatch, %outerH
-  br i1 undef, label %innerexiting, label %otherexitB
+  br i1 %c, label %innerexiting, label %otherexitB
 
 innerexiting:                                             ; preds = %innerH
-  br i1 undef, label %innerLatch, label %exitB
+  br i1 %c, label %innerLatch, label %exitB
 
 innerLatch:                                             ; preds = %innerexiting
   %tmp13 = fcmp olt double undef, 2.000000e+00
@@ -225,7 +225,7 @@ otherexitB:                                              ; preds = %innerH
 
 ; Blocks reachable from exits (not_zero44) have the IDom as the block within the loop (Header).
 ; Update the IDom to the preheader.
-define void @test6() {
+define void @test6(i1 %c) {
 ; CHECK-LABEL: test6
 ; CHECK-LABEL: header.prol.preheader:
 ; CHECK-NEXT:    br label %header.prol
@@ -234,7 +234,7 @@ define void @test6() {
 ; CHECK-NEXT:    %indvars.iv.prol = phi i64 [ undef, %header.prol.preheader ], [ %indvars.iv.next.prol, %latch.prol ]
 ; CHECK-NEXT:    %prol.iter = phi i64 [ %xtraiter, %header.prol.preheader ], [ %prol.iter.sub, %latch.prol ]
 
-; CHECK-NEXT:    br i1 false, label %latch.prol, label %otherexit.loopexit1
+; CHECK-NEXT:    br i1 %c, label %latch.prol, label %otherexit.loopexit1
 
 ; CHECK-LABEL: header.prol.loopexit.unr-lcssa:
 ; CHECK-NEXT:    %indvars.iv.unr.ph = phi i64 [ %indvars.iv.next.prol, %latch.prol ]
@@ -252,7 +252,7 @@ entry:
 
 header:                                          ; preds = %latch, %entry
   %indvars.iv = phi i64 [ undef, %entry ], [ %indvars.iv.next, %latch ]
-  br i1 undef, label %latch, label %otherexit
+  br i1 %c, label %latch, label %otherexit
 
 latch:                                         ; preds = %header
   %indvars.iv.next = add nsw i64 %indvars.iv, 2


        


More information about the llvm-commits mailing list