From da681b2abee40539b74f70bf4a70fc3e6ba14a99 Mon Sep 17 00:00:00 2001 From: Josse Van Delm Date: Thu, 22 Feb 2024 15:10:26 +0100 Subject: [PATCH] Make UnitAttrs attributes iso props --- xdsl/dialects/llvm.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/xdsl/dialects/llvm.py b/xdsl/dialects/llvm.py index ea62f4b73c..4e50e31cd1 100644 --- a/xdsl/dialects/llvm.py +++ b/xdsl/dialects/llvm.py @@ -45,6 +45,7 @@ irdl_attr_definition, irdl_op_definition, operand_def, + opt_attr_def, opt_operand_def, opt_prop_def, opt_result_def, @@ -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, @@ -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, )