aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/SlotIndexes.cpp
AgeCommit message (Collapse)AuthorFilesLines
2014-04-22[Modules] Remove potential ODR violations by sinking the DEBUG_TYPEChandler Carruth1-2/+2
define below all header includes in the lib/CodeGen/... tree. While the current modules implementation doesn't check for this kind of ODR violation yet, it is likely to grow support for it in the future. It also removes one layer of macro pollution across all the included headers. Other sub-trees will follow. llvm-svn: 206837
2014-04-14[C++11] More 'nullptr' conversion. In some cases just using a boolean check ↵Craig Topper1-4/+4
instead of comparing to nullptr. llvm-svn: 206142
2014-03-02[C++11] Replace llvm::next and llvm::prior with std::next and std::prev.Benjamin Kramer1-1/+1
Remove the old functions. llvm-svn: 202636
2013-02-23Make some fixes for LiveInterval repair with debug info. Debug valueCameron Zwarich1-1/+1
MachineInstrs don't have a slot index. llvm-svn: 175961
2013-02-20Find anchoring end points for repairIntervalsInRange and repairIndexesInRangeCameron Zwarich1-0/+9
automatically. llvm-svn: 175673
2013-02-20Add SlotIndexes::repairIndexesInRange(), which repairs SlotIndexes after addingCameron Zwarich1-0/+61
and removing instructions. The implementation seems more complicated than it needs to be, but I couldn't find something simpler that dealt with all of the corner cases. Also add a call to repairIndexesInRange() from repairIntervalsInRange(). llvm-svn: 175601
2012-09-11Release build: guard dump functions withManman Ren1-2/+2
"#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)" No functional change. Update r163339. llvm-svn: 163653
2012-09-06Release build: guard dump functions with "ifndef NDEBUG"Manman Ren1-0/+4
No functional change. llvm-svn: 163339
2012-04-25Remove more dead code.Jakob Stoklund Olesen1-3/+0
llvm-svn: 155566
2012-04-17SlotIndexes used to store the index list in a crufty custom linked-list. I can'tLang Hames1-27/+25
for the life of me remember why I wrote it this way, but I can't see any good reason for it now. This patch replaces the custom linked list with an ilist. This change should preserve the existing numberings exactly, so no generated code should change (if it does, file a bug!). llvm-svn: 154904
2012-01-24Use the standard MachineFunction::print() after SlotIndexes.Jakob Stoklund Olesen1-1/+1
llvm-svn: 148878
2011-11-13Rename SlotIndexes to match how they are used.Jakob Stoklund Olesen1-4/+6
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. llvm-svn: 144503
2011-04-02Use basic block numbers as indexes when mapping slot index ranges.Jakob Stoklund Olesen1-11/+9
This is more compact and faster than using DenseMap. llvm-svn: 128763
2011-03-04Renumber slot indexes locally when possible.Jakob Stoklund Olesen1-2/+25
Initially, slot indexes are quad-spaced. There is room for inserting up to 3 new instructions between the original instructions. When we run out of indexes between two instructions, renumber locally using double-spaced indexes. The original quad-spacing means that we catch up quickly, and we only have to renumber a handful of instructions to get a monotonic sequence. This is much faster than renumbering the whole function as we did before. llvm-svn: 127023
2011-03-04Number SlotIndexes uniformly without looking at the number of defs on each ↵Jakob Stoklund Olesen1-24/+5
instruction. You can't really predict how many indexes will be needed from the number of defs, so let's keep it simple. Also remove an extra empty index that was inserted after each basic block. It was intended for live-out ranges, but it was never used that way. llvm-svn: 127014
2011-03-04Add SlotIndex statistics.Jakob Stoklund Olesen1-0/+4
llvm-svn: 127007
2011-03-03Renumber slot indexes uniformly instead of spacing according to the number ↵Jakob Stoklund Olesen1-15/+1
of defs. There are probably much larger speedups to be had by renumbering locally instead of looping over the whole function. For now, the greedy register allocator is 25% faster. llvm-svn: 126926
2011-03-03Represent sentinel slot indexes with a null pointer.Jakob Stoklund Olesen1-31/+0
This is much faster than using a pointer to a ManagedStatic object accessed with a function call. The greedy register allocator is 5% faster overall just from the SlotIndex default constructor savings. llvm-svn: 126925
2011-02-03Tweak debug output from SlotIndexes.Jakob Stoklund Olesen1-1/+5
llvm-svn: 124814
2010-11-11Insert two blank SlotIndexes between basic blocks instead of just one.Jakob Stoklund Olesen1-2/+6
This is the first small step towards using closed intervals for liveness instead of the half-open intervals we're using now. We want to be able to distinguish between a SlotIndex that represents a variable being live-out of a basic block, and an index representing a variable live-in to its successor. That requires two separate indexes between blocks. One for live-outs and one for live-ins. With this change, getMBBEndIdx(MBB).getPrevSlot() becomes stable so it stays greater than any instructions inserted at the end of MBB. llvm-svn: 118747
2010-10-07Now with fewer extraneous semicolons!Owen Anderson1-1/+1
llvm-svn: 115996
2010-09-25Remove SlotIndex::PHI_BIT. It is no longer used by anything.Jakob Stoklund Olesen1-5/+1
llvm-svn: 114779
2010-09-24Terminator gaps were unused. Might as well delete them.Jakob Stoklund Olesen1-16/+1
llvm-svn: 114776
2010-07-21Fix batch of converting RegisterPass<> to INTIALIZE_PASS().Owen Anderson1-1/+2
llvm-svn: 109045
2010-06-24Print the LSBs of a SlotIndex symbolically using letters referring to theJakob Stoklund Olesen1-1/+3
[L]oad, [u]se, [d]ef, or [S]tore slots. This makes it easier to see if two indices refer to the same instruction, avoiding mental mod 4 calculations. llvm-svn: 106766
2010-02-10Fix "the the" and similar typos.Dan Gohman1-1/+1
llvm-svn: 95781
2010-02-09move target-independent opcodes out of TargetInstrInfoChris Lattner1-2/+2
into TargetOpcodes.h. #include the new TargetOpcodes.h into MachineInstr. Add new inline accessors (like isPHI()) to MachineInstr, and start using them throughout the codebase. llvm-svn: 95687
2010-01-22Ignore DEBUG_VALUE when building live intervals;Dale Johannesen1-0/+3
this makes the code work transparently the same whether they're there or not. llvm-svn: 94240
2010-01-05Change errs() to dbgs().David Greene1-6/+6
llvm-svn: 92589
2009-12-22Changed slot index ranges for MachineBasicBlocks to be exclusive of endpoint.Lang Hames1-5/+6
This fixes an in-place update bug where code inserted at the end of basic blocks may not be covered by existing intervals which were live across the entire block. It is also consistent with the way ranges are specified for live intervals. llvm-svn: 91859
2009-11-14Added an API to the SlotIndexes pass to allow new instructions to be ↵Lang Hames1-2/+1
inserted into the numbering. PreAllocSplitting is now using this API to insert code. llvm-svn: 88725
2009-11-10Fix DenseMap iterator constness.Jeffrey Yasskin1-1/+1
This patch forbids implicit conversion of DenseMap::const_iterator to DenseMap::iterator which was possible because DenseMapIterator inherited (publicly) from DenseMapConstIterator. Conversion the other way around is now allowed as one may expect. The template DenseMapConstIterator is removed and the template parameter IsConst which specifies whether the iterator is constant is added to DenseMapIterator. Actually IsConst parameter is not necessary since the constness can be determined from KeyT but this is not relevant to the fix and can be addressed later. Patch by Victor Zverovich! llvm-svn: 86636
2009-11-08Moved some ManagedStatics out of the SlotIndexes header.Lang Hames1-2/+28
llvm-svn: 86446
2009-11-07Update some globals to use ManagedStatic.Lang Hames1-2/+4
llvm-svn: 86342
2009-11-05Added support for renumbering existing index list elements. Removed some ↵Lang Hames1-25/+31
junk from the initial numbering code in runOnMachineFunction. llvm-svn: 86184
2009-11-04Handle empty/tombstone keys for LiveIndex more cleanly. Check for index ↵Lang Hames1-2/+2
sanity when constructing index list entries. llvm-svn: 86049
2009-11-03The Indexes Patch.Lang Hames1-0/+189
This introduces a new pass, SlotIndexes, which is responsible for numbering instructions for register allocation (and other clients). SlotIndexes numbering is designed to match the existing scheme, so this patch should not cause any changes in the generated code. For consistency, and to avoid naming confusion, LiveIndex has been renamed SlotIndex. The processImplicitDefs method of the LiveIntervals analysis has been moved into its own pass so that it can be run prior to SlotIndexes. This was necessary to match the existing numbering scheme. llvm-svn: 85979