Run verifier after legalizer and regalloc file tests.
Run the verify_contexti() function after invoking the legalize() and regalloc() context functions. This will help catch bad code produced by these passes.
This commit is contained in:
@@ -15,6 +15,7 @@ use ir::Function;
|
||||
use isa::TargetIsa;
|
||||
use legalize_function;
|
||||
use regalloc;
|
||||
use verifier;
|
||||
|
||||
/// Persistent data structures and compilation pipeline.
|
||||
pub struct Context {
|
||||
@@ -45,6 +46,16 @@ impl Context {
|
||||
}
|
||||
}
|
||||
|
||||
/// Run the verifier on the function.
|
||||
///
|
||||
/// Also check that the dominator tree and control flow graph are consistent with the function.
|
||||
///
|
||||
/// 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)
|
||||
}
|
||||
|
||||
/// Run the legalizer for `isa` on the function.
|
||||
pub fn legalize(&mut self, isa: &TargetIsa) {
|
||||
legalize_function(&mut self.func, &mut self.cfg, isa);
|
||||
|
||||
Reference in New Issue
Block a user