summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MachineBlockPlacement.cpp
diff options
context:
space:
mode:
authorXinliang David Li <davidxl@google.com>2016-06-03 23:48:36 +0000
committerXinliang David Li <davidxl@google.com>2016-06-03 23:48:36 +0000
commitff2873742e5bd4c59a7769fbbe9d6397e0c298f7 (patch)
treec4a732d112dff33429f277a5a60955c105b56d9d /llvm/lib/CodeGen/MachineBlockPlacement.cpp
parent7bae9adb0850519505d9f134d1ed9b39bc2b04c9 (diff)
downloadbcm5719-llvm-ff2873742e5bd4c59a7769fbbe9d6397e0c298f7.tar.gz
bcm5719-llvm-ff2873742e5bd4c59a7769fbbe9d6397e0c298f7.zip
Replace hard coded probability threshold with parameter /NFC
llvm-svn: 271751
Diffstat (limited to 'llvm/lib/CodeGen/MachineBlockPlacement.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineBlockPlacement.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/MachineBlockPlacement.cpp b/llvm/lib/CodeGen/MachineBlockPlacement.cpp
index 9df4da2f41f..c562af9d964 100644
--- a/llvm/lib/CodeGen/MachineBlockPlacement.cpp
+++ b/llvm/lib/CodeGen/MachineBlockPlacement.cpp
@@ -116,6 +116,8 @@ static cl::opt<unsigned> JumpInstCost("jump-inst-cost",
cl::desc("Cost of jump instructions."),
cl::init(1), cl::Hidden);
+extern cl::opt<unsigned> StaticLikelyProb;
+
namespace {
class BlockChain;
/// \brief Type for our function-wide basic block -> block chain mapping.
@@ -405,7 +407,7 @@ MachineBasicBlock *
MachineBlockPlacement::selectBestSuccessor(MachineBasicBlock *BB,
BlockChain &Chain,
const BlockFilterSet *BlockFilter) {
- const BranchProbability HotProb(4, 5); // 80%
+ const BranchProbability HotProb(StaticLikelyProb, 100);
MachineBasicBlock *BestSucc = nullptr;
auto BestProb = BranchProbability::getZero();
OpenPOWER on IntegriCloud