Skip to content

Add a get_and_zero_local operator. #698

Closed

Description

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.

Activity

  1. modified the milestone: Discussion on Jul 12, 2016
  2. flagxor commented on Jul 19, 2016

    @flagxor
    Member

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions