From a5f29f19cf2bb47bbb4a2ef4b41b5c30ef1d5f9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20L=C3=BCcke?= Date: Thu, 15 Jun 2023 12:56:50 +0100 Subject: [PATCH 1/2] fix native constraint op in mlir python bindings --- mlir/python/mlir/dialects/_pdl_ops_ext.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mlir/python/mlir/dialects/_pdl_ops_ext.py b/mlir/python/mlir/dialects/_pdl_ops_ext.py index 428301b18f208..5fc195096c810 100644 --- a/mlir/python/mlir/dialects/_pdl_ops_ext.py +++ b/mlir/python/mlir/dialects/_pdl_ops_ext.py @@ -58,13 +58,15 @@ class ApplyNativeConstraintOp: def __init__(self, name: Union[str, StringAttr], + results: Sequence[Type] = [], args: Sequence[Union[OpView, Operation, Value]] = [], *, loc=None, ip=None): name = _get_str_attr(name) args = _get_values(args) - super().__init__(name, args, loc=loc, ip=ip) + results = _get_values(results) + super().__init__(results, name, args, loc=loc, ip=ip) class ApplyNativeRewriteOp: From 221931fa79c98704315496bff7e4cfee69deb1ab Mon Sep 17 00:00:00 2001 From: Matthias Gehre Date: Thu, 15 Jun 2023 12:13:40 +0200 Subject: [PATCH 2/2] Run mlir tests with python bindings enabled --- .github/workflows/llvm-project-tests.yml | 26 +++++++++++++++++++++++- .github/workflows/mlir-tests.yml | 1 + 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/.github/workflows/llvm-project-tests.yml b/.github/workflows/llvm-project-tests.yml index 437581dbe4071..4788198f48a69 100644 --- a/.github/workflows/llvm-project-tests.yml +++ b/.github/workflows/llvm-project-tests.yml @@ -10,6 +10,11 @@ on: required: false projects: required: false + extra_cmake_args: + required: false + default: "" + type: string + workflow_call: inputs: build_target: @@ -20,6 +25,11 @@ on: required: true type: string + extra_cmake_args: + required: false + default: "" + type: string + concurrency: # Skip intermediate builds: always. # Cancel intermediate builds: only if it is a pull request build. @@ -57,6 +67,7 @@ jobs: uses: actions/setup-python@v4 with: python-version: '3.11' + - name: Install Ninja uses: llvm/actions/install-ninja@main # actions/checkout deletes any existing files in the new git directory, @@ -65,6 +76,9 @@ jobs: - uses: actions/checkout@v3 with: fetch-depth: 250 + - name: Install requirements.txt + if: inputs.projects == 'mlir' + run: pip install -r mlir/python/requirements.txt - name: Setup ccache uses: hendrikmuhs/ccache-action@v1 with: @@ -85,7 +99,17 @@ jobs: # This should be a no-op for non-mac OSes PKG_CONFIG_PATH: /usr/local/Homebrew/Library/Homebrew/os/mac/pkgconfig//12 with: - cmake_args: '-GNinja -DLLVM_ENABLE_PROJECTS="${{ inputs.projects }}" -DLLVM_TARGETS_TO_BUILD=host -DCMAKE_BUILD_TYPE=Release -DLLDB_INCLUDE_TESTS=OFF -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache' + cmake_args: >- + -GNinja + -DLLVM_ENABLE_PROJECTS="${{ inputs.projects }}" + -DLLVM_TARGETS_TO_BUILD=host + -DCMAKE_BUILD_TYPE=Release + -DLLDB_INCLUDE_TESTS=OFF + -DCMAKE_C_COMPILER_LAUNCHER=sccache + -DCMAKE_CXX_COMPILER_LAUNCHER=sccache + -DLLVM_ENABLE_ASSERTIONS=ON + ${{ inputs.extra_cmake_args }} + build_target: '${{ inputs.build_target }}' - name: Build and Test libclc diff --git a/.github/workflows/mlir-tests.yml b/.github/workflows/mlir-tests.yml index 5018d7c92cc23..d026e1e75285c 100644 --- a/.github/workflows/mlir-tests.yml +++ b/.github/workflows/mlir-tests.yml @@ -25,3 +25,4 @@ jobs: with: build_target: check-mlir projects: mlir + extra_cmake_args: -DMLIR_ENABLE_BINDINGS_PYTHON=ON