When adding blocks to the list of those which no longer have any CFG
authorChandler Carruth <chandlerc@gmail.com>
Thu, 24 Nov 2011 08:46:04 +0000 (08:46 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Thu, 24 Nov 2011 08:46:04 +0000 (08:46 +0000)
commita2deea1dcf8363f46bda8935283c5c701b5a278d
tree6e743ad6e90eda9e3509dff4b9f50038fa8733c7
parent2552de030bb50ab793ff8851401214187d35b542
When adding blocks to the list of those which no longer have any CFG
conflicts, we should only be adding the first block of the chain to the
list, lest we try to merge into the middle of that chain. Most of the
places we were doing this we already happened to be looking at the first
block, but there is no reason to assume that, and in some cases it was
clearly wrong.

I've added a couple of tests here. One already worked, but I like having
an explicit test for it. The other is reduced from a test case Duncan
reduced for me and used to crash. Now it is handled correctly.

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