Skip to content

Commit 037efd6

Browse files
author
git apple-llvm automerger
committed
Merge commit '066221f98e26' from llvm.org/main into next
2 parents b7506ee + 066221f commit 037efd6

File tree

4 files changed

+22
-47
lines changed

4 files changed

+22
-47
lines changed

llvm/include/llvm/Analysis/MemoryProfileInfo.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@
1313
#ifndef LLVM_ANALYSIS_MEMORYPROFILEINFO_H
1414
#define LLVM_ANALYSIS_MEMORYPROFILEINFO_H
1515

16-
#include "llvm/IR/InstrTypes.h"
1716
#include "llvm/IR/Metadata.h"
18-
#include "llvm/ProfileData/MemProfCommon.h"
17+
#include "llvm/IR/ModuleSummaryIndex.h"
1918
#include <map>
2019

2120
namespace llvm {

llvm/include/llvm/IR/ModuleSummaryIndex.h

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
#include "llvm/IR/ConstantRange.h"
2828
#include "llvm/IR/GlobalValue.h"
2929
#include "llvm/IR/Module.h"
30-
#include "llvm/ProfileData/MemProfCommon.h"
3130
#include "llvm/Support/Allocator.h"
3231
#include "llvm/Support/Compiler.h"
3332
#include "llvm/Support/InterleavedRange.h"
@@ -307,6 +306,14 @@ template <> struct DenseMapInfo<ValueInfo> {
307306
static unsigned getHashValue(ValueInfo I) { return hash_value(I.getRef()); }
308307
};
309308

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+
310317
/// Summary of memprof callsite metadata.
311318
struct CallsiteInfo {
312319
// Actual callee function.
@@ -343,6 +350,19 @@ inline raw_ostream &operator<<(raw_ostream &OS, const CallsiteInfo &SNI) {
343350
return OS;
344351
}
345352

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+
346366
/// Summary of a single MIB in a memprof metadata on allocations.
347367
struct MIBInfo {
348368
// The allocation type for this profiled context.

llvm/include/llvm/ProfileData/MemProfCommon.h

Lines changed: 0 additions & 43 deletions
This file was deleted.

llvm/lib/Transforms/Instrumentation/MemProfiler.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@
4646
#include "llvm/Transforms/Utils/ModuleUtils.h"
4747
#include <map>
4848
#include <set>
49-
#include <unordered_set>
5049

5150
using namespace llvm;
5251
using namespace llvm::memprof;

0 commit comments

Comments
 (0)