[Fast-ISel] Clear kill flags on registers replaced by updateValueMap.
authorPete Cooper <peter_cooper@apple.com>
Fri, 8 May 2015 20:46:54 +0000 (20:46 +0000)
committerPete Cooper <peter_cooper@apple.com>
Fri, 8 May 2015 20:46:54 +0000 (20:46 +0000)
commitf9f04c25b22dadbbbd1f56d72c152ff341ee8c28
tree0e474fe8b853ac607f2edd12a369349b94240954
parent74b576041ae3416097d0fe87f6fc3c2ba17ea68a
[Fast-ISel] Clear kill flags on registers replaced by updateValueMap.

When selecting an extract instruction, we don't actually generate code but instead work out which register we are reading, and rewrite uses of the extract def to the source register.  This is done via updateValueMap,.

However, its possible that the source register we are rewriting *to* to also have uses.  If those uses are after a kill of the value we are rewriting *from* then we have uses after a kill and the verifier fails.

This code checks for the case where the to register is also used, and if so it clears all kill on the from register.  This is conservative, but better that always clearing kills on the from register.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236897 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
test/CodeGen/ARM/fast-isel-update-valuemap-for-extract.ll [new file with mode: 0644]