Rework a bit of the implementation of loop block rotation to not rely so
authorChandler Carruth <chandlerc@gmail.com>
Sun, 27 Nov 2011 09:22:53 +0000 (09:22 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Sun, 27 Nov 2011 09:22:53 +0000 (09:22 +0000)
commit2eb5a744b18d429928751b06e205cbb88f668ae7
treea4f36f4f737e68b9478c51427132f21d90bfe620
parentb5dd9de7240f3018dcd8ce84c158547a5e0f1131
Rework a bit of the implementation of loop block rotation to not rely so
heavily on AnalyzeBranch. That routine doesn't behave as we want given
that rotation occurs mid-way through re-ordering the function. Instead
merely check that there are not unanalyzable branching constructs
present, and then reason about the CFG via successor lists. This
actually simplifies my mental model for all of this as well.

The concrete result is that we now will rotate more loop chains. I've
added a test case from Olden highlighting the effect. There is still
a bit more to do here though in order to regain all of the performance
in Olden.

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