[llvm] 2ab8770 - [test][SampleProfile][NewPM] Fix some tests under NPM

Arthur Eubanks via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 30 09:44:41 PDT 2020


Author: Arthur Eubanks
Date: 2020-09-30T09:44:29-07:00
New Revision: 2ab87702231e193ca170aa8ad4caa9f98bc7ced1

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

LOG: [test][SampleProfile][NewPM] Fix some tests under NPM

Added: 
    

Modified: 
    llvm/test/Transforms/SampleProfile/branch.ll
    llvm/test/Transforms/SampleProfile/calls.ll
    llvm/test/Transforms/SampleProfile/discriminator.ll
    llvm/test/Transforms/SampleProfile/fnptr.ll
    llvm/test/Transforms/SampleProfile/offset.ll
    llvm/test/Transforms/SampleProfile/propagate.ll
    llvm/test/Transforms/SampleProfile/remap.ll

Removed: 
    


################################################################################
diff  --git a/llvm/test/Transforms/SampleProfile/branch.ll b/llvm/test/Transforms/SampleProfile/branch.ll
index 6e7a9eb7208c..32c857c56d60 100644
--- a/llvm/test/Transforms/SampleProfile/branch.ll
+++ b/llvm/test/Transforms/SampleProfile/branch.ll
@@ -1,5 +1,5 @@
-; RUN: opt < %s -sample-profile -sample-profile-file=%S/Inputs/branch.prof | opt -analyze -branch-prob | FileCheck %s
-; RUN: opt < %s -passes=sample-profile -sample-profile-file=%S/Inputs/branch.prof | opt -analyze -branch-prob | FileCheck %s
+; RUN: opt < %s -sample-profile -sample-profile-file=%S/Inputs/branch.prof | opt -analyze -branch-prob -enable-new-pm=0 | FileCheck %s
+; RUN: opt < %s -passes=sample-profile -sample-profile-file=%S/Inputs/branch.prof | opt -passes='print<branch-prob>' -disable-output 2>&1 | FileCheck %s
 
 ; Original C++ code for this test case:
 ;
@@ -30,7 +30,7 @@
 
 ; Function Attrs: uwtable
 define i32 @main(i32 %argc, i8** %argv) #0 !dbg !6 {
-; CHECK: Printing analysis 'Branch Probability Analysis' for function 'main':
+; CHECK: Printing analysis {{.*}} for function 'main':
 
 entry:
   %retval = alloca i32, align 4

diff  --git a/llvm/test/Transforms/SampleProfile/calls.ll b/llvm/test/Transforms/SampleProfile/calls.ll
index f92bf547182a..ecd188fcaf0e 100644
--- a/llvm/test/Transforms/SampleProfile/calls.ll
+++ b/llvm/test/Transforms/SampleProfile/calls.ll
@@ -1,5 +1,5 @@
-; RUN: opt < %s -instcombine -sample-profile -sample-profile-file=%S/Inputs/calls.prof | opt -analyze -branch-prob | FileCheck %s
-; RUN: opt < %s -passes="function(instcombine),sample-profile" -sample-profile-file=%S/Inputs/calls.prof | opt -analyze -branch-prob | FileCheck %s
+; RUN: opt < %s -instcombine -sample-profile -sample-profile-file=%S/Inputs/calls.prof | opt -analyze -branch-prob -enable-new-pm=0 | FileCheck %s
+; RUN: opt < %s -passes="function(instcombine),sample-profile" -sample-profile-file=%S/Inputs/calls.prof | opt -passes='print<branch-prob>' -disable-output 2>&1 | FileCheck %s
 
 ; Original C++ test case
 ;

