1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 03:33:20 +01:00

CodeGen: MachineBlockPlacement: Rename member to more general name. NFC.

Rename ComputedTrellisEdges to ComputedEdges to allow for other methods of
pre-computing edges.

Differential Revision: https://reviews.llvm.org/D30308

llvm-svn: 296018
This commit is contained in:
Kyle Butt 2017-02-23 21:22:24 +00:00
parent 9021b155b4
commit 9b607f87d4

View File

@ -309,8 +309,8 @@ class MachineBlockPlacement : public MachineFunctionPass {
SmallVector<MachineBasicBlock *, 16> BlockWorkList; SmallVector<MachineBasicBlock *, 16> BlockWorkList;
SmallVector<MachineBasicBlock *, 16> EHPadWorkList; SmallVector<MachineBasicBlock *, 16> EHPadWorkList;
/// Edges that have already been computed as optimal by the trellis code. /// Edges that have already been computed as optimal.
DenseMap<const MachineBasicBlock *, MachineBasicBlock *> ComputedTrellisEdges; DenseMap<const MachineBasicBlock *, BlockAndTailDupResult> ComputedEdges;
/// \brief Machine Function /// \brief Machine Function
MachineFunction *F; MachineFunction *F;
@ -993,7 +993,7 @@ MachineBlockPlacement::getBestTrellisSuccessor(
} }
// We have already computed the optimal edge for the other side of the // We have already computed the optimal edge for the other side of the
// trellis. // trellis.
ComputedTrellisEdges[BestB.Src] = BestB.Dest; ComputedEdges[BestB.Src] = { BestB.Dest, false };
auto TrellisSucc = BestA.Dest; auto TrellisSucc = BestA.Dest;
DEBUG(BranchProbability SuccProb = getAdjustedProbability( DEBUG(BranchProbability SuccProb = getAdjustedProbability(
@ -1329,18 +1329,16 @@ MachineBlockPlacement::selectBestSuccessor(
DEBUG(dbgs() << "Selecting best successor for: " << getBlockName(BB) << "\n"); DEBUG(dbgs() << "Selecting best successor for: " << getBlockName(BB) << "\n");
// if we already precomputed the best successor for BB as part of a trellis we // if we already precomputed the best successor for BB, return that if still
// saw earlier, return that if still applicable. // applicable.
auto FoundEdge = ComputedTrellisEdges.find(BB); auto FoundEdge = ComputedEdges.find(BB);
if (FoundEdge != ComputedTrellisEdges.end()) { if (FoundEdge != ComputedEdges.end()) {
MachineBasicBlock *Succ = FoundEdge->second; MachineBasicBlock *Succ = FoundEdge->second.BB;
ComputedTrellisEdges.erase(FoundEdge); ComputedEdges.erase(FoundEdge);
BlockChain *SuccChain = BlockToChain[Succ]; BlockChain *SuccChain = BlockToChain[Succ];
if (BB->isSuccessor(Succ) && (!BlockFilter || BlockFilter->count(Succ)) && if (BB->isSuccessor(Succ) && (!BlockFilter || BlockFilter->count(Succ)) &&
SuccChain != &Chain && Succ == *SuccChain->begin()) { SuccChain != &Chain && Succ == *SuccChain->begin())
BestSucc.BB = Succ; return FoundEdge->second;
return BestSucc;
}
} }
// if BB is part of a trellis, Use the trellis to determine the optimal // if BB is part of a trellis, Use the trellis to determine the optimal