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

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 8 08:03:38 PDT 2025


================
@@ -1329,10 +1363,10 @@ bool DevirtModule::trySingleImplDevirt(
   if (!IsExported)
     return false;
 
-  // If the only implementation has local linkage, we must promote to external
-  // to make it visible to thin LTO objects. We can only get here during the
-  // ThinLTO export phase.
-  if (TheFn->hasLocalLinkage()) {
+  // If the only implementation has local linkage, we must promote
+  // to external to make it visible to thin LTO objects.
+  // This change should be safe only in LTO mode.
----------------
teresajohnson wrote:

Maybe change this to something like: "We only want to do this in the ThinLTO export phase, in which case we will not have built a local summary for the module."

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


More information about the llvm-commits mailing list