diff options
author | Alon Zakai <azakai@google.com> | 2021-10-27 14:10:30 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-27 14:10:30 -0700 |
commit | 5ec74cf79590648f3a633387f0d1d8a5930a410b (patch) | |
tree | 62e489dc604344f77324d526b64ed4253b977911 /test/binaryen.js | |
parent | 2b24537425ada522d892c7180a06aedc1c94509e (diff) | |
download | binaryen-5ec74cf79590648f3a633387f0d1d8a5930a410b.tar.gz binaryen-5ec74cf79590648f3a633387f0d1d8a5930a410b.tar.bz2 binaryen-5ec74cf79590648f3a633387f0d1d8a5930a410b.zip |
[Wasm GC] Constant Field Propagation: Handle immutable globals (#4258)
If we write an immutable global to a field, and that is the only thing
we ever write, then we can replace reads of the field with a get of
the global. To do that, this tracks immutable globals written to
fields and not just constant values.
Normally this is not needed, as if the global is immutable then we
propagate its constant value to everywhere anyhow. However, for
references this is useful: If we have a global immutable vtable,
for example, then we cannot replace a get of it with a constant.
So this PR helps with immutable reference types in globals, allowing
us to propagate global.gets to them to more places, which then
can allow optimizations there.
This + later opts removes 25% of array.gets from j2wasm. I believe
almost all of those are itable calls, so this means those are getting
devirtualized now. I see something like a 5% speedup due to that.
Diffstat (limited to 'test/binaryen.js')
0 files changed, 0 insertions, 0 deletions