History log of /external/llvm/lib/CodeGen/SplitKit.h
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
b20b518f800293ea6b2bed04134c71293ac52403 12-Jan-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Make SplitAnalysis::UseSlots private.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148031 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
74c4f97a466513e45e66e04469973fdcd5865300 11-Jan-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Exclusively use SplitAnalysis::getLastSplitPoint().

Delete the alternative implementation in LiveIntervalAnalysis.

These functions computed the same thing, but SplitAnalysis caches the
result.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147911 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
c4c633852fbb8ab9ef2679b679d2862746d2fa3e 14-Sep-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Hoist back-copies to the least busy dominator.

When a back-copy is hoisted to the nearest common dominator, keep
looking up the dominator tree for a less loopy dominator, and place the
back-copy there instead.

Don't do this when a single existing back-copy dominates all the others.
Assume the client knows what he is doing, and keep the dominating
back-copy.

This prevents us from hoisting back-copies into loops in most cases. If
a value is defined in a loop with multiple exits, we may still hoist
back-copies into that loop. That is the speed/size tradeoff.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139698 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
393bfcb263fa46e4badc73c6aa56306986f94dcf 14-Sep-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Distinguish complex mapped values from forced recomputation.

When a ParentVNI maps to multiple defs in a new interval, its live range
may still be derived directly from RegAssign by transferValues().

On the other hand, when instructions have been rematerialized or
hoisted, it may be necessary to completely recompute live ranges using
LiveRangeCalc::extend() to all uses.

Use a bit in the value map to indicate that a live range must be
recomputed. Rename markComplexMapped() to forceRecompute().

This fixes some live range verification errors when
-split-spill-mode=size hoists back-copies by recomputing source ranges
when RegAssign kills can't be moved.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139660 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
b21abfed813fa46976f896439ca2f9fbd2eba9ba 14-Sep-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Implement -split-spill-mode=size.

Whenever the complement interval is defined by multiple copies of the
same value, hoist those back-copies to the nearest common dominator.

This ensures that at most one copy is inserted per value in the
complement inteval, and no phi-defs are needed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139651 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
e5a2e366322ef5f0d597b1fb8dbf55f2cf36cf15 13-Sep-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Add SplitEditor::markOverlappedComplement().

This function is used to flag values where the complement interval may
overlap other intervals. Call it from overlapIntv, and use the flag to
fully recompute those live ranges in transferValues().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139612 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
abcc73e8ba3131c7c4f198840ece31453a0101ac 13-Sep-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Eliminate the extendRange() wrapper.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139608 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
c1c622ef0dd29d1bafd580790aec5231af50abf2 13-Sep-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Use a separate LiveRangeCalc for the complement in spill modes.

The complement interval may overlap the other intervals created, so use
a separate LiveRangeCalc instance to compute its live range.

A LiveRangeCalc instance can only be shared among non-overlapping
intervals.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139603 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
b5a457c4cbc71db6ae313ef1bf8eadac65767ab0 13-Sep-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Extract live range calculations from SplitKit.

SplitKit will soon need two copies of these data structures, and the
algorithms will also be useful when LiveIntervalAnalysis becomes
independent of LiveVariables.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139572 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
708d06f7fb5dfd9c8559aea07b042a88c65645f8 12-Sep-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> 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
/external/llvm/lib/CodeGen/SplitKit.h
3d4ec14ffc6b957b9418578567a5751ef6f80fdb 12-Sep-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Update comments to reflect some (not so) recent changes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139498 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
75e28f74b051e72ca3fc1aa38e5e43a5204a65ce 06-Aug-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Delete getMultiUseBlocks and splitSingleBlocks.

These functions are no longer used, and they are easily replaced with a
loop calling shouldSplitSingleBlock and splitSingleBlock.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136993 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
2d6d86be84ee355223ccd20b7f87a0c9971c50c9 06-Aug-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Split around single instructions to enable register class inflation.

Normally, we don't create a live range for a single instruction in a
basic block, the spiller does that anyway. However, when splitting a
live range that belongs to a proper register sub-class, inserting these
extra COPY instructions completely remove the constraints from the
remainder interval, and it may be allocated from the larger super-class.

