[Mlir-commits] [mlir] Add a polynomial dialect shell, attributes, and types (PR #72081)

Jeremy Kun llvmlistbot at llvm.org
Sun Apr 14 15:05:25 PDT 2024


================
@@ -0,0 +1,26 @@
+set(LLVM_TARGET_DEFINITIONS PolynomialDialect.td)
+mlir_tablegen(PolynomialDialect.cpp.inc -gen-dialect-defs -dialect=polynomial)
+mlir_tablegen(PolynomialDialect.h.inc -gen-dialect-decls -dialect=polynomial)
+add_public_tablegen_target(MLIRPolynomialDialectIncGen)
+add_dependencies(mlir-headers MLIRPolynomialDialectIncGen)
+
+set(LLVM_TARGET_DEFINITIONS PolynomialAttributes.td)
+mlir_tablegen(PolynomialAttributes.cpp.inc -gen-attrdef-defs -attrdefs-dialect=polynomial)
+mlir_tablegen(PolynomialAttributes.h.inc -gen-attrdef-decls -attrdefs-dialect=polynomial)
+add_public_tablegen_target(MLIRPolynomialAttributesIncGen)
+add_dependencies(mlir-headers MLIRPolynomialAttributesIncGen)
+add_mlir_doc(PolynomialAttributes PolynomialAttributes Dialects/ -gen-attrdef-doc)
+
+set(LLVM_TARGET_DEFINITIONS PolynomialOps.td)
+mlir_tablegen(PolynomialOps.cpp.inc -gen-op-defs)
+mlir_tablegen(PolynomialOps.h.inc -gen-op-decls)
+add_public_tablegen_target(MLIRPolynomialOpsIncGen)
+add_dependencies(mlir-headers MLIRPolynomialOpsIncGen)
+add_mlir_doc(PolynoialOps PolynoialOps Dialects/ -gen-dialect-doc -dialect polynomial)
+
+set(LLVM_TARGET_DEFINITIONS PolynomialTypes.td)
+mlir_tablegen(PolynomialTypes.cpp.inc -gen-typedef-defs -typedefs-dialect=polynomial)
+mlir_tablegen(PolynomialTypes.h.inc -gen-typedef-decls -typedefs-dialect=polynomial)
+add_public_tablegen_target(MLIRPolynomialTypesIncGen)
+add_dependencies(mlir-headers MLIRPolynomialTypesIncGen)
+add_mlir_doc(PolynomialTypes PolynomialTypes Dialects/ -gen-typedef-doc)
----------------
j2kun wrote:

The macro assumes specific organization that I didn't use here (i.e., all tablegen in a single `Polynomial.td` file), and since I have to add calls to the underlying `mlir_tablegen` for attrdefs anyway, I felt it was simpler to keep things uniform. I also plan to upstream canonicalization patterns defined in tablegen. If you feel strongly, I could migrate this to be compatible with that macro.

https://github.com/llvm/llvm-project/pull/72081


More information about the Mlir-commits mailing list