[MBP] Add flags to disable the BadCFGConflict check in MachineBlockPlacement.
authorChandler Carruth <chandlerc@gmail.com>
Wed, 14 Jan 2015 20:19:29 +0000 (20:19 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Wed, 14 Jan 2015 20:19:29 +0000 (20:19 +0000)
commit8af8091ef5a6cd3f79ab73d47ee07d91c9a5437f
tree74364a5312ee793c1b0d58a4161702873b131046
parent11abe69e9857390a035470c20534b8e5ac4d479e
[MBP] Add flags to disable the BadCFGConflict check in MachineBlockPlacement.

Some benchmarks have shown that this could lead to a potential
performance benefit, and so adding some flags to try to help measure the
difference.

A possible explanation. In diamond-shaped CFGs (A followed by either
B or C both followed by D), putting B and C both in between A and
D leads to the code being less dense than it could be. Always either
B or C have to be skipped increasing the chance of cache misses etc.
Moving either B or C to after D might be beneficial on average.

In the long run, but we should probably do a better job of analyzing the
basic block and branch probabilities to move the correct one of B or
C to after D. But even if we don't use this in the long run, it is
a good baseline for benchmarking.

Original patch authored by Daniel Jasper with test tweaks and a second
flag added by me.

Differential Revision: http://reviews.llvm.org/D6969

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226034 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/MachineBlockPlacement.cpp
test/CodeGen/X86/code_placement_bad_cfg_check.ll [new file with mode: 0644]