diff options
author | Alon Zakai <azakai@google.com> | 2022-11-17 15:00:28 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-17 23:00:28 +0000 |
commit | 977d653f9801b3eedc7dd667e4068573e73d2bb5 (patch) | |
tree | 8876e96e5f31d32b6a656a627b02e635db1314af /scripts/test/support.py | |
parent | 5f5c70255cfa917efee9855ce1f8340b017e0adb (diff) | |
download | binaryen-977d653f9801b3eedc7dd667e4068573e73d2bb5.tar.gz binaryen-977d653f9801b3eedc7dd667e4068573e73d2bb5.tar.bz2 binaryen-977d653f9801b3eedc7dd667e4068573e73d2bb5.zip |
[Wasm GC] Start an OptimizeCasts pass and reuse cast values there (#5263)
(some.operation
(ref.cast .. (local.get $ref))
(local.get $ref)
)
=>
(some.operation
(local.tee $temp
(ref.cast .. (local.get $ref))
)
(local.get $temp)
)
This can help cases where we cast for some reason but happen to not use the
cast value in all places. This occurs in j2wasm in itable calls sometimes: The
this pointer is is refined, but the itable may be done with an unrefined pointer,
which is less optimizable.
So far this is just inside basic blocks, but that is enough for the cast of itable
calls and other common patterns I see.
Diffstat (limited to 'scripts/test/support.py')
0 files changed, 0 insertions, 0 deletions