]> granicus.if.org Git - llvm/commitdiff
[HotColdSplit] Describe the pass in more detail, NFC
authorVedant Kumar <vsk@apple.com>
Fri, 25 Jan 2019 03:22:38 +0000 (03:22 +0000)
committerVedant Kumar <vsk@apple.com>
Fri, 25 Jan 2019 03:22:38 +0000 (03:22 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352161 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/IPO/HotColdSplitting.cpp

index 162428084c40c2587fac52f2abefee7038267ee3..8250db706e3a7f1fcba2fcd5740c18b083d1bd16 100644 (file)
@@ -5,11 +5,24 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-//
-// Outline cold regions to a separate function.
-// TODO: Update BFI and BPI
-// TODO: Add all the outlined functions to a separate section.
-//
+///
+/// \file
+/// The goal of hot/cold splitting is to improve the memory locality of code.
+/// The splitting pass does this by identifying cold blocks and moving them into
+/// separate functions.
+///
+/// When the splitting pass finds a cold block (referred to as "the sink"), it
+/// grows a maximal cold region around that block. The maximal region contains
+/// all blocks (post-)dominated by the sink [*]. In theory, these blocks are as
+/// cold as the sink. Once a region is found, it's split out of the original
+/// function provided it's profitable to do so.
+///
+/// [*] In practice, there is some added complexity because some blocks are not
+/// safe to extract.
+///
+/// TODO: Use the PM to get domtrees, and preserve BFI/BPI.
+/// TODO: Reorder outlined functions.
+///
 //===----------------------------------------------------------------------===//
 
 #include "llvm/ADT/PostOrderIterator.h"