summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MachineBlockPlacement.cpp
diff options
context:
space:
mode:
authorKyle Butt <kyle+llvm@iteratee.net>2017-08-04 21:13:41 +0000
committerKyle Butt <kyle+llvm@iteratee.net>2017-08-04 21:13:41 +0000
commit74f61dd8ef97454eb6729f9769c69567afcffb19 (patch)
tree7a716cc9e7da0b2cac2332492d8e3efb181d5b61 /llvm/lib/CodeGen/MachineBlockPlacement.cpp
parent92e584cb48200cd7eb9f608f94636a0e66ac4d9a (diff)
downloadbcm5719-llvm-74f61dd8ef97454eb6729f9769c69567afcffb19.tar.gz
bcm5719-llvm-74f61dd8ef97454eb6729f9769c69567afcffb19.zip
BlockPlacement: add a flag to force cold block outlining w/o a profile.
NFC. llvm-svn: 310129
Diffstat (limited to 'llvm/lib/CodeGen/MachineBlockPlacement.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineBlockPlacement.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/MachineBlockPlacement.cpp b/llvm/lib/CodeGen/MachineBlockPlacement.cpp
index 447ad629885..374b3079c34 100644
--- a/llvm/lib/CodeGen/MachineBlockPlacement.cpp
+++ b/llvm/lib/CodeGen/MachineBlockPlacement.cpp
@@ -91,6 +91,11 @@ static cl::opt<unsigned> LoopToColdBlockRatio(
"(frequency of block) is greater than this ratio"),
cl::init(5), cl::Hidden);
+static cl::opt<bool> ForceLoopColdBlock(
+ "force-loop-cold-block",
+ cl::desc("Force outlining cold blocks from loops."),
+ cl::init(false), cl::Hidden);
+
static cl::opt<bool>
PreciseRotationCost("precise-rotation-cost",
cl::desc("Model the cost of loop rotation more "
@@ -2146,7 +2151,7 @@ MachineBlockPlacement::collectLoopBlockSet(const MachineLoop &L) {
// will be merged into the first outer loop chain for which this block is not
// cold anymore. This needs precise profile data and we only do this when
// profile data is available.
- if (F->getFunction()->getEntryCount()) {
+ if (F->getFunction()->getEntryCount() || ForceLoopColdBlock) {
BlockFrequency LoopFreq(0);
for (auto LoopPred : L.getHeader()->predecessors())
if (!L.contains(LoopPred))
OpenPOWER on IntegriCloud