File tree Expand file tree Collapse file tree 1 file changed +18
-5
lines changed Expand file tree Collapse file tree 1 file changed +18
-5
lines changed Original file line number Diff line number Diff line change 5
5
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
6
//
7
7
// ===----------------------------------------------------------------------===//
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
+ // /
13
26
// ===----------------------------------------------------------------------===//
14
27
15
28
#include " llvm/ADT/PostOrderIterator.h"
You can’t perform that action at this time.
0 commit comments