Skip to content

Affine

affine

Affine = Dialect('affine', [ApplyOp, ForOp, ParallelOp, IfOp, StoreOp, LoadOp, MinOp, YieldOp], []) module-attribute

ApplyOp

Bases: IRDLOperation

Source code in xdsl/dialects/affine.py
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
@irdl_op_definition
class ApplyOp(IRDLOperation):
    name = "affine.apply"

    mapOperands = var_operand_def(IndexType)
    map = prop_def(AffineMapAttr)
    result = result_def(IndexType)

    traits = traits_def(Pure())

    def __init__(self, map_operands: Sequence[SSAValue], affine_map: AffineMapAttr):
        super().__init__(
            operands=[map_operands],
            properties={"map": affine_map},
            result_types=[IndexType()],
        )

    def verify_(self) -> None:
        if len(self.mapOperands) != self.map.data.num_dims + self.map.data.num_symbols:
            raise VerifyException(
                f"{self.name} expects "
                f"{self.map.data.num_dims + self.map.data.num_symbols} operands, but "
                f"got {len(self.mapOperands)}. The number of map operands must match "
                "the sum of the dimensions and symbols of its map."
            )
        if len(self.map.data.results) != 1:
            raise VerifyException("affine.apply expects a unidimensional map.")

    @classmethod
    def parse(cls, parser: Parser) -> ApplyOp:
        pos = parser.pos
        m = parser.parse_attribute()
        if not isinstance(m, AffineMapAttr):
            parser.raise_error("Expected affine map attr", at_position=pos)
        dims = parser.parse_optional_comma_separated_list(
            parser.Delimiter.PAREN, lambda: parser.parse_operand()
        )
        if dims is None:
            dims = []
        syms = parser.parse_optional_comma_separated_list(
            parser.Delimiter.SQUARE, lambda: parser.parse_operand()
        )
        if syms is None:
            syms = []
        return ApplyOp(dims + syms, m)

    def print(self, printer: Printer):
        m = self.map.data
        operands = tuple(self.mapOperands)
        assert len(operands) == m.num_dims + m.num_symbols, f"{len(operands)} {m}"
        printer.print_string(" ")
        printer.print_attribute(self.map)
        printer.print_string(" (")
        if m.num_dims:
            printer.print_list(
                operands[: m.num_dims], lambda el: printer.print_operand(el)
            )
        printer.print_string(")")

        if m.num_symbols:
            printer.print_string("[")
            printer.print_list(
                operands[m.num_dims :], lambda el: printer.print_operand(el)
            )
            printer.print_string("]")

name = 'affine.apply' class-attribute instance-attribute

mapOperands = var_operand_def(IndexType) class-attribute instance-attribute

map = prop_def(AffineMapAttr) class-attribute instance-attribute

result = result_def(IndexType) class-attribute instance-attribute

traits = traits_def(Pure()) class-attribute instance-attribute

__init__(map_operands: Sequence[SSAValue], affine_map: AffineMapAttr)

Source code in xdsl/dialects/affine.py
58
59
60
61
62
63
def __init__(self, map_operands: Sequence[SSAValue], affine_map: AffineMapAttr):
    super().__init__(
        operands=[map_operands],
        properties={"map": affine_map},
        result_types=[IndexType()],
    )

verify_() -> None

Source code in xdsl/dialects/affine.py
65
66
67
68
69
70
71
72
73
74
def verify_(self) -> None:
    if len(self.mapOperands) != self.map.data.num_dims + self.map.data.num_symbols:
        raise VerifyException(
            f"{self.name} expects "
            f"{self.map.data.num_dims + self.map.data.num_symbols} operands, but "
            f"got {len(self.mapOperands)}. The number of map operands must match "
            "the sum of the dimensions and symbols of its map."
        )
    if len(self.map.data.results) != 1:
        raise VerifyException("affine.apply expects a unidimensional map.")

parse(parser: Parser) -> ApplyOp classmethod

