Introduce a loop block rotation optimization to the new block placement
authorChandler Carruth <chandlerc@gmail.com>
Sun, 27 Nov 2011 00:38:03 +0000 (00:38 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Sun, 27 Nov 2011 00:38:03 +0000 (00:38 +0000)
commit2e38cf961d6d80c88290ca6b8d867e021f80b763
treed2b0eb5f21c74132c1217d3717dab0d1062994a7
parent9fbf6173b8730e18b39c0a6f3f348451f506780e
Introduce a loop block rotation optimization to the new block placement
pass. This is designed to achieve one of the important optimizations
that the old code placement pass did, but more simply.

This is a somewhat rough and *very* conservative version of the
transform. We could get a lot fancier here if there are profitable cases
to do so. In particular, this only looks for a single pattern, it
insists that the loop backedge being rotated away is the last backedge
in the chain, and it doesn't provide any means of doing better in-loop
placement due to the rotation. However, it appears that it will handle
the important loops I am finding in the LLVM test suite.

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