LLVM: lib/ProfileData/MemProfCommon.cpp Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
19
20using namespace llvm;
22
23namespace llvm {
24
25
26
28 "memprof-lifetime-access-density-cold-threshold", cl::init(0.05),
30 cl::desc("The threshold the lifetime access density (accesses per byte per "
31 "lifetime sec) must be under to consider an allocation cold"));
32
33
34
37 cl::desc("The average lifetime (s) for an allocation to be considered "
38 "cold"));
39
40
41
43 "memprof-min-ave-lifetime-access-density-hot-threshold", cl::init(1000),
45 cl::desc("The minimum TotalLifetimeAccessDensity / AllocCount for an "
46 "allocation to be considered hot"));
47
50 cl::desc("Enable use of hot hints (only supported for "
51 "unambigously hot allocations)"));
52
53}
54
58
59
60 if (((float)TotalLifetimeAccessDensity) / AllocCount / 100 <
62
63 && ((float)TotalLifetime) / AllocCount >=
66
67
68
70 ((float)TotalLifetimeAccessDensity) / AllocCount / 100 >
73
75}
76
84 std::memcpy(&Id, Hash.data(), sizeof(Hash));
85 return Id;
86}
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
HashResultTy< HasherT_ > final()
Forward to HasherT::final() if available.
Interface to help hash various types through a hasher type.
std::enable_if_t< hashbuilder_detail::IsHashableData< T >::value, HashBuilder & > add(T Value)
Implement hashing for hashable data types, e.g. integral or enum values.
Helper class to iterate through stack ids in both metadata (memprof MIB and callsite) and the corresp...
initializer< Ty > init(const Ty &Val)
LLVM_ABI AllocationType getAllocType(uint64_t TotalLifetimeAccessDensity, uint64_t AllocCount, uint64_t TotalLifetime)
Return the allocation type for a given set of memory profile values.
Definition MemProfCommon.cpp:55
LLVM_ABI uint64_t computeFullStackId(ArrayRef< Frame > CallStack)
Helper to generate a single hash id for a given callstack, used for emitting matching statistics and ...
Definition MemProfCommon.cpp:77
This is an optimization pass for GlobalISel generic memory operations.
LLVM_ABI cl::opt< float > MemProfLifetimeAccessDensityColdThreshold("memprof-lifetime-access-density-cold-threshold", cl::init(0.05), cl::Hidden, cl::desc("The threshold the lifetime access density (accesses per byte per " "lifetime sec) must be under to consider an allocation cold"))
std::array< uint8_t, NumBytes > BLAKE3Result
The constant LLVM_BLAKE3_OUT_LEN provides the default output length, 32 bytes, which is recommended f...
LLVM_ABI cl::opt< unsigned > MemProfAveLifetimeColdThreshold("memprof-ave-lifetime-cold-threshold", cl::init(200), cl::Hidden, cl::desc("The average lifetime (s) for an allocation to be considered " "cold"))
LLVM_ABI cl::opt< unsigned > MemProfMinAveLifetimeAccessDensityHotThreshold("memprof-min-ave-lifetime-access-density-hot-threshold", cl::init(1000), cl::Hidden, cl::desc("The minimum TotalLifetimeAccessDensity / AllocCount for an " "allocation to be considered hot"))
LLVM_ABI cl::opt< bool > MemProfUseHotHints("memprof-use-hot-hints", cl::init(false), cl::Hidden, cl::desc("Enable use of hot hints (only supported for " "unambigously hot allocations)"))