Skip to content

Commit

Permalink
Merge pull request #988 from peterhuene/default-opt-level
Browse files Browse the repository at this point in the history
Change default opt-level for Config to `speed`.
  • Loading branch information
peterhuene authored Feb 26, 2020
2 parents 427fc9a + 9ffa19c commit 0c23c2e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
5 changes: 5 additions & 0 deletions crates/api/src/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
8 changes: 7 additions & 1 deletion tests/wast_testsuites.rs
Original file line number Diff line number Diff line change
@@ -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"));
Expand All @@ -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()?;
Expand Down

0 comments on commit 0c23c2e

Please sign in to comment.