FnAbi computation should be cached. #65999
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.
We might be spending a non-trivial amount of time creating
FnAbi
s and adjusting them, so we should investigate caching them, similar to how we cache LLVMType
s we compute from RustTy
s.After #65947, this is what's left:
FnAbi::of_instance
: takesty::Instance
, easy to cachelayout_of
isFnAbi::of_fn_ptr
: takesty::PolyFnSig
, might be more expensiveinputs_and_outputs
is compared/hashed by pointer nowadays, isn't it?Type
s forfn
pointers is already cached itself, but calls offn
pointers also requireFnAbi
sFnAbi::of_instance
, so it's lower priorityThe text was updated successfully, but these errors were encountered: