Never clear <undef> flags on already joined copies.
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Thu, 17 May 2012 18:32:42 +0000 (18:32 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Thu, 17 May 2012 18:32:42 +0000 (18:32 +0000)
commit94e58f3a7c50e14819d411db3b6df10bbd35cb5e
treeeb6305ebff995ec02ee238f5979a896698e5236d
parente3da8c62864da0ed0386075baf79d612746d849b
Never clear <undef> flags on already joined copies.

RegisterCoalescer set <undef> flags on all operands of copy instructions
that are scheduled to be removed. This is so they won't affect
shrinkToUses() by introducing false register reads.

Make sure those <undef> flags are never cleared, or shrinkToUses() could
cause live intervals to end at instructions about to be deleted.

This would be a lot simpler if RegisterCoalescer could just erase joined
copies immediately instead of keeping all the to-be-deleted instructions
around.

This fixes PR12862. Unfortunately, bugpoint can't create a sane test
case for this. Like many other coalescer problems, this failure depends
of a very fragile series of events.

<rdar://problem/11474428>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157001 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/RegisterCoalescer.cpp