aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/PreAllocSplitting.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Give the pre-alloc splitter access to the VirtRegMap. It doesn't do anythingOwen Anderson2009-03-141-0/+8
| | | | | | | useful with it at the moment, but it will in the future. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67012 91177308-0d34-0410-b5e6-96231b3b80d8
* (Hopefully) silence a warning.Owen Anderson2009-03-051-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66158 91177308-0d34-0410-b5e6-96231b3b80d8
* Be more careful about choosing restore points when doing restore folding. ↵Owen Anderson2009-03-051-5/+28
| | | | | | This fixes some subtle miscompilations. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66147 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a restore folder, which shaves a dozen or so machineinstrs off oggenc. ↵Owen Anderson2009-03-041-6/+75
| | | | | | Update a testcase to check this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66029 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a crash in the pre-alloc splitter exposed by recent codegen changes.Owen Anderson2009-02-201-0/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65121 91177308-0d34-0410-b5e6-96231b3b80d8
* Add TargetInstrInfo::isSafeToMoveRegisterClassDefs. It returns true if it's ↵Evan Cheng2009-02-061-1/+4
| | | | | | safe to move an instruction which defines a value in the register class. Replace pre-splitting specific IgnoreRegisterClassBarriers with this new hook. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63936 91177308-0d34-0410-b5e6-96231b3b80d8
* Pre-alloc splitting needs to be more careful to avoid inserting spills/restoresOwen Anderson2009-02-051-22/+72
| | | | | | | | between call frame setup/restore points. Unfortunately, this regresses code size a bit, but at least it's correct now! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63837 91177308-0d34-0410-b5e6-96231b3b80d8
* MergeValueInto is too smart: it might choose to do the merge the opposite ↵Owen Anderson2009-02-021-2/+18
| | | | | | | | | | direction. Live interval reconstruction needs to account for this, and scour its maps to prevent dangling references. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63558 91177308-0d34-0410-b5e6-96231b3b80d8
* Refactor PerformPHIConstruction, no functionality changes.Evan Cheng2009-02-021-125/+165
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63536 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix test failures causes by my previous commit.Owen Anderson2009-02-011-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63492 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix an issue in PHI construction that was exposed by GCC 4.2 producing a ↵Owen Anderson2009-02-011-40/+27
| | | | | | different set iteration order for the reg_iterator. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63490 91177308-0d34-0410-b5e6-96231b3b80d8
* Correct the algorithms for choosing spill and restore points so that we ↵Owen Anderson2009-01-291-2/+23
| | | | | | | | | don't try to insert loads/stores between call frame setup and the actual call. This fixes the last known failure for the pre-alloc-splitter. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63339 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix an issue where restores could be inserted after a terminator instruction,Owen Anderson2009-01-291-4/+12
| | | | | | | | | and an iterator invalidation issue. FreeBench/pifft no longer miscompiles with these fixes! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63293 91177308-0d34-0410-b5e6-96231b3b80d8
* Comments are good. :-)Owen Anderson2009-01-291-3/+30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63276 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for aggressive load-use-store folding. This takes care of the Owen Anderson2009-01-291-19/+85
| | | | | | | vast majority of code size regressions introduced by pre-alloc-splitting. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63274 91177308-0d34-0410-b5e6-96231b3b80d8
* Make the pre-split-limit option more useful by using a per-function counter.Owen Anderson2009-01-271-1/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63091 91177308-0d34-0410-b5e6-96231b3b80d8
* Reapply r63025 and r63026, with fixes for the failing testcases.Owen Anderson2009-01-261-356/+13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63049 91177308-0d34-0410-b5e6-96231b3b80d8
* Also revert r63206Bill Wendling2009-01-261-0/+321
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63041 91177308-0d34-0410-b5e6-96231b3b80d8
* Temporarily revert r63025 until the testsuite failures can be fixed.Bill Wendling2009-01-261-12/+34
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63040 91177308-0d34-0410-b5e6-96231b3b80d8
* Get rid of a bunch of dead code now that interval reconstruction is enabled.resistor2009-01-261-321/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63026 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix an issue where LiveIntervals was trying to be smart about removing killresistor2009-01-261-34/+12
| | | | | | | | | | markers, and ended up foiling the interval reconstruction. This allows us to turn on reconstruction in the pre alloc splitter, which fixes a number of miscompilations. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63025 91177308-0d34-0410-b5e6-96231b3b80d8
* Silence a bogus compiler warning.evancheng2009-01-261-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63021 91177308-0d34-0410-b5e6-96231b3b80d8
* Some cleanups. No functional changes.resistor2009-01-241-26/+34
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62917 91177308-0d34-0410-b5e6-96231b3b80d8
* Stage two of fixing pre-alloc-splitting's code size issues: filter out ↵Owen Anderson2009-01-231-9/+37
| | | | | | | | | | | restores that are just going to be re-spilled again. This also helps performance. Pre-alloc-splitting now seems to be an overall win on SPEC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62834 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an initial pass at dead spill/restore removal for pre alloc splitting.Owen Anderson2009-01-231-4/+56
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62821 91177308-0d34-0410-b5e6-96231b3b80d8
* I accidentally removed this check in an earlier commit, which cause breakage ↵Owen Anderson2009-01-211-0/+4
| | | | | | in the pre alloc splitter. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62678 91177308-0d34-0410-b5e6-96231b3b80d8
* Be more aggressive about renumbering vregs after splitting them.Owen Anderson2009-01-211-3/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62639 91177308-0d34-0410-b5e6-96231b3b80d8
* Change TargetInstrInfo::isMoveInstr to return source and destination ↵Evan Cheng2009-01-201-3/+3
| | | | | | sub-register indices as well. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62600 91177308-0d34-0410-b5e6-96231b3b80d8
* More two-address fixes. This gets lua working with join-creation enabled.Owen Anderson2009-01-121-6/+10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62073 91177308-0d34-0410-b5e6-96231b3b80d8
* The phi construction algorithm used for interval reconstruction is ↵Owen Anderson2009-01-061-13/+27
| | | | | | | | | | | | complicated by two address instructions. We need to keep track of things we've processed AS USES independetly of whether we've processed them as defs. This fixes all known miscompilations when reconstruction is turned on. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61802 91177308-0d34-0410-b5e6-96231b3b80d8
* Get rid of sentinel insertion in interval reconstruction. It just masked theOwen Anderson2009-01-051-5/+0
| | | | | | | problem, rather than fixing it. The problem has now been fixed the right way. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61723 91177308-0d34-0410-b5e6-96231b3b80d8
* Get live interval reconstruction several steps closer to working.Owen Anderson2008-12-311-66/+86
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61514 91177308-0d34-0410-b5e6-96231b3b80d8
* Add braces, as suggested by a gcc warning.Duncan Sands2008-12-291-4/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61465 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix up kill/dead marking in the new live interval reconstruction code.Owen Anderson2008-12-281-6/+18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61460 91177308-0d34-0410-b5e6-96231b3b80d8
* Add prototype code for recomputing a live interval's ranges and valnos ↵Owen Anderson2008-12-281-1/+260
| | | | | | through recursive phi construction. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61458 91177308-0d34-0410-b5e6-96231b3b80d8
* Re-apply r61158 in a form that no longer breaks tests.Owen Anderson2008-12-181-36/+61
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61182 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r61158 for now, as it caused some test failures.Owen Anderson2008-12-171-46/+36
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61159 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix miscompilations caused by renumbering, and enable it as part of prealloc ↵Owen Anderson2008-12-171-36/+46
| | | | | | splitting. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61158 91177308-0d34-0410-b5e6-96231b3b80d8
* Add code to renumber split intervals into new vregs. This is disabled for ↵Owen Anderson2008-12-161-0/+48
| | | | | | now until I finish working out some iterator invalidation issues. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61104 91177308-0d34-0410-b5e6-96231b3b80d8
* Switch to top-down mode and fix a crasher this exposed caused by an error in theOwen Anderson2008-12-071-1/+11
| | | | | | | live interval updating. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60652 91177308-0d34-0410-b5e6-96231b3b80d8
* Factor out some common code.Owen Anderson2008-12-041-76/+39
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60553 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for folding spills into preceding defs when doing pre-alloc ↵Owen Anderson2008-12-021-27/+101
| | | | | | splitting. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60433 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for rematerialization in pre-alloc-splitting.Owen Anderson2008-11-191-3/+95
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59587 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a bug introduced by my previous patch. With this change, SPEC is now ↵Owen Anderson2008-11-181-1/+1
| | | | | | clean with prealloc splitting enabled. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59544 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't allow the restore point to be placed after terminators. With this change,Owen Anderson2008-11-131-2/+2
| | | | | | | | MultiSource/Applications is clean with the prealloc splitter. Some failures remain in SPEC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59267 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't walk into predecessors in which the vreg is not live when doing ↵Owen Anderson2008-11-111-0/+2
| | | | | | | | | shrinkwrapping. This lets several failing tests get farther along, but doesn't completely fix any of them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59086 91177308-0d34-0410-b5e6-96231b3b80d8
* Use the new predicate to control when we do prealloc splitting. Fix a small ↵Owen Anderson2008-11-051-1/+5
| | | | | | bug. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58738 91177308-0d34-0410-b5e6-96231b3b80d8
* First pass at checking for the creation of a new join point when doing ↵Owen Anderson2008-11-041-0/+73
| | | | | | pre-alloc splitting. This is not turned on yet. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58726 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert my last patch until I consult with Evan about it.Owen Anderson2008-11-031-10/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58591 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't do pre-splitting if doing so would create a value join that did notOwen Anderson2008-11-021-0/+10
| | | | | | | | | | exist before. Updating the live intervals in that care is tricky in the general case. Evan, if you see a tighter guard condition for this, let me know. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58560 91177308-0d34-0410-b5e6-96231b3b80d8