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)
| 28 | /// |
| 29 | /// [`validate_reginfo`]: super::validate_reginfo() |
| 30 | pub 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 | /// |
no test coverage detected