14 #include "llvm/Support/InterleavedRange.h"
24 os <<
"<NULL-PDLValue>";
29 os << cast<Attribute>();
32 os << *cast<Operation *>();
38 os << llvm::interleaved(cast<TypeRange>());
43 case Kind::ValueRange:
44 os << llvm::interleaved(cast<ValueRange>());
66 case Kind::ValueRange:
76 void PDLPatternModule::mergeIn(PDLPatternModule &&other) {
82 for (
auto &it : other.constraintFunctions)
83 registerConstraintFunction(it.first(), std::move(it.second));
84 for (
auto &it : other.rewriteFunctions)
85 registerRewriteFunction(it.first(), std::move(it.second));
86 for (
auto &it : other.configs)
87 configs.emplace_back(std::move(it));
88 for (
auto &it : other.configMap)
93 pdlModule = std::move(other.pdlModule);
98 Block *block = pdlModule->getBody();
100 other.pdlModule->getBody()->getOperations());
103 void PDLPatternModule::attachConfigToPatterns(ModuleOp module,
104 PDLPatternConfigSet &configSet) {
110 if (op->
hasTrait<SymbolOpInterface::Trait>())
111 configMap[op] = &configSet;
119 void PDLPatternModule::registerConstraintFunction(
120 StringRef name, PDLConstraintFunction constraintFn) {
125 constraintFunctions.try_emplace(name, std::move(constraintFn));
128 void PDLPatternModule::registerRewriteFunction(StringRef name,
129 PDLRewriteFunction rewriteFn) {
134 rewriteFunctions.try_emplace(name, std::move(rewriteFn));
union mlir::linalg::@1194::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.