The spiller will mop up these small live ranges if we end up spilling
anyway. It calls them snippets.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136989 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
fe62d92b7bbaf73e576bec0c0b11cfa6c191aa87 03-Aug-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Rename {First,Last}Use to {First,Last}Instr.

With a 'FirstDef' field right there, it is very confusing that FirstUse
refers to an instruction that may be a def.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136739 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
77ee1140a3297e6fbd6cb7cf586872af6d00d07e 03-Aug-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Add a BlockInfo::FirstDef field.

This is either an invalid SlotIndex, or valno->def for the first value
defined inside the block. PHI values are not counted as defined inside
the block.

The FirstDef field will be used when estimating the cost of spilling
around a block.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136736 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
4751eb760e7f4e51cfd594cbe46c7d0d7865d693 03-Aug-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Delete BlockInfo::LiveThrough. It wasn't used any more.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136735 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
b4ddedce599183362b0f0333922c2fe0e163a129 15-Jul-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Extract parts of RAGreedy::splitAroundRegion as SplitKit methods.

This gets rid of some of the gory splitting details in RAGreedy and
makes them available to future SplitKit clients.

Slightly generalize the functionality to support multi-way splitting.
Specifically, SplitEditor::splitLiveThroughBlock() supports switching
between different register intervals in a block.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135307 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
87360f73ae205854f100ba5fb7eef7b90ac3bc27 30-Jun-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Reapply r134047 now that the world is ready for it.

This patch will sometimes choose live range split points next to
interference instead of always splitting next to a register point. That
means spill code can now appear almost anywhere, and it was necessary
to fix code that didn't expect that.

The difficult places were:

- Between a CALL returning a value on the x87 stack and the
corresponding FpPOP_RETVAL (was FpGET_ST0). Probably also near x87
inline assembly, but that didn't actually show up in testing.

- Between a CALL popping arguments off the stack and the corresponding
ADJCALLSTACKUP.

Both are fixed now. The only place spill code can't appear is after
terminators, see SplitAnalysis::getLastSplitPoint.

Original commit message:

Rewrite RAGreedy::splitAroundRegion, now with cool ASCII art.

This function has to deal with a lot of special cases, and the old
version got it wrong sometimes. In particular, it would sometimes leave
multiple uses in the stack interval in a single block. That causes bad
code with multiple reloads in the same basic block.

The new version handles block entry and exit in a single pass. It first
eliminates all the easy cases, and then goes on to create a local
interval for the blocks with difficult interference. Previously, we
would only create the local interval for completely isolated blocks.

It can happen that the stack interval becomes completely empty because
we could allocate a register in all edge bundles, and the new local
intervals deal with the interference. The empty stack interval is
harmless, but we need to remove a SplitKit assertion that checks for
empty intervals.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134125 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
2c0cbce763a258ac58590a8ca3c28ff722093fef 29-Jun-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Revert r134047 while investigating a llvm-gcc-i386-linux-selfhost
miscompile.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134053 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
4d517e34e5c8431adb724c94a14b02362a9cfe67 29-Jun-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Rewrite RAGreedy::splitAroundRegion, now with cool ASCII art.

This function has to deal with a lot of special cases, and the old
version got it wrong sometimes. In particular, it would sometimes leave
multiple uses in the stack interval in a single block. That causes bad
code with multiple reloads in the same basic block.

The new version handles block entry and exit in a single pass. It first
eliminates all the easy cases, and then goes on to create a local
interval for the blocks with difficult interference. Previously, we
would only create the local interval for completely isolated blocks.

It can happen that the stack interval becomes completely empty because
we could allocate a register in all edge bundles, and the new local
intervals deal with the interference. The empty stack interval is
harmless, but we need to remove a SplitKit assertion that checks for
empty intervals.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134047 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
a2e79ef908e0f4179cda9e85e2f75057181bf321 30-May-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Reapply r132245 with a fix for the bug that broke the darwin9/i386 build.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132309 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
626d6fb1903e74337b257c5e165944bcd1273e65 29-May-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Revert r132245, "Create two BlockInfo entries when a live range is discontinuous through a block."

This commit seems to have broken a darwin 9 tester.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132299 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
c9cf9e94ec4daca659e2eb4e30d3f7d7f9b6b067 28-May-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Create two BlockInfo entries when a live range is discontinuous through a block.

Delete the Kill and Def markers in BlockInfo. They are no longer
necessary when BlockInfo describes a continuous live range.

This only affects the relatively rare kind of basic block where a live
range looks like this:

|---x o---|

Now live range splitting can pretend that it is looking at two blocks:

|---x
o---|

This allows the code to be simplified a bit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132245 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
b2abfa0bf30edf292a27a06e091d03983e644c9b 28-May-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Add SplitAnalysis::getNumLiveBlocks().

It is important that this function returns the same number of live blocks as
countLiveBlocks(CurLI) because live range splitting uses the number of live
blocks to ensure it is making progress.

This is in preparation of supporting duplicate UseBlock entries for basic blocks
that have a virtual register live-in and live-out, but not live-though.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132244 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
7d6b6a05b549da70b4473f015c97954c2a422724 03-May-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Gracefully handle invalid live ranges. Fix PR9831.

Register coalescing can sometimes create live ranges that end in the middle of a
basic block without any killing instruction. When SplitKit detects this, it will
repair the live range by shrinking it to its uses.

Live range splitting also needs to know about this. When the range shrinks so
much that it becomes allocatable, live range splitting fails because it can't
find a good split point. It is paranoid about making progress, so an allocatable
range is considered an error.

The coalescer should really not be creating these bad live ranges. They appear
when coalescing dead copies.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130787 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
9f4b893b84d9c2b56aa2abc3c96ce1e5ccc465e5 27-Apr-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Add a safe-guard against repeated splitting for some rare cases.

The number of blocks covered by a live range must be strictly decreasing when
splitting, otherwise we can't allow repeated splitting.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130249 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
6796e4fc889d99c4ad97ec5ad86e4c8cf75e52a4 24-Apr-2011 Sebastian Redl <sebastian.redl@getdesigned.at> Give SplitKit.h a header guard.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130095 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
5928046306d8bbe7db35707c294689f515f90e56 21-Apr-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Allow allocatable ranges from global live range splitting to be split again.

These intervals are allocatable immediately after splitting, but they may be
evicted because of later splitting. This is rare, but when it happens they
should be split again.

The remainder intervals that cannot be allocated after splitting still move
directly to spilling.

SplitEditor::finish can optionally provide a mapping from new live intervals
back to the original interval indexes returned by openIntv().

Each original interval index can map to multiple new intervals after connected
components have been separated. Dead code elimination may also add existing
intervals to the list.

The reverse mapping allows the SplitEditor client to treat the new intervals
differently depending on the split region they came from.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129925 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
44b7ae2355a32035ea286555736d173755a1c5e2 15-Apr-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Teach the SplitKit blitter to handle multiply defined values as well.

The transferValues() function can now handle both singly and multiply defined
values, as long as the resulting live range is known. Only rematerialized values
have their live range recomputed by extendRange().

The updateSSA() function can now insert PHI values in bulk across multiple
values in multiple target registers in one pass. The list of blocks received
from transferValues() is in layout order which seems to work well for the
iterative algorithm. Blocks from extendRange() are still in reverse BFS order,
but this function is used so rarely now that it doesn't matter.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129580 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
fd1cced726469e83915f428877a521ba737d35f3 13-Apr-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Stop using dead function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129442 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
5db4289e404d76664f8aabe2675a4cc2d7b0e98e 12-Apr-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> SparseBitVector is SLOW.

Use a Bitvector instead, we didn't need the smaller memory footprint anyway.
This makes the greedy register allocator 10% faster.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129390 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
fd5c51342a429ecab86a645282d0b36b216c0256 12-Apr-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Create new intervals for isolated blocks during region splitting.

This merges the behavior of splitSingleBlocks into splitAroundRegion, so the
RS_Region and RS_Block register stages can be coalesced. That means the leftover
intervals after region splitting go directly to spilling instead of a second
pass of per-block splitting.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129379 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
e1b43c3b4000ee7201fcac8d1c8e75bb9fb547e3 12-Apr-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Add SplitKit API to query and select the current interval being worked on.

