summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/Spiller.h
Commit message (Collapse)AuthorAgeFilesLines
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-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
* [CodeGen] Fix some Clang-tidy modernize-use-using and Include What You Use ↵Eugene Zelenko2017-08-291-9/+11
| | | | | | warnings; other minor fixes (NFC). llvm-svn: 312053
* Commit access testPhilipp Schaad2017-07-211-1/+1
| | | | llvm-svn: 308712
* Recommit r265547, and r265610,r265639,r265657 on top of it, plusWei Mi2016-04-131-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | two fixes with one about error verify-regalloc reported, and another about live range update of phi after rematerialization. r265547: Replace analyzeSiblingValues with new algorithm to fix its compile time issue. The patch is to solve PR17409 and its duplicates. analyzeSiblingValues is a N x N complexity algorithm where N is the number of siblings generated by reg splitting. Although it causes siginificant compile time issue when N is large, it is also important for performance since it removes redundent spills and enables rematerialization. To solve the compile time issue, the patch removes analyzeSiblingValues and replaces it with lower cost alternatives containing two parts. The first part creates a new spill hoisting method in postOptimization of register allocation. It does spill hoisting at once after all the spills are generated instead of inside every instance of selectOrSplit. The second part queries the define expr of the original register for rematerializaiton and keep it always available during register allocation even if it is already dead. It deletes those dead instructions only in postOptimization. With the two parts in the patch, it can remove analyzeSiblingValues without sacrificing performance. Patches on top of r265547: r265610 "Fix the compare-clang diff error introduced by r265547." r265639 "Fix the sanitizer bootstrap error in r265547." r265657 "InlineSpiller.cpp: Escap \@ in r265547. [-Wdocumentation]" Differential Revision: http://reviews.llvm.org/D15302 Differential Revision: http://reviews.llvm.org/D18934 Differential Revision: http://reviews.llvm.org/D18935 Differential Revision: http://reviews.llvm.org/D18936 llvm-svn: 266162
* Revert r265547 "Recommit r265309 after fixed an invalid memory reference bug ↵Hans Wennborg2016-04-081-2/+2
| | | | | | | | | | | | | happened" It caused PR27275: "ARM: Bad machine code: Using an undefined physical register" Also reverting the following commits that were landed on top: r265610 "Fix the compare-clang diff error introduced by r265547." r265639 "Fix the sanitizer bootstrap error in r265547." r265657 "InlineSpiller.cpp: Escap \@ in r265547. [-Wdocumentation]" llvm-svn: 265790
* Recommit r265309 after fixed an invalid memory reference bug happenedWei Mi2016-04-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | when DenseMap growed and moved memory. I verified it fixed the bootstrap problem on x86_64-linux-gnu but I cannot verify whether it fixes the bootstrap error on clang-ppc64be-linux. I will watch the build-bot result closely. Replace analyzeSiblingValues with new algorithm to fix its compile time issue. The patch is to solve PR17409 and its duplicates. analyzeSiblingValues is a N x N complexity algorithm where N is the number of siblings generated by reg splitting. Although it causes siginificant compile time issue when N is large, it is also important for performance since it removes redundent spills and enables rematerialization. To solve the compile time issue, the patch removes analyzeSiblingValues and replaces it with lower cost alternatives containing two parts. The first part creates a new spill hoisting method in postOptimization of register allocation. It does spill hoisting at once after all the spills are generated instead of inside every instance of selectOrSplit. The second part queries the define expr of the original register for rematerializaiton and keep it always available during register allocation even if it is already dead. It deletes those dead instructions only in postOptimization. With the two parts in the patch, it can remove analyzeSiblingValues without sacrificing performance. Differential Revision: http://reviews.llvm.org/D15302 llvm-svn: 265547
* Revert r265309 and r265312 because they caused some errors I need to ↵Wei Mi2016-04-041-2/+2
| | | | | | investigate. llvm-svn: 265317
* Replace analyzeSiblingValues with new algorithm to fix its compileWei Mi2016-04-041-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | time issue. The patch is to solve PR17409 and its duplicates. analyzeSiblingValues is a N x N complexity algorithm where N is the number of siblings generated by reg splitting. Although it causes siginificant compile time issue when N is large, it is also important for performance since it removes redundent spills and enables rematerialization. To solve the compile time issue, the patch removes analyzeSiblingValues and replaces it with lower cost alternatives containing two parts. The first part creates a new spill hoisting method in postOptimization of register allocation. It does spill hoisting at once after all the spills are generated instead of inside every instance of selectOrSplit. The second part queries the define expr of the original register for rematerializaiton and keep it always available during register allocation even if it is already dead. It deletes those dead instructions only in postOptimization. With the two parts in the patch, it can remove analyzeSiblingValues without sacrificing performance. Differential Revision: http://reviews.llvm.org/D15302 llvm-svn: 265309
* Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC)Alexander Kornienko2015-06-231-1/+1
| | | | | | Apparently, the style needs to be agreed upon first. llvm-svn: 240390
* Fixed/added namespace ending comments using clang-tidy. NFCAlexander Kornienko2015-06-191-1/+1
| | | | | | | | | | | | | The patch is generated using this command: tools/clang/tools/extra/clang-tidy/tool/run-clang-tidy.py -fix \ -checks=-*,llvm-namespace-comment -header-filter='llvm/.*|clang/.*' \ llvm/lib/ Thanks to Eugene Kosov for the original patch! llvm-svn: 240137
* [RegAlloc] Kill off the trivial spiller - nobody is using it any more.Lang Hames2014-11-061-5/+0
| | | | llvm-svn: 221474
* Canonicalize header guards into a common format.Benjamin Kramer2014-08-131-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
* Unweaken vtables as per ↵David Blaikie2011-12-201-0/+1
| | | | | | http://llvm.org/docs/CodingStandards.html#ll_virtual_anch llvm-svn: 146960
* Change the Spiller interface to take a LiveRangeEdit reference.Jakob Stoklund Olesen2011-03-101-13/+3
| | | | | | | This makes it possible to register delegates and get callbacks when the spiller edits live ranges. llvm-svn: 127389
* Make SpillIs an optional pointer. Avoid creating a bunch of temporary ↵Jakob Stoklund Olesen2011-03-101-1/+1
| | | | | | SmallVectors. llvm-svn: 127388
* Force the greedy register allocator to always use the inline spiller.Jakob Stoklund Olesen2010-12-101-0/+7
| | | | | | | Soon, RegAllocGreedy will start splitting live ranges, and then deferred spilling won't work anyway. llvm-svn: 121591
* RABasic is nearly functionally complete. There are a few remainingAndrew Trick2010-11-101-1/+1
| | | | | | | | | benchmarks hitting an assertion. Adds LiveIntervalUnion::collectInterferingVRegs. Fixes "late spilling" by checking for any unspillable live vregs among all physReg aliases. llvm-svn: 118701
* In which I learn how to forward declare template classes.Jakob Stoklund Olesen2010-10-251-2/+1
| | | | llvm-svn: 117272
* Clean up the Spiller.h interface.Jakob Stoklund Olesen2010-08-131-6/+2
| | | | | | | | | The earliestStart argument is entirely specific to linear scan allocation, and can be easily calculated by RegAllocLinearScan. Replace std::vector with SmallVector. llvm-svn: 111055
* Change the createSpiller interface to take a MachineFunctionPass argument.Jakob Stoklund Olesen2010-07-201-7/+4
| | | | | | | | The spillers can pluck the analyses they need from the pass reference. Switch some never-null pointers to references. llvm-svn: 108969
* Spillers may alter MachineLoopInfo when breaking critical edges, so make itJakob Stoklund Olesen2010-07-191-1/+1
| | | | | | non-const. llvm-svn: 108734
* Add support for rematerialization to InlineSpiller.Jakob Stoklund Olesen2010-06-301-2/+2
| | | | llvm-svn: 107351
* Don't return a std::vector in the Spiller interface, but take a reference to aJakob Stoklund Olesen2010-06-241-5/+13
| | | | | | | | vector instead. This avoids needless copying and allocation. Add documentation. llvm-svn: 106788
* Added a new "splitting" spiller.Lang Hames2009-12-091-1/+3
| | | | | | | | | | | | | When a call is placed to spill an interval this spiller will first try to break the interval up into its component values. Single value intervals and intervals which have already been split (or are the result of previous splits) are spilled by the default spiller. Splitting intervals as described above may improve the performance of generated code in some circumstances. This work is experimental however, and it still miscompiles many benchmarks. It's not recommended for general use yet. llvm-svn: 90951
* Removed references to LiveStacks from Spiller.* . They're no longer needed.Lang Hames2009-11-201-2/+1
| | | | llvm-svn: 89422
* Added a new Spiller implementation which wraps ↵Lang Hames2009-11-191-2/+6
| | | | | | | | | | LiveIntervals::addIntervalsForSpills. All spiller calls in RegAllocLinearScan now go through the new Spiller interface. The "-new-spill-framework" command line option has been removed. To use the trivial in-place spiller you should now pass "-spiller=trivial -rewriter=trivial". (Note the trivial spiller/rewriter are only meant to serve as examples of the new in-place modification work. Enabling them will yield terrible, though hopefully functional, code). llvm-svn: 89311
* Fixed the in-place spiller and trivial rewriter, which had been broken by ↵Lang Hames2009-11-181-4/+0
| | | | | | the recent SlotIndexes work. llvm-svn: 89238
* Fix some minor MSVC compiler warnings.Daniel Dunbar2009-07-191-1/+1
| | | | llvm-svn: 76356
* Match declaration to definition.Daniel Dunbar2009-07-121-1/+1
| | | | llvm-svn: 75440
* More VNInfo tweaking, plus a little progress on intra-block splitting.Lang Hames2009-06-191-1/+7
| | | | llvm-svn: 73750
* VNInfo cleanup.Lang Hames2009-06-171-0/+5
| | | | llvm-svn: 73634
* Update to in-place spilling framework. Includes live interval scaling and ↵Lang Hames2009-06-021-2/+3
| | | | | | trivial rewriter. llvm-svn: 72729
* Forward decls.Bill Wendling2009-05-191-0/+3
| | | | llvm-svn: 72114
* Remove 'class' specifier.Bill Wendling2009-05-191-3/+3
| | | | llvm-svn: 72113
* Fix to compile on VS2008.Bill Wendling2009-05-191-1/+2
| | | | llvm-svn: 72112
* New Spiller interface and trivial implementation.Lang Hames2009-05-181-0/+32
| | | | llvm-svn: 72030
* Renamed Spiller classes (plus uses and related files) to VirtRegRewriter.Lang Hames2009-05-061-340/+0
| | | | llvm-svn: 71057
* It has finally happened. Spiller is now using live interval info.Evan Cheng2009-04-211-5/+8
| | | | | | This fixes a very subtle bug. vr defined by an implicit_def is allowed overlap with any register since it doesn't actually modify anything. However, if it's used as a two-address use, its live range can be extended and it can be spilled. The spiller must take care not to emit a reload for the vn number that's defined by the implicit_def. This is both a correctness and performance issue. llvm-svn: 69743
* Teach spiller to unfold instructions which modref spill slot when a scratchEvan Cheng2009-04-171-3/+16
| | | | | | | | | | | | | | | | | | | | register is available and when it's profitable. e.g. xorq %r12<kill>, %r13 addq %rax, -184(%rbp) addq %r13, -184(%rbp) ==> xorq %r12<kill>, %r13 movq -184(%rbp), %r12 addq %rax, %r12 addq %r13, %r12 movq %r12, -184(%rbp) Two more instructions, but fewer memory accesses. It can also open up opportunities for more optimizations. llvm-svn: 69341
* Oy! When reverting r68073, I added in experimental code. Sorry...Bill Wendling2009-03-311-9/+0
| | | | llvm-svn: 68099
* Revert r68073. It's causing a failure in the Apple-style builds.Bill Wendling2009-03-311-0/+9
| | | | llvm-svn: 68092
* Spiller may unfold load / mod / store instructions as an optimization when ↵Evan Cheng2009-03-171-5/+21
| | | | | | the would be loaded value is available in a register. It needs to check if it's legal to clobber the register. Also, the register can contain values of multiple spill slots, make sure to check all instead of just the one being unfolded. llvm-svn: 67068
* Reorganize some #include's.Owen Anderson2009-03-121-4/+0
| | | | llvm-svn: 66780
* Reorganization: Move the Spiller out of VirtRegMap.cpp into its own files. ↵Owen Anderson2009-03-111-0/+312
No (intended) functionality change. llvm-svn: 66720
OpenPOWER on IntegriCloud