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 optimizer pass to avoid copies of variables no longer used #1960

Open
bbannier opened this issue Jan 16, 2025 · 0 comments
Open

Add optimizer pass to avoid copies of variables no longer used #1960

bbannier opened this issue Jan 16, 2025 · 0 comments
Labels
Enhancement Improvement of existing functionality

Comments

@bbannier
Copy link
Member

Most of them time when generating code we do not know whether a HILTI value will be used later and consequentially do not use std::move when emitting C++ code. This means that we might that we could e.g., needlessly create copies when calling functions which parameters pass by copy, or create copies when storing results in another variable.

The work in #1690 should gives us control flow information to decide whether a reference to a variable (a use of a hilti::ID referring to a variable) is the last use. If we persisted that information with e.g., the expression we could make use of it during C++ codegen.

@bbannier bbannier added the Enhancement Improvement of existing functionality label Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Improvement of existing functionality
Projects
None yet
Development

No branches or pull requests

1 participant