Skip to content

Irdl

irdl

Definition of the IRDL dialect.

IRDL = Dialect('irdl', [DialectOp, TypeOp, CPredOp, AttributeOp, BaseOp, ParametersOp, OperationOp, OperandsOp, ResultsOp, AttributesOp, RegionsOp, IsOp, ParametricOp, RegionOp, AnyOp, AnyOfOp, AllOfOp], [AttributeType, RegionType, VariadicityAttr, VariadicityArrayAttr]) module-attribute

VariadicityEnum

Bases: StrEnum

Source code in xdsl/dialects/irdl/irdl.py
57
58
59
60
class VariadicityEnum(StrEnum):
    SINGLE = "single"
    OPTIONAL = "optional"
    VARIADIC = "variadic"

SINGLE = 'single' class-attribute instance-attribute

OPTIONAL = 'optional' class-attribute instance-attribute

VARIADIC = 'variadic' class-attribute instance-attribute

VariadicityAttr dataclass

Bases: EnumAttribute[VariadicityEnum], SpacedOpaqueSyntaxAttribute

Source code in xdsl/dialects/irdl/irdl.py
63
64
65
66
67
68
69
@irdl_attr_definition
class VariadicityAttr(EnumAttribute[VariadicityEnum], SpacedOpaqueSyntaxAttribute):
    name = "irdl.variadicity"

    SINGLE: ClassVar[VariadicityAttr]
    OPTIONAL: ClassVar[VariadicityAttr]
    VARIADIC: ClassVar[VariadicityAttr]

name = 'irdl.variadicity' class-attribute instance-attribute

SINGLE: VariadicityAttr class-attribute

OPTIONAL: VariadicityAttr class-attribute

VARIADIC: VariadicityAttr class-attribute

VariadicityArrayAttr dataclass

Bases: ParametrizedAttribute, SpacedOpaqueSyntaxAttribute

Source code in xdsl/dialects/irdl/irdl.py
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
@irdl_attr_definition
class VariadicityArrayAttr(ParametrizedAttribute, SpacedOpaqueSyntaxAttribute):
    name = "irdl.variadicity_array"

    value: ArrayAttr[VariadicityAttr]

    @classmethod
    def parse_parameters(cls, parser: AttrParser) -> tuple[ArrayAttr[VariadicityAttr]]:
        data = parser.parse_comma_separated_list(
            AttrParser.Delimiter.SQUARE, lambda: VariadicityAttr.parse_parameter(parser)
        )
        return (ArrayAttr(VariadicityAttr(x) for x in data),)

    def print_parameters(self, printer: Printer) -> None:
        printer.print_string("[")
        printer.print_list(self.value, lambda var: var.print_parameter(printer))
        printer.print_string("]")

name = 'irdl.variadicity_array' class-attribute instance-attribute

value: ArrayAttr[VariadicityAttr] instance-attribute

parse_parameters(parser: AttrParser) -> tuple[ArrayAttr[VariadicityAttr]] classmethod

Source code in xdsl/dialects/irdl/irdl.py
83
84
85
86
87
88
@classmethod
def parse_parameters(cls, parser: AttrParser) -> tuple[ArrayAttr[VariadicityAttr]]:
    data = parser.parse_comma_separated_list(
        AttrParser.Delimiter.SQUARE, lambda: VariadicityAttr.parse_parameter(parser)
    )
    return (ArrayAttr(VariadicityAttr(x) for x in data),)

print_parameters(printer: Printer) -> None

Source code in xdsl/dialects/irdl/irdl.py
90
91
92
93
def print_parameters(self, printer: Printer) -> None:
    printer.print_string("[")
    printer.print_list(self.value, lambda var: var.print_parameter(printer))
    printer.print_string("]")

AttributeType dataclass

Bases: ParametrizedAttribute, TypeAttribute

Type of a attribute handle.

Source code in xdsl/dialects/irdl/irdl.py
 96
 97
 98
 99
100
@irdl_attr_definition
class AttributeType(ParametrizedAttribute, TypeAttribute):
    """Type of a attribute handle."""

    name = "irdl.attribute"

name = 'irdl.attribute' class-attribute instance-attribute

RegionType dataclass

Bases: ParametrizedAttribute, TypeAttribute

IRDL handle to a region definition

Source code in xdsl/dialects/irdl/irdl.py
103
104
105
106
107
@irdl_attr_definition
class RegionType(ParametrizedAttribute, TypeAttribute):
    """IRDL handle to a region definition"""

    name = "irdl.region"

name = 'irdl.region' class-attribute instance-attribute

DialectOp

Bases: IRDLOperation

A dialect definition.

Source code in xdsl/dialects/irdl/irdl.py
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
@irdl_op_definition
class DialectOp(IRDLOperation):
    """A dialect definition."""

    name = "irdl.dialect"

    sym_name = attr_def(SymbolNameConstraint())
    body = region_def("single_block")

    traits = traits_def(NoTerminator(), SymbolOpInterface(), SymbolTable())

    def __init__(self, name: str | StringAttr, body: Region):
        if isinstance(name, str):
            name = StringAttr(name)
        super().__init__(attributes={"sym_name": name}, regions=[body])

    @classmethod
    def parse(cls, parser: Parser) -> DialectOp:
        sym_name = parser.parse_symbol_name()
        region = parser.parse_optional_region()
        if region is None:
            region = Region(Block())
        return DialectOp(sym_name, region)

    def print(self, printer: Printer) -> None:
        printer.print_string(" ")
        printer.print_symbol_name(self.sym_name.data)
        if self.body.block.ops:
            printer.print_string(" ")
            printer.print_region(self.body)

name = 'irdl.dialect' class-attribute instance-attribute

sym_name = attr_def(SymbolNameConstraint()) class-attribute instance-attribute

body = region_def('single_block') class-attribute instance-attribute

traits = traits_def(NoTerminator(), SymbolOpInterface(), SymbolTable()) class-attribute instance-attribute

__init__(name: str | StringAttr, body: Region)

Source code in xdsl/dialects/irdl/irdl.py
121
122
123
124
def __init__(self, name: str | StringAttr, body: Region):
    if isinstance(name, str):
        name = StringAttr(name)
    super().__init__(attributes={"sym_name": name}, regions=[body])

