diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/passes/optimize-instructions_all-features.txt | 32 | ||||
-rw-r--r-- | test/passes/optimize-instructions_all-features.wast | 39 |
2 files changed, 71 insertions, 0 deletions
diff --git a/test/passes/optimize-instructions_all-features.txt b/test/passes/optimize-instructions_all-features.txt index 15f0eea86..96346ed22 100644 --- a/test/passes/optimize-instructions_all-features.txt +++ b/test/passes/optimize-instructions_all-features.txt @@ -4359,6 +4359,38 @@ ) ) ) + (func $lhs-is-neg-one (param $x i32) (param $y i64) + (drop + (i32.const -1) + ) + (drop + (i64.const -1) + ) + (drop + (i32.const -1) + ) + (drop + (i64.const -1) + ) + (drop + (i32.const -1) + ) + (drop + (i64.const -1) + ) + (drop + (i32.shr_s + (i32.const -1) + (call $ne0) + ) + ) + (drop + (i32.shr_u + (i32.const -1) + (local.get $x) + ) + ) + ) (func $pre-combine-or (param $x i32) (param $y i32) (drop (i32.ge_s diff --git a/test/passes/optimize-instructions_all-features.wast b/test/passes/optimize-instructions_all-features.wast index 02f55b20c..cdb3c56f2 100644 --- a/test/passes/optimize-instructions_all-features.wast +++ b/test/passes/optimize-instructions_all-features.wast @@ -4803,6 +4803,45 @@ ) )) ) + (func $lhs-is-neg-one (param $x i32) (param $y i64) + ;; -1 >> x ==> -1 + (drop (i32.shr_s + (i32.const -1) + (local.get $x) + )) + (drop (i64.shr_s + (i64.const -1) + (local.get $y) + )) + ;; rotl(-1, x) ==> -1 + (drop (i32.rotl + (i32.const -1) + (local.get $x) + )) + (drop (i64.rotl + (i64.const -1) + (local.get $y) + )) + ;; rotr(-1, x) ==> -1 + (drop (i32.rotr + (i32.const -1) + (local.get $x) + )) + (drop (i64.rotr + (i64.const -1) + (local.get $y) + )) + ;; skip + (drop (i32.shr_s + (i32.const -1) + (call $ne0) ;; side effect + )) + ;; skip + (drop (i32.shr_u + (i32.const -1) + (local.get $x) + )) + ) (func $pre-combine-or (param $x i32) (param $y i32) (drop (i32.or (i32.gt_s |