[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)
commit214997c63bc170b7859dcd03c551d6feaacb2dc2
tree3bbbb82211483b89f46967b5a67f433c0cc3a13f
parent8ac06996bf6e602888692df1836eeec02966db16
[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
llvm-svn: 232802
llvm/lib/CodeGen/MachineBlockPlacement.cpp
llvm/test/CodeGen/X86/code_placement_outline_optional_branches.ll