From 70275a2a1d4b502e075bb0efbb1d92e0b76fbc42 Mon Sep 17 00:00:00 2001 From: Peter Huene Date: Tue, 25 Feb 2020 16:33:13 -0800 Subject: [PATCH 1/2] Change default opt-level for Config to `speed`. This commit changes the default opt-level for a new `Config` to `speed`. Fixes #981. --- crates/api/src/runtime.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crates/api/src/runtime.rs b/crates/api/src/runtime.rs index 09dea30bd777..f367328fa380 100644 --- a/crates/api/src/runtime.rs +++ b/crates/api/src/runtime.rs @@ -46,6 +46,11 @@ impl Config { .set("enable_verifier", "false") .expect("should be valid flag"); + // Turn on cranelift speed optimizations by default + flags + .set("opt_level", "speed") + .expect("should be valid flag"); + Config { debug_info: false, validating_config: ValidatingParserConfig { From 9ffa19ca64f1e5c054e0ab99a0de0c5d279f3d18 Mon Sep 17 00:00:00 2001 From: Peter Huene Date: Wed, 26 Feb 2020 10:14:48 -0800 Subject: [PATCH 2/2] Disable optimizations for SIMD testsuite tests. --- tests/wast_testsuites.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/wast_testsuites.rs b/tests/wast_testsuites.rs index 543bed93775f..a4a1d0e64ffb 100644 --- a/tests/wast_testsuites.rs +++ b/tests/wast_testsuites.rs @@ -1,5 +1,5 @@ use std::path::Path; -use wasmtime::{Config, Engine, Store, Strategy}; +use wasmtime::{Config, Engine, OptLevel, Store, Strategy}; use wasmtime_wast::WastContext; include!(concat!(env!("OUT_DIR"), "/wast_testsuite_tests.rs")); @@ -24,6 +24,12 @@ fn run_wast(wast: &str, strategy: Strategy) -> anyhow::Result<()> { .wasm_multi_value(multi_val) .strategy(strategy)? .cranelift_debug_verifier(true); + + // FIXME: https://github.com/bytecodealliance/cranelift/issues/1409 + if simd { + cfg.cranelift_opt_level(OptLevel::None); + } + let store = Store::new(&Engine::new(&cfg)); let mut wast_context = WastContext::new(store); wast_context.register_spectest()?;