From 25e5aa67bd16f277ad32d42bfbbf7cd130ddf028 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Tue, 1 Nov 2022 17:12:29 -0700 Subject: ReorderGlobals pass (#4904) This sorts globals by their usage (and respecting dependencies). If the module has very many globals then using smaller LEBs can matter. If there are fewer than 128 globals then we cannot reduce size, and the pass exits early (so this pass will not slow down MVP builds, which usually have just 1 global, the stack pointer). But with wasm GC it is common to use globals for vtables etc., and often there is a very large number of them. --- test/lit/help/wasm2js.test | 3 +++ 1 file changed, 3 insertions(+) (limited to 'test/lit/help/wasm2js.test') diff --git a/test/lit/help/wasm2js.test b/test/lit/help/wasm2js.test index 0d61348b8..f190c8fed 100644 --- a/test/lit/help/wasm2js.test +++ b/test/lit/help/wasm2js.test @@ -314,6 +314,9 @@ ;; CHECK-NEXT: --reorder-functions sorts functions by access ;; CHECK-NEXT: frequency ;; CHECK-NEXT: +;; CHECK-NEXT: --reorder-globals sorts globals by access +;; CHECK-NEXT: frequency +;; CHECK-NEXT: ;; CHECK-NEXT: --reorder-locals sorts locals by access frequency ;; CHECK-NEXT: ;; CHECK-NEXT: --rereloop re-optimize control flow using -- cgit v1.2.3