[PATCH] D141952: [CSSPGO] Turn on postlink sample counts overwrite.

Hongtao Yu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 17 10:17:15 PST 2023


hoy created this revision.
Herald added subscribers: ormris, modimo, wenlei, hiraditya.
Herald added a project: All.
hoy requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

The CS preinliner computes sample counts for outlined functions globally, resulting in a more accurate function profile than the actual thinlto postlink sample inliner does. I've seen that turning on --overwrite-existing-weights for postlink results in general 0.5% to 1% code size win (perf wise is netural) for CSSPGO accross four of our big internal services, but slight code size regression for non-CS AutoFDO.  I'm turning on the switch for preinlined profile only.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D141952

Files:
  llvm/lib/Transforms/IPO/SampleProfile.cpp


Index: llvm/lib/Transforms/IPO/SampleProfile.cpp
===================================================================
--- llvm/lib/Transforms/IPO/SampleProfile.cpp
+++ llvm/lib/Transforms/IPO/SampleProfile.cpp
@@ -2014,6 +2014,8 @@
     if (Reader->profileIsPreInlined()) {
       if (!UsePreInlinerDecision.getNumOccurrences())
         UsePreInlinerDecision = true;
+      if (!OverwriteExistingWeights.getNumOccurrences())
+        OverwriteExistingWeights = true;
     }
 
     if (!Reader->profileIsCS()) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D141952.489872.patch
Type: text/x-patch
Size: 511 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230117/98beea94/attachment.bin>


More information about the llvm-commits mailing list