[Mlir-commits] [mlir] 9f3f6d7 - Move MLIR python sources to mlir/python.

Stella Laurenzo llvmlistbot at llvm.org
Mon May 3 11:37:13 PDT 2021


Author: Stella Laurenzo
Date: 2021-05-03T18:36:48Z
New Revision: 9f3f6d7bd81ea26af9bcc2a2ac71a08affa341d4

URL: https://github.com/llvm/llvm-project/commit/9f3f6d7bd81ea26af9bcc2a2ac71a08affa341d4
DIFF: https://github.com/llvm/llvm-project/commit/9f3f6d7bd81ea26af9bcc2a2ac71a08affa341d4.diff

LOG: Move MLIR python sources to mlir/python.

* NFC but has some fixes for CMake glitches discovered along the way (things not cleaning properly, co-mingled depends).
* Includes previously unsubmitted fix in D98681 and a TODO to fix it more appropriately in a smaller followup.

Differential Revision: https://reviews.llvm.org/D101493

Added: 
    mlir/cmake/modules/AddMLIRPython.cmake
    mlir/python/.style.yapf
    mlir/python/CMakeLists.txt
    mlir/python/mlir/_cext_loader.py
    mlir/python/mlir/_dlloader.py
    mlir/python/mlir/conversions/__init__.py
    mlir/python/mlir/dialects/AsyncOps.td
    mlir/python/mlir/dialects/BuiltinOps.td
    mlir/python/mlir/dialects/CMakeLists.txt
    mlir/python/mlir/dialects/GPUOps.td
    mlir/python/mlir/dialects/LinalgOps.td
    mlir/python/mlir/dialects/MemRefOps.td
    mlir/python/mlir/dialects/ShapeOps.td
    mlir/python/mlir/dialects/StandardOps.td
    mlir/python/mlir/dialects/TensorOps.td
    mlir/python/mlir/dialects/_builtin_ops_ext.py
    mlir/python/mlir/dialects/_linalg_ops_ext.py
    mlir/python/mlir/dialects/_ods_common.py
    mlir/python/mlir/dialects/async_dialect/__init__.py
    mlir/python/mlir/dialects/async_dialect/passes/__init__.py
    mlir/python/mlir/dialects/builtin.py
    mlir/python/mlir/dialects/gpu/__init__.py
    mlir/python/mlir/dialects/gpu/passes/__init__.py
    mlir/python/mlir/dialects/linalg/__init__.py
    mlir/python/mlir/dialects/linalg/opdsl/__init__.py
    mlir/python/mlir/dialects/linalg/opdsl/dump_oplib.py
    mlir/python/mlir/dialects/linalg/opdsl/lang/__init__.py
    mlir/python/mlir/dialects/linalg/opdsl/lang/affine.py
    mlir/python/mlir/dialects/linalg/opdsl/lang/comprehension.py
    mlir/python/mlir/dialects/linalg/opdsl/lang/config.py
    mlir/python/mlir/dialects/linalg/opdsl/lang/dsl.py
    mlir/python/mlir/dialects/linalg/opdsl/lang/emitter.py
    mlir/python/mlir/dialects/linalg/opdsl/lang/scalar_expr.py
    mlir/python/mlir/dialects/linalg/opdsl/lang/types.py
    mlir/python/mlir/dialects/linalg/opdsl/lang/yaml_helper.py
    mlir/python/mlir/dialects/linalg/opdsl/ops/__init__.py
    mlir/python/mlir/dialects/linalg/opdsl/ops/core_named_ops.py
    mlir/python/mlir/dialects/linalg/passes/__init__.py
    mlir/python/mlir/dialects/memref.py
    mlir/python/mlir/dialects/python_test.py
    mlir/python/mlir/dialects/shape.py
    mlir/python/mlir/dialects/std.py
    mlir/python/mlir/dialects/tensor.py
    mlir/python/mlir/execution_engine.py
    mlir/python/mlir/ir.py
    mlir/python/mlir/passmanager.py
    mlir/python/mlir/runtime/__init__.py
    mlir/python/mlir/runtime/np_to_memref.py
    mlir/python/mlir/transforms/__init__.py
    mlir/python/requirements.txt
    mlir/test/python/CMakeLists.txt
    mlir/test/python/dialects/async_dialect.py
    mlir/test/python/dialects/builtin.py
    mlir/test/python/dialects/gpu.py
    mlir/test/python/dialects/linalg/opdsl/assignments.py
    mlir/test/python/dialects/linalg/opdsl/doctests.py
    mlir/test/python/dialects/linalg/opdsl/emit_structured_generic.py
    mlir/test/python/dialects/linalg/opdsl/interfaces.py
    mlir/test/python/dialects/linalg/opdsl/lit.local.cfg
    mlir/test/python/dialects/linalg/opdsl/shape_maps_iteration.py
    mlir/test/python/dialects/linalg/opdsl/test_core_named_ops.py
    mlir/test/python/dialects/linalg/ops.py
    mlir/test/python/dialects/linalg/opsrun.py
    mlir/test/python/dialects/memref.py
    mlir/test/python/dialects/ods_helpers.py
    mlir/test/python/dialects/python_test.py
    mlir/test/python/execution_engine.py
    mlir/test/python/ir/affine_expr.py
    mlir/test/python/ir/affine_map.py
    mlir/test/python/ir/array_attributes.py
    mlir/test/python/ir/attributes.py
    mlir/test/python/ir/builtin_types.py
    mlir/test/python/ir/context_lifecycle.py
    mlir/test/python/ir/context_managers.py
    mlir/test/python/ir/debug.py
    mlir/test/python/ir/dialects.py
    mlir/test/python/ir/insertion_point.py
    mlir/test/python/ir/integer_set.py
    mlir/test/python/ir/location.py
    mlir/test/python/ir/module.py
    mlir/test/python/ir/operation.py
    mlir/test/python/ir/value.py
    mlir/test/python/lit.local.cfg
    mlir/test/python/pass_manager.py
    mlir/test/python/python_test_ops.td

Modified: 
    mlir/CMakeLists.txt
    mlir/cmake/modules/CMakeLists.txt
    mlir/docs/Bindings/Python.md
    mlir/lib/Bindings/Python/CMakeLists.txt
    mlir/test/CMakeLists.txt

