Add a somewhat hacky heuristic to do something different from whole-loop
authorChandler Carruth <chandlerc@gmail.com>
Mon, 16 Apr 2012 13:33:36 +0000 (13:33 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Mon, 16 Apr 2012 13:33:36 +0000 (13:33 +0000)
commite773e8c3e53aadb6e861316e4db88d63a0226b2f
treefabf835486b538a63eaa46f8f387d2e0b0b1b1e5
parent656dc6260654a7fa29d223bcaf6aae048669c72d
Add a somewhat hacky heuristic to do something different from whole-loop
rotation. When there is a loop backedge which is an unconditional
branch, we will end up with a branch somewhere no matter what. Try
placing this backedge in a fallthrough position above the loop header as
that will definitely remove at least one branch from the loop iteration,
where whole loop rotation may not.

I haven't seen any benchmarks where this is important but loop-blocks.ll
tests for it, and so this will be covered when I flip the default.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154812 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/MachineBlockPlacement.cpp
test/CodeGen/X86/block-placement.ll