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.
This commit is contained in:
Dan Gohman
2017-10-02 16:57:14 -07:00
parent 25b8b45a41
commit 7c7b1651d8

View File

@@ -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)?;