parse(parser: Parser) -> DialectOp classmethod

Source code in xdsl/dialects/irdl/irdl.py
126
127
128
129
130
131
132
@classmethod
def parse(cls, parser: Parser) -> DialectOp:
    sym_name = parser.parse_symbol_name()
    region = parser.parse_optional_region()
    if region is None:
        region = Region(Block())
    return DialectOp(sym_name, region)

print(printer: Printer) -> None

Source code in xdsl/dialects/irdl/irdl.py
134
135
136
137
138
139
def print(self, printer: Printer) -> None:
    printer.print_string(" ")
    printer.print_symbol_name(self.sym_name.data)
    if self.body.block.ops:
        printer.print_string(" ")
        printer.print_region(self.body)

TypeOp

Bases: IRDLOperation

A type definition.

Source code in xdsl/dialects/irdl/irdl.py
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
@irdl_op_definition
class TypeOp(IRDLOperation):
    """A type definition."""

    name = "irdl.type"

    sym_name = attr_def(SymbolNameConstraint())
    body = region_def("single_block")

    traits = traits_def(NoTerminator(), HasParent(DialectOp), SymbolOpInterface())

    def __init__(self, name: str | StringAttr, body: Region):
        if isinstance(name, str):
            name = StringAttr(name)
        super().__init__(attributes={"sym_name": name}, regions=[body])

    @classmethod
    def parse(cls, parser: Parser) -> TypeOp:
        sym_name = parser.parse_symbol_name()
        region = parser.parse_optional_region()
        if region is None:
            region = Region(Block())
        return TypeOp(sym_name, region)

    def print(self, printer: Printer) -> None:
        printer.print_string(" ")
        printer.print_symbol_name(self.sym_name.data)
        if self.body.block.ops:
            printer.print_string(" ")
            printer.print_region(self.body)

    @property
    def qualified_name(self):
        dialect_op = self.parent_op()
        if not isinstance(dialect_op, DialectOp):
            raise ValueError("Tried to get qualified name of an unverified TypeOp")
        return f"{dialect_op.sym_name.data}.{self.sym_name.data}"

name = 'irdl.type' class-attribute instance-attribute

sym_name = attr_def(SymbolNameConstraint()) class-attribute instance-attribute

body = region_def('single_block') class-attribute instance-attribute

traits = traits_def(NoTerminator(), HasParent(DialectOp), SymbolOpInterface()) class-attribute instance-attribute

qualified_name property

__init__(name: str | StringAttr, body: Region)

Source code in xdsl/dialects/irdl/irdl.py
153
154
155
156
def __init__(self, name: str | StringAttr, body: Region):
    if isinstance(name, str):
        name = StringAttr(name)
    super().__init__(attributes={"sym_name": name}, regions=[body])

parse(parser: Parser) -> TypeOp classmethod

Source code in xdsl/dialects/irdl/irdl.py
158
159
160
161
162
163
164
@classmethod
def parse(cls, parser: Parser) -> TypeOp:
    sym_name = parser.parse_symbol_name()
    region = parser.parse_optional_region()
    if region is None:
        region = Region(Block())
    return TypeOp(sym_name, region)

print(printer: Printer) -> None

Source code in xdsl/dialects/irdl/irdl.py
166
167
168
169
170
171
def print(self, printer: Printer) -> None:
    printer.print_string(" ")
    printer.print_symbol_name(self.sym_name.data)
    if self.body.block.ops:
        printer.print_string(" ")
        printer.print_region(self.body)

CPredOp

Bases: IRDLOperation

Constraints an attribute using a C++ predicate

Source code in xdsl/dialects/irdl/irdl.py
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
@irdl_op_definition
class CPredOp(IRDLOperation):
    """Constraints an attribute using a C++ predicate"""

    name = "irdl.c_pred"

    pred = attr_def(StringAttr)

    output = result_def(AttributeType())

    assembly_format = "$pred attr-dict"

    def __init__(self, pred: str | StringAttr):
        if isinstance(pred, str):
            pred = StringAttr(pred)
        super().__init__(attributes={"pred": pred}, result_types=[AttributeType()])

name = 'irdl.c_pred' class-attribute instance-attribute

pred = attr_def(StringAttr) class-attribute instance-attribute

output = result_def(AttributeType()) class-attribute instance-attribute

assembly_format = '$pred attr-dict' class-attribute instance-attribute

__init__(pred: str | StringAttr)

Source code in xdsl/dialects/irdl/irdl.py
193
194
195
196
def __init__(self, pred: str | StringAttr):
    if isinstance(pred, str):
        pred = StringAttr(pred)
    super().__init__(attributes={"pred": pred}, result_types=[AttributeType()])

AttributeOp

Bases: IRDLOperation

An attribute definition.

Source code in xdsl/dialects/irdl/irdl.py
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
@irdl_op_definition
class AttributeOp(IRDLOperation):
    """An attribute definition."""

    name = "irdl.attribute"

    sym_name = attr_def(SymbolNameConstraint())
    body = region_def("single_block")

    traits = traits_def(NoTerminator(), HasParent(DialectOp), SymbolOpInterface())

    def __init__(self, name: str | StringAttr, body: Region):
        if isinstance(name, str):
            name = StringAttr(name)
        super().__init__(attributes={"sym_name": name}, regions=[body])

    @classmethod
    def parse(cls, parser: Parser) -> AttributeOp:
        sym_name = parser.parse_symbol_name()
        region = parser.parse_optional_region()
        if region is None:
            region = Region(Block())
        return AttributeOp(sym_name, region)

    def print(self, printer: Printer) -> None:
        printer.print_string(" ")
        printer.print_symbol_name(self.sym_name.data)
        if self.body.block.ops:
            printer.print_string(" ")
            printer.print_region(self.body)

    @property
    def qualified_name(self):
        dialect_op = self.parent_op()
        if not isinstance(dialect_op, DialectOp):
            raise ValueError("Tried to get qualified name of an unverified AttributeOp")
        return f"{dialect_op.sym_name.data}.{self.sym_name.data}"

