[MachineSink+PGO] Teach MachineSink to use BlockFrequencyInfo
authorBruno Cardoso Lopes <bruno.cardoso@gmail.com>
Thu, 25 Sep 2014 23:14:26 +0000 (23:14 +0000)
committerBruno Cardoso Lopes <bruno.cardoso@gmail.com>
Thu, 25 Sep 2014 23:14:26 +0000 (23:14 +0000)
commitf4230250a101979aa60e111bb1c7bf4a16d9985d
treea1a75e39867ef1accb42273c0e1c64f1cdcfb7e9
parent5c1c055cb7dc2577933468fbd98441f2f5027c20
[MachineSink+PGO] Teach MachineSink to use BlockFrequencyInfo

Machine Sink uses loop depth information to select between successors BBs to
sink machine instructions into, where BBs within smaller loop depths are
preferable.  This patch adds support for choosing between successors by using
profile information from BlockFrequencyInfo instead, whenever the information
is available.

Tested it under SPEC2006 train (average of 30 runs for each program); ~1.5%
execution speedup in average on x86-64 darwin.

<rdar://problem/18021659>

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