| 31 | /// Entry in the priority queue. |
| 32 | #[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord)] |
| 33 | struct Entry { |
| 34 | /// The priority and index are encoded in a single `u64` for performance. |
| 35 | /// |
| 36 | /// The bit encoding is designed to prioritize virtual registers as follows: |
| 37 | /// - Earlier allocation stages are processed first. |
| 38 | /// - Virtual registers with a fixed-register hint are prioritized. |
| 39 | /// - Larger groups are harder to allocate, and so are prioritized. |
| 40 | /// - Large live ranges are harder to allocate, and so are prioritized. |
| 41 | /// - The virtual register index is used as a tiebreaker. It is negated to |
| 42 | /// prefer lower-indexed virtual registers when the size is the same. |
| 43 | /// |
| 44 | /// stage:1 has_fixed_hint:1 group_size:3 size:27 index:32 |
| 45 | bits: u64, |
| 46 | } |
| 47 | |
| 48 | // The above encoding assumes a maximum group size of 8. |
| 49 | const _: () = assert!(MAX_GROUP_SIZE == 8); |
nothing calls this directly
no outgoing calls
no test coverage detected