From 7c7b1651d89f2f968f337e78b1aa14abdb9eb2fd Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Mon, 2 Oct 2017 16:57:14 -0700 Subject: [PATCH] Do a full compile in 'cton-util wasm'. This removes the `optimize` option, as one can do that with `--set`, eg. `--set opt_level=best`. And it adds an option to print the compilation output. And, it enables simple_gvn and licm for opt_level=best. --- lib/cretonne/src/context.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/cretonne/src/context.rs b/lib/cretonne/src/context.rs index cd402873e8..4b62721fff 100644 --- a/lib/cretonne/src/context.rs +++ b/lib/cretonne/src/context.rs @@ -18,7 +18,7 @@ use isa::TargetIsa; use legalize_function; use regalloc; use result::{CtonError, CtonResult}; -use settings::FlagsOrIsa; +use settings::{FlagsOrIsa, OptLevel}; use verifier; use simple_gvn::do_simple_gvn; use licm::do_licm; @@ -68,6 +68,12 @@ impl Context { self.compute_cfg(); self.legalize(isa)?; + if isa.flags().opt_level() == OptLevel::Best { + self.compute_domtree(); + self.compute_loop_analysis(); + self.licm(isa)?; + self.simple_gvn(isa)?; + } self.compute_domtree(); self.regalloc(isa)?; self.prologue_epilogue(isa)?;