Fix PR5024 with a big hammer: disable the double-def assertion in the scavenger.
authorEvan Cheng <evan.cheng@apple.com>
Thu, 24 Sep 2009 02:27:09 +0000 (02:27 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Thu, 24 Sep 2009 02:27:09 +0000 (02:27 +0000)
commit393e277ecd02f52443633f6bfacdd1d4c6981212
tree3a4869f278ff2387db23b9757497a286973f743b
parentad934b821c78d39e73a213c62cd57288f8605a0c
Fix PR5024 with a big hammer: disable the double-def assertion in the scavenger.

LiveVariables add implicit kills to correctly track partial register kills. This works well enough and is fairly accurate. But coalescer can make it impossible to maintain these markers. e.g.

        BL <ga:sss1>, %R0<kill,undef>, %S0<kill>, %R0<imp-def>, %R1<imp-def,dead>, %R2<imp-def,dead>, %R3<imp-def,dead>, %R12<imp-def,dead>, %LR<imp-def,dead>, %D0<imp-def>, ...
...
%reg1031<def> = FLDS <cp#1>, 0, 14, %reg0, Mem:LD4[ConstantPool]
...
    %S0<def> = FCPYS %reg1031<kill>, 14, %reg0, %D0<imp-use,kill>

When reg1031 and S0 are coalesced, the copy (FCPYS) will be eliminated the the implicit-kill of D0 is lost. In this case it's possible to move the marker to the FLDS. But in many cases, this is not possible. Suppose

%reg1031<def> = FOO <cp#1>, %D0<imp-def>
...
    %S0<def> = FCPYS %reg1031<kill>, 14, %reg0, %D0<imp-use,kill>

When FCPYS goes away, the definition of S0 is the "FOO" instruction. However, transferring the D0 implicit-kill to FOO doesn't work since it is the def of D0 itself. We need to fix this in another time by introducing a "kill" pseudo instruction to track liveness.

Disabling the assertion is not ideal, but machine verifier is doing that job now. It's important to know double-def is not a miscomputation since it means a register should be free but it's not tracked as free. It's a performance issue instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82677 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/RegisterScavenging.cpp
test/CodeGen/ARM/2009-09-23-LiveVariablesBug.ll [new file with mode: 0644]