[llvm] 5250e7a - [test] Change -sample-profile tests to -passes=

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 17 12:00:46 PDT 2022


Author: Fangrui Song
Date: 2022-07-17T12:00:41-07:00
New Revision: 5250e7a0d826de0455e2fa18bd531d823999814a

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

LOG: [test] Change -sample-profile tests to -passes=

so that we can remove SampleProfileLoaderLegacyPass.

Added: 
    

Modified: 
    llvm/test/Transforms/SampleProfile/cov-zero-samples.ll
    llvm/test/Transforms/SampleProfile/early-inline.ll
    llvm/test/Transforms/SampleProfile/entry_counts_missing_dbginfo.ll
    llvm/test/Transforms/SampleProfile/indirect-call-gcc.ll
    llvm/test/Transforms/SampleProfile/indirect-call.ll
    llvm/test/Transforms/SampleProfile/inline-act.ll
    llvm/test/Transforms/SampleProfile/inline-cold-callsite-samplepgo.ll
    llvm/test/Transforms/SampleProfile/inline-combine.ll
    llvm/test/Transforms/SampleProfile/inline-coverage.ll
    llvm/test/Transforms/SampleProfile/nodebug.ll
    llvm/test/Transforms/SampleProfile/section-accurate-samplepgo.ll
    llvm/test/Transforms/SampleProfile/summary.ll

Removed: 
    


################################################################################
diff  --git a/llvm/test/Transforms/SampleProfile/cov-zero-samples.ll b/llvm/test/Transforms/SampleProfile/cov-zero-samples.ll
index 30f3b14fc233..43ba65b9c8f8 100644
--- a/llvm/test/Transforms/SampleProfile/cov-zero-samples.ll
+++ b/llvm/test/Transforms/SampleProfile/cov-zero-samples.ll
@@ -1,5 +1,5 @@
-; RUN: opt < %s -instcombine -sample-profile -sample-profile-file=%S/Inputs/cov-zero-samples.prof -sample-profile-check-record-coverage=100 -pass-remarks=sample-profile -pass-remarks-analysis=sample-profile -o /dev/null 2>&1 | FileCheck %s
-; RUN: opt < %s -passes="function(instcombine),sample-profile" -sample-profile-file=%S/Inputs/cov-zero-samples.prof -sample-profile-check-record-coverage=100 -pass-remarks=sample-profile -pass-remarks-analysis=sample-profile -o /dev/null 2>&1 | FileCheck %s
+; RUN: opt %s -passes='function(instcombine),sample-profile' -sample-profile-file=%S/Inputs/cov-zero-samples.prof -sample-profile-check-record-coverage=100 -pass-remarks=sample-profile -pass-remarks-analysis=sample-profile -o /dev/null 2>&1 | FileCheck %s
+; RUN: opt %s -passes="function(instcombine),sample-profile" -sample-profile-file=%S/Inputs/cov-zero-samples.prof -sample-profile-check-record-coverage=100 -pass-remarks=sample-profile -pass-remarks-analysis=sample-profile -o /dev/null 2>&1 | FileCheck %s
 ;
 ; CHECK: remark: cov-zero-samples.cc:9:29: Applied 404065 samples from profile (offset: 2.1)
 ; CHECK: remark: cov-zero-samples.cc:10:9: Applied 443089 samples from profile (offset: 3)

diff  --git a/llvm/test/Transforms/SampleProfile/early-inline.ll b/llvm/test/Transforms/SampleProfile/early-inline.ll
index b14316ceda60..204e0bb2951e 100644
--- a/llvm/test/Transforms/SampleProfile/early-inline.ll
+++ b/llvm/test/Transforms/SampleProfile/early-inline.ll
@@ -1,4 +1,4 @@
-; RUN: opt < %s -instcombine -sample-profile -sample-profile-file=%S/Inputs/einline.prof -S | FileCheck %s
+; RUN: opt -S %s -passes='function(instcombine),sample-profile' -sample-profile-file=%S/Inputs/einline.prof | FileCheck %s
 
 ; Checks if both call and invoke can be inlined early if their inlined
 ; instances are hot in profile.

