sway_ir::optimize

Module inline

Source
Expand description

Function inlining.

Function inlining is pretty hairy so these passes must be maintained with care.

Enums§

Inline
This is a copy of sway_core::inline::Inline. TODO: Reuse: Depend on sway_core? Move it to sway_types?

Constants§

FN_INLINE_NAME

Functions§

create_fn_inline_pass
fn_inline
inline_all_function_calls
Inline all calls made from a specific function, effectively removing all Call instructions.
inline_function_call
Inline a function to a specific call site within another function.
inline_some_function_calls
Inline function calls based on a provided heuristic predicate.
is_small_fn
A utility to get a predicate which can be passed to inline_some_function_calls() based on certain sizes of the function. If a constraint is None then any size is assumed to be acceptable.
metadata_to_inline