Bots, Bureaucrats, Interface administrators, smwadministrator, smwcurator, smweditor, Administrators
2,558
edits
Timo.stripf (talk | contribs) m (Timo.stripf moved page Inline Transformation to Inline Transformation) |
Timo.stripf (talk | contribs) |
||
| Line 56: | Line 56: | ||
=== Clang/LLVM Inline Implementation === | === Clang/LLVM Inline Implementation === | ||
LLVM uses a cost-based heuristic to decide whether a function should be inlined at a given call site. This decision is primarily handled by the InlineCost analysis, located in the files InlineCost.cpp and InlineCost.h. The inline parameters that influence this decision are encapsulated in the InlineParams structure. | |||
The InlineParams structure defines the thresholds and conditions that govern LLVM’s inlining decisions. These values vary based on the optimization level (-O0 to -O3). | |||
The | |||
{| class="wikitable" | {| class="wikitable" | ||
| Line 66: | Line 64: | ||
! Parameter !! Description !! Default Values | ! Parameter !! Description !! Default Values | ||
|- | |- | ||
| | | DefaultThreshold || Standard threshold for inlining decisions. If the computed inline cost is below this value, the function is likely to be inlined. || 0 (-O0), 75 (-O1), 225 (-O2), 275 (-O3) | ||
|- | |- | ||
| | | HintThreshold || Threshold for functions marked as inline, influencing their likelihood of being inlined. || Higher than DefaultThreshold | ||
|- | |- | ||
| | | ColdThreshold || Lower threshold for cold functions that are rarely executed. || Lower than DefaultThreshold | ||
|- | |- | ||
| | | OptSizeThreshold || Threshold when optimizing for size (-Os). || Lower than DefaultThreshold | ||
|- | |- | ||
| | | OptMinSizeThreshold || Threshold when optimizing for minimal size (-Oz). || Lower than OptSizeThreshold | ||
|- | |- | ||
| | | HotCallSiteThreshold || Increased threshold for call sites that are frequently executed (hot paths). || Higher than DefaultThreshold | ||
|- | |- | ||
| | | LocallyHotCallSiteThreshold || Threshold for call sites considered locally hot relative to their function entry. || Similar to HotCallSiteThreshold | ||
|- | |- | ||
| | | ColdCallSiteThreshold || Threshold for cold call sites, discouraging inlining. || Lower than DefaultThreshold | ||
|- | |- | ||
| | | ComputeFullInlineCost || Determines whether the full inline cost should always be computed. || true | ||
|- | |- | ||
| | | EnableDeferral || Allows the inlining decision to be deferred for later analysis. || true | ||
|- | |- | ||
| | | AllowRecursiveCall || Specifies whether recursive functions are allowed to be inlined. || false (-O0 to -O2), true (-O3) | ||
|} | |} | ||
edits