Skip to content

Detect when a record, tuple, or call can write in-place #1002

Closed
@marijnh

Description

@marijnh

If you do x = rec(a=10 with x) or y = f(y) or similar, the result has to be constructed in a scratch space, rather than directly into the local variable's memory, because the local is needed to build the result. The alias analysis could mark expressions where this is not needed, so that we can avoid this scratch alloc + move as much as possible. (This is already done when the expression initializes the memory, rather than replacing an existing value.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions