Add a flag to experiment with outlining optional branches.
authorDaniel Jasper <djasper@google.com>
Wed, 4 Mar 2015 11:05:34 +0000 (11:05 +0000)
committerDaniel Jasper <djasper@google.com>
Wed, 4 Mar 2015 11:05:34 +0000 (11:05 +0000)
commit471e856f499b85943b657cf4bbff918d945c625d
tree3e05b7d08a9cb1305b4d1dab2dd02e4eb43d3d6f
parent783cbdcd89c30bb5f528e72b04b98ea94d7c7669
Add a flag to experiment with outlining optional branches.

In a CFG with the edges A->B->C and A->C, B is an optional branch.

LLVM's default behavior is to lay the blocks out naturally, i.e. A, B,
C, in order to improve code locality and fallthroughs. However, if a
function contains many of those optional branches only a few of which
are taken, this leads to a lot of unnecessary icache misses. Moving B
out of line can work around this.

Review: http://reviews.llvm.org/D7719
llvm-svn: 231230
llvm/lib/CodeGen/MachineBlockPlacement.cpp
llvm/test/CodeGen/X86/code_placement_outline_optional_branches.ll [new file with mode: 0644]