Skip to content

Commit 1922187

Browse files
authored
Merge pull request #53 from Xilinx/martin.fix_python_bindings
fix native constraint op in mlir python bindings
2 parents debfaf5 + a0c95a2 commit 1922187

File tree

3 files changed

+29
-2
lines changed

3 files changed

+29
-2
lines changed

.github/workflows/llvm-project-tests.yml

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ on:
1010
required: false
1111
projects:
1212
required: false
13+
extra_cmake_args:
14+
required: false
15+
default: ""
16+
type: string
17+
1318
workflow_call:
1419
inputs:
1520
build_target:
@@ -20,6 +25,11 @@ on:
2025
required: true
2126
type: string
2227

28+
extra_cmake_args:
29+
required: false
30+
default: ""
31+
type: string
32+
2333
concurrency:
2434
# Skip intermediate builds: always.
2535
# Cancel intermediate builds: only if it is a pull request build.
@@ -57,6 +67,7 @@ jobs:
5767
uses: actions/setup-python@v4
5868
with:
5969
python-version: '3.11'
70+
6071
- name: Install Ninja
6172
uses: llvm/actions/install-ninja@main
6273
# actions/checkout deletes any existing files in the new git directory,
@@ -65,6 +76,9 @@ jobs:
6576
- uses: actions/checkout@v3
6677
with:
6778
fetch-depth: 250
79+
- name: Install requirements.txt
80+
if: inputs.projects == 'mlir'
81+
run: pip install -r mlir/python/requirements.txt
6882
- name: Setup ccache
6983
uses: hendrikmuhs/ccache-action@v1
7084
with:
@@ -85,7 +99,17 @@ jobs:
8599
# This should be a no-op for non-mac OSes
86100
PKG_CONFIG_PATH: /usr/local/Homebrew/Library/Homebrew/os/mac/pkgconfig//12
87101
with:
88-
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'
102+
cmake_args: >-
103+
-GNinja
104+
-DLLVM_ENABLE_PROJECTS="${{ inputs.projects }}"
105+
-DLLVM_TARGETS_TO_BUILD=host
106+
-DCMAKE_BUILD_TYPE=Release
107+
-DLLDB_INCLUDE_TESTS=OFF
108+
-DCMAKE_C_COMPILER_LAUNCHER=sccache
109+
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache
110+
-DLLVM_ENABLE_ASSERTIONS=ON
111+
${{ inputs.extra_cmake_args }}
112+
89113
build_target: '${{ inputs.build_target }}'
90114

91115
- name: Build and Test libclc

.github/workflows/mlir-tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,4 @@ jobs:
2828
with:
2929
build_target: check-mlir
3030
projects: mlir
31+
extra_cmake_args: -DMLIR_ENABLE_BINDINGS_PYTHON=ON

mlir/python/mlir/dialects/_pdl_ops_ext.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,15 @@ class ApplyNativeConstraintOp:
5858

5959
def __init__(self,
6060
name: Union[str, StringAttr],
61+
results: Sequence[Type] = [],
6162
args: Sequence[Union[OpView, Operation, Value]] = [],
6263
*,
6364
loc=None,
6465
ip=None):
6566
name = _get_str_attr(name)
6667
args = _get_values(args)
67-
super().__init__(name, args, loc=loc, ip=ip)
68+
results = _get_values(results)
69+
super().__init__(results, name, args, loc=loc, ip=ip)
6870

6971

7072
class ApplyNativeRewriteOp:

0 commit comments

Comments
 (0)