From: Duncan P. N. Exon Smith Date: Wed, 11 Jul 2018 23:30:25 +0000 (+0000) Subject: IR: Skip -print-*-all after -print-* X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=15753b03821edcd4d094d20c2d0b7bf703244870;p=llvm 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 2aff2f2ebe4..befe1d9ffb1 100644 --- a/lib/IR/IRPrintingPasses.cpp +++ b/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/test/Other/printer.ll b/test/Other/printer.ll new file mode 100644 index 00000000000..ac1abd70495 --- /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