MLIR  20.0.0git
PDLExtensionOps.h
Go to the documentation of this file.
1 //===- PDLExtensionOps.h - PDL extension for Transform dialect --*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef MLIR_DIALECT_TRANSFORM_PDLEXTENSION_PDLEXTENSIONOPS_H
10 #define MLIR_DIALECT_TRANSFORM_PDLEXTENSION_PDLEXTENSIONOPS_H
11 
15 #include "mlir/IR/OpDefinition.h"
17 #include "mlir/IR/SymbolTable.h"
19 
20 #define GET_OP_CLASSES
21 #include "mlir/Dialect/Transform/PDLExtension/PDLExtensionOps.h.inc"
22 
23 namespace mlir {
24 namespace transform {
25 /// PDL constraint callbacks that can be used by the PDL extension of the
26 /// Transform dialect. These are owned by the Transform dialect and can be
27 /// populated by extensions.
28 class PDLMatchHooks : public TransformDialectData<PDLMatchHooks> {
29 public:
31 
32  /// Takes ownership of the named PDL constraint function from the given
33  /// map and makes them available for use by the operations in the dialect.
34  void
35  mergeInPDLMatchHooks(llvm::StringMap<PDLConstraintFunction> &&constraintFns);
36 
37  /// Returns the named PDL constraint functions available in the dialect
38  /// as a map from their name to the function.
39  const llvm::StringMap<::mlir::PDLConstraintFunction> &
40  getPDLConstraintHooks() const;
41 
42 private:
43  /// A container for PDL constraint function that can be used by
44  /// operations in this dialect.
45  PDLPatternModule pdlMatchHooks;
46 };
47 } // namespace transform
48 } // namespace mlir
49 
51 
52 #endif // MLIR_DIALECT_TRANSFORM_PDLEXTENSION_PDLEXTENSIONOPS_H
#define MLIR_DECLARE_EXPLICIT_TYPE_ID(CLASS_NAME)
Definition: TypeID.h:249
MLIRContext is the top-level object for a collection of MLIR operations.
Definition: MLIRContext.h:60
PDL constraint callbacks that can be used by the PDL extension of the Transform dialect.
void mergeInPDLMatchHooks(llvm::StringMap< PDLConstraintFunction > &&constraintFns)
Takes ownership of the named PDL constraint function from the given map and makes them available for ...
const llvm::StringMap<::mlir::PDLConstraintFunction > & getPDLConstraintHooks() const
Returns the named PDL constraint functions available in the dialect as a map from their name to the f...
Base class for additional data owned by the Transform dialect.
Include the generated interface declarations.