Fix Bug 4657: register scavenger asserts with subreg lowering
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Mon, 3 Aug 2009 20:08:18 +0000 (20:08 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Mon, 3 Aug 2009 20:08:18 +0000 (20:08 +0000)
commit980daea857719b3eeb7dc88fe013049d361d955b
treeb4a859f5f789eb04937d82ff98b94b11805dd952
parentea1c9b7bacb6d58b4fef08fb32b1a7ccef856c1e
Fix Bug 4657: register scavenger asserts with subreg lowering

When LowerSubregsInstructionPass::LowerInsert eliminates an INSERT_SUBREG
instriction because it is an identity copy, make sure that the same registers
are alive before and after the elimination.

When the super-register is marked <undef> this requires inserting an
IMPLICIT_DEF instruction to make sure the super register is live.

Fix a related bug where a kill flag on the inserted sub-register was not transferred properly.

Finally, clear the undef flag in MachineInstr::addRegisterKilled. Undef implies dead and kill implies live, so they cant both be valid.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77989 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/LowerSubregs.cpp
lib/CodeGen/MachineInstr.cpp
test/CodeGen/ARM/2009-08-02-RegScavengerAssert-Neon.ll [new file with mode: 0644]