@@ -225,9 +225,7 @@ assignSections(MachineFunction &MF,
225
225
// blocks are ordered canonically.
226
226
MBB.setSectionID (MBB.getNumber ());
227
227
} else {
228
- // TODO: Replace `getBBIDOrNumber` with `getBBID` once version 1 is
229
- // deprecated.
230
- auto I = FuncBBClusterInfo.find (MBB.getBBIDOrNumber ());
228
+ auto I = FuncBBClusterInfo.find (*MBB.getBBID ());
231
229
if (I != FuncBBClusterInfo.end ()) {
232
230
MBB.setSectionID (I->second .ClusterID );
233
231
} else {
@@ -325,14 +323,8 @@ bool BasicBlockSections::runOnMachineFunction(MachineFunction &MF) {
325
323
if (BBSectionsType == BasicBlockSection::List &&
326
324
hasInstrProfHashMismatch (MF))
327
325
return true ;
328
- // Renumber blocks before sorting them. This is useful during sorting,
329
- // basic blocks in the same section will retain the default order.
330
- // This renumbering should also be done for basic block labels to match the
331
- // profiles with the correct blocks.
332
- // For LLVM_BB_ADDR_MAP versions 2 and higher, this renumbering serves
333
- // the different purpose of accessing the original layout positions and
334
- // finding the original fallthroughs.
335
- // TODO: Change the above comment accordingly when version 1 is deprecated.
326
+ // Renumber blocks before sorting them. This is useful for accessing the
327
+ // original layout positions and finding the original fallthroughs.
336
328
MF.RenumberBlocks ();
337
329
338
330
if (BBSectionsType == BasicBlockSection::Labels) {
@@ -383,8 +375,8 @@ bool BasicBlockSections::runOnMachineFunction(MachineFunction &MF) {
383
375
// If the two basic block are in the same section, the order is decided by
384
376
// their position within the section.
385
377
if (XSectionID.Type == MBBSectionID::SectionType::Default)
386
- return FuncBBClusterInfo.lookup (X. getBBIDOrNumber ()).PositionInCluster <
387
- FuncBBClusterInfo.lookup (Y. getBBIDOrNumber ()).PositionInCluster ;
378
+ return FuncBBClusterInfo.lookup (*X. getBBID ()).PositionInCluster <
379
+ FuncBBClusterInfo.lookup (*Y. getBBID ()).PositionInCluster ;
388
380
return X.getNumber () < Y.getNumber ();
389
381
};
390
382
0 commit comments