[MBP] Don't outline short optional branches
authorDaniel Jasper <djasper@google.com>
Fri, 20 Mar 2015 10:00:37 +0000 (10:00 +0000)
committerDaniel Jasper <djasper@google.com>
Fri, 20 Mar 2015 10:00:37 +0000 (10:00 +0000)
commit70b146b25e5383cded04e4cf6b05c37e09f94f8b
tree4ec09e0d94a0a8315f34c656d97333b8b5df1632
parent3220d112fac02b736a750262ff74f8f7a1a3e9aa
[MBP] Don't outline short optional branches

With the option -outline-optional-branches, LLVM will place optional
branches out of line (more details on r231230).

With this patch, this is not done for short optional branches. A short
optional branch is a branch containing a single block with an
instruction count below a certain threshold (defaulting to 3). Still
everything is guarded under -outline-optional-branches).

Outlining a short branch can't significantly improve code locality. It
can however decrease performance because of the additional jmp and in
cases where the optional branch is hot. This fixes a compile time
regression I have observed in a benchmark.

Review: http://reviews.llvm.org/D8108

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232802 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/MachineBlockPlacement.cpp
test/CodeGen/X86/code_placement_outline_optional_branches.ll