History log of /external/llvm/lib/CodeGen/LiveRangeEdit.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
22c310d78ce9630af15b0de94c18a409705b7496 10-Dec-2014 Tim Murray <timmurray@google.com> Revert "Revert "Bring in fixes for Cortex-A53 errata + build updates.""

This reverts commit c8db087b3b6d8767db4fa54057ac8fa448d812ca.
/external/llvm/lib/CodeGen/LiveRangeEdit.cpp
c8db087b3b6d8767db4fa54057ac8fa448d812ca 23-Oct-2014 Tim Murray <timmurray@google.com> Revert "Bring in fixes for Cortex-A53 errata + build updates."

This reverts commit 8a1773694c6d9b1277647440583811ad3d85c6a4.

bug 18094492
/external/llvm/lib/CodeGen/LiveRangeEdit.cpp
8a1773694c6d9b1277647440583811ad3d85c6a4 17-Oct-2014 Stephen Hines <srhines@google.com> Bring in fixes for Cortex-A53 errata + build updates.

Bug: 18034609

(cherry picked from commit bfc2d688b591c574c0cc788348c74545ce894efa)

Change-Id: I010fb735bb84fe97ccb8e3878f9601cb533962f4
/external/llvm/lib/CodeGen/LiveRangeEdit.cpp
dce4a407a24b04eebc6a376f8e62b41aaa7b071f 29-May-2014 Stephen Hines <srhines@google.com> Update LLVM for 3.5 rebase (r209712).

Change-Id: I149556c940fb7dc92d075273c87ff584f400941f
/external/llvm/lib/CodeGen/LiveRangeEdit.cpp
36b56886974eae4f9c5ebc96befd3e7bfe5de338 24-Apr-2014 Stephen Hines <srhines@google.com> Update to LLVM 3.5a.

Change-Id: Ifadecab779f128e62e430c2b4f6ddd84953ed617
/external/llvm/lib/CodeGen/LiveRangeEdit.cpp
095f994ba63994e8eb4b77127f9b872429496dba 11-Nov-2013 Arnaud A. de Grandmaison <arnaud.adegm@gmail.com> CalcSpillWeights: give a better describing name to calculateSpillWeights

Besides, this relates it more obviously to the VirtRegAuxInfo::calculateSpillWeightAndHint.

No functionnal change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194404 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveRangeEdit.cpp
4f3b5e8c9232e43d1291aab8db5f5698d7ee0ea4 10-Oct-2013 Matthias Braun <matze@braunis.de> Represent RegUnit liveness with LiveRange instance

Previously LiveInterval has been used, but having a spill weight and
register number is unnecessary for a register unit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192397 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveRangeEdit.cpp
5649e25ce86b9d89d228ae7c392413571b0f8c19 10-Oct-2013 Matthias Braun <matze@braunis.de> Pass LiveQueryResult by value

This makes the API a bit more natural to use and makes it easier to make
LiveRanges implementation details private.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192394 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveRangeEdit.cpp
846b31d74aa673a178f57f9d47f366d8ddb756d3 30-Aug-2013 Andrew Trick <atrick@apple.com> Use LiveRangeQuery for instruction-level liveness queries.

Remove redundant or bug-prone LiveInterval APIs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189685 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveRangeEdit.cpp
1362dcb5899bc88f0e567dd10e2e9003a79ace21 30-Aug-2013 Andrew Trick <atrick@apple.com> Replace LiveInterval::killedAt with isKilledAtInstr.

Return true for LRGs that end at EarlyClobber or Register slots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189642 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveRangeEdit.cpp
e742d687369f79702894b6cf302e1f222c5d7432 15-Aug-2013 Mark Lacey <mark.lacey@apple.com> Auto-compute live intervals on demand.

When new virtual registers are created during splitting/spilling, defer
creation of the live interval until we need to use the live interval.

Along with the recent commits to notify LiveRangeEdit when new virtual
registers are created, this makes it possible for functions like
TargetInstrInfo::loadRegFromStackSlot() and
TargetInstrInfo::storeRegToStackSlot() to create multiple virtual
registers as part of the process of generating loads/stores for
different register classes, and then have the live intervals for those
new registers computed when they are needed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188437 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveRangeEdit.cpp
03fe68e0a9c0fdd196f62899cb44b6f9a56dd7c8 15-Aug-2013 Mark Lacey <mark.lacey@apple.com> Notify LiveRangeEdit of new virtual registers.

Add a delegate class to MachineRegisterInfo with a single virtual
function, MRI_NoteNewVirtualRegister(). Update LiveRangeEdit to inherit
from this delegate class and override the definition of the callback
with an implementation that tracks the newly created virtual registers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188435 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveRangeEdit.cpp
1feb5854aeeda897e9318c8193d187673c8576b8 15-Aug-2013 Mark Lacey <mark.lacey@apple.com> Track new virtual registers by register number.

Track new virtual registers by register number, rather than by the live
interval created for them. This is the first step in separating the
creation of new virtual registers and new live intervals. Eventually
live intervals will be created and populated on demand after the virtual
registers have been created and used in instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188434 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveRangeEdit.cpp
1c6d387dc90fba589f8effb17c72a39f966f87df 14-Aug-2013 Jakob Stoklund Olesen <stoklund@2pi.dk> Remove unnecessary parameter to RenumberValues.

Patch by Matthias Braun!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188393 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveRangeEdit.cpp
529616299f109f58e2a8217a1a760ba961266459 22-Jun-2013 Andrew Trick <atrick@apple.com> Prevent LiveRangeEdit from deleting bundled instructions.

We have no targets on trunk that bundle before regalloc. However, we
have been advertising regalloc as bundle safe for use with out-of-tree
targets. We need to at least contain the parts of the code that are
still unsafe.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184620 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveRangeEdit.cpp
03dca5e4b6c41e1e7fa4edad3d7ff8d5f6de7008 21-Jun-2013 Andrew Trick <atrick@apple.com> Handle more cases in LiveRangeEdit::eliminateDeadDefs.

Live intervals for dead physregs may be created during coalescing. We
need to update these in the event that their instruction goes away.

crash.ll is the unit test that catches it when MI sched is enabled on
X86.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184572 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveRangeEdit.cpp
f1f99f394f367845c4f4528d4d2bce42e65a5f50 21-Jun-2013 Andrew Trick <atrick@apple.com> Refactor LiveRangeEdit::eliminateDeadDefs.

I want to add logic to handle more cases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184571 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveRangeEdit.cpp
005622ffae7e6386c27a65a8789bb8d0d773f5d8 21-Jun-2013 Andrew Trick <atrick@apple.com> whitespace

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184570 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveRangeEdit.cpp
4eed756153b84c211114a3e9186bf0cb55d4b394 17-Jun-2013 Benjamin Kramer <benny.kra@googlemail.com> Switch spill weights from a basic loop depth estimation to BlockFrequencyInfo.

The main advantages here are way better heuristics, taking into account not
just loop depth but also __builtin_expect and other static heuristics and will
eventually learn how to use profile info. Most of the work in this patch is
pushing the MachineBlockFrequencyInfo analysis into the right places.

This is good for a 5% speedup on zlib's deflate (x86_64), there were some very
unfortunate spilling decisions in its hottest loop in longest_match(). Other
benchmarks I tried were mostly neutral.

This changes register allocation in subtle ways, update the tests for it.
2012-02-20-MachineCPBug.ll was deleted as it's very fragile and the instruction
it looked for was gone already (but the FileCheck pattern picked up unrelated
stuff).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184105 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveRangeEdit.cpp
c2248b0e7895446cccf934b57c6aa3aa712e20d1 19-Mar-2013 Jakub Staszak <kubastaszak@gmail.com> Add some constantness.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177356 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveRangeEdit.cpp
d04a8d4b33ff316ca4cf961e06c9e312eff8e64f 03-Dec-2012 Chandler Carruth <chandlerc@gmail.com> Use the new script to sort the includes of every file under lib.

