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

Optimiser should be commutativity/associativity aware #256

Closed
stevehalliwell opened this issue Jun 19, 2024 · 0 comments · Fixed by #258
Closed

Optimiser should be commutativity/associativity aware #256

stevehalliwell opened this issue Jun 19, 2024 · 0 comments · Fixed by #258
Labels
enhancement New feature or request optimisation Improvement to time or space

Comments

@stevehalliwell
Copy link
Owner

Presently the optimiser will registerise based on pattern of is the previous instruction a GET_LOCAL take it internal and remove that, if the next previous is a GET_LOCAL, take that too and remove it.

The issue is this catches

var a = 1;
var b = 2;
var c = 0;
c = a + b;

but not

var i = 0;
i += 1;
@stevehalliwell stevehalliwell added enhancement New feature or request optimisation Improvement to time or space labels Jun 19, 2024
@stevehalliwell stevehalliwell changed the title Optimiser should be associativity aware Optimiser should be commutativity/associativity aware Jun 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request optimisation Improvement to time or space
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant