pub fn inline_some_function_calls<F: Fn(&Context, &Function, &Value) -> bool>(
context: &mut Context,
function: &Function,
predicate: F
) -> Result<bool, IrError>
Expand description
Inline function calls based on a provided heuristic predicate.
There are many things to consider when deciding to inline a function. For example:
- The size of the function, especially if smaller than the call overhead size.
- The stack frame size of the function.
- The number of calls made to the function or if the function is called inside a loop.
- A particular call has constant arguments implying further constant folding.
- An attribute request, e.g., #[always_inline], #[never_inline].