]> granicus.if.org Git - llvm/commit
[BranchFolding] Tail common all identical unreachable blocks
authorReid Kleckner <rnk@google.com>
Tue, 14 Feb 2017 21:02:24 +0000 (21:02 +0000)
committerReid Kleckner <rnk@google.com>
Tue, 14 Feb 2017 21:02:24 +0000 (21:02 +0000)
commitf3470b10da7a0e8fb47740af2cfca1a5acd86a8f
treed15ecf664bcf249573e310472f18b81176dbbfd7
parent07fb294d72bcb95081bcee5023a79c028b3210a2
[BranchFolding] Tail common all identical unreachable blocks

Summary:
Blocks ending in unreachable are typically cold because they end the
program or throw an exception, so merging them with other identical
blocks is usually profitable because it reduces the size of cold code.
MachineBlockPlacement generally does not arrange to fall through to such
blocks, so commoning these blocks will not introduce additional
unconditional branches.

Reviewers: hans, iteratee, haicheng

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D29153

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295105 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/BranchFolding.cpp
test/CodeGen/ARM/tail-opts.ll
test/CodeGen/X86/tail-opts.ll