LLVM  14.0.0git
Namespaces | Macros | Typedefs | Enumerations | Functions | Variables
InlineModelFeatureMaps.h File Reference
#include <array>
#include <string>
#include <vector>
Include dependency graph for InlineModelFeatureMaps.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 llvm
 This is an optimization pass for GlobalISel generic memory operations.
 

Macros

#define INLINE_COST_FEATURE_ITERATOR(M)
 
#define POPULATE_INDICES(INDEX_NAME, NAME)   INDEX_NAME,
 
#define INLINE_FEATURE_ITERATOR(M)
 
#define POPULATE_INDICES(INDEX_NAME, NAME)   INDEX_NAME,
 
#define POPULATE_INDICES(INDEX_NAME, NAME, COMMENT)   INDEX_NAME,
 

Typedefs

using llvm::InlineCostFeatures = std::array< int, static_cast< size_t >(InlineCostFeatureIndex::NumberOfFeatures)>
 
using llvm::InlineFeatures = std::vector< int64_t >
 

Enumerations

enum  llvm::InlineCostFeatureIndex : size_t { llvm::InlineCostFeatureIndex::POPULATE_INDICES, llvm::InlineCostFeatureIndex::NumberOfFeatures }
 
enum  llvm::FeatureIndex : size_t { llvm::FeatureIndex::POPULATE_INDICES, llvm::FeatureIndex::POPULATE_INDICES, llvm::FeatureIndex::NumberOfFeatures }
 

Functions

constexpr bool llvm::isHeuristicInlineCostFeature (InlineCostFeatureIndex Feature)
 
constexpr FeatureIndex llvm::inlineCostFeatureToMlFeature (InlineCostFeatureIndex Feature)
 

Variables

constexpr size_t llvm::NumberOfFeatures
 
const std::array< std::string, NumberOfFeatures > llvm::FeatureNameMap
 
const char *const llvm::DecisionName
 
const char *const llvm::DefaultDecisionName
 
const char *const llvm::RewardName
 

Macro Definition Documentation

◆ INLINE_COST_FEATURE_ITERATOR

#define INLINE_COST_FEATURE_ITERATOR (   M)
Value:
M(SROASavings, "sroa_savings") \
M(SROALosses, "sroa_losses") \
M(LoadElimination, "load_elimination") \
M(CallPenalty, "call_penalty") \
M(CallArgumentSetup, "call_argument_setup") \
M(LoadRelativeIntrinsic, "load_relative_intrinsic") \
M(LoweredCallArgSetup, "lowered_call_arg_setup") \
M(IndirectCallPenalty, "indirect_call_penalty") \
M(JumpTablePenalty, "jump_table_penalty") \
M(CaseClusterPenalty, "case_cluster_penalty") \
M(SwitchPenalty, "switch_penalty") \
M(UnsimplifiedCommonInstructions, "unsimplified_common_instructions") \
M(NumLoops, "num_loops") \
M(DeadBlocks, "dead_blocks") \
M(SimplifiedInstructions, "simplified_instructions") \
M(ConstantArgs, "constant_args") \
M(ConstantOffsetPtrArgs, "constant_offset_ptr_args") \
M(CallSiteCost, "callsite_cost") \
M(ColdCcPenalty, "cold_cc_penalty") \
M(LastCallToStaticBonus, "last_call_to_static_bonus") \
M(IsMultipleBlocks, "is_multiple_blocks") \
M(NestedInlines, "nested_inlines") \
M(NestedInlineCostEstimate, "nested_inline_cost_estimate") \
M(Threshold, "threshold")

Definition at line 22 of file InlineModelFeatureMaps.h.

◆ INLINE_FEATURE_ITERATOR

#define INLINE_FEATURE_ITERATOR (   M)
Value:
M(CalleeBasicBlockCount, "callee_basic_block_count", \
"number of basic blocks of the callee") \
M(CallSiteHeight, "callsite_height", \
"position of the call site in the original call graph - measured from " \
"the farthest SCC") \
M(NodeCount, "node_count", \
"total current number of defined functions in the module") \
M(NrCtantParams, "nr_ctant_params", \
"number of parameters in the call site that are constants") \
M(CostEstimate, "cost_estimate", "total cost estimate (threshold - free)") \
M(EdgeCount, "edge_count", "total number of calls in the module") \
M(CallerUsers, "caller_users", \
"number of module-internal users of the caller, +1 if the caller is " \
"exposed externally") \
M(CallerConditionallyExecutedBlocks, "caller_conditionally_executed_blocks", \
"number of blocks reached from a conditional instruction, in the caller") \
M(CallerBasicBlockCount, "caller_basic_block_count", \
"number of basic blocks in the caller") \
M(CalleeConditionallyExecutedBlocks, "callee_conditionally_executed_blocks", \
"number of blocks reached from a conditional instruction, in the callee") \
M(CalleeUsers, "callee_users", \
"number of module-internal users of the callee, +1 if the callee is " \
"exposed externally")

Definition at line 81 of file InlineModelFeatureMaps.h.

◆ POPULATE_INDICES [1/3]

#define POPULATE_INDICES (   INDEX_NAME,
  NAME 
)    INDEX_NAME,

Definition at line 114 of file InlineModelFeatureMaps.h.

◆ POPULATE_INDICES [2/3]

#define POPULATE_INDICES (   INDEX_NAME,
  NAME 
)    INDEX_NAME,

Definition at line 114 of file InlineModelFeatureMaps.h.

◆ POPULATE_INDICES [3/3]

#define POPULATE_INDICES (   INDEX_NAME,
  NAME,
  COMMENT 
)    INDEX_NAME,

Definition at line 114 of file InlineModelFeatureMaps.h.

M
We currently emits eax Perhaps this is what we really should generate is Is imull three or four cycles eax eax The current instruction priority is based on pattern complexity The former is more complex because it folds a load so the latter will not be emitted Perhaps we should use AddedComplexity to give LEA32r a higher priority We should always try to match LEA first since the LEA matching code does some estimate to determine whether the match is profitable if we care more about code then imull is better It s two bytes shorter than movl leal On a Pentium M
Definition: README.txt:252
llvm::InlineConstants::LastCallToStaticBonus
const int LastCallToStaticBonus
Definition: InlineCost.h:48
Threshold
static cl::opt< unsigned > Threshold("loop-unswitch-threshold", cl::desc("Max loop size to unswitch"), cl::init(100), cl::Hidden)
CallPenalty
static cl::opt< int > CallPenalty("inline-call-penalty", cl::Hidden, cl::init(25), cl::desc("Call penalty that is applied per callsite when inlining"))