[Mlir-commits] [mlir] [mlir][python] smaller scope for vector enumgen (PR #66992)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Thu Sep 21 02:23:32 PDT 2023


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-mlir

<details>
<summary>Changes</summary>

Don't generate enums from the main VectorOps.td file as that transitively includes enums from Arith.

---
Full diff: https://github.com/llvm/llvm-project/pull/66992.diff


2 Files Affected:

- (modified) mlir/python/CMakeLists.txt (+2-1) 
- (added) mlir/python/mlir/dialects/VectorAttributes.td (+14) 


``````````diff
diff --git a/mlir/python/CMakeLists.txt b/mlir/python/CMakeLists.txt
index 25be18fced0f7ac..9368cb4c2f1657f 100644
--- a/mlir/python/CMakeLists.txt
+++ b/mlir/python/CMakeLists.txt
@@ -381,7 +381,8 @@ declare_mlir_dialect_python_bindings(
   TD_FILE dialects/VectorOps.td
   SOURCES dialects/vector.py
   DIALECT_NAME vector
-  GEN_ENUM_BINDINGS)
+  GEN_ENUM_BINDINGS_TD_FILE
+    "dialects/VectorAttributes.td")
 
 ################################################################################
 # Python extensions.
diff --git a/mlir/python/mlir/dialects/VectorAttributes.td b/mlir/python/mlir/dialects/VectorAttributes.td
new file mode 100644
index 000000000000000..038e0ba21c3b25e
--- /dev/null
+++ b/mlir/python/mlir/dialects/VectorAttributes.td
@@ -0,0 +1,14 @@
+//===-- VectorAttributes.td - Entry point for bindings -----*- tablegen -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef PYTHON_BINDINGS_VECTOR_ATTRDEFS_TD
+#define PYTHON_BINDINGS_VECTOR_ATTRDEFS_TD
+
+include "mlir/Dialect/Vector/IR/VectorAttributes.td"
+
+#endif // PYTHON_BINDINGS_VECTOR_ATTRDEFS_TD

``````````

</details>


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


More information about the Mlir-commits mailing list