diff options
author | Alon Zakai <azakai@google.com> | 2019-03-06 14:12:26 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2019-03-06 16:34:34 -0800 |
commit | 83aa0dc2daf327ed264cc22e51af1a866787a764 (patch) | |
tree | 70660819a1cd694c9776b0eb93db7c162eab274f /test/wasm2js/left-to-right.2asm.js | |
parent | 22fe3269f79c38c7954967ec303642b5168844c3 (diff) | |
download | binaryen-83aa0dc2daf327ed264cc22e51af1a866787a764.tar.gz binaryen-83aa0dc2daf327ed264cc22e51af1a866787a764.tar.bz2 binaryen-83aa0dc2daf327ed264cc22e51af1a866787a764.zip |
Optimize added constants with propagation only if we see we will remove all uses of the original add, as otherwise we may just be adding work (both an offset, and an add). Refactor local-utils.h, and make UnneededSetRemover also check for side effects, so it cleanly removes all traces of unneeded sets.
Diffstat (limited to 'test/wasm2js/left-to-right.2asm.js')
-rw-r--r-- | test/wasm2js/left-to-right.2asm.js | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/test/wasm2js/left-to-right.2asm.js b/test/wasm2js/left-to-right.2asm.js index 959190b04..2f0855615 100644 --- a/test/wasm2js/left-to-right.2asm.js +++ b/test/wasm2js/left-to-right.2asm.js @@ -989,34 +989,28 @@ function asmFunc(global, env, buffer) { } function $88() { - var $0 = 0, i64toi32_i32$0 = 0, wasm2js_i32$0 = 0, wasm2js_i32$1 = 0; + var wasm2js_i32$0 = 0, wasm2js_i32$1 = 0; reset(); - $0 = i32_left() | 0; - i64toi32_i32$0 = i64_right() | 0; - wasm2js_i32$0 = $0; - wasm2js_i32$1 = i64toi32_i32$0; + wasm2js_i32$0 = i32_left() | 0; + wasm2js_i32$1 = i64_right() | 0; HEAP8[wasm2js_i32$0 >> 0] = wasm2js_i32$1; return get() | 0 | 0; } function $89() { - var $0 = 0, i64toi32_i32$0 = 0, wasm2js_i32$0 = 0, wasm2js_i32$1 = 0; + var wasm2js_i32$0 = 0, wasm2js_i32$1 = 0; reset(); - $0 = i32_left() | 0; - i64toi32_i32$0 = i64_right() | 0; - wasm2js_i32$0 = $0; - wasm2js_i32$1 = i64toi32_i32$0; + wasm2js_i32$0 = i32_left() | 0; + wasm2js_i32$1 = i64_right() | 0; HEAP16[wasm2js_i32$0 >> 1] = wasm2js_i32$1; return get() | 0 | 0; } function $90() { - var $0 = 0, i64toi32_i32$0 = 0, wasm2js_i32$0 = 0, wasm2js_i32$1 = 0; + var wasm2js_i32$0 = 0, wasm2js_i32$1 = 0; reset(); - $0 = i32_left() | 0; - i64toi32_i32$0 = i64_right() | 0; - wasm2js_i32$0 = $0; - wasm2js_i32$1 = i64toi32_i32$0; + wasm2js_i32$0 = i32_left() | 0; + wasm2js_i32$1 = i64_right() | 0; HEAP32[wasm2js_i32$0 >> 2] = wasm2js_i32$1; return get() | 0 | 0; } @@ -1061,7 +1055,7 @@ function asmFunc(global, env, buffer) { } function $93() { - var i64toi32_i32$0 = 0, i64toi32_i32$1 = 0, i64toi32_i32$4 = 0, $0 = 0, $0$hi = 0, $1 = 0, $1$hi = 0; + var i64toi32_i32$0 = 0, i64toi32_i32$1 = 0, $0 = 0, $0$hi = 0, $1 = 0, $1$hi = 0, i64toi32_i32$4 = 0; reset(); i64toi32_i32$0 = i64_left() | 0; i64toi32_i32$1 = i64toi32_i32$HIGH_BITS; @@ -2206,7 +2200,7 @@ function asmFunc(global, env, buffer) { var$0$hi = var$0$hi | 0; var$1 = var$1 | 0; var$1$hi = var$1$hi | 0; - var i64toi32_i32$0 = 0, i64toi32_i32$1 = 0, i64toi32_i32$2 = 0, wasm2js_i32$0 = 0; + var i64toi32_i32$1 = 0, i64toi32_i32$0 = 0, i64toi32_i32$2 = 0, wasm2js_i32$0 = 0; i64toi32_i32$0 = var$0$hi; i64toi32_i32$0 = var$1$hi; i64toi32_i32$0 = var$0$hi; |