Add a ControlFlowGraph argument to legalize_function.

Legalizing some instructions may require modifications to the control
flow graph, and some operations need to use the CFG analysis.

The CFG reference is threaded through all the legalization functions to
reach the generated expansion functions as well as the legalizer::split
module where it will be used first.
This commit is contained in:
Jakob Stoklund Olesen
2017-03-21 15:48:08 -07:00
parent a9056f699e
commit ca6e402b90
7 changed files with 52 additions and 28 deletions

View File

@@ -47,7 +47,7 @@ impl Context {
/// Run the legalizer for `isa` on the function.
pub fn legalize(&mut self, isa: &TargetIsa) {
legalize_function(&mut self.func, isa);
legalize_function(&mut self.func, &mut self.cfg, isa);
}
/// Recompute the control flow graph and dominator tree.