diff options
Diffstat (limited to 'llvm/test/Transforms')
17 files changed, 27 insertions, 0 deletions
diff --git a/llvm/test/Transforms/SampleProfile/branch.ll b/llvm/test/Transforms/SampleProfile/branch.ll index 19e85b45dba..ac68fd857bd 100644 --- a/llvm/test/Transforms/SampleProfile/branch.ll +++ b/llvm/test/Transforms/SampleProfile/branch.ll @@ -1,4 +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 ; Original C++ code for this test case: ; diff --git a/llvm/test/Transforms/SampleProfile/calls.ll b/llvm/test/Transforms/SampleProfile/calls.ll index b28d4fb88fb..0105019c73e 100644 --- a/llvm/test/Transforms/SampleProfile/calls.ll +++ b/llvm/test/Transforms/SampleProfile/calls.ll @@ -1,4 +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 ; Original C++ test case ; diff --git a/llvm/test/Transforms/SampleProfile/cov-zero-samples.ll b/llvm/test/Transforms/SampleProfile/cov-zero-samples.ll index d5e33e2ec32..dc3e6de8c3c 100644 --- a/llvm/test/Transforms/SampleProfile/cov-zero-samples.ll +++ b/llvm/test/Transforms/SampleProfile/cov-zero-samples.ll @@ -1,4 +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 -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 -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/coverage-warning.ll b/llvm/test/Transforms/SampleProfile/coverage-warning.ll index dd5bbace9e0..4b8349d0af9 100644 --- a/llvm/test/Transforms/SampleProfile/coverage-warning.ll +++ b/llvm/test/Transforms/SampleProfile/coverage-warning.ll @@ -1,4 +1,5 @@ ; RUN: opt < %s -sample-profile -sample-profile-file=%S/Inputs/coverage-warning.prof -sample-profile-check-record-coverage=90 -sample-profile-check-sample-coverage=100 -o /dev/null 2>&1 | FileCheck %s +; RUN: opt < %s -passes=sample-profile -sample-profile-file=%S/Inputs/coverage-warning.prof -sample-profile-check-record-coverage=90 -sample-profile-check-sample-coverage=100 -o /dev/null 2>&1 | FileCheck %s define i32 @foo(i32 %i) !dbg !4 { ; The profile has samples for line locations that are no longer present. ; Coverage does not reach 90%, so we should get this warning: diff --git a/llvm/test/Transforms/SampleProfile/discriminator.ll b/llvm/test/Transforms/SampleProfile/discriminator.ll index f383e1d1c6c..862c2ee43c5 100644 --- a/llvm/test/Transforms/SampleProfile/discriminator.ll +++ b/llvm/test/Transforms/SampleProfile/discriminator.ll @@ -1,4 +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 ; Original code ; diff --git a/llvm/test/Transforms/SampleProfile/entry_counts.ll b/llvm/test/Transforms/SampleProfile/entry_counts.ll index 49610f645a5..1f7aceb8abb 100644 --- a/llvm/test/Transforms/SampleProfile/entry_counts.ll +++ b/llvm/test/Transforms/SampleProfile/entry_counts.ll @@ -1,4 +1,5 @@ ; RUN: opt < %s -sample-profile -sample-profile-file=%S/Inputs/entry_counts.prof -S | FileCheck %s +; RUN: opt < %s -passes=sample-profile -sample-profile-file=%S/Inputs/entry_counts.prof -S | FileCheck %s ; According to the profile, function empty() was called 13,293 times. ; CHECK: {{.*}} = !{!"function_entry_count", i64 13293} diff --git a/llvm/test/Transforms/SampleProfile/fnptr.ll b/llvm/test/Transforms/SampleProfile/fnptr.ll index abb4f7dea63..540ddbd79c9 100644 --- a/llvm/test/Transforms/SampleProfile/fnptr.ll +++ b/llvm/test/Transforms/SampleProfile/fnptr.ll @@ -5,6 +5,9 @@ ; 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 -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 + ; CHECK: edge for.body3 -> if.then probability is 0x1a4f3959 / 0x80000000 = 20.55% ; CHECK: edge for.body3 -> if.else probability is 0x65b0c6a7 / 0x80000000 = 79.45% ; CHECK: edge for.inc -> for.inc12 probability is 0x33d4a4c1 / 0x80000000 = 40.49% diff --git a/llvm/test/Transforms/SampleProfile/gcc-simple.ll b/llvm/test/Transforms/SampleProfile/gcc-simple.ll index 2bd66060a06..cbd105ebc3b 100644 --- a/llvm/test/Transforms/SampleProfile/gcc-simple.ll +++ b/llvm/test/Transforms/SampleProfile/gcc-simple.ll @@ -1,4 +1,5 @@ ; RUN: opt < %s -sample-profile -sample-profile-file=%S/Inputs/gcc-simple.afdo -S | FileCheck %s +; RUN: opt < %s -passes=sample-profile -sample-profile-file=%S/Inputs/gcc-simple.afdo -S | FileCheck %s ; XFAIL: powerpc64-, s390x, mips-, mips64-, sparc ; Original code: ; diff --git a/llvm/test/Transforms/SampleProfile/inline-combine.ll b/llvm/test/Transforms/SampleProfile/inline-combine.ll index 5bd18382388..bcc1770bfae 100644 --- a/llvm/test/Transforms/SampleProfile/inline-combine.ll +++ b/llvm/test/Transforms/SampleProfile/inline-combine.ll @@ -1,4 +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 %"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 ae08466c38e..c88e7f865fa 100644 --- a/llvm/test/Transforms/SampleProfile/inline-coverage.ll +++ b/llvm/test/Transforms/SampleProfile/inline-coverage.ll @@ -1,4 +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 -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 -o /dev/null 2>&1 | FileCheck %s ; ; Original code: ; diff --git a/llvm/test/Transforms/SampleProfile/inline-hint.ll b/llvm/test/Transforms/SampleProfile/inline-hint.ll index 20cdd3039b1..b95b02684c9 100644 --- a/llvm/test/Transforms/SampleProfile/inline-hint.ll +++ b/llvm/test/Transforms/SampleProfile/inline-hint.ll @@ -1,4 +1,5 @@ ; RUN: opt %s -sample-profile -sample-profile-file=%S/Inputs/inline-hint.prof -pass-remarks=sample-profile -o /dev/null 2>&1 | FileCheck %s +; RUN: opt %s -passes=sample-profile -sample-profile-file=%S/Inputs/inline-hint.prof -pass-remarks=sample-profile -o /dev/null 2>&1 | FileCheck %s ; ; CHECK: Applied cold hint to globally cold function '_Z7cold_fnRxi' with 0.1 define void @_Z7cold_fnRxi() !dbg !4 { diff --git a/llvm/test/Transforms/SampleProfile/inline.ll b/llvm/test/Transforms/SampleProfile/inline.ll index f37ddb2b845..ed353834137 100644 --- a/llvm/test/Transforms/SampleProfile/inline.ll +++ b/llvm/test/Transforms/SampleProfile/inline.ll @@ -1,4 +1,5 @@ ; RUN: opt < %s -sample-profile -sample-profile-file=%S/Inputs/inline.prof -sample-profile-inline-hot-threshold=1 -S | FileCheck %s +; RUN: opt < %s -passes=sample-profile -sample-profile-file=%S/Inputs/inline.prof -sample-profile-inline-hot-threshold=1 -S | FileCheck %s ; Original C++ test case ; diff --git a/llvm/test/Transforms/SampleProfile/nolocinfo.ll b/llvm/test/Transforms/SampleProfile/nolocinfo.ll index 1467ca97983..bd6a10b33f2 100644 --- a/llvm/test/Transforms/SampleProfile/nolocinfo.ll +++ b/llvm/test/Transforms/SampleProfile/nolocinfo.ll @@ -1,4 +1,5 @@ ; RUN: opt < %s -sample-profile -sample-profile-file=%S/Inputs/nolocinfo.prof -S -pass-remarks=sample-profile 2>&1 | FileCheck %s +; RUN: opt < %s -passes=sample-profile -sample-profile-file=%S/Inputs/nolocinfo.prof -S -pass-remarks=sample-profile 2>&1 | FileCheck %s define i32 @foo(i32 %i) !dbg !4 { entry: diff --git a/llvm/test/Transforms/SampleProfile/offset.ll b/llvm/test/Transforms/SampleProfile/offset.ll index 6403ea78362..c8d52408e86 100644 --- a/llvm/test/Transforms/SampleProfile/offset.ll +++ b/llvm/test/Transforms/SampleProfile/offset.ll @@ -1,4 +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 ; Original C++ code for this test case: ; diff --git a/llvm/test/Transforms/SampleProfile/propagate.ll b/llvm/test/Transforms/SampleProfile/propagate.ll index 9a72edb6ee9..a5796695ca0 100644 --- a/llvm/test/Transforms/SampleProfile/propagate.ll +++ b/llvm/test/Transforms/SampleProfile/propagate.ll @@ -1,4 +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 ; Original C++ code for this test case: ; diff --git a/llvm/test/Transforms/SampleProfile/remarks.ll b/llvm/test/Transforms/SampleProfile/remarks.ll index 586f07b478a..908e4f8b10b 100644 --- a/llvm/test/Transforms/SampleProfile/remarks.ll +++ b/llvm/test/Transforms/SampleProfile/remarks.ll @@ -1,4 +1,5 @@ ; RUN: opt < %s -sample-profile -sample-profile-file=%S/Inputs/remarks.prof -S -pass-remarks=sample-profile 2>&1 | FileCheck %s +; RUN: opt < %s -passes=sample-profile -sample-profile-file=%S/Inputs/remarks.prof -S -pass-remarks=sample-profile 2>&1 | FileCheck %s ; ; Original test case. ; diff --git a/llvm/test/Transforms/SampleProfile/syntax.ll b/llvm/test/Transforms/SampleProfile/syntax.ll index debbc7c87dd..7114dfa6157 100644 --- a/llvm/test/Transforms/SampleProfile/syntax.ll +++ b/llvm/test/Transforms/SampleProfile/syntax.ll @@ -7,6 +7,15 @@ ; RUN: not opt < %s -sample-profile -sample-profile-file=%S/Inputs/bad_samples.prof 2>&1 | FileCheck -check-prefix=BAD-SAMPLES %s ; RUN: opt < %s -sample-profile -sample-profile-file=%S/Inputs/bad_mangle.prof 2>&1 >/dev/null +; RUN: opt < %s -passes=sample-profile -sample-profile-file=%S/Inputs/syntax.prof 2>&1 | FileCheck -check-prefix=NO-DEBUG %s +; RUN: not opt < %s -passes=sample-profile -sample-profile-file=missing.prof 2>&1 | FileCheck -check-prefix=MISSING-FILE %s +; RUN: not opt < %s -passes=sample-profile -sample-profile-file=%S/Inputs/bad_fn_header.prof 2>&1 | FileCheck -check-prefix=BAD-FN-HEADER %s +; RUN: not opt < %s -passes=sample-profile -sample-profile-file=%S/Inputs/bad_sample_line.prof 2>&1 | FileCheck -check-prefix=BAD-SAMPLE-LINE %s +; RUN: not opt < %s -passes=sample-profile -sample-profile-file=%S/Inputs/bad_line_values.prof 2>&1 | FileCheck -check-prefix=BAD-LINE-VALUES %s +; RUN: not opt < %s -passes=sample-profile -sample-profile-file=%S/Inputs/bad_discriminator_value.prof 2>&1 | FileCheck -check-prefix=BAD-DISCRIMINATOR-VALUE %s +; RUN: not opt < %s -passes=sample-profile -sample-profile-file=%S/Inputs/bad_samples.prof 2>&1 | FileCheck -check-prefix=BAD-SAMPLES %s +; RUN: opt < %s -passes=sample-profile -sample-profile-file=%S/Inputs/bad_mangle.prof 2>&1 >/dev/null + define void @empty() { entry: ret void |