diff  --git a/llvm/test/Transforms/SampleProfile/discriminator.ll b/llvm/test/Transforms/SampleProfile/discriminator.ll
index 4908c313dc5c..7e2d23ef018c 100644
--- a/llvm/test/Transforms/SampleProfile/discriminator.ll
+++ b/llvm/test/Transforms/SampleProfile/discriminator.ll
@@ -1,5 +1,5 @@
-; RUN: opt < %s -sample-profile -sample-profile-file=%S/Inputs/discriminator.prof | opt -analyze -branch-prob | FileCheck %s
-; RUN: opt < %s -passes=sample-profile -sample-profile-file=%S/Inputs/discriminator.prof | opt -analyze -branch-prob | FileCheck %s
+; RUN: opt < %s -sample-profile -sample-profile-file=%S/Inputs/discriminator.prof | opt -analyze -branch-prob -enable-new-pm=0 | FileCheck %s
+; RUN: opt < %s -passes=sample-profile -sample-profile-file=%S/Inputs/discriminator.prof | opt -passes='print<branch-prob>' -disable-output 2>&1 | FileCheck %s
 
 ; Original code
 ;
@@ -23,7 +23,7 @@
 ; but the then branch (line 3.1) is only executed 5 times.
 
 define i32 @foo(i32 %i) #0 !dbg !4 {
-; CHECK: Printing analysis 'Branch Probability Analysis' for function 'foo':
+; CHECK: Printing analysis {{.*}} for function 'foo':
 entry:
   %i.addr = alloca i32, align 4
   %x = alloca i32, align 4

diff  --git a/llvm/test/Transforms/SampleProfile/fnptr.ll b/llvm/test/Transforms/SampleProfile/fnptr.ll
index c22fc8403d87..94925b4a9170 100644
--- a/llvm/test/Transforms/SampleProfile/fnptr.ll
+++ b/llvm/test/Transforms/SampleProfile/fnptr.ll
@@ -2,11 +2,11 @@
 ; formats. This checks that we produce the same profile annotations regardless
 ; of the profile format.
 ;
-; RUN: opt < %s -sample-profile -sample-profile-file=%S/Inputs/fnptr.prof | opt -analyze -branch-prob | FileCheck %s
-; RUN: opt < %s -sample-profile -sample-profile-file=%S/Inputs/fnptr.binprof | opt -analyze -branch-prob | FileCheck %s
+; RUN: opt < %s -sample-profile -sample-profile-file=%S/Inputs/fnptr.prof | opt -analyze -branch-prob -enable-new-pm=0 | FileCheck %s
+; RUN: opt < %s -sample-profile -sample-profile-file=%S/Inputs/fnptr.binprof | opt -analyze -branch-prob  -enable-new-pm=0| FileCheck %s
 
-; RUN: opt < %s -passes=sample-profile -sample-profile-file=%S/Inputs/fnptr.prof | opt -analyze -branch-prob | FileCheck %s
-; RUN: opt < %s -passes=sample-profile -sample-profile-file=%S/Inputs/fnptr.binprof | opt -analyze -branch-prob | FileCheck %s
+; RUN: opt < %s -passes=sample-profile -sample-profile-file=%S/Inputs/fnptr.prof | opt -passes='print<branch-prob>' -disable-output 2>&1 | FileCheck %s
+; RUN: opt < %s -passes=sample-profile -sample-profile-file=%S/Inputs/fnptr.binprof | opt -passes='print<branch-prob>' -disable-output 2>&1 | FileCheck %s
 
 ; CHECK:   edge for.body3 -> if.then probability is 0x1a56a56a / 0x80000000 = 20.58%
 ; CHECK:   edge for.body3 -> if.else probability is 0x65a95a96 / 0x80000000 = 79.42%

