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 f84e218a93
commit e941a7db5f
7 changed files with 52 additions and 28 deletions

View File

@@ -42,10 +42,9 @@ impl SubTest for TestRegalloc {
let mut comp_ctx = cretonne::Context::new();
comp_ctx.func = func.into_owned();
comp_ctx.flowgraph();
// TODO: Should we have an option to skip legalization?
comp_ctx.legalize(isa);
comp_ctx.flowgraph();
comp_ctx.regalloc(isa);
let mut text = String::new();