[llvm] 80ab16d - [NFC][LoopCacheAnalysis] Update test cases to make sure the outputs follow the right order

via llvm-commits llvm-commits at lists.llvm.org
Wed May 25 20:34:14 PDT 2022


Author: Congzhe Cao
Date: 2022-05-25T23:32:00-04:00
New Revision: 80ab16d0ed7535e752f4c90f6a89ccff108a22e2

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

LOG: [NFC][LoopCacheAnalysis] Update test cases to make sure the outputs follow the right order

In this patch we change test cases from using "CHECK" to using
"CHECK-NEXT", which is to ensure the order of loops output by
loop cache analysis is correct. After D124725 we fixed the
non-deterministic output order hence we did not use "CHECK-DAG"
anymore, and now we should really use "CHECK-NEXT" to make sure
the loops in the output loop vector follow the right order.

Reviewed By: bmahjour, #loopoptwg

Differential Revision: https://reviews.llvm.org/D124984

Added: 
    

Modified: 
    llvm/test/Analysis/LoopCacheAnalysis/PowerPC/LoopnestFixedSize.ll
    llvm/test/Analysis/LoopCacheAnalysis/PowerPC/loads-store.ll
    llvm/test/Analysis/LoopCacheAnalysis/PowerPC/matmul.ll
    llvm/test/Analysis/LoopCacheAnalysis/PowerPC/matvecmul.ll
    llvm/test/Analysis/LoopCacheAnalysis/PowerPC/multi-store.ll
    llvm/test/Analysis/LoopCacheAnalysis/PowerPC/single-store.ll
    llvm/test/Analysis/LoopCacheAnalysis/PowerPC/stencil.ll

Removed: 
    


################################################################################
diff  --git a/llvm/test/Analysis/LoopCacheAnalysis/PowerPC/LoopnestFixedSize.ll b/llvm/test/Analysis/LoopCacheAnalysis/PowerPC/LoopnestFixedSize.ll
index bb868b5d43503..47ac25f68903d 100644
--- a/llvm/test/Analysis/LoopCacheAnalysis/PowerPC/LoopnestFixedSize.ll
+++ b/llvm/test/Analysis/LoopCacheAnalysis/PowerPC/LoopnestFixedSize.ll
@@ -7,7 +7,7 @@ target triple = "powerpc64le-unknown-linux-gnu"
 ; The IR is copied from llvm/test/Analysis/DependenceAnalysis/SimpleSIVNoValidityCheckFixedSize.ll
 
 ; CHECK: Loop 'for.body' has cost = 4186116
-; CHECK: Loop 'for.body4' has cost = 128898
+; CHECK-NEXT: Loop 'for.body4' has cost = 128898
 
 ;; #define N 1024
 ;; #define M 2048
@@ -49,7 +49,7 @@ for.end13:                                        ; preds = %for.inc11
 
 
 ; CHECK: Loop 'for.body' has cost = 4186116
-; CHECK: Loop 'for.body4' has cost = 128898
+; CHECK-NEXT: Loop 'for.body4' has cost = 128898
 
 define void @t2([2048 x i32]* %a) {
 entry:
@@ -84,10 +84,10 @@ for.end13:                                        ; preds = %for.inc11
 declare [2048 x i32]* @func_with_returned_arg([2048 x i32]* returned %arg)
 
 ; CHECK: Loop 'for.body' has cost = 2112128815104000000
-; CHECK: Loop 'for.body4' has cost = 16762927104000000
-; CHECK: Loop 'for.body8' has cost = 130960368000000
-; CHECK: Loop 'for.body12' has cost = 1047682944000
-; CHECK: Loop 'for.body16' has cost = 32260032000
+; CHECK-NEXT: Loop 'for.body4' has cost = 16762927104000000
+; CHECK-NEXT: Loop 'for.body8' has cost = 130960368000000
+; CHECK-NEXT: Loop 'for.body12' has cost = 1047682944000
+; CHECK-NEXT: Loop 'for.body16' has cost = 32260032000
 
 ;; #define N 128
 ;; #define M 2048

diff  --git a/llvm/test/Analysis/LoopCacheAnalysis/PowerPC/loads-store.ll b/llvm/test/Analysis/LoopCacheAnalysis/PowerPC/loads-store.ll
index c5c9e7602e9ba..3eb21c25f4bfa 100644
--- a/llvm/test/Analysis/LoopCacheAnalysis/PowerPC/loads-store.ll
+++ b/llvm/test/Analysis/LoopCacheAnalysis/PowerPC/loads-store.ll
@@ -11,8 +11,8 @@ target triple = "powerpc64le-unknown-linux-gnu"
 ; }
 
 ; CHECK: Loop 'for.i' has cost = 3000000
-; CHECK: Loop 'for.k' has cost = 2030000
-; CHECK: Loop 'for.j' has cost = 1060000
+; CHECK-NEXT: Loop 'for.k' has cost = 2030000
+; CHECK-NEXT: Loop 'for.j' has cost = 1060000
 
 define void @foo(i64 %n, i64 %m, i64 %o, i32* %A, i32* %B, i32* %C) {
 entry:

diff  --git a/llvm/test/Analysis/LoopCacheAnalysis/PowerPC/matmul.ll b/llvm/test/Analysis/LoopCacheAnalysis/PowerPC/matmul.ll
index 6679b1980ddc6..08ceb569eac4a 100644
--- a/llvm/test/Analysis/LoopCacheAnalysis/PowerPC/matmul.ll
+++ b/llvm/test/Analysis/LoopCacheAnalysis/PowerPC/matmul.ll
@@ -11,8 +11,8 @@ target triple = "powerpc64le-unknown-linux-gnu"
 ; }
 
 ; CHECK:Loop 'for.i' has cost = 2010000
-; CHECK:Loop 'for.k' has cost = 1040000
-; CHECK:Loop 'for.j' has cost = 70000
+; CHECK-NEXT:Loop 'for.k' has cost = 1040000
+; CHECK-NEXT:Loop 'for.j' has cost = 70000
     
 define void @matmul(i64 %n, i64 %m, i64 %o, i32* %A, i32* %B, i32* %C) {
 entry:

diff  --git a/llvm/test/Analysis/LoopCacheAnalysis/PowerPC/matvecmul.ll b/llvm/test/Analysis/LoopCacheAnalysis/PowerPC/matvecmul.ll
index 2b317c02b7fb8..a39dff4460c46 100644
--- a/llvm/test/Analysis/LoopCacheAnalysis/PowerPC/matvecmul.ll
+++ b/llvm/test/Analysis/LoopCacheAnalysis/PowerPC/matvecmul.ll
@@ -15,10 +15,10 @@ target triple = "powerpc64le-unknown-linux-gnu"
 ; }
 
 ; CHECK: Loop 'k_loop' has cost = 10200000000000000
-; CHECK: Loop 'j_loop' has cost = 102000000000000
-; CHECK: Loop 'i_loop' has cost = 1020000000000
-; CHECK: Loop 'm_loop' has cost = 10700000000
-; CHECK: Loop 'l_loop' has cost = 1300000000
+; CHECK-NEXT: Loop 'j_loop' has cost = 102000000000000
+; CHECK-NEXT: Loop 'i_loop' has cost = 1020000000000
+; CHECK-NEXT: Loop 'm_loop' has cost = 10700000000
+; CHECK-NEXT: Loop 'l_loop' has cost = 1300000000
 
 %_elem_type_of_double = type <{ double }>
 

diff  --git a/llvm/test/Analysis/LoopCacheAnalysis/PowerPC/multi-store.ll b/llvm/test/Analysis/LoopCacheAnalysis/PowerPC/multi-store.ll
index 89d959e927840..d334bfe2c6137 100644
--- a/llvm/test/Analysis/LoopCacheAnalysis/PowerPC/multi-store.ll
+++ b/llvm/test/Analysis/LoopCacheAnalysis/PowerPC/multi-store.ll
@@ -3,9 +3,9 @@
 target datalayout = "e-m:e-i64:64-n32:64-S128-v256:256:256-v512:512:512"
 target triple = "powerpc64le-unknown-linux-gnu"
 
-; CHECK-DAG: Loop 'for.j' has cost = 201000000
-; CHECK-DAG: Loop 'for.i' has cost = 102000000
-; CHECK-DAG: Loop 'for.k' has cost = 90000
+; CHECK: Loop 'for.j' has cost = 201000000
+; CHECK-NEXT: Loop 'for.i' has cost = 102000000
+; CHECK-NEXT: Loop 'for.k' has cost = 90000
 
 ;; Test to make sure when we have multiple conflicting access patterns, the 
 ;; chosen loop configuration favours the majority of those accesses. 

diff  --git a/llvm/test/Analysis/LoopCacheAnalysis/PowerPC/single-store.ll b/llvm/test/Analysis/LoopCacheAnalysis/PowerPC/single-store.ll
index 24d8e932a504b..9a060e8d6249e 100644
--- a/llvm/test/Analysis/LoopCacheAnalysis/PowerPC/single-store.ll
+++ b/llvm/test/Analysis/LoopCacheAnalysis/PowerPC/single-store.ll
@@ -11,8 +11,8 @@ target triple = "powerpc64le-unknown-linux-gnu"
 ; }
 
 ; CHECK: Loop 'for.i' has cost = 100000000
-; CHECK: Loop 'for.j' has cost = 1000000
-; CHECK: Loop 'for.k' has cost = 60000
+; CHECK-NEXT: Loop 'for.j' has cost = 1000000
+; CHECK-NEXT: Loop 'for.k' has cost = 60000
 
 define void @foo(i64 %n, i64 %m, i64 %o, i32* %A) {
 entry:

diff  --git a/llvm/test/Analysis/LoopCacheAnalysis/PowerPC/stencil.ll b/llvm/test/Analysis/LoopCacheAnalysis/PowerPC/stencil.ll
index f2549f4c96f64..b799595f65a57 100644
--- a/llvm/test/Analysis/LoopCacheAnalysis/PowerPC/stencil.ll
+++ b/llvm/test/Analysis/LoopCacheAnalysis/PowerPC/stencil.ll
@@ -12,7 +12,7 @@ target triple = "powerpc64le-unknown-linux-gnu"
 ; }
 
 ; CHECK: Loop 'for.i' has cost = 20600
-; CHECK: Loop 'for.j' has cost = 800
+; CHECK-NEXT: Loop 'for.j' has cost = 800
 
 define void @foo(i64 %n, i64 %m, i32* %A, i32* %B, i32* %C) {
 entry:


        


More information about the llvm-commits mailing list