Run the post-regalloc verification inside the regalloc context.

This means that we can verify the basics with verify_context before
moving on to verifying the liveness information.

Live ranges are now verified immediately after computing them and after
register allocation is complete.
This commit is contained in:
Jakob Stoklund Olesen
2017-04-21 16:23:33 -07:00
parent c5da572ebb
commit d0d5f3bb26
3 changed files with 13 additions and 10 deletions

View File

@@ -54,7 +54,7 @@ impl Context {
/// The `TargetIsa` argument is currently unused, but the verifier will soon be able to also
/// check ISA-dependent constraints.
pub fn verify<'a, ISA: Into<Option<&'a TargetIsa>>>(&self, _isa: ISA) -> verifier::Result {
verifier::verify_context(self)
verifier::verify_context(&self.func, &self.cfg, &self.domtree)
}
/// Run the verifier only if the `enable_verifier` setting is true.
@@ -81,7 +81,6 @@ impl Context {
/// Run the register allocator.
pub fn regalloc(&mut self, isa: &TargetIsa) -> CtonResult {
self.regalloc
.run(isa, &mut self.func, &self.cfg, &self.domtree)?;
self.verify_if(isa)
.run(isa, &mut self.func, &self.cfg, &self.domtree)
}
}