diff options
author | Alon Zakai <alonzakai@gmail.com> | 2016-11-30 15:02:01 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-30 15:02:01 -0800 |
commit | 36be3e0151dd7357e47b2d8f432bdd706a30466c (patch) | |
tree | 99a40bc874dbe786ae14eaec0e78bdcfc0ea0c86 /test/passes/optimize-instructions.txt | |
parent | 7d2d9ec9f2f936d0a53b7dc60089456a0654d29c (diff) | |
download | binaryen-36be3e0151dd7357e47b2d8f432bdd706a30466c.tar.gz binaryen-36be3e0151dd7357e47b2d8f432bdd706a30466c.tar.bz2 binaryen-36be3e0151dd7357e47b2d8f432bdd706a30466c.zip |
Fix regression from #850 (#851)
* fix regression from #850 - it is not always safe to fold added offsets into load/store offsets, as the add wraps but offset does not
* small refactoring to simplify asm2wasm pass invocation
Diffstat (limited to 'test/passes/optimize-instructions.txt')
-rw-r--r-- | test/passes/optimize-instructions.txt | 70 |
1 files changed, 50 insertions, 20 deletions
diff --git a/test/passes/optimize-instructions.txt b/test/passes/optimize-instructions.txt index a8cf68dbd..f959c3cd6 100644 --- a/test/passes/optimize-instructions.txt +++ b/test/passes/optimize-instructions.txt @@ -415,20 +415,32 @@ ) ) (func $load-off-2 (type $3) (param $0 i32) (result i32) - (i32.store - (i32.const 6) + (i32.store offset=2 + (i32.add + (i32.const 1) + (i32.const 3) + ) (get_local $0) ) - (i32.store - (i32.const 6) + (i32.store offset=2 + (i32.add + (i32.const 3) + (i32.const 1) + ) (get_local $0) ) - (i32.store offset=7 - (get_local $0) + (i32.store offset=2 + (i32.add + (get_local $0) + (i32.const 5) + ) (get_local $0) ) - (i32.store offset=9 - (get_local $0) + (i32.store offset=2 + (i32.add + (get_local $0) + (i32.const 7) + ) (get_local $0) ) (i32.store offset=2 @@ -445,12 +457,18 @@ ) (get_local $0) ) - (i32.store - (i32.const 4) + (i32.store offset=2 + (i32.add + (i32.const -15) + (i32.const 17) + ) (get_local $0) ) - (i32.store - (i32.const 0) + (i32.store offset=2 + (i32.add + (i32.const -21) + (i32.const 19) + ) (get_local $0) ) (i32.store @@ -462,18 +480,27 @@ (get_local $0) ) (drop - (i32.load - (i32.const 8) + (i32.load offset=2 + (i32.add + (i32.const 2) + (i32.const 4) + ) ) ) (drop - (i32.load - (i32.const 8) + (i32.load offset=2 + (i32.add + (i32.const 4) + (i32.const 2) + ) ) ) (drop - (i32.load offset=8 - (get_local $0) + (i32.load offset=2 + (i32.add + (get_local $0) + (i32.const 6) + ) ) ) (drop @@ -481,8 +508,11 @@ (i32.const 10) ) ) - (i32.load offset=12 - (get_local $0) + (i32.load offset=2 + (i32.add + (get_local $0) + (i32.const 10) + ) ) ) ) |