13 #ifndef MLIR_IR_DIALECT_HOOKS_H 14 #define MLIR_IR_DIALECT_HOOKS_H 17 #include "llvm/Support/raw_ostream.h" 55 llvm::errs() <<
"error: cannot register hooks for unknown dialect '" 56 << dialectName <<
"'\n";
61 if (
auto h = hooks.getConstantFoldHook())
63 if (
auto h = hooks.getDecodeHook())
65 if (
auto h = hooks.getExtractElementHook())
Definition: InferTypeOpInterface.cpp:20
Definition: DialectHooks.h:30
void registerDialectHooksSetter(const DialectHooksSetter &function)
Definition: Dialect.cpp:47
std::function< LogicalResult(Operation *, ArrayRef< Attribute >, SmallVectorImpl< Attribute > &)> DialectConstantFoldHook
Definition: Dialect.h:28
std::function< Attribute(const OpaqueElementsAttr, ArrayRef< uint64_t >)> DialectExtractElementHook
Definition: Dialect.h:30
DialectConstantFoldHook constantFoldHook
Definition: Dialect.h:72
Dialect * getRegisteredDialect(StringRef name)
Definition: MLIRContext.cpp:315
std::function< void(MLIRContext *)> DialectHooksSetter
Definition: DialectHooks.h:20
DialectConstantFoldHook getConstantFoldHook()
Definition: DialectHooks.h:33
std::function< bool(const OpaqueElementsAttr, ElementsAttr &)> DialectConstantDecodeHook
Definition: Dialect.h:26
DialectConstantDecodeHook decodeHook
Definition: Dialect.h:81
DialectConstantDecodeHook getDecodeHook()
Definition: DialectHooks.h:35
Definition: DialectHooks.h:50
Definition: MLIRContext.h:34
DialectHooksRegistration(StringRef dialectName)
Definition: DialectHooks.h:51
DialectExtractElementHook extractElementHook
Definition: Dialect.h:88
DialectExtractElementHook getExtractElementHook()
Definition: DialectHooks.h:37