Skip to content

[BOLT][NFC] Remove unused code for CDSplit #74136

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

Merged
merged 1 commit into from
Dec 1, 2023
Merged
Changes from all commits
Commits
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
31 changes: 0 additions & 31 deletions bolt/lib/Passes/SplitFunctions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,12 +194,6 @@ struct SplitCacheDirected final : public SplitStrategy {
}

private:
struct JumpInfo {
bool HasUncondBranch = false;
BinaryBasicBlock *CondSuccessor = nullptr;
BinaryBasicBlock *UncondSuccessor = nullptr;
};

struct CallInfo {
size_t Length;
size_t Count;
Expand All @@ -218,7 +212,6 @@ struct SplitCacheDirected final : public SplitStrategy {
DenseMap<const BinaryBasicBlock *, size_t> GlobalIndices;
DenseMap<const BinaryBasicBlock *, size_t> BBSizes;
DenseMap<const BinaryBasicBlock *, size_t> BBOffsets;
DenseMap<const BinaryBasicBlock *, JumpInfo> JumpInfos;

// Call graph.
std::vector<SmallVector<const BinaryBasicBlock *, 0>> Callers;
Expand All @@ -231,27 +224,6 @@ struct SplitCacheDirected final : public SplitStrategy {
}

void initializeAuxiliaryVariables() {
// Gather information about conditional and unconditional successors of
// each basic block; this information will be used to estimate block size
// increase due to hot-warm splitting.
auto analyzeBranches = [&](BinaryBasicBlock &BB) {
JumpInfo BBJumpInfo;
const MCSymbol *TBB = nullptr;
const MCSymbol *FBB = nullptr;
MCInst *CondBranch = nullptr;
MCInst *UncondBranch = nullptr;
if (BB.analyzeBranch(TBB, FBB, CondBranch, UncondBranch)) {
BBJumpInfo.HasUncondBranch = UncondBranch != nullptr;
if (BB.succ_size() == 1) {
BBJumpInfo.UncondSuccessor = BB.getSuccessor();
} else if (BB.succ_size() == 2) {
BBJumpInfo.CondSuccessor = BB.getConditionalSuccessor(true);
BBJumpInfo.UncondSuccessor = BB.getConditionalSuccessor(false);
}
}
return BBJumpInfo;
};

for (BinaryFunction *BF : BC.getSortedFunctions()) {
if (!shouldConsiderForCallGraph(*BF))
continue;
Expand All @@ -273,9 +245,6 @@ struct SplitCacheDirected final : public SplitStrategy {
BBOffsets[BB] = OrigHotSectionSize;
if (!BB->isSplit())
OrigHotSectionSize += BBSizes[BB];

// (Un)Conditional branch instruction information.
JumpInfos[BB] = analyzeBranches(*BB);
}
}
}
Expand Down