Skip to content

Commit 9d70f2b

Browse files
committed
[HotColdSplit] Describe the pass in more detail, NFC
llvm-svn: 352161
1 parent 65de025 commit 9d70f2b

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

llvm/lib/Transforms/IPO/HotColdSplitting.cpp

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,24 @@
55
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
66
//
77
//===----------------------------------------------------------------------===//
8-
//
9-
// Outline cold regions to a separate function.
10-
// TODO: Update BFI and BPI
11-
// TODO: Add all the outlined functions to a separate section.
12-
//
8+
///
9+
/// \file
10+
/// The goal of hot/cold splitting is to improve the memory locality of code.
11+
/// The splitting pass does this by identifying cold blocks and moving them into
12+
/// separate functions.
13+
///
14+
/// When the splitting pass finds a cold block (referred to as "the sink"), it
15+
/// grows a maximal cold region around that block. The maximal region contains
16+
/// all blocks (post-)dominated by the sink [*]. In theory, these blocks are as
17+
/// cold as the sink. Once a region is found, it's split out of the original
18+
/// function provided it's profitable to do so.
19+
///
20+
/// [*] In practice, there is some added complexity because some blocks are not
21+
/// safe to extract.
22+
///
23+
/// TODO: Use the PM to get domtrees, and preserve BFI/BPI.
24+
/// TODO: Reorder outlined functions.
25+
///
1326
//===----------------------------------------------------------------------===//
1427

1528
#include "llvm/ADT/PostOrderIterator.h"

0 commit comments

Comments
 (0)