[llvm] [WPD][ThinLTO]Add cutoff option for WPD (PR #113383)

Mingming Liu via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 23 20:26:07 PDT 2024


================
@@ -1169,6 +1177,10 @@ void DevirtModule::applySingleImplDevirt(VTableSlotInfo &SlotInfo,
       if (!OptimizedCalls.insert(&VCallSite.CB).second)
         continue;
 
+      if (WholeProgramDevirtCutoff.getNumOccurrences() > 0 &&
+          NumSingleImpl >= WholeProgramDevirtCutoff)
----------------
minglotus-6 wrote:

I tested the updated PR (using `static unsigned NumDevirtCalls`) using clang and verified the new option works
* `-wholeprogramdevirt-cutoff=0` gives no devirtualization
* `-wholeprogramdevirt-cutoff=1` allows at most one in one clang invocation (and catches the potentially interesting call-site)

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


More information about the llvm-commits mailing list