Skip to content

Commit 296088b

Browse files
authored
[BOLT][NFC] Remove unused code for CDSplit (#74136)
This diff removes JumpInfo related code that is no longer needed by CDSplit from SplitFunctions.cpp.
1 parent f310a5d commit 296088b

File tree

1 file changed

+0
-31
lines changed

1 file changed

+0
-31
lines changed

bolt/lib/Passes/SplitFunctions.cpp

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -194,12 +194,6 @@ struct SplitCacheDirected final : public SplitStrategy {
194194
}
195195

196196
private:
197-
struct JumpInfo {
198-
bool HasUncondBranch = false;
199-
BinaryBasicBlock *CondSuccessor = nullptr;
200-
BinaryBasicBlock *UncondSuccessor = nullptr;
201-
};
202-
203197
struct CallInfo {
204198
size_t Length;
205199
size_t Count;
@@ -218,7 +212,6 @@ struct SplitCacheDirected final : public SplitStrategy {
218212
DenseMap<const BinaryBasicBlock *, size_t> GlobalIndices;
219213
DenseMap<const BinaryBasicBlock *, size_t> BBSizes;
220214
DenseMap<const BinaryBasicBlock *, size_t> BBOffsets;
221-
DenseMap<const BinaryBasicBlock *, JumpInfo> JumpInfos;
222215

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

233226
void initializeAuxiliaryVariables() {
234-
// Gather information about conditional and unconditional successors of
235-
// each basic block; this information will be used to estimate block size
236-
// increase due to hot-warm splitting.
237-
auto analyzeBranches = [&](BinaryBasicBlock &BB) {
238-
JumpInfo BBJumpInfo;
239-
const MCSymbol *TBB = nullptr;
240-
const MCSymbol *FBB = nullptr;
241-
MCInst *CondBranch = nullptr;
242-
MCInst *UncondBranch = nullptr;
243-
if (BB.analyzeBranch(TBB, FBB, CondBranch, UncondBranch)) {
244-
BBJumpInfo.HasUncondBranch = UncondBranch != nullptr;
245-
if (BB.succ_size() == 1) {
246-
BBJumpInfo.UncondSuccessor = BB.getSuccessor();
247-
} else if (BB.succ_size() == 2) {
248-
BBJumpInfo.CondSuccessor = BB.getConditionalSuccessor(true);
249-
BBJumpInfo.UncondSuccessor = BB.getConditionalSuccessor(false);
250-
}
251-
}
252-
return BBJumpInfo;
253-
};
254-
255227
for (BinaryFunction *BF : BC.getSortedFunctions()) {
256228
if (!shouldConsiderForCallGraph(*BF))
257229
continue;
@@ -273,9 +245,6 @@ struct SplitCacheDirected final : public SplitStrategy {
273245
BBOffsets[BB] = OrigHotSectionSize;
274246
if (!BB->isSplit())
275247
OrigHotSectionSize += BBSizes[BB];
276-
277-
// (Un)Conditional branch instruction information.
278-
JumpInfos[BB] = analyzeBranches(*BB);
279248
}
280249
}
281250
}

0 commit comments

Comments
 (0)