2020-04-01 01:48:34 -07:00
|
|
|
//===- Pass.cpp - MLIR pass registration generator ------------------------===//
|
|
|
|
|
//
|
|
|
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
|
|
|
//
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
//
|
|
|
|
|
// PassGen uses the description of passes to generate base classes for passes
|
|
|
|
|
// and command line registration.
|
|
|
|
|
//
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
|
|
#include "mlir/TableGen/GenInfo.h"
|
|
|
|
|
#include "mlir/TableGen/Pass.h"
|
|
|
|
|
#include "llvm/ADT/StringExtras.h"
|
2020-07-31 13:18:13 -07:00
|
|
|
#include "llvm/Support/CommandLine.h"
|
2020-04-01 01:48:34 -07:00
|
|
|
#include "llvm/Support/FormatVariadic.h"
|
|
|
|
|
#include "llvm/TableGen/Error.h"
|
|
|
|
|
#include "llvm/TableGen/Record.h"
|
|
|
|
|
|
|
|
|
|
using namespace mlir;
|
|
|
|
|
using namespace mlir::tblgen;
|
2024-10-02 13:23:44 -07:00
|
|
|
using llvm::formatv;
|
|
|
|
|
using llvm::RecordKeeper;
|
2020-04-01 01:48:34 -07:00
|
|
|
|
2020-07-31 13:18:13 -07:00
|
|
|
static llvm::cl::OptionCategory passGenCat("Options for -gen-pass-decls");
|
|
|
|
|
static llvm::cl::opt<std::string>
|
|
|
|
|
groupName("name", llvm::cl::desc("The name of this group of passes"),
|
|
|
|
|
llvm::cl::cat(passGenCat));
|
|
|
|
|
|
2022-08-24 09:59:50 +02:00
|
|
|
/// Extract the list of passes from the TableGen records.
|
2024-10-03 06:30:31 -07:00
|
|
|
static std::vector<Pass> getPasses(const RecordKeeper &records) {
|
2022-08-24 09:59:50 +02:00
|
|
|
std::vector<Pass> passes;
|
|
|
|
|
|
2024-10-03 06:30:31 -07:00
|
|
|
for (const auto *def : records.getAllDerivedDefinitions("PassBase"))
|
2022-08-24 09:59:50 +02:00
|
|
|
passes.emplace_back(def);
|
|
|
|
|
|
|
|
|
|
return passes;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const char *const passHeader = R"(
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
// {0}
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
)";
|
|
|
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
// GEN: Pass registration generation
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
|
|
/// The code snippet used to generate a pass registration.
|
|
|
|
|
///
|
|
|
|
|
/// {0}: The def name of the pass record.
|
|
|
|
|
/// {1}: The pass constructor call.
|
|
|
|
|
const char *const passRegistrationCode = R"(
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
// {0} Registration
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
|
|
inline void register{0}() {{
|
|
|
|
|
::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {{
|
|
|
|
|
return {1};
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Old registration code, kept for temporary backwards compatibility.
|
|
|
|
|
inline void register{0}Pass() {{
|
|
|
|
|
::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {{
|
|
|
|
|
return {1};
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
)";
|
|
|
|
|
|
|
|
|
|
/// The code snippet used to generate a function to register all passes in a
|
|
|
|
|
/// group.
|
|
|
|
|
///
|
|
|
|
|
/// {0}: The name of the pass group.
|
|
|
|
|
const char *const passGroupRegistrationCode = R"(
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
// {0} Registration
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
|
|
inline void register{0}Passes() {{
|
|
|
|
|
)";
|
|
|
|
|
|
|
|
|
|
/// Emits the definition of the struct to be used to control the pass options.
|
|
|
|
|
static void emitPassOptionsStruct(const Pass &pass, raw_ostream &os) {
|
|
|
|
|
StringRef passName = pass.getDef()->getName();
|
|
|
|
|
ArrayRef<PassOption> options = pass.getOptions();
|
|
|
|
|
|
|
|
|
|
// Emit the struct only if the pass has at least one option.
|
|
|
|
|
if (options.empty())
|
|
|
|
|
return;
|
|
|
|
|
|
2024-10-02 13:23:44 -07:00
|
|
|
os << formatv("struct {0}Options {{\n", passName);
|
2022-08-24 09:59:50 +02:00
|
|
|
|
|
|
|
|
for (const PassOption &opt : options) {
|
|
|
|
|
std::string type = opt.getType().str();
|
|
|
|
|
|
|
|
|
|
if (opt.isListOption())
|
[mlir] Pass Options ownership modifications (#110582)
This change makes two (related) changes:
First, it updates the tablegen option for `ListOption` to emit a
`SmallVector` instead of an `ArrayRef`. This brings `ListOption` more
inline with the traditional `Option`, where values are typically
provided using types that have storage. After this change, all options
should be fully owned by a Pass' `Options` object after it has been
fully constructed, unless the underlying type of the `Option` explicitly
indicates otherwise.
Second, it updates the generated constructors for Passes to consume
options by value instead of reference, and prefers moving options into
the pass itself. This should be more efficient for non-trivial options
objects, where the previous interface forced a copy to be materialized.
Now, at worst case the API materializes a copy (no worse than before);
at best-case, all options objects are moved into place. Ideally, we
could update the Pass constructor to take an r-value reference to the
Options object instead, but this approach will require numerous changes
to existing passes and their factory functions.
---------
Authored-by: Nikhil Kalra <nkalra@apple.com>
2024-10-01 09:48:51 -07:00
|
|
|
type = "::llvm::SmallVector<" + type + ">";
|
2022-08-24 09:59:50 +02:00
|
|
|
|
2024-10-02 13:23:44 -07:00
|
|
|
os.indent(2) << formatv("{0} {1}", type, opt.getCppVariableName());
|
2022-08-24 09:59:50 +02:00
|
|
|
|
2022-12-06 07:21:02 +00:00
|
|
|
if (std::optional<StringRef> defaultVal = opt.getDefaultValue())
|
2022-08-24 09:59:50 +02:00
|
|
|
os << " = " << defaultVal;
|
|
|
|
|
|
|
|
|
|
os << ";\n";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
os << "};\n";
|
|
|
|
|
}
|
|
|
|
|
|
2022-09-27 17:23:59 -04:00
|
|
|
static std::string getPassDeclVarName(const Pass &pass) {
|
|
|
|
|
return "GEN_PASS_DECL_" + pass.getDef()->getName().upper();
|
|
|
|
|
}
|
|
|
|
|
|
2022-08-24 09:59:50 +02:00
|
|
|
/// Emit the code to be included in the public header of the pass.
|
|
|
|
|
static void emitPassDecls(const Pass &pass, raw_ostream &os) {
|
|
|
|
|
StringRef passName = pass.getDef()->getName();
|
2022-09-27 17:23:59 -04:00
|
|
|
std::string enableVarName = getPassDeclVarName(pass);
|
2022-08-24 09:59:50 +02:00
|
|
|
|
|
|
|
|
os << "#ifdef " << enableVarName << "\n";
|
|
|
|
|
emitPassOptionsStruct(pass, os);
|
|
|
|
|
|
|
|
|
|
if (StringRef constructor = pass.getConstructor(); constructor.empty()) {
|
|
|
|
|
// Default constructor declaration.
|
|
|
|
|
os << "std::unique_ptr<::mlir::Pass> create" << passName << "();\n";
|
|
|
|
|
|
|
|
|
|
// Declaration of the constructor with options.
|
|
|
|
|
if (ArrayRef<PassOption> options = pass.getOptions(); !options.empty())
|
2024-10-02 13:23:44 -07:00
|
|
|
os << formatv("std::unique_ptr<::mlir::Pass> create{0}("
|
|
|
|
|
"{0}Options options);\n",
|
|
|
|
|
passName);
|
2022-08-24 09:59:50 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
os << "#undef " << enableVarName << "\n";
|
|
|
|
|
os << "#endif // " << enableVarName << "\n";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// Emit the code for registering each of the given passes with the global
|
|
|
|
|
/// PassRegistry.
|
|
|
|
|
static void emitRegistrations(llvm::ArrayRef<Pass> passes, raw_ostream &os) {
|
|
|
|
|
os << "#ifdef GEN_PASS_REGISTRATION\n";
|
|
|
|
|
|
|
|
|
|
for (const Pass &pass : passes) {
|
|
|
|
|
std::string constructorCall;
|
|
|
|
|
if (StringRef constructor = pass.getConstructor(); !constructor.empty())
|
|
|
|
|
constructorCall = constructor.str();
|
|
|
|
|
else
|
2024-10-02 13:23:44 -07:00
|
|
|
constructorCall = formatv("create{0}()", pass.getDef()->getName()).str();
|
2022-08-24 09:59:50 +02:00
|
|
|
|
2024-10-02 13:23:44 -07:00
|
|
|
os << formatv(passRegistrationCode, pass.getDef()->getName(),
|
|
|
|
|
constructorCall);
|
2022-08-24 09:59:50 +02:00
|
|
|
}
|
|
|
|
|
|
2024-10-02 13:23:44 -07:00
|
|
|
os << formatv(passGroupRegistrationCode, groupName);
|
2022-08-24 09:59:50 +02:00
|
|
|
|
|
|
|
|
for (const Pass &pass : passes)
|
|
|
|
|
os << " register" << pass.getDef()->getName() << "();\n";
|
|
|
|
|
|
|
|
|
|
os << "}\n";
|
|
|
|
|
os << "#undef GEN_PASS_REGISTRATION\n";
|
|
|
|
|
os << "#endif // GEN_PASS_REGISTRATION\n";
|
|
|
|
|
}
|
|
|
|
|
|
2020-04-01 01:50:29 -07:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
// GEN: Pass base class generation
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
|
|
/// The code snippet used to generate the start of a pass base class.
|
|
|
|
|
///
|
|
|
|
|
/// {0}: The def name of the pass record.
|
2020-04-07 13:58:12 -07:00
|
|
|
/// {1}: The base class for the pass.
|
|
|
|
|
/// {2): The command line argument for the pass.
|
2024-01-15 02:11:52 -08:00
|
|
|
/// {3}: The summary for the pass.
|
|
|
|
|
/// {4}: The dependent dialects registration.
|
2022-08-29 10:57:58 +02:00
|
|
|
const char *const baseClassBegin = R"(
|
2020-04-07 13:58:12 -07:00
|
|
|
template <typename DerivedT>
|
|
|
|
|
class {0}Base : public {1} {
|
|
|
|
|
public:
|
2021-02-04 17:12:15 +00:00
|
|
|
using Base = {0}Base;
|
|
|
|
|
|
2020-04-10 23:46:52 -07:00
|
|
|
{0}Base() : {1}(::mlir::TypeID::get<DerivedT>()) {{}
|
2021-06-15 18:09:31 +03:00
|
|
|
{0}Base(const {0}Base &other) : {1}(other) {{}
|
2024-03-05 09:07:43 +02:00
|
|
|
{0}Base& operator=(const {0}Base &) = delete;
|
|
|
|
|
{0}Base({0}Base &&) = delete;
|
|
|
|
|
{0}Base& operator=({0}Base &&) = delete;
|
|
|
|
|
~{0}Base() = default;
|
2020-04-07 13:58:12 -07:00
|
|
|
|
2020-04-01 01:50:29 -07:00
|
|
|
/// Returns the command-line argument attached to this pass.
|
2021-02-04 17:12:15 +00:00
|
|
|
static constexpr ::llvm::StringLiteral getArgumentName() {
|
|
|
|
|
return ::llvm::StringLiteral("{2}");
|
|
|
|
|
}
|
2020-06-26 13:20:44 +02:00
|
|
|
::llvm::StringRef getArgument() const override { return "{2}"; }
|
2020-04-01 01:50:29 -07:00
|
|
|
|
2025-10-13 05:55:32 +02:00
|
|
|
::llvm::StringRef getDescription() const override { return R"PD({3})PD"; }
|
2021-06-16 23:41:23 +00:00
|
|
|
|
2020-04-07 13:58:12 -07:00
|
|
|
/// Returns the derived pass name.
|
2021-02-04 17:12:15 +00:00
|
|
|
static constexpr ::llvm::StringLiteral getPassName() {
|
|
|
|
|
return ::llvm::StringLiteral("{0}");
|
|
|
|
|
}
|
2020-06-26 13:20:44 +02:00
|
|
|
::llvm::StringRef getName() const override { return "{0}"; }
|
2020-04-07 13:58:12 -07:00
|
|
|
|
|
|
|
|
/// Support isa/dyn_cast functionality for the derived pass class.
|
|
|
|
|
static bool classof(const ::mlir::Pass *pass) {{
|
2020-04-10 23:46:52 -07:00
|
|
|
return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
|
2020-04-07 13:58:12 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// A clone method to create a copy of this pass.
|
[mlir] Avoid pontentially ambiguous class name
Summary: The Pass class exists in both the mlir and the llvm namespaces. Use the fully qualified class name to avoid any ambiguities.
Reviewers: rriddle
Reviewed By: rriddle
Subscribers: mehdi_amini, jpienaar, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, aartbik, liufengdb, stephenneuendorffer, Joonsoo, grosul1, jurahul, msifontes
Tags: #mlir
Differential Revision: https://reviews.llvm.org/D82371
2020-06-23 21:24:04 +02:00
|
|
|
std::unique_ptr<::mlir::Pass> clonePass() const override {{
|
2020-04-07 13:58:12 -07:00
|
|
|
return std::make_unique<DerivedT>(*static_cast<const DerivedT *>(this));
|
|
|
|
|
}
|
|
|
|
|
|
Separate the Registration from Loading dialects in the Context
This changes the behavior of constructing MLIRContext to no longer load globally
registered dialects on construction. Instead Dialects are only loaded explicitly
on demand:
- the Parser is lazily loading Dialects in the context as it encounters them
during parsing. This is the only purpose for registering dialects and not load
them in the context.
- Passes are expected to declare the dialects they will create entity from
(Operations, Attributes, or Types), and the PassManager is loading Dialects into
the Context when starting a pipeline.
This changes simplifies the configuration of the registration: a compiler only
need to load the dialect for the IR it will emit, and the optimizer is
self-contained and load the required Dialects. For example in the Toy tutorial,
the compiler only needs to load the Toy dialect in the Context, all the others
(linalg, affine, std, LLVM, ...) are automatically loaded depending on the
optimization pipeline enabled.
To adjust to this change, stop using the existing dialect registration: the
global registry will be removed soon.
1) For passes, you need to override the method:
virtual void getDependentDialects(DialectRegistry ®istry) const {}
and registery on the provided registry any dialect that this pass can produce.
Passes defined in TableGen can provide this list in the dependentDialects list
field.
2) For dialects, on construction you can register dependent dialects using the
provided MLIRContext: `context.getOrLoadDialect<DialectName>()`
This is useful if a dialect may canonicalize or have interfaces involving
another dialect.
3) For loading IR, dialect that can be in the input file must be explicitly
registered with the context. `MlirOptMain()` is taking an explicit registry for
this purpose. See how the standalone-opt.cpp example is setup:
mlir::DialectRegistry registry;
registry.insert<mlir::standalone::StandaloneDialect>();
registry.insert<mlir::StandardOpsDialect>();
Only operations from these two dialects can be in the input file. To include all
of the dialects in MLIR Core, you can populate the registry this way:
mlir::registerAllDialects(registry);
4) For `mlir-translate` callback, as well as frontend, Dialects can be loaded in
the context before emitting the IR: context.getOrLoadDialect<ToyDialect>()
Differential Revision: https://reviews.llvm.org/D85622
2020-08-18 20:01:19 +00:00
|
|
|
/// Return the dialect that must be loaded in the context before this pass.
|
|
|
|
|
void getDependentDialects(::mlir::DialectRegistry ®istry) const override {
|
2021-06-16 23:41:23 +00:00
|
|
|
{4}
|
Separate the Registration from Loading dialects in the Context
This changes the behavior of constructing MLIRContext to no longer load globally
registered dialects on construction. Instead Dialects are only loaded explicitly
on demand:
- the Parser is lazily loading Dialects in the context as it encounters them
during parsing. This is the only purpose for registering dialects and not load
them in the context.
- Passes are expected to declare the dialects they will create entity from
(Operations, Attributes, or Types), and the PassManager is loading Dialects into
the Context when starting a pipeline.
This changes simplifies the configuration of the registration: a compiler only
need to load the dialect for the IR it will emit, and the optimizer is
self-contained and load the required Dialects. For example in the Toy tutorial,
the compiler only needs to load the Toy dialect in the Context, all the others
(linalg, affine, std, LLVM, ...) are automatically loaded depending on the
optimization pipeline enabled.
To adjust to this change, stop using the existing dialect registration: the
global registry will be removed soon.
1) For passes, you need to override the method:
virtual void getDependentDialects(DialectRegistry ®istry) const {}
and registery on the provided registry any dialect that this pass can produce.
Passes defined in TableGen can provide this list in the dependentDialects list
field.
2) For dialects, on construction you can register dependent dialects using the
provided MLIRContext: `context.getOrLoadDialect<DialectName>()`
This is useful if a dialect may canonicalize or have interfaces involving
another dialect.
3) For loading IR, dialect that can be in the input file must be explicitly
registered with the context. `MlirOptMain()` is taking an explicit registry for
this purpose. See how the standalone-opt.cpp example is setup:
mlir::DialectRegistry registry;
registry.insert<mlir::standalone::StandaloneDialect>();
registry.insert<mlir::StandardOpsDialect>();
Only operations from these two dialects can be in the input file. To include all
of the dialects in MLIR Core, you can populate the registry this way:
mlir::registerAllDialects(registry);
4) For `mlir-translate` callback, as well as frontend, Dialects can be loaded in
the context before emitting the IR: context.getOrLoadDialect<ToyDialect>()
Differential Revision: https://reviews.llvm.org/D85622
2020-08-18 20:01:19 +00:00
|
|
|
}
|
|
|
|
|
|
2022-03-30 17:00:37 -07:00
|
|
|
/// Explicitly declare the TypeID for this class. We declare an explicit private
|
|
|
|
|
/// instantiation because Pass classes should only be visible by the current
|
|
|
|
|
/// library.
|
|
|
|
|
MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID({0}Base<DerivedT>)
|
|
|
|
|
|
2020-04-01 01:50:29 -07:00
|
|
|
)";
|
|
|
|
|
|
Separate the Registration from Loading dialects in the Context
This changes the behavior of constructing MLIRContext to no longer load globally
registered dialects on construction. Instead Dialects are only loaded explicitly
on demand:
- the Parser is lazily loading Dialects in the context as it encounters them
during parsing. This is the only purpose for registering dialects and not load
them in the context.
- Passes are expected to declare the dialects they will create entity from
(Operations, Attributes, or Types), and the PassManager is loading Dialects into
the Context when starting a pipeline.
This changes simplifies the configuration of the registration: a compiler only
need to load the dialect for the IR it will emit, and the optimizer is
self-contained and load the required Dialects. For example in the Toy tutorial,
the compiler only needs to load the Toy dialect in the Context, all the others
(linalg, affine, std, LLVM, ...) are automatically loaded depending on the
optimization pipeline enabled.
To adjust to this change, stop using the existing dialect registration: the
global registry will be removed soon.
1) For passes, you need to override the method:
virtual void getDependentDialects(DialectRegistry ®istry) const {}
and registery on the provided registry any dialect that this pass can produce.
Passes defined in TableGen can provide this list in the dependentDialects list
field.
2) For dialects, on construction you can register dependent dialects using the
provided MLIRContext: `context.getOrLoadDialect<DialectName>()`
This is useful if a dialect may canonicalize or have interfaces involving
another dialect.
3) For loading IR, dialect that can be in the input file must be explicitly
registered with the context. `MlirOptMain()` is taking an explicit registry for
this purpose. See how the standalone-opt.cpp example is setup:
mlir::DialectRegistry registry;
registry.insert<mlir::standalone::StandaloneDialect>();
registry.insert<mlir::StandardOpsDialect>();
Only operations from these two dialects can be in the input file. To include all
of the dialects in MLIR Core, you can populate the registry this way:
mlir::registerAllDialects(registry);
4) For `mlir-translate` callback, as well as frontend, Dialects can be loaded in
the context before emitting the IR: context.getOrLoadDialect<ToyDialect>()
Differential Revision: https://reviews.llvm.org/D85622
2020-08-18 20:01:19 +00:00
|
|
|
/// Registration for a single dependent dialect, to be inserted for each
|
|
|
|
|
/// dependent dialect in the `getDependentDialects` above.
|
2024-01-15 02:11:52 -08:00
|
|
|
const char *const dialectRegistrationTemplate = "registry.insert<{0}>();";
|
Separate the Registration from Loading dialects in the Context
This changes the behavior of constructing MLIRContext to no longer load globally
registered dialects on construction. Instead Dialects are only loaded explicitly
on demand:
- the Parser is lazily loading Dialects in the context as it encounters them
during parsing. This is the only purpose for registering dialects and not load
them in the context.
- Passes are expected to declare the dialects they will create entity from
(Operations, Attributes, or Types), and the PassManager is loading Dialects into
the Context when starting a pipeline.
This changes simplifies the configuration of the registration: a compiler only
need to load the dialect for the IR it will emit, and the optimizer is
self-contained and load the required Dialects. For example in the Toy tutorial,
the compiler only needs to load the Toy dialect in the Context, all the others
(linalg, affine, std, LLVM, ...) are automatically loaded depending on the
optimization pipeline enabled.
To adjust to this change, stop using the existing dialect registration: the
global registry will be removed soon.
1) For passes, you need to override the method:
virtual void getDependentDialects(DialectRegistry ®istry) const {}
and registery on the provided registry any dialect that this pass can produce.
Passes defined in TableGen can provide this list in the dependentDialects list
field.
2) For dialects, on construction you can register dependent dialects using the
provided MLIRContext: `context.getOrLoadDialect<DialectName>()`
This is useful if a dialect may canonicalize or have interfaces involving
another dialect.
3) For loading IR, dialect that can be in the input file must be explicitly
registered with the context. `MlirOptMain()` is taking an explicit registry for
this purpose. See how the standalone-opt.cpp example is setup:
mlir::DialectRegistry registry;
registry.insert<mlir::standalone::StandaloneDialect>();
registry.insert<mlir::StandardOpsDialect>();
Only operations from these two dialects can be in the input file. To include all
of the dialects in MLIR Core, you can populate the registry this way:
mlir::registerAllDialects(registry);
4) For `mlir-translate` callback, as well as frontend, Dialects can be loaded in
the context before emitting the IR: context.getOrLoadDialect<ToyDialect>()
Differential Revision: https://reviews.llvm.org/D85622
2020-08-18 20:01:19 +00:00
|
|
|
|
2022-08-29 10:57:58 +02:00
|
|
|
const char *const friendDefaultConstructorDeclTemplate = R"(
|
|
|
|
|
namespace impl {{
|
|
|
|
|
std::unique_ptr<::mlir::Pass> create{0}();
|
|
|
|
|
} // namespace impl
|
|
|
|
|
)";
|
|
|
|
|
|
|
|
|
|
const char *const friendDefaultConstructorWithOptionsDeclTemplate = R"(
|
|
|
|
|
namespace impl {{
|
[mlir] Pass Options ownership modifications (#110582)
This change makes two (related) changes:
First, it updates the tablegen option for `ListOption` to emit a
`SmallVector` instead of an `ArrayRef`. This brings `ListOption` more
inline with the traditional `Option`, where values are typically
provided using types that have storage. After this change, all options
should be fully owned by a Pass' `Options` object after it has been
fully constructed, unless the underlying type of the `Option` explicitly
indicates otherwise.
Second, it updates the generated constructors for Passes to consume
options by value instead of reference, and prefers moving options into
the pass itself. This should be more efficient for non-trivial options
objects, where the previous interface forced a copy to be materialized.
Now, at worst case the API materializes a copy (no worse than before);
at best-case, all options objects are moved into place. Ideally, we
could update the Pass constructor to take an r-value reference to the
Options object instead, but this approach will require numerous changes
to existing passes and their factory functions.
---------
Authored-by: Nikhil Kalra <nkalra@apple.com>
2024-10-01 09:48:51 -07:00
|
|
|
std::unique_ptr<::mlir::Pass> create{0}({0}Options options);
|
2022-08-29 10:57:58 +02:00
|
|
|
} // namespace impl
|
|
|
|
|
)";
|
|
|
|
|
|
|
|
|
|
const char *const friendDefaultConstructorDefTemplate = R"(
|
2022-08-24 09:59:50 +02:00
|
|
|
friend std::unique_ptr<::mlir::Pass> create{0}() {{
|
|
|
|
|
return std::make_unique<DerivedT>();
|
|
|
|
|
}
|
|
|
|
|
)";
|
|
|
|
|
|
2022-08-29 10:57:58 +02:00
|
|
|
const char *const friendDefaultConstructorWithOptionsDefTemplate = R"(
|
[mlir] Pass Options ownership modifications (#110582)
This change makes two (related) changes:
First, it updates the tablegen option for `ListOption` to emit a
`SmallVector` instead of an `ArrayRef`. This brings `ListOption` more
inline with the traditional `Option`, where values are typically
provided using types that have storage. After this change, all options
should be fully owned by a Pass' `Options` object after it has been
fully constructed, unless the underlying type of the `Option` explicitly
indicates otherwise.
Second, it updates the generated constructors for Passes to consume
options by value instead of reference, and prefers moving options into
the pass itself. This should be more efficient for non-trivial options
objects, where the previous interface forced a copy to be materialized.
Now, at worst case the API materializes a copy (no worse than before);
at best-case, all options objects are moved into place. Ideally, we
could update the Pass constructor to take an r-value reference to the
Options object instead, but this approach will require numerous changes
to existing passes and their factory functions.
---------
Authored-by: Nikhil Kalra <nkalra@apple.com>
2024-10-01 09:48:51 -07:00
|
|
|
friend std::unique_ptr<::mlir::Pass> create{0}({0}Options options) {{
|
|
|
|
|
return std::make_unique<DerivedT>(std::move(options));
|
2022-08-24 09:59:50 +02:00
|
|
|
}
|
|
|
|
|
)";
|
|
|
|
|
|
2022-08-29 10:57:58 +02:00
|
|
|
const char *const defaultConstructorDefTemplate = R"(
|
|
|
|
|
std::unique_ptr<::mlir::Pass> create{0}() {{
|
|
|
|
|
return impl::create{0}();
|
|
|
|
|
}
|
|
|
|
|
)";
|
|
|
|
|
|
|
|
|
|
const char *const defaultConstructorWithOptionsDefTemplate = R"(
|
[mlir] Pass Options ownership modifications (#110582)
This change makes two (related) changes:
First, it updates the tablegen option for `ListOption` to emit a
`SmallVector` instead of an `ArrayRef`. This brings `ListOption` more
inline with the traditional `Option`, where values are typically
provided using types that have storage. After this change, all options
should be fully owned by a Pass' `Options` object after it has been
fully constructed, unless the underlying type of the `Option` explicitly
indicates otherwise.
Second, it updates the generated constructors for Passes to consume
options by value instead of reference, and prefers moving options into
the pass itself. This should be more efficient for non-trivial options
objects, where the previous interface forced a copy to be materialized.
Now, at worst case the API materializes a copy (no worse than before);
at best-case, all options objects are moved into place. Ideally, we
could update the Pass constructor to take an r-value reference to the
Options object instead, but this approach will require numerous changes
to existing passes and their factory functions.
---------
Authored-by: Nikhil Kalra <nkalra@apple.com>
2024-10-01 09:48:51 -07:00
|
|
|
std::unique_ptr<::mlir::Pass> create{0}({0}Options options) {{
|
|
|
|
|
return impl::create{0}(std::move(options));
|
2022-08-29 10:57:58 +02:00
|
|
|
}
|
|
|
|
|
)";
|
|
|
|
|
|
2020-04-01 01:50:29 -07:00
|
|
|
/// Emit the declarations for each of the pass options.
|
|
|
|
|
static void emitPassOptionDecls(const Pass &pass, raw_ostream &os) {
|
|
|
|
|
for (const PassOption &opt : pass.getOptions()) {
|
2020-06-26 13:20:44 +02:00
|
|
|
os.indent(2) << "::mlir::Pass::"
|
|
|
|
|
<< (opt.isListOption() ? "ListOption" : "Option");
|
2020-04-01 01:50:29 -07:00
|
|
|
|
2025-10-13 05:55:32 +02:00
|
|
|
os << formatv(R"(<{0}> {1}{{*this, "{2}", ::llvm::cl::desc(R"PO({3})PO"))",
|
2024-10-02 13:23:44 -07:00
|
|
|
opt.getType(), opt.getCppVariableName(), opt.getArgument(),
|
2025-10-13 05:55:32 +02:00
|
|
|
opt.getDescription().trim());
|
2022-12-06 07:21:02 +00:00
|
|
|
if (std::optional<StringRef> defaultVal = opt.getDefaultValue())
|
2020-06-26 13:20:44 +02:00
|
|
|
os << ", ::llvm::cl::init(" << defaultVal << ")";
|
2022-12-06 07:21:02 +00:00
|
|
|
if (std::optional<StringRef> additionalFlags = opt.getAdditionalFlags())
|
2020-04-01 01:50:29 -07:00
|
|
|
os << ", " << *additionalFlags;
|
|
|
|
|
os << "};\n";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// Emit the declarations for each of the pass statistics.
|
|
|
|
|
static void emitPassStatisticDecls(const Pass &pass, raw_ostream &os) {
|
|
|
|
|
for (const PassStatistic &stat : pass.getStatistics()) {
|
2025-10-13 05:55:32 +02:00
|
|
|
os << formatv(
|
|
|
|
|
" ::mlir::Pass::Statistic {0}{{this, \"{1}\", R\"PS({2})PS\"};\n",
|
|
|
|
|
stat.getCppVariableName(), stat.getName(),
|
|
|
|
|
stat.getDescription().trim());
|
2020-04-01 01:50:29 -07:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-08-24 09:59:50 +02:00
|
|
|
/// Emit the code to be used in the implementation of the pass.
|
|
|
|
|
static void emitPassDefs(const Pass &pass, raw_ostream &os) {
|
|
|
|
|
StringRef passName = pass.getDef()->getName();
|
|
|
|
|
std::string enableVarName = "GEN_PASS_DEF_" + passName.upper();
|
2022-08-29 10:57:58 +02:00
|
|
|
bool emitDefaultConstructors = pass.getConstructor().empty();
|
|
|
|
|
bool emitDefaultConstructorWithOptions = !pass.getOptions().empty();
|
2022-08-24 09:59:50 +02:00
|
|
|
|
|
|
|
|
os << "#ifdef " << enableVarName << "\n";
|
|
|
|
|
|
2022-08-29 10:57:58 +02:00
|
|
|
if (emitDefaultConstructors) {
|
2024-10-02 13:23:44 -07:00
|
|
|
os << formatv(friendDefaultConstructorDeclTemplate, passName);
|
2022-08-29 10:57:58 +02:00
|
|
|
|
|
|
|
|
if (emitDefaultConstructorWithOptions)
|
2024-10-02 13:23:44 -07:00
|
|
|
os << formatv(friendDefaultConstructorWithOptionsDeclTemplate, passName);
|
2022-08-29 10:57:58 +02:00
|
|
|
}
|
|
|
|
|
|
Separate the Registration from Loading dialects in the Context
This changes the behavior of constructing MLIRContext to no longer load globally
registered dialects on construction. Instead Dialects are only loaded explicitly
on demand:
- the Parser is lazily loading Dialects in the context as it encounters them
during parsing. This is the only purpose for registering dialects and not load
them in the context.
- Passes are expected to declare the dialects they will create entity from
(Operations, Attributes, or Types), and the PassManager is loading Dialects into
the Context when starting a pipeline.
This changes simplifies the configuration of the registration: a compiler only
need to load the dialect for the IR it will emit, and the optimizer is
self-contained and load the required Dialects. For example in the Toy tutorial,
the compiler only needs to load the Toy dialect in the Context, all the others
(linalg, affine, std, LLVM, ...) are automatically loaded depending on the
optimization pipeline enabled.
To adjust to this change, stop using the existing dialect registration: the
global registry will be removed soon.
1) For passes, you need to override the method:
virtual void getDependentDialects(DialectRegistry ®istry) const {}
and registery on the provided registry any dialect that this pass can produce.
Passes defined in TableGen can provide this list in the dependentDialects list
field.
2) For dialects, on construction you can register dependent dialects using the
provided MLIRContext: `context.getOrLoadDialect<DialectName>()`
This is useful if a dialect may canonicalize or have interfaces involving
another dialect.
3) For loading IR, dialect that can be in the input file must be explicitly
registered with the context. `MlirOptMain()` is taking an explicit registry for
this purpose. See how the standalone-opt.cpp example is setup:
mlir::DialectRegistry registry;
registry.insert<mlir::standalone::StandaloneDialect>();
registry.insert<mlir::StandardOpsDialect>();
Only operations from these two dialects can be in the input file. To include all
of the dialects in MLIR Core, you can populate the registry this way:
mlir::registerAllDialects(registry);
4) For `mlir-translate` callback, as well as frontend, Dialects can be loaded in
the context before emitting the IR: context.getOrLoadDialect<ToyDialect>()
Differential Revision: https://reviews.llvm.org/D85622
2020-08-18 20:01:19 +00:00
|
|
|
std::string dependentDialectRegistrations;
|
|
|
|
|
{
|
|
|
|
|
llvm::raw_string_ostream dialectsOs(dependentDialectRegistrations);
|
2024-01-15 02:11:52 -08:00
|
|
|
llvm::interleave(
|
|
|
|
|
pass.getDependentDialects(), dialectsOs,
|
|
|
|
|
[&](StringRef dependentDialect) {
|
2024-10-02 13:23:44 -07:00
|
|
|
dialectsOs << formatv(dialectRegistrationTemplate, dependentDialect);
|
2024-01-15 02:11:52 -08:00
|
|
|
},
|
|
|
|
|
"\n ");
|
Separate the Registration from Loading dialects in the Context
This changes the behavior of constructing MLIRContext to no longer load globally
registered dialects on construction. Instead Dialects are only loaded explicitly
on demand:
- the Parser is lazily loading Dialects in the context as it encounters them
during parsing. This is the only purpose for registering dialects and not load
them in the context.
- Passes are expected to declare the dialects they will create entity from
(Operations, Attributes, or Types), and the PassManager is loading Dialects into
the Context when starting a pipeline.
This changes simplifies the configuration of the registration: a compiler only
need to load the dialect for the IR it will emit, and the optimizer is
self-contained and load the required Dialects. For example in the Toy tutorial,
the compiler only needs to load the Toy dialect in the Context, all the others
(linalg, affine, std, LLVM, ...) are automatically loaded depending on the
optimization pipeline enabled.
To adjust to this change, stop using the existing dialect registration: the
global registry will be removed soon.
1) For passes, you need to override the method:
virtual void getDependentDialects(DialectRegistry ®istry) const {}
and registery on the provided registry any dialect that this pass can produce.
Passes defined in TableGen can provide this list in the dependentDialects list
field.
2) For dialects, on construction you can register dependent dialects using the
provided MLIRContext: `context.getOrLoadDialect<DialectName>()`
This is useful if a dialect may canonicalize or have interfaces involving
another dialect.
3) For loading IR, dialect that can be in the input file must be explicitly
registered with the context. `MlirOptMain()` is taking an explicit registry for
this purpose. See how the standalone-opt.cpp example is setup:
mlir::DialectRegistry registry;
registry.insert<mlir::standalone::StandaloneDialect>();
registry.insert<mlir::StandardOpsDialect>();
Only operations from these two dialects can be in the input file. To include all
of the dialects in MLIR Core, you can populate the registry this way:
mlir::registerAllDialects(registry);
4) For `mlir-translate` callback, as well as frontend, Dialects can be loaded in
the context before emitting the IR: context.getOrLoadDialect<ToyDialect>()
Differential Revision: https://reviews.llvm.org/D85622
2020-08-18 20:01:19 +00:00
|
|
|
}
|
2022-08-24 09:59:50 +02:00
|
|
|
|
2022-08-29 10:57:58 +02:00
|
|
|
os << "namespace impl {\n";
|
2024-10-02 13:23:44 -07:00
|
|
|
os << formatv(baseClassBegin, passName, pass.getBaseClass(),
|
2025-10-13 05:55:32 +02:00
|
|
|
pass.getArgument(), pass.getSummary().trim(),
|
2024-10-02 13:23:44 -07:00
|
|
|
dependentDialectRegistrations);
|
2022-08-24 09:59:50 +02:00
|
|
|
|
|
|
|
|
if (ArrayRef<PassOption> options = pass.getOptions(); !options.empty()) {
|
2024-10-02 13:23:44 -07:00
|
|
|
os.indent(2) << formatv("{0}Base({0}Options options) : {0}Base() {{\n",
|
|
|
|
|
passName);
|
2022-08-24 09:59:50 +02:00
|
|
|
|
|
|
|
|
for (const PassOption &opt : pass.getOptions())
|
2024-10-02 13:23:44 -07:00
|
|
|
os.indent(4) << formatv("{0} = std::move(options.{0});\n",
|
|
|
|
|
opt.getCppVariableName());
|
2022-08-24 09:59:50 +02:00
|
|
|
|
|
|
|
|
os.indent(2) << "}\n";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Protected content
|
|
|
|
|
os << "protected:\n";
|
2020-04-01 01:50:29 -07:00
|
|
|
emitPassOptionDecls(pass, os);
|
|
|
|
|
emitPassStatisticDecls(pass, os);
|
2022-08-24 09:59:50 +02:00
|
|
|
|
|
|
|
|
// Private content
|
|
|
|
|
os << "private:\n";
|
|
|
|
|
|
2022-08-29 10:57:58 +02:00
|
|
|
if (emitDefaultConstructors) {
|
2024-10-02 13:23:44 -07:00
|
|
|
os << formatv(friendDefaultConstructorDefTemplate, passName);
|
2022-08-24 09:59:50 +02:00
|
|
|
|
|
|
|
|
if (!pass.getOptions().empty())
|
2024-10-02 13:23:44 -07:00
|
|
|
os << formatv(friendDefaultConstructorWithOptionsDefTemplate, passName);
|
2022-08-24 09:59:50 +02:00
|
|
|
}
|
|
|
|
|
|
2020-04-07 13:58:12 -07:00
|
|
|
os << "};\n";
|
2022-08-29 10:57:58 +02:00
|
|
|
os << "} // namespace impl\n";
|
|
|
|
|
|
|
|
|
|
if (emitDefaultConstructors) {
|
2024-10-02 13:23:44 -07:00
|
|
|
os << formatv(defaultConstructorDefTemplate, passName);
|
2022-08-29 10:57:58 +02:00
|
|
|
|
|
|
|
|
if (emitDefaultConstructorWithOptions)
|
2024-10-02 13:23:44 -07:00
|
|
|
os << formatv(defaultConstructorWithOptionsDefTemplate, passName);
|
2022-08-29 10:57:58 +02:00
|
|
|
}
|
2022-08-24 09:59:50 +02:00
|
|
|
|
|
|
|
|
os << "#undef " << enableVarName << "\n";
|
|
|
|
|
os << "#endif // " << enableVarName << "\n";
|
2020-04-07 13:58:12 -07:00
|
|
|
}
|
|
|
|
|
|
2022-08-30 09:48:11 +02:00
|
|
|
static void emitPass(const Pass &pass, raw_ostream &os) {
|
|
|
|
|
StringRef passName = pass.getDef()->getName();
|
2024-10-02 13:23:44 -07:00
|
|
|
os << formatv(passHeader, passName);
|
2022-08-30 09:48:11 +02:00
|
|
|
|
|
|
|
|
emitPassDecls(pass, os);
|
|
|
|
|
emitPassDefs(pass, os);
|
|
|
|
|
}
|
|
|
|
|
|
2022-08-31 23:38:31 +02:00
|
|
|
// TODO: Drop old pass declarations.
|
|
|
|
|
// The old pass base class is being kept until all the passes have switched to
|
|
|
|
|
// the new decls/defs design.
|
|
|
|
|
const char *const oldPassDeclBegin = R"(
|
|
|
|
|
template <typename DerivedT>
|
|
|
|
|
class {0}Base : public {1} {
|
|
|
|
|
public:
|
|
|
|
|
using Base = {0}Base;
|
|
|
|
|
|
|
|
|
|
{0}Base() : {1}(::mlir::TypeID::get<DerivedT>()) {{}
|
|
|
|
|
{0}Base(const {0}Base &other) : {1}(other) {{}
|
2024-03-05 09:07:43 +02:00
|
|
|
{0}Base& operator=(const {0}Base &) = delete;
|
|
|
|
|
{0}Base({0}Base &&) = delete;
|
|
|
|
|
{0}Base& operator=({0}Base &&) = delete;
|
|
|
|
|
~{0}Base() = default;
|
2022-08-31 23:38:31 +02:00
|
|
|
|
|
|
|
|
/// Returns the command-line argument attached to this pass.
|
|
|
|
|
static constexpr ::llvm::StringLiteral getArgumentName() {
|
|
|
|
|
return ::llvm::StringLiteral("{2}");
|
|
|
|
|
}
|
|
|
|
|
::llvm::StringRef getArgument() const override { return "{2}"; }
|
|
|
|
|
|
2025-10-13 05:55:32 +02:00
|
|
|
::llvm::StringRef getDescription() const override { return R"PD({3})PD"; }
|
2022-08-31 23:38:31 +02:00
|
|
|
|
|
|
|
|
/// Returns the derived pass name.
|
|
|
|
|
static constexpr ::llvm::StringLiteral getPassName() {
|
|
|
|
|
return ::llvm::StringLiteral("{0}");
|
|
|
|
|
}
|
|
|
|
|
::llvm::StringRef getName() const override { return "{0}"; }
|
|
|
|
|
|
|
|
|
|
/// Support isa/dyn_cast functionality for the derived pass class.
|
|
|
|
|
static bool classof(const ::mlir::Pass *pass) {{
|
|
|
|
|
return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// A clone method to create a copy of this pass.
|
|
|
|
|
std::unique_ptr<::mlir::Pass> clonePass() const override {{
|
|
|
|
|
return std::make_unique<DerivedT>(*static_cast<const DerivedT *>(this));
|
|
|
|
|
}
|
|
|
|
|
|
2024-01-15 02:11:52 -08:00
|
|
|
/// Register the dialects that must be loaded in the context before this pass.
|
2022-08-31 23:38:31 +02:00
|
|
|
void getDependentDialects(::mlir::DialectRegistry ®istry) const override {
|
|
|
|
|
{4}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// Explicitly declare the TypeID for this class. We declare an explicit private
|
|
|
|
|
/// instantiation because Pass classes should only be visible by the current
|
|
|
|
|
/// library.
|
|
|
|
|
MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID({0}Base<DerivedT>)
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
)";
|
|
|
|
|
|
|
|
|
|
// TODO: Drop old pass declarations.
|
|
|
|
|
/// Emit a backward-compatible declaration of the pass base class.
|
|
|
|
|
static void emitOldPassDecl(const Pass &pass, raw_ostream &os) {
|
|
|
|
|
StringRef defName = pass.getDef()->getName();
|
|
|
|
|
std::string dependentDialectRegistrations;
|
|
|
|
|
{
|
|
|
|
|
llvm::raw_string_ostream dialectsOs(dependentDialectRegistrations);
|
2024-01-15 02:11:52 -08:00
|
|
|
llvm::interleave(
|
|
|
|
|
pass.getDependentDialects(), dialectsOs,
|
|
|
|
|
[&](StringRef dependentDialect) {
|
2024-10-02 13:23:44 -07:00
|
|
|
dialectsOs << formatv(dialectRegistrationTemplate, dependentDialect);
|
2024-01-15 02:11:52 -08:00
|
|
|
},
|
|
|
|
|
"\n ");
|
2022-08-31 23:38:31 +02:00
|
|
|
}
|
2024-10-02 13:23:44 -07:00
|
|
|
os << formatv(oldPassDeclBegin, defName, pass.getBaseClass(),
|
2025-10-13 05:55:32 +02:00
|
|
|
pass.getArgument(), pass.getSummary().trim(),
|
2024-10-02 13:23:44 -07:00
|
|
|
dependentDialectRegistrations);
|
2022-08-31 23:38:31 +02:00
|
|
|
emitPassOptionDecls(pass, os);
|
|
|
|
|
emitPassStatisticDecls(pass, os);
|
|
|
|
|
os << "};\n";
|
|
|
|
|
}
|
|
|
|
|
|
2024-10-03 06:30:31 -07:00
|
|
|
static void emitPasses(const RecordKeeper &records, raw_ostream &os) {
|
|
|
|
|
std::vector<Pass> passes = getPasses(records);
|
2022-08-30 09:48:11 +02:00
|
|
|
os << "/* Autogenerated by mlir-tblgen; don't manually edit */\n";
|
|
|
|
|
|
2022-09-27 17:23:59 -04:00
|
|
|
os << "\n";
|
|
|
|
|
os << "#ifdef GEN_PASS_DECL\n";
|
|
|
|
|
os << "// Generate declarations for all passes.\n";
|
|
|
|
|
for (const Pass &pass : passes)
|
|
|
|
|
os << "#define " << getPassDeclVarName(pass) << "\n";
|
|
|
|
|
os << "#undef GEN_PASS_DECL\n";
|
|
|
|
|
os << "#endif // GEN_PASS_DECL\n";
|
|
|
|
|
|
2022-08-30 09:48:11 +02:00
|
|
|
for (const Pass &pass : passes)
|
|
|
|
|
emitPass(pass, os);
|
|
|
|
|
|
|
|
|
|
emitRegistrations(passes, os);
|
2022-08-31 23:38:31 +02:00
|
|
|
|
|
|
|
|
// TODO: Drop old pass declarations.
|
|
|
|
|
// Emit the old code until all the passes have switched to the new design.
|
|
|
|
|
os << "// Deprecated. Please use the new per-pass macros.\n";
|
|
|
|
|
os << "#ifdef GEN_PASS_CLASSES\n";
|
|
|
|
|
for (const Pass &pass : passes)
|
|
|
|
|
emitOldPassDecl(pass, os);
|
|
|
|
|
os << "#undef GEN_PASS_CLASSES\n";
|
|
|
|
|
os << "#endif // GEN_PASS_CLASSES\n";
|
2022-08-30 09:48:11 +02:00
|
|
|
}
|
|
|
|
|
|
2020-04-01 01:48:34 -07:00
|
|
|
static mlir::GenRegistration
|
2022-08-24 09:59:50 +02:00
|
|
|
genPassDecls("gen-pass-decls", "Generate pass declarations",
|
2024-10-02 13:23:44 -07:00
|
|
|
[](const RecordKeeper &records, raw_ostream &os) {
|
2022-08-30 09:48:11 +02:00
|
|
|
emitPasses(records, os);
|
2022-08-24 09:59:50 +02:00
|
|
|
return false;
|
|
|
|
|
});
|