History log of /external/llvm/lib/CodeGen/LiveRangeEdit.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
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