Source code in xdsl/dialects/affine.py
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
@classmethod
def parse(cls, parser: Parser) -> ApplyOp:
    pos = parser.pos
    m = parser.parse_attribute()
    if not isinstance(m, AffineMapAttr):
        parser.raise_error("Expected affine map attr", at_position=pos)
    dims = parser.parse_optional_comma_separated_list(
        parser.Delimiter.PAREN, lambda: parser.parse_operand()
    )
    if dims is None:
        dims = []
    syms = parser.parse_optional_comma_separated_list(
        parser.Delimiter.SQUARE, lambda: parser.parse_operand()
    )
    if syms is None:
        syms = []
    return ApplyOp(dims + syms, m)

print(printer: Printer)

Source code in xdsl/dialects/affine.py
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
def print(self, printer: Printer):
    m = self.map.data
    operands = tuple(self.mapOperands)
    assert len(operands) == m.num_dims + m.num_symbols, f"{len(operands)} {m}"
    printer.print_string(" ")
    printer.print_attribute(self.map)
    printer.print_string(" (")
    if m.num_dims:
        printer.print_list(
            operands[: m.num_dims], lambda el: printer.print_operand(el)
        )
    printer.print_string(")")

    if m.num_symbols:
        printer.print_string("[")
        printer.print_list(
            operands[m.num_dims :], lambda el: printer.print_operand(el)
        )
        printer.print_string("]")

ForOp dataclass

Bases: IRDLOperation

Source code in xdsl/dialects/affine.py
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
140
141
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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
@irdl_op_definition
class ForOp(IRDLOperation):
    name = "affine.for"

    lowerBoundOperands = var_operand_def(IndexType)
    upperBoundOperands = var_operand_def(IndexType)
    inits = var_operand_def()
    res = var_result_def()

    lowerBoundMap = prop_def(AffineMapAttr)
    upperBoundMap = prop_def(AffineMapAttr)
    step = prop_def(IntegerAttr)

    body = region_def()

    irdl_options = (AttrSizedOperandSegments(as_property=True),)

    # TODO this requires the ImplicitAffineTerminator trait instead of
    # NoTerminator
    # gh issue: https://github.com/xdslproject/xdsl/issues/1149

    def verify_(self) -> None:
        if len(self.inits) != len(self.results):
            raise VerifyException("Expected as many init operands as results.")
        if len(self.lowerBoundOperands) != (
            self.lowerBoundMap.data.num_dims + self.lowerBoundMap.data.num_symbols
        ):
            raise VerifyException(
                "Expected as many lower bound operands as lower bound dimensions and symbols."
            )
        if len(self.upperBoundOperands) != (
            self.upperBoundMap.data.num_dims + self.upperBoundMap.data.num_symbols
        ):
            raise VerifyException(
                "Expected as many upper bound operands as upper bound dimensions and symbols."
            )
        iter_types = self.inits.types
        if iter_types != self.result_types:
            raise VerifyException(
                "Expected all operands and result pairs to have matching types"
            )
        entry_block: Block = self.body.blocks[0]
        block_arg_types = (IndexType(), *iter_types)
        arg_types = entry_block.arg_types
        if block_arg_types != arg_types:
            raise VerifyException(
                "Expected BlockArguments to have the same types as the operands"
            )

    @staticmethod
    def from_region(
        lowerBoundOperands: Sequence[Operation | SSAValue],
        upperBoundOperands: Sequence[Operation | SSAValue],
        inits: Sequence[Operation | SSAValue],
        result_types: Sequence[Attribute],
        lower_bound: int | AffineMapAttr,
        upper_bound: int | AffineMapAttr,
        region: Region,
        step: int | IntegerAttr = 1,
    ) -> ForOp:
        if isinstance(lower_bound, int):
            lower_bound = AffineMapAttr(
                AffineMap(0, 0, (AffineExpr.constant(lower_bound),))
            )
        if isinstance(upper_bound, int):
            upper_bound = AffineMapAttr(
                AffineMap(0, 0, (AffineExpr.constant(upper_bound),))
            )
        if isinstance(step, int):
            step = IntegerAttr.from_index_int_value(step)
        properties: dict[str, Attribute] = {
            "lowerBoundMap": lower_bound,
            "upperBoundMap": upper_bound,
            "step": step,
        }
        return ForOp.build(
            operands=[lowerBoundOperands, upperBoundOperands, inits],
            result_types=[result_types],
            properties=properties,
            regions=[region],
        )

