[llvm] [WPD]: Enable speculative devirtualizatoin. (PR #159048)

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 25 12:50:54 PDT 2025


================
@@ -790,11 +812,22 @@ struct DevirtIndex {
 PreservedAnalyses WholeProgramDevirtPass::run(Module &M,
                                               ModuleAnalysisManager &MAM) {
   if (UseCommandLine) {
-    if (!DevirtModule::runForTesting(M, MAM))
+    if (!DevirtModule::runForTesting(M, MAM, ClDevirtualizeSpeculatively))
       return PreservedAnalyses::all();
     return PreservedAnalyses::none();
   }
-  if (!DevirtModule(M, MAM, ExportSummary, ImportSummary).run())
+
+  std::optional<ModuleSummaryIndex> Index;
+  if (!ExportSummary && !ImportSummary && DevirtSpeculatively) {
----------------
teresajohnson wrote:

I don't think DevirtSpeculatively is ever set currently (see comment about this earlier). So I don't think this change and the one below to pass DevirtSpeculatively can be tested in this PR, and should probably move to the follow on one.

https://github.com/llvm/llvm-project/pull/159048


More information about the llvm-commits mailing list