Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add optimization removing unused temporaries #1425

Open
Tracked by #1480
bbannier opened this issue Apr 18, 2023 · 0 comments · May be fixed by #1444
Open
Tracked by #1480

Add optimization removing unused temporaries #1425

bbannier opened this issue Apr 18, 2023 · 0 comments · May be fixed by #1444
Assignees

Comments

@bbannier
Copy link
Member

bbannier commented Apr 18, 2023

We currently generate temporaries which depending on user code might be dead. We should look into an optimization to remove them. E.g., for the following unit

public type X = unit {
    : uint8[] &until=True;
};

we generate code for the &until condition

local bool __stop = False;
{
    local uint<8> __dd = __elem;
    __stop = __stop || True;
}

Here we create a copy of the current element in $$ so user code has access to it. This might not be needed and depending on the element type be an expensive operation we could avoid.

@bbannier bbannier linked a pull request Jun 12, 2023 that will close this issue
@bbannier bbannier self-assigned this Jun 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants