From 3eeea2438fc79db95c34325853e9406e44d9832e Mon Sep 17 00:00:00 2001 From: Vadim Smirnov Date: Tue, 25 Jul 2023 11:18:16 +0300 Subject: [PATCH] feat(wasm-builder,wasm-opt): use only mvp features, enable sign-ext (#2976) --- utils/wasm-builder/src/optimize.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/utils/wasm-builder/src/optimize.rs b/utils/wasm-builder/src/optimize.rs index 0ad73346ecf..0702aa49ea6 100644 --- a/utils/wasm-builder/src/optimize.rs +++ b/utils/wasm-builder/src/optimize.rs @@ -225,6 +225,8 @@ pub fn do_optimization( .arg(format!("-O{optimization_level}")) .arg("-o") .arg(dest_optimized) + .arg("-mvp") + .arg("--enable-sign-ext") // the memory in our module is imported, `wasm-opt` needs to be told that // the memory is initialized to zeroes, otherwise it won't run the // memory-packing pre-pass. @@ -277,6 +279,8 @@ pub fn do_optimization( "z" => OptimizationOptions::new_optimize_for_size_aggressively(), _ => panic!("Invalid optimization level {}", optimization_level), } + .mvp_features_only() + .enable_feature(wasm_opt::Feature::SignExt) .shrink_level(wasm_opt::ShrinkLevel::Level2) .add_pass(Pass::Dae) .add_pass(Pass::Vacuum)