diff options
author | Kyle Butt <kyle+llvm@iteratee.net> | 2017-01-31 23:48:32 +0000 |
---|---|---|
committer | Kyle Butt <kyle+llvm@iteratee.net> | 2017-01-31 23:48:32 +0000 |
commit | b15c06677c63b4420c7673eb9d5cd37073244780 (patch) | |
tree | ef004ad1c4a9e3d96c13d1f191f924dfc6c520b2 /llvm/lib/CodeGen/BranchFolding.cpp | |
parent | a86be2223013a810ac8653ffa3214efa84245c74 (diff) | |
download | bcm5719-llvm-b15c06677c63b4420c7673eb9d5cd37073244780.tar.gz bcm5719-llvm-b15c06677c63b4420c7673eb9d5cd37073244780.zip |
CodeGen: Allow small copyable blocks to "break" the CFG.
When choosing the best successor for a block, ordinarily we would have preferred
a block that preserves the CFG unless there is a strong probability the other
direction. For small blocks that can be duplicated we now skip that requirement
as well, subject to some simple frequency calculations.
Differential Revision: https://reviews.llvm.org/D28583
llvm-svn: 293716
Diffstat (limited to 'llvm/lib/CodeGen/BranchFolding.cpp')
-rw-r--r-- | llvm/lib/CodeGen/BranchFolding.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/BranchFolding.cpp b/llvm/lib/CodeGen/BranchFolding.cpp index 1bdfa2dbbb9..c632eb7ab7d 100644 --- a/llvm/lib/CodeGen/BranchFolding.cpp +++ b/llvm/lib/CodeGen/BranchFolding.cpp @@ -500,6 +500,11 @@ BranchFolder::MBFIWrapper::printBlockFreq(raw_ostream &OS, void BranchFolder::MBFIWrapper::view(bool isSimple) { MBFI.view(isSimple); } +uint64_t +BranchFolder::MBFIWrapper::getEntryFreq() const { + return MBFI.getEntryFreq(); +} + /// CountTerminators - Count the number of terminators in the given /// block and set I to the position of the first non-terminator, if there /// is one, or MBB->end() otherwise. |