@@ -61,30 +61,29 @@ void StaticDataProfileInfo::addConstantProfileCount(
6161}
6262
6363StaticDataProfileInfo::StaticDataHotness
64- StaticDataProfileInfo::getSectionHotnessUsingProfileCount (
64+ StaticDataProfileInfo::getConstantHotnessUsingProfileCount (
6565 const Constant *C, const ProfileSummaryInfo *PSI, uint64_t Count) const {
66- // The accummulated counter shows the constant is hot. Return 'hot' whether
67- // this variable is seen by unprofiled functions or not.
66+ // The accummulated counter shows the constant is hot. Return enum 'hot'
67+ // whether this variable is seen by unprofiled functions or not.
6868 if (PSI->isHotCount (Count))
6969 return StaticDataHotness::Hot;
7070 // The constant is not hot, and seen by unprofiled functions. We don't want to
7171 // assign it to unlikely sections, even if the counter says 'cold'. So return
72- // an empty prefix before checking whether the counter is cold .
72+ // enum 'LukewarmOrUnknown' .
7373 if (ConstantWithoutCounts.count (C))
7474 return StaticDataHotness::LukewarmOrUnknown;
75- // The accummulated counter shows the constant is cold. Return 'unlikely '.
75+ // The accummulated counter shows the constant is cold so return enum 'cold '.
7676 if (PSI->isColdCount (Count))
7777 return StaticDataHotness::Cold;
7878
7979 return StaticDataHotness::LukewarmOrUnknown;
8080}
8181
82- StringRef StaticDataProfileInfo::hotnessToStr (
83- StaticDataProfileInfo::StaticDataHotness Hotness) const {
82+ StringRef StaticDataProfileInfo::hotnessToStr (StaticDataHotness Hotness) const {
8483 switch (Hotness) {
85- case StaticDataProfileInfo:: StaticDataHotness::Cold:
84+ case StaticDataHotness::Cold:
8685 return " unlikely" ;
87- case StaticDataProfileInfo:: StaticDataHotness::Hot:
86+ case StaticDataHotness::Hot:
8887 return " hot" ;
8988 default :
9089 return " " ;
@@ -104,7 +103,7 @@ StringRef StaticDataProfileInfo::getConstantSectionPrefix(
104103 std::optional<uint64_t > Count = getConstantProfileCount (C);
105104 if (!Count)
106105 return " " ;
107- return hotnessToStr (getSectionHotnessUsingProfileCount (C, PSI, *Count));
106+ return hotnessToStr (getConstantHotnessUsingProfileCount (C, PSI, *Count));
108107}
109108
110109bool StaticDataProfileInfoWrapperPass::doInitialization (Module &M) {
0 commit comments