This makes it possible to target multiple registers in one pass.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129374 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
f4afdfc501b7185d24a0ef184fe3d0c0bbe22e0c 09-Apr-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Build the Hopfield network incrementally when splitting global live ranges.

It is common for large live ranges to have few basic blocks with register uses
and many live-through blocks without any uses. This approach grows the Hopfield
network incrementally around the use blocks, completely avoiding checking
interference for some through blocks.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129188 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
db529a8a5d071610f3a8b467693bc40b073e68ef 06-Apr-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Analyze blocks with uses separately from live-through blocks without uses.

About 90% of the relevant blocks are live-through without uses, and the only
information required about them is their number. This saves memory and enables
later optimizations that need to look at only the use-blocks.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128985 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
a2948ef5accab638371615f539ea9f9ec5ff5d03 05-Apr-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Use std::unique instead of a SmallPtrSet to ensure unique instructions in UseSlots.

This allows us to always keep the smaller slot for an instruction which is what
we want when a register has early clobber defines.

Drop the UsingInstrs set and the UsingBlocks map. They are no longer needed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128886 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
612f7807c581eafb7c8105e1a55c8d839033bfb3 05-Apr-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Stop precomputing last split points, query the SplitAnalysis cache on demand.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128875 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
1a7744501a80351ce31fcecad42c8e35823bc081 05-Apr-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Cache the fairly expensive last split point computation and provide a fast
inlined path for the common case.

Most basic blocks don't contain a call that may throw, so the last split point
os simply the first terminator.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128874 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
6c8afd728eb02742ce320ecd39bcf3774d8423b7 04-Apr-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Stop caching basic block index ranges now that SlotIndexes can keep up.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128821 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
5c4c4d4b82a658643c8daefd5cc76d5c712285ed 04-Apr-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Delete leftover data members.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128820 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
2254227791ea267426b9ac674fc6d87decb65bc1 17-Mar-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Rewrite instructions as part of ConnectedVNInfoEqClasses::Distribute.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127779 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
5881799d0cccbd814ec1b0f0509df9be1f63c6cb 08-Mar-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Delete dead code after rematerializing.

LiveRangeEdit::eliminateDeadDefs() will eventually be used by coalescing,
splitting, and spilling for dead code elimination. It can delete chains of dead
instructions as long as there are no dependency loops.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127287 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
2b0f9e73d8623b21fc14335ef6208deab2629cdf 05-Mar-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Work around a coalescer bug.

The coalescer can in very rare cases leave too large live intervals around after
rematerializing cheap-as-a-move instructions.

Linear scan doesn't really care, but live range splitting gets very confused
when a live range is killed by a ghost instruction.

I will fix this properly in the coalescer after 2.9 branches.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127096 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
13ba2dab631636e525a44bb259aaea56a860d1c7 04-Mar-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Use an IndexedMap instead of a DenseMap for the live-out cache.

This speeds up updateSSA() so it only accounts for 5% of the live range
splitting time.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126972 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
36d61863bc83bd2301e0224adc560098b35ec0dc 03-Mar-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Cache basic block bounds instead of asking SlotIndexes::getMBBRange all the time.

This speeds up the greedy register allocator by 15%.
DenseMap is not as fast as one might hope.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126921 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
bece06f0c6936527e2b1c72d09f7d3a949af9a47 03-Mar-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Change the SplitEditor interface to a single instance can be shared for multiple splits.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126912 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
a2cae58411b36a58f658f9402e8d039add31ae4d 03-Mar-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Turn the Edit member into a pointer so it can change dynamically.

No functional change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126898 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
4670353a21fbc6e8159a129cda965f256e73a451 03-Mar-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Transfer simply defined values directly without recomputing liveness and SSA.

Values that map to a single new value in a new interval after splitting don't
need new PHIDefs, and if the parent value was never rematerialized the live
range will be the same.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126894 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
e2dc0c978e2435dbbb55cb7fca7750034c3e292a 03-Mar-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Extract a method. No functional change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126893 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
1c38ba6355a019b7fc3baa0d0ab31e8ba11f7db1 02-Mar-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Move extendRange() into SplitEditor and delete the LiveRangeMap class.