diff  --git a/llvm/test/Transforms/SampleProfile/entry_counts_missing_dbginfo.ll b/llvm/test/Transforms/SampleProfile/entry_counts_missing_dbginfo.ll
index a6def2f18ab4..52ed936d90de 100644
--- a/llvm/test/Transforms/SampleProfile/entry_counts_missing_dbginfo.ll
+++ b/llvm/test/Transforms/SampleProfile/entry_counts_missing_dbginfo.ll
@@ -1,4 +1,4 @@
-; RUN: opt < %s -sample-profile -sample-profile-file=%S/Inputs/entry_counts_cold.prof -S -profile-sample-accurate | FileCheck %s
+; RUN: opt -S %s -passes=sample-profile -sample-profile-file=%S/Inputs/entry_counts_cold.prof -profile-sample-accurate | FileCheck %s
 ; ModuleID = 'temp.bc'
 ; This is a test similar to entry_counts_cold.ll. The key 
diff erences are:
 ; - we want profile-sample-accurate. Normally, that would trigger resetting function entry counts to 0, and then update

diff  --git a/llvm/test/Transforms/SampleProfile/indirect-call-gcc.ll b/llvm/test/Transforms/SampleProfile/indirect-call-gcc.ll
index a9b3eaacff7b..61b320d86d73 100644
--- a/llvm/test/Transforms/SampleProfile/indirect-call-gcc.ll
+++ b/llvm/test/Transforms/SampleProfile/indirect-call-gcc.ll
@@ -1,4 +1,4 @@
-; RUN: opt < %s -sample-profile -sample-profile-file=%S/Inputs/indirect-call.afdo -S | FileCheck %s
+; RUN: opt -S %s -passes=sample-profile -sample-profile-file=%S/Inputs/indirect-call.afdo | FileCheck %s
 
 ; Checks if indirect call targets are read correctly when reading from gcc
 ; format profile.

diff  --git a/llvm/test/Transforms/SampleProfile/indirect-call.ll b/llvm/test/Transforms/SampleProfile/indirect-call.ll
index 2a652a902b4e..90566a639cc7 100644
--- a/llvm/test/Transforms/SampleProfile/indirect-call.ll
+++ b/llvm/test/Transforms/SampleProfile/indirect-call.ll
@@ -1,5 +1,5 @@
-; RUN: opt < %s -sample-profile -sample-profile-file=%S/Inputs/indirect-call.prof -S | FileCheck %s
-; RUN: opt < %s -sample-profile -sample-profile-file=%S/Inputs/indirect-call.compact.afdo -S | FileCheck %s
+; RUN: opt -S %s -passes=sample-profile -sample-profile-file=%S/Inputs/indirect-call.prof | FileCheck %s
+; RUN: opt -S %s -passes=sample-profile -sample-profile-file=%S/Inputs/indirect-call.compact.afdo | FileCheck %s
 
 ; CHECK-LABEL: @test
 define void @test(void ()*) #0 !dbg !3 {

diff  --git a/llvm/test/Transforms/SampleProfile/inline-act.ll b/llvm/test/Transforms/SampleProfile/inline-act.ll
index 65bae0a8de0d..e4c580488453 100644
--- a/llvm/test/Transforms/SampleProfile/inline-act.ll
+++ b/llvm/test/Transforms/SampleProfile/inline-act.ll
@@ -1,4 +1,4 @@
-; RUN: opt < %s -sample-profile -sample-profile-file=%S/Inputs/inline-act.prof
+; RUN: opt %s -passes=sample-profile -sample-profile-file=%S/Inputs/inline-act.prof
 
 ; Sample profile should have non-empty ACT passed to inliner
 

diff  --git a/llvm/test/Transforms/SampleProfile/inline-cold-callsite-samplepgo.ll b/llvm/test/Transforms/SampleProfile/inline-cold-callsite-samplepgo.ll
index d6a2fee6cf62..8c22e5672a41 100644
--- a/llvm/test/Transforms/SampleProfile/inline-cold-callsite-samplepgo.ll
+++ b/llvm/test/Transforms/SampleProfile/inline-cold-callsite-samplepgo.ll
@@ -1,8 +1,8 @@
 ; For SamplePGO, if -profile-sample-accurate is specified, cold callsite
 ; heuristics should be honored if the caller has no profile.
 
