diff options
author | Vedant Kumar <vsk@apple.com> | 2019-01-25 03:22:38 +0000 |
---|---|---|
committer | Vedant Kumar <vsk@apple.com> | 2019-01-25 03:22:38 +0000 |
commit | 9d70f2b9391edb5e9659c0fa94c305d9f5c28c61 (patch) | |
tree | 59aac7b795d2330ab8679291e91d11afd3480548 /llvm/lib/Transforms/IPO/HotColdSplitting.cpp | |
parent | 65de025d6457408b2ce57770735342781dfce850 (diff) | |
download | bcm5719-llvm-9d70f2b9391edb5e9659c0fa94c305d9f5c28c61.tar.gz bcm5719-llvm-9d70f2b9391edb5e9659c0fa94c305d9f5c28c61.zip |
[HotColdSplit] Describe the pass in more detail, NFC
llvm-svn: 352161
Diffstat (limited to 'llvm/lib/Transforms/IPO/HotColdSplitting.cpp')
-rw-r--r-- | llvm/lib/Transforms/IPO/HotColdSplitting.cpp | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/llvm/lib/Transforms/IPO/HotColdSplitting.cpp b/llvm/lib/Transforms/IPO/HotColdSplitting.cpp index 162428084c4..8250db706e3 100644 --- a/llvm/lib/Transforms/IPO/HotColdSplitting.cpp +++ b/llvm/lib/Transforms/IPO/HotColdSplitting.cpp @@ -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" |