diff options
author | Alon Zakai <azakai@google.com> | 2023-09-14 14:21:25 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-14 14:21:25 -0700 |
commit | 3e8a9dacf6c65c29054094ce9f1d34ae8480df65 (patch) | |
tree | 928b04d774c2540a6a4c170d6013d5b60663c447 /test/lit/ctor-eval | |
parent | f774effa54c6a40448487033a28a47caa3394f61 (diff) | |
download | binaryen-3e8a9dacf6c65c29054094ce9f1d34ae8480df65.tar.gz binaryen-3e8a9dacf6c65c29054094ce9f1d34ae8480df65.tar.bz2 binaryen-3e8a9dacf6c65c29054094ce9f1d34ae8480df65.zip |
Add a simple tuple optimization pass (#5937)
In some cases tuples are obviously not needed, such as when they are only used
in local operations and make/extract. Such tuples are not used as return values or
in control flow structures, so we might as well lower them to individual locals per
lane, which other passes can optimize a lot better.
I believe LLVM does the same with its own tuples: it lowers them as much as
possible, leaving only necessary ones.
Fixes #5923
Diffstat (limited to 'test/lit/ctor-eval')
-rw-r--r-- | test/lit/ctor-eval/multivalue-local.wast | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/test/lit/ctor-eval/multivalue-local.wast b/test/lit/ctor-eval/multivalue-local.wast index f83d3ea86..0f35dbd61 100644 --- a/test/lit/ctor-eval/multivalue-local.wast +++ b/test/lit/ctor-eval/multivalue-local.wast @@ -45,21 +45,12 @@ ;; CHECK: (func $multivalue-local_2 (type $1) (result i32) ;; CHECK-NEXT: (local $0 i32) -;; CHECK-NEXT: (local $1 (i32 i32)) ;; CHECK-NEXT: (local.set $0 ;; CHECK-NEXT: (i32.const 42) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (local.set $1 -;; CHECK-NEXT: (tuple.make -;; CHECK-NEXT: (i32.const 42) -;; CHECK-NEXT: (i32.const 1000) -;; CHECK-NEXT: ) -;; CHECK-NEXT: ) ;; CHECK-NEXT: (call $import) ;; CHECK-NEXT: (i32.add ;; CHECK-NEXT: (local.get $0) -;; CHECK-NEXT: (tuple.extract 0 -;; CHECK-NEXT: (local.get $1) -;; CHECK-NEXT: ) +;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) |