Sooooo many of these had incorrect or strange main module includes.
I have manually inspected all of these, and fixed the main module
include to be the nearest plausible thing I could find. If you own or
care about any of these source files, I encourage you to take some time
and check that these edits were sensible. I can't have broken anything
(I strictly added headers, and reordered them, never removed), but they
may not be the headers you'd really like to identify as containing the
API being implemented.

Many forward declarations and missing includes were added to a header
files to allow them to parse cleanly when included first. The main
module rule does in fact have its merits. =]

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169131 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveRangeEdit.cpp
1ead68d769f27f6d68d4aaeffe4199fa2cacbc95 28-Nov-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Make the LiveRegMatrix analysis available to targets.

No functional change, just moved header files.

Targets can inject custom passes between register allocation and
rewriting. This makes it possible to tweak the register allocation
before rewriting, using the full global interference checking available
from LiveRegMatrix.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168806 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveRangeEdit.cpp
320db3f8052c9f506d9ea043ba5da534df40aa08 17-Oct-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Avoid rematerializing a redef immediately after the old def.

PR14098 contains an example where we would rematerialize a MOV8ri
immediately after the original instruction:

%vreg7:sub_8bit<def> = MOV8ri 9; GR32_ABCD:%vreg7
%vreg22:sub_8bit<def> = MOV8ri 9; GR32_ABCD:%vreg7

Besides being pointless, it is also wrong since the original instruction
only redefines part of the register, and the value read by the new
instruction is wrong.

The problem was the LiveRangeEdit::allUsesAvailableAt() didn't
special-case OrigIdx == UseIdx and found the wrong SSA value.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166068 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveRangeEdit.cpp
790047620a8f31cee1841c06c9e5e7688166ad93 16-Oct-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Remove LIS::isAllocatable() and isReserved() helpers.

All callers can simply use the corresponding MRI functions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165985 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveRangeEdit.cpp
ddc26d89362330995f59ad29eb8bb439a817050b 27-Sep-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Avoid dereferencing a NULL pointer.

Fixes PR13943.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164778 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveRangeEdit.cpp
e2b83ab056836067e2c86ef22223a4c29fe267ce 02-Aug-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Avoid creating dangling physreg live ranges during DCE.

LiveRangeEdit::eliminateDeadDefs() can delete a dead instruction that
reads unreserved physregs. This would leave the corresponding regunit
live interval dangling because we don't have shrinkToUses() for physical
registers.

Fix this problem by turning the instruction into a KILL instead of
deleting it. This happens in a landing pad in
test/CodeGen/X86/2012-05-19-CoalescerCrash.ll:

%vreg27<def,dead> = COPY %EDX<kill>; GR32:%vreg27

becomes:

KILL %EDX<kill>

An upcoming fix to the machine verifier will catch problems like this by
verifying regunit live intervals.

This fixes PR13498. I am not including the test case from the PR since
we already have one exposing the problem once the verifier is fixed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161182 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveRangeEdit.cpp
2ec0cda5d5ede57022eb7dc5e7170f4fa420cb2b 20-Jul-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Avoid folding loads that are unsafe to move.

LiveRangeEdit::foldAsLoad() can eliminate a register by folding a load
into its only use. Only do that when the load is safe to move, and it
won't extend any live ranges.

This fixes PR13414.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160575 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveRangeEdit.cpp
834a9cdbb78c1a16c8ceecb018a324a3ba31c365 22-Jun-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Use MRI::isConstantPhysReg() to check remat feasibility.

Don't depend on LiveIntervals::hasInterval() to determine if a physreg
is reserved and constant.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159013 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveRangeEdit.cpp
76ff7418361c1c80ce9d018bce63511a70bd7390 22-May-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Only erase virtregs with no uses left.

