From 3e8a9dacf6c65c29054094ce9f1d34ae8480df65 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Thu, 14 Sep 2023 14:21:25 -0700 Subject: 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 --- test/lit/help/wasm2js.test | 2 ++ 1 file changed, 2 insertions(+) (limited to 'test/lit/help/wasm2js.test') diff --git a/test/lit/help/wasm2js.test b/test/lit/help/wasm2js.test index 1e34b3617..54a593b75 100644 --- a/test/lit/help/wasm2js.test +++ b/test/lit/help/wasm2js.test @@ -435,6 +435,8 @@ ;; CHECK-NEXT: --trap-mode-js replace trapping operations with ;; CHECK-NEXT: js semantics ;; CHECK-NEXT: +;; CHECK-NEXT: --tuple-optimization optimize trivial tuples away +;; CHECK-NEXT: ;; CHECK-NEXT: --type-merging merge types to their supertypes ;; CHECK-NEXT: where possible ;; CHECK-NEXT: -- cgit v1.2.3