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

Method hints_for_split

src/internal/hints.rs:195–208  ·  view source on GitHub ↗

Given a live range split, returns whether the left and right sides of the split still have a fixed register hint.

(
        &self,
        value: Value,
        seg: LiveRangeSegment,
        split_at: Inst,
    )

Source from the content-addressed store, hash-verified

193 /// Given a live range split, returns whether the left and right sides of
194 /// the split still have a fixed register hint.
195 pub fn hints_for_split(
196 &self,
197 value: Value,
198 seg: LiveRangeSegment,
199 split_at: Inst,
200 ) -> (bool, bool) {
201 let start = HintKey::incoming(value, seg.from.inst());
202 let end = HintKey::outgoing(value, seg.to.round_to_next_inst().inst());
203 let mid_key = HintKey::incoming(value, split_at);
204 let mid = self.hints.partition_point(|hint| hint.key < mid_key);
205 let first = mid != 0 && self.hints[mid - 1].key >= start;
206 let second = self.hints.get(mid).is_some_and(|hint| hint.key <= end);
207 (first, second)
208 }
209}

Callers 1

split_atMethod · 0.80

Calls 3

round_to_next_instMethod · 0.80
instMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected