summaryrefslogtreecommitdiff
path: root/include/llvm/CodeGen/SlotIndexes.h
Commit message (Collapse)AuthorAge
* Provide a common half-open interval map info implementation, and justChandler Carruth2012-12-27
| | | | | | | re-use that for SlotIndexes. This way other users who want half-open semantics can share the implementation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171158 91177308-0d34-0410-b5e6-96231b3b80d8
* Sort the #include lines for the include/... tree with the script.Chandler Carruth2012-12-03
| | | | | | | | | | AKA: Recompile *ALL* the source code! This one went much better. No manual edits here. I spot-checked for silliness and grep-checked for really broken edits and everything seemed good. It all still compiles. Yell if you see something that looks goofy. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169133 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a typo (the the => the)Sylvestre Ledru2012-07-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160621 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove dead infrastructure for building DenseMaps with a SlotIndex asChandler Carruth2012-07-05
| | | | | | | | the key -- they are now stored in an IntervalMap. I noticed this while looking into PR12652. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159745 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix typos found by http://github.com/lyda/misspell-checkBenjamin Kramer2012-06-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157885 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove more dead code.Jakob Stoklund Olesen2012-04-25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155566 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unused PointerLikeTypeTraits for IndexListEntry.Benjamin Kramer2012-04-21
| | | | | | | | | It set NumLowBitAvailable = 3 which may not be true on all platforms. We only ever use 2 bits (the default) so this assumption can be safely removed Should fix PR12612. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155288 91177308-0d34-0410-b5e6-96231b3b80d8
* Unbreak the MSVC build, that next() thing again.Francois Pichet2012-04-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154916 91177308-0d34-0410-b5e6-96231b3b80d8
* SlotIndexes used to store the index list in a crufty custom linked-list. I can'tLang Hames2012-04-17
| | | | | | | | | | | | 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!). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154904 91177308-0d34-0410-b5e6-96231b3b80d8
* Move getBundleStart() into MachineInstrBundle.h.Jakob Stoklund Olesen2012-03-01
| | | | | | | | | This allows the function to be inlined, and makes it suitable for use in getInstructionIndex(). Also provide a const version. C++ is great for touch typing practice. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151782 91177308-0d34-0410-b5e6-96231b3b80d8
* Instructions inside a bundle have the same number as the bundle itself.Jakob Stoklund Olesen2012-02-28
| | | | | | | | | | SlotIndexes are not assigned to instructions inside bundles, but it is still valid to look up the index of those instructions. The reverse getInstructionFromIndex() will return the first instruction in the bundle. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151672 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a check to make sure we don't assign slot indexes for instructions ↵Lang Hames2012-02-15
| | | | | | inside bundles. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150564 91177308-0d34-0410-b5e6-96231b3b80d8
* Drop ZeroIndex and InvalidIndex.Jakob Stoklund Olesen2012-02-04
| | | | | | | They are not used any more. Simply use SlotIndex() to get an invalid index. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149727 91177308-0d34-0410-b5e6-96231b3b80d8
* Detect when a value is undefined on an edge to a landing pad.Jakob Stoklund Olesen2012-01-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Consider this code: int h() { int x; try { x = f(); g(); } catch (...) { return x+1; } return x; } The variable x is undefined on the first edge to the landing pad, but it has the f() return value on the second edge to the landing pad. SplitAnalysis::getLastSplitPoint() would assume that the return value from f() was live into the landing pad when f() throws, which is of course impossible. Detect these cases, and treat them as if the landing pad wasn't there. This allows spill code to be inserted after the function call to f(). <rdar://problem/10664933> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147912 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify more DenseMap.find users.Benjamin Kramer2012-01-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147550 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename SlotIndexes to match how they are used.Jakob Stoklund Olesen2011-11-13
| | | | | | | | | | | | | | | | | | | | 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
* Fix typo.Nick Lewycky2011-09-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140807 91177308-0d34-0410-b5e6-96231b3b80d8
* Extract parts of RAGreedy::splitAroundRegion as SplitKit methods.Jakob Stoklund Olesen2011-07-15
| | | | | | | | | | | 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
* Remove an unused variable in NDEBUG (found with -Wunused-variable).Chandler Carruth2011-05-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130688 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a SlotIndexes::insertMachineInstrInMaps to insert the instruction after ↵Jakob Stoklund Olesen2011-05-02
| | | | | | | | | | any null indexes. This makes a difference if a live interval is referring to a deleted instruction. It can be important to insert an instruction before or after a deleted instruction to avoid interference. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130686 91177308-0d34-0410-b5e6-96231b3b80d8
* Skip a binary search when possible.Jakob Stoklund Olesen2011-04-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129293 91177308-0d34-0410-b5e6-96231b3b80d8
* Use std::unique instead of a SmallPtrSet to ensure unique instructions in ↵Jakob Stoklund Olesen2011-04-05
| | | | | | | | | | | 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
* Stop caching basic block index ranges now that SlotIndexes can keep up.Jakob Stoklund Olesen2011-04-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128821 91177308-0d34-0410-b5e6-96231b3b80d8
* Use basic block numbers as indexes when mapping slot index ranges.Jakob Stoklund Olesen2011-04-02
| | | | | | This is more compact and faster than using DenseMap. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128763 91177308-0d34-0410-b5e6-96231b3b80d8
* Renumber slot indexes locally when possible.Jakob Stoklund Olesen2011-03-04
| | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127023 91177308-0d34-0410-b5e6-96231b3b80d8
* Symbolize the default instruction distance.Jakob Stoklund Olesen2011-03-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127013 91177308-0d34-0410-b5e6-96231b3b80d8
* Deferred SlotIndex renumbering was a good idea but never used.Jakob Stoklund Olesen2011-03-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127008 91177308-0d34-0410-b5e6-96231b3b80d8
* Represent sentinel slot indexes with a null pointer.Jakob Stoklund Olesen2011-03-03
| | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126925 91177308-0d34-0410-b5e6-96231b3b80d8
* Avoid comparing invalid slot indexes, and assert that it doesn't happen.Jakob Stoklund Olesen2011-03-03
| | | | | | | The SlotIndex created by the default construction does not represent a position in the function, and it doesn't make sense to compare it to other indexes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126924 91177308-0d34-0410-b5e6-96231b3b80d8
* Optimize SlotIndex equality tests.Jakob Stoklund Olesen2011-03-03
| | | | | | | IndexListEntries have unique indexes, so it is not necessary to dereference pointers to them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126923 91177308-0d34-0410-b5e6-96231b3b80d8
* Assert if anybody tries to put a slot index on a DBG_VALUE instruction.Jakob Stoklund Olesen2011-01-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123323 91177308-0d34-0410-b5e6-96231b3b80d8
* Add SlotIndexes::getMBBRange() to get the range of a basic block in a singleJakob Stoklund Olesen2010-12-15
| | | | | | lookup. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121893 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement the first half of LiveDebugVariables.Jakob Stoklund Olesen2010-12-02
| | | | | | | | | | | | | | | | | | | Scan the MachineFunction for DBG_VALUE instructions, and replace them with a data structure similar to LiveIntervals. The live range of a DBG_VALUE is determined by propagating it down the dominator tree until a new DBG_VALUE is found. When a DBG_VALUE lives in a register, its live range is confined to the live range of the register's value. LiveDebugVariables runs before coalescing, so DBG_VALUEs are not artificially extended when registers are joined. The missing half will recreate DBG_VALUE instructions from the intervals when register allocation is complete. The pass is disabled by default. It can be enabled with the temporary command line option -live-debug-variables. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120636 91177308-0d34-0410-b5e6-96231b3b80d8
* Insert two blank SlotIndexes between basic blocks instead of just one.Jakob Stoklund Olesen2010-11-11
| | | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118747 91177308-0d34-0410-b5e6-96231b3b80d8
* Delete unused function.Jakob Stoklund Olesen2010-11-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118743 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename alignof -> alignOf to avoid irritating C++'0x compilers,Chris Lattner2010-10-30
| | | | | | | | PR8423, patch by nobled. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117774 91177308-0d34-0410-b5e6-96231b3b80d8
* Get rid of static constructors for pass registration. Instead, every pass ↵Owen Anderson2010-10-19
| | | | | | | | | | | | | | | | | | exposes an initializeMyPassFunction(), which must be called in the pass's constructor. This function uses static dependency declarations to recursively initialize the pass's dependencies. Clients that only create passes through the createFooPass() APIs will require no changes. Clients that want to use the CommandLine options for passes will need to manually call the appropriate initialization functions in PassInitialization.h before parsing commandline arguments. I have tested this with all standard configurations of clang and llvm-gcc on Darwin. It is possible that there are problems with the static dependencies that will only be visible with non-standard options. If you encounter any crash in pass registration/creation, please send the testcase to me directly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116820 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove SlotIndex::PHI_BIT. It is no longer used by anything.Jakob Stoklund Olesen2010-09-25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114779 91177308-0d34-0410-b5e6-96231b3b80d8
* Terminator gaps were unused. Might as well delete them.Jakob Stoklund Olesen2010-09-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114776 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a FIXME. The SlotIndex::Slot enum should be private.Jakob Stoklund Olesen2010-08-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110826 91177308-0d34-0410-b5e6-96231b3b80d8
* Reapply r110396, with fixes to appease the Linux buildbot gods.Owen Anderson2010-08-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110460 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r110396 to fix buildbots.Owen Anderson2010-08-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110410 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't use PassInfo* as a type identifier for passes. Instead, use the ↵Owen Anderson2010-08-05
| | | | | | | | | address of the static ID member as the sole unique type identifier. Clean up APIs related to this change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110396 91177308-0d34-0410-b5e6-96231b3b80d8
* Render MachineFunctions to HTML pages, with options to render registerLang Hames2010-07-19
| | | | | | | | | | pressure estimates and liveness alongside. Still experimental. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108698 91177308-0d34-0410-b5e6-96231b3b80d8
* Added a support for inserting new MBBs into the numbering.Lang Hames2010-07-09
| | | | | | | | | | Unlike insertMachineInstrInMaps this does not guarantee live intervals will remain correct. The caller will need to manually update intervals to account for the changes made to the CFG. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107958 91177308-0d34-0410-b5e6-96231b3b80d8
* Handle unindexed instructions in SlotIndices.Jakob Stoklund Olesen2010-07-02
| | | | | | | SlotIndexes::insertMachineInstrInMaps would crash when trying to insert an instruction imediately after an unmapped debug value. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107504 91177308-0d34-0410-b5e6-96231b3b80d8
* remove some unneeded errorhandling stuff.Chris Lattner2010-04-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100703 91177308-0d34-0410-b5e6-96231b3b80d8
* include densemap.h explicitly and rearrange #includes.Chris Lattner2010-04-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100216 91177308-0d34-0410-b5e6-96231b3b80d8
* Changed the definition of an "invalid" slot to include the empty & tombstone ↵Lang Hames2010-02-09
| | | | | | values, but not zero. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95631 91177308-0d34-0410-b5e6-96231b3b80d8
* Changed slot index ranges for MachineBasicBlocks to be exclusive of endpoint.Lang Hames2009-12-22
| | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91859 91177308-0d34-0410-b5e6-96231b3b80d8