Resolver which turns a set of parallel move operations into a linear sequence of move operations. This is also responsible for inserting the necessary scratch registers for things like stack-to-stack moves and rematerialization into a stack slot.
| 526 | /// This is also responsible for inserting the necessary scratch registers for |
| 527 | /// things like stack-to-stack moves and rematerialization into a stack slot. |
| 528 | pub struct ParallelMoves { |
| 529 | /// Final list of moves generated by the parallel move resolver. |
| 530 | /// |
| 531 | /// The edits are stored in *reverse order* due to the way we generate them. |
| 532 | edits: Vec<Edit>, |
| 533 | |
| 534 | /// Set of parallel move operations that need to be resolved. |
| 535 | moves: PrimaryMap<MoveIndex, Move>, |
| 536 | |
| 537 | /// List of values that will be re-materialized separately after all moves |
| 538 | /// have been performed. |
| 539 | remat: Vec<(Value, RegClass, Allocation)>, |
| 540 | |
| 541 | /// Same as `remat` but for rematerializations where an intermediate scratch |
| 542 | /// register is needed. |
| 543 | remat_with_scratch: Vec<(Value, RegClass, Allocation)>, |
| 544 | |
| 545 | /// For each allocation unit that is written to by a move, this holds the |
| 546 | /// index of the move writing to it. |
| 547 | writes_to_unit: SparseMap<AllocationUnit, MoveIndex>, |
| 548 | |
| 549 | /// Allocator for scratch registers that may be needed to resolve cycles and |
| 550 | /// memory-to-memory moves. |
| 551 | scratch: ScratchAllocator, |
| 552 | |
| 553 | /// Stack for DFS. |
| 554 | stack: Vec<(Visit, MoveIndex)>, |
| 555 | } |
| 556 | |
| 557 | impl Default for ParallelMoves { |
| 558 | fn default() -> Self { |
nothing calls this directly
no outgoing calls
no test coverage detected