Add an interface for SplitKit complement spill modes.
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Mon, 12 Sep 2011 16:49:21 +0000 (16:49 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Mon, 12 Sep 2011 16:49:21 +0000 (16:49 +0000)
commit708d06f7fb5dfd9c8559aea07b042a88c65645f8
tree6bbc7ba4471436a755327c09bb665b87c27b90e4
parent3d4ec14ffc6b957b9418578567a5751ef6f80fdb
Add an interface for SplitKit complement spill modes.

SplitKit always computes a complement live range to cover the places
where the original live range was live, but no explicit region has been
allocated.

Currently, the complement live range is created to be as small as
possible - it never overlaps any of the regions.  This minimizes
register pressure, but if the complement is going to be spilled anyway,
that is not very important.  The spiller will eliminate redundant
spills, and hoist others by making the spill slot live range overlap
some of the regions created by splitting.  Stack slots are cheap.

This patch adds the interface to enable spill modes in SplitKit.  In
spill mode, SplitKit will assume that the complement is going to spill,
so it will allow it to overlap regions in order to avoid back-copies.
By doing some of the spiller's work early, the complement live range
becomes simpler.  In some cases, it can become much simpler because no
extra PHI-defs are required.  This will speed up both splitting and
spilling.

This is only the interface to enable spill modes, no implementation yet.

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