summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SlotIndexes.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Remove redundant includes from lib/CodeGen.Michael Zolotukhin2017-12-131-1/+0
| | | | llvm-svn: 320619
* [CodeGen] Unify MBB reference format in both MIR and debug outputFrancis Visoiu Mistrih2017-12-041-1/+1
| | | | | | | | | | | | | | | | As part of the unification of the debug format and the MIR format, print MBB references as '%bb.5'. The MIR printer prints the IR name of a MBB only for block definitions. * find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" \) -type f -print0 | xargs -0 sed -i '' -E 's/BB#" << ([a-zA-Z0-9_]+)->getNumber\(\)/" << printMBBReference(*\1)/g' * find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" \) -type f -print0 | xargs -0 sed -i '' -E 's/BB#" << ([a-zA-Z0-9_]+)\.getNumber\(\)/" << printMBBReference(\1)/g' * find . \( -name "*.txt" -o -name "*.s" -o -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" \) -type f -print0 | xargs -0 sed -i '' -E 's/BB#([0-9]+)/%bb.\1/g' * grep -nr 'BB#' and fix Differential Revision: https://reviews.llvm.org/D40422 llvm-svn: 319665
* Target/TargetInstrInfo.h -> CodeGen/TargetInstrInfo.h to match layeringDavid Blaikie2017-11-081-1/+1
| | | | | | | | This header includes CodeGen headers, and is not, itself, included by any Target headers, so move it into CodeGen to match the layering of its implementation. llvm-svn: 317647
* Reverting r315590; it did not include changes for llvm-tblgen, which is ↵Aaron Ballman2017-10-151-2/+2
| | | | | | | | causing link errors for several people. Error LNK2019 unresolved external symbol "public: void __cdecl `anonymous namespace'::MatchableInfo::dump(void)const " (?dump@MatchableInfo@?A0xf4f1c304@@QEBAXXZ) referenced in function "public: void __cdecl `anonymous namespace'::AsmMatcherEmitter::run(class llvm::raw_ostream &)" (?run@AsmMatcherEmitter@?A0xf4f1c304@@QEAAXAEAVraw_ostream@llvm@@@Z) llvm-tblgen D:\llvm\2017\utils\TableGen\AsmMatcherEmitter.obj 1 llvm-svn: 315854
* [dump] Remove NDEBUG from test to enable dump methods [NFC]Don Hinton2017-10-121-2/+2
| | | | | | | | | | | | | | | Summary: Add LLVM_FORCE_ENABLE_DUMP cmake option, and use it along with LLVM_ENABLE_ASSERTIONS to set LLVM_ENABLE_DUMP. Remove NDEBUG and only use LLVM_ENABLE_DUMP to enable dump methods. Move definition of LLVM_ENABLE_DUMP from config.h to llvm-config.h so it'll be picked up by public headers. Differential Revision: https://reviews.llvm.org/D38406 llvm-svn: 315590
* CodeGen: Rename DEBUG_TYPE to match passnamesMatthias Braun2017-05-251-1/+1
| | | | | | | | Rename the DEBUG_TYPE to match the names of corresponding passes where it makes sense. Also establish the pattern of simply referencing DEBUG_TYPE instead of repeating the passname where possible. llvm-svn: 303921
* VirtRegMap: Correctly deal with bundles when deleting identity copies.Matthias Braun2017-03-171-0/+42
| | | | | | | | | | | | | | | | | | This fixes two problems when VirtRegMap encounters bundles: - When substituting a vreg subregister def with an actual register the internal read flag must be cleared. - Removing an identity COPY from a bundle needs to use removeFromBundle() and a newly introduced function to update SlotIndexes. No testcase here, because none of the in-tree targets trigger this, however an upcoming commit of mine will need this and the testcase there will trigger this. Differential Revision: https://reviews.llvm.org/D30925 llvm-svn: 298024
* CodeGen: Use MachineInstr& in SlotIndexes.cpp, NFCDuncan P. N. Exon Smith2016-07-011-18/+13
| | | | | | | Avoid implicit conversions from iterator to pointer by preferring MachineInstr& and using range-based for loops. llvm-svn: 274354
* CodeGen: Take MachineInstr& in SlotIndexes and LiveIntervals, NFCDuncan P. N. Exon Smith2016-02-271-6/+6
| | | | | | | | | | | | | | Take MachineInstr by reference instead of by pointer in SlotIndexes and the SlotIndex wrappers in LiveIntervals. The MachineInstrs here are never null, so this cleans up the API a bit. It also incidentally removes a few implicit conversions from MachineInstrBundleIterator to MachineInstr* (see PR26753). At a couple of call sites it was convenient to convert to a range-based for loop over MachineBasicBlock::instr_begin/instr_end, so I added MachineBasicBlock::instrs. llvm-svn: 262115
* Annotate dump() methods with LLVM_DUMP_METHOD, addressing Richard Smith ↵Yaron Keren2016-01-291-2/+2
| | | | | | | | r259192 post commit comment. clang part in r259232, this is the LLVM part of the patch. llvm-svn: 259240
* CodeGen: Continue removing ilist iterator implicit conversionsDuncan P. N. Exon Smith2015-10-091-2/+2
| | | | llvm-svn: 249884
* [llvm] Replacing asserts with static_asserts where appropriateGabor Horvath2015-03-161-1/+1
| | | | | | | | | | | | | | | | Summary: This patch consists of the suggestions of clang-tidy/misc-static-assert check. Reviewers: alexfh Reviewed By: alexfh Subscribers: xazax.hun, llvm-commits Differential Revision: http://reviews.llvm.org/D8343 llvm-svn: 232366
* [Modules] Remove potential ODR violations by sinking the DEBUG_TYPEChandler Carruth2014-04-221-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
* [C++11] More 'nullptr' conversion. In some cases just using a boolean check ↵Craig Topper2014-04-141-4/+4
| | | | | | instead of comparing to nullptr. llvm-svn: 206142
* [C++11] Replace llvm::next and llvm::prior with std::next and std::prev.Benjamin Kramer2014-03-021-1/+1
| | | | | | Remove the old functions. llvm-svn: 202636
* Make some fixes for LiveInterval repair with debug info. Debug valueCameron Zwarich2013-02-231-1/+1
| | | | | | MachineInstrs don't have a slot index. llvm-svn: 175961
* Find anchoring end points for repairIntervalsInRange and repairIndexesInRangeCameron Zwarich2013-02-201-0/+9
| | | | | | automatically. llvm-svn: 175673
* Add SlotIndexes::repairIndexesInRange(), which repairs SlotIndexes after addingCameron Zwarich2013-02-201-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
* Release build: guard dump functions withManman Ren2012-09-111-2/+2
| | | | | | | | "#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)" No functional change. Update r163339. llvm-svn: 163653
* Release build: guard dump functions with "ifndef NDEBUG"Manman Ren2012-09-061-0/+4
| | | | | | No functional change. llvm-svn: 163339
* Remove more dead code.Jakob Stoklund Olesen2012-04-251-3/+0
| | | | llvm-svn: 155566
* SlotIndexes used to store the index list in a crufty custom linked-list. I can'tLang Hames2012-04-171-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
* Use the standard MachineFunction::print() after SlotIndexes.Jakob Stoklund Olesen2012-01-241-1/+1
| | | | llvm-svn: 148878
* Rename SlotIndexes to match how they are used.Jakob Stoklund Olesen2011-11-131-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
* Use basic block numbers as indexes when mapping slot index ranges.Jakob Stoklund Olesen2011-04-021-11/+9
| | | | | | This is more compact and faster than using DenseMap. llvm-svn: 128763
* Renumber slot indexes locally when possible.Jakob Stoklund Olesen2011-03-041-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
* Number SlotIndexes uniformly without looking at the number of defs on each ↵Jakob Stoklund Olesen2011-03-041-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
* Add SlotIndex statistics.Jakob Stoklund Olesen2011-03-041-0/+4
| | | | llvm-svn: 127007
* Renumber slot indexes uniformly instead of spacing according to the number ↵Jakob Stoklund Olesen2011-03-031-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
* Represent sentinel slot indexes with a null pointer.Jakob Stoklund Olesen2011-03-031-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
* Tweak debug output from SlotIndexes.Jakob Stoklund Olesen2011-02-031-1/+5
| | | | llvm-svn: 124814
* Insert two blank SlotIndexes between basic blocks instead of just one.Jakob Stoklund Olesen2010-11-111-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
* Now with fewer extraneous semicolons!Owen Anderson2010-10-071-1/+1
| | | | llvm-svn: 115996
* Remove SlotIndex::PHI_BIT. It is no longer used by anything.Jakob Stoklund Olesen2010-09-251-5/+1
| | | | llvm-svn: 114779
* Terminator gaps were unused. Might as well delete them.Jakob Stoklund Olesen2010-09-241-16/+1
| | | | llvm-svn: 114776
* Fix batch of converting RegisterPass<> to INTIALIZE_PASS().Owen Anderson2010-07-211-1/+2
| | | | llvm-svn: 109045
* Print the LSBs of a SlotIndex symbolically using letters referring to theJakob Stoklund Olesen2010-06-241-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
* Fix "the the" and similar typos.Dan Gohman2010-02-101-1/+1
| | | | llvm-svn: 95781
* move target-independent opcodes out of TargetInstrInfoChris Lattner2010-02-091-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
* Ignore DEBUG_VALUE when building live intervals;Dale Johannesen2010-01-221-0/+3
| | | | | | | this makes the code work transparently the same whether they're there or not. llvm-svn: 94240
* Change errs() to dbgs().David Greene2010-01-051-6/+6
| | | | llvm-svn: 92589
* Changed slot index ranges for MachineBasicBlocks to be exclusive of endpoint.Lang Hames2009-12-221-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
* Added an API to the SlotIndexes pass to allow new instructions to be ↵Lang Hames2009-11-141-2/+1
| | | | | | | | inserted into the numbering. PreAllocSplitting is now using this API to insert code. llvm-svn: 88725
* Fix DenseMap iterator constness.Jeffrey Yasskin2009-11-101-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
* Moved some ManagedStatics out of the SlotIndexes header.Lang Hames2009-11-081-2/+28
| | | | llvm-svn: 86446
* Update some globals to use ManagedStatic.Lang Hames2009-11-071-2/+4
| | | | llvm-svn: 86342
* Added support for renumbering existing index list elements. Removed some ↵Lang Hames2009-11-051-25/+31
| | | | | | junk from the initial numbering code in runOnMachineFunction. llvm-svn: 86184
* Handle empty/tombstone keys for LiveIndex more cleanly. Check for index ↵Lang Hames2009-11-041-2/+2
| | | | | | sanity when constructing index list entries. llvm-svn: 86049
* The Indexes Patch.Lang Hames2009-11-031-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
OpenPOWER on IntegriCloud