Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dialects: Fix inline_asm unitattrs to not be properties #2223

Merged
merged 1 commit into from
Feb 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions xdsl/dialects/llvm.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
irdl_attr_definition,
irdl_op_definition,
operand_def,
opt_attr_def,
opt_operand_def,
opt_prop_def,
opt_result_def,
Expand Down Expand Up @@ -736,8 +737,9 @@ class InlineAsmOp(IRDLOperation):

asm_string: StringAttr = prop_def(StringAttr)
constraints: StringAttr = prop_def(StringAttr)
has_side_effects: UnitAttr | None = opt_prop_def(UnitAttr)
is_align_stack: UnitAttr | None = opt_prop_def(UnitAttr)

has_side_effects: UnitAttr | None = opt_attr_def(UnitAttr)
is_align_stack: UnitAttr | None = opt_attr_def(UnitAttr)

def __init__(
self,
Expand All @@ -754,13 +756,15 @@ def __init__(
"constraints": StringAttr(constraints),
"asm_dialect": IntegerAttr.from_int_and_width(asm_dialect, 64),
}
if has_side_effects:
props["has_side_effects"] = UnitAttr()
if is_align_stack:
props["is_align_stack"] = UnitAttr()

attrs = {
"has_side_effects": UnitAttr() if has_side_effects else None,
"is_align_stack": UnitAttr() if is_align_stack else None,
}

super().__init__(
operands=operands_,
attributes=attrs,
properties=props,
result_types=res_types,
)
Expand Down
Loading