Removed: 
    mlir/cmake/modules/AddMLIRPythonExtension.cmake
    mlir/lib/Bindings/Python/.style.yapf
    mlir/lib/Bindings/Python/AsyncOps.td
    mlir/lib/Bindings/Python/BuiltinOps.td
    mlir/lib/Bindings/Python/GPUOps.td
    mlir/lib/Bindings/Python/LinalgOps.td
    mlir/lib/Bindings/Python/MemRefOps.td
    mlir/lib/Bindings/Python/ShapeOps.td
    mlir/lib/Bindings/Python/StandardOps.td
    mlir/lib/Bindings/Python/TensorOps.td
    mlir/lib/Bindings/Python/mlir/_cext_loader.py
    mlir/lib/Bindings/Python/mlir/_dlloader.py
    mlir/lib/Bindings/Python/mlir/conversions/__init__.py
    mlir/lib/Bindings/Python/mlir/dialects/_builtin_ops_ext.py
    mlir/lib/Bindings/Python/mlir/dialects/_linalg_ops_ext.py
    mlir/lib/Bindings/Python/mlir/dialects/_ods_common.py
    mlir/lib/Bindings/Python/mlir/dialects/async_dialect/__init__.py
    mlir/lib/Bindings/Python/mlir/dialects/async_dialect/passes/__init__.py
    mlir/lib/Bindings/Python/mlir/dialects/builtin.py
    mlir/lib/Bindings/Python/mlir/dialects/gpu/__init__.py
    mlir/lib/Bindings/Python/mlir/dialects/gpu/passes/__init__.py
    mlir/lib/Bindings/Python/mlir/dialects/linalg/__init__.py
    mlir/lib/Bindings/Python/mlir/dialects/linalg/opdsl/__init__.py
    mlir/lib/Bindings/Python/mlir/dialects/linalg/opdsl/dump_oplib.py
    mlir/lib/Bindings/Python/mlir/dialects/linalg/opdsl/lang/__init__.py
    mlir/lib/Bindings/Python/mlir/dialects/linalg/opdsl/lang/affine.py
    mlir/lib/Bindings/Python/mlir/dialects/linalg/opdsl/lang/comprehension.py
    mlir/lib/Bindings/Python/mlir/dialects/linalg/opdsl/lang/config.py
    mlir/lib/Bindings/Python/mlir/dialects/linalg/opdsl/lang/dsl.py
    mlir/lib/Bindings/Python/mlir/dialects/linalg/opdsl/lang/emitter.py
    mlir/lib/Bindings/Python/mlir/dialects/linalg/opdsl/lang/scalar_expr.py
    mlir/lib/Bindings/Python/mlir/dialects/linalg/opdsl/lang/types.py
    mlir/lib/Bindings/Python/mlir/dialects/linalg/opdsl/lang/yaml_helper.py
    mlir/lib/Bindings/Python/mlir/dialects/linalg/opdsl/ops/__init__.py
    mlir/lib/Bindings/Python/mlir/dialects/linalg/opdsl/ops/core_named_ops.py
    mlir/lib/Bindings/Python/mlir/dialects/linalg/passes/__init__.py
    mlir/lib/Bindings/Python/mlir/dialects/memref.py
    mlir/lib/Bindings/Python/mlir/dialects/python_test.py
    mlir/lib/Bindings/Python/mlir/dialects/shape.py
    mlir/lib/Bindings/Python/mlir/dialects/std.py
    mlir/lib/Bindings/Python/mlir/dialects/tensor.py
    mlir/lib/Bindings/Python/mlir/execution_engine.py
    mlir/lib/Bindings/Python/mlir/ir.py
    mlir/lib/Bindings/Python/mlir/passmanager.py
    mlir/lib/Bindings/Python/mlir/runtime/__init__.py
    mlir/lib/Bindings/Python/mlir/runtime/np_to_memref.py
    mlir/lib/Bindings/Python/mlir/transforms/__init__.py
    mlir/lib/Bindings/Python/requirements.txt
    mlir/test/Bindings/CMakeLists.txt
    mlir/test/Bindings/Python/.style.yapf
    mlir/test/Bindings/Python/CMakeLists.txt
    mlir/test/Bindings/Python/context_lifecycle.py
    mlir/test/Bindings/Python/context_managers.py
    mlir/test/Bindings/Python/debug.py
    mlir/test/Bindings/Python/dialects.py
    mlir/test/Bindings/Python/dialects/async_dialect.py
    mlir/test/Bindings/Python/dialects/builtin.py
    mlir/test/Bindings/Python/dialects/gpu.py
    mlir/test/Bindings/Python/dialects/linalg/opdsl/assignments.py
    mlir/test/Bindings/Python/dialects/linalg/opdsl/doctests.py
    mlir/test/Bindings/Python/dialects/linalg/opdsl/emit_structured_generic.py
    mlir/test/Bindings/Python/dialects/linalg/opdsl/interfaces.py
    mlir/test/Bindings/Python/dialects/linalg/opdsl/lit.local.cfg
    mlir/test/Bindings/Python/dialects/linalg/opdsl/shape_maps_iteration.py
    mlir/test/Bindings/Python/dialects/linalg/opdsl/test_core_named_ops.py
    mlir/test/Bindings/Python/dialects/linalg/ops.py
    mlir/test/Bindings/Python/dialects/linalg/opsrun.py
    mlir/test/Bindings/Python/dialects/memref.py
    mlir/test/Bindings/Python/dialects/python_test.py
    mlir/test/Bindings/Python/execution_engine.py
    mlir/test/Bindings/Python/insertion_point.py
    mlir/test/Bindings/Python/ir_affine_expr.py
    mlir/test/Bindings/Python/ir_affine_map.py
    mlir/test/Bindings/Python/ir_array_attributes.py
    mlir/test/Bindings/Python/ir_attributes.py
    mlir/test/Bindings/Python/ir_integer_set.py
    mlir/test/Bindings/Python/ir_location.py
    mlir/test/Bindings/Python/ir_module.py
    mlir/test/Bindings/Python/ir_operation.py
    mlir/test/Bindings/Python/ir_types.py
    mlir/test/Bindings/Python/ir_value.py
    mlir/test/Bindings/Python/lit.local.cfg
    mlir/test/Bindings/Python/ods_helpers.py
    mlir/test/Bindings/Python/pass_manager.py
    mlir/test/Bindings/Python/python_test_ops.td


################################################################################
diff  --git a/mlir/CMakeLists.txt b/mlir/CMakeLists.txt
index 79ef5510ad2d3..5b5339b47e1ee 100644
--- a/mlir/CMakeLists.txt
+++ b/mlir/CMakeLists.txt
@@ -146,6 +146,11 @@ endif()
 # Generally things after this point may depend on MLIR_ALL_LIBS or libMLIR.so.
 add_subdirectory(tools)
 
+if(MLIR_BINDINGS_PYTHON_ENABLED)
+  # Python sources: built extensions come in via lib/Bindings/Python
+  add_subdirectory(python)
+endif()
+
 if( LLVM_INCLUDE_EXAMPLES )
   add_subdirectory(examples)
 endif()

diff  --git a/mlir/cmake/modules/AddMLIRPythonExtension.cmake b/mlir/cmake/modules/AddMLIRPython.cmake
similarity index 98%
rename from mlir/cmake/modules/AddMLIRPythonExtension.cmake
rename to mlir/cmake/modules/AddMLIRPython.cmake
index dce7d836f8d6d..a0ac69d668792 100644
--- a/mlir/cmake/modules/AddMLIRPythonExtension.cmake
+++ b/mlir/cmake/modules/AddMLIRPython.cmake
@@ -156,6 +156,7 @@ function(add_mlir_dialect_python_bindings tblgen_target)
   add_custom_command(
     TARGET ${tblgen_target} POST_BUILD
     COMMENT "Copying generated python source \"dialects/${dialect_filename}\""
+    BYPRODUCTS "${PROJECT_BINARY_DIR}/python/mlir/dialects/${dialect_filename}"
     COMMAND "${CMAKE_COMMAND}" -E copy_if_
diff erent
       "${CMAKE_CURRENT_BINARY_DIR}/${dialect_filename}"
       "${PROJECT_BINARY_DIR}/python/mlir/dialects/${dialect_filename}")