diff  --git a/llvm/test/Transforms/SampleProfile/offset.ll b/llvm/test/Transforms/SampleProfile/offset.ll
index 8451efe62b8e..b537b2436097 100644
--- a/llvm/test/Transforms/SampleProfile/offset.ll
+++ b/llvm/test/Transforms/SampleProfile/offset.ll
@@ -1,5 +1,5 @@
-; RUN: opt < %s -sample-profile -sample-profile-file=%S/Inputs/offset.prof | opt -analyze -branch-prob | FileCheck %s
-; RUN: opt < %s -passes=sample-profile -sample-profile-file=%S/Inputs/offset.prof | opt -analyze -branch-prob | FileCheck %s
+; RUN: opt < %s -sample-profile -sample-profile-file=%S/Inputs/offset.prof | opt -analyze -branch-prob -enable-new-pm=0 | FileCheck %s
+; RUN: opt < %s -passes=sample-profile -sample-profile-file=%S/Inputs/offset.prof | opt -passes='print<branch-prob>' -disable-output 2>&1 | FileCheck %s
 
 ; Original C++ code for this test case:
 ;

diff  --git a/llvm/test/Transforms/SampleProfile/propagate.ll b/llvm/test/Transforms/SampleProfile/propagate.ll
index b8db9f68c82a..74a6a700a8e5 100644
--- a/llvm/test/Transforms/SampleProfile/propagate.ll
+++ b/llvm/test/Transforms/SampleProfile/propagate.ll
@@ -1,5 +1,5 @@
-; RUN: opt < %s -sample-profile -sample-profile-file=%S/Inputs/propagate.prof | opt -analyze -branch-prob | FileCheck %s
-; RUN: opt < %s -passes=sample-profile -sample-profile-file=%S/Inputs/propagate.prof | opt -analyze -branch-prob | FileCheck %s
+; RUN: opt < %s -sample-profile -sample-profile-file=%S/Inputs/propagate.prof | opt -analyze -branch-prob -enable-new-pm=0 | FileCheck %s
+; RUN: opt < %s -passes=sample-profile -sample-profile-file=%S/Inputs/propagate.prof | opt -passes='print<branch-prob>' -disable-output 2>&1 | FileCheck %s
 
 ; Original C++ code for this test case:
 ;

diff  --git a/llvm/test/Transforms/SampleProfile/remap.ll b/llvm/test/Transforms/SampleProfile/remap.ll
index b7b3fb16bb94..090f4b3fde3a 100644
--- a/llvm/test/Transforms/SampleProfile/remap.ll
+++ b/llvm/test/Transforms/SampleProfile/remap.ll
@@ -1,15 +1,15 @@
-; RUN: opt %s -passes=sample-profile -sample-profile-file=%S/Inputs/remap.prof -sample-profile-remapping-file=%S/Inputs/remap.map | opt -analyze -branch-prob | FileCheck %s
+; RUN: opt %s -passes=sample-profile -sample-profile-file=%S/Inputs/remap.prof -sample-profile-remapping-file=%S/Inputs/remap.map | opt -passes='print<branch-prob>' -disable-output 2>&1 | FileCheck %s
 ;
 ; Check whether profile remapping work with loading profile on demand used by extbinary format profile.
 ; RUN: llvm-profdata merge -sample -extbinary %S/Inputs/remap.prof -o %t.extbinary.afdo
-; RUN: opt %s -passes=sample-profile -sample-profile-file=%t.extbinary.afdo -sample-profile-remapping-file=%S/Inputs/remap.map | opt -analyze -branch-prob | FileCheck %s
+; RUN: opt %s -passes=sample-profile -sample-profile-file=%t.extbinary.afdo -sample-profile-remapping-file=%S/Inputs/remap.map | opt -passes='print<branch-prob>' -disable-output 2>&1 | FileCheck %s
 ;
 ; Reduced from branch.ll
 
 declare i1 @foo()
 
 define void @_ZN3foo3barERKN1M1XINS_6detail3quxEEE() #0 !dbg !2 {
-; CHECK: Printing analysis 'Branch Probability Analysis' for function '_ZN3foo3barERKN1M1XINS_6detail3quxEEE':
+; CHECK: Printing analysis {{.*}} for function '_ZN3foo3barERKN1M1XINS_6detail3quxEEE':
 
 entry:
   %cmp = call i1 @foo(), !dbg !6


        


More information about the llvm-commits mailing list