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

FnAbi computation should be cached. #65999

Open
eddyb opened this issue Oct 31, 2019 · 2 comments
Open

FnAbi computation should be cached. #65999

eddyb opened this issue Oct 31, 2019 · 2 comments
Labels
A-codegen Area: Code generation C-enhancement Category: An issue proposing an enhancement or a PR with one. I-compiletime Issue: Problems and improvements with respect to compile times. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@eddyb
Copy link
Member

eddyb commented Oct 31, 2019

We might be spending a non-trivial amount of time creating FnAbis and adjusting them, so we should investigate caching them, similar to how we cache LLVM Types we compute from Rust Tys.

After #65947, this is what's left:

  • FnAbi::of_instance: takes ty::Instance, easy to cache
    • we should be able to make this a query, like layout_of is
  • FnAbi::of_fn_ptr: takes ty::PolyFnSig, might be more expensive
    • well, inputs_and_outputs is compared/hashed by pointer nowadays, isn't it?
    • creating LLVM Types for fn pointers is already cached itself, but calls of fn pointers also require FnAbis
    • this is likely used less than FnAbi::of_instance, so it's lower priority
@traxys
Copy link
Contributor

traxys commented Oct 31, 2019

Is it a good issue if I gained some knowledge on the structures of query ? (I would like to learn more of the inner workings of the compiler)

@eddyb
Copy link
Member Author

eddyb commented Nov 1, 2019

@traxys Sounds good! You would just need to wait for #65947.

@jonas-schievink jonas-schievink added A-codegen Area: Code generation C-enhancement Category: An issue proposing an enhancement or a PR with one. I-compiletime Issue: Problems and improvements with respect to compile times. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Nov 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-codegen Area: Code generation C-enhancement Category: An issue proposing an enhancement or a PR with one. I-compiletime Issue: Problems and improvements with respect to compile times. 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

3 participants