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

Optimize out triggering of unimplemented hooks #1769

Open
bbannier opened this issue Jun 25, 2024 · 0 comments
Open

Optimize out triggering of unimplemented hooks #1769

bbannier opened this issue Jun 25, 2024 · 0 comments

Comments

@bbannier
Copy link
Member

We have an optimization pass which removes dummy hook implementations hook we do emit when users did not provide their own hook implementations. What we did not implement at the time was for that pass to also remove the triggering of the hook wrapper (the code which invokes the hook implementations) since at that time we did not compile code in a way where we could be certain that we would see all code.

This has changed in the meantime and we now compile in a mode where all relevant code needs to be visible.1 We should update the pass to also remove triggering of the hook wrapper. Since we perform a number not-free computations for each hook invocation with pre- and post-hook functions this could improve performance. To implement this we could naively wrap all hook-dependent code with in checks of hook-specific feature constant. Ideally we would not break the way hooks can be implemented in C++ code (both for public and non-public units).

Footnotes

  1. Caveat: We also need to see all C++ files, but currently cannot detect hook implementations in C++ code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants