|
27 | 27 | #include "llvm/IR/ConstantRange.h" |
28 | 28 | #include "llvm/IR/GlobalValue.h" |
29 | 29 | #include "llvm/IR/Module.h" |
30 | | -#include "llvm/ProfileData/MemProfCommon.h" |
31 | 30 | #include "llvm/Support/Allocator.h" |
32 | 31 | #include "llvm/Support/Compiler.h" |
33 | 32 | #include "llvm/Support/InterleavedRange.h" |
@@ -307,6 +306,14 @@ template <> struct DenseMapInfo<ValueInfo> { |
307 | 306 | static unsigned getHashValue(ValueInfo I) { return hash_value(I.getRef()); } |
308 | 307 | }; |
309 | 308 |
|
| 309 | +// For optional hinted size reporting, holds a pair of the full stack id |
| 310 | +// (pre-trimming, from the full context in the profile), and the associated |
| 311 | +// total profiled size. |
| 312 | +struct ContextTotalSize { |
| 313 | + uint64_t FullStackId; |
| 314 | + uint64_t TotalSize; |
| 315 | +}; |
| 316 | + |
310 | 317 | /// Summary of memprof callsite metadata. |
311 | 318 | struct CallsiteInfo { |
312 | 319 | // Actual callee function. |
@@ -343,6 +350,19 @@ inline raw_ostream &operator<<(raw_ostream &OS, const CallsiteInfo &SNI) { |
343 | 350 | return OS; |
344 | 351 | } |
345 | 352 |
|
| 353 | +// Allocation type assigned to an allocation reached by a given context. |
| 354 | +// More can be added, now this is cold, notcold and hot. |
| 355 | +// Values should be powers of two so that they can be ORed, in particular to |
| 356 | +// track allocations that have different behavior with different calling |
| 357 | +// contexts. |
| 358 | +enum class AllocationType : uint8_t { |
| 359 | + None = 0, |
| 360 | + NotCold = 1, |
| 361 | + Cold = 2, |
| 362 | + Hot = 4, |
| 363 | + All = 7 // This should always be set to the OR of all values. |
| 364 | +}; |
| 365 | + |
346 | 366 | /// Summary of a single MIB in a memprof metadata on allocations. |
347 | 367 | struct MIBInfo { |
348 | 368 | // The allocation type for this profiled context. |
|
0 commit comments