Extract the updateSSA() method from the too long extendRange().

LiveOutCache can be shared among all the new intervals since there is at most
one of the new ranges live out from each basic block.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126818 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
d3fdaeb69a25bcd21914b80f75606e2c2f1b35c8 02-Mar-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Rename mapValue to extendRange because that is its function now.

Simplify the signature - The return value and ParentVNI are no longer needed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126809 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
9763e2bf39b84f18bd464b0cda61fe1cd98dcaae 02-Mar-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Move LiveIntervalMap::extendTo into LiveInterval itself.

This method could probably be used by LiveIntervalAnalysis::shrinkToUses, and
now it can use extendIntervalEndTo() which coalesces ranges.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126803 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
edb87555e466e781087e18936f427816c952f3e7 02-Mar-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Delete dead code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126801 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
670ccd18ae1ecec3b3c92885d5b64b21859001c4 02-Mar-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Move the value map from LiveIntervalMap to SplitEditor.

The value map is currently not used, all values are 'complex mapped' and
LiveIntervalMap::mapValue is used to dig them out.

This is the first step in a series changes leading to the removal of
LiveIntervalMap. Its data structures can be shared among all the live intervals
created by a split, so it is wasteful to create a copy for each.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126800 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
3afab9c57e1afb0b7a4a9fe25a74117461bc0e69 02-Mar-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Delete dead code.

Local live range splitting is better driven by interference. This code was just
guessing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126799 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
06c0f25499fd502668ca720b0fea4a4dfe6eb44a 22-Feb-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Add SplitKit::isOriginalEndpoint and use it to force live range splitting to terminate.

An original endpoint is an instruction that killed or defined the original live
range before any live ranges were split.

When splitting global live ranges, avoid creating local live ranges without any
original endpoints. We may still create global live ranges without original
endpoints, but such a range won't be split again, and live range splitting still
terminates.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126151 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
1b847deb26b52051de39f4cbecd224c9fbd0d1c2 19-Feb-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Give SplitAnalysis a VRM member to access VirtRegMap::getOriginal().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126005 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
0eeca440469e23f2db2bea3d7b136f0f95f6ff1d 19-Feb-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Missed member rename for naming convention.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126003 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
034a80d065358b412cdd270e08fb6f1986e65e50 17-Feb-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Split local live ranges.

A local live range is live in a single basic block. If such a range fails to
allocate, try to find a sub-range that would get a larger spill weight than its
interference.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125764 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
4f5c9d206139f946ae4bb5ee7e3ddb1714057cdb 10-Feb-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Delete unused code for analyzing and splitting around loops.

Loop splitting is better handled by the more generic global region splitting
based on the edge bundle graph.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125243 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
9b057771ba22441b8d312404204433477b4be657 10-Feb-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Use the LiveBLocks array for SplitEditor::splitSingleBlocks() as well.

This fixes a bug where splitSingleBlocks() could split a live range after a
terminator instruction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125237 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
f0ac26c51173a9a1d6e5b5794107dccc4c5b5792 09-Feb-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Move calcLiveBlockInfo() and the BlockInfo struct into SplitAnalysis.

No functional changes intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125231 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
5c716bdccce2fa504e1aa0b67226165d181d2459 08-Feb-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Add SplitEditor::overlapIntv() to create small ranges where both registers are live.

If a live range is used by a terminator instruction, and that live range needs
to leave the block on the stack or in a different register, it can be necessary
to have both sides of the split live at the terminator instruction.

Example:

%vreg2 = COPY %vreg1
JMP %vreg1

Becomes after spilling %vreg2:

SPILL %vreg1
JMP %vreg1

The spill doesn't kill the register as is normally the case.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125102 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
207c868c9210663d401b7f5ce5cae7c3e0943849 03-Feb-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Return live range end points from SplitEditor::enter*/leave*.