Also make sure registers aren't erased twice if the dead def mentions
the register twice.

This fixes PR12911.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157254 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveRangeEdit.cpp
7ebed91fddbcd259d03c4b438719ac1ce2a4fc87 20-May-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Fix 12892.

Dead code elimination during coalescing could cause a virtual register
to be split into connected components. The following rewriting would be
confused about the already joined copies present in the code, but
without a corresponding value number in the live range.

Erase all joined copies instantly when joining intervals such that the
MI and LiveInterval representations are always in sync.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157135 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveRangeEdit.cpp
20942dcd8634ad75091fe89669868cfebf74e869 19-May-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Allow LiveRangeEdit to be created with a NULL parent.

The dead code elimination with callbacks is still useful.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157100 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveRangeEdit.cpp
c696c8bd35a8ab293879e821142dd9136201f16e 19-May-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Modernize naming convention for class members.

No functional change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157079 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveRangeEdit.cpp
dda3a099a096588d435fdb855b52b0a203316de2 04-Apr-2012 Pete Cooper <peter_cooper@apple.com> Removed one last bad continue statement meant to be removed in r153914.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153975 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveRangeEdit.cpp
2e267ae7b8caf7192a3793eb3b78937ff83f794d 03-Apr-2012 Pete Cooper <peter_cooper@apple.com> Fixes to r153903. Added missing explanation of behaviour when the VirtRegMap is NULL. Also changed it in this case to just avoid updating the map, but live ranges or intervals will still get updated and created

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153914 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveRangeEdit.cpp
789d5d85ba6e9259a8e0f0bcfbd06a59ad164512 03-Apr-2012 Pete Cooper <peter_cooper@apple.com> Moved LiveRangeEdit.h so that it can be called from other parts of the backend, not just libCodeGen

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153906 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveRangeEdit.cpp
8a06af96698537377275dd7848db69915638dd26 03-Apr-2012 Pete Cooper <peter_cooper@apple.com> Refactored the LiveRangeEdit interface so that MachineFunction, TargetInstrInfo, MachineRegisterInfo, LiveIntervals, and VirtRegMap are all passed into the constructor and stored as members instead of passed in to each method.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153903 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveRangeEdit.cpp
1485455be0310c6b24f096823029e08867531016 28-Feb-2012 Lang Hames <lhames@gmail.com> Kill off LiveRangeEdit::getNewVRegs and LiveRangeEdit::getUselessVRegs. These
methods are no longer needed now that LinearScan has gone away.

(Contains tweaks trivialSpillEverywhere to enable the removal of getNewVRegs).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151658 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveRangeEdit.cpp
7842a741eb0e1baa35af8c3bb5884655c1edaa9e 17-Feb-2012 Jim Grosbach <grosbach@apple.com> Tidy up.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150820 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveRangeEdit.cpp
2d24e2a396a1d211baaeedf32148a3b657240170 20-Dec-2011 David Blaikie <dblaikie@gmail.com> Unweaken vtables as per http://llvm.org/docs/CodingStandards.html#ll_virtual_anch

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146960 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveRangeEdit.cpp
4777ebb767d1b590c05d502c4a7f6adef4e6d5d1 12-Dec-2011 Pete Cooper <peter_cooper@apple.com> Fixed register allocator splitting a live range on a spilling variable.

If we create new intervals for a variable that is being spilled, then those new intervals are not guaranteed to also spill. This means that anything reading from the original spilling value might not get the correct value if spills were missed.

Fixes <rdar://problem/10546864>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146428 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveRangeEdit.cpp
5a96b3dad2f634c9081c8b2b6c2575441dc5a2bd 07-Dec-2011 Evan Cheng <evan.cheng@apple.com> Add bundle aware API for querying instruction properties and switch the code
generator to it. For non-bundle instructions, these behave exactly the same
as the MC layer API.

For properties like mayLoad / mayStore, look into the bundle and if any of the
bundled instructions has the property it would return true.
For properties like isPredicable, only return true if *all* of the bundled
instructions have the property.
For properties like canFoldAsLoad, isCompare, conservatively return false for
bundles.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146026 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveRangeEdit.cpp
2debd48ca790ac01be6e12e094fdf4fdcadc8364 13-Nov-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Rename SlotIndexes to match how they are used.

The old naming scheme (load/use/def/store) can be traced back to an old
linear scan article, but the names don't match how slots are actually
used.

The load and store slots are not needed after the deferred spill code
insertion framework was deleted.

The use and def slots don't make any sense because we are using
half-open intervals as is customary in C code, but the names suggest
closed intervals. In reality, these slots were used to distinguish
early-clobber defs from normal defs.

The new naming scheme also has 4 slots, but the names match how the
slots are really used. This is a purely mechanical renaming, but some
of the code makes a lot more sense now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144503 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveRangeEdit.cpp
6d1fd0b979cb88809ebb77a24f4da69e1d67606b 09-Aug-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Move CalculateRegClass to MRI::recomputeRegClass.

This function doesn't have anything to do with spill weights, and MRI
already has functions for manipulating the register class of a virtual
register.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137123 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveRangeEdit.cpp
9693d4c3f0d0e8c91e4748eb1c18799b1de7551c 05-Jul-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Fix PR10277.

Remat during spilling triggers dead code elimination. If a phi-def
becomes unused, that may also cause live ranges to split into separate
connected components.

This type of splitting is different from normal live range splitting. In
particular, there may not be a common original interval.

When the split range is its own original, make sure that the new
siblings are also their own originals. The range being split cannot be
used as an original since it doesn't cover the new siblings.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134413 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveRangeEdit.cpp
e9bd4ea5fda4957c373a3bbc14803d9670041dcc 05-May-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Add some statistics to the splitting and spilling frameworks.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130931 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveRangeEdit.cpp
bb30dd40ed0873e39fec4dfa321091a0c8d1abfc 02-May-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Minimize the slot indexes spanned by register ranges created when splitting.

When an interfering live range ends at a dead slot index between two
instructions, make sure that the inserted copy instruction gets a slot index
after the dead ones. This makes it possible to avoid the interference.

Ideally, there shouldn't be interference ending at a deleted instruction, but
physical register coalescing can sometimes do that to sub-registers.

This fixes PR9823.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130687 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveRangeEdit.cpp
3b7d917dec53a742fcb14802557ee75d35185968 21-Apr-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Add debug output for rematerializable instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129883 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveRangeEdit.cpp
806562cc59ad35e6c742abe9109e9b8090b3f820 15-Apr-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Remember to set flag.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129579 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveRangeEdit.cpp
1edc3cf65d54130542fc91bac67ecf616ef88d48 11-Apr-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Don't shrink live ranges after dead code elimination unless it is going to help.

In particular, don't repeatedly recompute the PIC base live range after rematerialization.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129275 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveRangeEdit.cpp
3520019931c2bad615c35edcb943cd1e8582ebac 05-Apr-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> When dead code elimination removes all but one use, try to fold the single def into the remaining use.

Rematerialization can leave single-use loads behind that we might as well fold whenever possible.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128918 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveRangeEdit.cpp
f22ca3fe5f0cfbb832cf41270f97cf5c0134fd7b 30-Mar-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Treat clones the same as their origin.

When DCE clones a live range because it separates into connected components,
make sure that the clones enter the same register allocator stage as the
register they were cloned from.

For instance, clones may be split even when they where created during spilling.
Other registers created during spilling are not candidates for splitting or even
(re-)spilling.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128524 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveRangeEdit.cpp
6094bd87d845afabba5b99ec4848fa6116bac682 29-Mar-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Recompute register class and hint for registers created during spilling.

