[RegAllocFast] Don't insert kill flags of super-register for partial kill
authorQuentin Colombet <qcolombet@apple.com>
Fri, 7 Jul 2017 19:25:45 +0000 (19:25 +0000)
committerQuentin Colombet <qcolombet@apple.com>
Fri, 7 Jul 2017 19:25:45 +0000 (19:25 +0000)
commit868ef847a627b95c93d0eac5080cdcc3f989f56e
tree34c977444b329c4cee54ca7c9435ed05a1f1e5f7
parent81551148b72f46760db75e4fa5cb85b82bbc766b
[RegAllocFast] Don't insert kill flags of super-register for partial kill

When reusing a register for a new definition, the fast register allocator
used to insert a kill flag at the previous last use of that register to
inform later passes that this register is free between the redef and the
last use. However, this may be wrong when subregisters are involved.
Indeed, a partially redef would have trigger a kill of the full super
register, potentially wrongly marking all the other subregisters as
free. Given we don't track which lanes are still live, we cannot set the
kill flag in such case.

Note: This bug has been latent for about 7 years (r104056).

llvmg.org/PR33677

llvm-svn: 307428
llvm/lib/CodeGen/RegAllocFast.cpp
llvm/test/CodeGen/SystemZ/regalloc-fast-invalid-kill-flag.mir [new file with mode: 0644]