Skip to content

Escape analysis #4

@wbbradley

Description

@wbbradley

Escape analysis

Goal: Implement escape analysis in order to avoid unnecessary heap allocations.

After translation, before gen phase, add a phase to annotate heap-exprs.

Escape phase

  1. Build a usage graph of exprs.
  2. Find all exprs that have usage links to return statements or towards heap-marked exprs.
  3. For any tuples that link to return statements, mark them as heap.
  4. Goto 2 until no more exprs are marked.

During gen phase, pay attention to heap-marks on tuples.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions