Move verify calls out of Context.

Also, move flowgraph() calls out of filetest and into the passes that
need them so that filetest doesn't have embedded knowledge of these
dependencies.

This resolves a TODO about the way Context was running the verifier, and
it makes the Context functions and the filetest runners more transparent.

This also fixes simple_gvn to use the existing dominator tree rather
than computing its own.
This commit is contained in:
Dan Gohman
2017-09-12 15:38:30 -07:00
parent 69f8174c03
commit 9d0d6b5a1b
8 changed files with 37 additions and 32 deletions

View File

@@ -116,22 +116,18 @@ impl Context {
}
/// Perform simple GVN on the function.
pub fn simple_gvn(&mut self) -> CtonResult {
do_simple_gvn(&mut self.func, &mut self.cfg);
// TODO: Factor things such that we can get a Flags and test
// enable_verifier().
self.verify(None).map_err(Into::into)
pub fn simple_gvn(&mut self) {
do_simple_gvn(&mut self.func, &mut self.cfg, &mut self.domtree)
}
/// Perform LICM on the function.
pub fn licm(&mut self) -> CtonResult {
pub fn licm(&mut self) {
do_licm(
&mut self.func,
&mut self.cfg,
&mut self.domtree,
&mut self.loop_analysis,
);
self.verify(None).map_err(Into::into)
)
}
/// Run the register allocator.