[llvm] r310129 - BlockPlacement: add a flag to force cold block outlining w/o a profile.

Kyle Butt via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 4 14:13:41 PDT 2017


Author: iteratee
Date: Fri Aug  4 14:13:41 2017
New Revision: 310129

URL: http://llvm.org/viewvc/llvm-project?rev=310129&view=rev
Log:
BlockPlacement: add a flag to force cold block outlining w/o a profile.

NFC.

Modified:
    llvm/trunk/lib/CodeGen/MachineBlockPlacement.cpp

Modified: llvm/trunk/lib/CodeGen/MachineBlockPlacement.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineBlockPlacement.cpp?rev=310129&r1=310128&r2=310129&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/MachineBlockPlacement.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachineBlockPlacement.cpp Fri Aug  4 14:13:41 2017
@@ -91,6 +91,11 @@ static cl::opt<unsigned> LoopToColdBlock
              "(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::collectLoopBlockS
   // 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))




More information about the llvm-commits mailing list