diff options
author | Alon Zakai <azakai@google.com> | 2019-05-01 17:18:04 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-01 17:18:04 -0700 |
commit | af459403bc6e1bb99468ad05f351665143193082 (patch) | |
tree | fd6b0c2e0bd14822c3e3bb1e0f4a3b42c78bb56c /test/wasm2js/get_local.2asm.js | |
parent | 2bd3758a22131cfd6925b3fd995657b211095c90 (diff) | |
download | binaryen-af459403bc6e1bb99468ad05f351665143193082.tar.gz binaryen-af459403bc6e1bb99468ad05f351665143193082.tar.bz2 binaryen-af459403bc6e1bb99468ad05f351665143193082.zip |
wasm2js: don't run coalesce-locals if not optimizing (#2076)
That pass is very slow on unoptimized code (super-linear on the number of locals, which if unoptimized can be massive due to flatten).
Diffstat (limited to 'test/wasm2js/get_local.2asm.js')
-rw-r--r-- | test/wasm2js/get_local.2asm.js | 240 |
1 files changed, 138 insertions, 102 deletions
diff --git a/test/wasm2js/get_local.2asm.js b/test/wasm2js/get_local.2asm.js index 2f9bc5e4c..782be9fba 100644 --- a/test/wasm2js/get_local.2asm.js +++ b/test/wasm2js/get_local.2asm.js @@ -30,9 +30,10 @@ function asmFunc(global, env, buffer) { } function $1() { - var $0_1 = 0, $1_1 = 0; - i64toi32_i32$HIGH_BITS = $0_1; - return $1_1 | 0; + var i64toi32_i32$0 = 0, $0$hi = 0, $0_1 = 0; + i64toi32_i32$0 = $0$hi; + i64toi32_i32$HIGH_BITS = i64toi32_i32$0; + return $0_1 | 0; } function $2() { @@ -50,10 +51,12 @@ function asmFunc(global, env, buffer) { return $0_1 | 0; } - function $5($0_1, $1_1) { + function $5($0_1, $0$hi) { $0_1 = $0_1 | 0; - $1_1 = $1_1 | 0; - i64toi32_i32$HIGH_BITS = $1_1; + $0$hi = $0$hi | 0; + var i64toi32_i32$0 = 0; + i64toi32_i32$0 = $0$hi; + i64toi32_i32$HIGH_BITS = i64toi32_i32$0; return $0_1 | 0; } @@ -67,94 +70,117 @@ function asmFunc(global, env, buffer) { return +$0_1; } - function $8($0_1, $1_1, $2_1, $3_1, $4_1, $5_1) { + function $8($0_1, $0$hi, $1_1, $2_1, $3_1, $4_1) { $0_1 = $0_1 | 0; - $1_1 = $1_1 | 0; - $2_1 = Math_fround($2_1); - $3_1 = +$3_1; + $0$hi = $0$hi | 0; + $1_1 = Math_fround($1_1); + $2_1 = +$2_1; + $3_1 = $3_1 | 0; $4_1 = $4_1 | 0; - $5_1 = $5_1 | 0; - var $6_1 = Math_fround(0), $7_1 = 0, $8_1 = 0, $9_1 = 0, $10 = 0, $11 = 0.0; - $1_1 = $7_1; - $1_1 = $9_1; + var i64toi32_i32$0 = 0, $5_1 = Math_fround(0), $6$hi = 0, $6_1 = 0, $7$hi = 0, $7_1 = 0, $8_1 = 0.0; + i64toi32_i32$0 = $0$hi; + i64toi32_i32$0 = $6$hi; + i64toi32_i32$0 = $7$hi; } - function $9($0_1, $1_1, $2_1, $3_1, $4_1, $5_1) { + function $9($0_1, $0$hi, $1_1, $2_1, $3_1, $4_1) { $0_1 = $0_1 | 0; - $1_1 = $1_1 | 0; - $2_1 = Math_fround($2_1); - $3_1 = +$3_1; + $0$hi = $0$hi | 0; + $1_1 = Math_fround($1_1); + $2_1 = +$2_1; + $3_1 = $3_1 | 0; $4_1 = $4_1 | 0; - $5_1 = $5_1 | 0; - var $6_1 = 0, $7_1 = 0, $8_1 = 0.0, $9_1 = 0.0, $10 = 0, $11 = 0; - $6_1 = 0; - $7_1 = $6_1; - $6_1 = $1_1; - $8_1 = +($0_1 >>> 0) + 4294967296.0 * +($6_1 >>> 0); - $6_1 = $7_1; - $0_1 = 6; - $9_1 = +($0_1 >>> 0) + 4294967296.0 * +($6_1 >>> 0); - $6_1 = $10; - $0_1 = $11; - return +($8_1 + (+$2_1 + ($3_1 + (+($4_1 >>> 0) + (+($5_1 | 0) + (+Math_fround(5.5) + ($9_1 + (+($0_1 >>> 0) + 4294967296.0 * +($6_1 >>> 0) + 8.0)))))))); + var i64toi32_i32$0 = 0, i64toi32_i32$1 = 0, $6$hi = 0, $10 = 0.0, $21 = 0.0, $7$hi = 0, $7_1 = 0; + i64toi32_i32$0 = 0; + $6$hi = i64toi32_i32$0; + i64toi32_i32$0 = $0$hi; + i64toi32_i32$1 = $0_1; + $10 = +(i64toi32_i32$1 >>> 0) + 4294967296.0 * +(i64toi32_i32$0 >>> 0); + i64toi32_i32$0 = $6$hi; + i64toi32_i32$1 = 6; + $21 = +(i64toi32_i32$1 >>> 0) + 4294967296.0 * +(i64toi32_i32$0 >>> 0); + i64toi32_i32$0 = $7$hi; + i64toi32_i32$1 = $7_1; + return +($10 + (+$1_1 + ($2_1 + (+($3_1 >>> 0) + (+($4_1 | 0) + (+Math_fround(5.5) + ($21 + (+(i64toi32_i32$1 >>> 0) + 4294967296.0 * +(i64toi32_i32$0 >>> 0) + 8.0)))))))); } function legalstub$1() { - var $0_1 = 0, $1_1 = 0, $2_1 = 0, $3_1 = 0, $4_1 = 0, $5_1 = 0; - $0_1 = $1() | 0; - $2_1 = i64toi32_i32$HIGH_BITS; - $4_1 = $0_1; - $5_1 = $2_1; - $3_1 = 32; - $1_1 = $3_1 & 31 | 0; - if (32 >>> 0 <= ($3_1 & 63 | 0) >>> 0) { - $0_1 = $2_1 >>> $1_1 | 0 + var i64toi32_i32$0 = 0, i64toi32_i32$4 = 0, i64toi32_i32$1 = 0, i64toi32_i32$3 = 0, $7_1 = 0, $0_1 = 0, $0$hi = 0, i64toi32_i32$2 = 0; + i64toi32_i32$0 = $1() | 0; + i64toi32_i32$1 = i64toi32_i32$HIGH_BITS; + $0_1 = i64toi32_i32$0; + $0$hi = i64toi32_i32$1; + i64toi32_i32$2 = i64toi32_i32$0; + 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) { + { + i64toi32_i32$0 = 0; + $7_1 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; + } } else { - $0_1 = (((1 << $1_1 | 0) - 1 | 0) & $2_1 | 0) << (32 - $1_1 | 0) | 0 | ($0_1 >>> $1_1 | 0) | 0 + { + i64toi32_i32$0 = i64toi32_i32$1 >>> i64toi32_i32$4 | 0; + $7_1 = (((1 << i64toi32_i32$4 | 0) - 1 | 0) & i64toi32_i32$1 | 0) << (32 - i64toi32_i32$4 | 0) | 0 | (i64toi32_i32$2 >>> i64toi32_i32$4 | 0) | 0; + } } - setTempRet0($0_1 | 0); - return $4_1 | 0; + setTempRet0($7_1 | 0); + i64toi32_i32$0 = $0$hi; + return $0_1 | 0; } function legalstub$5($0_1, $1_1) { $0_1 = $0_1 | 0; $1_1 = $1_1 | 0; - var $2_1 = 0, $3_1 = 0, $4_1 = 0, $5_1 = 0, $6_1 = 0; - $3_1 = 0; - $5_1 = $0_1; - $6_1 = $3_1; - $3_1 = 0; - $4_1 = 32; - $2_1 = $4_1 & 31 | 0; - if (32 >>> 0 <= ($4_1 & 63 | 0) >>> 0) { + var i64toi32_i32$2 = 0, i64toi32_i32$4 = 0, i64toi32_i32$0 = 0, i64toi32_i32$1 = 0, i64toi32_i32$3 = 0, $12 = 0, $13 = 0, $4_1 = 0, $4$hi = 0, $7$hi = 0, $2_1 = 0, $2$hi = 0; + i64toi32_i32$0 = 0; + $4_1 = $0_1; + $4$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) { { - $0_1 = $1_1 << $2_1 | 0; - $4_1 = 0; + i64toi32_i32$1 = i64toi32_i32$2 << i64toi32_i32$4 | 0; + $12 = 0; } } else { { - $0_1 = ((1 << $2_1 | 0) - 1 | 0) & ($1_1 >>> (32 - $2_1 | 0) | 0) | 0 | ($3_1 << $2_1 | 0) | 0; - $4_1 = $1_1 << $2_1 | 0; + 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; + $12 = i64toi32_i32$2 << i64toi32_i32$4 | 0; } } - $1_1 = $0_1; - $0_1 = $6_1; - $3_1 = $5_1; - $1_1 = $0_1 | $1_1 | 0; - $1_1 = $5($3_1 | $4_1 | 0 | 0, $1_1 | 0) | 0; - $3_1 = i64toi32_i32$HIGH_BITS; - $6_1 = $1_1; - $5_1 = $3_1; - $0_1 = $1_1; - $4_1 = 32; - $2_1 = $4_1 & 31 | 0; - if (32 >>> 0 <= ($4_1 & 63 | 0) >>> 0) { - $0_1 = $3_1 >>> $2_1 | 0 + $7$hi = i64toi32_i32$1; + i64toi32_i32$1 = $4$hi; + i64toi32_i32$0 = $4_1; + i64toi32_i32$2 = $7$hi; + i64toi32_i32$3 = $12; + i64toi32_i32$2 = i64toi32_i32$1 | i64toi32_i32$2 | 0; + i64toi32_i32$2 = $5(i64toi32_i32$0 | i64toi32_i32$3 | 0 | 0, i64toi32_i32$2 | 0) | 0; + i64toi32_i32$0 = i64toi32_i32$HIGH_BITS; + $2_1 = i64toi32_i32$2; + $2$hi = i64toi32_i32$0; + i64toi32_i32$1 = i64toi32_i32$2; + 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) { + { + i64toi32_i32$2 = 0; + $13 = i64toi32_i32$0 >>> i64toi32_i32$4 | 0; + } } else { - $0_1 = (((1 << $2_1 | 0) - 1 | 0) & $3_1 | 0) << (32 - $2_1 | 0) | 0 | ($0_1 >>> $2_1 | 0) | 0 + { + i64toi32_i32$2 = i64toi32_i32$0 >>> i64toi32_i32$4 | 0; + $13 = (((1 << i64toi32_i32$4 | 0) - 1 | 0) & i64toi32_i32$0 | 0) << (32 - i64toi32_i32$4 | 0) | 0 | (i64toi32_i32$1 >>> i64toi32_i32$4 | 0) | 0; + } } - setTempRet0($0_1 | 0); - return $6_1 | 0; + setTempRet0($13 | 0); + i64toi32_i32$2 = $2$hi; + return $2_1 | 0; } function legalstub$8($0_1, $1_1, $2_1, $3_1, $4_1, $5_1) { @@ -164,28 +190,33 @@ function asmFunc(global, env, buffer) { $3_1 = +$3_1; $4_1 = $4_1 | 0; $5_1 = $5_1 | 0; - var $6_1 = 0, $7_1 = 0, $8_1 = 0, $9_1 = 0, $10 = 0; - $6_1 = 0; - $10 = $6_1; - $6_1 = 0; - $7_1 = 32; - $8_1 = $7_1 & 31 | 0; - if (32 >>> 0 <= ($7_1 & 63 | 0) >>> 0) { + var i64toi32_i32$2 = 0, i64toi32_i32$0 = 0, i64toi32_i32$1 = 0, i64toi32_i32$4 = 0, i64toi32_i32$3 = 0, $14 = 0, $7_1 = 0, $7$hi = 0, $10$hi = 0; + i64toi32_i32$0 = 0; + $7_1 = $0_1; + $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) { { - $9_1 = $1_1 << $8_1 | 0; - $7_1 = 0; + i64toi32_i32$1 = i64toi32_i32$2 << i64toi32_i32$4 | 0; + $14 = 0; } } else { { - $9_1 = ((1 << $8_1 | 0) - 1 | 0) & ($1_1 >>> (32 - $8_1 | 0) | 0) | 0 | ($6_1 << $8_1 | 0) | 0; - $7_1 = $1_1 << $8_1 | 0; + 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; + $14 = i64toi32_i32$2 << i64toi32_i32$4 | 0; } } - $1_1 = $9_1; - $9_1 = $10; - $6_1 = $0_1; - $1_1 = $9_1 | $1_1 | 0; - $8($6_1 | $7_1 | 0 | 0, $1_1 | 0, Math_fround($2_1), +$3_1, $4_1 | 0, $5_1 | 0); + $10$hi = i64toi32_i32$1; + i64toi32_i32$1 = $7$hi; + i64toi32_i32$0 = $7_1; + i64toi32_i32$2 = $10$hi; + i64toi32_i32$3 = $14; + i64toi32_i32$2 = i64toi32_i32$1 | i64toi32_i32$2 | 0; + $8(i64toi32_i32$0 | i64toi32_i32$3 | 0 | 0, i64toi32_i32$2 | 0, Math_fround($2_1), +$3_1, $4_1 | 0, $5_1 | 0); } function legalstub$9($0_1, $1_1, $2_1, $3_1, $4_1, $5_1) { @@ -195,28 +226,33 @@ function asmFunc(global, env, buffer) { $3_1 = +$3_1; $4_1 = $4_1 | 0; $5_1 = $5_1 | 0; - var $6_1 = 0, $7_1 = 0, $8_1 = 0, $9_1 = 0, $10 = 0; - $6_1 = 0; - $10 = $6_1; - $6_1 = 0; - $7_1 = 32; - $8_1 = $7_1 & 31 | 0; - if (32 >>> 0 <= ($7_1 & 63 | 0) >>> 0) { + var i64toi32_i32$2 = 0, i64toi32_i32$0 = 0, i64toi32_i32$1 = 0, i64toi32_i32$4 = 0, i64toi32_i32$3 = 0, $14 = 0, $7_1 = 0, $7$hi = 0, $10$hi = 0; + i64toi32_i32$0 = 0; + $7_1 = $0_1; + $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) { { - $9_1 = $1_1 << $8_1 | 0; - $7_1 = 0; + i64toi32_i32$1 = i64toi32_i32$2 << i64toi32_i32$4 | 0; + $14 = 0; } } else { { - $9_1 = ((1 << $8_1 | 0) - 1 | 0) & ($1_1 >>> (32 - $8_1 | 0) | 0) | 0 | ($6_1 << $8_1 | 0) | 0; - $7_1 = $1_1 << $8_1 | 0; + 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; + $14 = i64toi32_i32$2 << i64toi32_i32$4 | 0; } } - $1_1 = $9_1; - $9_1 = $10; - $6_1 = $0_1; - $1_1 = $9_1 | $1_1 | 0; - return +(+$9($6_1 | $7_1 | 0 | 0, $1_1 | 0, Math_fround($2_1), +$3_1, $4_1 | 0, $5_1 | 0)); + $10$hi = i64toi32_i32$1; + i64toi32_i32$1 = $7$hi; + i64toi32_i32$0 = $7_1; + i64toi32_i32$2 = $10$hi; + i64toi32_i32$3 = $14; + i64toi32_i32$2 = i64toi32_i32$1 | i64toi32_i32$2 | 0; + return +(+$9(i64toi32_i32$0 | i64toi32_i32$3 | 0 | 0, i64toi32_i32$2 | 0, Math_fround($2_1), +$3_1, $4_1 | 0, $5_1 | 0)); } var FUNCTION_TABLE = []; |