[llvm] [AMDGPU] Increase inline threshold when the callee only has one live use (PR #111311)
    Matt Arsenault via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Mon Oct  7 02:26:20 PDT 2024
    
    
  
================
@@ -1307,6 +1311,12 @@ unsigned GCNTTIImpl::adjustInliningThreshold(const CallBase *CB) const {
   unsigned AllocaSize = getCallArgsTotalAllocaSize(CB, DL);
   if (AllocaSize > 0)
     Threshold += ArgAllocaCost;
+
+  // Increase the threshold if it is the only call to a local function.
+  Function *Callee = CB->getCalledFunction();
+  if (Callee->hasLocalLinkage() && Callee->hasOneLiveUse())
----------------
arsenm wrote:
Guard against null callee 
https://github.com/llvm/llvm-project/pull/111311
    
    
More information about the llvm-commits
mailing list