[PATCH] D62707: [AMDGPU] Use InliningThresholdMultiplier for inline hint

Stanislav Mekhanoshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 30 15:27:44 PDT 2019


rampitec created this revision.
rampitec added a reviewer: scott.linder.
Herald added subscribers: eraman, t-tye, tpr, dstuttard, yaxunl, nhaehnle, wdng, jvesely, kzhuravl, arsenm.

AMDGPU uses multiplier 9 for the inline cost. It is taken into account
everywhere except for inline hint threshold. As a result we are penalizing
functions with the inline hint making them less probable to be inlined
than those without the hint. Defaults are 225 for a normal function and
325 for a function with an inline hint. Currently we have effective
threshold 225 * 9 = 2025 for normal functions and just 325 for those with
the hint. That is fixed by this patch.


https://reviews.llvm.org/D62707

Files:
  lib/Target/AMDGPU/AMDGPUInline.cpp


Index: lib/Target/AMDGPU/AMDGPUInline.cpp
===================================================================
--- lib/Target/AMDGPU/AMDGPUInline.cpp
+++ lib/Target/AMDGPU/AMDGPUInline.cpp
@@ -111,7 +111,8 @@
     Callee->hasFnAttribute(Attribute::InlineHint);
   if (InlineHint && Params.HintThreshold && Params.HintThreshold > Thres
       && !Caller->hasFnAttribute(Attribute::MinSize))
-    Thres = Params.HintThreshold.getValue();
+    Thres = Params.HintThreshold.getValue() *
+            TTIWP->getTTI(*Callee).getInliningThresholdMultiplier();
 
   const DataLayout &DL = Caller->getParent()->getDataLayout();
   if (!Callee)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D62707.202321.patch
Type: text/x-patch
Size: 634 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190530/46011135/attachment.bin>


More information about the llvm-commits mailing list