Skip to content

Commit 3ed2118

Browse files
committed
Change CFG to lower-case Cfg.
1 parent ceb1ad5 commit 3ed2118

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

llvm/include/llvm/CodeGen/BasicBlockSectionsProfileReader.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ struct BBClusterInfo {
4242
unsigned PositionInCluster;
4343
};
4444

45-
// This represents the CFG profile data for a function.
45+
// This represents the cfg profile data for a function.
4646
struct CfgProfile {
4747
// Node counts for each basic block.
4848
DenseMap<UniqueBBID, uint64_t> NodeCounts;
@@ -75,7 +75,7 @@ struct FunctionProfile {
7575
// determines the `UniqueBBID::CloneID` of the cloned blocks in that path.
7676
SmallVector<SmallVector<unsigned>> ClonePaths;
7777
// Cfg profile data (block and edge frequencies).
78-
CfgProfile CFG;
78+
CfgProfile Cfg;
7979
};
8080

8181
class BasicBlockSectionsProfileReader {
@@ -109,7 +109,7 @@ class BasicBlockSectionsProfileReader {
109109
auto It = ProgramPathAndClusterInfo.find(getAliasName(FuncName));
110110
if (It == ProgramPathAndClusterInfo.end())
111111
return nullptr;
112-
return &It->second.CFG;
112+
return &It->second.Cfg;
113113
}
114114

115115
private:

llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1542,11 +1542,11 @@ void AsmPrinter::emitBBAddrMapSection(const MachineFunction &MF) {
15421542

15431543
// We will emit the BBSPR profile data if requested and availale. Otherwise,
15441544
// we fall back to MBFI and MBPI.
1545-
const CfgProfile *FuncCFGProfile = nullptr;
1545+
const CfgProfile *FuncCfgProfile = nullptr;
15461546
if (PgoAnalysisMapUsePropellerCfg) {
15471547
if (auto *BBSPR = getAnalysisIfAvailable<
15481548
BasicBlockSectionsProfileReaderWrapperPass>())
1549-
FuncCFGProfile =
1549+
FuncCfgProfile =
15501550
BBSPR->getFunctionCfgProfile(MF.getFunction().getName());
15511551
}
15521552

@@ -1562,8 +1562,8 @@ void AsmPrinter::emitBBAddrMapSection(const MachineFunction &MF) {
15621562
if (Features.FuncEntryCount) {
15631563
OutStreamer->AddComment("function entry count");
15641564
uint64_t EntryCount = 0;
1565-
if (FuncCFGProfile) {
1566-
EntryCount = FuncCFGProfile->getNodeCount(*MF.front().getBBID());
1565+
if (FuncCfgProfile) {
1566+
EntryCount = FuncCfgProfile->getNodeCount(*MF.front().getBBID());
15671567
} else {
15681568
auto MaybeEntryCount = MF.getFunction().getEntryCount();
15691569
EntryCount = MaybeEntryCount ? MaybeEntryCount->getCount() : 0;
@@ -1577,7 +1577,7 @@ void AsmPrinter::emitBBAddrMapSection(const MachineFunction &MF) {
15771577
if (Features.BBFreq) {
15781578
OutStreamer->AddComment("basic block frequency");
15791579
uint64_t BlockFrequency =
1580-
FuncCFGProfile ? FuncCFGProfile->getNodeCount(*MBB.getBBID())
1580+
FuncCfgProfile ? FuncCfgProfile->getNodeCount(*MBB.getBBID())
15811581
: MBFI->getBlockFreq(&MBB).getFrequency();
15821582
OutStreamer->emitULEB128IntValue(BlockFrequency);
15831583
}
@@ -1591,8 +1591,8 @@ void AsmPrinter::emitBBAddrMapSection(const MachineFunction &MF) {
15911591
// For MPBI, we emit the numerator of the probability. For BBSPR, we
15921592
// emit the raw edge count.
15931593
uint64_t EdgeFrequency =
1594-
FuncCFGProfile
1595-
? FuncCFGProfile->getEdgeCount(*MBB.getBBID(),
1594+
FuncCfgProfile
1595+
? FuncCfgProfile->getEdgeCount(*MBB.getBBID(),
15961596
*SuccMBB->getBBID())
15971597
: MBPI->getEdgeProbability(&MBB, SuccMBB).getNumerator();
15981598
OutStreamer->emitULEB128IntValue(EdgeFrequency);

llvm/lib/CodeGen/BasicBlockSectionsProfileReader.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ BasicBlockSectionsProfileReader::getClonePathsForFunction(
100100
// the edge 1->3. Within the given clusters, each cloned block is identified by
101101
// "<original block id>.<clone id>". For instance, 3.1 represents the first
102102
// clone of block 3. Original blocks are specified just with their block ids. A
103-
// block cloned multiple times appears with distinct clone ids. The CFG for bar
103+
// block cloned multiple times appears with distinct clone ids. The Cfg for bar
104104
// is shown below before and after cloning with its final clusters labeled.
105105
//
106106
// f main
@@ -240,12 +240,12 @@ Error BasicBlockSectionsProfileReader::ReadV1Profile() {
240240
}
241241
continue;
242242
}
243-
case 'g': { // CFG profile specifier.
243+
case 'g': { // Cfg profile specifier.
244244
// Skip the profile when we the profile iterator (FI) refers to the
245245
// past-the-end element.
246246
if (FI == ProgramPathAndClusterInfo.end())
247247
continue;
248-
// For each node, its CFG profile is encoded as
248+
// For each node, its Cfg profile is encoded as
249249
// <src>:<count>,<sink_1>:<count_1>,<sink_2>:<count_2>,...
250250
for (auto BasicBlockEdgeProfile : Values) {
251251
if (BasicBlockEdgeProfile.empty())
@@ -264,10 +264,10 @@ Error BasicBlockSectionsProfileReader::ReadV1Profile() {
264264
Twine("unsigned integer expected: '") + CountStr + "'");
265265
if (i == 0) {
266266
// The first element represents the source and its total count.
267-
FI->second.CFG.NodeCounts[SrcBBID = *BBID] = Count;
267+
FI->second.Cfg.NodeCounts[SrcBBID = *BBID] = Count;
268268
continue;
269269
}
270-
FI->second.CFG.EdgeCounts[SrcBBID][*BBID] = Count;
270+
FI->second.Cfg.EdgeCounts[SrcBBID][*BBID] = Count;
271271
}
272272
}
273273
continue;

0 commit comments

Comments
 (0)