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

Constant folding for expressions #691

Open
yorickpeterse opened this issue Feb 13, 2024 · 0 comments
Open

Constant folding for expressions #691

yorickpeterse opened this issue Feb 13, 2024 · 0 comments
Labels
compiler Changes related to the compiler feature New things to add to Inko, such as a new standard library module performance Changes related to improving performance

Comments

@yorickpeterse
Copy link
Collaborator

Description

The DefineConstants MIR pass applies constant folding to constant values, such that e.g. let A = 10 + 5 is turned into let A = 15. We should extract this logic and use it for a constant folding pass that operates on expressions (= the contents of method bodies). This way expressions such as let a = 'foo' + 'bar' are turned into let a = 'foobar'.

Related work

No response

@yorickpeterse yorickpeterse added feature New things to add to Inko, such as a new standard library module performance Changes related to improving performance compiler Changes related to the compiler labels Feb 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler Changes related to the compiler feature New things to add to Inko, such as a new standard library module performance Changes related to improving performance
Projects
None yet
Development

No branches or pull requests

1 participant