diff options
author | Alon Zakai <alonzakai@gmail.com> | 2018-05-10 08:58:09 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-10 08:58:09 -0700 |
commit | 111b4f1950467d51a78211af183f4ae6398aac49 (patch) | |
tree | 7f53ab6389e2bcaacf761cbf33846ac0210bd098 /test/get-set-local.2asm.js | |
parent | 6a9ececa2fc9eca99a12b65ca130612942babdce (diff) | |
download | binaryen-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/get-set-local.2asm.js')
-rw-r--r-- | test/get-set-local.2asm.js | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/test/get-set-local.2asm.js b/test/get-set-local.2asm.js index 78c119b78..e7203c9cd 100644 --- a/test/get-set-local.2asm.js +++ b/test/get-set-local.2asm.js @@ -23,12 +23,11 @@ function asmFunc(global, env, buffer) { $0 = $0 | 0; r = r | 0; r$hi = r$hi | 0; - var i64toi32_i32$0 = 0, result$hi = 0; + var i64toi32_i32$0 = 0; i64toi32_i32$0 = r$hi; - result$hi = i64toi32_i32$0; i64toi32_i32$0 = 0; i64toi32_i32$0 = i64toi32_i32$0; - return ($0 | 0) == (r | 0) & (i64toi32_i32$0 | 0) == (result$hi | 0) | 0 | 0; + return ($0 | 0) == (r | 0) & (i64toi32_i32$0 | 0) == (r$hi | 0) | 0 | 0; } function __wasm_ctz_i32(x) { |