name = 'irdl.attribute' class-attribute instance-attribute

sym_name = attr_def(SymbolNameConstraint()) class-attribute instance-attribute

body = region_def('single_block') class-attribute instance-attribute

traits = traits_def(NoTerminator(), HasParent(DialectOp), SymbolOpInterface()) class-attribute instance-attribute

qualified_name property

__init__(name: str | StringAttr, body: Region)

Source code in xdsl/dialects/irdl/irdl.py
210
211
212
213
def __init__(self, name: str | StringAttr, body: Region):
    if isinstance(name, str):
        name = StringAttr(name)
    super().__init__(attributes={"sym_name": name}, regions=[body])

parse(parser: Parser) -> AttributeOp classmethod

Source code in xdsl/dialects/irdl/irdl.py
215
216
217
218
219
220
221
@classmethod
def parse(cls, parser: Parser) -> AttributeOp:
    sym_name = parser.parse_symbol_name()
    region = parser.parse_optional_region()
    if region is None:
        region = Region(Block())
    return AttributeOp(sym_name, region)

print(printer: Printer) -> None

Source code in xdsl/dialects/irdl/irdl.py
223
224
225
226
227
228
def print(self, printer: Printer) -> None:
    printer.print_string(" ")
    printer.print_symbol_name(self.sym_name.data)
    if self.body.block.ops:
        printer.print_string(" ")
        printer.print_region(self.body)

ParametersOp

Bases: IRDLOperation

An attribute or type parameter definition

Source code in xdsl/dialects/irdl/irdl.py
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
@irdl_op_definition
class ParametersOp(IRDLOperation):
    """An attribute or type parameter definition"""

    name = "irdl.parameters"

    args = var_operand_def(AttributeType)

    names = prop_def(ArrayAttr[StringAttr])

    traits = traits_def(HasParent(TypeOp, AttributeOp))

    def __init__(self, args: Sequence[SSAValue], names: ArrayAttr[StringAttr]):
        super().__init__(operands=[args], properties={"names": names})

    @classmethod
    def parse(cls, parser: Parser) -> ParametersOp:
        args = parser.parse_comma_separated_list(
            parser.Delimiter.PAREN, lambda: _parse_argument(parser)
        )
        return ParametersOp(
            tuple(x[1] for x in args),
            ArrayAttr(x[0] for x in args),
        )

    def print(self, printer: Printer) -> None:
        with printer.in_parens():
            printer.print_list(
                zip(self.names, self.args), lambda x: _print_argument(printer, x)
            )

name = 'irdl.parameters' class-attribute instance-attribute

args = var_operand_def(AttributeType) class-attribute instance-attribute

names = prop_def(ArrayAttr[StringAttr]) class-attribute instance-attribute

traits = traits_def(HasParent(TypeOp, AttributeOp)) class-attribute instance-attribute

__init__(args: Sequence[SSAValue], names: ArrayAttr[StringAttr])

Source code in xdsl/dialects/irdl/irdl.py
265
266
def __init__(self, args: Sequence[SSAValue], names: ArrayAttr[StringAttr]):
    super().__init__(operands=[args], properties={"names": names})

parse(parser: Parser) -> ParametersOp classmethod

Source code in xdsl/dialects/irdl/irdl.py
268
269
270
271
272
273
274
275
276
@classmethod
def parse(cls, parser: Parser) -> ParametersOp:
    args = parser.parse_comma_separated_list(
        parser.Delimiter.PAREN, lambda: _parse_argument(parser)
    )
    return ParametersOp(
        tuple(x[1] for x in args),
        ArrayAttr(x[0] for x in args),
    )

print(printer: Printer) -> None

Source code in xdsl/dialects/irdl/irdl.py
278
279
280
281
282
def print(self, printer: Printer) -> None:
    with printer.in_parens():
        printer.print_list(
            zip(self.names, self.args), lambda x: _print_argument(printer, x)
        )

OperationOp

Bases: IRDLOperation

An operation definition.

Source code in xdsl/dialects/irdl/irdl.py
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
@irdl_op_definition
class OperationOp(IRDLOperation):
    """An operation definition."""

    name = "irdl.operation"

    sym_name = attr_def(SymbolNameConstraint())
    body = region_def("single_block")

    traits = traits_def(NoTerminator(), HasParent(DialectOp), SymbolOpInterface())

    def __init__(self, name: str | StringAttr, body: Region):
        if isinstance(name, str):
            name = StringAttr(name)
        super().__init__(attributes={"sym_name": name}, regions=[body])

    @classmethod
    def parse(cls, parser: Parser) -> OperationOp:
        sym_name = parser.parse_symbol_name()
        region = parser.parse_optional_region()
        if region is None:
            region = Region(Block())
        return OperationOp(sym_name, region)

    def print(self, printer: Printer) -> None:
        printer.print_string(" ")
        printer.print_symbol_name(self.sym_name.data)
        if self.body.block.ops:
            printer.print_string(" ")
            printer.print_region(self.body)

    @property
    def qualified_name(self):
        dialect_op = self.parent_op()
        if not isinstance(dialect_op, DialectOp):
            raise ValueError("Tried to get qualified name of an unverified OperationOp")
        return f"{dialect_op.sym_name.data}.{self.sym_name.data}"

    def get_py_class_name(self) -> str:
        return (
            "".join(
                y[:1].upper() + y[1:]
                for x in self.sym_name.data.split(".")
                for y in x.split("_")
            )
            + "Op"
        )

name = 'irdl.operation' class-attribute instance-attribute

sym_name = attr_def(SymbolNameConstraint()) class-attribute instance-attribute

body = region_def('single_block') class-attribute instance-attribute

traits = traits_def(NoTerminator(), HasParent(DialectOp), SymbolOpInterface()) class-attribute instance-attribute

qualified_name property

__init__(name: str | StringAttr, body: Region)

Source code in xdsl/dialects/irdl/irdl.py
296
297
298
299
def __init__(self, name: str | StringAttr, body: Region):
    if isinstance(name, str):
        name = StringAttr(name)
    super().__init__(attributes={"sym_name": name}, regions=[body])

parse(parser: Parser) -> OperationOp classmethod

Source code in xdsl/dialects/irdl/irdl.py
301
302
303
304
305
306
307
@classmethod
def parse(cls, parser: Parser) -> OperationOp:
    sym_name = parser.parse_symbol_name()
    region = parser.parse_optional_region()
    if region is None:
        region = Region(Block())
    return OperationOp(sym_name, region)

print(printer: Printer) -> None

Source code in xdsl/dialects/irdl/irdl.py
309
310
311
312
313
314
def print(self, printer: Printer) -> None:
    printer.print_string(" ")
    printer.print_symbol_name(self.sym_name.data)
    if self.body.block.ops:
        printer.print_string(" ")
        printer.print_region(self.body)

get_py_class_name() -> str

Source code in xdsl/dialects/irdl/irdl.py
323
324
325
326
327
328
329
330
331
def get_py_class_name(self) -> str:
    return (
        "".join(
            y[:1].upper() + y[1:]
            for x in self.sym_name.data.split(".")
            for y in x.split("_")
        )
        + "Op"
    )

OperandsOp

Bases: IRDLOperation

An operation operand definition.

Source code in xdsl/dialects/irdl/irdl.py
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
@irdl_op_definition
class OperandsOp(IRDLOperation):
    """An operation operand definition."""

    name = "irdl.operands"

    args = var_operand_def(AttributeType)

    variadicity = prop_def(VariadicityArrayAttr)

    names = prop_def(ArrayAttr[StringAttr])

    traits = traits_def(HasParent(OperationOp))

    def __init__(
        self,
        operands: Sequence[SSAValue],
        variadicity: VariadicityArrayAttr,
        names: ArrayAttr[StringAttr],
    ):
        properties = {
            "variadicity": variadicity,
            "names": names,
        }
        super().__init__(operands=[operands], properties=properties)

    @classmethod
    def parse(cls, parser: Parser) -> OperandsOp:
        args = parser.parse_comma_separated_list(
            parser.Delimiter.PAREN, lambda: _parse_argument_with_var(parser)
        )
        return OperandsOp(
            tuple(x[2] for x in args),
            VariadicityArrayAttr(ArrayAttr(x[1] for x in args)),
            ArrayAttr(x[0] for x in args),
        )

    def print(self, printer: Printer) -> None:
        with printer.in_parens():
            printer.print_list(
                zip(self.names, self.variadicity.value, self.args),
                lambda x: _print_argument_with_var(printer, x),
                ", ",
            )

name = 'irdl.operands' class-attribute instance-attribute

args = var_operand_def(AttributeType) class-attribute instance-attribute

variadicity = prop_def(VariadicityArrayAttr) class-attribute instance-attribute

names = prop_def(ArrayAttr[StringAttr]) class-attribute instance-attribute

traits = traits_def(HasParent(OperationOp)) class-attribute instance-attribute

__init__(operands: Sequence[SSAValue], variadicity: VariadicityArrayAttr, names: ArrayAttr[StringAttr])

Source code in xdsl/dialects/irdl/irdl.py
374
375
376
377
378
379
380
381
382
383
384
def __init__(
    self,
    operands: Sequence[SSAValue],
    variadicity: VariadicityArrayAttr,
    names: ArrayAttr[StringAttr],
):
    properties = {
        "variadicity": variadicity,
        "names": names,
    }
    super().__init__(operands=[operands], properties=properties)

parse(parser: Parser) -> OperandsOp classmethod

Source code in xdsl/dialects/irdl/irdl.py
386
387
388
389
390
391
392
393
394
395
@classmethod
def parse(cls, parser: Parser) -> OperandsOp:
    args = parser.parse_comma_separated_list(
        parser.Delimiter.PAREN, lambda: _parse_argument_with_var(parser)
    )
    return OperandsOp(
        tuple(x[2] for x in args),
        VariadicityArrayAttr(ArrayAttr(x[1] for x in args)),
        ArrayAttr(x[0] for x in args),
    )

print(printer: Printer) -> None

Source code in xdsl/dialects/irdl/irdl.py
397
398
399
400
401
402
403
def print(self, printer: Printer) -> None:
    with printer.in_parens():
        printer.print_list(
            zip(self.names, self.variadicity.value, self.args),
            lambda x: _print_argument_with_var(printer, x),
            ", ",
        )

ResultsOp

Bases: IRDLOperation

An operation result definition.

Source code in xdsl/dialects/irdl/irdl.py
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
@irdl_op_definition
class ResultsOp(IRDLOperation):
    """An operation result definition."""

    name = "irdl.results"

    args = var_operand_def(AttributeType)

    variadicity = prop_def(VariadicityArrayAttr)

    names = prop_def(ArrayAttr[StringAttr])

    traits = traits_def(HasParent(OperationOp))

    def __init__(
        self,
        operands: Sequence[SSAValue],
        variadicity: VariadicityArrayAttr,
        names: ArrayAttr[StringAttr],
    ):
        properties = {
            "variadicity": variadicity,
            "names": names,
        }
        super().__init__(operands=[operands], properties=properties)

    @classmethod
    def parse(cls, parser: Parser) -> ResultsOp:
        args = parser.parse_comma_separated_list(
            parser.Delimiter.PAREN, lambda: _parse_argument_with_var(parser)
        )
        return ResultsOp(
            tuple(x[2] for x in args),
            VariadicityArrayAttr(ArrayAttr(x[1] for x in args)),
            ArrayAttr(x[0] for x in args),
        )

    def print(self, printer: Printer) -> None:
        with printer.in_parens():
            printer.print_list(
                zip(self.names, self.variadicity.value, self.args),
                lambda x: _print_argument_with_var(printer, x),
                ", ",
            )

name = 'irdl.results' class-attribute instance-attribute

args = var_operand_def(AttributeType) class-attribute instance-attribute

variadicity = prop_def(VariadicityArrayAttr) class-attribute instance-attribute

names = prop_def(ArrayAttr[StringAttr]) class-attribute instance-attribute

traits = traits_def(HasParent(OperationOp)) class-attribute instance-attribute

__init__(operands: Sequence[SSAValue], variadicity: VariadicityArrayAttr, names: ArrayAttr[StringAttr])

Source code in xdsl/dialects/irdl/irdl.py
420
421
422
423
424
425
426
427
428
429
430
def __init__(
    self,
    operands: Sequence[SSAValue],
    variadicity: VariadicityArrayAttr,
    names: ArrayAttr[StringAttr],
):
    properties = {
        "variadicity": variadicity,
        "names": names,
    }
    super().__init__(operands=[operands], properties=properties)

parse(parser: Parser) -> ResultsOp classmethod

Source code in xdsl/dialects/irdl/irdl.py
432
433
434
435
436
437
438
439
440
441
@classmethod
def parse(cls, parser: Parser) -> ResultsOp:
    args = parser.parse_comma_separated_list(
        parser.Delimiter.PAREN, lambda: _parse_argument_with_var(parser)
    )
    return ResultsOp(
        tuple(x[2] for x in args),
        VariadicityArrayAttr(ArrayAttr(x[1] for x in args)),
        ArrayAttr(x[0] for x in args),
    )

print(printer: Printer) -> None

Source code in xdsl/dialects/irdl/irdl.py
443
444
445
446
447
448
449
def print(self, printer: Printer) -> None:
    with printer.in_parens():
        printer.print_list(
            zip(self.names, self.variadicity.value, self.args),
            lambda x: _print_argument_with_var(printer, x),
            ", ",
        )

AttributesOp

Bases: IRDLOperation

Define the attributes of an operation

Source code in xdsl/dialects/irdl/irdl.py
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
@irdl_op_definition
class AttributesOp(IRDLOperation):
    """Define the attributes of an operation"""

    name = "irdl.attributes"

    attribute_values = var_operand_def(AttributeType())

    attribute_value_names = attr_def(ArrayAttr[StringAttr])

    def __init__(
        self,
        attribute_values: Sequence[SSAValue],
        attribute_value_names: ArrayAttr[StringAttr],
    ):
        super().__init__(
            operands=(attribute_values,),
            attributes={"attribute_value_names": attribute_value_names},
        )

    @classmethod
    def get(cls, attributes: dict[str, SSAValue]) -> AttributesOp:
        operands = tuple(attributes.values())
        names = ArrayAttr(StringAttr(x) for x in attributes.keys())
        return AttributesOp(operands, names)

    @classmethod
    def parse(cls, parser: Parser) -> AttributesOp:
        tuples = parser.parse_optional_comma_separated_list(
            parser.Delimiter.BRACES, lambda: _parse_attribute(parser)
        )
        if tuples is None:
            return AttributesOp.get(dict())
        return AttributesOp.get(dict(tuples))

    def print(self, printer: Printer) -> None:
        if not self.attribute_values:
            return
        with printer.indented():
            printer.print_string(" {\n")
            printer.print_list(
                zip(self.attribute_value_names, self.attribute_values),
                lambda x: _print_attribute(printer, x),
                ",\n",
            )
        printer.print_string("\n}")

    def verify_(self) -> None:
        if len(self.attribute_values) != len(self.attribute_value_names):
            raise VerifyException(
                (
                    "The number of attribute names and their constraints must be the same",
                    f"but got {len(self.attribute_value_names)} and {len(self.attribute_values)} respectively",
                )
            )

name = 'irdl.attributes' class-attribute instance-attribute

attribute_values = var_operand_def(AttributeType()) class-attribute instance-attribute

attribute_value_names = attr_def(ArrayAttr[StringAttr]) class-attribute instance-attribute

__init__(attribute_values: Sequence[SSAValue], attribute_value_names: ArrayAttr[StringAttr])

Source code in xdsl/dialects/irdl/irdl.py
476
477
478
479
480
481
482
483
484
def __init__(
    self,
    attribute_values: Sequence[SSAValue],
    attribute_value_names: ArrayAttr[StringAttr],
):
    super().__init__(
        operands=(attribute_values,),
        attributes={"attribute_value_names": attribute_value_names},
    )

get(attributes: dict[str, SSAValue]) -> AttributesOp classmethod

Source code in xdsl/dialects/irdl/irdl.py
486
487
488
489
490
@classmethod
def get(cls, attributes: dict[str, SSAValue]) -> AttributesOp:
    operands = tuple(attributes.values())
    names = ArrayAttr(StringAttr(x) for x in attributes.keys())
    return AttributesOp(operands, names)

parse(parser: Parser) -> AttributesOp classmethod

Source code in xdsl/dialects/irdl/irdl.py
492
493
494
495
496
497
498
499
@classmethod
def parse(cls, parser: Parser) -> AttributesOp:
    tuples = parser.parse_optional_comma_separated_list(
        parser.Delimiter.BRACES, lambda: _parse_attribute(parser)
    )
    if tuples is None:
        return AttributesOp.get(dict())
    return AttributesOp.get(dict(tuples))

print(printer: Printer) -> None

Source code in xdsl/dialects/irdl/irdl.py
501
502
503
504
505
506
507
508
509
510
511
def print(self, printer: Printer) -> None:
    if not self.attribute_values:
        return
    with printer.indented():
        printer.print_string(" {\n")
        printer.print_list(
            zip(self.attribute_value_names, self.attribute_values),
            lambda x: _print_attribute(printer, x),
            ",\n",
        )
    printer.print_string("\n}")

verify_() -> None

Source code in xdsl/dialects/irdl/irdl.py
513
514
515
516
517
518
519
520
def verify_(self) -> None:
    if len(self.attribute_values) != len(self.attribute_value_names):
        raise VerifyException(
            (
                "The number of attribute names and their constraints must be the same",
                f"but got {len(self.attribute_value_names)} and {len(self.attribute_values)} respectively",
            )
        )

RegionsOp

Bases: IRDLOperation

Define the regions of an operation

Source code in xdsl/dialects/irdl/irdl.py
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
@irdl_op_definition
class RegionsOp(IRDLOperation):
    """Define the regions of an operation"""

    name = "irdl.regions"

    args = var_operand_def(RegionType())

    names = prop_def(ArrayAttr[StringAttr])

    def __init__(self, args: Sequence[SSAValue], names: ArrayAttr[StringAttr]):
        super().__init__(operands=[args], properties={"names": names})

    @classmethod
    def parse(cls, parser: Parser) -> RegionsOp:
        args = parser.parse_comma_separated_list(
            parser.Delimiter.PAREN, lambda: _parse_argument(parser)
        )
        return RegionsOp(
            tuple(x[1] for x in args),
            ArrayAttr(x[0] for x in args),
        )

    def print(self, printer: Printer) -> None:
        with printer.in_parens():
            printer.print_list(
                zip(self.names, self.args), lambda x: _print_argument(printer, x)
            )

name = 'irdl.regions' class-attribute instance-attribute

args = var_operand_def(RegionType()) class-attribute instance-attribute

names = prop_def(ArrayAttr[StringAttr]) class-attribute instance-attribute

__init__(args: Sequence[SSAValue], names: ArrayAttr[StringAttr])

Source code in xdsl/dialects/irdl/irdl.py
533
534
def __init__(self, args: Sequence[SSAValue], names: ArrayAttr[StringAttr]):
    super().__init__(operands=[args], properties={"names": names})

parse(parser: Parser) -> RegionsOp classmethod

Source code in xdsl/dialects/irdl/irdl.py
536
537
538
539
540
541
542
543
544
@classmethod
def parse(cls, parser: Parser) -> RegionsOp:
    args = parser.parse_comma_separated_list(
        parser.Delimiter.PAREN, lambda: _parse_argument(parser)
    )
    return RegionsOp(
        tuple(x[1] for x in args),
        ArrayAttr(x[0] for x in args),
    )

print(printer: Printer) -> None

Source code in xdsl/dialects/irdl/irdl.py
546
547
548
549
550
def print(self, printer: Printer) -> None:
    with printer.in_parens():
        printer.print_list(
            zip(self.names, self.args), lambda x: _print_argument(printer, x)
        )

IsOp

Bases: IRDLOperation

Constraint an attribute/type to be a specific attribute instance.

Source code in xdsl/dialects/irdl/irdl.py
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
@irdl_op_definition
class IsOp(IRDLOperation):
    """Constraint an attribute/type to be a specific attribute instance."""

    name = "irdl.is"

    expected = attr_def()
    output = result_def(AttributeType)

    def __init__(self, expected: Attribute):
        super().__init__(
            attributes={"expected": expected}, result_types=[AttributeType()]
        )

    @classmethod
    def parse(cls, parser: Parser) -> IsOp:
        expected = parser.parse_attribute()
        return IsOp(expected)

    def print(self, printer: Printer) -> None:
        printer.print_string(" ")
        printer.print_attribute(self.expected)

name = 'irdl.is' class-attribute instance-attribute

expected = attr_def() class-attribute instance-attribute

output = result_def(AttributeType) class-attribute instance-attribute

__init__(expected: Attribute)

Source code in xdsl/dialects/irdl/irdl.py
567
568
569
570
def __init__(self, expected: Attribute):
    super().__init__(
        attributes={"expected": expected}, result_types=[AttributeType()]
    )

parse(parser: Parser) -> IsOp classmethod

Source code in xdsl/dialects/irdl/irdl.py
572
573
574
575
@classmethod
def parse(cls, parser: Parser) -> IsOp:
    expected = parser.parse_attribute()
    return IsOp(expected)

print(printer: Printer) -> None

Source code in xdsl/dialects/irdl/irdl.py
577
578
579
def print(self, printer: Printer) -> None:
    printer.print_string(" ")
    printer.print_attribute(self.expected)

BaseOp

Bases: IRDLOperation

Constraint an attribute/type base

Source code in xdsl/dialects/irdl/irdl.py
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
@irdl_op_definition
class BaseOp(IRDLOperation):
    """Constraint an attribute/type base"""

    name = "irdl.base"

    base_ref = opt_attr_def(SymbolRefAttr)
    base_name = opt_attr_def(StringAttr)
    output = result_def(AttributeType)

    def __init__(
        self,
        base: SymbolRefAttr | str | StringAttr,
        attr_dict: Mapping[str, Attribute] | None = None,
    ):
        attr_dict = attr_dict or {}
        if isinstance(base, str):
            base = StringAttr(base)
        if isinstance(base, StringAttr):
            super().__init__(
                attributes={"base_name": base, **attr_dict},
                result_types=[AttributeType()],
            )
        else:
            super().__init__(
                attributes={"base_ref": base, **attr_dict},
                result_types=[AttributeType()],
            )

    @classmethod
    def parse(cls, parser: Parser) -> BaseOp:
        attr = parser.parse_attribute()
        if not isinstance(attr, SymbolRefAttr | StringAttr):
            parser.raise_error("expected symbol reference or string")
        attr_dict = parser.parse_optional_attr_dict()
        return BaseOp(attr, attr_dict)

    def print(self, printer: Printer) -> None:
        if self.base_ref is not None:
            printer.print_string(" ")
            printer.print_attribute(self.base_ref)
        elif self.base_name is not None:
            printer.print_string(" ")
            printer.print_attribute(self.base_name)
        printer.print_op_attributes(self.attributes)

    def verify_(self) -> None:
        if not ((self.base_ref is None) ^ (self.base_name is None)):
            raise VerifyException("expected base as a reference or as a name")

name = 'irdl.base' class-attribute instance-attribute

base_ref = opt_attr_def(SymbolRefAttr) class-attribute instance-attribute

base_name = opt_attr_def(StringAttr) class-attribute instance-attribute

output = result_def(AttributeType) class-attribute instance-attribute

__init__(base: SymbolRefAttr | str | StringAttr, attr_dict: Mapping[str, Attribute] | None = None)

Source code in xdsl/dialects/irdl/irdl.py
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
def __init__(
    self,
    base: SymbolRefAttr | str | StringAttr,
    attr_dict: Mapping[str, Attribute] | None = None,
):
    attr_dict = attr_dict or {}
    if isinstance(base, str):
        base = StringAttr(base)
    if isinstance(base, StringAttr):
        super().__init__(
            attributes={"base_name": base, **attr_dict},
            result_types=[AttributeType()],
        )
    else:
        super().__init__(
            attributes={"base_ref": base, **attr_dict},
            result_types=[AttributeType()],
        )

