[llvm] [WPD]: Enable speculative devirtualizatoin. (PR #159048)
Teresa Johnson via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 25 12:50:52 PDT 2025
================
@@ -1325,10 +1367,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()) {
+ // Out of speculative devirtualization mode, if the only implementation has
+ // local linkage, we must promote to external to make it visible to thin LTO
+ // objects.
+ if (!DevirtSpeculatively && TheFn->hasLocalLinkage()) {
----------------
teresajohnson wrote:
This won't work if it is extended later to support speculative devirt of public vis vtables in LTO mode. Maybe track whether we originally had an ExportSummary, and do this only when we did?
https://github.com/llvm/llvm-project/pull/159048
More information about the llvm-commits
mailing list