diff options
author | Cong Hou <congh@google.com> | 2015-08-06 18:17:29 +0000 |
---|---|---|
committer | Cong Hou <congh@google.com> | 2015-08-06 18:17:29 +0000 |
commit | ec105872056880da9689cfffdb296e32ca1ba876 (patch) | |
tree | 5363b408f75223b073c2cef8c7cba8cdd9d61735 /llvm/lib/CodeGen/MachineBlockPlacement.cpp | |
parent | f032c956de59891e0c64e8d85a3f68533ddc8de6 (diff) | |
download | bcm5719-llvm-ec105872056880da9689cfffdb296e32ca1ba876.tar.gz bcm5719-llvm-ec105872056880da9689cfffdb296e32ca1ba876.zip |
Revert r244154 which causes some build failure. See https://llvm.org/bugs/show_bug.cgi?id=24377.
llvm-svn: 244239
Diffstat (limited to 'llvm/lib/CodeGen/MachineBlockPlacement.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineBlockPlacement.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/MachineBlockPlacement.cpp b/llvm/lib/CodeGen/MachineBlockPlacement.cpp index ecc093e97f5..b77c803f77f 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 << "] ("; |