Assign multiple values to a Register (dest = src1, src2, ...). This is used to initialize RArray values. It's provided to avoid very verbose IR for common vectorcall operations. Note that this interacts atypically with reference counting. We assume that each RArray register is init
| 349 | |
| 350 | @final |
| 351 | class AssignMulti(BaseAssign): |
| 352 | """Assign multiple values to a Register (dest = src1, src2, ...). |
| 353 | |
| 354 | This is used to initialize RArray values. It's provided to avoid |
| 355 | very verbose IR for common vectorcall operations. |
| 356 | |
| 357 | Note that this interacts atypically with reference counting. We |
| 358 | assume that each RArray register is initialized exactly once |
| 359 | with this op. |
| 360 | """ |
| 361 | |
| 362 | error_kind = ERR_NEVER |
| 363 | |
| 364 | def __init__(self, dest: Register, src: list[Value], line: int = -1) -> None: |
| 365 | super().__init__(dest, line) |
| 366 | assert src |
| 367 | assert isinstance(dest.type, RArray) |
| 368 | assert dest.type.length == len(src) |
| 369 | self.src = src |
| 370 | |
| 371 | def sources(self) -> list[Value]: |
| 372 | return self.src.copy() |
| 373 | |
| 374 | def set_sources(self, new: list[Value]) -> None: |
| 375 | self.src = new[:] |
| 376 | |
| 377 | def stolen(self) -> list[Value]: |
| 378 | return [] |
| 379 | |
| 380 | def accept(self, visitor: OpVisitor[T]) -> T: |
| 381 | return visitor.visit_assign_multi(self) |
| 382 | |
| 383 | |
| 384 | class ControlOp(Op): |
no outgoing calls
searching dependent graphs…