-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
Open
Labels
A-codegenArea: Code generationArea: Code generationA-destructorsArea: Destructors (`Drop`, …)Area: Destructors (`Drop`, …)C-optimizationCategory: An issue highlighting optimization opportunities or PRs implementing suchCategory: An issue highlighting optimization opportunities or PRs implementing suchI-compiletimeIssue: Problems and improvements with respect to compile times.Issue: Problems and improvements with respect to compile times.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
Currently, it seems like every CGU that contains a &ConcreteType -> &dyn Trait cast will instantiate the corresponding vtable and drop glue of ConcreteType. This can result in massive LLVM IR bloat that then slows down compile times.
We have observed this in rust-analyzer (rust-lang/rust-analyzer#10065, also Zulip discussion here), where the drop glue of a single type RootDatabase is responsible for over 40% of LLVM IR in some downstream crates.
marmeladema, zeskeertwee, Kobzol, crumblingstatue, zacps and 10 more
Metadata
Metadata
Assignees
Labels
A-codegenArea: Code generationArea: Code generationA-destructorsArea: Destructors (`Drop`, …)Area: Destructors (`Drop`, …)C-optimizationCategory: An issue highlighting optimization opportunities or PRs implementing suchCategory: An issue highlighting optimization opportunities or PRs implementing suchI-compiletimeIssue: Problems and improvements with respect to compile times.Issue: Problems and improvements with respect to compile times.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.