parse(parser: Parser) -> BaseOp classmethod

Source code in xdsl/dialects/irdl/irdl.py
611
612
613
614
615
616
617
@classmethod
def parse(cls, parser: Parser) -> BaseOp:
    attr = parser.parse_attribute()
    if not isinstance(attr, SymbolRefAttr | StringAttr):
        parser.raise_error("expected symbol reference or string")
    attr_dict = parser.parse_optional_attr_dict()
    return BaseOp(attr, attr_dict)

print(printer: Printer) -> None

Source code in xdsl/dialects/irdl/irdl.py
619
620
621
622
623
624
625
626
def print(self, printer: Printer) -> None:
    if self.base_ref is not None:
        printer.print_string(" ")
        printer.print_attribute(self.base_ref)
    elif self.base_name is not None:
        printer.print_string(" ")
        printer.print_attribute(self.base_name)
    printer.print_op_attributes(self.attributes)

verify_() -> None

Source code in xdsl/dialects/irdl/irdl.py
628
629
630
def verify_(self) -> None:
    if not ((self.base_ref is None) ^ (self.base_name is None)):
        raise VerifyException("expected base as a reference or as a name")

ParametricOp

Bases: IRDLOperation

Constraint an attribute/type base and its parameters

Source code in xdsl/dialects/irdl/irdl.py
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
@irdl_op_definition
class ParametricOp(IRDLOperation):
    """Constraint an attribute/type base and its parameters"""

    name = "irdl.parametric"

    base_type = attr_def(SymbolRefAttr)
    args = var_operand_def(AttributeType)
    output = result_def(AttributeType)

    def __init__(
        self, base_type: str | StringAttr | SymbolRefAttr, args: Sequence[SSAValue]
    ):
        if isinstance(base_type, str | StringAttr):
            base_type = SymbolRefAttr(base_type)
        super().__init__(
            attributes={"base_type": base_type},
            operands=[args],
            result_types=[AttributeType()],
        )

    @classmethod
    def parse(cls, parser: Parser) -> ParametricOp:
        base_type = parser.parse_attribute()
        if not isinstance(base_type, SymbolRefAttr):
            parser.raise_error("expected symbol reference")
        args = parser.parse_comma_separated_list(
            parser.Delimiter.ANGLE, parser.parse_operand
        )
        return ParametricOp(base_type, args)

    def print(self, printer: Printer) -> None:
        printer.print_string(" ")
        printer.print_attribute(self.base_type)
        with printer.in_angle_brackets():
            printer.print_list(self.args, printer.print_ssa_value)

name = 'irdl.parametric' class-attribute instance-attribute

base_type = attr_def(SymbolRefAttr) class-attribute instance-attribute

args = var_operand_def(AttributeType) class-attribute instance-attribute

output = result_def(AttributeType) class-attribute instance-attribute

__init__(base_type: str | StringAttr | SymbolRefAttr, args: Sequence[SSAValue])

Source code in xdsl/dialects/irdl/irdl.py
643
644
645
646
647
648
649
650
651
652
def __init__(
    self, base_type: str | StringAttr | SymbolRefAttr, args: Sequence[SSAValue]
):
    if isinstance(base_type, str | StringAttr):
        base_type = SymbolRefAttr(base_type)
    super().__init__(
        attributes={"base_type": base_type},
        operands=[args],
        result_types=[AttributeType()],
    )

parse(parser: Parser) -> ParametricOp classmethod

Source code in xdsl/dialects/irdl/irdl.py
654
655
656
657
658
659
660
661
662
@classmethod
def parse(cls, parser: Parser) -> ParametricOp:
    base_type = parser.parse_attribute()
    if not isinstance(base_type, SymbolRefAttr):
        parser.raise_error("expected symbol reference")
    args = parser.parse_comma_separated_list(
        parser.Delimiter.ANGLE, parser.parse_operand
    )
    return ParametricOp(base_type, args)

print(printer: Printer) -> None

Source code in xdsl/dialects/irdl/irdl.py
664
665
666
667
668
def print(self, printer: Printer) -> None:
    printer.print_string(" ")
    printer.print_attribute(self.base_type)
    with printer.in_angle_brackets():
        printer.print_list(self.args, printer.print_ssa_value)

RegionOp

Bases: IRDLOperation

Define a region of an operation

Source code in xdsl/dialects/irdl/irdl.py
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
@irdl_op_definition
class RegionOp(IRDLOperation):
    """Define a region of an operation"""

    name = "irdl.region"

    entry_block_args = var_operand_def(AttributeType())

    constrained_arguments = opt_attr_def(UnitAttr)

    number_of_blocks = opt_attr_def(IntegerAttr[I32])

    output = result_def(RegionType())

    assembly_format = (
        "(```(` $entry_block_args $constrained_arguments^ `)`)?"
        "(` ` `with` `size` $number_of_blocks^)? attr-dict"
    )

    def __init__(
        self,
        number_of_blocks: IntegerAttr[I32],
        entry_block_args: Sequence[SSAValue],
        constrained_arguments: UnitAttr | NoneType = None,
    ):
        attributes: dict[str, Attribute] = {
            "number_of_blocks": number_of_blocks,
        }
        if isinstance(constrained_arguments, UnitAttr):
            attributes["constrained_arguments"] = constrained_arguments
        super().__init__(operands=entry_block_args, attributes=attributes)

    def verify_(self) -> None:
        if len(self.entry_block_args) > 0 and not self.constrained_arguments:
            raise VerifyException(
                "constrained_arguments must be set when specifying arguments"
            )

name = 'irdl.region' class-attribute instance-attribute

entry_block_args = var_operand_def(AttributeType()) class-attribute instance-attribute

constrained_arguments = opt_attr_def(UnitAttr) class-attribute instance-attribute

number_of_blocks = opt_attr_def(IntegerAttr[I32]) class-attribute instance-attribute

output = result_def(RegionType()) class-attribute instance-attribute

assembly_format = '(```(` $entry_block_args $constrained_arguments^ `)`)?(` ` `with` `size` $number_of_blocks^)? attr-dict' class-attribute instance-attribute

