SpillPlacement: fix a bug in iterate.
authorManman Ren <manman.ren@gmail.com>
Fri, 28 Feb 2014 23:05:31 +0000 (23:05 +0000)
committerManman Ren <manman.ren@gmail.com>
Fri, 28 Feb 2014 23:05:31 +0000 (23:05 +0000)
commit5de568068963748c789a42777f1e7f9fade7403b
treecf769e8cf85db73df7943eae92990fdabffd878f
parentc1d2eda56567d3e1d8e3b85f06a5c3bd068ae29d
SpillPlacement: fix a bug in iterate.

Inside iterate, we scan backwards then scan forwards in a loop. When iteration
is not zero, the last node was just updated so we can skip it. But when
iteration is zero, we can't skip the last node.

For the testing case, fixing this will save a spill and move register copies
from hot path to cold path.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202557 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SpillPlacement.cpp
test/CodeGen/X86/ragreedy-bug.ll [new file with mode: 0644]