Clear kill flags on all used registers when sinking instructions.
authorPete Cooper <peter_cooper@apple.com>
Fri, 8 May 2015 17:54:32 +0000 (17:54 +0000)
committerPete Cooper <peter_cooper@apple.com>
Fri, 8 May 2015 17:54:32 +0000 (17:54 +0000)
commitd90099d36ca7359e5077e295da2bcf5f7c5a386f
tree67a8ec2bd75ad532663dd9b030a98dea16c62a02
parent8eaf0475887a0ff8345f89333513265744c48289
Clear kill flags on all used registers when sinking instructions.

The test here was sinking the AND here to a lower BB:

%vreg7<def> = ANDWri %vreg8, 0; GPR32common:%vreg7,%vreg8
TBNZW %vreg8<kill>, 0, <BB#1>; GPR32common:%vreg8

which meant that vreg8 was read after it was killed.

This commit changes the code from clearing kill flags on the AND to clearing flags on all registers used by the AND.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236886 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/MachineSink.cpp
test/CodeGen/AArch64/machine-sink-kill-flags.ll [new file with mode: 0644]