14#ifndef LLVM_TRANSFORMS_UTILS_CODELAYOUT_H
15#define LLVM_TRANSFORMS_UTILS_CODELAYOUT_H
24using EdgeT = std::pair<uint64_t, uint64_t>;
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
std::vector< uint64_t > computeCacheDirectedLayout(ArrayRef< uint64_t > FuncSizes, ArrayRef< uint64_t > FuncCounts, ArrayRef< EdgeCount > CallCounts, ArrayRef< uint64_t > CallOffsets)
Apply a Cache-Directed Sort for functions represented by a call graph.
double calcExtTspScore(ArrayRef< uint64_t > Order, ArrayRef< uint64_t > NodeSizes, ArrayRef< EdgeCount > EdgeCounts)
Estimate the "quality" of a given node order in CFG.
std::pair< uint64_t, uint64_t > EdgeT
std::vector< uint64_t > computeExtTspLayout(ArrayRef< uint64_t > NodeSizes, ArrayRef< uint64_t > NodeCounts, ArrayRef< EdgeCount > EdgeCounts)
Find a layout of nodes (basic blocks) of a given CFG optimizing jump locality and thus processor I-ca...
Algorithm-specific params for Cache-Directed Sort.
unsigned MaxChainSize
The maximum size of a chain to create.
unsigned CacheSize
The size of a line in the cache.
double DistancePower
The power exponent for the distance-based locality.
double FrequencyScale
The scale factor for the frequency-based locality.
unsigned CacheEntries
The size of the cache.