diff  --git a/mlir/cmake/modules/CMakeLists.txt b/mlir/cmake/modules/CMakeLists.txt
index 204513812995e..c6d485f6585e5 100644
--- a/mlir/cmake/modules/CMakeLists.txt
+++ b/mlir/cmake/modules/CMakeLists.txt
@@ -81,7 +81,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
   install(FILES
     ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/MLIRConfig.cmake
     ${CMAKE_CURRENT_SOURCE_DIR}/AddMLIR.cmake
-    ${CMAKE_CURRENT_SOURCE_DIR}/AddMLIRPythonExtension.cmake
+    ${CMAKE_CURRENT_SOURCE_DIR}/AddMLIRPython.cmake
     ${CMAKE_CURRENT_SOURCE_DIR}/MLIRDetectPythonEnv.cmake
     DESTINATION ${MLIR_INSTALL_PACKAGE_DIR}
     COMPONENT mlir-cmake-exports)

diff  --git a/mlir/docs/Bindings/Python.md b/mlir/docs/Bindings/Python.md
index 510de6365451a..48c70724b4b20 100644
--- a/mlir/docs/Bindings/Python.md
+++ b/mlir/docs/Bindings/Python.md
@@ -8,7 +8,7 @@ Current status: Under development and not enabled by default
 
 * A relatively recent Python3 installation
 * Installation of python dependencies as specified in
-  `mlir/lib/Bindings/Python/requirements.txt`
+  `mlir/python/requirements.txt`
 
 ### CMake variables
 
@@ -55,7 +55,7 @@ python -m pip install --upgrade pip
 
 # Now the `python` command will resolve to your virtual environment and
 # packages will be installed there.
