diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/passes/optimize-instructions.txt | 70 | ||||
-rw-r--r-- | test/passes/optimize-instructions.wast | 75 |
2 files changed, 145 insertions, 0 deletions
diff --git a/test/passes/optimize-instructions.txt b/test/passes/optimize-instructions.txt index 7d82ae8b1..0e8654e48 100644 --- a/test/passes/optimize-instructions.txt +++ b/test/passes/optimize-instructions.txt @@ -3223,6 +3223,76 @@ (i32.const 2) ) ) + (func $pre-combine-or (; 75 ;) (type $5) (param $x i32) (param $y i32) + (drop + (i32.ge_s + (get_local $x) + (get_local $y) + ) + ) + (drop + (i32.ge_s + (get_local $x) + (get_local $y) + ) + ) + (drop + (i32.or + (i32.eq + (get_local $x) + (i32.const 1) + ) + (i32.gt_s + (get_local $x) + (get_local $y) + ) + ) + ) + (drop + (i32.or + (i32.eq + (get_local $x) + (get_local $y) + ) + (i32.gt_s + (get_local $x) + (i32.const 1) + ) + ) + ) + (drop + (i32.or + (i32.gt_s + (call $ne0) + (get_local $y) + ) + (i32.eq + (call $ne0) + (get_local $y) + ) + ) + ) + (drop + (i32.or + (i32.gt_s + (get_local $y) + (call $ne0) + ) + (i32.eq + (call $ne0) + (get_local $y) + ) + ) + ) + ) + (func $combine-or (; 76 ;) (type $5) (param $x i32) (param $y i32) + (drop + (i32.ge_s + (get_local $x) + (get_local $y) + ) + ) + ) ) (module (type $0 (func)) diff --git a/test/passes/optimize-instructions.wast b/test/passes/optimize-instructions.wast index 234b3913b..be9761a2b 100644 --- a/test/passes/optimize-instructions.wast +++ b/test/passes/optimize-instructions.wast @@ -3663,6 +3663,81 @@ (i32.const 2) ) ) + (func $pre-combine-or (param $x i32) (param $y i32) + (drop (i32.or + (i32.gt_s + (get_local $x) + (get_local $y) + ) + (i32.eq + (get_local $y) ;; ordering should not stop us + (get_local $x) + ) + )) + (drop (i32.or + (i32.eq ;; ordering should not stop us + (get_local $y) + (get_local $x) + ) + (i32.gt_s + (get_local $x) + (get_local $y) + ) + )) + (drop (i32.or + (i32.gt_s + (get_local $x) + (get_local $y) + ) + (i32.eq + (get_local $x) + (i32.const 1) ;; not equal + ) + )) + (drop (i32.or + (i32.gt_s + (get_local $x) + (i32.const 1) ;; not equal + ) + (i32.eq + (get_local $x) + (get_local $y) + ) + )) + (drop (i32.or + (i32.gt_s + (call $ne0) ;; side effects + (get_local $y) + ) + (i32.eq + (call $ne0) + (get_local $y) + ) + )) + (drop (i32.or + (i32.gt_s + (get_local $y) + (call $ne0) ;; side effects + ) + (i32.eq + (get_local $y) + (call $ne0) + ) + )) + ) + (func $combine-or (param $x i32) (param $y i32) + (drop (i32.or + (i32.gt_s + (get_local $x) + (get_local $y) + ) + (i32.eq + (get_local $x) + (get_local $y) + ) + )) + ;; TODO: more stuff here + ) ) (module (import "env" "memory" (memory $0 (shared 256 256))) |