llvm::FeatureIndex

Indices of ML inliner input features (cost features, context, embeddings).

Synopsis

Declared in <llvm/Analysis/InlineModelFeatureMaps.h>

enum class FeatureIndex : size_t;

Description

Not all features listed in FeatureIndex are used by the ML model. Specifically, callee_embedding and caller_embedding are used only when the usage of IR2Vec embeddings is explicitly enabled. Meaning, the size/number of features is not static. So, we cannot determine number of features based on the number of elements in this enum. Cost-feature indices come first and match INLINE_COST_FEATURE_ITERATOR; remaining values match INLINE_FEATURE_ITERATOR (comments cannot live inside those X-macros).

Members

NameDescription
sroa_savings Savings from SROA (scalar replacement of aggregates).
sroa_losses Losses from SROA (scalar replacement of aggregates).
load_elimination Cost of load elimination in the call.
call_penalty Accumulation of penalty applied to call sites when inlining.
call_argument_setup Accumulation of call argument setup costs.
load_relative_intrinsic Accumulation of costs of loading relative intrinsics.
lowered_call_arg_setup Accumulation of cost of lowered call argument setups.
indirect_call_penalty Accumulation of costs for indirect calls.
jump_table_penalty Accumulation of costs for jump tables.
case_cluster_penalty Accumulation of costs for case clusters.
switch_default_dest_penalty Accumulation of costs for switch default destination.
switch_penalty Accumulation of costs for switch statements.
unsimplified_common_instructions Costs from unsimplified common instructions.
num_loops Number of loops in the caller.
dead_blocks Number of dead blocks in the caller.
simplified_instructions Number of simplified instructions.
constant_args Number of constant arguments in the call site.
constant_offset_ptr_args Number of constant offset pointer args in the call site.
callsite_cost Estimated cost of the call site.
cold_cc_penalty Penalty for a cold calling convention.
last_call_to_static_bonus Bonus for being the last call to static.
is_multiple_blocks Boolean; is the callee multiple blocks.
nested_inlines Would the default inliner perform nested inlining.
nested_inline_cost_estimate Estimate of the accumulated cost of nested inlines.
threshold Threshold for the heuristic inliner.
callee_basic_block_count Number of basic blocks of the callee.
callsite_height Position of the call site in the original call graph, measured from the farthest SCC.
node_count Total current number of defined functions in the module.
nr_ctant_params Number of parameters in the call site that are constants.
cost_estimate Total cost estimate (threshold - free).
edge_count Total number of calls in the module.
caller_users Number of module-internal users of the caller, +1 if exposed externally.
caller_conditionally_executed_blocks Number of blocks reached from a conditional instruction in the caller.
caller_basic_block_count Number of basic blocks in the caller.
callee_conditionally_executed_blocks Number of blocks reached from a conditional instruction in the callee.
callee_users Number of module-internal users of the callee, +1 if exposed externally.
is_callee_avail_external Whether the callee has available-externally linkage.
is_caller_avail_external Whether the caller has available-externally linkage.
callee_embedding IR2Vec embedding of the callee (optional).
caller_embedding IR2Vec embedding of the caller (optional).

Non-Member Functions

NameDescription
inlineCostFeatureToMlFeatureMap an inline-cost feature index to the corresponding ML feature index.