[llvm] 3113e5b - [CSSPGO] Relax size limitation for priority inlining with preinlined profile

Hongtao Yu via llvm-commits llvm-commits at lists.llvm.org
Tue May 3 18:43:14 PDT 2022


Author: Hongtao Yu
Date: 2022-05-03T18:43:07-07:00
New Revision: 3113e5bb520c7281138a5909cbf776efa5e80047

URL: https://github.com/llvm/llvm-project/commit/3113e5bb520c7281138a5909cbf776efa5e80047
DIFF: https://github.com/llvm/llvm-project/commit/3113e5bb520c7281138a5909cbf776efa5e80047.diff

LOG: [CSSPGO] Relax size limitation for priority inlining with preinlined profile

As a follow-up to D124632, I'm turning on unlimited size caps for inlining with preinlined profile. It should be safe as a preinlined profile has "bounded" inline contexts.

No noticeable size or perf delta was seen with two of our internal large services, but I think this is still a good change to be consistent with the other case.

Reviewed By: wenlei

Differential Revision: https://reviews.llvm.org/D124793

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/IPO/SampleProfile.cpp b/llvm/lib/Transforms/IPO/SampleProfile.cpp
index 001ba2308903e..8957940807f9a 100644
--- a/llvm/lib/Transforms/IPO/SampleProfile.cpp
+++ b/llvm/lib/Transforms/IPO/SampleProfile.cpp
@@ -2025,10 +2025,13 @@ bool SampleProfileLoader::doInitialization(Module &M,
     if (Reader->profileIsPreInlined()) {
       if (!UsePreInlinerDecision.getNumOccurrences())
         UsePreInlinerDecision = true;
-    } else if (!Reader->profileIsCS()) {
+    }
+
+    if (!Reader->profileIsCS()) {
       // Non-CS profile should be fine without a function size budget for the
-      // inliner since the contexts in the profile are all from inlining in
-      // the prevoius build, thus they are bounded.
+      // inliner since the contexts in the profile are either all from inlining
+      // in the prevoius build or pre-computed by the preinliner with a size
+      // cap, thus they are bounded.
       if (!ProfileInlineLimitMin.getNumOccurrences())
         ProfileInlineLimitMin = std::numeric_limits<unsigned>::max();
       if (!ProfileInlineLimitMax.getNumOccurrences())


        


More information about the llvm-commits mailing list