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

incr. comp.: Increase partition granularity via special-casing non-inlined functions #35902

Open
michaelwoerister opened this issue Aug 22, 2016 · 7 comments
Labels
A-incr-comp Area: Incremental compilation C-enhancement Category: An issue proposing an enhancement or a PR with one. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@michaelwoerister
Copy link
Member

michaelwoerister commented Aug 22, 2016

If we put every function into its own codegen unit, we would minimize the amount of functions being re-translated even though they have not changed. The main reason we don't do this, is because it would completely prevent inlining, which in turn has too detrimental an effect on runtime performance.

However, for many functions we could probably predict very well that they would never get inlined by LLVM anyway, because they are marked with #[inline(never)] or they are just too big. This category of functions could be put into their own codegen unit without negative effects on runtime performance.

@michaelwoerister michaelwoerister added A-incr-comp Area: Incremental compilation C-enhancement Category: An issue proposing an enhancement or a PR with one. labels Aug 22, 2016
@michaelwoerister
Copy link
Member Author

cc @nikomatsakis

@michaelwoerister michaelwoerister changed the title incr. comp.: Increase partition granularity by for non-inlined functions incr. comp.: Increase partition granularity via special-casing non-inlined functions Aug 22, 2016
@retep998
Copy link
Member

retep998 commented Aug 22, 2016

Even if a function is marked with #[inline(never)] that doesn't mean it won't inline other functions into it. Wouldn't having it in a codegen unit of its own would prevent it from inlining other functions in the same crate.

@michaelwoerister
Copy link
Member Author

michaelwoerister commented Aug 22, 2016

Having it in a codegen unit of its own would prevent it from inlining other functions in the same crate.

Not necessarily. It could still inline as many functions as it wants (via copying those functions into the codegen unit of its "main" functions). That just leads to another kind of false positives when it comes to recompilation.

@Mark-Simulacrum
Copy link
Member

Has anything happened here? I don't think so, but perhaps an update would be good.

@michaelwoerister
Copy link
Member Author

michaelwoerister commented May 12, 2017

Well, generic functions are not treated as inline functions by default anymore. Otherwise the status is the same. ThinLTO might open up some interesting opportunities here, since it potentially decouples runtime performance from CGU granularity.

@steveklabnik
Copy link
Member

Triage: incremental compilation has come a long way, but I'm still not sure what the state is today.

@retep998
Copy link
Member

Because codegen unit currently implies object file, this would make object file spam even worse of an issue, making #53014 occur far more often.

@pnkfelix pnkfelix added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Jun 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-incr-comp Area: Incremental compilation C-enhancement Category: An issue proposing an enhancement or a PR with one. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

5 participants