11 #include "llvm/Support/InterleavedRange.h"
21 os <<
"<NULL-PDLValue>";
26 os << cast<Attribute>();
29 os << *cast<Operation *>();
35 os << llvm::interleaved(cast<TypeRange>());
40 case Kind::ValueRange:
41 os << llvm::interleaved(cast<ValueRange>());
63 case Kind::ValueRange:
73 void PDLPatternModule::mergeIn(PDLPatternModule &&other) {
79 for (
auto &it : other.constraintFunctions)
80 registerConstraintFunction(it.first(), std::move(it.second));
81 for (
auto &it : other.rewriteFunctions)
82 registerRewriteFunction(it.first(), std::move(it.second));
83 for (
auto &it : other.configs)
84 configs.emplace_back(std::move(it));
85 for (
auto &it : other.configMap)
90 pdlModule = std::move(other.pdlModule);
95 Block *block = pdlModule->getBody();
97 other.pdlModule->getBody()->getOperations());
100 void PDLPatternModule::attachConfigToPatterns(ModuleOp module,
101 PDLPatternConfigSet &configSet) {
107 if (op->
hasTrait<SymbolOpInterface::Trait>())
108 configMap[op] = &configSet;
116 void PDLPatternModule::registerConstraintFunction(
117 StringRef name, PDLConstraintFunction constraintFn) {
122 constraintFunctions.try_emplace(name, std::move(constraintFn));
125 void PDLPatternModule::registerRewriteFunction(StringRef name,
126 PDLRewriteFunction rewriteFn) {
131 rewriteFunctions.try_emplace(name, std::move(rewriteFn));
union mlir::linalg::@1242::ArityGroupAndKind::Kind kind
static void print(spirv::VerCapExtAttr triple, DialectAsmPrinter &printer)
Block represents an ordered list of Operations.
OpListType & getOperations()
Operation is the basic unit of execution within MLIR.
bool hasTrait()
Returns true if the operation was registered with a particular trait, e.g.
Kind
An enumeration of the kinds of predicates.
Include the generated interface declarations.