From 9ea5226b891c502f3195732d3e8705a11849ff3d Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Wed, 30 Aug 2017 14:32:42 -0700 Subject: [PATCH] Add simple_gvn to the optimization pipeline for WebAssembly functions. --- cranelift/src/wasm.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/cranelift/src/wasm.rs b/cranelift/src/wasm.rs index c83df807fc..49292dbe29 100644 --- a/cranelift/src/wasm.rs +++ b/cranelift/src/wasm.rs @@ -196,6 +196,18 @@ fn handle_module(flag_verbose: bool, } } }; + match context.simple_gvn() { + Ok(())=> (), + Err(error) => { + match error { + CtonError::Verifier(err) => { + return Err(pretty_verifier_error(&context.func, None, err)); + } + CtonError::ImplLimitExceeded | + CtonError::CodeTooLarge => return Err(String::from(error.description())), + } + } + }; match verifier::verify_context(&context.func, &context.cfg, &context.domtree, None) { Ok(()) => (), Err(err) => return Err(pretty_verifier_error(&context.func, None, err)),