diff --git a/llvm/include/llvm/IR/PrintPasses.h b/llvm/include/llvm/IR/PrintPasses.h --- a/llvm/include/llvm/IR/PrintPasses.h +++ b/llvm/include/llvm/IR/PrintPasses.h @@ -53,6 +53,7 @@ // Return true if -filter-passes is empty or contains the pass name. bool isPassInPrintList(StringRef PassName); +bool isFilterPassesEmpty(); // Returns true if we should print the function. bool isFunctionInPrintList(StringRef FunctionName); diff --git a/llvm/include/llvm/Passes/StandardInstrumentations.h b/llvm/include/llvm/Passes/StandardInstrumentations.h --- a/llvm/include/llvm/Passes/StandardInstrumentations.h +++ b/llvm/include/llvm/Passes/StandardInstrumentations.h @@ -177,9 +177,9 @@ // Determine if this pass/IR is interesting and if so, save the IR // otherwise it is left on the stack without data. - void saveIRBeforePass(Any IR, StringRef PassID); + void saveIRBeforePass(Any IR, StringRef PassID, StringRef PassName); // Compare the IR from before the pass after the pass. - void handleIRAfterPass(Any IR, StringRef PassID); + void handleIRAfterPass(Any IR, StringRef PassID, StringRef PassName); // Handle the situation where a pass is invalidated. void handleInvalidatedPass(StringRef PassID); diff --git a/llvm/lib/IR/PrintPasses.cpp b/llvm/lib/IR/PrintPasses.cpp --- a/llvm/lib/IR/PrintPasses.cpp +++ b/llvm/lib/IR/PrintPasses.cpp @@ -146,6 +146,8 @@ return Set.empty() || Set.count(std::string(PassName)); } +bool llvm::isFilterPassesEmpty() { return FilterPasses.empty(); } + bool llvm::isFunctionInPrintList(StringRef FunctionName) { static std::unordered_set PrintFuncNames(PrintFuncsList.begin(), PrintFuncsList.end()); diff --git a/llvm/lib/Passes/PassBuilder.cpp b/llvm/lib/Passes/PassBuilder.cpp --- a/llvm/lib/Passes/PassBuilder.cpp +++ b/llvm/lib/Passes/PassBuilder.cpp @@ -373,7 +373,7 @@ /// We currently only use this for --print-before/after. bool shouldPopulateClassToPassNames() { return PrintPipelinePasses || !printBeforePasses().empty() || - !printAfterPasses().empty(); + !printAfterPasses().empty() || !isFilterPassesEmpty(); } // A pass for testing -print-on-crash. diff --git a/llvm/lib/Passes/StandardInstrumentations.cpp b/llvm/lib/Passes/StandardInstrumentations.cpp --- a/llvm/lib/Passes/StandardInstrumentations.cpp +++ b/llvm/lib/Passes/StandardInstrumentations.cpp @@ -315,8 +315,8 @@ // Return true when this is a pass on IR for which printing // of changes is desired. -bool isInteresting(Any IR, StringRef PassID) { - if (isIgnored(PassID) || !isPassInPrintList(PassID)) +bool isInteresting(Any IR, StringRef PassID, StringRef PassName) { + if (isIgnored(PassID) || !isPassInPrintList(PassName)) return false; if (any_isa(IR)) return isInterestingFunction(*any_cast(IR)); @@ -330,13 +330,14 @@ } template -void ChangeReporter::saveIRBeforePass(Any IR, StringRef PassID) { +void ChangeReporter::saveIRBeforePass(Any IR, StringRef PassID, + StringRef PassName) { // Always need to place something on the stack because invalidated passes // are not given the IR so it cannot be determined whether the pass was for // something that was filtered out. BeforeStack.emplace_back(); - if (!isInteresting(IR, PassID)) + if (!isInteresting(IR, PassID, PassName)) return; // Is this the initial IR? if (InitialIR) { @@ -351,7 +352,8 @@ } template -void ChangeReporter::handleIRAfterPass(Any IR, StringRef PassID) { +void ChangeReporter::handleIRAfterPass(Any IR, StringRef PassID, + StringRef PassName) { assert(!BeforeStack.empty() && "Unexpected empty stack encountered."); std::string Name = getIRName(IR); @@ -359,7 +361,7 @@ if (isIgnored(PassID)) { if (VerboseMode) handleIgnored(PassID, Name); - } else if (!isInteresting(IR, PassID)) { + } else if (!isInteresting(IR, PassID, PassName)) { if (VerboseMode) handleFiltered(PassID, Name); } else { @@ -395,12 +397,13 @@ template void ChangeReporter::registerRequiredCallbacks( PassInstrumentationCallbacks &PIC) { - PIC.registerBeforeNonSkippedPassCallback( - [this](StringRef P, Any IR) { saveIRBeforePass(IR, P); }); + PIC.registerBeforeNonSkippedPassCallback([&PIC, this](StringRef P, Any IR) { + saveIRBeforePass(IR, P, PIC.getPassNameForClassName(P)); + }); PIC.registerAfterPassCallback( - [this](StringRef P, Any IR, const PreservedAnalyses &) { - handleIRAfterPass(IR, P); + [&PIC, this](StringRef P, Any IR, const PreservedAnalyses &) { + handleIRAfterPass(IR, P, PIC.getPassNameForClassName(P)); }); PIC.registerAfterPassInvalidatedCallback( [this](StringRef P, const PreservedAnalyses &) { @@ -2030,12 +2033,13 @@ sys::AddSignalHandler(SignalHandler, nullptr); CrashReporter = this; - PIC.registerBeforeNonSkippedPassCallback([this](StringRef PassID, Any IR) { + PIC.registerBeforeNonSkippedPassCallback([&PIC, this](StringRef PassID, + Any IR) { SavedIR.clear(); raw_string_ostream OS(SavedIR); OS << formatv("*** Dump of {0}IR Before Last Pass {1}", llvm::forcePrintModuleIR() ? "Module " : "", PassID); - if (!isInteresting(IR, PassID)) { + if (!isInteresting(IR, PassID, PIC.getPassNameForClassName(PassID))) { OS << " Filtered Out ***\n"; return; } diff --git a/llvm/test/Other/ChangePrinters/DotCfg/print-changed-dot-cfg.ll b/llvm/test/Other/ChangePrinters/DotCfg/print-changed-dot-cfg.ll --- a/llvm/test/Other/ChangePrinters/DotCfg/print-changed-dot-cfg.ll +++ b/llvm/test/Other/ChangePrinters/DotCfg/print-changed-dot-cfg.ll @@ -30,19 +30,19 @@ ; ; Check that the reporting of IRs respects -filter-passes ; RUN: rm -rf %t && mkdir -p %t -; RUN: opt -disable-verify -S -print-changed=dot-cfg -passes="instsimplify,no-op-function" -filter-passes="NoOpFunctionPass" -dot-cfg-dir=%t < %s -o /dev/null +; RUN: opt -disable-verify -S -print-changed=dot-cfg -passes="instsimplify,no-op-function" -filter-passes="no-op-function" -dot-cfg-dir=%t < %s -o /dev/null ; RUN: ls %t/*.pdf %t/passes.html | count 2 ; RUN: FileCheck %s -input-file=%t/passes.html --check-prefix=CHECK-DOT-CFG-FILTER-PASSES ; ; Check that the reporting of IRs respects -filter-passes with multiple passes ; RUN: rm -rf %t && mkdir -p %t -; RUN: opt -disable-verify -S -print-changed=dot-cfg -passes="instsimplify,no-op-function" -filter-passes="NoOpFunctionPass,InstSimplifyPass" -dot-cfg-dir=%t < %s -o /dev/null +; RUN: opt -disable-verify -S -print-changed=dot-cfg -passes="instsimplify,no-op-function" -filter-passes="no-op-function,instsimplify" -dot-cfg-dir=%t < %s -o /dev/null ; RUN: ls %t/*.pdf %t/passes.html | count 4 ; RUN: FileCheck %s -input-file=%t/passes.html --check-prefix=CHECK-DOT-CFG-FILTER-MULT-PASSES ; ; Check that the reporting of IRs respects both -filter-passes and -filter-print-funcs ; RUN: rm -rf %t && mkdir -p %t -; RUN: opt -disable-verify -S -print-changed=dot-cfg -passes="instsimplify,no-op-function" -filter-passes="NoOpFunctionPass,InstSimplifyPass" -filter-print-funcs=f -dot-cfg-dir=%t < %s -o /dev/null +; RUN: opt -disable-verify -S -print-changed=dot-cfg -passes="instsimplify,no-op-function" -filter-passes="no-op-function,instsimplify" -filter-print-funcs=f -dot-cfg-dir=%t < %s -o /dev/null ; RUN: ls %t/*.pdf %t/passes.html | count 3 ; RUN: FileCheck %s -input-file=%t/passes.html --check-prefix=CHECK-DOT-CFG-FILTER-FUNC-PASSES ; @@ -86,18 +86,18 @@ ; ; Check that the reporting of IRs respects -filter-passes ; RUN: rm -rf %t && mkdir -p %t -; RUN: opt -S -print-changed=dot-cfg-quiet -passes="instsimplify,no-op-function" -filter-passes="NoOpFunctionPass" -dot-cfg-dir=%t < %s -o /dev/null +; RUN: opt -S -print-changed=dot-cfg-quiet -passes="instsimplify,no-op-function" -filter-passes="no-op-function" -dot-cfg-dir=%t < %s -o /dev/null ; RUN: FileCheck %s -input-file=%t/passes.html --check-prefix=CHECK-DOT-CFG-QUIET-FILTER-PASSES-NONE --allow-empty ; ; Check that the reporting of IRs respects -filter-passes with multiple passes ; RUN: rm -rf %t && mkdir -p %t -; RUN: opt -S -print-changed=dot-cfg-quiet -passes="instsimplify,no-op-function" -filter-passes="NoOpFunctionPass,InstSimplifyPass" -dot-cfg-dir=%t < %s -o /dev/null +; RUN: opt -S -print-changed=dot-cfg-quiet -passes="instsimplify,no-op-function" -filter-passes="no-op-function,instsimplify" -dot-cfg-dir=%t < %s -o /dev/null ; RUN: ls %t/*.pdf %t/passes.html | count 3 ; RUN: FileCheck %s -input-file=%t/passes.html --check-prefix=CHECK-DOT-CFG-QUIET-FILTER-MULT-PASSES ; ; Check that the reporting of IRs respects both -filter-passes and -filter-print-funcs ; RUN: rm -rf %t && mkdir -p %t -; RUN: opt -S -print-changed=dot-cfg-quiet -passes="instsimplify,no-op-function" -filter-passes="NoOpFunctionPass,InstSimplifyPass" -filter-print-funcs=f -dot-cfg-dir=%t < %s -o /dev/null +; RUN: opt -S -print-changed=dot-cfg-quiet -passes="instsimplify,no-op-function" -filter-passes="no-op-function,instsimplify" -filter-print-funcs=f -dot-cfg-dir=%t < %s -o /dev/null ; RUN: ls %t/*.pdf %t/passes.html | count 2 ; RUN: FileCheck %s -input-file=%t/passes.html --check-prefix=CHECK-DOT-CFG-QUIET-FILTER-FUNC-PASSES ; diff --git a/llvm/test/Other/ChangePrinters/print-changed-diff.ll b/llvm/test/Other/ChangePrinters/print-changed-diff.ll --- a/llvm/test/Other/ChangePrinters/print-changed-diff.ll +++ b/llvm/test/Other/ChangePrinters/print-changed-diff.ll @@ -17,13 +17,13 @@ ; RUN: opt -S -print-changed=diff -passes=instsimplify -filter-print-funcs="f,g" 2>&1 -o /dev/null < %s | FileCheck %s --check-prefix=CHECK-DIFF-FILTER-MULT-FUNC ; ; Check that the reporting of IRs respects -filter-passes -; RUN: opt -S -print-changed=diff -passes="instsimplify,no-op-function" -filter-passes="NoOpFunctionPass" 2>&1 -o /dev/null < %s | FileCheck %s --check-prefix=CHECK-DIFF-FILTER-PASSES +; RUN: opt -S -print-changed=diff -passes="instsimplify,no-op-function" -filter-passes="no-op-function" 2>&1 -o /dev/null < %s | FileCheck %s --check-prefix=CHECK-DIFF-FILTER-PASSES ; ; Check that the reporting of IRs respects -filter-passes with multiple passes -; RUN: opt -S -print-changed=diff -passes="instsimplify,no-op-function" -filter-passes="NoOpFunctionPass,InstSimplifyPass" 2>&1 -o /dev/null < %s | FileCheck %s --check-prefix=CHECK-DIFF-FILTER-MULT-PASSES +; RUN: opt -S -print-changed=diff -passes="instsimplify,no-op-function" -filter-passes="no-op-function,instsimplify" 2>&1 -o /dev/null < %s | FileCheck %s --check-prefix=CHECK-DIFF-FILTER-MULT-PASSES ; ; Check that the reporting of IRs respects both -filter-passes and -filter-print-funcs -; RUN: opt -S -print-changed=diff -passes="instsimplify,no-op-function" -filter-passes="NoOpFunctionPass,InstSimplifyPass" -filter-print-funcs=f 2>&1 -o /dev/null < %s | FileCheck %s --check-prefix=CHECK-DIFF-FILTER-FUNC-PASSES +; RUN: opt -S -print-changed=diff -passes="instsimplify,no-op-function" -filter-passes="no-op-function,instsimplify" -filter-print-funcs=f 2>&1 -o /dev/null < %s | FileCheck %s --check-prefix=CHECK-DIFF-FILTER-FUNC-PASSES ; ; Check that repeated passes that change the IR are printed and that the ; others (including g) are filtered out. Note that only the first time @@ -49,13 +49,13 @@ ; RUN: opt -S -print-changed=diff-quiet -passes=instsimplify -filter-print-funcs="f,g" 2>&1 -o /dev/null < %s | FileCheck %s --check-prefix=CHECK-DIFF-QUIET-FILTER-MULT-FUNC ; ; Check that the reporting of IRs respects -filter-passes -; RUN: opt -S -print-changed=diff-quiet -passes="instsimplify,no-op-function" -filter-passes="NoOpFunctionPass" 2>&1 -o /dev/null < %s | FileCheck %s --check-prefix=CHECK-DIFF-QUIET-FILTER-PASSES-NONE --allow-empty +; RUN: opt -S -print-changed=diff-quiet -passes="instsimplify,no-op-function" -filter-passes="no-op-function" 2>&1 -o /dev/null < %s | FileCheck %s --check-prefix=CHECK-DIFF-QUIET-FILTER-PASSES-NONE --allow-empty ; ; Check that the reporting of IRs respects -filter-passes with multiple passes -; RUN: opt -S -print-changed=diff-quiet -passes="instsimplify,no-op-function" -filter-passes="NoOpFunctionPass,InstSimplifyPass" 2>&1 -o /dev/null < %s | FileCheck %s --check-prefix=CHECK-DIFF-QUIET-FILTER-MULT-PASSES +; RUN: opt -S -print-changed=diff-quiet -passes="instsimplify,no-op-function" -filter-passes="no-op-function,instsimplify" 2>&1 -o /dev/null < %s | FileCheck %s --check-prefix=CHECK-DIFF-QUIET-FILTER-MULT-PASSES ; ; Check that the reporting of IRs respects both -filter-passes and -filter-print-funcs -; RUN: opt -S -print-changed=diff-quiet -passes="instsimplify,no-op-function" -filter-passes="NoOpFunctionPass,InstSimplifyPass" -filter-print-funcs=f 2>&1 -o /dev/null < %s | FileCheck %s --check-prefix=CHECK-DIFF-QUIET-FILTER-FUNC-PASSES +; RUN: opt -S -print-changed=diff-quiet -passes="instsimplify,no-op-function" -filter-passes="no-op-function,instsimplify" -filter-print-funcs=f 2>&1 -o /dev/null < %s | FileCheck %s --check-prefix=CHECK-DIFF-QUIET-FILTER-FUNC-PASSES ; ; Check that repeated passes that change the IR are printed and that the ; others (including g) are filtered out. Note that only the first time @@ -81,13 +81,13 @@ ; RUN: opt -S -print-changed=cdiff -passes=instsimplify -filter-print-funcs="f,g" 2>&1 -o /dev/null < %s | FileCheck %s --check-prefix=CHECK-CDIFF-FILTER-MULT-FUNC ; ; Check that the reporting of IRs respects -filter-passes -; RUN: opt -S -print-changed=cdiff -passes="instsimplify,no-op-function" -filter-passes="NoOpFunctionPass" 2>&1 -o /dev/null < %s | FileCheck %s --check-prefix=CHECK-CDIFF-FILTER-PASSES +; RUN: opt -S -print-changed=cdiff -passes="instsimplify,no-op-function" -filter-passes="no-op-function" 2>&1 -o /dev/null < %s | FileCheck %s --check-prefix=CHECK-CDIFF-FILTER-PASSES ; ; Check that the reporting of IRs respects -filter-passes with multiple passes -; RUN: opt -S -print-changed=cdiff -passes="instsimplify,no-op-function" -filter-passes="NoOpFunctionPass,InstSimplifyPass" 2>&1 -o /dev/null < %s | FileCheck %s --check-prefix=CHECK-CDIFF-FILTER-MULT-PASSES +; RUN: opt -S -print-changed=cdiff -passes="instsimplify,no-op-function" -filter-passes="no-op-function,instsimplify" 2>&1 -o /dev/null < %s | FileCheck %s --check-prefix=CHECK-CDIFF-FILTER-MULT-PASSES ; ; Check that the reporting of IRs respects both -filter-passes and -filter-print-funcs -; RUN: opt -S -print-changed=cdiff -passes="instsimplify,no-op-function" -filter-passes="NoOpFunctionPass,InstSimplifyPass" -filter-print-funcs=f 2>&1 -o /dev/null < %s | FileCheck %s --check-prefix=CHECK-CDIFF-FILTER-FUNC-PASSES +; RUN: opt -S -print-changed=cdiff -passes="instsimplify,no-op-function" -filter-passes="no-op-function,instsimplify" -filter-print-funcs=f 2>&1 -o /dev/null < %s | FileCheck %s --check-prefix=CHECK-CDIFF-FILTER-FUNC-PASSES ; ; Check that repeated passes that change the IR are printed and that the ; others (including g) are filtered out. Note that only the first time @@ -113,13 +113,13 @@ ; RUN: opt -S -print-changed=cdiff-quiet -passes=instsimplify -filter-print-funcs="f,g" 2>&1 -o /dev/null < %s | FileCheck %s --check-prefix=CHECK-CDIFF-QUIET-FILTER-MULT-FUNC ; ; Check that the reporting of IRs respects -filter-passes -; RUN: opt -S -print-changed=cdiff-quiet -passes="instsimplify,no-op-function" -filter-passes="NoOpFunctionPass" 2>&1 -o /dev/null < %s | FileCheck %s --check-prefix=CHECK-CDIFF-QUIET-FILTER-PASSES-NONE --allow-empty +; RUN: opt -S -print-changed=cdiff-quiet -passes="instsimplify,no-op-function" -filter-passes="no-op-function" 2>&1 -o /dev/null < %s | FileCheck %s --check-prefix=CHECK-CDIFF-QUIET-FILTER-PASSES-NONE --allow-empty ; ; Check that the reporting of IRs respects -filter-passes with multiple passes -; RUN: opt -S -print-changed=cdiff-quiet -passes="instsimplify,no-op-function" -filter-passes="NoOpFunctionPass,InstSimplifyPass" 2>&1 -o /dev/null < %s | FileCheck %s --check-prefix=CHECK-CDIFF-QUIET-FILTER-MULT-PASSES +; RUN: opt -S -print-changed=cdiff-quiet -passes="instsimplify,no-op-function" -filter-passes="no-op-function,instsimplify" 2>&1 -o /dev/null < %s | FileCheck %s --check-prefix=CHECK-CDIFF-QUIET-FILTER-MULT-PASSES ; ; Check that the reporting of IRs respects both -filter-passes and -filter-print-funcs -; RUN: opt -S -print-changed=cdiff-quiet -passes="instsimplify,no-op-function" -filter-passes="NoOpFunctionPass,InstSimplifyPass" -filter-print-funcs=f 2>&1 -o /dev/null < %s | FileCheck %s --check-prefix=CHECK-CDIFF-QUIET-FILTER-FUNC-PASSES +; RUN: opt -S -print-changed=cdiff-quiet -passes="instsimplify,no-op-function" -filter-passes="no-op-function,instsimplify" -filter-print-funcs=f 2>&1 -o /dev/null < %s | FileCheck %s --check-prefix=CHECK-CDIFF-QUIET-FILTER-FUNC-PASSES ; ; Check that repeated passes that change the IR are printed and that the ; others (including g) are filtered out. Note that only the first time diff --git a/llvm/test/Other/change-printer.ll b/llvm/test/Other/change-printer.ll --- a/llvm/test/Other/change-printer.ll +++ b/llvm/test/Other/change-printer.ll @@ -22,16 +22,16 @@ ; RUN: opt -S -print-changed -passes=instsimplify -filter-print-funcs="f,g" 2>&1 -o /dev/null < %s | FileCheck %s --check-prefix=CHECK-FILTER-MULT-FUNC ; ; Check that the reporting of IRs respects -filter-passes -; RUN: opt -S -print-changed -passes="instsimplify,no-op-function" -filter-passes="NoOpFunctionPass" 2>&1 -o /dev/null < %s | FileCheck %s --check-prefix=CHECK-FILTER-PASSES +; RUN: opt -S -print-changed -passes="instsimplify,no-op-function" -filter-passes="no-op-function" 2>&1 -o /dev/null < %s | FileCheck %s --check-prefix=CHECK-FILTER-PASSES ; ; Check that the reporting of IRs respects -filter-passes with multiple passes -; RUN: opt -S -print-changed -passes="instsimplify,no-op-function" -filter-passes="NoOpFunctionPass,InstSimplifyPass" 2>&1 -o /dev/null < %s | FileCheck %s --check-prefix=CHECK-FILTER-MULT-PASSES +; RUN: opt -S -print-changed -passes="instsimplify,no-op-function" -filter-passes="no-op-function,instsimplify" 2>&1 -o /dev/null < %s | FileCheck %s --check-prefix=CHECK-FILTER-MULT-PASSES ; ; Check that the reporting of IRs respects both -filter-passes and -filter-print-funcs -; RUN: opt -S -print-changed -passes="instsimplify,no-op-function" -filter-passes="NoOpFunctionPass,InstSimplifyPass" -filter-print-funcs=f 2>&1 -o /dev/null < %s | FileCheck %s --check-prefix=CHECK-FILTER-FUNC-PASSES +; RUN: opt -S -print-changed -passes="instsimplify,no-op-function" -filter-passes="no-op-function,instsimplify" -filter-print-funcs=f 2>&1 -o /dev/null < %s | FileCheck %s --check-prefix=CHECK-FILTER-FUNC-PASSES ; ; Check that the reporting of IRs respects -filter-passes, -filter-print-funcs and -print-module-scope -; RUN: opt -S -print-changed -passes="instsimplify,no-op-function" -filter-passes="NoOpFunctionPass,InstSimplifyPass" -filter-print-funcs=f -print-module-scope 2>&1 -o /dev/null < %s | FileCheck %s --check-prefix=CHECK-FILTER-FUNC-PASSES-MOD-SCOPE +; RUN: opt -S -print-changed -passes="instsimplify,no-op-function" -filter-passes="no-op-function,instsimplify" -filter-print-funcs=f -print-module-scope 2>&1 -o /dev/null < %s | FileCheck %s --check-prefix=CHECK-FILTER-FUNC-PASSES-MOD-SCOPE ; ; Check that repeated passes that change the IR are printed and that the ; others (including g) are filtered out. Note that the second time @@ -69,16 +69,16 @@ ; RUN: opt -S -print-changed=quiet -passes="instsimplify,no-op-function" -filter-passes="NoOpFunctionPass" 2>&1 -o /dev/null < %s | FileCheck %s --check-prefix=CHECK-QUIET-FILTER-PASSES-NONE --allow-empty ; ; Check that the reporting of IRs respects -filter-passes with multiple passes -; RUN: opt -S -print-changed=quiet -passes="instsimplify" -filter-passes="NoOpFunctionPass,InstSimplifyPass" 2>&1 -o /dev/null < %s | FileCheck %s --check-prefix=CHECK-QUIET-FILTER-PASSES +; RUN: opt -S -print-changed=quiet -passes="instsimplify" -filter-passes="no-op-function,instsimplify" 2>&1 -o /dev/null < %s | FileCheck %s --check-prefix=CHECK-QUIET-FILTER-PASSES ; ; Check that the reporting of IRs respects -filter-passes with multiple passes -; RUN: opt -S -print-changed=quiet -passes="instsimplify,no-op-function" -filter-passes="NoOpFunctionPass,InstSimplifyPass" 2>&1 -o /dev/null < %s | FileCheck %s --check-prefix=CHECK-QUIET-FILTER-MULT-PASSES +; RUN: opt -S -print-changed=quiet -passes="instsimplify,no-op-function" -filter-passes="no-op-function,instsimplify" 2>&1 -o /dev/null < %s | FileCheck %s --check-prefix=CHECK-QUIET-FILTER-MULT-PASSES ; ; Check that the reporting of IRs respects both -filter-passes and -filter-print-funcs -; RUN: opt -S -print-changed=quiet -passes="instsimplify,no-op-function" -filter-passes="NoOpFunctionPass,InstSimplifyPass" -filter-print-funcs=f 2>&1 -o /dev/null < %s | FileCheck %s --check-prefix=CHECK-QUIET-FILTER-FUNC-PASSES +; RUN: opt -S -print-changed=quiet -passes="instsimplify,no-op-function" -filter-passes="no-op-function,instsimplify" -filter-print-funcs=f 2>&1 -o /dev/null < %s | FileCheck %s --check-prefix=CHECK-QUIET-FILTER-FUNC-PASSES ; ; Check that the reporting of IRs respects -filter-passes, -filter-print-funcs and -print-module-scope -; RUN: opt -S -print-changed=quiet -passes="instsimplify,no-op-function" -filter-passes="NoOpFunctionPass,InstSimplifyPass" -filter-print-funcs=f -print-module-scope 2>&1 -o /dev/null < %s | FileCheck %s --check-prefix=CHECK-QUIET-FILTER-FUNC-PASSES-MOD-SCOPE +; RUN: opt -S -print-changed=quiet -passes="instsimplify,no-op-function" -filter-passes="no-op-function,instsimplify" -filter-print-funcs=f -print-module-scope 2>&1 -o /dev/null < %s | FileCheck %s --check-prefix=CHECK-QUIET-FILTER-FUNC-PASSES-MOD-SCOPE ; ; Check that repeated passes that change the IR are printed and that the ; others (including g) are filtered out. Note that the second time diff --git a/llvm/test/Other/print-on-crash.ll b/llvm/test/Other/print-on-crash.ll --- a/llvm/test/Other/print-on-crash.ll +++ b/llvm/test/Other/print-on-crash.ll @@ -10,7 +10,7 @@ ; RUN: not --crash opt -print-on-crash -print-module-scope -passes=trigger-crash < %s 2>&1 | FileCheck %s --check-prefix=CHECK_MODULE -; RUN: not --crash opt -print-on-crash -print-module-scope -passes=trigger-crash -filter-passes=TriggerCrashPass < %s 2>&1 | FileCheck %s --check-prefix=CHECK_MODULE +; RUN: not --crash opt -print-on-crash -print-module-scope -passes=trigger-crash -filter-passes=trigger-crash < %s 2>&1 | FileCheck %s --check-prefix=CHECK_MODULE ; RUN: not --crash opt -print-on-crash -print-module-scope -passes=trigger-crash -filter-passes=blah < %s 2>&1 | FileCheck %s --check-prefix=CHECK_FILTERED