diff options
author | Alon Zakai <azakai@google.com> | 2019-05-02 13:09:18 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-02 13:09:18 -0700 |
commit | b394fcc887dbb2e02b5ff5b307004e4dc7ec2baf (patch) | |
tree | 0610ee3fea56d492adef79345bae271e8be3b334 /test/unit.fromasm.imprecise | |
parent | 01a4bfdb5c28d54fd480d603cba2d35c943a0bf5 (diff) | |
download | binaryen-b394fcc887dbb2e02b5ff5b307004e4dc7ec2baf.tar.gz binaryen-b394fcc887dbb2e02b5ff5b307004e4dc7ec2baf.tar.bz2 binaryen-b394fcc887dbb2e02b5ff5b307004e4dc7ec2baf.zip |
Optimize mutable globals (#2066)
If a global is marked mutable but not assigned to, make it immutable.
If an immutable global is a copy of another, use the original, so we can remove the duplicates.
Fixes #2011
Diffstat (limited to 'test/unit.fromasm.imprecise')
-rw-r--r-- | test/unit.fromasm.imprecise | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/test/unit.fromasm.imprecise b/test/unit.fromasm.imprecise index b40a5bd06..62b517f87 100644 --- a/test/unit.fromasm.imprecise +++ b/test/unit.fromasm.imprecise @@ -20,8 +20,7 @@ (import "env" "emscripten_log" (func $emscripten_log)) (import "asm2wasm" "f64-rem" (func $f64-rem (param f64 f64) (result f64))) (global $Int (mut i32) (i32.const 0)) - (global $Double (mut f64) (f64.const 0)) - (global $n (mut i32) (global.get $n$asm2wasm$import)) + (global $Double f64 (f64.const 0)) (global $nonZero (mut i32) (i32.const 1337)) (global $exportedNumber i32 (i32.const 42)) (export "big_negative" (func $big_negative)) @@ -119,7 +118,7 @@ ) (if (i32.gt_s - (global.get $n) + (global.get $n$asm2wasm$import) (i32.const 0) ) (return @@ -433,7 +432,7 @@ (i32.store (local.get $0) (i32.add - (global.get $n) + (global.get $n$asm2wasm$import) (i32.const 144) ) ) |