summaryrefslogtreecommitdiff
path: root/test/unary-ops.2asm.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2018-05-10 08:58:09 -0700
committerGitHub <noreply@github.com>2018-05-10 08:58:09 -0700
commit111b4f1950467d51a78211af183f4ae6398aac49 (patch)
tree7f53ab6389e2bcaacf761cbf33846ac0210bd098 /test/unary-ops.2asm.js
parent6a9ececa2fc9eca99a12b65ca130612942babdce (diff)
downloadbinaryen-111b4f1950467d51a78211af183f4ae6398aac49.tar.gz
binaryen-111b4f1950467d51a78211af183f4ae6398aac49.tar.bz2
binaryen-111b4f1950467d51a78211af183f4ae6398aac49.zip
Optimize equivalent locals (#1540)
If locals are known to contain the same value, we can * Pick which local to use for a get_local of any of them. Makes sense to prefer the most common, to increase the chance of one dropping to zero uses. * Remove copies between a local and one that we know contains the same value. This is a consistent win, small though, around 0.1-0.2%.
Diffstat (limited to 'test/unary-ops.2asm.js')
-rw-r--r--test/unary-ops.2asm.js5
1 files changed, 2 insertions, 3 deletions
diff --git a/test/unary-ops.2asm.js b/test/unary-ops.2asm.js
index b8d6666b3..293aa8d0b 100644
--- a/test/unary-ops.2asm.js
+++ b/test/unary-ops.2asm.js
@@ -48,12 +48,11 @@ function asmFunc(global, env, buffer) {
$0 = $0 | 0;
r = r | 0;
r$hi = r$hi | 0;
- var i64toi32_i32$1 = 0, i64toi32_i32$0 = 0, i64toi32_i32$2 = 0;
+ var i64toi32_i32$1 = 0, i64toi32_i32$0 = 0;
i64toi32_i32$1 = $0;
i64toi32_i32$0 = i64toi32_i32$1 >> 31 | 0;
- i64toi32_i32$2 = i64toi32_i32$1;
i64toi32_i32$1 = r$hi;
- return (i64toi32_i32$2 | 0) == (r | 0) & (i64toi32_i32$0 | 0) == (i64toi32_i32$1 | 0) | 0 | 0;
+ return ($0 | 0) == (r | 0) & (i64toi32_i32$0 | 0) == (i64toi32_i32$1 | 0) | 0 | 0;
}
function $5($0, $0$hi) {