2018-10-21 19:49:31 -07:00
|
|
|
//===- Dialect.cpp - Dialect implementation -------------------------------===//
|
|
|
|
//
|
2020-01-26 03:58:30 +00:00
|
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
2019-12-23 09:35:36 -08:00
|
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
2018-10-21 19:49:31 -07:00
|
|
|
//
|
2019-12-23 09:35:36 -08:00
|
|
|
//===----------------------------------------------------------------------===//
|
2018-10-21 19:49:31 -07:00
|
|
|
|
|
|
|
#include "mlir/IR/Dialect.h"
|
2021-06-16 18:53:21 +02:00
|
|
|
#include "mlir/IR/BuiltinDialect.h"
|
2019-05-03 10:01:01 -07:00
|
|
|
#include "mlir/IR/Diagnostics.h"
|
2019-11-01 14:47:42 -07:00
|
|
|
#include "mlir/IR/DialectImplementation.h"
|
2019-08-14 20:48:35 -07:00
|
|
|
#include "mlir/IR/DialectInterface.h"
|
2024-08-05 16:32:36 -07:00
|
|
|
#include "mlir/IR/DialectRegistry.h"
|
2022-09-19 09:47:37 -07:00
|
|
|
#include "mlir/IR/ExtensibleDialect.h"
|
2018-10-21 19:49:31 -07:00
|
|
|
#include "mlir/IR/MLIRContext.h"
|
2019-08-14 20:48:35 -07:00
|
|
|
#include "mlir/IR/Operation.h"
|
2024-08-05 16:32:36 -07:00
|
|
|
#include "mlir/Support/TypeID.h"
|
2020-03-18 19:51:13 -07:00
|
|
|
#include "llvm/ADT/MapVector.h"
|
2024-08-05 16:32:36 -07:00
|
|
|
#include "llvm/ADT/SetOperations.h"
|
|
|
|
#include "llvm/ADT/SmallVector.h"
|
|
|
|
#include "llvm/ADT/SmallVectorExtras.h"
|
2019-02-25 13:16:24 -08:00
|
|
|
#include "llvm/ADT/Twine.h"
|
2021-02-15 10:39:13 +01:00
|
|
|
#include "llvm/Support/Debug.h"
|
2018-10-21 19:49:31 -07:00
|
|
|
#include "llvm/Support/ManagedStatic.h"
|
2019-02-26 16:43:12 -08:00
|
|
|
#include "llvm/Support/Regex.h"
|
2024-08-05 16:32:36 -07:00
|
|
|
#include <memory>
|
2019-08-14 20:48:35 -07:00
|
|
|
|
2021-02-15 10:39:13 +01:00
|
|
|
#define DEBUG_TYPE "dialect"
|
|
|
|
|
2018-10-21 19:49:31 -07:00
|
|
|
using namespace mlir;
|
2019-08-14 20:48:35 -07:00
|
|
|
using namespace detail;
|
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Dialect
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2020-08-07 02:41:44 +00:00
|
|
|
Dialect::Dialect(StringRef name, MLIRContext *context, TypeID id)
|
|
|
|
: name(name), dialectID(id), context(context) {
|
2019-03-29 22:30:54 -07:00
|
|
|
assert(isValidNamespace(name) && "invalid dialect namespace");
|
2018-10-21 19:49:31 -07:00
|
|
|
}
|
2018-11-09 14:04:03 -08:00
|
|
|
|
2021-12-22 00:19:53 +00:00
|
|
|
Dialect::~Dialect() = default;
|
2019-02-25 13:16:24 -08:00
|
|
|
|
2019-07-01 10:29:09 -07:00
|
|
|
/// Verify an attribute from this dialect on the argument at 'argIndex' for
|
2019-07-11 15:05:19 -07:00
|
|
|
/// the region at 'regionIndex' on the given operation. Returns failure if
|
|
|
|
/// the verification failed, success otherwise. This hook may optionally be
|
|
|
|
/// invoked from any operation containing a region.
|
|
|
|
LogicalResult Dialect::verifyRegionArgAttribute(Operation *, unsigned, unsigned,
|
|
|
|
NamedAttribute) {
|
2019-07-01 10:29:09 -07:00
|
|
|
return success();
|
|
|
|
}
|
|
|
|
|
2019-10-18 16:02:56 -07:00
|
|
|
/// Verify an attribute from this dialect on the result at 'resultIndex' for
|
|
|
|
/// the region at 'regionIndex' on the given operation. Returns failure if
|
|
|
|
/// the verification failed, success otherwise. This hook may optionally be
|
|
|
|
/// invoked from any operation containing a region.
|
|
|
|
LogicalResult Dialect::verifyRegionResultAttribute(Operation *, unsigned,
|
|
|
|
unsigned, NamedAttribute) {
|
|
|
|
return success();
|
|
|
|
}
|
|
|
|
|
2019-05-15 09:10:52 -07:00
|
|
|
/// Parse an attribute registered to this dialect.
|
2019-11-01 15:39:30 -07:00
|
|
|
Attribute Dialect::parseAttribute(DialectAsmParser &parser, Type type) const {
|
|
|
|
parser.emitError(parser.getNameLoc())
|
|
|
|
<< "dialect '" << getNamespace()
|
|
|
|
<< "' provides no attribute parsing hook";
|
2019-05-15 09:10:52 -07:00
|
|
|
return Attribute();
|
|
|
|
}
|
|
|
|
|
2019-02-25 13:16:24 -08:00
|
|
|
/// Parse a type registered to this dialect.
|
2019-11-01 15:39:30 -07:00
|
|
|
Type Dialect::parseType(DialectAsmParser &parser) const {
|
2019-08-07 11:49:56 -07:00
|
|
|
// If this dialect allows unknown types, then represent this with OpaqueType.
|
|
|
|
if (allowsUnknownTypes()) {
|
2021-11-16 17:21:15 +00:00
|
|
|
StringAttr ns = StringAttr::get(getContext(), getNamespace());
|
2021-02-26 17:57:03 -08:00
|
|
|
return OpaqueType::get(ns, parser.getFullSymbolSpec());
|
2019-08-07 11:49:56 -07:00
|
|
|
}
|
|
|
|
|
2019-11-01 15:39:30 -07:00
|
|
|
parser.emitError(parser.getNameLoc())
|
|
|
|
<< "dialect '" << getNamespace() << "' provides no type parsing hook";
|
2019-02-25 13:16:24 -08:00
|
|
|
return Type();
|
|
|
|
}
|
2019-02-26 16:43:12 -08:00
|
|
|
|
2022-12-14 11:39:19 +01:00
|
|
|
std::optional<Dialect::ParseOpHook>
|
2021-03-23 00:33:03 +00:00
|
|
|
Dialect::getParseOperationHook(StringRef opName) const {
|
2022-12-03 18:50:27 -08:00
|
|
|
return std::nullopt;
|
2021-03-23 00:33:03 +00:00
|
|
|
}
|
|
|
|
|
2021-08-28 03:02:55 +00:00
|
|
|
llvm::unique_function<void(Operation *, OpAsmPrinter &printer)>
|
|
|
|
Dialect::getOperationPrinter(Operation *op) const {
|
2021-03-23 00:33:03 +00:00
|
|
|
assert(op->getDialect() == this &&
|
|
|
|
"Dialect hook invoked on non-dialect owned operation");
|
2021-08-28 03:02:55 +00:00
|
|
|
return nullptr;
|
2021-03-23 00:33:03 +00:00
|
|
|
}
|
|
|
|
|
2019-02-26 16:43:12 -08:00
|
|
|
/// Utility function that returns if the given string is a valid dialect
|
2021-12-07 18:27:58 +00:00
|
|
|
/// namespace
|
2019-02-26 16:43:12 -08:00
|
|
|
bool Dialect::isValidNamespace(StringRef str) {
|
|
|
|
llvm::Regex dialectNameRegex("^[a-zA-Z_][a-zA-Z_0-9\\$]*$");
|
|
|
|
return dialectNameRegex.match(str);
|
|
|
|
}
|
2019-08-14 20:48:35 -07:00
|
|
|
|
|
|
|
/// Register a set of dialect interfaces with this dialect instance.
|
|
|
|
void Dialect::addInterface(std::unique_ptr<DialectInterface> interface) {
|
2022-02-22 14:51:37 -08:00
|
|
|
// Handle the case where the models resolve a promised interface.
|
2023-09-05 09:17:54 -04:00
|
|
|
handleAdditionOfUndefinedPromisedInterface(getTypeID(), interface->getID());
|
2022-02-22 14:51:37 -08:00
|
|
|
|
2019-08-14 20:48:35 -07:00
|
|
|
auto it = registeredInterfaces.try_emplace(interface->getID(),
|
|
|
|
std::move(interface));
|
|
|
|
(void)it;
|
2022-02-22 14:49:12 -08:00
|
|
|
LLVM_DEBUG({
|
|
|
|
if (!it.second) {
|
|
|
|
llvm::dbgs() << "[" DEBUG_TYPE
|
|
|
|
"] repeated interface registration for dialect "
|
|
|
|
<< getNamespace();
|
|
|
|
}
|
|
|
|
});
|
2019-08-14 20:48:35 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Dialect Interface
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2021-12-22 00:19:53 +00:00
|
|
|
DialectInterface::~DialectInterface() = default;
|
2019-08-14 20:48:35 -07:00
|
|
|
|
2022-08-23 12:56:02 -07:00
|
|
|
MLIRContext *DialectInterface::getContext() const {
|
|
|
|
return dialect->getContext();
|
|
|
|
}
|
|
|
|
|
2019-08-14 20:48:35 -07:00
|
|
|
DialectInterfaceCollectionBase::DialectInterfaceCollectionBase(
|
2023-06-24 03:15:47 +02:00
|
|
|
MLIRContext *ctx, TypeID interfaceKind, StringRef interfaceName) {
|
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
|
|
|
for (auto *dialect : ctx->getLoadedDialects()) {
|
2023-06-24 03:15:47 +02:00
|
|
|
#ifndef NDEBUG
|
2023-09-05 09:17:54 -04:00
|
|
|
dialect->handleUseOfUndefinedPromisedInterface(
|
|
|
|
dialect->getTypeID(), interfaceKind, interfaceName);
|
2023-06-24 03:15:47 +02:00
|
|
|
#endif
|
2019-08-21 09:41:37 -07:00
|
|
|
if (auto *interface = dialect->getRegisteredInterface(interfaceKind)) {
|
2019-08-20 18:49:08 -07:00
|
|
|
interfaces.insert(interface);
|
2019-08-21 09:41:37 -07:00
|
|
|
orderedInterfaces.push_back(interface);
|
|
|
|
}
|
|
|
|
}
|
2019-08-14 20:48:35 -07:00
|
|
|
}
|
|
|
|
|
2021-12-22 00:19:53 +00:00
|
|
|
DialectInterfaceCollectionBase::~DialectInterfaceCollectionBase() = default;
|
2019-08-14 20:48:35 -07:00
|
|
|
|
|
|
|
/// Get the interface for the dialect of given operation, or null if one
|
|
|
|
/// is not registered.
|
|
|
|
const DialectInterface *
|
|
|
|
DialectInterfaceCollectionBase::getInterfaceFor(Operation *op) const {
|
2019-08-20 18:49:08 -07:00
|
|
|
return getInterfaceFor(op->getDialect());
|
2019-08-14 20:48:35 -07:00
|
|
|
}
|
2022-02-22 14:49:12 -08:00
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// DialectExtension
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
DialectExtensionBase::~DialectExtensionBase() = default;
|
|
|
|
|
2022-02-22 14:51:37 -08:00
|
|
|
void dialect_extension_detail::handleUseOfUndefinedPromisedInterface(
|
2023-09-05 09:17:54 -04:00
|
|
|
Dialect &dialect, TypeID interfaceRequestorID, TypeID interfaceID,
|
|
|
|
StringRef interfaceName) {
|
|
|
|
dialect.handleUseOfUndefinedPromisedInterface(interfaceRequestorID,
|
|
|
|
interfaceID, interfaceName);
|
2022-02-22 14:51:37 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
void dialect_extension_detail::handleAdditionOfUndefinedPromisedInterface(
|
2023-09-05 09:17:54 -04:00
|
|
|
Dialect &dialect, TypeID interfaceRequestorID, TypeID interfaceID) {
|
|
|
|
dialect.handleAdditionOfUndefinedPromisedInterface(interfaceRequestorID,
|
|
|
|
interfaceID);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool dialect_extension_detail::hasPromisedInterface(Dialect &dialect,
|
|
|
|
TypeID interfaceRequestorID,
|
|
|
|
TypeID interfaceID) {
|
|
|
|
return dialect.hasPromisedInterface(interfaceRequestorID, interfaceID);
|
2022-02-22 14:51:37 -08:00
|
|
|
}
|
|
|
|
|
2022-02-22 14:49:12 -08:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// DialectRegistry
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2024-08-05 16:32:36 -07:00
|
|
|
namespace {
|
|
|
|
template <typename Fn>
|
|
|
|
void applyExtensionsFn(
|
|
|
|
Fn &&applyExtension,
|
|
|
|
const llvm::MapVector<TypeID, std::unique_ptr<DialectExtensionBase>>
|
|
|
|
&extensions) {
|
|
|
|
// Note: Additional extensions may be added while applying an extension.
|
|
|
|
// The iterators will be invalidated if extensions are added so we'll keep
|
|
|
|
// a copy of the extensions for ourselves.
|
|
|
|
|
|
|
|
const auto extractExtension =
|
|
|
|
[](const auto &entry) -> DialectExtensionBase * {
|
|
|
|
return entry.second.get();
|
|
|
|
};
|
|
|
|
|
|
|
|
auto startIt = extensions.begin(), endIt = extensions.end();
|
|
|
|
size_t count = 0;
|
|
|
|
while (startIt != endIt) {
|
|
|
|
count += endIt - startIt;
|
|
|
|
|
|
|
|
// Grab the subset of extensions we'll apply in this iteration.
|
|
|
|
const auto subset =
|
|
|
|
llvm::map_to_vector(llvm::make_range(startIt, endIt), extractExtension);
|
|
|
|
|
|
|
|
for (const auto *ext : subset)
|
|
|
|
applyExtension(*ext);
|
|
|
|
|
|
|
|
// Book-keep for the next iteration.
|
|
|
|
startIt = extensions.begin() + count;
|
|
|
|
endIt = extensions.end();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} // namespace
|
|
|
|
|
2022-02-22 14:49:12 -08:00
|
|
|
DialectRegistry::DialectRegistry() { insert<BuiltinDialect>(); }
|
|
|
|
|
|
|
|
DialectAllocatorFunctionRef
|
|
|
|
DialectRegistry::getDialectAllocator(StringRef name) const {
|
2024-11-08 07:33:59 -08:00
|
|
|
auto it = registry.find(name);
|
2022-02-22 14:49:12 -08:00
|
|
|
if (it == registry.end())
|
|
|
|
return nullptr;
|
|
|
|
return it->second.second;
|
|
|
|
}
|
|
|
|
|
|
|
|
void DialectRegistry::insert(TypeID typeID, StringRef name,
|
|
|
|
const DialectAllocatorFunction &ctor) {
|
|
|
|
auto inserted = registry.insert(
|
|
|
|
std::make_pair(std::string(name), std::make_pair(typeID, ctor)));
|
|
|
|
if (!inserted.second && inserted.first->second.first != typeID) {
|
|
|
|
llvm::report_fatal_error(
|
|
|
|
"Trying to register different dialects for the same namespace: " +
|
|
|
|
name);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-09-19 09:47:37 -07:00
|
|
|
void DialectRegistry::insertDynamic(
|
|
|
|
StringRef name, const DynamicDialectPopulationFunction &ctor) {
|
|
|
|
// This TypeID marks dynamic dialects. We cannot give a TypeID for the
|
|
|
|
// dialect yet, since the TypeID of a dynamic dialect is defined at its
|
|
|
|
// construction.
|
|
|
|
TypeID typeID = TypeID::get<void>();
|
|
|
|
|
|
|
|
// Create the dialect, and then call ctor, which allocates its components.
|
|
|
|
auto constructor = [nameStr = name.str(), ctor](MLIRContext *ctx) {
|
|
|
|
auto *dynDialect = ctx->getOrLoadDynamicDialect(
|
|
|
|
nameStr, [ctx, ctor](DynamicDialect *dialect) { ctor(ctx, dialect); });
|
|
|
|
assert(dynDialect && "Dynamic dialect creation unexpectedly failed");
|
|
|
|
return dynDialect;
|
|
|
|
};
|
|
|
|
|
|
|
|
insert(typeID, name, constructor);
|
|
|
|
}
|
|
|
|
|
2022-02-22 14:49:12 -08:00
|
|
|
void DialectRegistry::applyExtensions(Dialect *dialect) const {
|
|
|
|
MLIRContext *ctx = dialect->getContext();
|
|
|
|
StringRef dialectName = dialect->getNamespace();
|
|
|
|
|
|
|
|
// Functor used to try to apply the given extension.
|
|
|
|
auto applyExtension = [&](const DialectExtensionBase &extension) {
|
|
|
|
ArrayRef<StringRef> dialectNames = extension.getRequiredDialects();
|
2023-08-05 00:44:48 -07:00
|
|
|
// An empty set is equivalent to always invoke.
|
|
|
|
if (dialectNames.empty()) {
|
|
|
|
extension.apply(ctx, dialect);
|
|
|
|
return;
|
|
|
|
}
|
2022-02-22 14:49:12 -08:00
|
|
|
|
|
|
|
// Handle the simple case of a single dialect name. In this case, the
|
|
|
|
// required dialect should be the current dialect.
|
|
|
|
if (dialectNames.size() == 1) {
|
|
|
|
if (dialectNames.front() == dialectName)
|
|
|
|
extension.apply(ctx, dialect);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Otherwise, check to see if this extension requires this dialect.
|
|
|
|
const StringRef *nameIt = llvm::find(dialectNames, dialectName);
|
|
|
|
if (nameIt == dialectNames.end())
|
|
|
|
return;
|
|
|
|
|
|
|
|
// If it does, ensure that all of the other required dialects have been
|
|
|
|
// loaded.
|
|
|
|
SmallVector<Dialect *> requiredDialects;
|
|
|
|
requiredDialects.reserve(dialectNames.size());
|
|
|
|
for (auto it = dialectNames.begin(), e = dialectNames.end(); it != e;
|
|
|
|
++it) {
|
|
|
|
// The current dialect is known to be loaded.
|
|
|
|
if (it == nameIt) {
|
|
|
|
requiredDialects.push_back(dialect);
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
// Otherwise, check if it is loaded.
|
|
|
|
Dialect *loadedDialect = ctx->getLoadedDialect(*it);
|
|
|
|
if (!loadedDialect)
|
|
|
|
return;
|
|
|
|
requiredDialects.push_back(loadedDialect);
|
|
|
|
}
|
|
|
|
extension.apply(ctx, requiredDialects);
|
|
|
|
};
|
|
|
|
|
2024-08-05 16:32:36 -07:00
|
|
|
applyExtensionsFn(applyExtension, extensions);
|
2022-02-22 14:49:12 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
void DialectRegistry::applyExtensions(MLIRContext *ctx) const {
|
|
|
|
// Functor used to try to apply the given extension.
|
|
|
|
auto applyExtension = [&](const DialectExtensionBase &extension) {
|
|
|
|
ArrayRef<StringRef> dialectNames = extension.getRequiredDialects();
|
2023-08-05 00:44:48 -07:00
|
|
|
if (dialectNames.empty()) {
|
|
|
|
auto loadedDialects = ctx->getLoadedDialects();
|
|
|
|
extension.apply(ctx, loadedDialects);
|
|
|
|
return;
|
|
|
|
}
|
2022-02-22 14:49:12 -08:00
|
|
|
|
|
|
|
// Check to see if all of the dialects for this extension are loaded.
|
|
|
|
SmallVector<Dialect *> requiredDialects;
|
|
|
|
requiredDialects.reserve(dialectNames.size());
|
|
|
|
for (StringRef dialectName : dialectNames) {
|
|
|
|
Dialect *loadedDialect = ctx->getLoadedDialect(dialectName);
|
|
|
|
if (!loadedDialect)
|
|
|
|
return;
|
|
|
|
requiredDialects.push_back(loadedDialect);
|
|
|
|
}
|
|
|
|
extension.apply(ctx, requiredDialects);
|
|
|
|
};
|
|
|
|
|
2024-08-05 16:32:36 -07:00
|
|
|
applyExtensionsFn(applyExtension, extensions);
|
2022-02-22 14:49:12 -08:00
|
|
|
}
|
2022-01-18 16:16:54 -08:00
|
|
|
|
|
|
|
bool DialectRegistry::isSubsetOf(const DialectRegistry &rhs) const {
|
2024-08-05 16:32:36 -07:00
|
|
|
// Check that all extension keys are present in 'rhs'.
|
|
|
|
const auto hasExtension = [&](const auto &key) {
|
|
|
|
return rhs.extensions.contains(key);
|
|
|
|
};
|
|
|
|
if (!llvm::all_of(make_first_range(extensions), hasExtension))
|
2022-01-18 16:16:54 -08:00
|
|
|
return false;
|
2024-08-05 16:32:36 -07:00
|
|
|
|
2022-01-18 16:16:54 -08:00
|
|
|
// Check that the current dialects fully overlap with the dialects in 'rhs'.
|
|
|
|
return llvm::all_of(
|
|
|
|
registry, [&](const auto &it) { return rhs.registry.count(it.first); });
|
|
|
|
}
|