These end points come from the inserted copies, and can be passed directly to
useIntv. This simplifies the coloring code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124799 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
0f43811903f10394f7088f4634c0b4f9668cbac0 03-Feb-2011 Eric Christopher <echristo@apple.com> Reapply this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124779 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
463a2977b1d9e6679f859db9f32e9e783b075c10 03-Feb-2011 Eric Christopher <echristo@apple.com> Temporarily revert 124765 in an attempt to find the cycle breaking bootstrap.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124778 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
2cd21119593becfa1962cfaca0319fd67913f545 03-Feb-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> 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
/external/llvm/lib/CodeGen/SplitKit.h
078628465b73348b5608ec6aa2d7181679543903 26-Jan-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Rename member variables to follow the rest of LLVM.
No functional change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124257 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
d7ca57705e7ccc19245b8b3d6fc271562366bf92 20-Jan-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Add LiveIntervalMap::dumpCache() to print out the cache used by the ssa update algorithm.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123925 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
b5fa9333431673aac2ced8dea80152349a85cf6f 18-Jan-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Add RAGreedy methods for splitting live ranges around regions.

Analyze the live range's behavior entering and leaving basic blocks. Compute an
interference pattern for each allocation candidate, and use SpillPlacement to
find an optimal region where that register can be live.

This code is still not enabled.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123774 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
8dd070edc2209ecfdae49780ec1596b349e2cbd1 04-Jan-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Turn the EdgeBundles class into a stand-alone machine CFG analysis pass.

The analysis will be needed by both the greedy register allocator and the
X86FloatingPoint pass. It only needs to be computed once when the CFG doesn't
change.

This pass is very fast, usually showing up as 0.0% wall time.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122832 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
8d0963f72c8922bafffb36ff49b18064098a3cab 21-Dec-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Add EdgeBundles to SplitKit.

Edge bundles is an annotation on the CFG that turns it into a bipartite directed
graph where each basic block is connected to an outgoing and an ingoing bundle.
These bundles are useful for identifying regions of the CFG for live range
splitting.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122301 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
697483addf056595c997302f1316cc59244eefaa 15-Dec-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Detect and enumerate bypass loops.

Bypass loops have the current live range live through, but contain no uses or
defs. Splitting around a bypass loop can free registers for other uses inside
the loop by spilling the split range.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121871 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
521a453721aeefbb6783b6acc8ea36b3c18b4931 15-Dec-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Separate SplitAnalysis::getSplitLoops().

This method returns the set of loops with uses that are candidates for
splitting.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121870 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
cfa7134a9c33c0c7f8dda359c89dc6763a258e07 10-Nov-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Basic rematerialization during splitting.

Whenever splitting wants to insert a copy, it checks if the value can be
rematerialized cheaply instead.

Missing features:
- Delete instructions when all uses have been rematerialized.
- Truncate live ranges to the remaining uses after rematerialization.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118702 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
3d4114c464d1ec6c9a6088e04d2156f72c4b42ce 02-Nov-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> When inserting copies during splitting, always use the parent register as the
source, and let rewrite() clean it up.

This way, kill flags on the inserted copies are fixed as well during rewrite().

We can't just assume that all the copies we insert are going to be kills since
critical edges into loop headers sometimes require both source and dest to be
live out of a block.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117980 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
e1dde7b05a83438eeba4bd83f8cf080f56d22c5b 28-Oct-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Replace SplitKit SSA update with an iterative algorithm very similar to the one
in SSAUpdaterImpl.h

Verifying live intervals revealed that the old method was completely wrong, and
we need an iterative approach to calculating PHI placemant. Fortunately, we have
MachineDominators available, so we don't have to compute that over and over
like SSAUpdaterImpl.h must.

Live-out values are cached between calls to mapValue() and computed in a greedy
way, so most calls will be working with very small block sets.

Thanks to Bob for explaining how this should work.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117599 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
d68f458244b9d9a6644a9550dd5cee60331c9e7d 28-Oct-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Make MachineDominators available for SplitEditor. We are going to need it for
proper SSA updating.

This doesn't cause MachineDominators to be recomputed since we are already
requiring MachineLoopInfo which uses dominators as well.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117598 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
c95c1465fdba059f6cbf24d1d9fd84f442c60fe4 27-Oct-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Handle critical loop predecessors by making both inside and outside registers
live out.

This doesn't prevent us from inserting a loop preheader later on, if that is
better.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117424 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
0960a650b7047373da25bee6ec2eb73889c3b7bb 27-Oct-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Compute critical loop predecessors in the same way as critical loop exits.

Critical edges going into a loop are not as bad as critical exits. We can handle
them by splitting the critical edge, or by having both inside and outside
registers live out of the predecessor.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117423 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
14e8d71cc945034d4ee6e76be00e00f14efac62f 23-Oct-2010 Andrew Trick <atrick@apple.com> This is a prototype of an experimental register allocation
framework. It's purpose is not to improve register allocation per se,
but to make it easier to develop powerful live range splitting. I call
it the basic allocator because it is as simple as a global allocator
can be but provides the building blocks for sophisticated register
allocation with live range splitting.

A minimal implementation is provided that trivially spills whenever it
runs out of registers. I'm checking in now to get high-level design
and style feedback. I've only done minimal testing. The next step is
implementing a "greedy" allocation algorithm that does some register
reassignment and makes better splitting decisions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117174 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
532de3dc6ea98387368954c0ac0e07b0adca8b62 22-Oct-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Add print methods

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117143 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
50cef5829dd8fcbda052c8fb702483c6212f803b 15-Oct-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Remove unused accessor.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116580 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
9d5d48bc41b182a1b76b1df25069ad4fb6fc45a7 15-Oct-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Eliminate curli from SplitEditor. Use the LiveRangeEdit reference instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116547 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
a17768f5822ab62bc18608e5ba473187bf726b84 15-Oct-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Create a new LiveRangeEdit class to keep track of the new registers created when
splitting or spillling, and to help with rematerialization.

Use LiveRangeEdit in InlineSpiller and SplitKit. This will eventually make it
possible to share remat code between InlineSpiller and SplitKit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116543 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
7466927b1af264b359c860cb9f7d1f3b275cc5cd 09-Oct-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Rename SplitEditor::rewrite to finish() and break it out into a couple of new
functions: computeRemainder and rewrite.

When the remainder breaks up into multiple components, remember to rewrite those
uses as well.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116121 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
fc3ef3c2e9e1a01f19aaf1e362d8d2f209c09a46 06-Oct-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Remove SplitAnalysis::removeUse. It was only used to make SplitAnalysis
reusable, but that is no longer relevant since a split will always replace the
original.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115709 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
57d0f2deb0afefe69770a28937a4363e7b1f9753 06-Oct-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Update SplitEditor API to reflect the fact that the original live interval is
never kept after splitting.

Keeping the original interval made sense when the split region doesn't modify
the register, and the original is spilled. We can get the same effect by
detecting reloaded values when spilling around copies.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115695 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
fc60d7729bb5b63b7d61e370e51bd05e9a18b8bc 05-Oct-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Don't use nextIndex to check for live out of instruction.
Insert copy after defining instruction.

Fix LiveIntervalMap::extendTo to properly handle live segments starting before
the current basic block.

Make sure the open live range is extended to the inserted copy's use slot.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115665 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
5fa42a45a1845046dde84089fb4d8e1e1b329b65 22-Sep-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Build the complement interval dupli after the split intervals instead of
creating it before and subtracting split ranges.

This way, the SSA update code in LiveIntervalMap can properly create and use new
phi values in dupli. Now it is possible to create split regions where a value
escapes along two different CFG edges, creating phi values outside the split
region.

This is a work in progress and probably quite broken.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114492 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
f6a129a24b866635c3c51edf08749755f952b5f2 16-Sep-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Use the value mapping provided by LiveIntervalMap. This simplifies the code a
great deal because we don't have to worry about maintaining SSA form.

Unconditionally copy back to dupli when the register is live out of the split
range, even if the live-out value was defined outside the range. Skipping the
back-copy only makes sense when the live range is going to spill outside the
split range, and we don't know that it will. Besides, this was a hack to avoid
SSA update issues.

