aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/RegAllocLinearScan.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Copy coalescing change to prevent a physical register from being pin to aEvan Cheng2007-04-171-9/+22
| | | | | | | | | | | | | | long live interval that has low usage density. 1. Change order of coalescing to join physical registers with virtual registers first before virtual register intervals become too long. 2. Check size and usage density to determine if it's worthwhile to join. 3. If joining is aborted, assign virtual register live interval allocation preference field to the physical register. 4. Register allocator should try to allocate to the preferred register first (if available) to create identify moves that can be eliminated. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36218 91177308-0d34-0410-b5e6-96231b3b80d8
* First cut trivial re-materialization support.Evan Cheng2007-03-201-4/+16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35208 91177308-0d34-0410-b5e6-96231b3b80d8
* Only add liveinterval to livein set if it isn't assigned a stack slot.Evan Cheng2007-02-251-4/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34593 91177308-0d34-0410-b5e6-96231b3b80d8
* Re-apply my liveintervalanalysis changes. Now with PR1207 fixes.Evan Cheng2007-02-191-2/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34428 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR1207:Reid Spencer2007-02-191-3/+2
| | | | | | | | Revert patches that caused the problem. Evan, please investigate and reapply when you've discovered the problem. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34399 91177308-0d34-0410-b5e6-96231b3b80d8
* Do not add livein's to entry MBB twice.Evan Cheng2007-02-171-2/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34382 91177308-0d34-0410-b5e6-96231b3b80d8
* Add live-ins to every BB.Evan Cheng2007-02-161-0/+20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34342 91177308-0d34-0410-b5e6-96231b3b80d8
* Eliminate static ctors from StatisticsChris Lattner2006-12-191-9/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32698 91177308-0d34-0410-b5e6-96231b3b80d8
* Detemplatize the Statistic class. The only type it is instantiated withChris Lattner2006-12-061-2/+2
| | | | | | | is 'unsigned'. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32279 91177308-0d34-0410-b5e6-96231b3b80d8
* eliminate fp statisticChris Lattner2006-12-061-3/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32251 91177308-0d34-0410-b5e6-96231b3b80d8
* Unbreak VC++ build.Jeff Cohen2006-12-021-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32113 91177308-0d34-0410-b5e6-96231b3b80d8
* Replace std::cerr uses of the "DEBUG" macro with "DOUT" instead. RemovesBill Wendling2006-11-171-29/+27
| | | | | | | a #include of iostream. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31800 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove redundant <cmath>.Jim Laskey2006-11-081-1/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31561 91177308-0d34-0410-b5e6-96231b3b80d8
* Use correct value for float HUGH_VAL.Jim Laskey2006-11-071-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31500 91177308-0d34-0410-b5e6-96231b3b80d8
* LinearScanner hotspot.Jim Laskey2006-10-241-3/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31153 91177308-0d34-0410-b5e6-96231b3b80d8
* s|llvm/Support/Visibility.h|llvm/Support/Compiler.h|Chris Lattner2006-08-271-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29911 91177308-0d34-0410-b5e6-96231b3b80d8
* Final polish on machine pass registries.Jim Laskey2006-08-021-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29471 91177308-0d34-0410-b5e6-96231b3b80d8
* Introducing plugable register allocators and instruction schedulers.Jim Laskey2006-08-011-0/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29434 91177308-0d34-0410-b5e6-96231b3b80d8
* Reduce number of exported symbolsAndrew Lenharth2006-07-201-2/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29220 91177308-0d34-0410-b5e6-96231b3b80d8
* Shave another 27K off libllvmgcc.dylib with visibility hiddenChris Lattner2006-06-281-1/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28973 91177308-0d34-0410-b5e6-96231b3b80d8
* If the register allocator cannot find a register to spill, try the aliases. IfEvan Cheng2006-05-121-2/+19
| | | | | | | | that still fails (because all the register spill weights are inf), just grab one. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28262 91177308-0d34-0410-b5e6-96231b3b80d8
* Backing out previous check-in.Evan Cheng2006-05-111-16/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28219 91177308-0d34-0410-b5e6-96231b3b80d8
* If the live interval legnth is essentially zero, i.e. in every live rangeEvan Cheng2006-05-101-1/+15
| | | | | | | | the use follows def immediately, it doesn't make sense to spill it and hope it will be easier to allocate for this LI. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28217 91177308-0d34-0410-b5e6-96231b3b80d8
* Add some comments.Chris Lattner2006-03-251-0/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27133 91177308-0d34-0410-b5e6-96231b3b80d8
* Code cleanups, no functionality changeChris Lattner2006-02-231-23/+10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26328 91177308-0d34-0410-b5e6-96231b3b80d8
* Add explicit #includes of <iostream>Chris Lattner2006-01-221-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25515 91177308-0d34-0410-b5e6-96231b3b80d8
* HB is *the* code janitor.Duraid Madina2005-12-281-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25031 91177308-0d34-0410-b5e6-96231b3b80d8
* I think I know what you meant here, but just to be safe I'll let youDuraid Madina2005-11-211-1/+1
| | | | | | | | | do it. :) <_sabre_> excuses excuses git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24471 91177308-0d34-0410-b5e6-96231b3b80d8
* Add section switching to common code generator code. Add a couple ofChris Lattner2005-11-211-0/+1
| | | | | | | asserts. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24445 91177308-0d34-0410-b5e6-96231b3b80d8
* Expose the LiveInterval interfaces as public headers.Chris Lattner2005-09-211-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23400 91177308-0d34-0410-b5e6-96231b3b80d8
* When checking the fixed intervals, don't forget to check for register aliases.Chris Lattner2005-08-301-5/+11
| | | | | | | This fixes PR621 and Regression/CodeGen/X86/2005-08-30-RegAllocAliasProblem.ll git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23158 91177308-0d34-0410-b5e6-96231b3b80d8
* Keep track of which registers are related to which other registers.Chris Lattner2005-08-231-21/+86
| | | | | | | | | | | | | | Use this information to avoid doing expensive interval intersections for registers that could not possible be interesting. This speeds up linscan on ia64 compiling kc++ in release mode from taking 7.82s to 4.8s(!), total itanium llc time on this program is 27.3s now. This marginally speeds up PPC and X86, but they appear to be limited by other parts of linscan, not this code. On this program, on itanium, live intervals now takes 41% of llc time. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22986 91177308-0d34-0410-b5e6-96231b3b80d8
* Try to avoid scanning the fixed list. On architectures with a non-stupidChris Lattner2005-08-221-20/+55
| | | | | | | | | | | | | | number of regs (e.g. most riscs), many functions won't need to use callee clobbered registers. Do a speculative check to see if we can get a free register without processing the fixed list (which has all of these). This saves a lot of time on machines with lots of callee clobbered regs (e.g. ppc and itanium, also x86). This reduces ppc llc compile time from 184s -> 172s on kc++. This is probably worth FAR FAR more on itanium though. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22972 91177308-0d34-0410-b5e6-96231b3b80d8
* Move some code in the register assignment case that only needs to happen ifChris Lattner2005-08-221-17/+26
| | | | | | | | | we spill out of the fast path. The scan of active_ and the calls to updateSpillWeights don't need to happen unless a spill occurs. This reduces debug llc time of kc++ with ppc from 187.3s to 183.2s. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22971 91177308-0d34-0410-b5e6-96231b3b80d8
* Speed up this loop a bit, based on some observations that Nate made, andChris Lattner2005-08-221-8/+34
| | | | | | | add some comments. This loop really needs to be reevaluated! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22966 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove trailing whitespaceMisha Brukman2005-04-211-4/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21420 91177308-0d34-0410-b5e6-96231b3b80d8
* Update these register allocators to set the PhysRegUsed info in MachineFunction.Chris Lattner2005-01-231-2/+9
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19791 91177308-0d34-0410-b5e6-96231b3b80d8
* Silence VS warningsChris Lattner2005-01-081-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19385 91177308-0d34-0410-b5e6-96231b3b80d8
* Move virtual method call out of loopChris Lattner2004-12-151-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18955 91177308-0d34-0410-b5e6-96231b3b80d8
* Move virtual function call out of loop to speed up getFreePhysReg by aboutNate Begeman2004-12-071-2/+2
| | | | | | | 20%, shaving 0.1s off hbd compile time on my g5. Yay. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18592 91177308-0d34-0410-b5e6-96231b3b80d8
* * There is no reason for SpillWeights to be an instance varChris Lattner2004-11-181-69/+71
| | | | | | | | | * Do not put fixed registers into the unhandled set. This means they will never find their way into the inactive, active, or handled sets, so we can simplify a bunch of code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17945 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a couple of bugs where we considered physregs past their range as possiblyChris Lattner2004-11-181-6/+11
| | | | | | | intersecting an interval. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17939 91177308-0d34-0410-b5e6-96231b3b80d8
* Start using the iterators in the fixed_ intervals to avoid having to binaryChris Lattner2004-11-181-5/+12
| | | | | | | | search physreg intervals every time we access it. This takes another half second off of linscan. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17937 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a counter for the number of times linscan has to backtrack. Start usingChris Lattner2004-11-181-22/+36
| | | | | | | | the iterator hints we have to speed up overlaps(). This speeds linscan up by about .2s (out of 8.7) on 175.vpr for PPC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17935 91177308-0d34-0410-b5e6-96231b3b80d8
* * Improve comments/documentation substantiallyChris Lattner2004-11-181-128/+172
| | | | | | | | | | | | | | | | | | | * Eliminate the releaseMemory method, this is not an analysis * Change the fixed, active, and inactive lists of intervals to maintain an iterator for the current position in the interval. This allows us to do constant time increments of the iterator instead of having to do a binary search to find our liverange in our liveinterval all of the time, which substantially speeds up cases where LiveIntervals have many LiveRanges - which is very common for physical registers. On targets with many physregs, this can make a noticable difference. With a release build of LLC for PPC, this halves the time in processInactiveIntervals and processActiveIntervals, from 1.5s to .75s. This also lays the ground for more to come. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17933 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename some methods, use 'begin' instead of 'start', add new LiveIntervalChris Lattner2004-11-181-11/+13
| | | | | | | iterator/begin/end members. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17930 91177308-0d34-0410-b5e6-96231b3b80d8
* Do not make i have bigger scope that we needChris Lattner2004-11-051-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17483 91177308-0d34-0410-b5e6-96231b3b80d8
* Free the VirtRegMap at the end of MachineFunction processing instead of atChris Lattner2004-09-301-1/+1
| | | | | | | the beginning of processing the next one. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16605 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixes to make LLVM compile with vc7.1.Alkis Evlogimenos2004-09-031-2/+2
| | | | | | | Patch contributed by Paolo Invernizzi! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16152 91177308-0d34-0410-b5e6-96231b3b80d8
* Change the way we choose a free register: instead of picking the firstAlkis Evlogimenos2004-09-021-3/+14
| | | | | | | | | | | | | | | | | | | | | | | free allocatable register, we prefer the a free one with the most uses of inactive intervals. This causes less spills and performes a bit better compared to gcc: Program | GCC/LLC (Before)| GCC/LLC (After) 164.gzip/164.gzip | 0.59 | 0.60 175.vpr/175.vpr | 0.57 | 0.58 176.gcc/176.gcc | 0.59 | 0.61 181.mcf/181.mcf | 0.94 | 0.95 186.crafty/186.crafty | 0.62 | 0.62 197.parser/197.parser | 0.89 | 0.88 252.eon/252.eon | 0.61 | 0.66 253.perlbmk/253.perlbmk | 0.79 | 0.84 254.gap/254.gap | 0.81 | 0.81 255.vortex/255.vortex | 0.92 | 0.93 256.bzip2/256.bzip2 | 0.69 | 0.69 300.twolf/300.twolf | 0.91 | 0.90 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16147 91177308-0d34-0410-b5e6-96231b3b80d8