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)
commitc3553ffc70ac8196629bc1d19b3186399e883a03
tree59fc1f50bc2f7f9e4c72d3ea4c4cf1995b84784a
parent14a87459906408ef325940b07bcf5fea3183f5fe
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>

llvm-svn: 157001
llvm/lib/CodeGen/RegisterCoalescer.cpp