Skip to content

Liveness analysis in JuvixAsm #1562

@lukaszcz

Description

@lukaszcz

Function-local liveness analysis. This is easy to do because there are no loops within a single function. It is important not to leave this to the C compiler because we manage the stack explicitly - we want to save only live variables after copy propagation. The C compiler cannot remove unnecessary saves (pushes to the stack) because it's not aware of JuvixAsm semantics.

Type info available in JuvixAsm can help remove more pushes: the variables of non-allocated types (e.g. bool, enum) do not need to be saved in Prealloc and can be considered "not live" for this purpose.

Copy propagation in JuvixReg will need to adjust the live variables.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions