mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-21 18:22:53 +01:00
[Analaysis, CodeGen] Remove getHotSucc (NFC)
These functions seem to be unused for at least 5 years.
This commit is contained in:
parent
afb69b12ce
commit
a471532d2a
@ -168,12 +168,6 @@ public:
|
||||
/// as having a relative probability >= 80%.
|
||||
bool isEdgeHot(const BasicBlock *Src, const BasicBlock *Dst) const;
|
||||
|
||||
/// Retrieve the hot successor of a block if one exists.
|
||||
///
|
||||
/// Given a basic block, look through its successors and if one exists for
|
||||
/// which \see isEdgeHot would return true, return that successor block.
|
||||
const BasicBlock *getHotSucc(const BasicBlock *BB) const;
|
||||
|
||||
/// Print an edge's probability.
|
||||
///
|
||||
/// Retrieves an edge's probability similarly to \see getEdgeProbability, but
|
||||
|
@ -55,10 +55,6 @@ public:
|
||||
bool isEdgeHot(const MachineBasicBlock *Src,
|
||||
const MachineBasicBlock *Dst) const;
|
||||
|
||||
// Return a hot successor for the block BB or null if there isn't one.
|
||||
// NB: This routine's complexity is linear on the number of successors.
|
||||
MachineBasicBlock *getHotSucc(MachineBasicBlock *MBB) const;
|
||||
|
||||
// Print value between 0 (0% probability) and 1 (100% probability),
|
||||
// however the value is never equal to 0, and can be 1 only iff SRC block
|
||||
// has only one successor.
|
||||
|
@ -1105,26 +1105,6 @@ isEdgeHot(const BasicBlock *Src, const BasicBlock *Dst) const {
|
||||
return getEdgeProbability(Src, Dst) > BranchProbability(4, 5);
|
||||
}
|
||||
|
||||
const BasicBlock *
|
||||
BranchProbabilityInfo::getHotSucc(const BasicBlock *BB) const {
|
||||
auto MaxProb = BranchProbability::getZero();
|
||||
const BasicBlock *MaxSucc = nullptr;
|
||||
|
||||
for (const auto *Succ : successors(BB)) {
|
||||
auto Prob = getEdgeProbability(BB, Succ);
|
||||
if (Prob > MaxProb) {
|
||||
MaxProb = Prob;
|
||||
MaxSucc = Succ;
|
||||
}
|
||||
}
|
||||
|
||||
// Hot probability is at least 4/5 = 80%
|
||||
if (MaxProb > BranchProbability(4, 5))
|
||||
return MaxSucc;
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
/// Get the raw edge probability for the edge. If can't find it, return a
|
||||
/// default probability 1/N where N is the number of successors. Here an edge is
|
||||
/// specified using PredBlock and an
|
||||
|
@ -68,26 +68,6 @@ bool MachineBranchProbabilityInfo::isEdgeHot(
|
||||
return getEdgeProbability(Src, Dst) > HotProb;
|
||||
}
|
||||
|
||||
MachineBasicBlock *
|
||||
MachineBranchProbabilityInfo::getHotSucc(MachineBasicBlock *MBB) const {
|
||||
auto MaxProb = BranchProbability::getZero();
|
||||
MachineBasicBlock *MaxSucc = nullptr;
|
||||
for (MachineBasicBlock::const_succ_iterator I = MBB->succ_begin(),
|
||||
E = MBB->succ_end(); I != E; ++I) {
|
||||
auto Prob = getEdgeProbability(MBB, I);
|
||||
if (Prob > MaxProb) {
|
||||
MaxProb = Prob;
|
||||
MaxSucc = *I;
|
||||
}
|
||||
}
|
||||
|
||||
BranchProbability HotProb(StaticLikelyProb, 100);
|
||||
if (getEdgeProbability(MBB, MaxSucc) >= HotProb)
|
||||
return MaxSucc;
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
raw_ostream &MachineBranchProbabilityInfo::printEdgeProbability(
|
||||
raw_ostream &OS, const MachineBasicBlock *Src,
|
||||
const MachineBasicBlock *Dst) const {
|
||||
|
Loading…
Reference in New Issue
Block a user