MCPcopy Create free account
hub / github.com/Amanieu/regalloc3 / Entry

Class Entry

src/internal/allocator/queue.rs:33–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31/// Entry in the priority queue.
32#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord)]
33struct 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.
49const _: () = assert!(MAX_GROUP_SIZE == 8);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected