[llvm] [lld] [clang] [SHT_LLVM_BB_ADDR_MAP] Allow basic-block-sections and labels be used together by decoupling the handling of the two features. (PR #74128)

2024-02-01 Thread Aiden Grossman via cfe-commits
@@ -73,68 +83,89 @@ FileHeader: Sections: - Name:.text.foo Type:SHT_PROGBITS -Address: [[FOO_ADDR]] +Address: 0x4000 Flags: [SHF_ALLOC, SHF_EXECINSTR] -Content: '503b050520907d02ebf5c3' +Content: '503b050530907d08ebf50f8dee1fc3'

[llvm] [lld] [clang] [SHT_LLVM_BB_ADDR_MAP] Allow basic-block-sections and labels be used together by decoupling the handling of the two features. (PR #74128)

2024-02-01 Thread Rahman Lavaee via cfe-commits
@@ -858,62 +899,64 @@ struct BBAddrMap { bool hasIndirectBranch() const { return MD.HasIndirectBranch; } }; - BBAddrMap(uint64_t Addr, std::vector BBEntries) - : Addr(Addr), BBEntries(std::move(BBEntries)) {} + // Struct representing the BBAddrMap information for

[llvm] [lld] [clang] [SHT_LLVM_BB_ADDR_MAP] Allow basic-block-sections and labels be used together by decoupling the handling of the two features. (PR #74128)

2024-02-01 Thread Rahman Lavaee via cfe-commits
@@ -858,62 +899,64 @@ struct BBAddrMap { bool hasIndirectBranch() const { return MD.HasIndirectBranch; } }; - BBAddrMap(uint64_t Addr, std::vector BBEntries) - : Addr(Addr), BBEntries(std::move(BBEntries)) {} + // Struct representing the BBAddrMap information for

[llvm] [lld] [clang] [SHT_LLVM_BB_ADDR_MAP] Allow basic-block-sections and labels be used together by decoupling the handling of the two features. (PR #74128)

2024-01-26 Thread Aiden Grossman via cfe-commits
@@ -172,6 +172,105 @@ class OtoolOptTable : public CommonOptTable { "Mach-O object file displaying tool") {} }; +struct BBAddrMapLabel { + std::string BlockLabel; + std::string PGOAnalysis; +}; + +// This class represents the BBAddrMap and PGOMap

[llvm] [lld] [clang] [SHT_LLVM_BB_ADDR_MAP] Allow basic-block-sections and labels be used together by decoupling the handling of the two features. (PR #74128)

2024-01-26 Thread Aiden Grossman via cfe-commits
@@ -1693,24 +1750,21 @@ disassembleObject(ObjectFile , const ObjectFile , LLVM_DEBUG(LVP.dump()); - std::unordered_map AddrToBBAddrMap; - std::unordered_map AddrToPGOAnalysisMap; + BBAddrMapInfo FullAddrMap; auto ReadBBAddrMap = [&](std::optional SectionIndex =

[llvm] [lld] [clang] [SHT_LLVM_BB_ADDR_MAP] Allow basic-block-sections and labels be used together by decoupling the handling of the two features. (PR #74128)

2024-01-25 Thread Mircea Trofin via cfe-commits
@@ -858,62 +899,64 @@ struct BBAddrMap { bool hasIndirectBranch() const { return MD.HasIndirectBranch; } }; - BBAddrMap(uint64_t Addr, std::vector BBEntries) - : Addr(Addr), BBEntries(std::move(BBEntries)) {} + // Struct representing the BBAddrMap information for

[llvm] [lld] [clang] [SHT_LLVM_BB_ADDR_MAP] Allow basic-block-sections and labels be used together by decoupling the handling of the two features. (PR #74128)

2024-01-19 Thread via cfe-commits
@@ -1401,17 +1406,48 @@ void AsmPrinter::emitBBAddrMapSection(const MachineFunction ) { uint8_t BBAddrMapVersion = OutStreamer->getContext().getBBAddrMapVersion(); OutStreamer->emitInt8(BBAddrMapVersion); OutStreamer->AddComment("feature"); - auto FeaturesBits =

[llvm] [lld] [clang] [SHT_LLVM_BB_ADDR_MAP] Allow basic-block-sections and labels be used together by decoupling the handling of the two features. (PR #74128)

2024-01-11 Thread James Henderson via cfe-commits
@@ -1419,32 +1419,50 @@ void ELFState::writeSectionContent( CBA.write(E.Feature); SHeader.sh_size += 2; } - -if (Section.PGOAnalyses) { - if (E.Version < 2) -WithColor::warning() -<< "unsupported SHT_LLVM_BB_ADDR_MAP version when

[llvm] [lld] [clang] [SHT_LLVM_BB_ADDR_MAP] Allow basic-block-sections and labels be used together by decoupling the handling of the two features. (PR #74128)

2024-01-08 Thread Micah Weston via cfe-commits
@@ -7574,30 +7573,38 @@ template void LLVMELFDumper::printBBAddrMaps() { continue; } for (const BBAddrMap : *BBAddrMapOrErr) { - DictScope D(W, "Function"); - W.printHex("At", AM.Addr); + DictScope FD(W, "Function"); + if

[llvm] [lld] [clang] [SHT_LLVM_BB_ADDR_MAP] Allow basic-block-sections and labels be used together by decoupling the handling of the two features. (PR #74128)

2024-01-07 Thread Micah Weston via cfe-commits
@@ -719,60 +730,83 @@ decodeBBAddrMapImpl(const ELFFile , Feature = Data.getU8(Cur); // Feature byte if (!Cur) break; - auto FeatEnableOrErr = PGOAnalysisMap::Features::decode(Feature); + auto FeatEnableOrErr =

[llvm] [lld] [clang] [SHT_LLVM_BB_ADDR_MAP] Allow basic-block-sections and labels be used together by decoupling the handling of the two features. (PR #74128)

2024-01-04 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-lld-elf @llvm/pr-subscribers-backend-x86 @llvm/pr-subscribers-clang Author: Rahman Lavaee (rlavaee) Changes Today `-split-machine-functions` and `-fbasic-block-sections={all,list}` cannot be combined with `-basic-block-sections=labels` (the labels

[llvm] [lld] [clang] [SHT_LLVM_BB_ADDR_MAP] Allow basic-block-sections and labels be used together by decoupling the handling of the two features. (PR #74128)

2024-01-04 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-llvm-binary-utilities Author: Rahman Lavaee (rlavaee) Changes Today `-split-machine-functions` and `-fbasic-block-sections={all,list}` cannot be combined with `-basic-block-sections=labels` (the labels option will be ignored). The inconsistency