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!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@336869 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/IR/IRPrintingPasses.cpp b/lib/IR/IRPrintingPasses.cpp
index 2aff2f2e..befe1d9 100644
--- a/lib/IR/IRPrintingPasses.cpp
+++ b/lib/IR/IRPrintingPasses.cpp
@@ -127,13 +127,13 @@
 
 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/test/Other/printer.ll b/test/Other/printer.ll
new file mode 100644
index 0000000..ac1abd7
--- /dev/null
+++ b/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