Format
format
¶
FuncOpLikeParseResult: TypeAlias = tuple[str, Sequence[Attribute], Sequence[Attribute], Region, DictionaryAttr | None, ArrayAttr[DictionaryAttr] | None, ArrayAttr[DictionaryAttr] | None]
module-attribute
¶
FuncOpLikeParseResultWithVariadic: TypeAlias = tuple[str, Sequence[Attribute], Sequence[Attribute], Region, DictionaryAttr | None, ArrayAttr[DictionaryAttr] | None, ArrayAttr[DictionaryAttr] | None, bool]
module-attribute
¶
AbstractYieldOperation
¶
Bases: IRDLOperation, Generic[AttributeInvT]
A base class for yielding operations to inherit, provides the standard custom syntax
and a definition of the arguments variadic operand.
Source code in xdsl/dialects/utils/format.py
print_for_op_like(printer: Printer, start: SSAValue, stop: IntegerAttr | SSAValue, step: IntegerAttr | SSAValue, iter_args: Sequence[SSAValue], body: Region, bound_words: Sequence[str] = ['to'])
¶
Prints backend loop bounds, step, iteration arguments, and body.
The induction variable and each SSA operand are printed with their own types.
The stop and step may also be typed integer literals.
Users can provide specific words for bounds (default: "to").
Source code in xdsl/dialects/utils/format.py
parse_for_op_like(parser: Parser, bound_words: Sequence[str] = ['to'], *, allow_static_stop: bool = False, allow_static_step: bool = False) -> tuple[SSAValue, IntegerAttr | SSAValue, IntegerAttr | SSAValue, Sequence[SSAValue], Region]
¶
parse_for_op_like(
parser: Parser,
bound_words: Sequence[str] = ...,
*,
allow_static_stop: Literal[False] = ...,
allow_static_step: Literal[False] = ...,
) -> tuple[
SSAValue, SSAValue, SSAValue, Sequence[SSAValue], Region
]
parse_for_op_like(
parser: Parser,
bound_words: Sequence[str] = ...,
*,
allow_static_stop: Literal[False] = ...,
allow_static_step: Literal[True],
) -> tuple[
SSAValue,
SSAValue,
IntegerAttr | SSAValue,
Sequence[SSAValue],
Region,
]
Parses backend loop bounds, step, iteration arguments, and body. Bounds are returned in textual order. The induction variable and each SSA operand must be followed by their types. Users can provide specific words for bounds (default: "to").
When allow_static_stop=True, the termination bound may be either a static typed
integer literal or a dynamic SSA value.
When allow_static_step=True, the step may be either a static typed integer literal
or a dynamic SSA value.
The default (False) only allows dynamic SSA values.
Source code in xdsl/dialects/utils/format.py
print_func_op_like(printer: Printer, sym_name: StringAttr, function_type: FunctionType, body: Region, attributes: dict[str, Attribute], *, arg_attrs: ArrayAttr[DictionaryAttr] | None = None, res_attrs: ArrayAttr[DictionaryAttr] | None = None, reserved_attr_names: Sequence[str], is_variadic: bool = False, print_empty_outputs: bool = True)
¶
Source code in xdsl/dialects/utils/format.py
parse_func_op_like(parser: Parser, *, reserved_attr_names: Sequence[str], allow_variadic: bool = False) -> FuncOpLikeParseResult | FuncOpLikeParseResultWithVariadic
¶
Returns the function name, argument types, return types, body, extra args, arg_attrs and res_attrs. If allow_variadic=True, also returns is_variadic as the 8th element.
Source code in xdsl/dialects/utils/format.py
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 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 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 521 522 | |
print_func_argument(printer: Printer, arg: BlockArgument, attrs: DictionaryAttr | None)
¶
Keep function-argument syntax compatible with MLIR parser expectations:
%arg : type {attrs} loc(...) (location after attrs).