Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/pip/pytest-asyncio-0.25.0
Browse files Browse the repository at this point in the history
  • Loading branch information
superlopuh committed Dec 16, 2024
2 parents 4050b1d + 3725f40 commit e11ef24
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 41 deletions.
38 changes: 0 additions & 38 deletions .github/workflows/update-bot.yml

This file was deleted.

32 changes: 32 additions & 0 deletions .github/workflows/update-lockfile-bot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Update Lockfile Bot

on:
workflow_dispatch:

permissions:
contents: write
pull-requests: write

jobs:
lock:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v3
with:
enable-cache: true
cache-dependency-glob: "uv.lock"

- name: Set up Python
run: uv python install 3.12

- name: Install the package locally and update lockfile
run: |
# Install all default extras.
XDSL_VERSION_OVERRIDE="0+dynamic" make venv
- uses: EndBug/add-and-commit@v9
with:
add: uv.lock
21 changes: 20 additions & 1 deletion tests/filecheck/dialects/llvm/invalid.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,29 @@ builtin.module {
// CHECK: Varargs specifier `...` must be at the end of the argument definition

// -----
// CHECK: -----

builtin.module {
%cc = "test.op"() {"cconv" = #llvm.cconv<invalid>} : () -> ()
}

// CHECK: Unknown calling convention

// -----

func.func public @main() {
%0 = "test.op"() : () -> (!llvm.struct<(i32)>)
%1 = "llvm.extractvalue"(%0) {"position" = array<i32: 0>} : (!llvm.struct<(i32)>) -> i32
func.return
}

// CHECK: Expected attribute i64 but got i32

// -----

func.func public @main() {
%0, %1 = "test.op"() : () -> (!llvm.struct<(i32)>, i32)
%2 = "llvm.insertvalue"(%0, %1) {"position" = array<i32: 0>} : (!llvm.struct<(i32)>, i32) -> !llvm.struct<(i32)>
func.return
}

// CHECK: Expected attribute i64 but got i32
4 changes: 4 additions & 0 deletions xdsl/dialects/builtin.py
Original file line number Diff line number Diff line change
Expand Up @@ -1248,6 +1248,10 @@ def __len__(self) -> int:
return len(self.data.data) // self.elt_type.size


DenseI64ArrayConstr = ParamAttrConstraint(DenseArrayBase, [i64, BytesAttr])
"""Type constraint for DenseArrays containing integers of i64 integers."""


@irdl_attr_definition
class FunctionType(ParametrizedAttribute, TypeAttribute):
name = "fun"
Expand Down
5 changes: 3 additions & 2 deletions xdsl/dialects/llvm.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
ArrayAttr,
ContainerType,
DenseArrayBase,
DenseI64ArrayConstr,
IndexType,
IntAttr,
IntegerAttr,
Expand Down Expand Up @@ -1262,7 +1263,7 @@ class ExtractValueOp(IRDLOperation):

name = "llvm.extractvalue"

position = prop_def(DenseArrayBase)
position = prop_def(DenseI64ArrayConstr)
container = operand_def(Attribute)

res = result_def(Attribute)
Expand Down Expand Up @@ -1292,7 +1293,7 @@ class InsertValueOp(IRDLOperation):

name = "llvm.insertvalue"

position = prop_def(DenseArrayBase)
position = prop_def(DenseI64ArrayConstr)
container = operand_def(Attribute)
value = operand_def(Attribute)

Expand Down

0 comments on commit e11ef24

Please sign in to comment.