23 os <<
"<NULL-PDLValue>";
28 os << cast<Attribute>();
31 os << *cast<Operation *>();
37 llvm::interleaveComma(cast<TypeRange>(), os);
42 case Kind::ValueRange:
43 llvm::interleaveComma(cast<ValueRange>(), os);
65 case Kind::ValueRange:
75 void PDLPatternModule::mergeIn(PDLPatternModule &&other) {
81 for (
auto &it : other.constraintFunctions)
82 registerConstraintFunction(it.first(), std::move(it.second));
83 for (
auto &it : other.rewriteFunctions)
84 registerRewriteFunction(it.first(), std::move(it.second));
85 for (
auto &it : other.configs)
86 configs.emplace_back(std::move(it));
87 for (
auto &it : other.configMap)
92 pdlModule = std::move(other.pdlModule);
97 Block *block = pdlModule->getBody();
99 other.pdlModule->getBody()->getOperations());
102 void PDLPatternModule::attachConfigToPatterns(ModuleOp module,
103 PDLPatternConfigSet &configSet) {
109 if (op->
hasTrait<SymbolOpInterface::Trait>())
110 configMap[op] = &configSet;
117 void PDLPatternModule::registerConstraintFunction(
118 StringRef name, PDLConstraintFunction constraintFn) {
123 constraintFunctions.try_emplace(name, std::move(constraintFn));
126 void PDLPatternModule::registerRewriteFunction(StringRef name,
127 PDLRewriteFunction rewriteFn) {
132 rewriteFunctions.try_emplace(name, std::move(rewriteFn));
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.