Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AsmPrinter][ELF] Support profile-guided section prefix for jump tables' (read-only) data sections #122215

Merged
merged 23 commits into from
Jan 29, 2025
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
5d207e9
[SDP]Introduce StaticDataSplitter pass and implemenet jump table spli…
mingmingl-llvm Jan 8, 2025
34b6b9b
Flag-gate the new pass and resolve review feedback
mingmingl-llvm Jan 9, 2025
dd74827
rely to upstream
mingmingl-llvm Jan 10, 2025
8d3a985
Emit jump table with section suffix
mingmingl-llvm Jan 11, 2025
1bacc51
Apply suggestions from code review
mingmingl-llvm Jan 11, 2025
8a85d1a
resolve review feedback
mingmingl-llvm Jan 11, 2025
e54dacb
Discover jump table by calling MachineOperand::isJTI()
mingmingl-llvm Jan 13, 2025
27ef86d
Introduce a TargetMachine option , and the command line flag option t…
mingmingl-llvm Jan 14, 2025
e816def
Emit jump tables into .hot and .unlikely sections respectively
mingmingl-llvm Jan 15, 2025
28defd8
merge base patch
mingmingl-llvm Jan 15, 2025
7f3e473
Add -mtriple=x86_64-unknown-linux-gnu for test
mingmingl-llvm Jan 16, 2025
1bef9b1
run clang format
mingmingl-llvm Jan 16, 2025
59a958a
Apply suggestions from code review
mingmingl-llvm Jan 17, 2025
2d06092
fix windows build bot failure
mingmingl-llvm Jan 17, 2025
9134ffa
resolve comments
mingmingl-llvm Jan 17, 2025
ea2d838
merge with main branch
mingmingl-llvm Jan 24, 2025
027ae56
resolve review feedback
mingmingl-llvm Jan 27, 2025
fd0034a
[NFCI]Refactor AsmPrinter around jump table emission
mingmingl-llvm Jan 27, 2025
a79a789
Merge branch 'main' into users/mingmingl-llvm/spr/nfcprecommit
mingmingl-llvm Jan 27, 2025
d569eff
display diff after refactor
mingmingl-llvm Jan 27, 2025
be96277
git merge main
mingmingl-llvm Jan 27, 2025
b919de9
resolve comments
mingmingl-llvm Jan 28, 2025
6bb4b32
Resolve comments. Also append a dot when -fno-unique-section-names is…
mingmingl-llvm Jan 28, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions llvm/include/llvm/CodeGen/AsmPrinter.h
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,10 @@ class AsmPrinter : public MachineFunctionPass {
/// function to the current output stream.
virtual void emitJumpTableInfo();

virtual void emitJumpTables(ArrayRef<unsigned> JumpTableIndices,
MCSection *JumpTableSection, bool JTInDiffSection,
const MachineJumpTableInfo &MJTI);

/// Emit the specified global variable to the .s file.
virtual void emitGlobalVariable(const GlobalVariable *GV);

Expand Down Expand Up @@ -892,10 +896,10 @@ class AsmPrinter : public MachineFunctionPass {
// Internal Implementation Details
//===------------------------------------------------------------------===//

void emitJumpTableEntry(const MachineJumpTableInfo *MJTI,
void emitJumpTableEntry(const MachineJumpTableInfo &MJTI,
const MachineBasicBlock *MBB, unsigned uid) const;

void emitJumpTableSizesSection(const MachineJumpTableInfo *MJTI,
void emitJumpTableSizesSection(const MachineJumpTableInfo &MJTI,
const Function &F) const;

void emitLLVMUsedList(const ConstantArray *InitList);
Expand Down
2 changes: 2 additions & 0 deletions llvm/include/llvm/CodeGen/CommandFlags.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ bool getEmitCallSiteInfo();

bool getEnableMachineFunctionSplitter();

bool getEnableStaticDataPartitioning();

bool getEnableDebugEntryValues();

bool getValueTrackingVariableLocations();
Expand Down
9 changes: 9 additions & 0 deletions llvm/include/llvm/CodeGen/MachineFunction.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,15 @@ template <> struct ilist_callback_traits<MachineBasicBlock> {
}
};

// The hotness of static data tracked by a MachineFunction and not represented
// as a global object in the module IR / MIR. Typical examples are
// MachineJumpTableInfo and MachineConstantPool.
enum class MachineFunctionDataHotness {
Unknown,
Cold,
Hot,
};

/// MachineFunctionInfo - This class can be derived from and used by targets to
/// hold private target-specific information for each MachineFunction. Objects
/// of type are accessed/created with MF::getInfo and destroyed when the
Expand Down
11 changes: 9 additions & 2 deletions llvm/include/llvm/CodeGen/MachineJumpTableInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,17 @@ namespace llvm {
class MachineBasicBlock;
class DataLayout;
class raw_ostream;
enum class MachineFunctionDataHotness;

/// MachineJumpTableEntry - One jump table in the jump table info.
///
struct MachineJumpTableEntry {
/// MBBs - The vector of basic blocks from which to create the jump table.
std::vector<MachineBasicBlock*> MBBs;

explicit MachineJumpTableEntry(const std::vector<MachineBasicBlock*> &M)
: MBBs(M) {}
MachineFunctionDataHotness Hotness;

explicit MachineJumpTableEntry(const std::vector<MachineBasicBlock *> &M);
};

class MachineJumpTableInfo {
Expand Down Expand Up @@ -107,6 +109,11 @@ class MachineJumpTableInfo {
return JumpTables;
}

// Update machine jump table entry's hotness. Return true if the hotness is
// updated.
bool updateJumpTableEntryHotness(size_t JTI,
MachineFunctionDataHotness Hotness);

/// RemoveJumpTable - Mark the specific index as being dead. This will
/// prevent it from being emitted.
void RemoveJumpTable(unsigned Idx) {
Expand Down
4 changes: 4 additions & 0 deletions llvm/include/llvm/CodeGen/Passes.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ namespace llvm {
/// using profile information.
MachineFunctionPass *createMachineFunctionSplitterPass();

/// createStaticDataSplitterPass - This pass partitions a static data section
/// into a hot and cold section using profile information.
MachineFunctionPass *createStaticDataSplitterPass();

/// MachineFunctionPrinter pass - This pass prints out the machine function to
/// the given stream as a debugging tool.
MachineFunctionPass *
Expand Down
3 changes: 3 additions & 0 deletions llvm/include/llvm/CodeGen/TargetLoweringObjectFileImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ class TargetLoweringObjectFileELF : public TargetLoweringObjectFile {

MCSection *getSectionForJumpTable(const Function &F,
const TargetMachine &TM) const override;
MCSection *
getSectionForJumpTable(const Function &F, const TargetMachine &TM,
const MachineJumpTableEntry *JTE) const override;
MCSection *getSectionForLSDA(const Function &F, const MCSymbol &FnSym,
const TargetMachine &TM) const override;

Expand Down
1 change: 1 addition & 0 deletions llvm/include/llvm/InitializePasses.h
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ void initializeSpeculativeExecutionLegacyPassPass(PassRegistry &);
void initializeSpillPlacementWrapperLegacyPass(PassRegistry &);
void initializeStackColoringLegacyPass(PassRegistry &);
void initializeStackFrameLayoutAnalysisPassPass(PassRegistry &);
void initializeStaticDataSplitterPass(PassRegistry &);
void initializeStackMapLivenessPass(PassRegistry &);
void initializeStackProtectorPass(PassRegistry &);
void initializeStackSafetyGlobalInfoWrapperPassPass(PassRegistry &);
Expand Down
1 change: 1 addition & 0 deletions llvm/include/llvm/Passes/MachinePassRegistry.def
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ DUMMY_MACHINE_FUNCTION_PASS("livedebugvalues", LiveDebugValuesPass)
DUMMY_MACHINE_FUNCTION_PASS("lrshrink", LiveRangeShrinkPass)
DUMMY_MACHINE_FUNCTION_PASS("machine-combiner", MachineCombinerPass)
DUMMY_MACHINE_FUNCTION_PASS("machine-cp", MachineCopyPropagationPass)
DUMMY_MACHINE_FUNCTION_PASS("static-data-splitter", StaticDataSplitter)
DUMMY_MACHINE_FUNCTION_PASS("machine-function-splitter", MachineFunctionSplitterPass)
DUMMY_MACHINE_FUNCTION_PASS("machine-latecleanup", MachineLateInstrsCleanupPass)
DUMMY_MACHINE_FUNCTION_PASS("machine-sanmd", MachineSanitizerBinaryMetadata)
Expand Down
5 changes: 5 additions & 0 deletions llvm/include/llvm/Target/TargetLoweringObjectFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class Function;
class GlobalObject;
class GlobalValue;
class MachineBasicBlock;
class MachineJumpTableEntry;
class MachineModuleInfo;
class Mangler;
class MCContext;
Expand Down Expand Up @@ -132,6 +133,10 @@ class TargetLoweringObjectFile : public MCObjectFileInfo {

virtual MCSection *getSectionForJumpTable(const Function &F,
const TargetMachine &TM) const;
virtual MCSection *
getSectionForJumpTable(const Function &F, const TargetMachine &TM,
const MachineJumpTableEntry *JTE) const;

virtual MCSection *getSectionForLSDA(const Function &, const MCSymbol &,
const TargetMachine &) const {
return LSDASection;
Expand Down
4 changes: 4 additions & 0 deletions llvm/include/llvm/Target/TargetMachine.h
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,10 @@ class TargetMachine {
return Options.FunctionSections;
}

bool getEnableStaticDataPartitioning() const {
return Options.EnableStaticDataPartitioning;
}

/// Return true if visibility attribute should not be emitted in XCOFF,
/// corresponding to -mignore-xcoff-visibility.
bool getIgnoreXCOFFVisibility() const {
Expand Down
3 changes: 3 additions & 0 deletions llvm/include/llvm/Target/TargetOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,9 @@ namespace llvm {
/// Enables the MachineFunctionSplitter pass.
unsigned EnableMachineFunctionSplitter : 1;

/// Enables the StaticDataSplitter pass.
unsigned EnableStaticDataPartitioning : 1;

/// Set if the target supports default outlining behaviour.
unsigned SupportsDefaultOutlining : 1;

Expand Down
110 changes: 84 additions & 26 deletions llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2861,7 +2861,6 @@ void AsmPrinter::emitConstantPool() {
// Print assembly representations of the jump tables used by the current
// function.
void AsmPrinter::emitJumpTableInfo() {
const DataLayout &DL = MF->getDataLayout();
const MachineJumpTableInfo *MJTI = MF->getJumpTableInfo();
if (!MJTI) return;
if (MJTI->getEntryKind() == MachineJumpTableInfo::EK_Inline) return;
Expand All @@ -2876,42 +2875,101 @@ void AsmPrinter::emitJumpTableInfo() {
MJTI->getEntryKind() == MachineJumpTableInfo::EK_LabelDifference32 ||
MJTI->getEntryKind() == MachineJumpTableInfo::EK_LabelDifference64,
F);

std::vector<unsigned> JumpTableIndices;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the attempt to reuse this vector for both cases - with and without partitioning makes the code more complex than it needs to be. Consider the following refactoring:

  • Sink the vector into the if condition below.
  • Use separate vectors for hot and cold when partitioning is enabled.
  • Use an arrayref as param for emitJumpTableImpl instead of iterator range.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

if (!TM.Options.EnableStaticDataPartitioning) {
for (unsigned JTI = 0, JTSize = JT.size(); JTI < JTSize; ++JTI)
JumpTableIndices.push_back(JTI);
emitJumpTables(JumpTableIndices, TLOF.getSectionForJumpTable(F, TM),
JTInDiffSection, *MJTI);
return;
}

// When static data partitioning is enabled, collect jump table entries that
// go into the same section together to reduce the amount of section switch
// statements.
//
// Iterate all jump tables, put hot jump table indices towards the beginning
// of the vector, and cold jump table indices towards the end. Meanwhile
// retain the relative orders of original jump tables within a hot or unlikely
// section by reversing the cold jump table indices.
int NextHotJumpTableIndex = 0, NextColdJumpTableIndex = JT.size() - 1;
JumpTableIndices.resize(JT.size());
for (unsigned JTI = 0, JTSize = JT.size(); JTI < JTSize; ++JTI) {
if (JT[JTI].Hotness == MachineFunctionDataHotness::Cold)
JumpTableIndices[NextColdJumpTableIndex--] = JTI;
else
JumpTableIndices[NextHotJumpTableIndex++] = JTI;
mingmingl-llvm marked this conversation as resolved.
Show resolved Hide resolved
}

if (NextHotJumpTableIndex != 0) {
emitJumpTables(
ArrayRef<unsigned>(JumpTableIndices).take_front(NextHotJumpTableIndex),
TLOF.getSectionForJumpTable(F, TM, &JT[0]), JTInDiffSection, *MJTI);
}
ellishg marked this conversation as resolved.
Show resolved Hide resolved

if (NextHotJumpTableIndex < (int)JT.size()) {
ellishg marked this conversation as resolved.
Show resolved Hide resolved
// Reverse the order of cold jump tables indices.
for (int L = NextHotJumpTableIndex, R = JT.size() - 1; L < R; ++L, --R)
std::swap(JumpTableIndices[L], JumpTableIndices[R]);
ellishg marked this conversation as resolved.
Show resolved Hide resolved

emitJumpTables(
ArrayRef<unsigned>(JumpTableIndices)
.take_back(JT.size() - NextHotJumpTableIndex),
ellishg marked this conversation as resolved.
Show resolved Hide resolved
TLOF.getSectionForJumpTable(
F, TM, &JT[JumpTableIndices[NextHotJumpTableIndex]]),
JTInDiffSection, *MJTI);
}

return;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't need this return?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed it.

}

void AsmPrinter::emitJumpTables(ArrayRef<unsigned> JumpTableIndices,
MCSection *JumpTableSection,
bool JTInDiffSection,
const MachineJumpTableInfo &MJTI) {
if (JumpTableIndices.empty())
return;

const DataLayout &DL = MF->getDataLayout();
if (JTInDiffSection) {
// Drop it in the readonly section.
MCSection *ReadOnlySection = TLOF.getSectionForJumpTable(F, TM);
OutStreamer->switchSection(ReadOnlySection);
OutStreamer->switchSection(JumpTableSection);
}

emitAlignment(Align(MJTI->getEntryAlignment(DL)));
emitAlignment(Align(MJTI.getEntryAlignment(MF->getDataLayout())));

// Jump tables in code sections are marked with a data_region directive
// where that's supported.
if (!JTInDiffSection)
OutStreamer->emitDataRegion(MCDR_DataRegionJT32);

for (unsigned JTI = 0, e = JT.size(); JTI != e; ++JTI) {
const std::vector<MachineBasicBlock*> &JTBBs = JT[JTI].MBBs;
const auto &JT = MJTI.getJumpTables();
for (unsigned Index = 0, e = JumpTableIndices.size(); Index != e; ++Index) {
ellishg marked this conversation as resolved.
Show resolved Hide resolved
const std::vector<MachineBasicBlock *> &JTBBs =
mingmingl-llvm marked this conversation as resolved.
Show resolved Hide resolved
JT[JumpTableIndices[Index]].MBBs;

// If this jump table was deleted, ignore it.
if (JTBBs.empty()) continue;
if (JTBBs.empty())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are some formatting changes here (and below) that make it hard to reason about what actually changed. Any way to separate them out into a separate PR easily?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense. #124645 does the refactor.

continue;

// For the EK_LabelDifference32 entry, if using .set avoids a relocation,
/// emit a .set directive for each unique entry.
if (MJTI->getEntryKind() == MachineJumpTableInfo::EK_LabelDifference32 &&
if (MJTI.getEntryKind() == MachineJumpTableInfo::EK_LabelDifference32 &&
MAI->doesSetDirectiveSuppressReloc()) {
SmallPtrSet<const MachineBasicBlock*, 16> EmittedSets;
SmallPtrSet<const MachineBasicBlock *, 16> EmittedSets;
const TargetLowering *TLI = MF->getSubtarget().getTargetLowering();
const MCExpr *Base = TLI->getPICJumpTableRelocBaseExpr(MF,JTI,OutContext);
const MCExpr *Base = TLI->getPICJumpTableRelocBaseExpr(
MF, JumpTableIndices[Index], OutContext);
for (const MachineBasicBlock *MBB : JTBBs) {
if (!EmittedSets.insert(MBB).second)
continue;

// .set LJTSet, LBB32-base
const MCExpr *LHS =
MCSymbolRefExpr::create(MBB->getSymbol(), OutContext);
OutStreamer->emitAssignment(GetJTSetSymbol(JTI, MBB->getNumber()),
MCBinaryExpr::createSub(LHS, Base,
OutContext));
MCSymbolRefExpr::create(MBB->getSymbol(), OutContext);
OutStreamer->emitAssignment(
GetJTSetSymbol(JumpTableIndices[Index], MBB->getNumber()),
MCBinaryExpr::createSub(LHS, Base, OutContext));
}
}

Expand All @@ -2923,27 +2981,27 @@ void AsmPrinter::emitJumpTableInfo() {
// FIXME: This doesn't have to have any specific name, just any randomly
// named and numbered local label started with 'l' would work. Simplify
// GetJTISymbol.
OutStreamer->emitLabel(GetJTISymbol(JTI, true));
OutStreamer->emitLabel(GetJTISymbol(JumpTableIndices[Index], true));

MCSymbol* JTISymbol = GetJTISymbol(JTI);
MCSymbol *JTISymbol = GetJTISymbol(JumpTableIndices[Index]);
OutStreamer->emitLabel(JTISymbol);

// Defer MCAssembler based constant folding due to a performance issue. The
// label differences will be evaluated at write time.
for (const MachineBasicBlock *MBB : JTBBs)
emitJumpTableEntry(MJTI, MBB, JTI);
emitJumpTableEntry(MJTI, MBB, JumpTableIndices[Index]);
}

if (EmitJumpTableSizesSection)
emitJumpTableSizesSection(MJTI, F);
emitJumpTableSizesSection(MJTI, MF->getFunction());

if (!JTInDiffSection)
OutStreamer->emitDataRegion(MCDR_DataRegionEnd);
}

void AsmPrinter::emitJumpTableSizesSection(const MachineJumpTableInfo *MJTI,
void AsmPrinter::emitJumpTableSizesSection(const MachineJumpTableInfo &MJTI,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good to split out the pointer to ref changes as a separate PR and commit it as NFC.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a6aa936 should be the pointer-to-ref change. I rebased the PR as suggested. After the rebase this diff will not show up.

const Function &F) const {
const std::vector<MachineJumpTableEntry> &JT = MJTI->getJumpTables();
const std::vector<MachineJumpTableEntry> &JT = MJTI.getJumpTables();

if (JT.empty())
return;
Expand Down Expand Up @@ -2991,17 +3049,17 @@ void AsmPrinter::emitJumpTableSizesSection(const MachineJumpTableInfo *MJTI,

/// EmitJumpTableEntry - Emit a jump table entry for the specified MBB to the
/// current stream.
void AsmPrinter::emitJumpTableEntry(const MachineJumpTableInfo *MJTI,
void AsmPrinter::emitJumpTableEntry(const MachineJumpTableInfo &MJTI,
const MachineBasicBlock *MBB,
unsigned UID) const {
assert(MBB && MBB->getNumber() >= 0 && "Invalid basic block");
const MCExpr *Value = nullptr;
switch (MJTI->getEntryKind()) {
switch (MJTI.getEntryKind()) {
case MachineJumpTableInfo::EK_Inline:
llvm_unreachable("Cannot emit EK_Inline jump table entry");
case MachineJumpTableInfo::EK_Custom32:
Value = MF->getSubtarget().getTargetLowering()->LowerCustomJumpTableEntry(
MJTI, MBB, UID, OutContext);
&MJTI, MBB, UID, OutContext);
break;
case MachineJumpTableInfo::EK_BlockAddress:
// EK_BlockAddress - Each entry is a plain address of block, e.g.:
Expand Down Expand Up @@ -3035,7 +3093,7 @@ void AsmPrinter::emitJumpTableEntry(const MachineJumpTableInfo *MJTI,
// If the .set directive avoids relocations, this is emitted as:
// .set L4_5_set_123, LBB123 - LJTI1_2
// .word L4_5_set_123
if (MJTI->getEntryKind() == MachineJumpTableInfo::EK_LabelDifference32 &&
if (MJTI.getEntryKind() == MachineJumpTableInfo::EK_LabelDifference32 &&
MAI->doesSetDirectiveSuppressReloc()) {
Value = MCSymbolRefExpr::create(GetJTSetSymbol(UID, MBB->getNumber()),
OutContext);
Expand All @@ -3051,7 +3109,7 @@ void AsmPrinter::emitJumpTableEntry(const MachineJumpTableInfo *MJTI,

assert(Value && "Unknown entry kind!");

unsigned EntrySize = MJTI->getEntrySize(getDataLayout());
unsigned EntrySize = MJTI.getEntrySize(getDataLayout());
OutStreamer->emitValue(Value, EntrySize);
}

Expand Down
1 change: 1 addition & 0 deletions llvm/lib/CodeGen/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ add_llvm_component_library(LLVMCodeGen
StackMaps.cpp
StackProtector.cpp
StackSlotColoring.cpp
StaticDataSplitter.cpp
SwiftErrorValueTracking.cpp
SwitchLoweringUtils.cpp
TailDuplication.cpp
Expand Down
1 change: 1 addition & 0 deletions llvm/lib/CodeGen/CodeGen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ void llvm::initializeCodeGen(PassRegistry &Registry) {
initializeStackMapLivenessPass(Registry);
initializeStackProtectorPass(Registry);
initializeStackSlotColoringPass(Registry);
initializeStaticDataSplitterPass(Registry);
initializeStripDebugMachineModulePass(Registry);
initializeTailDuplicateLegacyPass(Registry);
initializeTargetPassConfigPass(Registry);
Expand Down
8 changes: 8 additions & 0 deletions llvm/lib/CodeGen/CommandFlags.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ CGOPT(bool, EnableStackSizeSection)
CGOPT(bool, EnableAddrsig)
CGOPT(bool, EmitCallSiteInfo)
CGOPT(bool, EnableMachineFunctionSplitter)
CGOPT(bool, EnableStaticDataPartitioning)
CGOPT(bool, EnableDebugEntryValues)
CGOPT(bool, ForceDwarfFrameSection)
CGOPT(bool, XRayFunctionIndex)
Expand Down Expand Up @@ -480,6 +481,12 @@ codegen::RegisterCodeGenFlags::RegisterCodeGenFlags() {
cl::init(false));
CGBINDOPT(EnableMachineFunctionSplitter);

static cl::opt<bool> EnableStaticDataPartitioning(
"partition-static-data-sections",
cl::desc("Partition data sections using profile information."),
cl::init(false));
CGBINDOPT(EnableStaticDataPartitioning);

static cl::opt<bool> ForceDwarfFrameSection(
"force-dwarf-frame-section",
cl::desc("Always emit a debug frame section."), cl::init(false));
Expand Down Expand Up @@ -586,6 +593,7 @@ codegen::InitTargetOptionsFromCodeGenFlags(const Triple &TheTriple) {
Options.ExceptionModel = getExceptionModel();
Options.EmitStackSizeSection = getEnableStackSizeSection();
Options.EnableMachineFunctionSplitter = getEnableMachineFunctionSplitter();
Options.EnableStaticDataPartitioning = getEnableStaticDataPartitioning();
Options.EmitAddrsig = getEnableAddrsig();
Options.EmitCallSiteInfo = getEmitCallSiteInfo();
Options.EnableDebugEntryValues = getEnableDebugEntryValues();
Expand Down
Loading
Loading