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

@@ -12,7 +12,7 @@ use regalloc::coloring::Coloring;
use regalloc::live_value_tracker::LiveValueTracker;
use regalloc::liveness::Liveness;
use result::CtonResult;
use verifier::verify_liveness;
use verifier::{verify_context, verify_liveness};
/// Persistent memory allocations for register allocation.
pub struct Context {
@@ -62,6 +62,10 @@ impl Context {
self.coloring
.run(isa, func, domtree, &mut self.liveness, &mut self.tracker);
if isa.flags().enable_verifier() {
verify_context(func, cfg, domtree)?;
verify_liveness(isa, func, cfg, &self.liveness)?;
}
Ok(())
}
}