The spill weight is not recomputed for an unspillable register - it stays infinite.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128490 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveRangeEdit.cpp
cf610d07de3ba4929bb5d00e084877dd974b44a1 29-Mar-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Remember to use the correct register when rematerializing for snippets.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128469 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveRangeEdit.cpp
2ef661b0e8de0d4186c5f9cc990adce0a2493b17 29-Mar-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Properly enable rematerialization when spilling after live range splitting.

The instruction to be rematerialized may not be the one defining the register
that is being spilled. The traceSiblingValue() function sees through sibling
copies to find the remat candidate.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128449 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveRangeEdit.cpp
1e6c65dba706de80f5a4ceb8a1fc86bc3d0a61c6 23-Mar-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Notify the delegate before removing dead values from a live interval.

The register allocator needs to know when the range shrinks.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128145 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveRangeEdit.cpp
6a3dbd3b25bbc99bd1a233d6a74ddea3493ba6ac 17-Mar-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Dead code elimination may separate the live interval into multiple connected components.

I have convinced myself that it can only happen when a phi value dies. When it
happens, allocate new virtual registers for the components.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127827 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveRangeEdit.cpp
1d5b84508173b93faf513032b3847152e6060791 16-Mar-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Add a LiveRangeEdit delegate callback before shrinking a live range.

The register allocator needs to adjust its live interval unions when that happens.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127774 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveRangeEdit.cpp
cc5c4296fda7270e8394626d7254596f5f9c8d82 16-Mar-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Erase virtual registers that are unused after DCE.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127773 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveRangeEdit.cpp
c46570dc05851395829bef904bb6ddb1260400d1 16-Mar-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Clarify debugging output.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127771 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveRangeEdit.cpp
7792e980c43536814ea42448db9799b4da32fef6 13-Mar-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Tell the register allocator about new unused virtual registers.

This allows the allocator to free any resources used by the virtual register,
including physical register assignments.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127560 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveRangeEdit.cpp
92a55f4bdd120cdd3bb5a004c792d4d24a940311 09-Mar-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Add a LiveRangeEdit::Delegate protocol.

This will we used for keeping register allocator data structures up to date
while LiveRangeEdit is trimming live intervals.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127300 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveRangeEdit.cpp
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/LiveRangeEdit.cpp
1973b3e2541f95c87e4acb7e134362ff306ec9ed 07-Mar-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Make the UselessRegs argument optional in the LiveRangeEdit constructor.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127181 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveRangeEdit.cpp
fd38917d4d040759d75e9d1f4e2c885fb40ba2d7 19-Feb-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> This method belonged in VirtRegMap.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126002 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveRangeEdit.cpp
e324f6e05ff7a157347edb48203db0250805f748 18-Feb-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Use VirtRegMap's Virt2SplitMap to keep track of the original live range before splitting.

All new virtual registers created for spilling or splitting point back to their original.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125980 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveRangeEdit.cpp
b80e973c95034e5754d888140497a9658a7c1ded 10-Nov-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Simplify the LiveRangeEdit::canRematerializeAt() interface a bit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118661 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveRangeEdit.cpp
a37d5cf3425eb93a25cc5da2bbf9b6a47c757b45 01-Nov-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Don't assign new registers created during a split to the same stack slot, but
give them individual stack slots once the are actually spilled.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117945 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveRangeEdit.cpp
f1583ae84a8eeb0f6c0f81bd5bf189bdc9eaecb2 21-Oct-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Remember to keep track of rematted values.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116962 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveRangeEdit.cpp
080c316ff8a066cd164d9a8f92df509d8cb63110 21-Oct-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Move some of the InlineSpiller rematerialization code into LiveRangeEdit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116951 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveRangeEdit.cpp
2a0180fbff4870995482d96986ad780ab9de8af4 15-Oct-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Move stack slot assignments into LiveRangeEdit.

All registers created during splitting or spilling are assigned to the same
stack slot as the parent register.

When splitting or rematting, we may not spill at all. In that case the stack
slot is still assigned, but it will be dead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116546 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveRangeEdit.cpp
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/LiveRangeEdit.cpp