Decide inlining from user directives and viability, without cost modeling.
Declared in <llvm/Analysis/InlineCost.h>
std::optional<InlineResult>
getAttributeBasedInliningDecision(
CallBase& Call,
Function* Callee,
TargetTransformInfo& CalleeTTI,
function_ref<TargetLibraryInfo const&(Function&)> GetTLI);
Returns InlineResult::success() if the call site should be always inlined because of user directives, and the inlining is viable. Returns InlineResult::failure() if the inlining may never happen because of user directives or incompatibilities detectable without needing callee traversal. Otherwise returns std::nullopt, meaning that inlining should be decided based on other criteria (e.g. cost modeling).
Always/never decision from directives, or std::nullopt to defer to cost modeling.
| Name | Description |
|---|---|
| Call | Call site whose attributes are inspected. |
| Callee | Callee function, or null for an indirect call. |
| CalleeTTI | Target transform info used to check inline compatibility. |
| GetTLI | Callback returning target library info for a function. |