Defer SplitKit value mapping until all defs are available.
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Thu, 3 Feb 2011 00:54:23 +0000 (00:54 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Thu, 3 Feb 2011 00:54:23 +0000 (00:54 +0000)
commit2cd21119593becfa1962cfaca0319fd67913f545
tree1e012e68f87b842b624ad4d12d0a14cf3151c7c2
parent37280785092424431a714fa04981045a8fff3818
Defer SplitKit value mapping until all defs are available.

The greedy register allocator revealed some problems with the value mapping in
SplitKit. We would sometimes start mapping values before all defs were known,
and that could change a value from a simple 1-1 mapping to a multi-def mapping
that requires ssa update.

The new approach collects all defs and register assignments first without
filling in any live intervals. Only when finish() is called, do we compute
liveness and mapped values. At this time we know with certainty which values map
to multiple values in a split range.

This also has the advantage that we can compute live ranges based on the
remaining uses after rematerializing at split points.

The current implementation has many opportunities for compile time optimization.

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