[clang] [llvm] [WPD]: Apply speculative WPD in non-lto mode. (PR #145031)

Hassnaa Hamdi via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 31 03:05:55 PDT 2025


================
@@ -2437,8 +2486,12 @@ bool DevirtModule::run() {
                  .WPDRes[S.first.ByteOffset];
     if (tryFindVirtualCallTargets(TargetsForSlot, TypeMemberInfos,
                                   S.first.ByteOffset, ExportSummary)) {
-
-      if (!trySingleImplDevirt(ExportSummary, TargetsForSlot, S.second, Res)) {
+      bool SingleImplDevirt =
+          trySingleImplDevirt(ExportSummary, TargetsForSlot, S.second, Res);
+      // In Speculative devirt mode, we skip virtual constant propagation
+      // and branch funneling to minimize the drawback if we got wrong
+      // speculation during devirtualization.
+      if (!SingleImplDevirt && DevirtCheckMode != WPDCheckMode::Fallback) {
----------------
hassnaaHamdi wrote:

fixed

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


More information about the cfe-commits mailing list