name = 'affine.for' class-attribute instance-attribute

lowerBoundOperands = var_operand_def(IndexType) class-attribute instance-attribute

upperBoundOperands = var_operand_def(IndexType) class-attribute instance-attribute

inits = var_operand_def() class-attribute instance-attribute

res = var_result_def() class-attribute instance-attribute

lowerBoundMap = prop_def(AffineMapAttr) class-attribute instance-attribute

upperBoundMap = prop_def(AffineMapAttr) class-attribute instance-attribute

step = prop_def(IntegerAttr) class-attribute instance-attribute

body = region_def() class-attribute instance-attribute

irdl_options = (AttrSizedOperandSegments(as_property=True),) class-attribute instance-attribute

verify_() -> None

Source code in xdsl/dialects/affine.py
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
def verify_(self) -> None:
    if len(self.inits) != len(self.results):
        raise VerifyException("Expected as many init operands as results.")
    if len(self.lowerBoundOperands) != (
        self.lowerBoundMap.data.num_dims + self.lowerBoundMap.data.num_symbols
    ):
        raise VerifyException(
            "Expected as many lower bound operands as lower bound dimensions and symbols."
        )
    if len(self.upperBoundOperands) != (
        self.upperBoundMap.data.num_dims + self.upperBoundMap.data.num_symbols
    ):
        raise VerifyException(
            "Expected as many upper bound operands as upper bound dimensions and symbols."
        )
    iter_types = self.inits.types
    if iter_types != self.result_types:
        raise VerifyException(
            "Expected all operands and result pairs to have matching types"
        )
    entry_block: Block = self.body.blocks[0]
    block_arg_types = (IndexType(), *iter_types)
    arg_types = entry_block.arg_types
    if block_arg_types != arg_types:
        raise VerifyException(
            "Expected BlockArguments to have the same types as the operands"
        )

from_region(lowerBoundOperands: Sequence[Operation | SSAValue], upperBoundOperands: Sequence[Operation | SSAValue], inits: Sequence[Operation | SSAValue], result_types: Sequence[Attribute], lower_bound: int | AffineMapAttr, upper_bound: int | AffineMapAttr, region: Region, step: int | IntegerAttr = 1) -> ForOp staticmethod

Source code in xdsl/dialects/affine.py
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
@staticmethod
def from_region(
    lowerBoundOperands: Sequence[Operation | SSAValue],
    upperBoundOperands: Sequence[Operation | SSAValue],
    inits: Sequence[Operation | SSAValue],
    result_types: Sequence[Attribute],
    lower_bound: int | AffineMapAttr,
    upper_bound: int | AffineMapAttr,
    region: Region,
    step: int | IntegerAttr = 1,
) -> ForOp:
    if isinstance(lower_bound, int):
        lower_bound = AffineMapAttr(
            AffineMap(0, 0, (AffineExpr.constant(lower_bound),))
        )
    if isinstance(upper_bound, int):
        upper_bound = AffineMapAttr(
            AffineMap(0, 0, (AffineExpr.constant(upper_bound),))
        )
    if isinstance(step, int):
        step = IntegerAttr.from_index_int_value(step)
    properties: dict[str, Attribute] = {
        "lowerBoundMap": lower_bound,
        "upperBoundMap": upper_bound,
        "step": step,
    }
    return ForOp.build(
        operands=[lowerBoundOperands, upperBoundOperands, inits],
        result_types=[result_types],
        properties=properties,
        regions=[region],
    )

IfOp dataclass

Bases: IRDLOperation

See external documentation.