-; RUN: opt < %s -sample-profile -sample-profile-file=%S/Inputs/inline.prof -inline -S -inline-cold-callsite-threshold=0 | FileCheck %s
-; RUN: opt < %s -sample-profile -sample-profile-file=%S/Inputs/inline.prof -profile-sample-accurate -inline -S -inline-cold-callsite-threshold=0 | FileCheck %s --check-prefix ACCURATE
+; RUN: opt -S %s -passes='sample-profile,cgscc(inline)' -sample-profile-file=%S/Inputs/inline.prof -inline-cold-callsite-threshold=0 | FileCheck %s
+; RUN: opt -S %s -passes='sample-profile,cgscc(inline)' -sample-profile-file=%S/Inputs/inline.prof -profile-sample-accurate -inline-cold-callsite-threshold=0 | FileCheck %s --check-prefix ACCURATE
 
 declare void @extern()
 define void @callee() #1 {

diff  --git a/llvm/test/Transforms/SampleProfile/inline-combine.ll b/llvm/test/Transforms/SampleProfile/inline-combine.ll
index efe491df5724..780235d7eba6 100644
--- a/llvm/test/Transforms/SampleProfile/inline-combine.ll
+++ b/llvm/test/Transforms/SampleProfile/inline-combine.ll
@@ -1,5 +1,5 @@
-; RUN: opt < %s -instcombine -sample-profile -sample-profile-file=%S/Inputs/inline-combine.prof -S | FileCheck %s
-; RUN: opt < %s -passes="function(instcombine),sample-profile" -sample-profile-file=%S/Inputs/inline-combine.prof -S | FileCheck %s
+; RUN: opt -S %s -passes='function(instcombine),sample-profile' -sample-profile-file=%S/Inputs/inline-combine.prof | FileCheck %s
+; RUN: opt -S %s -passes="function(instcombine),sample-profile" -sample-profile-file=%S/Inputs/inline-combine.prof | FileCheck %s
 
 %"class.llvm::FoldingSetNodeID" = type { %"class.llvm::SmallVector" }
 %"class.llvm::SmallVector" = type { %"class.llvm::SmallVectorImpl.base", %"struct.llvm::SmallVectorStorage" }

diff  --git a/llvm/test/Transforms/SampleProfile/inline-coverage.ll b/llvm/test/Transforms/SampleProfile/inline-coverage.ll
index 5049ed38e0b4..74525cd0cb48 100644
--- a/llvm/test/Transforms/SampleProfile/inline-coverage.ll
+++ b/llvm/test/Transforms/SampleProfile/inline-coverage.ll
@@ -1,5 +1,5 @@
-; RUN: opt < %s -instcombine -sample-profile -sample-profile-file=%S/Inputs/inline-coverage.prof -sample-profile-check-record-coverage=100 -sample-profile-check-sample-coverage=110 -pass-remarks=sample-profile -pass-remarks-analysis=sample-profile -o /dev/null 2>&1 | FileCheck %s
-; RUN: opt < %s -passes="function(instcombine),sample-profile" -sample-profile-file=%S/Inputs/inline-coverage.prof -sample-profile-check-record-coverage=100 -sample-profile-check-sample-coverage=110 -pass-remarks=sample-profile -pass-remarks-analysis=sample-profile -o /dev/null 2>&1 | FileCheck %s
+; RUN: opt %s -passes='function(instcombine),sample-profile' -sample-profile-file=%S/Inputs/inline-coverage.prof -sample-profile-check-record-coverage=100 -sample-profile-check-sample-coverage=110 -pass-remarks=sample-profile -pass-remarks-analysis=sample-profile -o /dev/null 2>&1 | FileCheck %s
+; RUN: opt %s -passes="function(instcombine),sample-profile" -sample-profile-file=%S/Inputs/inline-coverage.prof -sample-profile-check-record-coverage=100 -sample-profile-check-sample-coverage=110 -pass-remarks=sample-profile -pass-remarks-analysis=sample-profile -o /dev/null 2>&1 | FileCheck %s
 ;
 ; Original code:
 ;

