Builtin
builtin
DYNAMIC_INDEX = -2 ** 63
module-attribute
A constant value denoting a dynamic index in a shape. Equal to -(2 ** 63) which is used in C++ MLIR.
FlatSymbolRefAttrConstr = MessageConstraint(ParamAttrConstraint.get(SymbolRefAttr, AnyAttr(), EmptyArrayAttrConstraint()), 'Expected SymbolRefAttr with no nested symbols.')
module-attribute
Constrain SymbolRef to be FlatSymbolRef
FlatSymbolRefAttr = Annotated[SymbolRefAttr, FlatSymbolRefAttrConstr]
module-attribute
SymbolRef constrained to have an empty nested_references property.
IntCovT = TypeVar('IntCovT', bound=int, default=int, covariant=True)
module-attribute
StaticDimensionConstr = MessageConstraint(IntAttrConstraint(NotEqualIntConstraint(DYNAMIC_INDEX)), f'expected static dimension, but got {DYNAMIC_INDEX}')
module-attribute
Constrain a dimension to be static (not equal to DYNAMIC_INDEX).
StaticShapeArrayConstr = MessageConstraint(ArrayOfConstraint(StaticDimensionConstr), 'expected static shape, but got dynamic dimension')
module-attribute
Constrain an array to be a static shape (all dimensions static).
SignednessCovT = TypeVar('SignednessCovT', bound=Signedness, default=Signedness, covariant=True)
module-attribute
I128: TypeAlias = IntegerType[Literal[128], Literal[Signedness.SIGNLESS]]
module-attribute
I64: TypeAlias = IntegerType[Literal[64], Literal[Signedness.SIGNLESS]]
module-attribute
I32: TypeAlias = IntegerType[Literal[32], Literal[Signedness.SIGNLESS]]
module-attribute
I16: TypeAlias = IntegerType[Literal[16], Literal[Signedness.SIGNLESS]]
module-attribute
I8: TypeAlias = IntegerType[Literal[8], Literal[Signedness.SIGNLESS]]
module-attribute
I1: TypeAlias = IntegerType[Literal[1], Literal[Signedness.SIGNLESS]]
module-attribute
i128: I128 = IntegerType(128)
module-attribute
i64: I64 = IntegerType(64)
module-attribute
i32: I32 = IntegerType(32)
module-attribute
i16: I16 = IntegerType(16)
module-attribute
i8: I8 = IntegerType(8)
module-attribute
i1: I1 = IntegerType(1)
module-attribute
AnySignlessIntegerType: TypeAlias = IntegerType[int, Literal[Signedness.SIGNLESS]]
module-attribute
Type alias constrained to signless IntegerType.
SignlessIntegerConstraint = irdl_to_attr_constraint(AnySignlessIntegerType)
module-attribute
Type constraint for signless IntegerType.
LocationAttr: TypeAlias = UnknownLoc | FileLineColLoc | CallSiteLoc | NameLoc | FusedLoc
module-attribute
Union of all MLIR location attribute types. Represents source location information that can be attached to operations, covering unknown locations, file/line/column positions, call-site chains, named locations, and fused (multi-location) aggregates.
UNKNOWN_LOC: LocationAttr = UnknownLoc()
module-attribute
IndexTypeConstr = BaseAttr(IndexType)
module-attribute
IntegerAttrTypeConstr = IndexTypeConstr | BaseAttr(IntegerType)
module-attribute
AnySignlessIntegerOrIndexType: TypeAlias = Annotated[Attribute, AnyOf.get(IndexType, SignlessIntegerConstraint)]
module-attribute
Type alias constrained to IndexType or signless IntegerType.
BoolAttr: TypeAlias = IntegerAttr[Annotated[IntegerType, IntegerType(1)]]
module-attribute
AnyFloat: TypeAlias = BFloat16Type | Float16Type | Float32Type | Float64Type | Float80Type | Float128Type
module-attribute
AnyFloatConstr = BaseAttr(BFloat16Type) | BaseAttr(Float16Type) | BaseAttr(Float32Type) | BaseAttr(Float64Type) | BaseAttr(Float80Type) | BaseAttr(Float128Type)
module-attribute
ComplexElementCovT = TypeVar('ComplexElementCovT', bound=(IntegerType | AnyFloat), default=(IntegerType | AnyFloat), covariant=True)
module-attribute
AnyVectorType: TypeAlias = VectorType[Attribute]
module-attribute
AnyTensorType: TypeAlias = TensorType[Attribute]
module-attribute
AnyTensorTypeConstr = BaseAttr[TensorType[Attribute]](TensorType)
module-attribute
AnyUnrankedTensorType: TypeAlias = UnrankedTensorType[Attribute]
module-attribute
AnyUnrankedTensorTypeConstr = BaseAttr[AnyUnrankedTensorType](UnrankedTensorType)
module-attribute
VectorOrTensorOf: TypeAlias = VectorType[AttributeCovT] | TensorType[AttributeCovT] | UnrankedTensorType[AttributeCovT]
module-attribute
DenseArrayT = TypeVar('DenseArrayT', bound=(IntegerType | AnyFloat), default=(IntegerType | AnyFloat), covariant=True)
module-attribute
DenseArrayInvT = TypeVar('DenseArrayInvT', bound=(IntegerType | AnyFloat), default=(IntegerType | AnyFloat))
module-attribute
bf16 = BFloat16Type()
module-attribute
f16 = Float16Type()
module-attribute
f32 = Float32Type()
module-attribute
f64 = Float64Type()
module-attribute
f80 = Float80Type()
module-attribute
f128 = Float128Type()
module-attribute
AnyUnrankedMemRefTypeConstr = BaseAttr[UnrankedMemRefType](UnrankedMemRefType)
module-attribute
RankedStructure: TypeAlias = VectorType[AttributeCovT] | TensorType[AttributeCovT] | MemRefType[AttributeCovT]
module-attribute
AnyDenseElement: TypeAlias = IntegerType | IndexType | AnyFloat | ComplexType
module-attribute
DenseElementCovT = TypeVar('DenseElementCovT', bound=AnyDenseElement, default=AnyDenseElement, covariant=True)
module-attribute
DenseElementT = TypeVar('DenseElementT', bound=AnyDenseElement, default=AnyDenseElement)
module-attribute
DenseIntElementsAttr: TypeAlias = DenseIntOrFPElementsAttr[IndexType | IntegerType]
module-attribute
Builtin = Dialect('builtin', [ModuleOp, UnregisteredOp, UnrealizedConversionCastOp], [UnregisteredAttr, StringAttr, SymbolRefAttr, IntAttr, IntegerAttr, ArrayAttr, DictionaryAttr, DenseIntOrFPElementsAttr, DenseResourceAttr, UnitAttr, FloatData, UnknownLoc, FileLineColLoc, NoneAttr, OpaqueAttr, ComplexType, FunctionType, BFloat16Type, Float16Type, Float32Type, Float64Type, Float80Type, Float128Type, FloatAttr, SignednessAttr, TupleType, IntegerType, IndexType, NoneType, VectorType, TensorType, UnrankedTensorType, AffineMapAttr, AffineSetAttr, MemRefType, UnrankedMemRefType], [OpAsmDialectInterface()])
module-attribute
ShapedType
dataclass
Bases: Attribute, ABC
Source code in xdsl/dialects/builtin.py
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 140 141 142 143 144 145 146 147 | |
get_num_dims() -> int
abstractmethod
Source code in xdsl/dialects/builtin.py
114 115 | |
get_shape() -> tuple[int, ...]
abstractmethod
Source code in xdsl/dialects/builtin.py
117 118 | |
element_count() -> int
Source code in xdsl/dialects/builtin.py
120 121 | |
has_static_shape() -> bool
Check if all dimensions have static (non-dynamic) shapes.
Source code in xdsl/dialects/builtin.py
123 124 125 126 127 | |
strides_for_shape(shape: Sequence[int], factor: int = 1) -> tuple[int | None, ...]
staticmethod
Returns a tuple of strides for a given shape, with row-major layout.
Strides that depend on a dynamic index are returned as None.
The optional factor parameter specifies the stride for the innermost
dimension, defaulting to 1.
Source code in xdsl/dialects/builtin.py
129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 | |
ContainerType
Bases: ABC, Generic[_ContainerElementTypeT]
Source code in xdsl/dialects/builtin.py
155 156 157 158 | |
get_element_type() -> _ContainerElementTypeT
abstractmethod
Source code in xdsl/dialects/builtin.py
156 157 158 | |
NoneAttr
dataclass
Bases: ParametrizedAttribute, BuiltinAttribute
An attribute representing the absence of an attribute.
Source code in xdsl/dialects/builtin.py
184 185 186 187 188 189 190 191 | |
name = 'none'
class-attribute
instance-attribute
print_builtin(printer: Printer)
Source code in xdsl/dialects/builtin.py
190 191 | |
ArrayAttr
Bases: _BuiltinGenericData[tuple[AttributeCovT, ...]], Iterable[AttributeCovT], Generic[AttributeCovT]
Source code in xdsl/dialects/builtin.py
194 195 196 197 198 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 | |
name = 'array'
class-attribute
instance-attribute
__init__(param: Iterable[AttributeCovT]) -> None
Source code in xdsl/dialects/builtin.py
202 203 | |
print_builtin(printer: Printer)
Source code in xdsl/dialects/builtin.py
205 206 207 | |
constr(constr: IRDLAttrConstraint[AttributeInvT] | RangeConstraint[AttributeInvT] | None = None) -> ArrayOfConstraint[AttributeInvT]
staticmethod
Source code in xdsl/dialects/builtin.py
209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 | |
__len__()
Source code in xdsl/dialects/builtin.py
225 226 | |
__iter__() -> Iterator[AttributeCovT]
Source code in xdsl/dialects/builtin.py
228 229 | |
ArrayOfConstraint
dataclass
Bases: AttrConstraint[ArrayAttr[AttributeCovT]]
Source code in xdsl/dialects/builtin.py
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 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 | |
elem_range_constraint: RangeConstraint[AttributeCovT]
instance-attribute
A constraint that enforces an ArrayData whose elements satisfy the underlying range constraint.
__init__(constr: IRDLAttrConstraint[AttributeCovT] | RangeConstraint[AttributeCovT])
Source code in xdsl/dialects/builtin.py
240 241 242 243 244 245 246 247 248 249 | |
verify(attr: Attribute, constraint_context: ConstraintContext) -> None
Source code in xdsl/dialects/builtin.py
251 252 253 254 255 256 257 258 259 260 | |
can_infer(var_constraint_names: AbstractSet[str]) -> bool
Source code in xdsl/dialects/builtin.py
262 263 264 265 | |
infer(context: ConstraintContext) -> ArrayAttr[AttributeCovT]
Source code in xdsl/dialects/builtin.py
267 268 | |
get_bases() -> set[type[Attribute]] | None
Source code in xdsl/dialects/builtin.py
270 271 | |
variables() -> set[str]
Source code in xdsl/dialects/builtin.py
273 274 | |
mapping_type_vars(type_var_mapping: Mapping[TypeVar, AttrConstraint | IntConstraint]) -> AttrConstraint[ArrayAttr[AttributeCovT]]
Source code in xdsl/dialects/builtin.py
276 277 278 279 280 281 | |
StringAttr
dataclass
Bases: _BuiltinData[str]
Source code in xdsl/dialects/builtin.py
284 285 286 287 288 289 | |
name = 'string'
class-attribute
instance-attribute
print_builtin(printer: Printer)
Source code in xdsl/dialects/builtin.py
288 289 | |
SymbolNameConstraint
dataclass
Bases: AttrConstraint[StringAttr]
Constrain an attribute to be a StringAttr. This constraint has special assembly format support.
Source code in xdsl/dialects/builtin.py
292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 | |
__init__() -> None
verify(attr: Attribute, constraint_context: ConstraintContext) -> None
Source code in xdsl/dialects/builtin.py
299 300 301 302 303 304 305 | |
get_bases() -> set[type[Attribute]] | None
Source code in xdsl/dialects/builtin.py
307 308 | |
mapping_type_vars(type_var_mapping: Mapping[TypeVar, AttrConstraint | IntConstraint]) -> AttrConstraint[StringAttr]
Source code in xdsl/dialects/builtin.py
310 311 312 313 | |
BytesAttr
dataclass
Bases: _BuiltinData[bytes]
Source code in xdsl/dialects/builtin.py
316 317 318 319 320 321 | |
name = 'bytes'
class-attribute
instance-attribute
print_builtin(printer: Printer)
Source code in xdsl/dialects/builtin.py
320 321 | |
SymbolRefAttr
Bases: ParametrizedAttribute, BuiltinAttribute
Source code in xdsl/dialects/builtin.py
324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 | |
name = 'symbol_ref'
class-attribute
instance-attribute
root_reference: StringAttr
instance-attribute
nested_references: ArrayAttr[StringAttr]
instance-attribute
__init__(root: str | StringAttr, nested: Sequence[str] | Sequence[StringAttr] | ArrayAttr[StringAttr] = []) -> None
Source code in xdsl/dialects/builtin.py
330 331 332 333 334 335 336 337 338 339 340 341 | |
string_value()
Source code in xdsl/dialects/builtin.py
343 344 345 346 347 | |
print_builtin(printer: Printer)
Source code in xdsl/dialects/builtin.py
349 350 351 352 353 | |
EmptyArrayAttrConstraint
dataclass
Bases: AttrConstraint
Constrain attribute to be empty ArrayData
Source code in xdsl/dialects/builtin.py
356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 | |
verify(attr: Attribute, constraint_context: ConstraintContext) -> None
Source code in xdsl/dialects/builtin.py
361 362 363 364 365 | |
mapping_type_vars(type_var_mapping: Mapping[TypeVar, AttrConstraint | IntConstraint]) -> EmptyArrayAttrConstraint
Source code in xdsl/dialects/builtin.py
367 368 369 370 | |
IntAttr
dataclass
Bases: GenericData[IntCovT], Generic[IntCovT]
Source code in xdsl/dialects/builtin.py
385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 | |
name = 'builtin.int'
class-attribute
instance-attribute
parse_parameter(parser: AttrParser) -> IntCovT
classmethod
Source code in xdsl/dialects/builtin.py
389 390 391 392 393 | |
print_parameter(printer: Printer) -> None
Source code in xdsl/dialects/builtin.py
395 396 397 | |
__bool__() -> bool
Returns True if value is non-zero.
Source code in xdsl/dialects/builtin.py
399 400 401 | |
constr(constr: IntConstraint | int | TypeForm[int] | None = None) -> AttrConstraint[IntAttr]
staticmethod
Source code in xdsl/dialects/builtin.py
403 404 405 406 407 408 409 410 | |
IntAttrConstraint
dataclass
Bases: AttrConstraint[IntAttr]
Constrains the value of an IntAttr.
Source code in xdsl/dialects/builtin.py
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 | |
int_constraint: IntConstraint
instance-attribute
__init__(int_constraint: IntConstraint) -> None
get(int_constraint: IntConstraint | int | TypeForm[int] | None = None) -> AttrConstraint[IntAttr]
staticmethod
Source code in xdsl/dialects/builtin.py
419 420 421 422 423 424 425 426 427 428 429 430 431 | |
verify(attr: Attribute, constraint_context: ConstraintContext) -> None
Source code in xdsl/dialects/builtin.py
435 436 437 438 | |
variables() -> set[str]
Source code in xdsl/dialects/builtin.py
440 441 | |
can_infer(var_constraint_names: AbstractSet[str]) -> bool
Source code in xdsl/dialects/builtin.py
443 444 | |
infer(context: ConstraintContext) -> IntAttr
Source code in xdsl/dialects/builtin.py
446 447 | |
get_bases() -> set[type[Attribute]] | None
Source code in xdsl/dialects/builtin.py
449 450 | |
mapping_type_vars(type_var_mapping: Mapping[TypeVar, AttrConstraint | IntConstraint])
Source code in xdsl/dialects/builtin.py
452 453 454 455 456 457 | |
Signedness
Bases: ConstraintConvertible, Enum
Signedness semantics for integer
Source code in xdsl/dialects/builtin.py
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 | |
SIGNLESS = 0
class-attribute
instance-attribute
No signedness semantics
SIGNED = 1
class-attribute
instance-attribute
UNSIGNED = 2
class-attribute
instance-attribute
value_range(bitwidth: int) -> tuple[int, int]
For a given bitwidth, returns (min, max+1), where min and max are the smallest and largest representable values.
Signless integers are bit patterns, so the representable range is the union of the signed and unsigned representable ranges.
Source code in xdsl/dialects/builtin.py
487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 | |
base_constr() -> AttrConstraint[SignednessAttr]
staticmethod
The constraint for this class.
Source code in xdsl/dialects/builtin.py
503 504 505 506 | |
constr() -> AttrConstraint[SignednessAttr]
Source code in xdsl/dialects/builtin.py
508 509 | |
SignednessAttr
dataclass
Bases: GenericData[SignednessCovT], Generic[SignednessCovT]
Source code in xdsl/dialects/builtin.py
517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 | |
name = 'builtin.signedness'
class-attribute
instance-attribute
parse_parameter(parser: AttrParser) -> SignednessCovT
classmethod
Source code in xdsl/dialects/builtin.py
521 522 523 524 525 526 527 528 529 530 | |
print_parameter(printer: Printer) -> None
Source code in xdsl/dialects/builtin.py
532 533 534 535 536 537 538 539 540 541 542 | |
constr() -> AttrConstraint
staticmethod
Source code in xdsl/dialects/builtin.py
544 545 546 | |
CompileTimeFixedBitwidthType
dataclass
Bases: TypeAttribute, ABC
A type attribute whose runtime bitwidth is fixed, but may be target-dependent.
Source code in xdsl/dialects/builtin.py
549 550 551 552 553 554 555 556 557 558 559 560 561 562 | |
name = 'abstract.compile_time_fixed_bitwidth_type'
class-attribute
instance-attribute
compile_time_size: int
abstractmethod
property
Contiguous memory footprint of the value during compilation.
FixedBitwidthType
dataclass
Bases: CompileTimeFixedBitwidthType, ABC
A type attribute whose runtime bitwidth is target-independent.
Source code in xdsl/dialects/builtin.py
565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 | |
name = 'abstract.fixed_bitwidth_type'
class-attribute
instance-attribute
bitwidth: int
abstractmethod
property
Contiguous memory footprint in bits
size: int
property
Contiguous memory footprint in bytes, defaults to ceil(bitwidth / 8)
PackableType
dataclass
Bases: CompileTimeFixedBitwidthType, ABC, Generic[_PyT]
Abstract base class for xDSL types whose values can be encoded and decoded as bytes.
Source code in xdsl/dialects/builtin.py
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 | |
iter_unpack(buffer: ReadableBuffer) -> Iterator[_PyT]
abstractmethod
Yields unpacked values one at a time, starting at the beginning of the buffer.
Source code in xdsl/dialects/builtin.py
596 597 598 599 600 601 | |
unpack(buffer: ReadableBuffer, num: int) -> tuple[_PyT, ...]
abstractmethod
Unpack num values from the beginning of the buffer.
Source code in xdsl/dialects/builtin.py
603 604 605 606 607 608 | |
pack_into(buffer: WriteableBuffer, offset: int, value: _PyT) -> None
abstractmethod
Pack a value at a given offset into a buffer.
Source code in xdsl/dialects/builtin.py
610 611 612 613 614 615 | |
pack(values: Sequence[_PyT]) -> bytes
abstractmethod
Create a new buffer containing the input values.
Source code in xdsl/dialects/builtin.py
617 618 619 620 621 622 | |
StructPackableType
dataclass
Bases: PackableType[_PyT], ABC, Generic[_PyT]
Abstract base class for xDSL types that can be packed and unpacked using Python's
struct package, using a format string.
Source code in xdsl/dialects/builtin.py
625 626 627 628 629 630 631 632 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 | |
format: str
abstractmethod
property
Format to be used when decoding and encoding bytes.
See external documentation.
compile_time_size: int
property
iter_unpack(buffer: ReadableBuffer) -> Iterator[_PyT]
Source code in xdsl/dialects/builtin.py
641 642 | |
unpack(buffer: ReadableBuffer, num: int) -> tuple[_PyT, ...]
Source code in xdsl/dialects/builtin.py
644 645 646 | |
pack_into(buffer: WriteableBuffer, offset: int, value: _PyT) -> None
Source code in xdsl/dialects/builtin.py
648 649 | |
pack(values: Sequence[_PyT]) -> bytes
Source code in xdsl/dialects/builtin.py
651 652 653 | |
IntegerType
Bases: ParametrizedAttribute, StructPackableType[int], FixedBitwidthType, BuiltinAttribute, Generic[IntCovT, SignednessCovT]
Source code in xdsl/dialects/builtin.py
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 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 | |
name = 'integer_type'
class-attribute
instance-attribute
width: IntAttr[IntCovT]
instance-attribute
signedness: SignednessAttr[SignednessCovT]
instance-attribute
bitwidth: int
property
format: str
property
__init__(data: IntCovT | IntAttr[IntCovT], signedness: SignednessCovT | SignednessAttr[SignednessCovT] = Signedness.SIGNLESS) -> None
Source code in xdsl/dialects/builtin.py
684 685 686 687 688 689 690 691 692 693 694 | |
print_builtin(printer: Printer) -> None
Source code in xdsl/dialects/builtin.py
696 697 698 699 700 701 702 703 | |
__repr__()
Source code in xdsl/dialects/builtin.py
705 706 707 708 709 710 711 | |
verify()
Source code in xdsl/dialects/builtin.py
713 714 715 716 717 | |
value_range() -> tuple[int, int]
Source code in xdsl/dialects/builtin.py
719 720 | |
verify_value(value: int)
Source code in xdsl/dialects/builtin.py
722 723 724 725 726 727 728 729 | |
normalized_value(value: int, *, truncate_bits: bool = False) -> int | None
Signless values can represent integers from both the signed and unsigned ranges
for a given bitwidth.
We choose to normalize values that are not in the intersection of the two ranges
to the signed version (meaning ambiguous values will always be negative).
For example, the bitpattern of all ones will always be represented as -1 at
runtime.
If the input value is outside of the valid range, return None if truncate_bits
is false, otherwise returns a value in range by truncating the bits of the input.
Source code in xdsl/dialects/builtin.py
731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 | |
get_normalized_value(value: int) -> int
Normalises an integer value similarly to the normalized_value function,
but throws a ValueError when the value falls outside the type's range.
Source code in xdsl/dialects/builtin.py
758 759 760 761 762 763 764 765 766 767 768 769 770 | |
UnitAttr
dataclass
Bases: ParametrizedAttribute, BuiltinAttribute
Source code in xdsl/dialects/builtin.py
809 810 811 812 813 814 | |
name = 'unit'
class-attribute
instance-attribute
print_builtin(printer: Printer) -> None
Source code in xdsl/dialects/builtin.py
813 814 | |
LocationConstraint
dataclass
Bases: AttrConstraint
Check if an attribute is one of the supported location types.
Source code in xdsl/dialects/builtin.py
817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 | |
verify(attr: Attribute, constraint_context: ConstraintContext) -> None
Source code in xdsl/dialects/builtin.py
822 823 824 825 | |
mapping_type_vars(type_var_mapping: Mapping[TypeVar, AttrConstraint | IntConstraint]) -> AttrConstraint
Source code in xdsl/dialects/builtin.py
827 828 829 830 831 | |
LocationsArrayConstraint
Bases: AttrConstraint
Check if an attribute is one of the supported location types.
Source code in xdsl/dialects/builtin.py
834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 | |
location_constraint = LocationConstraint()
instance-attribute
__init__()
Source code in xdsl/dialects/builtin.py
839 840 | |
verify(attr: Attribute, constraint_context: ConstraintContext) -> None
Source code in xdsl/dialects/builtin.py
842 843 844 845 846 | |
mapping_type_vars(type_var_mapping: Mapping[TypeVar, AttrConstraint | IntConstraint]) -> AttrConstraint
Source code in xdsl/dialects/builtin.py
848 849 850 851 852 | |
UnknownLoc
dataclass
Bases: ParametrizedAttribute, BuiltinAttribute
Syntax:
unknown-location ::= `unknown`
Source location information is an extremely integral part of the MLIR
infrastructure. As such, location information is always present in the IR,
and must explicitly be set to unknown. Thus, an instance of the unknown
location represents an unspecified source location.
Example:
loc(unknown)
Source code in xdsl/dialects/builtin.py
855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 | |
name = 'unknown_loc'
class-attribute
instance-attribute
print_builtin(printer: Printer) -> None
Source code in xdsl/dialects/builtin.py
878 879 880 | |
FileLineColLoc
dataclass
Bases: ParametrizedAttribute, BuiltinAttribute
Syntax:
filelinecol-location ::= string-literal `:` integer-literal `:`
integer-literal
An instance of this location represents a tuple of file, line number, and column number. This is similar to the type of location that you get from most source languages.
Example:
loc("mysource.cc":10:8)
Source code in xdsl/dialects/builtin.py
883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 | |
name = 'file_line_loc'
class-attribute
instance-attribute
filename: StringAttr = param_def()
class-attribute
instance-attribute
line: IntAttr = param_def()
class-attribute
instance-attribute
column: IntAttr = param_def()
class-attribute
instance-attribute
print_builtin(printer: Printer) -> None
Source code in xdsl/dialects/builtin.py
910 911 912 913 914 915 916 | |
CallSiteLoc
dataclass
Bases: ParametrizedAttribute, BuiltinAttribute
Source code in xdsl/dialects/builtin.py
919 920 921 922 923 924 925 926 927 928 929 930 931 932 | |
name = 'builtin.callsite_loc'
class-attribute
instance-attribute
callee: Attribute = param_def(LocationConstraint())
class-attribute
instance-attribute
caller: Attribute = param_def(LocationConstraint())
class-attribute
instance-attribute
print_builtin(printer: Printer) -> None
Source code in xdsl/dialects/builtin.py
926 927 928 929 930 931 932 | |
FusedLoc
dataclass
Bases: ParametrizedAttribute, BuiltinAttribute
Source code in xdsl/dialects/builtin.py
935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 | |
name = 'builtin.fused_loc'
class-attribute
instance-attribute
locations: Attribute = param_def(constraint=(LocationsArrayConstraint()), converter=(ArrayAttr[Attribute].get))
class-attribute
instance-attribute
metadata: Attribute = param_def()
class-attribute
instance-attribute
print_builtin(printer: Printer) -> None
Source code in xdsl/dialects/builtin.py
944 945 946 947 948 949 950 951 | |
NameLoc
dataclass
Bases: ParametrizedAttribute, BuiltinAttribute
Source code in xdsl/dialects/builtin.py
954 955 956 957 958 959 960 961 962 963 964 965 966 967 | |
name = 'builtin.name_loc'
class-attribute
instance-attribute
desc: StringAttr = param_def()
class-attribute
instance-attribute
location: Attribute = param_def(LocationConstraint())
class-attribute
instance-attribute
print_builtin(printer: Printer) -> None
Source code in xdsl/dialects/builtin.py
961 962 963 964 965 966 967 | |
IndexType
dataclass
Bases: ParametrizedAttribute, BuiltinAttribute, StructPackableType[int]
Source code in xdsl/dialects/builtin.py
980 981 982 983 984 985 986 987 988 989 990 | |
name = 'index'
class-attribute
instance-attribute
format: str
property
print_builtin(printer: Printer)
Source code in xdsl/dialects/builtin.py
984 985 | |
IntegerAttr
Bases: BuiltinAttribute, TypedAttribute, Generic[_IntegerAttrType]
Source code in xdsl/dialects/builtin.py
1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 | |
name = 'integer'
class-attribute
instance-attribute
value: IntAttr
instance-attribute
type: _IntegerAttrType
instance-attribute
__init__(value: int | IntAttr, value_type: IntCovT | IntegerType[IntCovT] | IndexType, *, truncate_bits: bool = False) -> None
__init__(
value: int | IntAttr,
value_type: _IntegerAttrType,
*,
truncate_bits: bool = False,
) -> None
__init__(
value: int | IntAttr,
value_type: IntCovT,
*,
truncate_bits: bool = False,
) -> None
Source code in xdsl/dialects/builtin.py
1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 | |
from_int_and_width(value: int, width: IntCovT) -> IntegerAttr[IntegerType[IntCovT, Literal[Signedness.SIGNLESS]]]
staticmethod
Source code in xdsl/dialects/builtin.py
1056 1057 1058 1059 1060 1061 | |
from_index_int_value(value: int) -> IntegerAttr[IndexType]
staticmethod
Source code in xdsl/dialects/builtin.py
1063 1064 1065 | |
from_bool(value: bool) -> BoolAttr
staticmethod
Source code in xdsl/dialects/builtin.py
1067 1068 1069 | |
print_builtin(printer: Printer) -> None
Source code in xdsl/dialects/builtin.py
1071 1072 1073 1074 1075 1076 | |
verify() -> None
Source code in xdsl/dialects/builtin.py
1078 1079 1080 1081 1082 | |
parse_with_type(parser: AttrParser, type: Attribute) -> TypedAttribute
staticmethod
Source code in xdsl/dialects/builtin.py
1084 1085 1086 1087 1088 1089 1090 | |
print_without_type(printer: Printer)
Source code in xdsl/dialects/builtin.py
1092 1093 | |
get_type() -> Attribute
Source code in xdsl/dialects/builtin.py
1095 1096 | |
constr(type: IRDLAttrConstraint[_IntegerAttrType] = IntegerAttrTypeConstr, *, value: AttrConstraint | IntConstraint | None = None) -> AttrConstraint[IntegerAttr[_IntegerAttrType]]
staticmethod
Source code in xdsl/dialects/builtin.py
1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 | |
__bool__() -> bool
Returns True if value is non-zero.
Source code in xdsl/dialects/builtin.py
1111 1112 1113 | |
iter_unpack(type: _IntegerAttrTypeInvT, buffer: ReadableBuffer) -> Iterator[IntegerAttr[_IntegerAttrTypeInvT]]
staticmethod
Yields unpacked values one at a time, starting at the beginning of the buffer.
Source code in xdsl/dialects/builtin.py
1115 1116 1117 1118 1119 1120 1121 1122 1123 | |
unpack(type: _IntegerAttrTypeInvT, buffer: ReadableBuffer, num: int) -> tuple[IntegerAttr[_IntegerAttrTypeInvT], ...]
staticmethod
Unpack num values from the beginning of the buffer.
Source code in xdsl/dialects/builtin.py
1125 1126 1127 1128 1129 1130 1131 1132 | |
BFloat16Type
dataclass
Bases: ParametrizedAttribute, _FloatType
Source code in xdsl/dialects/builtin.py
1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 | |
name = 'bf16'
class-attribute
instance-attribute
bitwidth: int
property
compile_time_size: int
property
iter_unpack(buffer: ReadableBuffer) -> Iterator[float]
Source code in xdsl/dialects/builtin.py
1185 1186 1187 1188 | |
unpack(buffer: ReadableBuffer, num: int) -> tuple[float, ...]
Source code in xdsl/dialects/builtin.py
1190 1191 | |
pack_into(buffer: WriteableBuffer, offset: int, value: float) -> None
Source code in xdsl/dialects/builtin.py
1193 1194 | |
pack(values: Sequence[float]) -> bytes
Source code in xdsl/dialects/builtin.py
1196 1197 | |
Float16Type
dataclass
Bases: ParametrizedAttribute, _FloatType, StructPackableType[float]
Source code in xdsl/dialects/builtin.py
1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 | |
name = 'f16'
class-attribute
instance-attribute
bitwidth: int
property
format: str
property
Float32Type
dataclass
Bases: ParametrizedAttribute, _FloatType, StructPackableType[float]
Source code in xdsl/dialects/builtin.py
1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 | |
name = 'f32'
class-attribute
instance-attribute
bitwidth: int
property
format: str
property
Float64Type
dataclass
Bases: ParametrizedAttribute, _FloatType, StructPackableType[float]
Source code in xdsl/dialects/builtin.py
1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 | |
name = 'f64'
class-attribute
instance-attribute
bitwidth: int
property
format: str
property
Float80Type
dataclass
Bases: ParametrizedAttribute, _FloatType, StructPackableType[float]
Source code in xdsl/dialects/builtin.py
1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 | |
name = 'f80'
class-attribute
instance-attribute
bitwidth: int
property
format: str
property
Float128Type
dataclass
Bases: ParametrizedAttribute, _FloatType, StructPackableType[float]
Source code in xdsl/dialects/builtin.py
1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 | |
name = 'f128'
class-attribute
instance-attribute
bitwidth: int
property
format: str
property
FloatData
dataclass
Bases: Data[float]
Source code in xdsl/dialects/builtin.py
1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 | |
name = 'builtin.float_data'
class-attribute
instance-attribute
parse_parameter(parser: AttrParser) -> float
classmethod
Source code in xdsl/dialects/builtin.py
1282 1283 1284 1285 | |
print_parameter(printer: Printer) -> None
Source code in xdsl/dialects/builtin.py
1287 1288 1289 | |
__eq__(other: object)
Source code in xdsl/dialects/builtin.py
1291 1292 1293 1294 1295 1296 | |
__hash__()
Source code in xdsl/dialects/builtin.py
1298 1299 | |
FloatAttr
Bases: BuiltinAttribute, TypedAttribute, Generic[_FloatAttrType]
Source code in xdsl/dialects/builtin.py
1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 | |
name = 'float'
class-attribute
instance-attribute
value: FloatData
instance-attribute
type: _FloatAttrType
instance-attribute
__init__(data: float | FloatData, type: int | _FloatAttrType | AnyFloat) -> None
__init__(
data: float | FloatData, type: _FloatAttrType
) -> None
__init__(data: float | FloatData, type: int) -> None
Source code in xdsl/dialects/builtin.py
1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 | |
parse_with_type(parser: AttrParser, type: Attribute) -> TypedAttribute
staticmethod
Source code in xdsl/dialects/builtin.py
1348 1349 1350 1351 1352 1353 1354 | |
print_without_type(printer: Printer)
Source code in xdsl/dialects/builtin.py
1356 1357 | |
print_builtin(printer: Printer)
Source code in xdsl/dialects/builtin.py
1359 1360 1361 1362 | |
iter_unpack(type: _FloatAttrTypeInvT, buffer: ReadableBuffer) -> Iterator[FloatAttr[_FloatAttrTypeInvT]]
staticmethod
Yields unpacked values one at a time, starting at the beginning of the buffer.
Source code in xdsl/dialects/builtin.py
1364 1365 1366 1367 1368 1369 1370 1371 1372 | |
unpack(type: _FloatAttrTypeInvT, buffer: ReadableBuffer, num: int) -> tuple[FloatAttr[_FloatAttrTypeInvT], ...]
staticmethod
Unpack num values from the beginning of the buffer.
Source code in xdsl/dialects/builtin.py
1374 1375 1376 1377 1378 1379 1380 1381 | |
constr(type: IRDLAttrConstraint[_FloatAttrType] = AnyFloatConstr) -> AttrConstraint[FloatAttr[_FloatAttrType]]
staticmethod
Source code in xdsl/dialects/builtin.py
1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 | |
ComplexType
dataclass
Bases: PackableType[tuple[float, float] | tuple[int, int]], ParametrizedAttribute, BuiltinAttribute, ContainerType[ComplexElementCovT], TypeAttribute, Generic[ComplexElementCovT]
Source code in xdsl/dialects/builtin.py
1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 | |
name = 'complex'
class-attribute
instance-attribute
element_type: ComplexElementCovT
instance-attribute
compile_time_size: int
property
size: int
property
print_builtin(printer: Printer)
Source code in xdsl/dialects/builtin.py
1417 1418 1419 1420 | |
get_element_type() -> ComplexElementCovT
Source code in xdsl/dialects/builtin.py
1422 1423 | |
iter_unpack(buffer: ReadableBuffer)
Source code in xdsl/dialects/builtin.py
1433 1434 1435 | |
unpack(buffer: ReadableBuffer, num: int)
Source code in xdsl/dialects/builtin.py
1437 1438 1439 | |
pack_into(buffer: WriteableBuffer, offset: int, value: tuple[float, float] | tuple[int, int]) -> None
pack_into(
buffer: WriteableBuffer,
offset: int,
value: tuple[int, int],
) -> None
pack_into(
buffer: WriteableBuffer,
offset: int,
value: tuple[float, float],
) -> None
Source code in xdsl/dialects/builtin.py
1457 1458 1459 1460 1461 1462 1463 1464 1465 | |
pack(values: Sequence[tuple[float, float] | tuple[int, int]]) -> bytes
pack(values: Sequence[tuple[float, float]]) -> bytes
pack(values: Sequence[tuple[int, int]]) -> bytes
Source code in xdsl/dialects/builtin.py
1477 1478 | |
constr(element_type: IRDLAttrConstraint[ComplexElementCovT] | None = None) -> AttrConstraint[ComplexType[ComplexElementCovT]]
staticmethod
Source code in xdsl/dialects/builtin.py
1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 | |
DictionaryAttr
Bases: _BuiltinData[immutabledict[str, Attribute]]
Source code in xdsl/dialects/builtin.py
1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 | |
name = 'dictionary'
class-attribute
instance-attribute
__init__(value: Mapping[str, Attribute])
Source code in xdsl/dialects/builtin.py
1497 1498 1499 1500 | |
print_builtin(printer: Printer)
Source code in xdsl/dialects/builtin.py
1502 1503 | |
verify() -> None
Source code in xdsl/dialects/builtin.py
1505 1506 | |
TupleType
dataclass
Bases: ParametrizedAttribute, BuiltinAttribute, TypeAttribute
Source code in xdsl/dialects/builtin.py
1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 | |
name = 'tuple'
class-attribute
instance-attribute
types: ArrayAttr[TypeAttribute] = param_def(converter=(ArrayAttr[TypeAttribute].get))
class-attribute
instance-attribute
print_builtin(printer: Printer)
Source code in xdsl/dialects/builtin.py
1515 1516 1517 1518 | |
VectorType
Bases: BuiltinAttribute, ParametrizedAttribute, TypeAttribute, ShapedType, ContainerType[AttributeCovT], Generic[AttributeCovT]
Source code in xdsl/dialects/builtin.py
1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 | |
name = 'vector'
class-attribute
instance-attribute
element_type: AttributeCovT
instance-attribute
shape: ArrayAttr[IntAttr]
instance-attribute
scalable_dims: ArrayAttr[BoolAttr]
instance-attribute
__init__(element_type: AttributeCovT, shape: Iterable[int | IntAttr], scalable_dims: ArrayAttr[BoolAttr] | None = None) -> None
Source code in xdsl/dialects/builtin.py
1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 | |
print_builtin(printer: Printer)
Source code in xdsl/dialects/builtin.py
1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 | |
get_num_dims() -> int
Source code in xdsl/dialects/builtin.py
1575 1576 | |
get_num_scalable_dims() -> int
Source code in xdsl/dialects/builtin.py
1578 1579 | |
get_shape() -> tuple[int, ...]
Source code in xdsl/dialects/builtin.py
1581 1582 | |
get_element_type() -> AttributeCovT
Source code in xdsl/dialects/builtin.py
1584 1585 | |
get_scalable_dims() -> tuple[bool, ...]
Source code in xdsl/dialects/builtin.py
1587 1588 | |
verify()
Source code in xdsl/dialects/builtin.py
1590 1591 1592 1593 1594 1595 1596 1597 | |
constr(element_type: IRDLAttrConstraint[AttributeCovT] | None = None, *, shape: IRDLAttrConstraint[ArrayAttr[IntAttr]] | None = None, scalable_dims: IRDLAttrConstraint[ArrayAttr[BoolAttr]] | None = None) -> AttrConstraint[VectorType[AttributeCovT]]
staticmethod
Source code in xdsl/dialects/builtin.py
1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 | |
TensorType
Bases: ParametrizedAttribute, BuiltinAttribute, TypeAttribute, ShapedType, ContainerType[AttributeCovT], Generic[AttributeCovT]
Source code in xdsl/dialects/builtin.py
1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 | |
name = 'tensor'
class-attribute
instance-attribute
shape: ArrayAttr[IntAttr]
instance-attribute
element_type: AttributeCovT
instance-attribute
encoding: Attribute
instance-attribute
__init__(element_type: AttributeCovT, shape: Iterable[int | IntAttr], encoding: Attribute = NoneAttr())
Source code in xdsl/dialects/builtin.py
1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 | |
print_builtin(printer: Printer)
Source code in xdsl/dialects/builtin.py
1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 | |
get_num_dims() -> int
Source code in xdsl/dialects/builtin.py
1659 1660 | |
get_shape() -> tuple[int, ...]
Source code in xdsl/dialects/builtin.py
1662 1663 | |
get_element_type() -> AttributeCovT
Source code in xdsl/dialects/builtin.py
1665 1666 | |
constr(element_type: IRDLAttrConstraint[AttributeInvT] | None = None, shape: IRDLAttrConstraint[AttributeInvT] | None = None) -> AttrConstraint[TensorType[AttributeInvT]]
staticmethod
Source code in xdsl/dialects/builtin.py
1668 1669 1670 1671 1672 1673 1674 1675 1676 | |
UnrankedTensorType
dataclass
Bases: ParametrizedAttribute, BuiltinAttribute, TypeAttribute, ContainerType[AttributeCovT], Generic[AttributeCovT]
Source code in xdsl/dialects/builtin.py
1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 | |
name = 'unranked_tensor'
class-attribute
instance-attribute
element_type: AttributeCovT
instance-attribute
get_element_type() -> AttributeCovT
Source code in xdsl/dialects/builtin.py
1695 1696 | |
print_builtin(printer: Printer)
Source code in xdsl/dialects/builtin.py
1698 1699 1700 | |
ContainerOf
dataclass
Bases: AttrConstraint[AttributeCovT | VectorType[AttributeCovT] | TensorType[AttributeCovT]], Generic[AttributeCovT]
A type constraint that can be nested once in a vector or a tensor.
Source code in xdsl/dialects/builtin.py
1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 | |
elem_constr: AttrConstraint[AttributeCovT]
instance-attribute
__init__(elem_constr: AttributeCovT | type[AttributeCovT] | AttrConstraint[AttributeCovT]) -> None
Source code in xdsl/dialects/builtin.py
1718 1719 1720 1721 1722 1723 1724 | |
verify(attr: Attribute, constraint_context: ConstraintContext) -> None
Source code in xdsl/dialects/builtin.py
1726 1727 1728 1729 1730 | |
get_bases() -> set[type[Attribute]] | None
Source code in xdsl/dialects/builtin.py
1732 1733 1734 1735 | |
mapping_type_vars(type_var_mapping: Mapping[TypeVar, AttrConstraint | IntConstraint]) -> ContainerOf[AttributeCovT]
Source code in xdsl/dialects/builtin.py
1737 1738 1739 1740 | |
VectorRankConstraint
dataclass
Bases: AttrConstraint
Constrain a vector to be of a given rank.
Source code in xdsl/dialects/builtin.py
1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 | |
expected_rank: int
instance-attribute
The expected vector rank.
__init__(expected_rank: int) -> None
verify(attr: Attribute, constraint_context: ConstraintContext) -> None
Source code in xdsl/dialects/builtin.py
1759 1760 1761 1762 1763 1764 1765 | |
mapping_type_vars(type_var_mapping: Mapping[TypeVar, AttrConstraint | IntConstraint]) -> VectorRankConstraint
Source code in xdsl/dialects/builtin.py
1767 1768 1769 1770 | |
VectorBaseTypeConstraint
dataclass
Bases: AttrConstraint
Constrain a vector to be of a given base type.
Source code in xdsl/dialects/builtin.py
1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 | |
expected_type: Attribute
instance-attribute
The expected vector base type.
__init__(expected_type: Attribute) -> None
verify(attr: Attribute, constraint_context: ConstraintContext) -> None
Source code in xdsl/dialects/builtin.py
1782 1783 1784 1785 1786 1787 1788 | |
mapping_type_vars(type_var_mapping: Mapping[TypeVar, AttrConstraint | IntConstraint]) -> VectorBaseTypeConstraint
Source code in xdsl/dialects/builtin.py
1790 1791 1792 1793 | |
VectorBaseTypeAndRankConstraint
dataclass
Bases: AttrConstraint
Constrain a vector to be of a given rank and base type.
Source code in xdsl/dialects/builtin.py
1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 | |
expected_type: Attribute
instance-attribute
The expected vector base type.
expected_rank: int
instance-attribute
The expected vector rank.
__init__(expected_type: Attribute, expected_rank: int) -> None
verify(attr: Attribute, constraint_context: ConstraintContext) -> None
Source code in xdsl/dialects/builtin.py
1808 1809 1810 1811 1812 | |
mapping_type_vars(type_var_mapping: Mapping[TypeVar, AttrConstraint | IntConstraint]) -> VectorBaseTypeAndRankConstraint
Source code in xdsl/dialects/builtin.py
1814 1815 1816 1817 | |
DenseResourceAttr
dataclass
Bases: BuiltinAttribute, TypedAttribute
Source code in xdsl/dialects/builtin.py
1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 | |
name = 'dense_resource'
class-attribute
instance-attribute
resource_handle: StringAttr
instance-attribute
type: ShapedType
instance-attribute
print_without_type(printer: Printer)
Source code in xdsl/dialects/builtin.py
1827 1828 1829 1830 | |
print_builtin(printer: Printer)
Source code in xdsl/dialects/builtin.py
1832 1833 1834 1835 | |
from_params(handle: str | StringAttr, type: ShapedType) -> DenseResourceAttr
staticmethod
Source code in xdsl/dialects/builtin.py
1837 1838 1839 1840 1841 | |
DenseArrayBase
dataclass
Bases: ContainerType[DenseArrayT], ParametrizedAttribute, BuiltinAttribute, Generic[DenseArrayT]
Source code in xdsl/dialects/builtin.py
1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 | |
name = 'array'
class-attribute
instance-attribute
elt_type: DenseArrayT
instance-attribute
data: BytesAttr
instance-attribute
print_builtin(printer: Printer)
Source code in xdsl/dialects/builtin.py
1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 | |
verify()
Source code in xdsl/dialects/builtin.py
1890 1891 1892 1893 1894 1895 1896 1897 | |
get_element_type() -> DenseArrayT
Source code in xdsl/dialects/builtin.py
1899 1900 | |
create_dense_int(data_type: _IntegerTypeInvT, data: Sequence[int]) -> DenseArrayBase[_IntegerTypeInvT]
staticmethod
Source code in xdsl/dialects/builtin.py
1902 1903 1904 1905 1906 1907 | |
create_dense_float(data_type: _FloatAttrTypeInvT, data: Sequence[float]) -> DenseArrayBase[_FloatAttrTypeInvT]
staticmethod
Source code in xdsl/dialects/builtin.py
1909 1910 1911 1912 1913 1914 | |
from_list(data_type: IntegerType | AnyFloat, data: Sequence[int] | Sequence[float]) -> DenseArrayBase
staticmethod
from_list(
data_type: _IntegerTypeInvT, data: Sequence[int]
) -> DenseArrayBase[_IntegerTypeInvT]
from_list(
data_type: _FloatAttrTypeInvT, data: Sequence[float]
) -> DenseArrayBase[_FloatAttrTypeInvT]
Source code in xdsl/dialects/builtin.py
1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 | |
iter_values() -> Iterator[float] | Iterator[int]
iter_values() -> Iterator[int]
iter_values() -> Iterator[float]
Returns an iterator of int or float values, depending on whether
self.elt_type is an integer type or a floating point type.
Source code in xdsl/dialects/builtin.py
1947 1948 1949 1950 1951 1952 | |
get_values() -> tuple[int, ...] | tuple[float, ...]
get_values() -> tuple[int, ...]
get_values() -> tuple[float, ...]
Get a tuple of int or float values, depending on whether self.elt_type is
an integer type or a floating point type.
Source code in xdsl/dialects/builtin.py
1960 1961 1962 1963 1964 1965 | |
iter_attrs() -> Iterator[IntegerAttr] | Iterator[FloatAttr]
Source code in xdsl/dialects/builtin.py
1967 1968 1969 1970 1971 | |
get_attrs() -> tuple[IntegerAttr, ...] | tuple[FloatAttr, ...]
Source code in xdsl/dialects/builtin.py
1973 1974 1975 1976 1977 | |
__len__() -> int
Source code in xdsl/dialects/builtin.py
1979 1980 | |
constr(element_type: IRDLAttrConstraint[DenseArrayInvT] | None = None) -> AttrConstraint[DenseArrayBase[DenseArrayInvT]]
staticmethod
Source code in xdsl/dialects/builtin.py
1982 1983 1984 1985 1986 1987 1988 1989 | |
FunctionType
dataclass
Bases: ParametrizedAttribute, BuiltinAttribute, TypeAttribute
Source code in xdsl/dialects/builtin.py
1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 | |
name = 'fun'
class-attribute
instance-attribute
inputs: ArrayAttr[Attribute]
instance-attribute
outputs: ArrayAttr[Attribute]
instance-attribute
print_builtin(printer: Printer)
Source code in xdsl/dialects/builtin.py
1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 | |
from_lists(inputs: Sequence[Attribute], outputs: Sequence[Attribute]) -> FunctionType
staticmethod
Source code in xdsl/dialects/builtin.py
2010 2011 2012 2013 2014 | |
from_attrs(inputs: ArrayAttr[Attribute], outputs: ArrayAttr[Attribute]) -> FunctionType
staticmethod
Source code in xdsl/dialects/builtin.py
2016 2017 2018 2019 2020 | |
OpaqueAttr
dataclass
Bases: ParametrizedAttribute, BuiltinAttribute
Source code in xdsl/dialects/builtin.py
2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 | |
name = 'opaque'
class-attribute
instance-attribute
ident: StringAttr
instance-attribute
value: StringAttr
instance-attribute
type: Attribute
instance-attribute
print_builtin(printer: Printer)
Source code in xdsl/dialects/builtin.py
2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 | |
from_strings(name: str, value: str, type: Attribute = NoneAttr()) -> OpaqueAttr
staticmethod
Source code in xdsl/dialects/builtin.py
2042 2043 2044 | |
MemRefLayoutAttr
dataclass
Bases: Attribute, ABC
Interface for any attribute acceptable as a memref layout.
Source code in xdsl/dialects/builtin.py
2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 | |
get_affine_map() -> AffineMap
abstractmethod
Return the affine mapping from the iteration space of this layout to the element offset in linear memory. The resulting affine map thus has only one result.
Source code in xdsl/dialects/builtin.py
2052 2053 2054 2055 2056 2057 2058 2059 | |
get_strides() -> Sequence[int | None] | None
(optional) Return the list of strides, representing the element offset in linear memory for every dimension in the iteration space of this memref layout attribute.
Note: The dimension of the iteration space may differ from the dimension of the data it represents. For instance, this can occur in a tiled layout.
This is only applicable to hyper-rectangular layouts. If this is not applicable for a given layout, returns None
Source code in xdsl/dialects/builtin.py
2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 | |
StridedLayoutAttr
Bases: MemRefLayoutAttr, BuiltinAttribute, ParametrizedAttribute
An attribute representing a strided layout of a shaped type. See external documentation.
Contrary to MLIR, we represent dynamic offsets and strides with
NoneAttr, and we do not restrict offsets and strides to 64-bits
integers.
Source code in xdsl/dialects/builtin.py
2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 | |
name = 'strided'
class-attribute
instance-attribute
strides: ArrayAttr[IntAttr | NoneAttr]
instance-attribute
offset: IntAttr | NoneAttr
instance-attribute
__init__(strides: ArrayAttr[IntAttr | NoneAttr] | Sequence[int | None | IntAttr | NoneAttr], offset: int | None | IntAttr | NoneAttr = 0) -> None
Source code in xdsl/dialects/builtin.py
2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 | |
print_builtin(printer: Printer)
Source code in xdsl/dialects/builtin.py
2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 | |
get_strides() -> Sequence[int | None]
Source code in xdsl/dialects/builtin.py
2133 2134 2135 2136 2137 | |
get_offset() -> int | None
Source code in xdsl/dialects/builtin.py
2139 2140 2141 2142 2143 | |
get_affine_map() -> AffineMap
Return the affine mapping from the iteration space of this layout to the element offset in linear memory. The resulting affine map thus has only one result.
For dynamic strides, this results in an affinemap with a number of symbols, ordered in the following manner: (1) Symbol for the dynamic offset of the layout (2) Symbols for every dynamic stride of the layout
Source code in xdsl/dialects/builtin.py
2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 | |
AffineMapAttr
dataclass
Bases: MemRefLayoutAttr, _BuiltinData[AffineMap]
An Attribute containing an AffineMap object.
Source code in xdsl/dialects/builtin.py
2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 | |
name = 'affine_map'
class-attribute
instance-attribute
print_builtin(printer: Printer)
Source code in xdsl/dialects/builtin.py
2186 2187 | |
constant_map(value: int) -> AffineMapAttr
staticmethod
Source code in xdsl/dialects/builtin.py
2189 2190 2191 | |
get_affine_map() -> AffineMap
Source code in xdsl/dialects/builtin.py
2193 2194 | |
AffineSetAttr
dataclass
Bases: _BuiltinData[AffineSet]
An attribute containing an AffineSet object.
Source code in xdsl/dialects/builtin.py
2197 2198 2199 2200 2201 2202 2203 2204 | |
name = 'affine_set'
class-attribute
instance-attribute
print_builtin(printer: Printer)
Source code in xdsl/dialects/builtin.py
2203 2204 | |
UnrealizedConversionCastOp
dataclass
Bases: IRDLOperation
Source code in xdsl/dialects/builtin.py
2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 | |
name = 'builtin.unrealized_conversion_cast'
class-attribute
instance-attribute
inputs = var_operand_def()
class-attribute
instance-attribute
outputs = var_result_def()
class-attribute
instance-attribute
traits = traits_def(NoMemoryEffect())
class-attribute
instance-attribute
get(inputs: Sequence[SSAValue | Operation], result_type: Sequence[Attribute])
staticmethod
Source code in xdsl/dialects/builtin.py
2216 2217 2218 2219 2220 2221 | |
cast_one(input: SSAValue, result_type: AttributeInvT) -> tuple[UnrealizedConversionCastOp, SSAValue[AttributeInvT]]
staticmethod
Source code in xdsl/dialects/builtin.py
2223 2224 2225 2226 2227 2228 2229 2230 2231 | |
parse(parser: Parser) -> Self
classmethod
Source code in xdsl/dialects/builtin.py
2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 | |
print(printer: Printer)
Source code in xdsl/dialects/builtin.py
2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 | |
UnregisteredOp
dataclass
Bases: Operation, ABC
An unregistered operation.
Each unregistered op is registered as a subclass of UnregisteredOp,
and op with different names have distinct subclasses.
Source code in xdsl/dialects/builtin.py
2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 | |
name = 'builtin.unregistered'
class-attribute
instance-attribute
traits = traits_def()
class-attribute
instance-attribute
op_name: StringAttr
property
with_name(name: str) -> type[Operation]
classmethod
Return a new unregistered operation type given a name.
This function should not be called directly. Use methods from
Context to get an UnregisteredOp type.
Source code in xdsl/dialects/builtin.py
2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 | |
has_trait(trait: type[OpTrait] | OpTrait, *, value_if_unregistered: bool = True) -> bool
classmethod
Source code in xdsl/dialects/builtin.py
2329 2330 2331 2332 2333 2334 2335 2336 | |
UnregisteredAttr
dataclass
Bases: ParametrizedAttribute, BuiltinAttribute, ABC
An unregistered attribute or type.
Each unregistered attribute is registered as a subclass of
UnregisteredAttr, and attribute with different names have
distinct subclasses.
Since attributes do not have a generic format, unregistered attributes represent their original parameters as a string, which is exactly the content parsed from the textual representation.
Source code in xdsl/dialects/builtin.py
2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 | |
name = 'builtin.unregistered'
class-attribute
instance-attribute
attr_name: StringAttr
instance-attribute
is_type: IntAttr
instance-attribute
is_opaque: IntAttr
instance-attribute
value: StringAttr
instance-attribute
This parameter is non-null is the attribute is a type, and null otherwise.
__init__(attr_name: str | StringAttr, is_type: bool | IntAttr, is_opaque: bool | IntAttr, value: str | StringAttr)
Source code in xdsl/dialects/builtin.py
2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 | |
print_builtin(printer: Printer)
Source code in xdsl/dialects/builtin.py
2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 | |
with_name_and_type(name: str, is_type: bool) -> type[UnregisteredAttr]
classmethod
Return a new unregistered attribute type given a name and a
boolean indicating if the attribute can be a type.
This function should not be called directly. Use methods from
Context to get an UnregisteredAttr type.
Source code in xdsl/dialects/builtin.py
2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 | |
ModuleOp
Bases: IRDLOperation
Source code in xdsl/dialects/builtin.py
2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 | |
name = 'builtin.module'
class-attribute
instance-attribute
sym_name = opt_prop_def(StringAttr)
class-attribute
instance-attribute
body = region_def('single_block')
class-attribute
instance-attribute
traits = traits_def(IsolatedFromAbove(), NoTerminator(), OptionalSymbolOpInterface(), SymbolTable())
class-attribute
instance-attribute
ops: BlockOps
property
__init__(ops: Iterable[Operation] | Region, attributes: Mapping[str, Attribute] | None = None, sym_name: StringAttr | None = None)
Source code in xdsl/dialects/builtin.py
2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 | |
parse(parser: Parser) -> ModuleOp
classmethod
Source code in xdsl/dialects/builtin.py
2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 | |
print(printer: Printer) -> None
Source code in xdsl/dialects/builtin.py
2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 | |
NoneType
dataclass
Bases: ParametrizedAttribute, BuiltinAttribute, TypeAttribute
Source code in xdsl/dialects/builtin.py
2508 2509 2510 2511 2512 2513 | |
name = 'none_type'
class-attribute
instance-attribute
print_builtin(printer: Printer)
Source code in xdsl/dialects/builtin.py
2512 2513 | |
MemRefType
Bases: ParametrizedAttribute, BuiltinAttribute, TypeAttribute, ShapedType, ContainerType[_MemRefTypeElement], Generic[_MemRefTypeElement]
Source code in xdsl/dialects/builtin.py
2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 | |
name = 'memref'
class-attribute
instance-attribute
shape: ArrayAttr[IntAttr]
instance-attribute
element_type: _MemRefTypeElement
instance-attribute
layout: MemRefLayoutAttr | NoneAttr
instance-attribute
memory_space: Attribute
instance-attribute
__init__(element_type: _MemRefTypeElement, shape: ArrayAttr[IntAttr] | Iterable[int | IntAttr], layout: MemRefLayoutAttr | NoneAttr = NoneAttr(), memory_space: Attribute = NoneAttr())
Source code in xdsl/dialects/builtin.py
2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 | |
get_num_dims() -> int
Source code in xdsl/dialects/builtin.py
2550 2551 | |
get_shape() -> tuple[int, ...]
Source code in xdsl/dialects/builtin.py
2553 2554 | |
get_element_type() -> _MemRefTypeElement
Source code in xdsl/dialects/builtin.py
2556 2557 | |
parse_parameters(parser: AttrParser) -> list[Attribute]
classmethod
Source code in xdsl/dialects/builtin.py
2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 | |
print_parameters(printer: Printer) -> None
Source code in xdsl/dialects/builtin.py
2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 | |
print_builtin(printer: Printer)
Source code in xdsl/dialects/builtin.py
2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 | |
get_affine_map() -> AffineMap
Return the affine mapping from the iteration space of this memref's layout to the element offset in linear memory.
Source code in xdsl/dialects/builtin.py
2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 | |
get_affine_map_in_bytes() -> AffineMap
Return the affine mapping from the iteration space of this memref's layout to the byte offset in linear memory.
Unlike the get_affine_map, this function accounts for element width.
Source code in xdsl/dialects/builtin.py
2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 | |
get_strides() -> Sequence[int | None] | None
Yields the strides of the memref for each dimension. The stride of a dimension is the number of elements that are skipped when incrementing the corresponding index by one.
Source code in xdsl/dialects/builtin.py
2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 | |
constr(element_type: IRDLAttrConstraint[_MemRefTypeElement] = AnyAttr(), *, shape: IRDLAttrConstraint | None = None, layout: IRDLAttrConstraint | None = None, memory_space: IRDLAttrConstraint | None = None) -> AttrConstraint[MemRefType[_MemRefTypeElement]]
staticmethod
Source code in xdsl/dialects/builtin.py
2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 | |
UnrankedMemRefType
dataclass
Bases: ParametrizedAttribute, BuiltinAttribute, TypeAttribute, ContainerType[_UnrankedMemRefTypeElems], Generic[_UnrankedMemRefTypeElems]
Source code in xdsl/dialects/builtin.py
2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 | |
name = 'unranked_memref'
class-attribute
instance-attribute
element_type: _UnrankedMemRefTypeElems
instance-attribute
memory_space: Attribute
instance-attribute
print_builtin(printer: Printer)
Source code in xdsl/dialects/builtin.py
2680 2681 2682 2683 2684 2685 2686 | |
from_type(referenced_type: _UnrankedMemRefTypeElemsInit, memory_space: Attribute = NoneAttr()) -> UnrankedMemRefType[_UnrankedMemRefTypeElemsInit]
staticmethod
Source code in xdsl/dialects/builtin.py
2688 2689 2690 2691 2692 2693 | |
get_element_type() -> _UnrankedMemRefTypeElems
Source code in xdsl/dialects/builtin.py
2695 2696 | |
DenseIntOrFPElementsAttr
dataclass
Bases: TypedAttribute, BuiltinAttribute, ContainerType[DenseElementCovT], Generic[DenseElementCovT]
Source code in xdsl/dialects/builtin.py
2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 | |
name = 'dense'
class-attribute
instance-attribute
type: RankedStructure[DenseElementCovT]
instance-attribute
data: BytesAttr
instance-attribute
shape_is_complete: bool
property
get_shape() -> tuple[int, ...]
Source code in xdsl/dialects/builtin.py
2725 2726 | |
get_element_type() -> DenseElementCovT
Source code in xdsl/dialects/builtin.py
2728 2729 | |
__len__() -> int
Source code in xdsl/dialects/builtin.py
2731 2732 | |
verify() -> None
Source code in xdsl/dialects/builtin.py
2748 2749 2750 2751 2752 2753 2754 | |
create_dense_int(type: RankedStructure[_IntegerAttrType], data: int | Sequence[int]) -> DenseIntOrFPElementsAttr[_IntegerAttrType]
staticmethod
Source code in xdsl/dialects/builtin.py
2756 2757 2758 2759 2760 2761 2762 2763 | |
create_dense_float(type: RankedStructure[_FloatAttrType], data: float | Sequence[float]) -> DenseIntOrFPElementsAttr[_FloatAttrType]
staticmethod
Source code in xdsl/dialects/builtin.py
2765 2766 2767 2768 2769 2770 2771 2772 2773 | |
create_dense_complex(type: RankedStructure[ComplexType], data: Sequence[tuple[float, float]] | Sequence[tuple[int, int]]) -> DenseIntOrFPElementsAttr[ComplexType]
staticmethod
create_dense_complex(
type: RankedStructure[ComplexType[_IntegerTypeInvT]],
data: Sequence[tuple[int, int]],
) -> DenseIntOrFPElementsAttr[
ComplexType[_IntegerTypeInvT]
]
create_dense_complex(
type: RankedStructure[ComplexType[_FloatAttrTypeInvT]],
data: Sequence[tuple[float, float]],
) -> DenseIntOrFPElementsAttr[
ComplexType[_FloatAttrTypeInvT]
]
Source code in xdsl/dialects/builtin.py
2789 2790 2791 2792 2793 2794 2795 | |
from_list(type: RankedStructure[AnyFloat | IntegerType | IndexType | ComplexType[IntegerType] | ComplexType[AnyFloat]], data: Sequence[int] | Sequence[float] | Sequence[tuple[int, int]] | Sequence[tuple[float, float]]) -> DenseIntOrFPElementsAttr
staticmethod
from_list(
type: RankedStructure[_FloatAttrTypeInvT],
data: Sequence[float],
) -> DenseIntOrFPElementsAttr[_FloatAttrTypeInvT]
from_list(
type: RankedStructure[_IntegerAttrTypeInvT],
data: Sequence[int],
) -> DenseIntOrFPElementsAttr[_IntegerAttrTypeInvT]
from_list(
type: RankedStructure[ComplexType[_IntegerTypeInvT]],
data: Sequence[tuple[int, int]],
) -> DenseIntOrFPElementsAttr[
ComplexType[_IntegerTypeInvT]
]
from_list(
type: RankedStructure[ComplexType[_FloatAttrTypeInvT]],
data: Sequence[tuple[float, float]],
) -> DenseIntOrFPElementsAttr[
ComplexType[_FloatAttrTypeInvT]
]
Source code in xdsl/dialects/builtin.py
2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 | |
iter_values() -> Iterator[int] | Iterator[float] | Iterator[tuple[int, int]] | Iterator[tuple[float, float]]
Return an iterator over all the values of the elements in this DenseIntOrFPElementsAttr
Source code in xdsl/dialects/builtin.py
2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 | |
get_int_values() -> Sequence[int]
Return all the values of the elements in this DenseIntOrFPElementsAttr, checking that the elements are integers.
Source code in xdsl/dialects/builtin.py
2866 2867 2868 2869 2870 2871 2872 2873 2874 | |
get_float_values() -> Sequence[float]
Return all the values of the elements in this DenseIntOrFPElementsAttr, checking that the elements are floats.
Source code in xdsl/dialects/builtin.py
2876 2877 2878 2879 2880 2881 2882 2883 2884 | |
get_complex_values() -> Sequence[tuple[int, int]] | Sequence[tuple[float, float]]
Return all the values of the elements in this DenseIntOrFPElementsAttr, checking that the elements are complex.
Source code in xdsl/dialects/builtin.py
2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 | |
get_values() -> tuple[int, ...] | tuple[float, ...] | tuple[tuple[int, int], ...] | tuple[tuple[float, float], ...]
get_values() -> tuple[int, ...]
get_values() -> tuple[float, ...]
get_values() -> tuple[tuple[int, int], ...]
get_values() -> tuple[tuple[float, float], ...]
get_values() -> (
tuple[int, ...]
| tuple[float, ...]
| tuple[tuple[int, int], ...]
| tuple[tuple[float, float], ...]
)
Return all the values of the elements in this DenseIntOrFPElementsAttr
Source code in xdsl/dialects/builtin.py
2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 | |
iter_attrs() -> Iterator[IntegerAttr] | Iterator[FloatAttr]
Return an iterator over all elements of the dense attribute in their relevant attribute representation (IntegerAttr / FloatAttr)
Source code in xdsl/dialects/builtin.py
2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 | |
get_attrs() -> Sequence[IntegerAttr] | Sequence[FloatAttr]
Return all elements of the dense attribute in their relevant attribute representation (IntegerAttr / FloatAttr)
Source code in xdsl/dialects/builtin.py
2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 | |
is_splat() -> bool
Return whether or not this dense attribute is defined entirely by a single value (splat).
Source code in xdsl/dialects/builtin.py
2961 2962 2963 2964 2965 2966 2967 | |
parse_with_type(parser: AttrParser, type: Attribute) -> TypedAttribute
staticmethod
Source code in xdsl/dialects/builtin.py
2969 2970 2971 2972 | |
print_without_type(printer: Printer)
Source code in xdsl/dialects/builtin.py
3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 | |
print_builtin(printer: Printer)
Source code in xdsl/dialects/builtin.py
3028 3029 3030 3031 | |