Spill mode: Hoist back-copies locally.
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Fri, 16 Sep 2011 00:03:35 +0000 (00:03 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Fri, 16 Sep 2011 00:03:35 +0000 (00:03 +0000)
commitebac0c1747d20e48f359d76dd454444107080d83
tree970f4b0170b4c1320e6dc9ad42aa8e93ddb0697b
parent69cf1cac3f62e60a50ff0aa9808ea4d317e273ef
Spill mode: Hoist back-copies locally.

The leaveIntvAfter() function normally inserts a back-copy after the
requested instruction, making the back-copy kill the live range.

In spill mode, try to insert the back-copy before the last use instead.
That means the last use becomes the kill instead of the back-copy.  This
lowers the register pressure because the last use can now redefine the
same register it was reading.

This will also improve compile time: The back-copy isn't a kill, so
hoisting it in hoistCopiesForSize() won't force a recomputation of the
source live range.  Similarly, if the back-copy isn't hoisted by the
splitter, the spiller will not attempt hoisting it locally.

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