};
} // end anonymous namespace
-/// Returns true if the given pass is hidden from IR printing.
-static bool isHiddenPass(Pass *pass) {
- return isa<OpToOpPassAdaptor, VerifierPass>(pass);
-}
-
static void printIR(Operation *op, bool printModuleScope, raw_ostream &out,
OpPrintingFlags flags) {
// Check to see if we are printing the top-level module.
/// Instrumentation hooks.
void IRPrinterInstrumentation::runBeforePass(Pass *pass, Operation *op) {
- if (isHiddenPass(pass))
+ if (isa<OpToOpPassAdaptor>(pass))
return;
// If the config asked to detect changes, record the current fingerprint.
if (config->shouldPrintAfterOnlyOnChange())
}
void IRPrinterInstrumentation::runAfterPass(Pass *pass, Operation *op) {
- if (isHiddenPass(pass))
+ if (isa<OpToOpPassAdaptor>(pass))
return;
// If the config asked to detect changes, compare the current fingerprint with
// the previous.
/// 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<OpToOpPassAdaptor>(this)) {
llvm::interleaveComma(adaptor->getPassManagers(), os,
[&](OpPassManager &pm) {
os << pm.getOpName() << "(";
- pm.printAsTextualPipeline(os, filterVerifier);
+ pm.printAsTextualPipeline(os);
os << ")";
});
return;
}
//===----------------------------------------------------------------------===//
-// Verifier Passes
-//===----------------------------------------------------------------------===//
-
-void VerifierPass::runOnOperation() {
- if (failed(verify(getOperation())))
- signalPassFailure();
- markAllAnalysesPreserved();
-}
-
-//===----------------------------------------------------------------------===//
// OpPassManagerImpl
//===----------------------------------------------------------------------===//
// Otherwise, merge into the existing adaptor and delete the current one.
currentAdaptor->mergeInto(*lastAdaptor);
it->reset();
- } else if (lastAdaptor && !isa<VerifierPass>(*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;
std::swap(passes, oldPasses);
for (std::unique_ptr<Pass> &pass : oldPasses) {
- // Ignore verifier passes, they are added back in the "addPass()" calls.
- if (isa<VerifierPass>(pass.get()))
- continue;
-
// If this pass isn't an adaptor, move it directly to the new pass list.
auto *currentAdaptor = dyn_cast<OpToOpPassAdaptor>(pass.get());
if (!currentAdaptor) {
// 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<Pass> &nestedPass : adaptorPM.getImpl().passes) {
- if (!isa<VerifierPass>(nestedPass.get()))
- nest(adaptorPM.getOpName()).addPass(std::move(nestedPass));
- }
+ for (std::unique_ptr<Pass> &nestedPass : adaptorPM.getImpl().passes)
+ nest(adaptorPM.getOpName()).addPass(std::move(nestedPass));
}
}
}
/// Prints out the given passes as the textual representation of a pipeline.
static void printAsTextualPipeline(ArrayRef<std::unique_ptr<Pass>> 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> &pass) {
- return !filterVerifier || !isa<VerifierPass>(pass);
- });
- llvm::interleaveComma(filteredPasses, os,
- [&](const std::unique_ptr<Pass> &pass) {
- pass->printAsTextualPipeline(os, filterVerifier);
- });
+ raw_ostream &os) {
+ llvm::interleaveComma(passes, os, [&](const std::unique_ptr<Pass> &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";
}