You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The use case is to help inform the runtime compiler that local variables are not used (or constants) over code ranges.
This might be exploited by a baseline compiler to avoid flushing local variables cached in registers to memory. If a use of a local variable also zeros it then whatever value it had is no longer needed.
For decoding to SSA, if wasm code can use get_and_zero_local on the last use of a local then at control flow merge points the locals not live will be flagged as constant zero rather than having potentially different definitions, and this would avoid the need to emit a phi for them rather a single definition could be carried forward flagged as zero.
My expressionless encoding experiment noted excess phi's being generated for unused locals as a problem, but perhaps being able to zero a local on the last use of a definition offers a way to address this. Something to explore.
The text was updated successfully, but these errors were encountered:
Don't think this is necessary for MVP.
This seems like a very particular flavor of trying to pre-compute liveness. That might be an interesting direction, but also seems very open ended.
Worth exploring in the future.
@flagxor It might not be necessary for the MVP, or it might be, we just don't have a MVP at this point and far from it I seem to be the only person articulating any design that might scale to handle multiple values. One of my proposals was the expressionless encoding but on exploration it caused more effort decoding and produced more phi's, however it later occurred that get_and_zero_local might address some of these shortcomings. If decoding efficiency is a show stopper for a MVP then this might be too.
How do we know that this can be explored later efficiently? Perhaps other design decisions will make it too inefficient to encode? I would like to see a path forward, a plan, and the expressionless encoding is at least a path and a plan.
Perhaps you would like to help move the design forward and articulating some proposal for handling multiple return values from functions might at least create some discussion?
The use case is to help inform the runtime compiler that local variables are not used (or constants) over code ranges.
This might be exploited by a baseline compiler to avoid flushing local variables cached in registers to memory. If a use of a local variable also zeros it then whatever value it had is no longer needed.
For decoding to SSA, if wasm code can use
get_and_zero_local
on the last use of a local then at control flow merge points the locals not live will be flagged as constant zero rather than having potentially different definitions, and this would avoid the need to emit a phi for them rather a single definition could be carried forward flagged as zero.My expressionless encoding experiment noted excess phi's being generated for unused locals as a problem, but perhaps being able to zero a local on the last use of a definition offers a way to address this. Something to explore.
The text was updated successfully, but these errors were encountered: