MachineBlockPlacement: Strengthen the source order bias when picking an exit block.
authorBenjamin Kramer <benny.kra@googlemail.com>
Wed, 20 Nov 2013 19:08:44 +0000 (19:08 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Wed, 20 Nov 2013 19:08:44 +0000 (19:08 +0000)
commit16e2f0ef1aa14650458939c2f5e9ed909edf0082
tree893163203fed39e3a80880464afd2f02be33c5e9
parentba883cebd634c877e56341c1206b8518bcf40452
MachineBlockPlacement: Strengthen the source order bias when picking an exit block.

We now only allow breaking source order if the exit block frequency is
significantly higher than the other exit block. The actual bias is
currently under a flag so the best cut-off can be found; the flag
defaults to the old behavior. The idea is to get some benchmark coverage
over different values for the flag and pick the best one.

When we require the new frequency to be at least 20% higher than the old
frequency I see a 5% speedup on zlib's deflate when compressing a random
file on x86_64/westmere. Hal reported a small speedup on Fhourstones on
a BG/Q and no regressions in the test suite.

The test case is the full long_match function from zlib's deflate. I was
reluctant to add it for previous tweaks to branch probabilities because
it's large and potentially fragile, but changed my mind since it's an
important use case and more likely to break with all the current work
going into the PGO infrastructure.

Differential Revision: http://llvm-reviews.chandlerc.com/D2202

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