__init__(number_of_blocks: IntegerAttr[I32], entry_block_args: Sequence[SSAValue], constrained_arguments: UnitAttr | NoneType = None)

Source code in xdsl/dialects/irdl/irdl.py
690
691
692
693
694
695
696
697
698
699
700
701
def __init__(
    self,
    number_of_blocks: IntegerAttr[I32],
    entry_block_args: Sequence[SSAValue],
    constrained_arguments: UnitAttr | NoneType = None,
):
    attributes: dict[str, Attribute] = {
        "number_of_blocks": number_of_blocks,
    }
    if isinstance(constrained_arguments, UnitAttr):
        attributes["constrained_arguments"] = constrained_arguments
    super().__init__(operands=entry_block_args, attributes=attributes)

verify_() -> None

Source code in xdsl/dialects/irdl/irdl.py
703
704
705
706
707
def verify_(self) -> None:
    if len(self.entry_block_args) > 0 and not self.constrained_arguments:
        raise VerifyException(
            "constrained_arguments must be set when specifying arguments"
        )

AnyOp

Bases: IRDLOperation

Constraint an attribute/type to be any attribute/type instance.

Source code in xdsl/dialects/irdl/irdl.py
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
@irdl_op_definition
class AnyOp(IRDLOperation):
    """Constraint an attribute/type to be any attribute/type instance."""

    name = "irdl.any"

    output = result_def(AttributeType)

    def __init__(self):
        super().__init__(result_types=[AttributeType()])

    @classmethod
    def parse(cls, parser: Parser) -> AnyOp:
        return AnyOp()

    def print(self, printer: Printer) -> None:
        pass

name = 'irdl.any' class-attribute instance-attribute

output = result_def(AttributeType) class-attribute instance-attribute

__init__()

Source code in xdsl/dialects/irdl/irdl.py
718
719
def __init__(self):
    super().__init__(result_types=[AttributeType()])

parse(parser: Parser) -> AnyOp classmethod

Source code in xdsl/dialects/irdl/irdl.py
721
722
723
@classmethod
def parse(cls, parser: Parser) -> AnyOp:
    return AnyOp()

print(printer: Printer) -> None

Source code in xdsl/dialects/irdl/irdl.py
725
726
def print(self, printer: Printer) -> None:
    pass

AnyOfOp

Bases: IRDLOperation

Constraint an attribute/type to the union of the provided constraints.

Source code in xdsl/dialects/irdl/irdl.py
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
@irdl_op_definition
class AnyOfOp(IRDLOperation):
    """Constraint an attribute/type to the union of the provided constraints."""

    name = "irdl.any_of"

    args = var_operand_def(AttributeType)
    output = result_def(AttributeType)

    def __init__(self, args: Sequence[SSAValue]):
        super().__init__(operands=[args], result_types=[AttributeType()])

    @classmethod
    def parse(cls, parser: Parser) -> AnyOfOp:
        args = parser.parse_comma_separated_list(
            parser.Delimiter.PAREN, parser.parse_operand
        )
        return AnyOfOp(args)

    def print(self, printer: Printer) -> None:
        with printer.in_parens():
            printer.print_list(self.args, printer.print_ssa_value)

name = 'irdl.any_of' class-attribute instance-attribute

args = var_operand_def(AttributeType) class-attribute instance-attribute

output = result_def(AttributeType) class-attribute instance-attribute

__init__(args: Sequence[SSAValue])

Source code in xdsl/dialects/irdl/irdl.py
738
739
def __init__(self, args: Sequence[SSAValue]):
    super().__init__(operands=[args], result_types=[AttributeType()])

parse(parser: Parser) -> AnyOfOp classmethod

Source code in xdsl/dialects/irdl/irdl.py
741
742
743
744
745
746
@classmethod
def parse(cls, parser: Parser) -> AnyOfOp:
    args = parser.parse_comma_separated_list(
        parser.Delimiter.PAREN, parser.parse_operand
    )
    return AnyOfOp(args)

print(printer: Printer) -> None

Source code in xdsl/dialects/irdl/irdl.py
748
749
750
def print(self, printer: Printer) -> None:
    with printer.in_parens():
        printer.print_list(self.args, printer.print_ssa_value)

AllOfOp

Bases: IRDLOperation

Constraint an attribute/type to the intersection of the provided constraints.

Source code in xdsl/dialects/irdl/irdl.py
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
@irdl_op_definition
class AllOfOp(IRDLOperation):
    """Constraint an attribute/type to the intersection of the provided constraints."""

    name = "irdl.all_of"

    args = var_operand_def(AttributeType)
    output = result_def(AttributeType)

    def __init__(self, args: Sequence[SSAValue]):
        super().__init__(operands=[args], result_types=[AttributeType()])

    @classmethod
    def parse(cls, parser: Parser) -> AllOfOp:
        args = parser.parse_comma_separated_list(
            parser.Delimiter.PAREN, parser.parse_operand
        )
        return AllOfOp(args)

    def print(self, printer: Printer) -> None:
        with printer.in_parens():
            printer.print_list(self.args, printer.print_ssa_value)

name = 'irdl.all_of' class-attribute instance-attribute

args = var_operand_def(AttributeType) class-attribute instance-attribute

output = result_def(AttributeType) class-attribute instance-attribute

__init__(args: Sequence[SSAValue])

Source code in xdsl/dialects/irdl/irdl.py
762
763
def __init__(self, args: Sequence[SSAValue]):
    super().__init__(operands=[args], result_types=[AttributeType()])

parse(parser: Parser) -> AllOfOp classmethod

Source code in xdsl/dialects/irdl/irdl.py
765
766
767
768
769
770
@classmethod
def parse(cls, parser: Parser) -> AllOfOp:
    args = parser.parse_comma_separated_list(
        parser.Delimiter.PAREN, parser.parse_operand
    )
    return AllOfOp(args)

print(printer: Printer) -> None

Source code in xdsl/dialects/irdl/irdl.py
772
773
774
def print(self, printer: Printer) -> None:
    with printer.in_parens():
        printer.print_list(self.args, printer.print_ssa_value)