Optimize ref tests/casts dominated by other tests/casts
Categories
(Core :: JavaScript: WebAssembly, enhancement, P2)
Tracking
()
People
(Reporter: bvisness, Assigned: bvisness)
References
(Blocks 1 open bug)
Details
Attachments
(3 files, 1 obsolete file)
There are optimizations we could perform to tighten up ref.test and ref.cast. For example, a ref.cast dominated by a ref.test of the same type could be omitted.
| Assignee | ||
Comment 1•16 days ago
|
||
This allows ref.is_null to participate in other optimizations around
tests and casts.
Updated•11 days ago
|
| Assignee | ||
Comment 2•3 days ago
|
||
I don't think we'll actually do anything with this patch because it
doesn't seem worthwhile to remove redundant casts this way. It should be
covered by other work on this bug.
Updated•3 days ago
|
| Assignee | ||
Comment 3•3 days ago
|
||
The LUB seemed like the conservative choice when commoning up nodes
during GVN, but actually this is somewhat wrong. Combining the types
from two equivalent nodes is not like combining the types in a phi; in
the latter case the values are not equivalent and therefore you must
find an upper bound, while in the former the values are equivalent and
therefore you can safely take a lower bound.
This restores the property that ref types only lower over the course of
optimization, which makes everything more sane and predictable.
| Assignee | ||
Comment 4•3 days ago
|
||
There is a suite of optimizations we can make when ref.test and ref.cast
instructions dominate each other. This is not yet captured by any other
optimizations but should particularly help the pattern of:
local.get $obj
ref.test (ref $t)
if
local.get $obj
ref.cast $obj
...
end
Description
•