Skip to content

Inlining, no inline, inlinable, pragmas chapter #44

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

Open
doyougnu opened this issue Aug 23, 2022 · 5 comments
Open

Inlining, no inline, inlinable, pragmas chapter #44

doyougnu opened this issue Aug 23, 2022 · 5 comments
Milestone

Comments

@doyougnu
Copy link
Collaborator

Show core and stg.

@doyougnu doyougnu added this to the Phase 1 milestone Aug 23, 2022
@doyougnu
Copy link
Collaborator Author

Bonus: try to correlate to too much improper inlining to more pressure on instruction caches which then cause reigster spills. Would be great to get numbers on this!

@doyougnu
Copy link
Collaborator Author

@doyougnu
Copy link
Collaborator Author

doyougnu commented Mar 16, 2023

See this ticket as a case study: https://gitlab.haskell.org/ghc/ghc/-/issues/23122#note_487215

and also a good example of reading core and join point manipulation.

@doyougnu
Copy link
Collaborator Author

doyougnu commented Sep 15, 2023

Also this ticket on the implications of -fexpose-all-unfoldings vs INLINEABLE https://gitlab.haskell.org/ghc/ghc/-/issues/21715#note_437347 with background here: haskell-unordered-containers/unordered-containers#357

The basic gist is that INLINEABLE stores the unoptimized unfolding so that it can be later optimized is say another package, whereas -fexpose-all-unfoldings stores the optimized unfolding in the interface file so that it can be inlined later. Notice the subtle difference here, it is entirely possible that INLINEABLE optimizes better that the flag because GHC will have access to the call site, whereas the flag just says: here is your optimized version and now Im done.

@doyougnu
Copy link
Collaborator Author

Also this ticket which contemplates the consequences of INLINE: https://gitlab.haskell.org/ghc/ghc/-/issues/23823

One major one being that with an INLINE pragma the float out pass is skipped

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

1 participant