diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/passes/optimize-instructions.txt | 136 | ||||
-rw-r--r-- | test/passes/optimize-instructions.wast | 227 |
2 files changed, 359 insertions, 4 deletions
diff --git a/test/passes/optimize-instructions.txt b/test/passes/optimize-instructions.txt index 5ed72a62e..b1b4ce2d2 100644 --- a/test/passes/optimize-instructions.txt +++ b/test/passes/optimize-instructions.txt @@ -10,6 +10,7 @@ (type $8 (func (result i64))) (type $9 (func (param i32 i64 f32 f64))) (type $10 (func (param i32 i64 f32))) + (type $11 (func (param i32 i64 f64 i32))) (memory $0 0) (export "load-off-2" (func $load-off-2)) (func $f (; 0 ;) (type $0) (param $i1 i32) (param $i2 i64) @@ -813,10 +814,7 @@ ) ) (drop - (i32.ne - (i32.const -1) - (i32.const -1) - ) + (i32.const 0) ) (drop (f32.le @@ -2722,6 +2720,136 @@ ) ) ) + (func $shift-a-zero (; 66 ;) (type $10) (param $x i32) (param $y i64) (param $z f32) + (drop + (i32.const 0) + ) + (drop + (i32.const 0) + ) + (drop + (i32.const 0) + ) + (drop + (i64.const 0) + ) + (drop + (i32.shl + (i32.const 0) + (unreachable) + ) + ) + ) + (func $identical-siblings (; 67 ;) (type $11) (param $x i32) (param $y i64) (param $z f64) (param $xx i32) + (drop + (i32.const 0) + ) + (drop + (i64.const 0) + ) + (drop + (f64.sub + (get_local $z) + (get_local $z) + ) + ) + (drop + (i32.sub + (get_local $x) + (get_local $xx) + ) + ) + (drop + (i32.sub + (unreachable) + (unreachable) + ) + ) + (drop + (i32.add + (get_local $x) + (get_local $x) + ) + ) + (drop + (i32.const 0) + ) + (drop + (i32.const 0) + ) + (drop + (i32.const 0) + ) + (drop + (i32.const 0) + ) + (drop + (i32.const 0) + ) + (drop + (i32.const 0) + ) + (drop + (get_local $x) + ) + (drop + (get_local $x) + ) + (drop + (i32.const 1) + ) + (drop + (i32.const 1) + ) + (drop + (i32.const 1) + ) + (drop + (i32.const 1) + ) + (drop + (i32.const 1) + ) + (drop + (i64.const 0) + ) + (drop + (i32.const 0) + ) + (drop + (i32.const 0) + ) + (drop + (i32.const 0) + ) + (drop + (i32.const 0) + ) + (drop + (i32.const 0) + ) + (drop + (get_local $y) + ) + (drop + (get_local $y) + ) + (drop + (i32.const 1) + ) + (drop + (i32.const 1) + ) + (drop + (i32.const 1) + ) + (drop + (i32.const 1) + ) + (drop + (i32.const 1) + ) + ) ) (module (type $0 (func)) diff --git a/test/passes/optimize-instructions.wast b/test/passes/optimize-instructions.wast index e4d7773ee..85709c7ca 100644 --- a/test/passes/optimize-instructions.wast +++ b/test/passes/optimize-instructions.wast @@ -3158,6 +3158,233 @@ (drop (f32.add (get_local $z) (f32.const 0x40))) ) + (func $shift-a-zero (param $x i32) (param $y i64) (param $z f32) + (drop + (i32.shl + (i32.const 0) + (get_local $x) + ) + ) + (drop + (i32.shr_u + (i32.const 0) + (get_local $x) + ) + ) + (drop + (i32.shr_s + (i32.const 0) + (get_local $x) + ) + ) + (drop + (i64.shl + (i64.const 0) + (get_local $y) + ) + ) + (drop + (i32.shl + (i32.const 0) + (unreachable) + ) + ) + ) + (func $identical-siblings (param $x i32) (param $y i64) (param $z f64) (param $xx i32) + (drop + (i32.sub + (get_local $x) + (get_local $x) + ) + ) + (drop + (i64.sub + (get_local $y) + (get_local $y) + ) + ) + (drop + (f64.sub + (get_local $z) + (get_local $z) + ) + ) + (drop + (i32.sub + (get_local $x) + (get_local $xx) + ) + ) + (drop + (i32.sub + (unreachable) + (unreachable) + ) + ) + (drop + (i32.add + (get_local $x) + (get_local $x) + ) + ) + ;; more ops + (drop + (i32.xor + (get_local $x) + (get_local $x) + ) + ) + (drop + (i32.ne + (get_local $x) + (get_local $x) + ) + ) + (drop + (i32.lt_s + (get_local $x) + (get_local $x) + ) + ) + (drop + (i32.lt_u + (get_local $x) + (get_local $x) + ) + ) + (drop + (i32.gt_s + (get_local $x) + (get_local $x) + ) + ) + (drop + (i32.gt_u + (get_local $x) + (get_local $x) + ) + ) + (drop + (i32.and + (get_local $x) + (get_local $x) + ) + ) + (drop + (i32.or + (get_local $x) + (get_local $x) + ) + ) + (drop + (i32.eq + (get_local $x) + (get_local $x) + ) + ) + (drop + (i32.le_s + (get_local $x) + (get_local $x) + ) + ) + (drop + (i32.le_u + (get_local $x) + (get_local $x) + ) + ) + (drop + (i32.ge_s + (get_local $x) + (get_local $x) + ) + ) + (drop + (i32.ge_u + (get_local $x) + (get_local $x) + ) + ) + (drop + (i64.xor + (get_local $y) + (get_local $y) + ) + ) + (drop + (i64.ne + (get_local $y) + (get_local $y) + ) + ) + (drop + (i64.lt_s + (get_local $y) + (get_local $y) + ) + ) + (drop + (i64.lt_u + (get_local $y) + (get_local $y) + ) + ) + (drop + (i64.gt_s + (get_local $y) + (get_local $y) + ) + ) + (drop + (i64.gt_u + (get_local $y) + (get_local $y) + ) + ) + (drop + (i64.and + (get_local $y) + (get_local $y) + ) + ) + (drop + (i64.or + (get_local $y) + (get_local $y) + ) + ) + (drop + (i64.eq + (get_local $y) + (get_local $y) + ) + ) + (drop + (i64.le_s + (get_local $y) + (get_local $y) + ) + ) + (drop + (i64.le_u + (get_local $y) + (get_local $y) + ) + ) + (drop + (i64.ge_s + (get_local $y) + (get_local $y) + ) + ) + (drop + (i64.ge_u + (get_local $y) + (get_local $y) + ) + ) + ) ) (module (import "env" "memory" (memory $0 (shared 256 256))) |