aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/MemoryProfileInfo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Analysis/MemoryProfileInfo.cpp')
-rw-r--r--llvm/lib/Analysis/MemoryProfileInfo.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/llvm/lib/Analysis/MemoryProfileInfo.cpp b/llvm/lib/Analysis/MemoryProfileInfo.cpp
index 92a5b6f..b09f4ed 100644
--- a/llvm/lib/Analysis/MemoryProfileInfo.cpp
+++ b/llvm/lib/Analysis/MemoryProfileInfo.cpp
@@ -241,9 +241,13 @@ static MDNode *createMIBNode(LLVMContext &Ctx, ArrayRef<uint64_t> MIBCallStack,
ColdBytes += TotalSize;
// If we have the max cold context size from summary information and have
// requested identification of contexts above a percentage of the max, see
- // if this context qualifies.
- if (MaxColdSize > 0 && MinPercentMaxColdSize < 100 &&
- TotalSize * 100 >= MaxColdSize * MinPercentMaxColdSize)
+ // if this context qualifies. We should assume this is large if we rebuilt
+ // the trie from existing metadata (i.e. to update after inlining), in
+ // which case we don't have a MaxSize from the profile - we assume any
+ // context size info in existence on the metadata should be propagated.
+ if (BuiltFromExistingMetadata ||
+ (MaxColdSize > 0 && MinPercentMaxColdSize < 100 &&
+ TotalSize * 100 >= MaxColdSize * MinPercentMaxColdSize))
LargeColdContext = true;
}
// Only add the context size info as metadata if we need it in the thin