diff options
author | Rahman Lavaee <rahmanl@google.com> | 2023-08-18 18:16:30 +0000 |
---|---|---|
committer | Rahman Lavaee <rahmanl@google.com> | 2023-08-20 18:29:47 +0000 |
commit | 69e47deca97b9a7f7394e5472095ee32e46f1831 (patch) | |
tree | 68e5163321b63dcac72fdc0a89990dae19545250 /llvm/lib/CodeGen/BasicBlockSections.cpp | |
parent | 0db1ae3ed111a213e95e2317c3b4457c0f8826c1 (diff) | |
download | llvm-69e47deca97b9a7f7394e5472095ee32e46f1831.zip llvm-69e47deca97b9a7f7394e5472095ee32e46f1831.tar.gz llvm-69e47deca97b9a7f7394e5472095ee32e46f1831.tar.bz2 |
[Propeller] Deprecate Codegen paths for SHT_LLVM_BB_ADDR_MAP version 1.
This patch removes the `getBBIDOrNumber` which was introduced to allow emitting version 1.
Reviewed By: shenhan
Differential Revision: https://reviews.llvm.org/D158299
Diffstat (limited to 'llvm/lib/CodeGen/BasicBlockSections.cpp')
-rw-r--r-- | llvm/lib/CodeGen/BasicBlockSections.cpp | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/llvm/lib/CodeGen/BasicBlockSections.cpp b/llvm/lib/CodeGen/BasicBlockSections.cpp index 76fe1d9..33e70b1 100644 --- a/llvm/lib/CodeGen/BasicBlockSections.cpp +++ b/llvm/lib/CodeGen/BasicBlockSections.cpp @@ -225,9 +225,7 @@ assignSections(MachineFunction &MF, // blocks are ordered canonically. MBB.setSectionID(MBB.getNumber()); } else { - // TODO: Replace `getBBIDOrNumber` with `getBBID` once version 1 is - // deprecated. - auto I = FuncBBClusterInfo.find(MBB.getBBIDOrNumber()); + auto I = FuncBBClusterInfo.find(*MBB.getBBID()); if (I != FuncBBClusterInfo.end()) { MBB.setSectionID(I->second.ClusterID); } else { @@ -325,14 +323,8 @@ bool BasicBlockSections::runOnMachineFunction(MachineFunction &MF) { if (BBSectionsType == BasicBlockSection::List && hasInstrProfHashMismatch(MF)) return true; - // Renumber blocks before sorting them. This is useful during sorting, - // basic blocks in the same section will retain the default order. - // This renumbering should also be done for basic block labels to match the - // profiles with the correct blocks. - // For LLVM_BB_ADDR_MAP versions 2 and higher, this renumbering serves - // the different purpose of accessing the original layout positions and - // finding the original fallthroughs. - // TODO: Change the above comment accordingly when version 1 is deprecated. + // Renumber blocks before sorting them. This is useful for accessing the + // original layout positions and finding the original fallthroughs. MF.RenumberBlocks(); if (BBSectionsType == BasicBlockSection::Labels) { @@ -383,8 +375,8 @@ bool BasicBlockSections::runOnMachineFunction(MachineFunction &MF) { // If the two basic block are in the same section, the order is decided by // their position within the section. if (XSectionID.Type == MBBSectionID::SectionType::Default) - return FuncBBClusterInfo.lookup(X.getBBIDOrNumber()).PositionInCluster < - FuncBBClusterInfo.lookup(Y.getBBIDOrNumber()).PositionInCluster; + return FuncBBClusterInfo.lookup(*X.getBBID()).PositionInCluster < + FuncBBClusterInfo.lookup(*Y.getBBID()).PositionInCluster; return X.getNumber() < Y.getNumber(); }; |