From ec105872056880da9689cfffdb296e32ca1ba876 Mon Sep 17 00:00:00 2001 From: Cong Hou Date: Thu, 6 Aug 2015 18:17:29 +0000 Subject: Revert r244154 which causes some build failure. See https://llvm.org/bugs/show_bug.cgi?id=24377. llvm-svn: 244239 --- llvm/lib/CodeGen/MachineBlockPlacement.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'llvm/lib/CodeGen/MachineBlockPlacement.cpp') diff --git a/llvm/lib/CodeGen/MachineBlockPlacement.cpp b/llvm/lib/CodeGen/MachineBlockPlacement.cpp index ecc093e97f58..b77c803f77f3 100644 --- a/llvm/lib/CodeGen/MachineBlockPlacement.cpp +++ b/llvm/lib/CodeGen/MachineBlockPlacement.cpp @@ -361,7 +361,8 @@ MachineBlockPlacement::selectBestSuccessor(MachineBasicBlock *BB, // improve the MBPI interface to efficiently support query patterns such as // this. uint32_t BestWeight = 0; - uint32_t SumWeight = MBPI->getSumForBlock(BB); + uint32_t WeightScale = 0; + uint32_t SumWeight = MBPI->getSumForBlock(BB, WeightScale); DEBUG(dbgs() << "Attempting merge from: " << getBlockName(BB) << "\n"); for (MachineBasicBlock *Succ : BB->successors()) { if (BlockFilter && !BlockFilter->count(Succ)) @@ -377,7 +378,7 @@ MachineBlockPlacement::selectBestSuccessor(MachineBasicBlock *BB, } uint32_t SuccWeight = MBPI->getEdgeWeight(BB, Succ); - BranchProbability SuccProb(SuccWeight, SumWeight); + BranchProbability SuccProb(SuccWeight / WeightScale, SumWeight); // If we outline optional branches, look whether Succ is unavoidable, i.e. // dominates all terminators of the MachineFunction. If it does, other @@ -674,7 +675,8 @@ MachineBlockPlacement::findBestLoopExit(MachineFunction &F, MachineLoop &L, // FIXME: Due to the performance of the probability and weight routines in // the MBPI analysis, we use the internal weights and manually compute the // probabilities to avoid quadratic behavior. - uint32_t SumWeight = MBPI->getSumForBlock(MBB); + uint32_t WeightScale = 0; + uint32_t SumWeight = MBPI->getSumForBlock(MBB, WeightScale); for (MachineBasicBlock *Succ : MBB->successors()) { if (Succ->isLandingPad()) continue; @@ -703,7 +705,7 @@ MachineBlockPlacement::findBestLoopExit(MachineFunction &F, MachineLoop &L, BlocksExitingToOuterLoop.insert(MBB); } - BranchProbability SuccProb(SuccWeight, SumWeight); + BranchProbability SuccProb(SuccWeight / WeightScale, SumWeight); BlockFrequency ExitEdgeFreq = MBFI->getBlockFreq(MBB) * SuccProb; DEBUG(dbgs() << " exiting: " << getBlockName(MBB) << " -> " << getBlockName(Succ) << " [L:" << SuccLoopDepth << "] ("; -- cgit v1.2.3