diff options
author | Alon Zakai <alonzakai@gmail.com> | 2016-11-29 19:35:55 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-29 19:35:55 -0800 |
commit | 7d2d9ec9f2f936d0a53b7dc60089456a0654d29c (patch) | |
tree | 9af4b035eece3a2dc7855209707d2138f76a8143 /test/passes/optimize-instructions.txt | |
parent | 724814c5adafaacac693f9a11e3517e411c4c5de (diff) | |
download | binaryen-7d2d9ec9f2f936d0a53b7dc60089456a0654d29c.tar.gz binaryen-7d2d9ec9f2f936d0a53b7dc60089456a0654d29c.tar.bz2 binaryen-7d2d9ec9f2f936d0a53b7dc60089456a0654d29c.zip |
Optimize added factors into load/store offsets (#850)
* optimize added factors into load/store offsets, removing the add
* optimize offset of load/store of a constant into the constant
Diffstat (limited to 'test/passes/optimize-instructions.txt')
-rw-r--r-- | test/passes/optimize-instructions.txt | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/test/passes/optimize-instructions.txt b/test/passes/optimize-instructions.txt index cb043f155..a8cf68dbd 100644 --- a/test/passes/optimize-instructions.txt +++ b/test/passes/optimize-instructions.txt @@ -2,7 +2,9 @@ (type $0 (func (param i32 i64))) (type $1 (func)) (type $2 (func (result i32))) + (type $3 (func (param i32) (result i32))) (memory $0 0) + (export "load-off-2" (func $load-off-2)) (func $f (type $0) (param $i1 i32) (param $i2 i64) (if (i32.eqz @@ -412,4 +414,75 @@ (nop) ) ) + (func $load-off-2 (type $3) (param $0 i32) (result i32) + (i32.store + (i32.const 6) + (get_local $0) + ) + (i32.store + (i32.const 6) + (get_local $0) + ) + (i32.store offset=7 + (get_local $0) + (get_local $0) + ) + (i32.store offset=9 + (get_local $0) + (get_local $0) + ) + (i32.store offset=2 + (i32.add + (get_local $0) + (i32.const -11) + ) + (get_local $0) + ) + (i32.store offset=2 + (i32.add + (get_local $0) + (i32.const -13) + ) + (get_local $0) + ) + (i32.store + (i32.const 4) + (get_local $0) + ) + (i32.store + (i32.const 0) + (get_local $0) + ) + (i32.store + (i32.const 25) + (get_local $0) + ) + (i32.store + (i32.const -23) + (get_local $0) + ) + (drop + (i32.load + (i32.const 8) + ) + ) + (drop + (i32.load + (i32.const 8) + ) + ) + (drop + (i32.load offset=8 + (get_local $0) + ) + ) + (drop + (i32.load + (i32.const 10) + ) + ) + (i32.load offset=12 + (get_local $0) + ) + ) ) |