Index: include/llvm/ProfileData/ProfileCommon.h =================================================================== --- include/llvm/ProfileData/ProfileCommon.h +++ include/llvm/ProfileData/ProfileCommon.h @@ -150,17 +150,16 @@ public: uint32_t getNumLinesWithSamples() { return NumCounts; } uint64_t getTotalSamples() { return TotalCount; } - uint64_t getMaxHeadSamples() { return MaxFunctionCount; } uint64_t getMaxSamplesPerLine() { return MaxCount; } void addRecord(const sampleprof::FunctionSamples &FS); SampleProfileSummary(std::vector Cutoffs) : ProfileSummary(PSK_Sample, Cutoffs) {} SampleProfileSummary(uint64_t TotalSamples, uint64_t MaxSamplesPerLine, - uint64_t MaxHeadSamples, int32_t NumLinesWithSamples, + uint64_t MaxFunctionCount, int32_t NumLinesWithSamples, uint32_t NumFunctions, SummaryEntryVector DetailedSummary) : ProfileSummary(PSK_Sample, DetailedSummary, TotalSamples, - MaxSamplesPerLine, MaxHeadSamples, NumLinesWithSamples, + MaxSamplesPerLine, MaxFunctionCount, NumLinesWithSamples, NumFunctions) {} static bool classof(const ProfileSummary *PS) { return PS->getKind() == PSK_Sample; Index: include/llvm/ProfileData/SampleProfReader.h =================================================================== --- include/llvm/ProfileData/SampleProfReader.h +++ include/llvm/ProfileData/SampleProfReader.h @@ -134,8 +134,8 @@ // Total number of samples in the profile. // MAX_COUNT (uint64_t) // Maximum value of samples on a line. -// MAX_HEAD_SAMPLES (uint64_t) -// Maximum number of head samples. +// MAX_FUNCTION_COUNT (uint64_t) +// Maximum number of samples at function entry (head samples). // NUM_COUNTS (uint64_t) // Number of lines with samples. // NUM_FUNCTIONS (uint64_t) Index: lib/ProfileData/ProfileSummary.cpp =================================================================== --- lib/ProfileData/ProfileSummary.cpp +++ lib/ProfileData/ProfileSummary.cpp @@ -214,7 +214,7 @@ Components.push_back( getKeyValMD(Context, "MaxSamplesPerLine", getMaxSamplesPerLine())); Components.push_back( - getKeyValMD(Context, "MaxHeadSamples", getMaxHeadSamples())); + getKeyValMD(Context, "MaxFunctionCount", getMaxFunctionCount())); Components.push_back( getKeyValMD(Context, "NumLinesWithSamples", getNumLinesWithSamples())); Components.push_back(getKeyValMD(Context, "NumFunctions", NumFunctions)); @@ -318,8 +318,8 @@ // Parse an MDTuple representing a SampleProfileSummary object. static ProfileSummary *getSampleProfileSummaryFromMD(MDTuple *Tuple) { - uint64_t TotalSamples, MaxSamplesPerLine, MaxHeadSamples, NumLinesWithSamples, - NumFunctions; + uint64_t TotalSamples, MaxSamplesPerLine, MaxFunctionCount, + NumLinesWithSamples, NumFunctions; SummaryEntryVector Summary; if (Tuple->getNumOperands() != 7) @@ -332,8 +332,8 @@ if (!getVal(dyn_cast(Tuple->getOperand(2)), "MaxSamplesPerLine", MaxSamplesPerLine)) return nullptr; - if (!getVal(dyn_cast(Tuple->getOperand(3)), "MaxHeadSamples", - MaxHeadSamples)) + if (!getVal(dyn_cast(Tuple->getOperand(3)), "MaxFunctionCount", + MaxFunctionCount)) return nullptr; if (!getVal(dyn_cast(Tuple->getOperand(4)), "NumLinesWithSamples", NumLinesWithSamples)) @@ -344,7 +344,7 @@ if (!getSummaryFromMD(dyn_cast(Tuple->getOperand(6)), Summary)) return nullptr; return new SampleProfileSummary(TotalSamples, MaxSamplesPerLine, - MaxHeadSamples, NumLinesWithSamples, + MaxFunctionCount, NumLinesWithSamples, NumFunctions, Summary); } Index: lib/ProfileData/SampleProfWriter.cpp =================================================================== --- lib/ProfileData/SampleProfWriter.cpp +++ lib/ProfileData/SampleProfWriter.cpp @@ -140,7 +140,7 @@ auto &OS = *OutputStream; encodeULEB128(Summary->getTotalSamples(), OS); encodeULEB128(Summary->getMaxSamplesPerLine(), OS); - encodeULEB128(Summary->getMaxHeadSamples(), OS); + encodeULEB128(Summary->getMaxFunctionCount(), OS); encodeULEB128(Summary->getNumLinesWithSamples(), OS); encodeULEB128(Summary->getNumFunctions(), OS); std::vector &Entries = Summary->getDetailedSummary(); Index: unittests/ProfileData/SampleProfTest.cpp =================================================================== --- unittests/ProfileData/SampleProfTest.cpp +++ unittests/ProfileData/SampleProfTest.cpp @@ -100,7 +100,7 @@ ASSERT_EQ(123603u, Summary.getTotalSamples()); ASSERT_EQ(6u, Summary.getNumLinesWithSamples()); ASSERT_EQ(2u, Summary.getNumFunctions()); - ASSERT_EQ(1437u, Summary.getMaxHeadSamples()); + ASSERT_EQ(1437u, Summary.getMaxFunctionCount()); ASSERT_EQ(60351u, Summary.getMaxSamplesPerLine()); uint32_t Cutoff = 800000;