summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2018-07-11 23:30:25 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2018-07-11 23:30:25 +0000
commit9f22752c4b5b2afede1429e299fad0bdc48c02d8 (patch)
treefd8a9d4ddb9fd671eb61cb416d8cb24c2bec8e41
parent0319c28459203f4a0c8bb456d377357f752c6bc2 (diff)
downloadbcm5719-llvm-9f22752c4b5b2afede1429e299fad0bdc48c02d8.tar.gz
bcm5719-llvm-9f22752c4b5b2afede1429e299fad0bdc48c02d8.zip
IR: Skip -print-*-all after -print-*
This changes `-print-*` from transformation passes to analysis passes so that `-print-after-all` and `-print-before-all` don't trigger. This avoids some redundant output. Patch by Son Tuan Vu! llvm-svn: 336869
-rw-r--r--llvm/lib/IR/IRPrintingPasses.cpp6
-rw-r--r--llvm/test/Other/printer.ll13
2 files changed, 16 insertions, 3 deletions
diff --git a/llvm/lib/IR/IRPrintingPasses.cpp b/llvm/lib/IR/IRPrintingPasses.cpp
index 2aff2f2ebe4..befe1d9ffb1 100644
--- a/llvm/lib/IR/IRPrintingPasses.cpp
+++ b/llvm/lib/IR/IRPrintingPasses.cpp
@@ -127,13 +127,13 @@ public:
char PrintModulePassWrapper::ID = 0;
INITIALIZE_PASS(PrintModulePassWrapper, "print-module",
- "Print module to stderr", false, false)
+ "Print module to stderr", false, true)
char PrintFunctionPassWrapper::ID = 0;
INITIALIZE_PASS(PrintFunctionPassWrapper, "print-function",
- "Print function to stderr", false, false)
+ "Print function to stderr", false, true)
char PrintBasicBlockPass::ID = 0;
INITIALIZE_PASS(PrintBasicBlockPass, "print-bb", "Print BB to stderr", false,
- false)
+ true)
ModulePass *llvm::createPrintModulePass(llvm::raw_ostream &OS,
const std::string &Banner,
diff --git a/llvm/test/Other/printer.ll b/llvm/test/Other/printer.ll
new file mode 100644
index 00000000000..ac1abd70495
--- /dev/null
+++ b/llvm/test/Other/printer.ll
@@ -0,0 +1,13 @@
+; RUN: opt -mem2reg -instcombine -print-after-all -S < %s 2>&1 | FileCheck %s
+define void @tester(){
+ ret void
+}
+
+define void @foo(){
+ ret void
+}
+
+;CHECK: IR Dump After Promote Memory to Register
+;CHECK: IR Dump After Combine redundant instructions
+;CHECK: IR Dump After Module Verifier
+;CHECK-NOT: IR Dump After Print Module IR
OpenPOWER on IntegriCloud