Clear up some confusion about the end point of a half-open LiveRange. Methinks
LiveRanges need to be closed so both start and end are included in the range.
The low bits of a SlotIndex are symbolic, so a half-open range doesn't really
make sense. This would be a pervasive change, though.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114043 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
dd9f3fdc77b77b10710c27050d508d7c7fb40c25 14-Sep-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Mechanically replace LiveInterval* with LiveIntervalMap for intervals being
edited without actually using LiveIntervalMap functionality.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113816 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
9ca2aeb2d223d11fd01b0bb8f13fe7f3a969714d 14-Sep-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Allow LiveIntervalMap to be reused by resetting the current live interval.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113815 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
ff3ae8691c18c4c40d09fb21ecac880aea9a536b 18-Aug-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Thinking about it, we don't need MachineDominatorTree after all. The DomValue
map discovers the iterated dominance frontier for free.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111400 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
1407c84242688dbcdbaa5b0296c18f46d102f25a 18-Aug-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Add the LiveIntervalMap class. Don't hook it up yet.

LiveIntervalMap maps values from a parent LiveInterval to a child interval that
is a strict subset. It will create phi-def values as needed to preserve the
VNInfo SSA form in the child interval.

This leads to an algorithm very similar to the one in SSAUpdaterImpl.h, but with
enough differences that the code can't be reused:

- We don't need to manipulate PHI instructions.
- LiveIntervals have kills.
- We have MachineDominatorTree.
- We can use df_iterator.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111393 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
0a2b2a1497a77f1db281d4dc9f21d01fe48f6ec6 14-Aug-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Clean up the Spiller.h interface.

The earliestStart argument is entirely specific to linear scan allocation, and
can be easily calculated by RegAllocLinearScan.

Replace std::vector with SmallVector.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111055 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
fc412d85c46a8656361fe1e9197ea85922e2cd61 13-Aug-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Implement splitting inside a single block.

When a live range is contained a single block, we can split it around
instruction clusters. The current approach is very primitive, splitting before
and after the largest gap between uses.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111043 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
2dee7a527b083e259f9e826c57c1e5dab9540798 13-Aug-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Update the SplitAnalysis statistics as uses are moved from curli to the new
split intervals. THis means the analysis can be used for multiple splits as long
as curli doesn't shrink.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110975 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
f1b05f2b0ef48cb80b064e2f792b38c626822fc0 12-Aug-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Implement single block splitting.

Before spilling a live range, we split it into a separate range for each basic
block where it is used. That way we only get one reload per basic block if the
new smaller ranges can allocate to a register.

This type of splitting is already present in the standard spiller.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110934 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
08e93b14c37277ab40b835de340f89ba357d3332 10-Aug-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Recalculate the spill weight and allocation hint for virtual registers created
during live range splitting.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110686 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
5eb308b9448ee5b14fac26c0533eac481bc28471 07-Aug-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Lazily defer duplicating the live interval we are splitting until we know it is
necessary.

Sometimes, live range splitting doesn't shrink the current interval, but simply
changes some instructions to use a new interval. That makes the original more
suitable for spilling. In this case, we don't need to duplicate the original.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110481 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
7536f72a97ad25c3652fdfe26d392fd78b6ea7b9 05-Aug-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Checkpoint SplitKit progress.

We are now at a point where we can split around simple single-entry, single-exit
loops, although still with some bugs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110257 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
f0179004e94259a8adab6c48f295ea9ab18af4c3 27-Jul-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Add SplitEditor to SplitKit. This class will be used to edit live intervals and
rewrite instructions for live range splitting.

Still work in progress.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109469 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
f2c6e367c1c0d8797e62e58a3ccdb8cceee27987 21-Jul-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Change the createSpiller interface to take a MachineFunctionPass argument.

The spillers can pluck the analyses they need from the pass reference.

Switch some never-null pointers to references.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108969 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
6a0dc079efe7acf7e71cc4c0948fe814f35ba091 20-Jul-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Implement loop splitting analysis.
Determine which loop exit blocks need a 'pre-exit' block inserted.
Recognize when this would be impossible.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108941 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
abff28087fd6be8150ff0e69def7de7312b2f76b 20-Jul-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Appease the colonials.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108845 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/SplitKit.h
8ae0263471cc29c5f8278ee1ea5b678042ec6dce 20-Jul-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Beginning SplitKit - utility classes for live range splitting.

This is a work in progress. So far we have some basic loop analysis to help
determine where it is useful to split a live range around a loop.

The actual loop splitting code from Splitter.cpp is also going to move in here.

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