[RegAllocFast] Handle implicit definitions conservatively.
authorQuentin Colombet <qcolombet@apple.com>
Wed, 3 Dec 2014 23:38:08 +0000 (23:38 +0000)
committerQuentin Colombet <qcolombet@apple.com>
Wed, 3 Dec 2014 23:38:08 +0000 (23:38 +0000)
commit331ec379a087568ddbd06df22050d2f9233f638a
treee64964ad8d8474839ae601ee5883d56e20ec22d9
parentcc0061b2999b9a378b86ce8aabe46399d39aec11
[RegAllocFast] Handle implicit definitions conservatively.

Prior to this commit, physical registers defined implicitly were considered free
right after their definition, i.e.. like dead definitions. Therefore, their uses
had to immediately follow their definitions, otherwise the related register may
be reused to allocate a virtual register.

This commit fixes this assumption by keeping implicit definitions alive until
they are actually used. The downside is that if the implicit definition was dead
(and not marked at such), we block an otherwise available register. This is
however conservatively correct and makes the fast register allocator much more
robust in particular regarding the scheduling of the instructions.

Fixes PR21700.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223317 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/RegAllocFast.cpp
test/CodeGen/X86/crash-O0.ll