-python -m pip install -r mlir/lib/Bindings/Python/requirements.txt
+python -m pip install -r mlir/python/requirements.txt
 
 # Now run `cmake`, `ninja`, et al.
 ```

diff  --git a/mlir/lib/Bindings/Python/CMakeLists.txt b/mlir/lib/Bindings/Python/CMakeLists.txt
index 580405f096192..a2e972dc15df4 100644
--- a/mlir/lib/Bindings/Python/CMakeLists.txt
+++ b/mlir/lib/Bindings/Python/CMakeLists.txt
@@ -1,77 +1,6 @@
-include(AddMLIRPythonExtension)
+include(AddMLIRPython)
 add_custom_target(MLIRBindingsPythonExtension)
 
-################################################################################
-# Copy python source tree.
-################################################################################
-
-file(GLOB_RECURSE PY_SRC_FILES
-  RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}"
-  "${CMAKE_CURRENT_SOURCE_DIR}/mlir/*.py")
-
-add_custom_target(MLIRBindingsPythonSources ALL
-  DEPENDS ${PY_SRC_FILES}
-)
-add_dependencies(MLIRBindingsPythonExtension MLIRBindingsPythonSources)
-
-foreach(PY_SRC_FILE ${PY_SRC_FILES})
-  set(PY_DEST_FILE "${PROJECT_BINARY_DIR}/python/${PY_SRC_FILE}")
-  get_filename_component(PY_DEST_DIR "${PY_DEST_FILE}" DIRECTORY)
-  file(MAKE_DIRECTORY "${PY_DEST_DIR}")
-  add_custom_command(
-    TARGET MLIRBindingsPythonSources PRE_BUILD
-    COMMENT "Copying python source ${PY_SRC_FILE} -> ${PY_DEST_FILE}"
-    DEPENDS "${PY_SRC_FILE}"
-    COMMAND "${CMAKE_COMMAND}" -E create_symlink
-        "${CMAKE_CURRENT_SOURCE_DIR}/${PY_SRC_FILE}" "${PY_DEST_FILE}"
-  )
-endforeach()
-
-################################################################################
-# Generate dialect-specific bindings.
-################################################################################
-
-add_mlir_dialect_python_bindings(MLIRBindingsPythonAsyncOps
-  TD_FILE AsyncOps.td
-  DIALECT_NAME async_dialect)
-add_dependencies(MLIRBindingsPythonSources MLIRBindingsPythonAsyncOps)
-
-add_mlir_dialect_python_bindings(MLIRBindingsPythonBuiltinOps
-  TD_FILE BuiltinOps.td
-  DIALECT_NAME builtin)
-add_dependencies(MLIRBindingsPythonSources MLIRBindingsPythonBuiltinOps)
-
-add_mlir_dialect_python_bindings(MLIRBindingsPythonGPUOps
-  TD_FILE GPUOps.td
-  DIALECT_NAME gpu)
-add_dependencies(MLIRBindingsPythonSources MLIRBindingsPythonGPUOps)
-
-add_mlir_dialect_python_bindings(MLIRBindingsPythonLinalgOps
-  TD_FILE LinalgOps.td
-  DIALECT_NAME linalg
-  DEPENDS LinalgOdsGen)
-add_dependencies(MLIRBindingsPythonSources MLIRBindingsPythonLinalgOps)
-
-add_mlir_dialect_python_bindings(MLIRBindingsPythonMemRefOps
-  TD_FILE MemRefOps.td
-  DIALECT_NAME memref)
-add_dependencies(MLIRBindingsPythonSources MLIRBindingsPythonMemRefOps)
-
-add_mlir_dialect_python_bindings(MLIRBindingsPythonShapeOps
-  TD_FILE ShapeOps.td
-  DIALECT_NAME shape)
-add_dependencies(MLIRBindingsPythonSources MLIRBindingsPythonShapeOps)
-
-add_mlir_dialect_python_bindings(MLIRBindingsPythonStandardOps
-  TD_FILE StandardOps.td
-  DIALECT_NAME std)
-add_dependencies(MLIRBindingsPythonSources MLIRBindingsPythonStandardOps)
-
-add_mlir_dialect_python_bindings(MLIRBindingsPythonTensorOps
-  TD_FILE TensorOps.td
-  DIALECT_NAME tensor)
-add_dependencies(MLIRBindingsPythonSources MLIRBindingsPythonTensorOps)
-
 ################################################################################
 # Build core python extension
 ################################################################################
@@ -92,42 +21,6 @@ add_mlir_python_extension(MLIRCoreBindingsPythonExtension _mlir
 )
 add_dependencies(MLIRBindingsPythonExtension MLIRCoreBindingsPythonExtension)
 
-# Note that we copy from the source tree just like for headers because
-# it will not be polluted with py_cache runtime artifacts (from testing and
-# such).
-install(
-  DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/mlir
-  DESTINATION python
-  COMPONENT MLIRBindingsPythonSources
-  FILES_MATCHING PATTERN "*.py"
-)
-
-if (NOT LLVM_ENABLE_IDE)
-  add_llvm_install_targets(
-    install-MLIRBindingsPythonSources
-    DEPENDS MLIRBindingsPythonSources
-    COMPONENT MLIRBindingsPythonSources)
-endif()
-
-# Dialect sources are generated. Install separately.
-# Note that __pycache__ directories may have been left by tests and other
-# executions. And __init__.py is handled as a regular source file.
-install(
-  DIRECTORY ${PROJECT_BINARY_DIR}/python/mlir/dialects
-  DESTINATION python/mlir
-  COMPONENT MLIRBindingsPythonDialects
-  FILES_MATCHING PATTERN "*.py"
-  PATTERN "__pycache__" EXCLUDE
-  PATTERN "__init__.py" EXCLUDE
-)
-
-if (NOT LLVM_ENABLE_IDE)
-  add_llvm_install_targets(
-    install-MLIRBindingsPythonDialects
-    DEPENDS MLIRBindingsPythonSources
-    COMPONENT MLIRBindingsPythonDialects)
-endif()
-
 add_subdirectory(Transforms)
 add_subdirectory(Conversions)
 

diff  --git a/mlir/lib/Bindings/Python/.style.yapf b/mlir/python/.style.yapf
similarity index 100%
rename from mlir/lib/Bindings/Python/.style.yapf
rename to mlir/python/.style.yapf

diff  --git a/mlir/python/CMakeLists.txt b/mlir/python/CMakeLists.txt
new file mode 100644
index 0000000000000..1b9705a0318e6
--- /dev/null
+++ b/mlir/python/CMakeLists.txt
@@ -0,0 +1,49 @@
+################################################################################
+# Copy python source tree.
+################################################################################
+
+file(GLOB_RECURSE PY_SRC_FILES
+  RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}"
+  "${CMAKE_CURRENT_SOURCE_DIR}/mlir/*.py")
+
+add_custom_target(MLIRBindingsPythonSources ALL
+  DEPENDS
+    ${PY_SRC_FILES}
+)
+
+foreach(PY_SRC_FILE ${PY_SRC_FILES})
+  set(PY_DEST_FILE "${PROJECT_BINARY_DIR}/python/${PY_SRC_FILE}")
+  get_filename_component(PY_DEST_DIR "${PY_DEST_FILE}" DIRECTORY)
+  file(MAKE_DIRECTORY "${PY_DEST_DIR}")
+  add_custom_command(
+    TARGET MLIRBindingsPythonSources PRE_BUILD
+    COMMENT "Copying python source ${PY_SRC_FILE} -> ${PY_DEST_FILE}"
+    DEPENDS "${PY_SRC_FILE}"
+    BYPRODUCTS "${PY_DEST_FILE}"
+    COMMAND "${CMAKE_COMMAND}" -E create_symlink
+        "${CMAKE_CURRENT_SOURCE_DIR}/${PY_SRC_FILE}" "${PY_DEST_FILE}"
+  )
+endforeach()
+
+# Note that we copy from the source tree just like for headers because
+# it will not be polluted with py_cache runtime artifacts (from testing and
+# such).
+install(
+  DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/mlir
+  DESTINATION python
+  COMPONENT MLIRBindingsPythonSources
+  FILES_MATCHING PATTERN "*.py"
+)
+
+if (NOT LLVM_ENABLE_IDE)
+  add_llvm_install_targets(
+    install-MLIRBindingsPythonSources
+    DEPENDS MLIRBindingsPythonSources
+    COMPONENT MLIRBindingsPythonSources)
+endif()
+
+################################################################################
+# Generated sources.
+################################################################################
+
+add_subdirectory(mlir/dialects)

diff  --git a/mlir/lib/Bindings/Python/mlir/_cext_loader.py b/mlir/python/mlir/_cext_loader.py
similarity index 100%
rename from mlir/lib/Bindings/Python/mlir/_cext_loader.py
rename to mlir/python/mlir/_cext_loader.py

diff  --git a/mlir/lib/Bindings/Python/mlir/_dlloader.py b/mlir/python/mlir/_dlloader.py
similarity index 100%
rename from mlir/lib/Bindings/Python/mlir/_dlloader.py
rename to mlir/python/mlir/_dlloader.py

diff  --git a/mlir/lib/Bindings/Python/mlir/conversions/__init__.py b/mlir/python/mlir/conversions/__init__.py
similarity index 100%
rename from mlir/lib/Bindings/Python/mlir/conversions/__init__.py
rename to mlir/python/mlir/conversions/__init__.py

diff  --git a/mlir/lib/Bindings/Python/AsyncOps.td b/mlir/python/mlir/dialects/AsyncOps.td
similarity index 100%
rename from mlir/lib/Bindings/Python/AsyncOps.td
rename to mlir/python/mlir/dialects/AsyncOps.td

diff  --git a/mlir/lib/Bindings/Python/BuiltinOps.td b/mlir/python/mlir/dialects/BuiltinOps.td
similarity index 100%
rename from mlir/lib/Bindings/Python/BuiltinOps.td
rename to mlir/python/mlir/dialects/BuiltinOps.td

diff  --git a/mlir/python/mlir/dialects/CMakeLists.txt b/mlir/python/mlir/dialects/CMakeLists.txt
new file mode 100644
index 0000000000000..31a4ee55b9d38
--- /dev/null
+++ b/mlir/python/mlir/dialects/CMakeLists.txt
@@ -0,0 +1,71 @@
+include(AddMLIRPython)
+
+################################################################################
+# Generate dialect-specific bindings.
+################################################################################
+
+add_mlir_dialect_python_bindings(MLIRBindingsPythonAsyncOps
+  TD_FILE AsyncOps.td
+  DIALECT_NAME async_dialect)
+add_dependencies(MLIRBindingsPythonSources MLIRBindingsPythonAsyncOps)
+
+add_mlir_dialect_python_bindings(MLIRBindingsPythonBuiltinOps
+  TD_FILE BuiltinOps.td
+  DIALECT_NAME builtin)
+add_dependencies(MLIRBindingsPythonSources MLIRBindingsPythonBuiltinOps)
+
+add_mlir_dialect_python_bindings(MLIRBindingsPythonGPUOps
+  TD_FILE GPUOps.td
+  DIALECT_NAME gpu)
+add_dependencies(MLIRBindingsPythonSources MLIRBindingsPythonGPUOps)
+
+add_mlir_dialect_python_bindings(MLIRBindingsPythonLinalgOps
+  TD_FILE LinalgOps.td
+  DIALECT_NAME linalg
+  DEPENDS LinalgOdsGen)
+add_dependencies(MLIRBindingsPythonSources MLIRBindingsPythonLinalgOps)
+
+add_mlir_dialect_python_bindings(MLIRBindingsPythonMemRefOps
+  TD_FILE MemRefOps.td
+  DIALECT_NAME memref)
+add_dependencies(MLIRBindingsPythonSources MLIRBindingsPythonMemRefOps)
+
+add_mlir_dialect_python_bindings(MLIRBindingsPythonShapeOps
+  TD_FILE ShapeOps.td
+  DIALECT_NAME shape)
+add_dependencies(MLIRBindingsPythonSources MLIRBindingsPythonShapeOps)
+
+add_mlir_dialect_python_bindings(MLIRBindingsPythonStandardOps
+  TD_FILE StandardOps.td
+  DIALECT_NAME std)
+add_dependencies(MLIRBindingsPythonSources MLIRBindingsPythonStandardOps)
+
+add_mlir_dialect_python_bindings(MLIRBindingsPythonTensorOps
+  TD_FILE TensorOps.td
+  DIALECT_NAME tensor)
+add_dependencies(MLIRBindingsPythonSources MLIRBindingsPythonTensorOps)
+
+################################################################################
+# Installation.
+################################################################################
+
+# Dialect sources are generated. Install separately.
+# Note that __pycache__ directories may have been left by tests and other
+# executions. And __init__.py is handled as a regular source file.
+# TODO: Eliminate this glob install, instead adding INSTALL_COMPONENT to
+# add_mlir_dialect_python_bindings and installing the precise file there.
+install(
+  DIRECTORY ${PROJECT_BINARY_DIR}/python/mlir/dialects
+  DESTINATION python/mlir
+  COMPONENT MLIRBindingsPythonDialects
+  FILES_MATCHING PATTERN "_*_gen.py"
+  PATTERN "__pycache__" EXCLUDE
+  PATTERN "__init__.py" EXCLUDE
+)
+
+if (NOT LLVM_ENABLE_IDE)
+  add_llvm_install_targets(
+    install-MLIRBindingsPythonDialects
+    DEPENDS MLIRBindingsPythonSources
+    COMPONENT MLIRBindingsPythonDialects)
+endif()

diff  --git a/mlir/lib/Bindings/Python/GPUOps.td b/mlir/python/mlir/dialects/GPUOps.td
similarity index 100%
rename from mlir/lib/Bindings/Python/GPUOps.td
rename to mlir/python/mlir/dialects/GPUOps.td

diff  --git a/mlir/lib/Bindings/Python/LinalgOps.td b/mlir/python/mlir/dialects/LinalgOps.td
similarity index 100%
rename from mlir/lib/Bindings/Python/LinalgOps.td
rename to mlir/python/mlir/dialects/LinalgOps.td

diff  --git a/mlir/lib/Bindings/Python/MemRefOps.td b/mlir/python/mlir/dialects/MemRefOps.td
similarity index 100%
rename from mlir/lib/Bindings/Python/MemRefOps.td
rename to mlir/python/mlir/dialects/MemRefOps.td

diff  --git a/mlir/lib/Bindings/Python/ShapeOps.td b/mlir/python/mlir/dialects/ShapeOps.td
similarity index 100%
rename from mlir/lib/Bindings/Python/ShapeOps.td
rename to mlir/python/mlir/dialects/ShapeOps.td

diff  --git a/mlir/lib/Bindings/Python/StandardOps.td b/mlir/python/mlir/dialects/StandardOps.td
similarity index 100%
rename from mlir/lib/Bindings/Python/StandardOps.td
rename to mlir/python/mlir/dialects/StandardOps.td

diff  --git a/mlir/lib/Bindings/Python/TensorOps.td b/mlir/python/mlir/dialects/TensorOps.td
similarity index 100%
rename from mlir/lib/Bindings/Python/TensorOps.td
rename to mlir/python/mlir/dialects/TensorOps.td

diff  --git a/mlir/lib/Bindings/Python/mlir/dialects/_builtin_ops_ext.py b/mlir/python/mlir/dialects/_builtin_ops_ext.py
similarity index 100%
rename from mlir/lib/Bindings/Python/mlir/dialects/_builtin_ops_ext.py
rename to mlir/python/mlir/dialects/_builtin_ops_ext.py

diff  --git a/mlir/lib/Bindings/Python/mlir/dialects/_linalg_ops_ext.py b/mlir/python/mlir/dialects/_linalg_ops_ext.py
similarity index 100%
rename from mlir/lib/Bindings/Python/mlir/dialects/_linalg_ops_ext.py
rename to mlir/python/mlir/dialects/_linalg_ops_ext.py

diff  --git a/mlir/lib/Bindings/Python/mlir/dialects/_ods_common.py b/mlir/python/mlir/dialects/_ods_common.py
similarity index 100%
rename from mlir/lib/Bindings/Python/mlir/dialects/_ods_common.py
rename to mlir/python/mlir/dialects/_ods_common.py

diff  --git a/mlir/lib/Bindings/Python/mlir/dialects/async_dialect/__init__.py b/mlir/python/mlir/dialects/async_dialect/__init__.py
similarity index 100%
rename from mlir/lib/Bindings/Python/mlir/dialects/async_dialect/__init__.py
rename to mlir/python/mlir/dialects/async_dialect/__init__.py

diff  --git a/mlir/lib/Bindings/Python/mlir/dialects/async_dialect/passes/__init__.py b/mlir/python/mlir/dialects/async_dialect/passes/__init__.py
similarity index 100%
rename from mlir/lib/Bindings/Python/mlir/dialects/async_dialect/passes/__init__.py
rename to mlir/python/mlir/dialects/async_dialect/passes/__init__.py

diff  --git a/mlir/lib/Bindings/Python/mlir/dialects/builtin.py b/mlir/python/mlir/dialects/builtin.py
similarity index 100%
rename from mlir/lib/Bindings/Python/mlir/dialects/builtin.py
rename to mlir/python/mlir/dialects/builtin.py

diff  --git a/mlir/lib/Bindings/Python/mlir/dialects/gpu/__init__.py b/mlir/python/mlir/dialects/gpu/__init__.py
similarity index 100%
rename from mlir/lib/Bindings/Python/mlir/dialects/gpu/__init__.py
rename to mlir/python/mlir/dialects/gpu/__init__.py

diff  --git a/mlir/lib/Bindings/Python/mlir/dialects/gpu/passes/__init__.py b/mlir/python/mlir/dialects/gpu/passes/__init__.py
similarity index 100%
rename from mlir/lib/Bindings/Python/mlir/dialects/gpu/passes/__init__.py
rename to mlir/python/mlir/dialects/gpu/passes/__init__.py

diff  --git a/mlir/lib/Bindings/Python/mlir/dialects/linalg/__init__.py b/mlir/python/mlir/dialects/linalg/__init__.py
similarity index 100%
rename from mlir/lib/Bindings/Python/mlir/dialects/linalg/__init__.py
rename to mlir/python/mlir/dialects/linalg/__init__.py

diff  --git a/mlir/lib/Bindings/Python/mlir/dialects/linalg/opdsl/__init__.py b/mlir/python/mlir/dialects/linalg/opdsl/__init__.py
similarity index 100%
rename from mlir/lib/Bindings/Python/mlir/dialects/linalg/opdsl/__init__.py
rename to mlir/python/mlir/dialects/linalg/opdsl/__init__.py

diff  --git a/mlir/lib/Bindings/Python/mlir/dialects/linalg/opdsl/dump_oplib.py b/mlir/python/mlir/dialects/linalg/opdsl/dump_oplib.py
similarity index 100%
rename from mlir/lib/Bindings/Python/mlir/dialects/linalg/opdsl/dump_oplib.py
rename to mlir/python/mlir/dialects/linalg/opdsl/dump_oplib.py

diff  --git a/mlir/lib/Bindings/Python/mlir/dialects/linalg/opdsl/lang/__init__.py b/mlir/python/mlir/dialects/linalg/opdsl/lang/__init__.py
similarity index 100%
rename from mlir/lib/Bindings/Python/mlir/dialects/linalg/opdsl/lang/__init__.py
rename to mlir/python/mlir/dialects/linalg/opdsl/lang/__init__.py

diff  --git a/mlir/lib/Bindings/Python/mlir/dialects/linalg/opdsl/lang/affine.py b/mlir/python/mlir/dialects/linalg/opdsl/lang/affine.py
similarity index 100%
rename from mlir/lib/Bindings/Python/mlir/dialects/linalg/opdsl/lang/affine.py
rename to mlir/python/mlir/dialects/linalg/opdsl/lang/affine.py

diff  --git a/mlir/lib/Bindings/Python/mlir/dialects/linalg/opdsl/lang/comprehension.py b/mlir/python/mlir/dialects/linalg/opdsl/lang/comprehension.py
similarity index 100%
rename from mlir/lib/Bindings/Python/mlir/dialects/linalg/opdsl/lang/comprehension.py
rename to mlir/python/mlir/dialects/linalg/opdsl/lang/comprehension.py

diff  --git a/mlir/lib/Bindings/Python/mlir/dialects/linalg/opdsl/lang/config.py b/mlir/python/mlir/dialects/linalg/opdsl/lang/config.py
similarity index 100%
rename from mlir/lib/Bindings/Python/mlir/dialects/linalg/opdsl/lang/config.py
rename to mlir/python/mlir/dialects/linalg/opdsl/lang/config.py

diff  --git a/mlir/lib/Bindings/Python/mlir/dialects/linalg/opdsl/lang/dsl.py b/mlir/python/mlir/dialects/linalg/opdsl/lang/dsl.py
similarity index 100%
rename from mlir/lib/Bindings/Python/mlir/dialects/linalg/opdsl/lang/dsl.py
rename to mlir/python/mlir/dialects/linalg/opdsl/lang/dsl.py

diff  --git a/mlir/lib/Bindings/Python/mlir/dialects/linalg/opdsl/lang/emitter.py b/mlir/python/mlir/dialects/linalg/opdsl/lang/emitter.py
similarity index 100%
rename from mlir/lib/Bindings/Python/mlir/dialects/linalg/opdsl/lang/emitter.py
rename to mlir/python/mlir/dialects/linalg/opdsl/lang/emitter.py

diff  --git a/mlir/lib/Bindings/Python/mlir/dialects/linalg/opdsl/lang/scalar_expr.py b/mlir/python/mlir/dialects/linalg/opdsl/lang/scalar_expr.py
similarity index 100%
rename from mlir/lib/Bindings/Python/mlir/dialects/linalg/opdsl/lang/scalar_expr.py
rename to mlir/python/mlir/dialects/linalg/opdsl/lang/scalar_expr.py

diff  --git a/mlir/lib/Bindings/Python/mlir/dialects/linalg/opdsl/lang/types.py b/mlir/python/mlir/dialects/linalg/opdsl/lang/types.py
similarity index 100%
rename from mlir/lib/Bindings/Python/mlir/dialects/linalg/opdsl/lang/types.py
rename to mlir/python/mlir/dialects/linalg/opdsl/lang/types.py

diff  --git a/mlir/lib/Bindings/Python/mlir/dialects/linalg/opdsl/lang/yaml_helper.py b/mlir/python/mlir/dialects/linalg/opdsl/lang/yaml_helper.py
similarity index 100%
rename from mlir/lib/Bindings/Python/mlir/dialects/linalg/opdsl/lang/yaml_helper.py
rename to mlir/python/mlir/dialects/linalg/opdsl/lang/yaml_helper.py

diff  --git a/mlir/lib/Bindings/Python/mlir/dialects/linalg/opdsl/ops/__init__.py b/mlir/python/mlir/dialects/linalg/opdsl/ops/__init__.py
similarity index 100%
rename from mlir/lib/Bindings/Python/mlir/dialects/linalg/opdsl/ops/__init__.py
rename to mlir/python/mlir/dialects/linalg/opdsl/ops/__init__.py

diff  --git a/mlir/lib/Bindings/Python/mlir/dialects/linalg/opdsl/ops/core_named_ops.py b/mlir/python/mlir/dialects/linalg/opdsl/ops/core_named_ops.py
similarity index 100%
rename from mlir/lib/Bindings/Python/mlir/dialects/linalg/opdsl/ops/core_named_ops.py
rename to mlir/python/mlir/dialects/linalg/opdsl/ops/core_named_ops.py

diff  --git a/mlir/lib/Bindings/Python/mlir/dialects/linalg/passes/__init__.py b/mlir/python/mlir/dialects/linalg/passes/__init__.py
similarity index 100%
rename from mlir/lib/Bindings/Python/mlir/dialects/linalg/passes/__init__.py
rename to mlir/python/mlir/dialects/linalg/passes/__init__.py

diff  --git a/mlir/lib/Bindings/Python/mlir/dialects/memref.py b/mlir/python/mlir/dialects/memref.py
similarity index 100%
rename from mlir/lib/Bindings/Python/mlir/dialects/memref.py
rename to mlir/python/mlir/dialects/memref.py

diff  --git a/mlir/lib/Bindings/Python/mlir/dialects/python_test.py b/mlir/python/mlir/dialects/python_test.py
similarity index 100%
rename from mlir/lib/Bindings/Python/mlir/dialects/python_test.py
rename to mlir/python/mlir/dialects/python_test.py

diff  --git a/mlir/lib/Bindings/Python/mlir/dialects/shape.py b/mlir/python/mlir/dialects/shape.py
similarity index 100%
rename from mlir/lib/Bindings/Python/mlir/dialects/shape.py
rename to mlir/python/mlir/dialects/shape.py

diff  --git a/mlir/lib/Bindings/Python/mlir/dialects/std.py b/mlir/python/mlir/dialects/std.py
similarity index 100%
rename from mlir/lib/Bindings/Python/mlir/dialects/std.py
rename to mlir/python/mlir/dialects/std.py

diff  --git a/mlir/lib/Bindings/Python/mlir/dialects/tensor.py b/mlir/python/mlir/dialects/tensor.py
similarity index 100%
rename from mlir/lib/Bindings/Python/mlir/dialects/tensor.py
rename to mlir/python/mlir/dialects/tensor.py

diff  --git a/mlir/lib/Bindings/Python/mlir/execution_engine.py b/mlir/python/mlir/execution_engine.py
similarity index 100%
rename from mlir/lib/Bindings/Python/mlir/execution_engine.py
rename to mlir/python/mlir/execution_engine.py

diff  --git a/mlir/lib/Bindings/Python/mlir/ir.py b/mlir/python/mlir/ir.py
similarity index 100%
rename from mlir/lib/Bindings/Python/mlir/ir.py
rename to mlir/python/mlir/ir.py

diff  --git a/mlir/lib/Bindings/Python/mlir/passmanager.py b/mlir/python/mlir/passmanager.py
similarity index 100%
rename from mlir/lib/Bindings/Python/mlir/passmanager.py
rename to mlir/python/mlir/passmanager.py

diff  --git a/mlir/lib/Bindings/Python/mlir/runtime/__init__.py b/mlir/python/mlir/runtime/__init__.py
similarity index 100%
rename from mlir/lib/Bindings/Python/mlir/runtime/__init__.py
rename to mlir/python/mlir/runtime/__init__.py

diff  --git a/mlir/lib/Bindings/Python/mlir/runtime/np_to_memref.py b/mlir/python/mlir/runtime/np_to_memref.py
similarity index 100%
rename from mlir/lib/Bindings/Python/mlir/runtime/np_to_memref.py
rename to mlir/python/mlir/runtime/np_to_memref.py

diff  --git a/mlir/lib/Bindings/Python/mlir/transforms/__init__.py b/mlir/python/mlir/transforms/__init__.py
similarity index 100%
rename from mlir/lib/Bindings/Python/mlir/transforms/__init__.py
rename to mlir/python/mlir/transforms/__init__.py

diff  --git a/mlir/lib/Bindings/Python/requirements.txt b/mlir/python/requirements.txt
similarity index 100%
rename from mlir/lib/Bindings/Python/requirements.txt
rename to mlir/python/requirements.txt

diff  --git a/mlir/test/Bindings/CMakeLists.txt b/mlir/test/Bindings/CMakeLists.txt
deleted file mode 100644
index b41f480b6dcf0..0000000000000
--- a/mlir/test/Bindings/CMakeLists.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-if(MLIR_BINDINGS_PYTHON_ENABLED)
-  add_subdirectory(Python)
-endif()

diff  --git a/mlir/test/Bindings/Python/.style.yapf b/mlir/test/Bindings/Python/.style.yapf
deleted file mode 100644
index 9ef1dc15ba620..0000000000000
--- a/mlir/test/Bindings/Python/.style.yapf
+++ /dev/null
@@ -1,4 +0,0 @@
-[style]
-  based_on_style = google
-  column_limit = 80
-  indent_width = 2

diff  --git a/mlir/test/CMakeLists.txt b/mlir/test/CMakeLists.txt
index 64832fe9bf8f4..bf05922976ae0 100644
--- a/mlir/test/CMakeLists.txt
+++ b/mlir/test/CMakeLists.txt
@@ -1,9 +1,12 @@
-add_subdirectory(Bindings)
 add_subdirectory(CAPI)
 add_subdirectory(EDSC)
 add_subdirectory(SDBM)
 add_subdirectory(lib)
 
+if(MLIR_BINDINGS_PYTHON_ENABLED)
+  add_subdirectory(python)
+endif()
+
 llvm_canonicalize_cmake_booleans(
   MLIR_BINDINGS_PYTHON_ENABLED
   LLVM_BUILD_EXAMPLES
@@ -111,6 +114,7 @@ endif()
 if(MLIR_BINDINGS_PYTHON_ENABLED)
   list(APPEND MLIR_TEST_DEPENDS
     MLIRBindingsPythonExtension
+    MLIRBindingsPythonSources
     MLIRBindingsPythonTestOps
     MLIRTransformsBindingsPythonExtension
     MLIRConversionsBindingsPythonExtension

diff  --git a/mlir/test/Bindings/Python/CMakeLists.txt b/mlir/test/python/CMakeLists.txt
similarity index 78%
rename from mlir/test/Bindings/Python/CMakeLists.txt
rename to mlir/test/python/CMakeLists.txt
index 666bd9fd1cec3..19f5a79bcd75e 100644
--- a/mlir/test/Bindings/Python/CMakeLists.txt
+++ b/mlir/test/python/CMakeLists.txt
@@ -1,4 +1,5 @@
-include(AddMLIRPythonExtension)
+include(AddMLIRPython)
+
 add_mlir_dialect_python_bindings(MLIRBindingsPythonTestOps
   TD_FILE python_test_ops.td
   DIALECT_NAME python_test)

diff  --git a/mlir/test/Bindings/Python/dialects/async_dialect.py b/mlir/test/python/dialects/async_dialect.py
similarity index 100%
rename from mlir/test/Bindings/Python/dialects/async_dialect.py
rename to mlir/test/python/dialects/async_dialect.py

diff  --git a/mlir/test/Bindings/Python/dialects/builtin.py b/mlir/test/python/dialects/builtin.py
similarity index 100%
rename from mlir/test/Bindings/Python/dialects/builtin.py
rename to mlir/test/python/dialects/builtin.py

diff  --git a/mlir/test/Bindings/Python/dialects/gpu.py b/mlir/test/python/dialects/gpu.py
similarity index 100%
rename from mlir/test/Bindings/Python/dialects/gpu.py
rename to mlir/test/python/dialects/gpu.py

diff  --git a/mlir/test/Bindings/Python/dialects/linalg/opdsl/assignments.py b/mlir/test/python/dialects/linalg/opdsl/assignments.py
similarity index 100%
rename from mlir/test/Bindings/Python/dialects/linalg/opdsl/assignments.py
rename to mlir/test/python/dialects/linalg/opdsl/assignments.py

diff  --git a/mlir/test/Bindings/Python/dialects/linalg/opdsl/doctests.py b/mlir/test/python/dialects/linalg/opdsl/doctests.py
similarity index 100%
rename from mlir/test/Bindings/Python/dialects/linalg/opdsl/doctests.py
rename to mlir/test/python/dialects/linalg/opdsl/doctests.py

diff  --git a/mlir/test/Bindings/Python/dialects/linalg/opdsl/emit_structured_generic.py b/mlir/test/python/dialects/linalg/opdsl/emit_structured_generic.py
similarity index 100%
rename from mlir/test/Bindings/Python/dialects/linalg/opdsl/emit_structured_generic.py
rename to mlir/test/python/dialects/linalg/opdsl/emit_structured_generic.py

diff  --git a/mlir/test/Bindings/Python/dialects/linalg/opdsl/interfaces.py b/mlir/test/python/dialects/linalg/opdsl/interfaces.py
similarity index 100%
rename from mlir/test/Bindings/Python/dialects/linalg/opdsl/interfaces.py
rename to mlir/test/python/dialects/linalg/opdsl/interfaces.py

diff  --git a/mlir/test/Bindings/Python/dialects/linalg/opdsl/lit.local.cfg b/mlir/test/python/dialects/linalg/opdsl/lit.local.cfg
similarity index 100%
rename from mlir/test/Bindings/Python/dialects/linalg/opdsl/lit.local.cfg
rename to mlir/test/python/dialects/linalg/opdsl/lit.local.cfg

diff  --git a/mlir/test/Bindings/Python/dialects/linalg/opdsl/shape_maps_iteration.py b/mlir/test/python/dialects/linalg/opdsl/shape_maps_iteration.py
similarity index 100%
rename from mlir/test/Bindings/Python/dialects/linalg/opdsl/shape_maps_iteration.py
rename to mlir/test/python/dialects/linalg/opdsl/shape_maps_iteration.py

diff  --git a/mlir/test/Bindings/Python/dialects/linalg/opdsl/test_core_named_ops.py b/mlir/test/python/dialects/linalg/opdsl/test_core_named_ops.py
similarity index 100%
rename from mlir/test/Bindings/Python/dialects/linalg/opdsl/test_core_named_ops.py
rename to mlir/test/python/dialects/linalg/opdsl/test_core_named_ops.py

diff  --git a/mlir/test/Bindings/Python/dialects/linalg/ops.py b/mlir/test/python/dialects/linalg/ops.py
similarity index 100%
rename from mlir/test/Bindings/Python/dialects/linalg/ops.py
rename to mlir/test/python/dialects/linalg/ops.py

diff  --git a/mlir/test/Bindings/Python/dialects/linalg/opsrun.py b/mlir/test/python/dialects/linalg/opsrun.py
similarity index 100%
rename from mlir/test/Bindings/Python/dialects/linalg/opsrun.py
rename to mlir/test/python/dialects/linalg/opsrun.py

diff  --git a/mlir/test/Bindings/Python/dialects/memref.py b/mlir/test/python/dialects/memref.py
similarity index 100%
rename from mlir/test/Bindings/Python/dialects/memref.py
rename to mlir/test/python/dialects/memref.py

diff  --git a/mlir/test/Bindings/Python/ods_helpers.py b/mlir/test/python/dialects/ods_helpers.py
similarity index 100%
rename from mlir/test/Bindings/Python/ods_helpers.py
rename to mlir/test/python/dialects/ods_helpers.py

diff  --git a/mlir/test/Bindings/Python/dialects/python_test.py b/mlir/test/python/dialects/python_test.py
similarity index 100%
rename from mlir/test/Bindings/Python/dialects/python_test.py
rename to mlir/test/python/dialects/python_test.py

diff  --git a/mlir/test/Bindings/Python/execution_engine.py b/mlir/test/python/execution_engine.py
similarity index 100%
rename from mlir/test/Bindings/Python/execution_engine.py
rename to mlir/test/python/execution_engine.py

diff  --git a/mlir/test/Bindings/Python/ir_affine_expr.py b/mlir/test/python/ir/affine_expr.py
similarity index 100%
rename from mlir/test/Bindings/Python/ir_affine_expr.py
rename to mlir/test/python/ir/affine_expr.py

diff  --git a/mlir/test/Bindings/Python/ir_affine_map.py b/mlir/test/python/ir/affine_map.py
similarity index 100%
rename from mlir/test/Bindings/Python/ir_affine_map.py
rename to mlir/test/python/ir/affine_map.py

diff  --git a/mlir/test/Bindings/Python/ir_array_attributes.py b/mlir/test/python/ir/array_attributes.py
similarity index 100%
rename from mlir/test/Bindings/Python/ir_array_attributes.py
rename to mlir/test/python/ir/array_attributes.py

diff  --git a/mlir/test/Bindings/Python/ir_attributes.py b/mlir/test/python/ir/attributes.py
similarity index 100%
rename from mlir/test/Bindings/Python/ir_attributes.py
rename to mlir/test/python/ir/attributes.py

diff  --git a/mlir/test/Bindings/Python/ir_types.py b/mlir/test/python/ir/builtin_types.py
similarity index 100%
rename from mlir/test/Bindings/Python/ir_types.py
rename to mlir/test/python/ir/builtin_types.py

diff  --git a/mlir/test/Bindings/Python/context_lifecycle.py b/mlir/test/python/ir/context_lifecycle.py
similarity index 100%
rename from mlir/test/Bindings/Python/context_lifecycle.py
rename to mlir/test/python/ir/context_lifecycle.py

diff  --git a/mlir/test/Bindings/Python/context_managers.py b/mlir/test/python/ir/context_managers.py
similarity index 100%
rename from mlir/test/Bindings/Python/context_managers.py
rename to mlir/test/python/ir/context_managers.py

diff  --git a/mlir/test/Bindings/Python/debug.py b/mlir/test/python/ir/debug.py
similarity index 100%
rename from mlir/test/Bindings/Python/debug.py
rename to mlir/test/python/ir/debug.py

diff  --git a/mlir/test/Bindings/Python/dialects.py b/mlir/test/python/ir/dialects.py
similarity index 100%
rename from mlir/test/Bindings/Python/dialects.py
rename to mlir/test/python/ir/dialects.py

diff  --git a/mlir/test/Bindings/Python/insertion_point.py b/mlir/test/python/ir/insertion_point.py
similarity index 100%
rename from mlir/test/Bindings/Python/insertion_point.py
rename to mlir/test/python/ir/insertion_point.py

diff  --git a/mlir/test/Bindings/Python/ir_integer_set.py b/mlir/test/python/ir/integer_set.py
similarity index 100%
rename from mlir/test/Bindings/Python/ir_integer_set.py
rename to mlir/test/python/ir/integer_set.py

diff  --git a/mlir/test/Bindings/Python/ir_location.py b/mlir/test/python/ir/location.py
similarity index 100%
rename from mlir/test/Bindings/Python/ir_location.py
rename to mlir/test/python/ir/location.py

diff  --git a/mlir/test/Bindings/Python/ir_module.py b/mlir/test/python/ir/module.py
similarity index 100%
rename from mlir/test/Bindings/Python/ir_module.py
rename to mlir/test/python/ir/module.py

diff  --git a/mlir/test/Bindings/Python/ir_operation.py b/mlir/test/python/ir/operation.py
similarity index 100%
rename from mlir/test/Bindings/Python/ir_operation.py
rename to mlir/test/python/ir/operation.py

diff  --git a/mlir/test/Bindings/Python/ir_value.py b/mlir/test/python/ir/value.py
similarity index 100%
rename from mlir/test/Bindings/Python/ir_value.py
rename to mlir/test/python/ir/value.py

diff  --git a/mlir/test/Bindings/Python/lit.local.cfg b/mlir/test/python/lit.local.cfg
similarity index 100%
rename from mlir/test/Bindings/Python/lit.local.cfg
rename to mlir/test/python/lit.local.cfg

diff  --git a/mlir/test/Bindings/Python/pass_manager.py b/mlir/test/python/pass_manager.py
similarity index 100%
rename from mlir/test/Bindings/Python/pass_manager.py
rename to mlir/test/python/pass_manager.py

diff  --git a/mlir/test/Bindings/Python/python_test_ops.td b/mlir/test/python/python_test_ops.td
similarity index 100%
rename from mlir/test/Bindings/Python/python_test_ops.td
rename to mlir/test/python/python_test_ops.td


        


More information about the Mlir-commits mailing list