[PATCH] D36296: BlockPlacement: add a flag to force cold block outlining w/o a profile.

Kyle Butt via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 3 17:03:06 PDT 2017


iteratee created this revision.
Herald added a subscriber: sanjoy.

Add a flag that forces cold blocks to be evicted from a loop. NFC.


Repository:
  rL LLVM

https://reviews.llvm.org/D36296

Files:
  lib/CodeGen/MachineBlockPlacement.cpp


Index: lib/CodeGen/MachineBlockPlacement.cpp
===================================================================
--- lib/CodeGen/MachineBlockPlacement.cpp
+++ lib/CodeGen/MachineBlockPlacement.cpp
@@ -91,6 +91,11 @@
              "(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 @@
   // 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))


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D36296.109660.patch
Type: text/x-patch
Size: 1075 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170804/512069a3/attachment.bin>


More information about the llvm-commits mailing list