Source code in xdsl/dialects/affine.py
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
@irdl_op_definition
class IfOp(IRDLOperation):
    """
    See external [documentation](https://mlir.llvm.org/docs/Dialects/Affine/#affineif-affineaffineifop).
    """

    name = "affine.if"

    args = var_operand_def(IndexType)
    res = var_result_def()

    condition = prop_def(AffineSetAttr)

    then_region = region_def("single_block")
    else_region = region_def()

    traits = traits_def(RecursiveMemoryEffect(), RecursivelySpeculatable())

name = 'affine.if' class-attribute instance-attribute

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

res = var_result_def() class-attribute instance-attribute

condition = prop_def(AffineSetAttr) class-attribute instance-attribute

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

else_region = region_def() class-attribute instance-attribute

traits = traits_def(RecursiveMemoryEffect(), RecursivelySpeculatable()) class-attribute instance-attribute

ParallelOp dataclass

Bases: IRDLOperation

See external documentation.

Source code in xdsl/dialects/affine.py
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
@irdl_op_definition
class ParallelOp(IRDLOperation):
    """
    See external [documentation](https://mlir.llvm.org/docs/Dialects/Affine/#affineparallel-affineaffineparallelop).
    """

    name = "affine.parallel"

    map_operands = var_operand_def(IndexType)

    reductions = prop_def(ArrayAttr[StringAttr])
    lowerBoundsMap = prop_def(AffineMapAttr)
    lowerBoundsGroups = prop_def(DenseIntElementsAttr)
    upperBoundsMap = prop_def(AffineMapAttr)
    upperBoundsGroups = prop_def(DenseIntElementsAttr)
    steps = prop_def(ArrayAttr[IntegerAttr[IntegerType]])

    res = var_result_def()

    body = region_def("single_block")

    def verify_(self) -> None:
        if (
            len(self.operands)
            != len(self.results)
            + self.lowerBoundsMap.data.num_dims
            + self.upperBoundsMap.data.num_dims
            + self.lowerBoundsMap.data.num_symbols
            + self.upperBoundsMap.data.num_symbols
        ):
            raise VerifyException(
                "Expected as many operands as results, lower bound args and upper bound args."
            )

        if sum(self.lowerBoundsGroups.get_values()) != len(
            self.lowerBoundsMap.data.results
        ):
            raise VerifyException("Expected a lower bound group for each lower bound")
        if sum(self.upperBoundsGroups.get_values()) != len(
            self.upperBoundsMap.data.results
        ):
            raise VerifyException("Expected an upper bound group for each upper bound")

name = 'affine.parallel' class-attribute instance-attribute

map_operands = var_operand_def(IndexType) class-attribute instance-attribute

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

lowerBoundsMap = prop_def(AffineMapAttr) class-attribute instance-attribute

lowerBoundsGroups = prop_def(DenseIntElementsAttr) class-attribute instance-attribute

upperBoundsMap = prop_def(AffineMapAttr) class-attribute instance-attribute

upperBoundsGroups = prop_def(DenseIntElementsAttr) class-attribute instance-attribute

steps = prop_def(ArrayAttr[IntegerAttr[IntegerType]]) class-attribute instance-attribute

res = var_result_def() class-attribute instance-attribute

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

verify_() -> None

Source code in xdsl/dialects/affine.py
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
def verify_(self) -> None:
    if (
        len(self.operands)
        != len(self.results)
        + self.lowerBoundsMap.data.num_dims
        + self.upperBoundsMap.data.num_dims
        + self.lowerBoundsMap.data.num_symbols
        + self.upperBoundsMap.data.num_symbols
    ):
        raise VerifyException(
            "Expected as many operands as results, lower bound args and upper bound args."
        )

    if sum(self.lowerBoundsGroups.get_values()) != len(
        self.lowerBoundsMap.data.results
    ):
        raise VerifyException("Expected a lower bound group for each lower bound")
    if sum(self.upperBoundsGroups.get_values()) != len(
        self.upperBoundsMap.data.results
    ):
        raise VerifyException("Expected an upper bound group for each upper bound")

