[ARM] IT block insertion needs to update kill flags
authorPete Cooper <peter_cooper@apple.com>
Mon, 4 May 2015 22:44:47 +0000 (22:44 +0000)
committerPete Cooper <peter_cooper@apple.com>
Mon, 4 May 2015 22:44:47 +0000 (22:44 +0000)
commit8737acdac27ca7393accf2e5b23c41f09da27a63
treed0429c483f0c832338b00b00b66733cfed2e2fa9
parent7e93f3b7230b2e067d6bf0416ad1d431df1291c9
[ARM] IT block insertion needs to update kill flags

When forming an IT block from the first MOV here:

%R2<def> = t2MOVr %R0, pred:1, pred:%CPSR, opt:%noreg
%R3<def> = tMOVr %R0<kill>, pred:14, pred:%noreg

the move in to R3 is moved out of the IT block so that later instructions on the same predicate can be inside this block, and we can share the IT instruction.

However, when moving the R3 copy out of the IT block, we need to clear its kill flags for anything in use at this point in time, ie, R0 here.

This appeases the machine verifier which thought that R0 wasn't defined when used.

I have a test case, but its extremely register allocator specific.  It would be too fragile to commit a test which depends on the register allocator here.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236468 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/ARM/Thumb2ITBlockPass.cpp