Fixed a long standing spiller bug that's exposed by Thumb:
authorEvan Cheng <evan.cheng@apple.com>
Thu, 8 Feb 2007 06:04:54 +0000 (06:04 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Thu, 8 Feb 2007 06:04:54 +0000 (06:04 +0000)
commitf50d09ad21dbb16e35460d63d23d331a2cac7a91
treef1e80bbc2db213e6ed32bd1c0c9b29af9bbaca1c
parentf596a97287dc7c00486089162796dd66b627dadf
Fixed a long standing spiller bug that's exposed by Thumb:

The code sequence before the spiller is something like:
                 = tMOVrr
        %reg1117 = tMOVrr
        %reg1078 = tLSLri %reg1117, 2

The it starts spilling:
        %r0 = tRestore <fi#5>, 0
        %r1 = tRestore <fi#7>, 0
        %r1 = tMOVrr %r1<kill>
        tSpill %r1, <fi#5>, 0
        %reg1078 = tLSLri %reg1117, 2

It restores the value while processing the first tMOVrr. At this point, the
spiller remembers fi#5 is available in %r0. Next it processes the second move.
It restores the source before the move and spills the result afterwards. The
move becomes a noop and is deleted. However, a spill has been inserted and that
should invalidate reuse of %r0 for fi#5 and add reuse of %r1 for fi#5.
Therefore, %reg1117 (which is also assigned fi#5) should get %r1, not %r0.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34039 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/VirtRegMap.cpp