StoreOp

Bases: IRDLOperation

Source code in xdsl/dialects/affine.py
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
@irdl_op_definition
class StoreOp(IRDLOperation):
    name = "affine.store"

    T: ClassVar = VarConstraint("T", AnyAttr())

    value = operand_def(T)
    memref = operand_def(MemRefType.constr(T))
    indices = var_operand_def(IndexType)
    map = opt_prop_def(AffineMapAttr)

    def __init__(
        self,
        value: SSAValue,
        memref: SSAValue,
        indices: Sequence[SSAValue],
        map: AffineMapAttr | None = None,
    ):
        if map is None:
            # Create identity map for memrefs with at least one dimension or () -> ()
            # for zero-dimensional memrefs.
            if not isinstance(memref_type := memref.type, MemRefType):
                raise ValueError(
                    "affine.store memref operand must be of type MemRefType"
                )
            rank = memref_type.get_num_dims()
            map = AffineMapAttr(AffineMap.identity(rank))
        super().__init__(
            operands=(value, memref, indices),
            properties={"map": map},
        )

name = 'affine.store' class-attribute instance-attribute

T: ClassVar = VarConstraint('T', AnyAttr()) class-attribute instance-attribute

value = operand_def(T) class-attribute instance-attribute

memref = operand_def(MemRefType.constr(T)) class-attribute instance-attribute

indices = var_operand_def(IndexType) class-attribute instance-attribute

map = opt_prop_def(AffineMapAttr) class-attribute instance-attribute

__init__(value: SSAValue, memref: SSAValue, indices: Sequence[SSAValue], map: AffineMapAttr | None = None)

Source code in xdsl/dialects/affine.py
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
def __init__(
    self,
    value: SSAValue,
    memref: SSAValue,
    indices: Sequence[SSAValue],
    map: AffineMapAttr | None = None,
):
    if map is None:
        # Create identity map for memrefs with at least one dimension or () -> ()
        # for zero-dimensional memrefs.
        if not isinstance(memref_type := memref.type, MemRefType):
            raise ValueError(
                "affine.store memref operand must be of type MemRefType"
            )
        rank = memref_type.get_num_dims()
        map = AffineMapAttr(AffineMap.identity(rank))
    super().__init__(
        operands=(value, memref, indices),
        properties={"map": map},
    )

LoadOp

Bases: IRDLOperation

Source code in xdsl/dialects/affine.py
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
332
333
334
335
336
337
338
@irdl_op_definition
class LoadOp(IRDLOperation):
    name = "affine.load"

    T: ClassVar = VarConstraint("T", AnyAttr())

    memref = operand_def(MemRefType.constr(T))
    indices = var_operand_def(IndexType)

    result = result_def(T)

    map = opt_prop_def(AffineMapAttr)

    def __init__(
        self,
        memref: SSAValue,
        indices: Sequence[SSAValue],
        map: AffineMapAttr | None = None,
        result_type: Attribute | None = None,
    ):
        if map is None:
            # Create identity map for memrefs with at least one dimension or () -> ()
            # for zero-dimensional memrefs.
            if not isinstance(memref.type, ShapedType):
                raise ValueError(
                    "affine.store memref operand must be of type ShapedType"
                )
            memref_type = cast(MemRefType, memref.type)
            rank = memref_type.get_num_dims()
            map = AffineMapAttr(AffineMap.identity(rank))
        if result_type is None:
            # Create identity map for memrefs with at least one dimension or () -> ()
            # for zero-dimensional memrefs.
            if not isa(memref.type, ContainerType):
                raise ValueError(
                    "affine.store memref operand must be of type ContainerType"
                )

            result_type = memref.type.get_element_type()

        super().__init__(
            operands=(memref, indices),
            properties={"map": map},
            result_types=(result_type,),
        )

name = 'affine.load' class-attribute instance-attribute

T: ClassVar = VarConstraint('T', AnyAttr()) class-attribute instance-attribute

memref = operand_def(MemRefType.constr(T)) class-attribute instance-attribute

indices = var_operand_def(IndexType) class-attribute instance-attribute

result = result_def(T) class-attribute instance-attribute

map = opt_prop_def(AffineMapAttr) class-attribute instance-attribute

__init__(memref: SSAValue, indices: Sequence[SSAValue], map: AffineMapAttr | None = None, result_type: Attribute | None = None)

Source code in xdsl/dialects/affine.py
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
332
333
334
335
336
337
338
def __init__(
    self,
    memref: SSAValue,
    indices: Sequence[SSAValue],
    map: AffineMapAttr | None = None,
    result_type: Attribute | None = None,
):
    if map is None:
        # Create identity map for memrefs with at least one dimension or () -> ()
        # for zero-dimensional memrefs.
        if not isinstance(memref.type, ShapedType):
            raise ValueError(
                "affine.store memref operand must be of type ShapedType"
            )
        memref_type = cast(MemRefType, memref.type)
        rank = memref_type.get_num_dims()
        map = AffineMapAttr(AffineMap.identity(rank))
    if result_type is None:
        # Create identity map for memrefs with at least one dimension or () -> ()
        # for zero-dimensional memrefs.
        if not isa(memref.type, ContainerType):
            raise ValueError(
                "affine.store memref operand must be of type ContainerType"
            )

        result_type = memref.type.get_element_type()

    super().__init__(
        operands=(memref, indices),
        properties={"map": map},
        result_types=(result_type,),
    )

MinOp dataclass

Bases: IRDLOperation

Source code in xdsl/dialects/affine.py
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
@irdl_op_definition
class MinOp(IRDLOperation):
    name = "affine.min"
    arguments = var_operand_def(IndexType())
    result = result_def(IndexType())

    map = prop_def(AffineMapAttr)

    def verify_(self) -> None:
        if len(self.operands) != self.map.data.num_dims + self.map.data.num_symbols:
            raise VerifyException(
                f"{self.name} expects "
                f"{self.map.data.num_dims + self.map.data.num_symbols} "
                "operands, but got {len(self.operands)}. The number of map operands "
                "must match the sum of the dimensions and symbols of its map."
            )

name = 'affine.min' class-attribute instance-attribute

arguments = var_operand_def(IndexType()) class-attribute instance-attribute

result = result_def(IndexType()) class-attribute instance-attribute

map = prop_def(AffineMapAttr) class-attribute instance-attribute

verify_() -> None

Source code in xdsl/dialects/affine.py
349
350
351
352
353
354
355
356
def verify_(self) -> None:
    if len(self.operands) != self.map.data.num_dims + self.map.data.num_symbols:
        raise VerifyException(
            f"{self.name} expects "
            f"{self.map.data.num_dims + self.map.data.num_symbols} "
            "operands, but got {len(self.operands)}. The number of map operands "
            "must match the sum of the dimensions and symbols of its map."
        )

YieldOp dataclass

Bases: IRDLOperation

Source code in xdsl/dialects/affine.py
359
360
361
362
363
364
365
366
367
368
@irdl_op_definition
class YieldOp(IRDLOperation):
    name = "affine.yield"
    arguments = var_operand_def()

    traits = traits_def(IsTerminator(), Pure())

    @staticmethod
    def get(*operands: SSAValue | Operation) -> YieldOp:
        return YieldOp.create(operands=[SSAValue.get(operand) for operand in operands])

name = 'affine.yield' class-attribute instance-attribute

arguments = var_operand_def() class-attribute instance-attribute

traits = traits_def(IsTerminator(), Pure()) class-attribute instance-attribute

get(*operands: SSAValue | Operation) -> YieldOp staticmethod

Source code in xdsl/dialects/affine.py
366
367
368
@staticmethod
def get(*operands: SSAValue | Operation) -> YieldOp:
    return YieldOp.create(operands=[SSAValue.get(operand) for operand in operands])