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

Teresa Johnson via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 4 10:56:27 PDT 2025


================
@@ -5170,7 +5174,7 @@ Execute ``clang-cl /?`` to see a list of supported options:
       -fstandalone-debug      Emit full debug info for all types used by the program
       -fstrict-aliasing	      Enable optimizations based on strict aliasing rules
       -fsyntax-only           Run the preprocessor, parser and semantic analysis stages
-      -fwhole-program-vtables Enables whole-program vtable optimization. Requires -flto
+      -fwhole-program-vtables Enables whole-program vtable optimization.
----------------
teresajohnson wrote:

gcc has an option called -fdevirtualize-speculatively, that describes what is being enabled here: https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html#index-fdevirtualize-speculatively

How about adding that to clang and using it to enable this instead of -fwhole-program-vtables, which doesn't really make sense as what is being enabled isn't whole program in this case.

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


More information about the cfe-commits mailing list