diff options
| author | Sam Elliott <ashe2@cs.washington.edu> | 2017-08-20 01:30:45 +0000 |
|---|---|---|
| committer | Sam Elliott <ashe2@cs.washington.edu> | 2017-08-20 01:30:45 +0000 |
| commit | b0c975369199c5f0e2c756020dff2520a9c4c2f6 (patch) | |
| tree | 8bc7e3d62676bc172f0614e2ce5a79e55f5a4138 /llvm/test/Transforms | |
| parent | 6adf81b1d57468c2a399083e84764abe8efba2fc (diff) | |
| download | bcm5719-llvm-b0c975369199c5f0e2c756020dff2520a9c4c2f6.tar.gz bcm5719-llvm-b0c975369199c5f0e2c756020dff2520a9c4c2f6.zip | |
Keep Optimization Remark Yaml in NewPM
Summary:
The New Pass Manager infrastructure was forgetting to keep around the optimization remark yaml file that the compiler might have been producing. This meant setting the option to '-' for stdout worked, but setting it to a filename didn't give file output (presumably it was deleted because compilation didn't explicitly keep it). This change just ensures that the file is kept if compilation succeeds.
So far I have updated one of the optimization remark output tests to add a version with the new pass manager. It is my intention for this patch to also include changes to all tests that use `-opt-remark-output=` but I wanted to get the code patch ready for review while I was making all those changes.
Fixes https://bugs.llvm.org/show_bug.cgi?id=33951
Reviewers: anemet, chandlerc
Reviewed By: anemet, chandlerc
Subscribers: javed.absar, chandlerc, fhahn, llvm-commits
Differential Revision: https://reviews.llvm.org/D36906
llvm-svn: 311271
Diffstat (limited to 'llvm/test/Transforms')
8 files changed, 29 insertions, 5 deletions
diff --git a/llvm/test/Transforms/GVN/opt-remarks.ll b/llvm/test/Transforms/GVN/opt-remarks.ll index e31793038cb..d22998b6f21 100644 --- a/llvm/test/Transforms/GVN/opt-remarks.ll +++ b/llvm/test/Transforms/GVN/opt-remarks.ll @@ -1,6 +1,9 @@ ; RUN: opt < %s -gvn -o /dev/null -pass-remarks-output=%t -S -pass-remarks=gvn \ ; RUN: 2>&1 | FileCheck %s ; RUN: cat %t | FileCheck -check-prefix=YAML %s +; RUN: opt < %s -aa-pipeline=basic-aa -passes=gvn -o /dev/null -pass-remarks-output=%t -S -pass-remarks=gvn \ +; RUN: 2>&1 | FileCheck %s +; RUN: cat %t | FileCheck -check-prefix=YAML %s ; CHECK: remark: <unknown>:0:0: load of type i32 eliminated{{$}} ; CHECK-NEXT: remark: <unknown>:0:0: load of type i32 eliminated{{$}} diff --git a/llvm/test/Transforms/LoopVectorize/X86/vectorization-remarks-missed.ll b/llvm/test/Transforms/LoopVectorize/X86/vectorization-remarks-missed.ll index 4dc62d86453..a6f35e2b0ce 100644 --- a/llvm/test/Transforms/LoopVectorize/X86/vectorization-remarks-missed.ll +++ b/llvm/test/Transforms/LoopVectorize/X86/vectorization-remarks-missed.ll @@ -2,6 +2,10 @@ ; RUN: opt < %s -loop-vectorize -o /dev/null -pass-remarks-output=%t.yaml ; RUN: cat %t.yaml | FileCheck -check-prefix=YAML %s +; RUN: opt < %s -passes=loop-vectorize -S -pass-remarks-missed='loop-vectorize' -pass-remarks-analysis='loop-vectorize' 2>&1 | FileCheck %s +; RUN: opt < %s -passes=loop-vectorize -o /dev/null -pass-remarks-output=%t.yaml +; RUN: cat %t.yaml | FileCheck -check-prefix=YAML %s + ; C/C++ code for tests ; void test(int *A, int Length) { ; #pragma clang loop vectorize(enable) interleave(enable) diff --git a/llvm/test/Transforms/NewGVN/opt-remarks.ll b/llvm/test/Transforms/NewGVN/opt-remarks.ll index 528b4545288..4da2ff4af4d 100644 --- a/llvm/test/Transforms/NewGVN/opt-remarks.ll +++ b/llvm/test/Transforms/NewGVN/opt-remarks.ll @@ -2,6 +2,10 @@ ; RUN: opt < %s -newgvn -o /dev/null -pass-remarks-output=%t -S -pass-remarks=gvn \ ; RUN: 2>&1 | FileCheck %s ; RUN: cat %t | FileCheck -check-prefix=YAML %s +; RUN: opt < %s -passes=newgvn -o /dev/null -pass-remarks-output=%t -S -pass-remarks=gvn \ +; RUN: 2>&1 | FileCheck %s +; RUN: cat %t | FileCheck -check-prefix=YAML %s + ; CHECK: remark: <unknown>:0:0: load of type i32 eliminated{{$}} ; CHECK-NEXT: remark: <unknown>:0:0: load of type i32 eliminated{{$}} diff --git a/llvm/test/Transforms/PGOProfile/memop_size_opt.ll b/llvm/test/Transforms/PGOProfile/memop_size_opt.ll index 0d2edd40e9c..fc5f41d40fb 100644 --- a/llvm/test/Transforms/PGOProfile/memop_size_opt.ll +++ b/llvm/test/Transforms/PGOProfile/memop_size_opt.ll @@ -1,6 +1,10 @@ +; RUN: opt < %s -pgo-memop-opt -pgo-memop-count-threshold=90 -pgo-memop-percent-threshold=15 -S | FileCheck %s --check-prefix=MEMOP_OPT ; RUN: opt < %s -passes=pgo-memop-opt -pgo-memop-count-threshold=90 -pgo-memop-percent-threshold=15 -S | FileCheck %s --check-prefix=MEMOP_OPT ; RUN: opt < %s -pgo-memop-opt -pgo-memop-count-threshold=90 -pgo-memop-percent-threshold=15 -pass-remarks-with-hotness -pass-remarks-output=%t.opt.yaml -S | FileCheck %s --check-prefix=MEMOP_OPT ; RUN: FileCheck %s -input-file=%t.opt.yaml --check-prefix=YAML +; RUN: opt < %s -passes=pgo-memop-opt -pgo-memop-count-threshold=90 -pgo-memop-percent-threshold=15 -pass-remarks-with-hotness -pass-remarks-output=%t.opt.yaml -S | FileCheck %s --check-prefix=MEMOP_OPT +; RUN: FileCheck %s -input-file=%t.opt.yaml --check-prefix=YAML + target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-unknown-linux-gnu" diff --git a/llvm/test/Transforms/SLPVectorizer/AArch64/getelementptr.ll b/llvm/test/Transforms/SLPVectorizer/AArch64/getelementptr.ll index 962a6c3b57b..47bc7c762f7 100644 --- a/llvm/test/Transforms/SLPVectorizer/AArch64/getelementptr.ll +++ b/llvm/test/Transforms/SLPVectorizer/AArch64/getelementptr.ll @@ -1,5 +1,8 @@ ; RUN: opt -S -slp-vectorizer -slp-threshold=-18 -dce -instcombine -pass-remarks-output=%t < %s | FileCheck %s ; RUN: cat %t | FileCheck -check-prefix=YAML %s +; RUN: opt -S -passes='slp-vectorizer,dce,instcombine' -slp-threshold=-18 -pass-remarks-output=%t < %s | FileCheck %s +; RUN: cat %t | FileCheck -check-prefix=YAML %s + target datalayout = "e-m:e-i32:64-i128:128-n32:64-S128" target triple = "aarch64--linux-gnu" diff --git a/llvm/test/Transforms/SLPVectorizer/AArch64/horizontal.ll b/llvm/test/Transforms/SLPVectorizer/AArch64/horizontal.ll index 1a6a2fb890d..45063e33bd5 100644 --- a/llvm/test/Transforms/SLPVectorizer/AArch64/horizontal.ll +++ b/llvm/test/Transforms/SLPVectorizer/AArch64/horizontal.ll @@ -1,5 +1,8 @@ ; RUN: opt -slp-vectorizer -slp-threshold=-6 -S -pass-remarks-output=%t < %s | FileCheck %s ; RUN: cat %t | FileCheck -check-prefix=YAML %s +; RUN: opt -passes=slp-vectorizer -slp-threshold=-6 -S -pass-remarks-output=%t < %s | FileCheck %s +; RUN: cat %t | FileCheck -check-prefix=YAML %s + ; FIXME: The threshold is changed to keep this test case a bit smaller. ; The AArch64 cost model should not give such high costs to select statements. diff --git a/llvm/test/Transforms/SampleProfile/remarks.ll b/llvm/test/Transforms/SampleProfile/remarks.ll index 6285d69f9c7..1fc8f38751e 100644 --- a/llvm/test/Transforms/SampleProfile/remarks.ll +++ b/llvm/test/Transforms/SampleProfile/remarks.ll @@ -1,6 +1,8 @@ ; RUN: opt < %s -sample-profile -sample-profile-file=%S/Inputs/remarks.prof -S -pass-remarks=sample-profile -pass-remarks-output=%t.opt.yaml 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 ; RUN: FileCheck %s -check-prefix=YAML < %t.opt.yaml +; RUN: opt < %s -passes=sample-profile -sample-profile-file=%S/Inputs/remarks.prof -S -pass-remarks=sample-profile -pass-remarks-output=%t.opt.yaml 2>&1 | FileCheck %s +; RUN: FileCheck %s -check-prefix=YAML < %t.opt.yaml + ; Original test case. ; ; 1 #include <stdlib.h> diff --git a/llvm/test/Transforms/Util/libcalls-opt-remarks.ll b/llvm/test/Transforms/Util/libcalls-opt-remarks.ll index 8c7aaf883f7..e8eb7ce9cc2 100644 --- a/llvm/test/Transforms/Util/libcalls-opt-remarks.ll +++ b/llvm/test/Transforms/Util/libcalls-opt-remarks.ll @@ -1,8 +1,9 @@ -; RUN: opt < %s -instcombine -o /dev/null -pass-remarks-output=%t -S -pass-remarks=instcombine \ -; RUN: 2>&1 | FileCheck %s +; RUN: opt < %s -instcombine -o /dev/null -pass-remarks-output=%t -S \ +; RUN: -pass-remarks=instcombine 2>&1 | FileCheck %s +; RUN: cat %t | FileCheck -check-prefix=YAML %s +; RUN: opt < %s -passes='require<opt-remark-emit>,instcombine' -o /dev/null \ +; RUN: -pass-remarks-output=%t -S -pass-remarks=instcombine 2>&1 | FileCheck %s ; RUN: cat %t | FileCheck -check-prefix=YAML %s -; RUN: opt < %s -passes='require<opt-remark-emit>,instcombine' -o /dev/null -S -pass-remarks=instcombine \ -; RUN: 2>&1 | FileCheck %s ; CHECK: remark: libcalls-opt-remarks.c:10:10: folded strlen(select) to select of constants{{$}} ; CHECK-NOT: remark: |

