| 62 | } |
| 63 | |
| 64 | pub struct MoveOptimizer { |
| 65 | /// State tracker used for processing blocks. |
| 66 | state_tracker: StateTracker, |
| 67 | |
| 68 | /// Set of values and their allocations on entry to a block. |
| 69 | /// |
| 70 | /// A single entry state may be shared by multiple blocks if they have the |
| 71 | /// same predecessor block. |
| 72 | entry_states: PrimaryMap<EntryState, SmallVec<[(Allocation, Value); 15]>>, |
| 73 | |
| 74 | /// For each block, the state that it has on entry when processing it. |
| 75 | /// |
| 76 | /// This must be some for blocks that are in the queue or have been |
| 77 | /// processed. |
| 78 | block_entry_states: SecondaryMap<Block, PackedOption<EntryState>>, |
| 79 | |
| 80 | /// Queue of blocks that need to be pre-processed. |
| 81 | /// |
| 82 | /// For faster convergence, we always pre-process the lower-index blocks |
| 83 | /// first. |
| 84 | blocks_to_preprocess: BinaryHeap<Reverse<Block>>, |
| 85 | |
| 86 | /// Set of blocks in `blocks_to_process`. |
| 87 | blocks_in_queue: EntitySet<Block>, |
| 88 | } |
| 89 | |
| 90 | impl MoveOptimizer { |
| 91 | pub fn new() -> Self { |
nothing calls this directly
no outgoing calls
no test coverage detected