diff  --git a/llvm/test/Transforms/SampleProfile/nodebug.ll b/llvm/test/Transforms/SampleProfile/nodebug.ll
index d1c53c1a6f22..dc516108b0d6 100644
--- a/llvm/test/Transforms/SampleProfile/nodebug.ll
+++ b/llvm/test/Transforms/SampleProfile/nodebug.ll
@@ -1,4 +1,4 @@
-; RUN: opt < %s -sample-profile -sample-profile-file=%S/Inputs/nodebug.prof
+; RUN: opt %s -passes=sample-profile -sample-profile-file=%S/Inputs/nodebug.prof
 
 define void @foo() !dbg !3 {
   call void @bar(), !dbg !4

diff  --git a/llvm/test/Transforms/SampleProfile/section-accurate-samplepgo.ll b/llvm/test/Transforms/SampleProfile/section-accurate-samplepgo.ll
index b6c48d80d962..a404220056c8 100644
--- a/llvm/test/Transforms/SampleProfile/section-accurate-samplepgo.ll
+++ b/llvm/test/Transforms/SampleProfile/section-accurate-samplepgo.ll
@@ -1,7 +1,7 @@
 ; REQUIRES: x86-registered-target
-; RUN: opt < %s -sample-profile -sample-profile-file=%S/Inputs/inline.prof -codegenprepare -S | FileCheck %s
-; RUN: opt < %s -sample-profile -sample-profile-file=%S/Inputs/inline.prof -codegenprepare -profile-unknown-in-special-section -partial-profile -S | FileCheck %s --check-prefix UNKNOWN
-; RUN: opt < %s -sample-profile -sample-profile-file=%S/Inputs/inline.prof -codegenprepare -profile-sample-accurate -S | FileCheck %s --check-prefix ACCURATE
+; RUN: opt -S %s -passes=sample-profile -sample-profile-file=%S/Inputs/inline.prof | opt -S -codegenprepare | FileCheck %s
+; RUN: opt -S %s -passes=sample-profile -sample-profile-file=%S/Inputs/inline.prof | opt -S -codegenprepare -profile-unknown-in-special-section -partial-profile | FileCheck %s --check-prefix=UNKNOWN
+; RUN: opt -S %s -passes=sample-profile -sample-profile-file=%S/Inputs/inline.prof -profile-sample-accurate -S | opt -S -codegenprepare | FileCheck %s --check-prefix=ACCURATE
 
 target triple = "x86_64-pc-linux-gnu"
 

diff  --git a/llvm/test/Transforms/SampleProfile/summary.ll b/llvm/test/Transforms/SampleProfile/summary.ll
index 03b6644eacc8..ea27cc582bf8 100644
--- a/llvm/test/Transforms/SampleProfile/summary.ll
+++ b/llvm/test/Transforms/SampleProfile/summary.ll
@@ -1,6 +1,6 @@
 ; Test that we annotate entire program's summary to IR.
-; RUN: opt < %s -sample-profile -sample-profile-file=%S/Inputs/summary.prof -S | FileCheck %s
-; RUN: opt < %s -sample-profile -sample-profile-file=%S/Inputs/summary.prof -S | opt -sample-profile -sample-profile-file=%S/Inputs/summary.prof -S | FileCheck %s
+; RUN: opt -S %s -passes=sample-profile -sample-profile-file=%S/Inputs/summary.prof | FileCheck %s
+; RUN: opt -S %s -passes=sample-profile -sample-profile-file=%S/Inputs/summary.prof | opt -S -passes=sample-profile -sample-profile-file=%S/Inputs/summary.prof | FileCheck %s
 
 define i32 @bar() #0 !dbg !1 {
 entry:


        


More information about the llvm-commits mailing list