diff options
author | Alon Zakai <azakai@google.com> | 2019-05-01 10:43:01 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-01 10:43:01 -0700 |
commit | 73709b4da08d285c2237c8c23a54ba53274c0c7f (patch) | |
tree | 2f428e5367c511b22391a8c471edbc0e7ed0688a /test/wasm2js/i64-add-sub.2asm.js | |
parent | ac93469d7fde75397403db94d9bf0c1bac0cf60f (diff) | |
download | binaryen-73709b4da08d285c2237c8c23a54ba53274c0c7f.tar.gz binaryen-73709b4da08d285c2237c8c23a54ba53274c0c7f.tar.bz2 binaryen-73709b4da08d285c2237c8c23a54ba53274c0c7f.zip |
wasm2js: run more optimizations (#2073)
In particular, coalesce-locals is useful even if closure is run later (apparently it finds stuff closure can't).
Diffstat (limited to 'test/wasm2js/i64-add-sub.2asm.js')
-rw-r--r-- | test/wasm2js/i64-add-sub.2asm.js | 307 |
1 files changed, 135 insertions, 172 deletions
diff --git a/test/wasm2js/i64-add-sub.2asm.js b/test/wasm2js/i64-add-sub.2asm.js index d27bbe3e4..f0fdcb6ac 100644 --- a/test/wasm2js/i64-add-sub.2asm.js +++ b/test/wasm2js/i64-add-sub.2asm.js @@ -21,49 +21,38 @@ function asmFunc(global, env, buffer) { var abort = env.abort; var nan = global.NaN; var infinity = global.Infinity; - function $1($0, $0$hi, $1_1, $1$hi, r, r$hi) { + function $1($0, $1_1, $2_1, $3, $4, $5) { $0 = $0 | 0; - $0$hi = $0$hi | 0; $1_1 = $1_1 | 0; - $1$hi = $1$hi | 0; - r = r | 0; - r$hi = r$hi | 0; - var i64toi32_i32$5 = 0, i64toi32_i32$3 = 0, i64toi32_i32$4 = 0, $5$hi = 0; - i64toi32_i32$3 = $1_1; - i64toi32_i32$4 = $0 + i64toi32_i32$3 | 0; - i64toi32_i32$5 = $0$hi + $1$hi | 0; - if (i64toi32_i32$4 >>> 0 < i64toi32_i32$3 >>> 0) { - i64toi32_i32$5 = i64toi32_i32$5 + 1 | 0 + $2_1 = $2_1 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $6 = 0; + $6 = $0 + $2_1 | 0; + $0 = $1_1 + $3 | 0; + if ($6 >>> 0 < $2_1 >>> 0) { + $0 = $0 + 1 | 0 } - $5$hi = i64toi32_i32$5; - i64toi32_i32$5 = r$hi; - i64toi32_i32$5 = $5$hi; - i64toi32_i32$3 = r; - return (i64toi32_i32$4 | 0) == (i64toi32_i32$3 | 0) & (i64toi32_i32$5 | 0) == (r$hi | 0) | 0 | 0; + $2_1 = $4; + return ($6 | 0) == ($2_1 | 0) & ($0 | 0) == ($5 | 0) | 0 | 0; } - function $2($0, $0$hi, $1_1, $1$hi, r, r$hi) { + function $2($0, $1_1, $2_1, $3, $4, $5) { $0 = $0 | 0; - $0$hi = $0$hi | 0; $1_1 = $1_1 | 0; - $1$hi = $1$hi | 0; - r = r | 0; - r$hi = r$hi | 0; - var i64toi32_i32$5 = 0, i64toi32_i32$0 = 0, i64toi32_i32$2 = 0, i64toi32_i32$3 = 0, $5$hi = 0; - i64toi32_i32$0 = $0$hi; - i64toi32_i32$0 = $1$hi; - i64toi32_i32$0 = $0$hi; - i64toi32_i32$2 = $0; - i64toi32_i32$3 = $1_1; - i64toi32_i32$5 = (i64toi32_i32$2 >>> 0 < i64toi32_i32$3 >>> 0) + $1$hi | 0; - i64toi32_i32$5 = i64toi32_i32$0 - i64toi32_i32$5 | 0; - $5$hi = i64toi32_i32$5; - i64toi32_i32$5 = r$hi; - i64toi32_i32$5 = $5$hi; - i64toi32_i32$0 = i64toi32_i32$2 - i64toi32_i32$3 | 0; - i64toi32_i32$2 = r$hi; - i64toi32_i32$3 = r; - return (i64toi32_i32$0 | 0) == (i64toi32_i32$3 | 0) & (i64toi32_i32$5 | 0) == (i64toi32_i32$2 | 0) | 0 | 0; + $2_1 = $2_1 | 0; + $3 = $3 | 0; + $4 = $4 | 0; + $5 = $5 | 0; + var $6 = 0; + $6 = $0; + $0 = ($6 >>> 0 < $2_1 >>> 0) + $3 | 0; + $0 = $1_1 - $0 | 0; + $1_1 = $6 - $2_1 | 0; + $6 = $5; + $2_1 = $4; + return ($1_1 | 0) == ($2_1 | 0) & ($0 | 0) == ($6 | 0) | 0 | 0; } function legalstub$1($0, $1_1, $2_1, $3, $4, $5) { @@ -73,92 +62,79 @@ function asmFunc(global, env, buffer) { $3 = $3 | 0; $4 = $4 | 0; $5 = $5 | 0; - var i64toi32_i32$0 = 0, i64toi32_i32$2 = 0, i64toi32_i32$1 = 0, i64toi32_i32$4 = 0, i64toi32_i32$3 = 0, $26 = 0, $27 = 0, $28 = 0, $7 = 0, $7$hi = 0, $10$hi = 0, $11 = 0, $11$hi = 0, $13 = 0, $13$hi = 0, $16$hi = 0, $17 = 0, $17$hi = 0, $19 = 0, $19$hi = 0, $22$hi = 0, $23 = 0, $23$hi = 0; - i64toi32_i32$0 = 0; - $7 = $0; - $7$hi = i64toi32_i32$0; - i64toi32_i32$0 = 0; - i64toi32_i32$2 = $1_1; - i64toi32_i32$1 = 0; - i64toi32_i32$3 = 32; - i64toi32_i32$4 = i64toi32_i32$3 & 31 | 0; - if (32 >>> 0 <= (i64toi32_i32$3 & 63 | 0) >>> 0) { + var $6 = 0, $7 = 0, $8 = 0, $9 = 0, $10 = 0, $11 = 0; + $6 = 0; + $10 = $0; + $9 = $6; + $6 = 0; + $7 = 32; + $8 = $7 & 31 | 0; + if (32 >>> 0 <= ($7 & 63 | 0) >>> 0) { { - i64toi32_i32$1 = i64toi32_i32$2 << i64toi32_i32$4 | 0; - $26 = 0; + $0 = $1_1 << $8 | 0; + $7 = 0; } } else { { - i64toi32_i32$1 = ((1 << i64toi32_i32$4 | 0) - 1 | 0) & (i64toi32_i32$2 >>> (32 - i64toi32_i32$4 | 0) | 0) | 0 | (i64toi32_i32$0 << i64toi32_i32$4 | 0) | 0; - $26 = i64toi32_i32$2 << i64toi32_i32$4 | 0; + $0 = ((1 << $8 | 0) - 1 | 0) & ($1_1 >>> (32 - $8 | 0) | 0) | 0 | ($6 << $8 | 0) | 0; + $7 = $1_1 << $8 | 0; } } - $10$hi = i64toi32_i32$1; - i64toi32_i32$1 = $7$hi; - i64toi32_i32$0 = $7; - i64toi32_i32$2 = $10$hi; - i64toi32_i32$3 = $26; - i64toi32_i32$2 = i64toi32_i32$1 | i64toi32_i32$2 | 0; - $11 = i64toi32_i32$0 | i64toi32_i32$3 | 0; - $11$hi = i64toi32_i32$2; - i64toi32_i32$2 = 0; - $13 = $2_1; - $13$hi = i64toi32_i32$2; - i64toi32_i32$2 = 0; - i64toi32_i32$1 = $3; - i64toi32_i32$0 = 0; - i64toi32_i32$3 = 32; - i64toi32_i32$4 = i64toi32_i32$3 & 31 | 0; - if (32 >>> 0 <= (i64toi32_i32$3 & 63 | 0) >>> 0) { + $1_1 = $0; + $0 = $9; + $6 = $10; + $1_1 = $0 | $1_1 | 0; + $11 = $6 | $7 | 0; + $10 = $1_1; + $1_1 = 0; + $9 = $1_1; + $1_1 = 0; + $0 = $3; + $7 = 32; + $8 = $7 & 31 | 0; + if (32 >>> 0 <= ($7 & 63 | 0) >>> 0) { { - i64toi32_i32$0 = i64toi32_i32$1 << i64toi32_i32$4 | 0; - $27 = 0; + $6 = $0 << $8 | 0; + $7 = 0; } } else { { - i64toi32_i32$0 = ((1 << i64toi32_i32$4 | 0) - 1 | 0) & (i64toi32_i32$1 >>> (32 - i64toi32_i32$4 | 0) | 0) | 0 | (i64toi32_i32$2 << i64toi32_i32$4 | 0) | 0; - $27 = i64toi32_i32$1 << i64toi32_i32$4 | 0; + $6 = ((1 << $8 | 0) - 1 | 0) & ($0 >>> (32 - $8 | 0) | 0) | 0 | ($1_1 << $8 | 0) | 0; + $7 = $0 << $8 | 0; } } - $16$hi = i64toi32_i32$0; - i64toi32_i32$0 = $13$hi; - i64toi32_i32$2 = $13; - i64toi32_i32$1 = $16$hi; - i64toi32_i32$3 = $27; - i64toi32_i32$1 = i64toi32_i32$0 | i64toi32_i32$1 | 0; - $17 = i64toi32_i32$2 | i64toi32_i32$3 | 0; - $17$hi = i64toi32_i32$1; - i64toi32_i32$1 = 0; - $19 = $4; - $19$hi = i64toi32_i32$1; - i64toi32_i32$1 = 0; - i64toi32_i32$0 = $5; - i64toi32_i32$2 = 0; - i64toi32_i32$3 = 32; - i64toi32_i32$4 = i64toi32_i32$3 & 31 | 0; - if (32 >>> 0 <= (i64toi32_i32$3 & 63 | 0) >>> 0) { + $0 = $6; + $6 = $9; + $1_1 = $2_1; + $0 = $6 | $0 | 0; + $9 = $1_1 | $7 | 0; + $2_1 = $0; + $0 = 0; + $3 = $0; + $0 = 0; + $6 = $5; + $7 = 32; + $8 = $7 & 31 | 0; + if (32 >>> 0 <= ($7 & 63 | 0) >>> 0) { { - i64toi32_i32$2 = i64toi32_i32$0 << i64toi32_i32$4 | 0; - $28 = 0; + $1_1 = $6 << $8 | 0; + $7 = 0; } } else { { - i64toi32_i32$2 = ((1 << i64toi32_i32$4 | 0) - 1 | 0) & (i64toi32_i32$0 >>> (32 - i64toi32_i32$4 | 0) | 0) | 0 | (i64toi32_i32$1 << i64toi32_i32$4 | 0) | 0; - $28 = i64toi32_i32$0 << i64toi32_i32$4 | 0; + $1_1 = ((1 << $8 | 0) - 1 | 0) & ($6 >>> (32 - $8 | 0) | 0) | 0 | ($0 << $8 | 0) | 0; + $7 = $6 << $8 | 0; } } - $22$hi = i64toi32_i32$2; - i64toi32_i32$2 = $19$hi; - i64toi32_i32$1 = $19; - i64toi32_i32$0 = $22$hi; - i64toi32_i32$3 = $28; - i64toi32_i32$0 = i64toi32_i32$2 | i64toi32_i32$0 | 0; - $23 = i64toi32_i32$1 | i64toi32_i32$3 | 0; - $23$hi = i64toi32_i32$0; - i64toi32_i32$0 = $11$hi; - i64toi32_i32$1 = $17$hi; - i64toi32_i32$2 = $23$hi; - return $1($11 | 0, i64toi32_i32$0 | 0, $17 | 0, i64toi32_i32$1 | 0, $23 | 0, i64toi32_i32$2 | 0) | 0 | 0; + $6 = $1_1; + $1_1 = $3; + $0 = $4; + $6 = $1_1 | $6 | 0; + $3 = $0 | $7 | 0; + $1_1 = $6; + $6 = $10; + $0 = $2_1; + return $1($11 | 0, $6 | 0, $9 | 0, $0 | 0, $3 | 0, $1_1 | 0) | 0 | 0; } function legalstub$2($0, $1_1, $2_1, $3, $4, $5) { @@ -168,92 +144,79 @@ function asmFunc(global, env, buffer) { $3 = $3 | 0; $4 = $4 | 0; $5 = $5 | 0; - var i64toi32_i32$0 = 0, i64toi32_i32$2 = 0, i64toi32_i32$1 = 0, i64toi32_i32$4 = 0, i64toi32_i32$3 = 0, $26 = 0, $27 = 0, $28 = 0, $7 = 0, $7$hi = 0, $10$hi = 0, $11 = 0, $11$hi = 0, $13 = 0, $13$hi = 0, $16$hi = 0, $17 = 0, $17$hi = 0, $19 = 0, $19$hi = 0, $22$hi = 0, $23 = 0, $23$hi = 0; - i64toi32_i32$0 = 0; - $7 = $0; - $7$hi = i64toi32_i32$0; - i64toi32_i32$0 = 0; - i64toi32_i32$2 = $1_1; - i64toi32_i32$1 = 0; - i64toi32_i32$3 = 32; - i64toi32_i32$4 = i64toi32_i32$3 & 31 | 0; - if (32 >>> 0 <= (i64toi32_i32$3 & 63 | 0) >>> 0) { + var $6 = 0, $7 = 0, $8 = 0, $9 = 0, $10 = 0, $11 = 0; + $6 = 0; + $10 = $0; + $9 = $6; + $6 = 0; + $7 = 32; + $8 = $7 & 31 | 0; + if (32 >>> 0 <= ($7 & 63 | 0) >>> 0) { { - i64toi32_i32$1 = i64toi32_i32$2 << i64toi32_i32$4 | 0; - $26 = 0; + $0 = $1_1 << $8 | 0; + $7 = 0; } } else { { - i64toi32_i32$1 = ((1 << i64toi32_i32$4 | 0) - 1 | 0) & (i64toi32_i32$2 >>> (32 - i64toi32_i32$4 | 0) | 0) | 0 | (i64toi32_i32$0 << i64toi32_i32$4 | 0) | 0; - $26 = i64toi32_i32$2 << i64toi32_i32$4 | 0; + $0 = ((1 << $8 | 0) - 1 | 0) & ($1_1 >>> (32 - $8 | 0) | 0) | 0 | ($6 << $8 | 0) | 0; + $7 = $1_1 << $8 | 0; } } - $10$hi = i64toi32_i32$1; - i64toi32_i32$1 = $7$hi; - i64toi32_i32$0 = $7; - i64toi32_i32$2 = $10$hi; - i64toi32_i32$3 = $26; - i64toi32_i32$2 = i64toi32_i32$1 | i64toi32_i32$2 | 0; - $11 = i64toi32_i32$0 | i64toi32_i32$3 | 0; - $11$hi = i64toi32_i32$2; - i64toi32_i32$2 = 0; - $13 = $2_1; - $13$hi = i64toi32_i32$2; - i64toi32_i32$2 = 0; - i64toi32_i32$1 = $3; - i64toi32_i32$0 = 0; - i64toi32_i32$3 = 32; - i64toi32_i32$4 = i64toi32_i32$3 & 31 | 0; - if (32 >>> 0 <= (i64toi32_i32$3 & 63 | 0) >>> 0) { + $1_1 = $0; + $0 = $9; + $6 = $10; + $1_1 = $0 | $1_1 | 0; + $11 = $6 | $7 | 0; + $10 = $1_1; + $1_1 = 0; + $9 = $1_1; + $1_1 = 0; + $0 = $3; + $7 = 32; + $8 = $7 & 31 | 0; + if (32 >>> 0 <= ($7 & 63 | 0) >>> 0) { { - i64toi32_i32$0 = i64toi32_i32$1 << i64toi32_i32$4 | 0; - $27 = 0; + $6 = $0 << $8 | 0; + $7 = 0; } } else { { - i64toi32_i32$0 = ((1 << i64toi32_i32$4 | 0) - 1 | 0) & (i64toi32_i32$1 >>> (32 - i64toi32_i32$4 | 0) | 0) | 0 | (i64toi32_i32$2 << i64toi32_i32$4 | 0) | 0; - $27 = i64toi32_i32$1 << i64toi32_i32$4 | 0; + $6 = ((1 << $8 | 0) - 1 | 0) & ($0 >>> (32 - $8 | 0) | 0) | 0 | ($1_1 << $8 | 0) | 0; + $7 = $0 << $8 | 0; } } - $16$hi = i64toi32_i32$0; - i64toi32_i32$0 = $13$hi; - i64toi32_i32$2 = $13; - i64toi32_i32$1 = $16$hi; - i64toi32_i32$3 = $27; - i64toi32_i32$1 = i64toi32_i32$0 | i64toi32_i32$1 | 0; - $17 = i64toi32_i32$2 | i64toi32_i32$3 | 0; - $17$hi = i64toi32_i32$1; - i64toi32_i32$1 = 0; - $19 = $4; - $19$hi = i64toi32_i32$1; - i64toi32_i32$1 = 0; - i64toi32_i32$0 = $5; - i64toi32_i32$2 = 0; - i64toi32_i32$3 = 32; - i64toi32_i32$4 = i64toi32_i32$3 & 31 | 0; - if (32 >>> 0 <= (i64toi32_i32$3 & 63 | 0) >>> 0) { + $0 = $6; + $6 = $9; + $1_1 = $2_1; + $0 = $6 | $0 | 0; + $9 = $1_1 | $7 | 0; + $2_1 = $0; + $0 = 0; + $3 = $0; + $0 = 0; + $6 = $5; + $7 = 32; + $8 = $7 & 31 | 0; + if (32 >>> 0 <= ($7 & 63 | 0) >>> 0) { { - i64toi32_i32$2 = i64toi32_i32$0 << i64toi32_i32$4 | 0; - $28 = 0; + $1_1 = $6 << $8 | 0; + $7 = 0; } } else { { - i64toi32_i32$2 = ((1 << i64toi32_i32$4 | 0) - 1 | 0) & (i64toi32_i32$0 >>> (32 - i64toi32_i32$4 | 0) | 0) | 0 | (i64toi32_i32$1 << i64toi32_i32$4 | 0) | 0; - $28 = i64toi32_i32$0 << i64toi32_i32$4 | 0; + $1_1 = ((1 << $8 | 0) - 1 | 0) & ($6 >>> (32 - $8 | 0) | 0) | 0 | ($0 << $8 | 0) | 0; + $7 = $6 << $8 | 0; } } - $22$hi = i64toi32_i32$2; - i64toi32_i32$2 = $19$hi; - i64toi32_i32$1 = $19; - i64toi32_i32$0 = $22$hi; - i64toi32_i32$3 = $28; - i64toi32_i32$0 = i64toi32_i32$2 | i64toi32_i32$0 | 0; - $23 = i64toi32_i32$1 | i64toi32_i32$3 | 0; - $23$hi = i64toi32_i32$0; - i64toi32_i32$0 = $11$hi; - i64toi32_i32$1 = $17$hi; - i64toi32_i32$2 = $23$hi; - return $2($11 | 0, i64toi32_i32$0 | 0, $17 | 0, i64toi32_i32$1 | 0, $23 | 0, i64toi32_i32$2 | 0) | 0 | 0; + $6 = $1_1; + $1_1 = $3; + $0 = $4; + $6 = $1_1 | $6 | 0; + $3 = $0 | $7 | 0; + $1_1 = $6; + $6 = $10; + $0 = $2_1; + return $2($11 | 0, $6 | 0, $9 | 0, $0 | 0, $3 | 0, $1_1 | 0) | 0 | 0; } var FUNCTION_TABLE = []; |