Skip to content

FnAbi computation should be cached. #65999

Open
@eddyb

Description

@eddyb

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-codegenArea: Code generationC-enhancementCategory: An issue proposing an enhancement or a PR with one.I-compiletimeIssue: Problems and improvements with respect to compile times.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions