Enhance CodePlacementOpt's unconditional intra-loop branch elimination logic
authorDan Gohman <gohman@apple.com>
Sat, 17 Oct 2009 00:32:43 +0000 (00:32 +0000)
committerDan Gohman <gohman@apple.com>
Sat, 17 Oct 2009 00:32:43 +0000 (00:32 +0000)
commit3bdd8de2806e47f34369c1e6ce6e6b44a135bd29
tree685f68f1e94d5709d9ed435f014e28ee9376b941
parentb68d67caf3d8e73e92df932f46b67c87e7eb17c2
Enhance CodePlacementOpt's unconditional intra-loop branch elimination logic
to be more general and understand more varieties of loops.

Teach CodePlacementOpt to reorganize the basic blocks of a loop so that
they are contiguous. This also includes a fair amount of logic for preserving
fall-through edges while doing so. This fixes a BranchFolding-ism where blocks
which can't be made to use a fall-through edge and don't conveniently fit
anywhere nearby get tossed out to the end of the function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84295 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/CodePlacementOpt.cpp
test/CodeGen/X86/2009-04-20-LinearScanOpt.ll
test/CodeGen/X86/loop_blocks.ll [new file with mode: 0644]