[clang] [llvm] [Clang]: Enable speculative devirtualization (PR #159685)
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 27 00:40:07 PST 2025
================
@@ -1641,6 +1642,24 @@ PassBuilder::buildModuleOptimizationPipeline(OptimizationLevel Level,
if (!LTOPreLink)
MPM.addPass(RelLookupTableConverterPass());
+ if (PTO.DevirtualizeSpeculatively && LTOPhase == ThinOrFullLTOPhase::None) {
+ MPM.addPass(WholeProgramDevirtPass(
+ /*ExportSummary*/ nullptr,
+ /*ImportSummary*/ nullptr,
+ /*DevirtSpeculatively*/ PTO.DevirtualizeSpeculatively));
+ MPM.addPass(LowerTypeTestsPass(nullptr, nullptr,
+ lowertypetests::DropTestKind::Assume));
+ if (EnableModuleInliner) {
----------------
fhahn wrote:
You can add a phase odering test. Did you evaluate the compile-time impact of running the inliner again? Did you measure the perf impact of just running the inliner again, without `WholeProgramDevirtPass`?
https://github.com/llvm/llvm-project/pull/159685
More information about the llvm-commits
mailing list