diff options
author | Alon Zakai <azakai@google.com> | 2023-02-03 10:25:02 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-03 10:25:02 -0800 |
commit | 42b859f01df94dfffb01258b2305df8ec4d05304 (patch) | |
tree | 3caaa872d4d36b7840025f4a4cf1654026ed5f4b /test/lit/help/wasm2js.test | |
parent | d2d5135b14c2b36cdd6b5a5d00a7734fe385fc37 (diff) | |
download | binaryen-42b859f01df94dfffb01258b2305df8ec4d05304.tar.gz binaryen-42b859f01df94dfffb01258b2305df8ec4d05304.tar.bz2 binaryen-42b859f01df94dfffb01258b2305df8ec4d05304.zip |
[Wasm GC] Add AbstractTypeRefining pass (#5461)
If a type hierarchy has abstract classes in the middle, that is, types that
are never instantiated, then we can optimize casts and other operations
to them. Say in Java that we have `AbstractList`, and it only has one
subclass `IntList` that is ever created, then any place we have an `AbstractList`
we must actually have an `IntList`, or a null. (Or, if no subtype is instantiated,
then the value must definitely be a null.)
The actual implementation does a type mapping, that is, it finds all places
using an abstract type and makes them refer to the single instantiated
subtype (or null). After that change, no references to the abstract type
remain in the program, so this both refines types and also cleans up the
type section.
Diffstat (limited to 'test/lit/help/wasm2js.test')
-rw-r--r-- | test/lit/help/wasm2js.test | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/test/lit/help/wasm2js.test b/test/lit/help/wasm2js.test index 501504027..502419cf2 100644 --- a/test/lit/help/wasm2js.test +++ b/test/lit/help/wasm2js.test @@ -42,6 +42,9 @@ ;; CHECK-NEXT: Optimization passes: ;; CHECK-NEXT: -------------------- ;; CHECK-NEXT: +;; CHECK-NEXT: --abstract-type-refining refine and merge abstract +;; CHECK-NEXT: (never-created) types +;; CHECK-NEXT: ;; CHECK-NEXT: --alignment-lowering lower unaligned loads and stores ;; CHECK-NEXT: to smaller aligned ones ;; CHECK-NEXT: |