diff options
author | Alon Zakai <azakai@google.com> | 2021-04-22 15:21:43 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-22 15:21:43 -0700 |
commit | fa28a70db380c893b2c2bd236a422dc9ae1a383c (patch) | |
tree | 77f5779e6343ad41c4be8b33cd7b4066cad5b979 /test/lit/passes/optimize-instructions.wast | |
parent | 23a26c75c6d737d6f97ed1048639b41e948fdd58 (diff) | |
download | binaryen-fa28a70db380c893b2c2bd236a422dc9ae1a383c.tar.gz binaryen-fa28a70db380c893b2c2bd236a422dc9ae1a383c.tar.bz2 binaryen-fa28a70db380c893b2c2bd236a422dc9ae1a383c.zip |
OptimizeInstructions: Handle EqZInt64 on an if/select arm, not just 32 (#3837)
Diffstat (limited to 'test/lit/passes/optimize-instructions.wast')
-rw-r--r-- | test/lit/passes/optimize-instructions.wast | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/test/lit/passes/optimize-instructions.wast b/test/lit/passes/optimize-instructions.wast index fd2637373..058c030dd 100644 --- a/test/lit/passes/optimize-instructions.wast +++ b/test/lit/passes/optimize-instructions.wast @@ -11792,6 +11792,50 @@ ) ) ) + ;; CHECK: (func $ternary-i64-0 (param $x i32) (param $y i64) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (i64.eqz + ;; CHECK-NEXT: (if (result i64) + ;; CHECK-NEXT: (local.get $x) + ;; CHECK-NEXT: (i64.const 1) + ;; CHECK-NEXT: (local.get $y) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + (func $ternary-i64-0 (param $x i32) (param $y i64) + (drop + (if (result i32) + (local.get $x) + (i32.const 0) + (i64.eqz + (local.get $y) + ) + ) + ) + ) + ;; CHECK: (func $ternary-i64-1 (param $x i32) (param $y i64) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (i64.eqz + ;; CHECK-NEXT: (if (result i64) + ;; CHECK-NEXT: (local.get $x) + ;; CHECK-NEXT: (local.get $y) + ;; CHECK-NEXT: (i64.const 0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + (func $ternary-i64-1 (param $x i32) (param $y i64) + (drop + (if (result i32) + (local.get $x) + (i64.eqz + (local.get $y) + ) + (i32.const 1) + ) + ) + ) ;; CHECK: (func $ternary-no (param $x i32) (param $y i32) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (select |