diff --git a/mlir/include/mlir/Pass/Pass.h b/mlir/include/mlir/Pass/Pass.h --- a/mlir/include/mlir/Pass/Pass.h +++ b/mlir/include/mlir/Pass/Pass.h @@ -118,7 +118,7 @@ /// Prints out the pass in the textual representation of pipelines. If this is /// an adaptor pass, print with the op_name(sub_pass,...) format. - void printAsTextualPipeline(raw_ostream &os, bool filterVerifier = true); + void printAsTextualPipeline(raw_ostream &os); //===--------------------------------------------------------------------===// // Statistics diff --git a/mlir/include/mlir/Pass/PassManager.h b/mlir/include/mlir/Pass/PassManager.h --- a/mlir/include/mlir/Pass/PassManager.h +++ b/mlir/include/mlir/Pass/PassManager.h @@ -105,7 +105,7 @@ /// of pipelines. /// Note: The quality of the string representation depends entirely on the /// the correctness of per-pass overrides of Pass::printAsTextualPipeline. - void printAsTextualPipeline(raw_ostream &os, bool filterVerifier = true); + void printAsTextualPipeline(raw_ostream &os); /// Raw dump of the pass manager to llvm::errs(). void dump(); diff --git a/mlir/lib/Pass/IRPrinting.cpp b/mlir/lib/Pass/IRPrinting.cpp --- a/mlir/lib/Pass/IRPrinting.cpp +++ b/mlir/lib/Pass/IRPrinting.cpp @@ -95,11 +95,6 @@ }; } // end anonymous namespace -/// Returns true if the given pass is hidden from IR printing. -static bool isHiddenPass(Pass *pass) { - return isa(pass); -} - static void printIR(Operation *op, bool printModuleScope, raw_ostream &out, OpPrintingFlags flags) { // Check to see if we are printing the top-level module. @@ -133,7 +128,7 @@ /// Instrumentation hooks. void IRPrinterInstrumentation::runBeforePass(Pass *pass, Operation *op) { - if (isHiddenPass(pass)) + if (isa(pass)) return; // If the config asked to detect changes, record the current fingerprint. if (config->shouldPrintAfterOnlyOnChange()) @@ -148,7 +143,7 @@ } void IRPrinterInstrumentation::runAfterPass(Pass *pass, Operation *op) { - if (isHiddenPass(pass)) + if (isa(pass)) return; // If the config asked to detect changes, compare the current fingerprint with // the previous. diff --git a/mlir/lib/Pass/Pass.cpp b/mlir/lib/Pass/Pass.cpp --- a/mlir/lib/Pass/Pass.cpp +++ b/mlir/lib/Pass/Pass.cpp @@ -52,13 +52,13 @@ /// Prints out the pass in the textual representation of pipelines. If this is /// an adaptor pass, print with the op_name(sub_pass,...) format. -void Pass::printAsTextualPipeline(raw_ostream &os, bool filterVerifier) { +void Pass::printAsTextualPipeline(raw_ostream &os) { // Special case for adaptors to use the 'op_name(sub_passes)' format. if (auto *adaptor = dyn_cast(this)) { llvm::interleaveComma(adaptor->getPassManagers(), os, [&](OpPassManager &pm) { os << pm.getOpName() << "("; - pm.printAsTextualPipeline(os, filterVerifier); + pm.printAsTextualPipeline(os); os << ")"; }); return; @@ -74,16 +74,6 @@ passOptions.print(os); } -//===----------------------------------------------------------------------===// -// Verifier Passes -//===----------------------------------------------------------------------===// - -void VerifierPass::runOnOperation() { - if (failed(verify(getOperation()))) - signalPassFailure(); - markAllAnalysesPreserved(); -} - //===----------------------------------------------------------------------===// // OpPassManagerImpl //===----------------------------------------------------------------------===// @@ -198,9 +188,9 @@ // Otherwise, merge into the existing adaptor and delete the current one. currentAdaptor->mergeInto(*lastAdaptor); it->reset(); - } else if (lastAdaptor && !isa(*it)) { - // If this pass is not an adaptor and not a verifier pass, then coalesce - // and forget any existing adaptor. + } else if (lastAdaptor) { + // If this pass is not an adaptor, then coalesce and forget any existing + // adaptor. for (auto &pm : lastAdaptor->getPassManagers()) pm.getImpl().coalesceAdjacentAdaptorPasses(); lastAdaptor = nullptr; @@ -223,10 +213,6 @@ std::swap(passes, oldPasses); for (std::unique_ptr &pass : oldPasses) { - // Ignore verifier passes, they are added back in the "addPass()" calls. - if (isa(pass.get())) - continue; - // If this pass isn't an adaptor, move it directly to the new pass list. auto *currentAdaptor = dyn_cast(pass.get()); if (!currentAdaptor) { @@ -237,12 +223,8 @@ // Otherwise, split the adaptors of each manager within the adaptor. for (OpPassManager &adaptorPM : currentAdaptor->getPassManagers()) { adaptorPM.getImpl().splitAdaptorPasses(); - - // Add all non-verifier passes to this pass manager. - for (std::unique_ptr &nestedPass : adaptorPM.getImpl().passes) { - if (!isa(nestedPass.get())) - nest(adaptorPM.getOpName()).addPass(std::move(nestedPass)); - } + for (std::unique_ptr &nestedPass : adaptorPM.getImpl().passes) + nest(adaptorPM.getOpName()).addPass(std::move(nestedPass)); } } } @@ -311,30 +293,21 @@ /// Prints out the given passes as the textual representation of a pipeline. static void printAsTextualPipeline(ArrayRef> passes, - raw_ostream &os, - bool filterVerifier = true) { - // Filter out passes that are not part of the public pipeline. - auto filteredPasses = - llvm::make_filter_range(passes, [&](const std::unique_ptr &pass) { - return !filterVerifier || !isa(pass); - }); - llvm::interleaveComma(filteredPasses, os, - [&](const std::unique_ptr &pass) { - pass->printAsTextualPipeline(os, filterVerifier); - }); + raw_ostream &os) { + llvm::interleaveComma(passes, os, [&](const std::unique_ptr &pass) { + pass->printAsTextualPipeline(os); + }); } /// Prints out the passes of the pass manager as the textual representation /// of pipelines. -void OpPassManager::printAsTextualPipeline(raw_ostream &os, - bool filterVerifier) { - ::printAsTextualPipeline(impl->passes, os, filterVerifier); +void OpPassManager::printAsTextualPipeline(raw_ostream &os) { + ::printAsTextualPipeline(impl->passes, os); } void OpPassManager::dump() { llvm::errs() << "Pass Manager with " << impl->passes.size() << " passes: "; - ::printAsTextualPipeline(impl->passes, llvm::errs(), - /*filterVerifier=*/false); + ::printAsTextualPipeline(impl->passes, llvm::errs()); llvm::errs() << "\n"; } diff --git a/mlir/lib/Pass/PassDetail.h b/mlir/lib/Pass/PassDetail.h --- a/mlir/lib/Pass/PassDetail.h +++ b/mlir/lib/Pass/PassDetail.h @@ -14,15 +14,6 @@ namespace mlir { namespace detail { -//===----------------------------------------------------------------------===// -// Verifier Pass -//===----------------------------------------------------------------------===// - -/// Pass to verify an operation and signal failure if necessary. -class VerifierPass : public PassWrapper> { - void runOnOperation() override; -}; - //===----------------------------------------------------------------------===// // OpToOpPassAdaptor //===----------------------------------------------------------------------===//