aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/InterferenceCache.h
AgeCommit message (Collapse)AuthorFilesLines
2019-01-19Update the file headers across all of the LLVM projects in the monorepoChandler Carruth1-4/+3
to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
2017-09-22[CodeGen] Fix build bots which uses old Clang broken in r314046. (NFC)Eugene Zelenko1-1/+1
llvm-svn: 314049
2017-09-22[CodeGen] Fix some Clang-tidy modernize-use-default-member-init and Include ↵Eugene Zelenko1-33/+42
What You Use warnings; other minor fixes (NFC). llvm-svn: 314046
2015-07-01[CodeGen] Reduce visibility of implementation detailsBenjamin Kramer1-1/+1
NFC. llvm-svn: 241164
2015-03-08Make static variables const if possible. Makes them go into a read-only section.Benjamin Kramer1-2/+2
Or fold them into a initializer list which has the same effect. NFC. llvm-svn: 231598
2014-08-13Canonicalize header guards into a common format.Benjamin Kramer1-2/+2
Add header guards to files that were missing guards. Remove #endif comments as they don't seem common in LLVM (we can easily add them back if we decide they're useful) Changes made by clang-tidy with minor tweaks. llvm-svn: 215558
2014-04-16[C++11] More 'nullptr' conversion. In some cases just using a boolean check ↵Craig Topper1-9/+11
instead of comparing to nullptr. llvm-svn: 206356
2014-02-06The following patch' purpose is to reduce compile time for compilation of smallPuyan Lotfi1-2/+10
programs on targets with large register files. The root of the compile time overhead was in the use of llvm::SmallVector to hold PhysRegEntries, which resulted in slow-down from calling llvm::SmallVector::assign(N, 0). In contrast std::vector uses the faster __platform_bzero to zero out primitive buffers when assign is called, while SmallVector uses an iterator. The fix for this was simply to replace the SmallVector with a dynamically allocated buffer and to initialize or reinitialize the buffer based on the total registers that the target architecture requires. The changes support cases where a pass manager may be reused for different targets, and note that the PhysRegEntries is allocated using calloc mainly for good for, and also to quite tools like Valgrind (see comments for more info on this). There is an rdar to track the fact that SmallVector doesn't have platform specific speedup optimizations inside of it for things like this, and I'll create a bugzilla entry at some point soon as well. TL;DR: This fix replaces the expensive llvm::SmallVector<unsigned char>::assign(N, 0) with a call to calloc for N bytes which is much faster because SmallVector's assign uses iterators. llvm-svn: 200917
2013-10-10Represent RegUnit liveness with LiveRange instanceMatthias Braun1-1/+1
Previously LiveInterval has been used, but having a spill weight and register number is unnecessary for a register unit. llvm-svn: 192397
2013-09-11Revert "Give internal classes hidden visibility."Benjamin Kramer1-1/+1
It works with clang, but GCC has different rules so we can't make all of those hidden. This reverts commit r190534. llvm-svn: 190536
2013-09-11Give internal classes hidden visibility.Benjamin Kramer1-1/+1
Worth 100k on a linux/x86_64 Release+Asserts clang. llvm-svn: 190534
2012-11-28Make the LiveRegMatrix analysis available to targets.Jakob Stoklund Olesen1-1/+1
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. llvm-svn: 168806
2012-06-20Convert RAGreedy to LiveRegMatrix interference checking.Jakob Stoklund Olesen1-8/+26
Stop depending on the LiveIntervalUnions in RegAllocBase, they are about to be removed. The changes are mostly replacing register alias iterators with regunit iterators, and querying LiveRegMatrix instrad of RegAllocBase. InterferenceCache is converted to work with per-regunit LiveIntervalUnions, and it checks fixed regunit interference separately, using the fixed live intervals provided by LiveIntervalAnalysis. The local splitting helper calcGapWeights() is also considering fixed regunit interference which is kept on the side now. llvm-svn: 158867
2012-02-10Add register mask support to InterferenceCache.Jakob Stoklund Olesen1-3/+9
This makes global live range splitting behave identically with and without register mask operands. This is not necessarily the best way of using register masks for live range splitting. It would be more efficient to first split global live ranges around calls (i.e., register masks), and reserve the fine grained per-physreg interference guidance for global live ranges that do not cross calls. For now the goal is to produce identical assembly when enabling register masks. llvm-svn: 150259
2012-02-10Remove unused variable.Jakob Stoklund Olesen1-2/+1
llvm-svn: 150258
2011-07-23Allow null interference cursors to be queried.Jakob Stoklund Olesen1-1/+2
They always report 'no interference'. llvm-svn: 135843
2011-07-14Reapply r135121 with a fixed copy constructor.Jakob Stoklund Olesen1-3/+40
Original commit message: Count references to interference cache entries. Each InterferenceCache::Cursor instance references a cache entry. A non-zero reference count guarantees that the entry won't be reused for a new register. This makes it possible to have multiple live cursors examining interference for different physregs. The total number of live cursors into a cache must be kept below InterferenceCache::getMaxCursors(). Code generation should be unaffected by this change, and it doesn't seem to affect the cache replacement strategy either. llvm-svn: 135130
2011-07-14Revert r135121 which broke a gcc-4.2 builder.Jakob Stoklund Olesen1-40/+3
llvm-svn: 135122
2011-07-14Count references to interference cache entries.Jakob Stoklund Olesen1-3/+40
Each InterferenceCache::Cursor instance references a cache entry. A non-zero reference count guarantees that the entry won't be reused for a new register. This makes it possible to have multiple live cursors examining interference for different physregs. The total number of live cursors into a cache must be kept below InterferenceCache::getMaxCursors(). Code generation should be unaffected by this change, and it doesn't seem to affect the cache replacement strategy either. llvm-svn: 135121
2011-07-14Reapply r135074 and r135080 with a fix.Jakob Stoklund Olesen1-4/+8
The cache entry referenced by the best split candidate could become clobbered by an unsuccessful candidate. The correct fix here is to use reference counts on the cache entries. Coming up. llvm-svn: 135113
2011-07-13Revert r135074 and r135080. They broke clamscan.Jakob Stoklund Olesen1-8/+4
llvm-svn: 135096
2011-07-13Move the InterferenceCache cursor into the GlobalSplitCand struct.Jakob Stoklund Olesen1-4/+8
This is in preparation of supporting multiple global split candidates in a single live range split operation. llvm-svn: 135074
2011-04-09Precompute interference for neighbor blocks as long as there is no interference.Jakob Stoklund Olesen1-1/+5
This doesn't require seeking in the live interval union, so it is very cheap. llvm-svn: 129187
2011-04-02Add an InterferenceCache class for caching per-block interference ranges.Jakob Stoklund Olesen1-0/+159
When the greedy register allocator is splitting multiple global live ranges, it tends to look at the same interference data many times. The InterferenceCache class caches queries for unaltered LiveIntervalUnions. llvm-svn: 128764