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

Function validate_function

src/debug_utils/validate_func.rs:30–42  ·  view source on GitHub ↗

Checks `func` to ensure it satisfies all of the pre-conditions required by the register allocator. As long as this validation succeeds, the register allocator is guaranteed to produce a valid allocation. The only exception is if operands are overconstrained: the register allocator may still fail in that case even if validation passes. This assumes that `reginfo` has already been validated by [`v

(func: &impl Function, reginfo: &impl RegInfo)

Source from the content-addressed store, hash-verified

28///
29/// [`validate_reginfo`]: super::validate_reginfo()
30pub fn validate_function(func: &impl Function, reginfo: &impl RegInfo) -> Result<()> {
31 let mut ctx = Context {
32 func,
33 reginfo,
34 value_defs: SecondaryMap::with_max_index(func.num_values()),
35 early_fixed: RegUnitSet::new(),
36 late_fixed: RegUnitSet::new(),
37 reuse_targets: vec![],
38 domtree: DominatorTree::new(),
39 };
40 ctx.check_function()?;
41 Ok(())
42}
43
44/// An entity reference.
45///

Callers 1

load_functionFunction · 0.85

Calls 2

num_valuesMethod · 0.45
check_functionMethod · 0.45

Tested by

no test coverage detected