Immutable ir
immutable_ir
ISSAValue
dataclass
Bases: ABC
Represents an immutable SSA variable. An immutable SSA variable is either an operation result or a basic block argument.
Source code in xdsl/rewriting/composable_rewriting/immutable_ir/immutable_ir.py
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | |
type: Attribute
instance-attribute
users: IList[IOperation]
instance-attribute
__init__(type: Attribute, users: IList[IOperation]) -> None
IOpResult
dataclass
Bases: ISSAValue
Represents an immutable SSA variable defined by an operation result.
Source code in xdsl/rewriting/composable_rewriting/immutable_ir/immutable_ir.py
49 50 51 52 53 54 55 56 57 58 59 60 61 62 | |
op: IOperation
instance-attribute
index: int
instance-attribute
__init__(type: Attribute, users: IList[IOperation], op: IOperation, index: int) -> None
__hash__() -> int
Source code in xdsl/rewriting/composable_rewriting/immutable_ir/immutable_ir.py
56 57 | |
__eq__(other: object) -> bool
Source code in xdsl/rewriting/composable_rewriting/immutable_ir/immutable_ir.py
59 60 61 62 | |
IBlockArg
dataclass
Bases: ISSAValue
Represents an immutable SSA variable defined by a basic block.
Source code in xdsl/rewriting/composable_rewriting/immutable_ir/immutable_ir.py
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 | |
block: IBlock
instance-attribute
index: int
instance-attribute
__init__(type: Attribute, users: IList[IOperation], block: IBlock, index: int) -> None
__hash__() -> int
Source code in xdsl/rewriting/composable_rewriting/immutable_ir/immutable_ir.py
72 73 | |
__eq__(other: object) -> bool
Source code in xdsl/rewriting/composable_rewriting/immutable_ir/immutable_ir.py
75 76 | |
__repr__() -> str
Source code in xdsl/rewriting/composable_rewriting/immutable_ir/immutable_ir.py
78 79 | |
IRegion
dataclass
An immutable region contains a CFG of immutable blocks. IRegions are contained in operations.
Source code in xdsl/rewriting/composable_rewriting/immutable_ir/immutable_ir.py
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 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 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 196 197 198 199 200 201 202 203 204 | |
blocks: IList[IBlock]
instance-attribute
Immutable blocks contained in the IRegion. The first block is the entry block.
block: IBlock
property
Returns the block of a single-block region. Returns an exception if the region is not single-block.
ops: IList[IOperation]
property
Get the operations of a single-block region. Returns an exception if the region is not single-block.
__hash__() -> int
Source code in xdsl/rewriting/composable_rewriting/immutable_ir/immutable_ir.py
89 90 | |
__eq__(value: object) -> bool
Source code in xdsl/rewriting/composable_rewriting/immutable_ir/immutable_ir.py
92 93 | |
__init__(blocks: Sequence[IBlock])
Creates a new immutable region from a sequence of immutable blocks.
Source code in xdsl/rewriting/composable_rewriting/immutable_ir/immutable_ir.py
121 122 123 124 125 | |
from_mutable(blocks: Iterable[Block], value_map: dict[SSAValue, ISSAValue] | None = None, block_map: dict[Block, IBlock] | None = None) -> IRegion
classmethod
Creates a new immutable region from a sequence of mutable blocks. The value_map and block_map are used to map already known correspondings of mutable values to immutable values and mutable blocks to immutable blocks.
Source code in xdsl/rewriting/composable_rewriting/immutable_ir/immutable_ir.py
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 | |
to_mutable(value_mapping: dict[ISSAValue, SSAValue] | None = None, block_mapping: dict[IBlock, Block] | None = None) -> Region
Returns a mutable region that is a copy of this immutable region. The value_mapping and block_mapping are used to map already known correspondings of immutable values to mutable values and immutable blocks to mutable blocks.
Source code in xdsl/rewriting/composable_rewriting/immutable_ir/immutable_ir.py
181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 | |
IBlock
dataclass
An immutable block contains a list of immutable operations. IBlocks are contained in IRegions.
Source code in xdsl/rewriting/composable_rewriting/immutable_ir/immutable_ir.py
207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 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 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 | |
args: IList[IBlockArg]
instance-attribute
ops: IList[IOperation]
instance-attribute
arg_types: list[Attribute]
property
__hash__() -> int
Source code in xdsl/rewriting/composable_rewriting/immutable_ir/immutable_ir.py
219 220 | |
__eq__(value: object) -> bool
Source code in xdsl/rewriting/composable_rewriting/immutable_ir/immutable_ir.py
222 223 | |
__repr__() -> str
Source code in xdsl/rewriting/composable_rewriting/immutable_ir/immutable_ir.py
225 226 227 228 | |
__post_init__()
Source code in xdsl/rewriting/composable_rewriting/immutable_ir/immutable_ir.py
230 231 232 | |
__init__(args: Sequence[Attribute] | Sequence[IBlockArg], ops: Sequence[IOperation])
Creates a new immutable block.
Source code in xdsl/rewriting/composable_rewriting/immutable_ir/immutable_ir.py
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 | |
from_mutable(block: Block, value_map: dict[SSAValue, ISSAValue] | None = None, block_map: dict[Block, IBlock] | None = None) -> IBlock
classmethod
Creates an immutable block from a mutable block. The value_map and block_map are used to map already known correspondings of mutable values to immutable values and mutable blocks to immutable blocks.
Source code in xdsl/rewriting/composable_rewriting/immutable_ir/immutable_ir.py
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 292 293 294 295 296 297 298 299 300 301 | |
to_mutable(value_mapping: dict[ISSAValue, SSAValue] | None = None, block_mapping: dict[IBlock, Block] | None = None) -> Block
Returns a mutable block that is a copy of this immutable block. The value_mapping and block_mapping are used to map already known correspondings of immutable values to mutable values and immutable blocks to mutable blocks.
Source code in xdsl/rewriting/composable_rewriting/immutable_ir/immutable_ir.py
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 | |
IOperation
dataclass
Represents an immutable operation.
Source code in xdsl/rewriting/composable_rewriting/immutable_ir/immutable_ir.py
340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 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 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 | |
__match_args__ = ('op_type', 'operands', 'results', 'successors', 'regions')
class-attribute
instance-attribute
name: str
instance-attribute
op_type: type[Operation]
instance-attribute
properties: immutabledict[str, Attribute]
instance-attribute
attributes: immutabledict[str, Attribute]
instance-attribute
operands: IList[ISSAValue]
instance-attribute
results: IList[IOpResult]
instance-attribute
successors: IList[IBlock]
instance-attribute
regions: IList[IRegion]
instance-attribute
result: IOpResult
property
Get the result of a of an IOperation with a single result. Returns an exception if the operation does not have exactly one result.
region: IRegion
property
Get the region of a of an IOperation with a single region. Returns an exception if the operation does not have exactly one region.
result_types: list[Attribute]
property
__init__(name: str, op_type: type[Operation], attributes: immutabledict[str, Attribute], properties: immutabledict[str, Attribute], operands: Sequence[ISSAValue], result_types: Sequence[Attribute], successors: Sequence[IBlock], regions: Sequence[IRegion]) -> None
Source code in xdsl/rewriting/composable_rewriting/immutable_ir/immutable_ir.py
354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 | |
get(name: str, op_type: type[Operation], operands: Sequence[ISSAValue], result_types: Sequence[Attribute], attributes: immutabledict[str, Attribute], properties: immutabledict[str, Attribute], successors: Sequence[IBlock], regions: Sequence[IRegion]) -> IOperation
classmethod
Source code in xdsl/rewriting/composable_rewriting/immutable_ir/immutable_ir.py
390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 | |
__hash__() -> int
Source code in xdsl/rewriting/composable_rewriting/immutable_ir/immutable_ir.py
413 414 | |
__eq__(value: object) -> bool
Source code in xdsl/rewriting/composable_rewriting/immutable_ir/immutable_ir.py
416 417 | |
to_mutable(value_mapping: dict[ISSAValue, SSAValue] | None = None, block_mapping: dict[IBlock, Block] | None = None) -> Operation
Returns a mutable operation that is a copy of this immutable operation. The value_mapping and block_mapping are used to map already known correspondings of immutable values to mutable values and immutable blocks to mutable blocks.
Source code in xdsl/rewriting/composable_rewriting/immutable_ir/immutable_ir.py
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 | |
from_mutable(op: Operation, value_map: dict[SSAValue, ISSAValue] | None = None, block_map: dict[Block, IBlock] | None = None, existing_operands: Sequence[ISSAValue] | None = None) -> IOperation
classmethod
Returns an immutable operation that is a copy of the given mutable operation. The value_map and block_map are used to map already known correspondings of mutable values to immutable values and mutable blocks to immutable blocks.
Source code in xdsl/rewriting/composable_rewriting/immutable_ir/immutable_ir.py
510 511 512 513 514 515 516 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 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 | |
get_attribute(name: str) -> Attribute
Source code in xdsl/rewriting/composable_rewriting/immutable_ir/immutable_ir.py
585 586 | |
get_attributes_copy() -> dict[str, Attribute]
Source code in xdsl/rewriting/composable_rewriting/immutable_ir/immutable_ir.py
588 589 | |
get_immutable_copy(op: Operation) -> IOperation
Source code in xdsl/rewriting/composable_rewriting/immutable_ir/immutable_ir.py
336 337 | |