CakeML / CakeML/cakeml

Introduce cutsets in StackLang and LabLang

Open
#1,078 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Standard ML
Stars
1.2k
Forks
104
Avg merge
2d 21h
Merged PRs (30d)
16

Description

At the moment, WordLang is the last language with cutsets, i.e. annotations which state that only local variables in this set are to survive this line in the code. These annotations are useful when optimising because they give optimisations the freedom to write anything to any other value without danger of having some effect on code elsewhere by such update to local variables.

*Example:*

v0 := (v1 + 1) * 3;
v1 := (v1 + 1) & 7;
cut {v0, v1, v2}

With the cutset annotation, an optimisation can locally make the decision to that it's safe to assign to v5 since the cutset at the end ensures that its value never makes it past the last line in the example.

v5 := v1 + 1;
v0 := v5 * 3;
v1 := v5 & 7;
cut {v0, v1, v2}

This issue is about adding cutset annotations to StackLang and LabLang so that future peephole optimisers at these levels can make use of new temporaries.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.