Open
Description
When doing LTO, LLVM supports a devirtualization pass that converts some indirect calls to static, inlineable calls. This can unlock a lot of optimizations when dynamic dispatch is used frequently in a program.
I don't know how hard this would be to support in Rust. Clang has a flag -fwhole-program-vtables
which we would need to emulate. From there it seems like it might "just work". I'm opening this issue to start collecting more information.
I also found #11915 which mentions this, but not sure if any of the information there is still accurate.
Metadata
Metadata
Assignees
Labels
Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Area: Trait systemCategory: An issue proposing an enhancement or a PR with one.Category: An issue highlighting optimization opportunities or PRs implementing suchRelevant to the compiler team, which will review and decide on the PR/issue.