Fix PR14732 by handling all kinds of IMPLICIT_DEF live ranges.
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Thu, 3 Jan 2013 00:47:51 +0000 (00:47 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Thu, 3 Jan 2013 00:47:51 +0000 (00:47 +0000)
commit251ed7f3e59a857dd92bda1ba4f9305f33deb67b
tree40200e5363ae38bc59c8545ce6fe34943e1c90f6
parent47990e974355dd58d1f320f252e1a7ed3a79e034
Fix PR14732 by handling all kinds of IMPLICIT_DEF live ranges.

Most IMPLICIT_DEF instructions are removed by the ProcessImplicitDefs
pass, and a few are reinserted by PHIElimination when a PHI argument is
<undef>.

RegisterCoalescer was assuming that all IMPLICIT_DEF live ranges look
like those created by PHIElimination, and that their live range never
leaves the basic block.

The PR14732 test case does tricks with PHI nodes that causes a longer
IMPLICIT_DEF live range to appear. This happens very rarely, but
RegisterCoalescer should be able to handle it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171435 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/RegisterCoalescer.cpp
test/CodeGen/X86/coalesce-implicitdef.ll [new file with mode: 0644]