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

Method initial_value

src/internal/move_optimizer.rs:520–532  ·  view source on GitHub ↗

Simpler version of `def_value` used for to set up the initial block entry state. This is always called on a clean state and therefore doesn't need to worry about overlaps or clobbering existing values. However it does need to handle the case where a value is in multiple allocations at once, which `def_value` doesn't need to.

(&mut self, value: Value, alloc: Allocation, reginfo: &impl RegInfo)

Source from the content-addressed store, hash-verified

518 /// However it does need to handle the case where a value is in multiple
519 /// allocations at once, which `def_value` doesn't need to.
520 fn initial_value(&mut self, value: Value, alloc: Allocation, reginfo: &impl RegInfo) {
521 match alloc.kind() {
522 AllocationKind::PhysReg(reg) => {
523 for unit in reginfo.reg_units(reg) {
524 self.last_unit_write.insert_unique(unit, (reg, value));
525 }
526 self.value_regs.entry(value).or_default().insert(reg);
527 }
528 AllocationKind::SpillSlot(slot) => {
529 self.spillslot_values.insert_unique(slot, value);
530 }
531 }
532 }
533
534 /// Calls `def_value` for each member of a group.
535 fn def_value_group(

Callers 2

runMethod · 0.80
compute_entry_statesMethod · 0.80

Calls 6

reg_unitsMethod · 0.80
insert_uniqueMethod · 0.80
or_defaultMethod · 0.80
entryMethod · 0.80
kindMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected