aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/RegAllocLinearScan.cpp
AgeCommit message (Collapse)Author
2006-10-24LinearScanner hotspot.Jim Laskey
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31153 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-27s|llvm/Support/Visibility.h|llvm/Support/Compiler.h|Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29911 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-02Final polish on machine pass registries.Jim Laskey
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29471 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-01Introducing plugable register allocators and instruction schedulers.Jim Laskey
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29434 91177308-0d34-0410-b5e6-96231b3b80d8
2006-07-20Reduce number of exported symbolsAndrew Lenharth
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29220 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-28Shave another 27K off libllvmgcc.dylib with visibility hiddenChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28973 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-12If the register allocator cannot find a register to spill, try the aliases. IfEvan Cheng
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
2006-05-11Backing out previous check-in.Evan Cheng
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28219 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-10If the live interval legnth is essentially zero, i.e. in every live rangeEvan Cheng
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
2006-03-25Add some comments.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27133 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-23Code cleanups, no functionality changeChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26328 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-22Add explicit #includes of <iostream>Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25515 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-28HB is *the* code janitor.Duraid Madina
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25031 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-21I think I know what you meant here, but just to be safe I'll let youDuraid Madina
do it. :) <_sabre_> excuses excuses git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24471 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-21Add section switching to common code generator code. Add a couple ofChris Lattner
asserts. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24445 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-21Expose the LiveInterval interfaces as public headers.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23400 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-30When checking the fixed intervals, don't forget to check for register aliases.Chris Lattner
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
2005-08-23Keep track of which registers are related to which other registers.Chris Lattner
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
2005-08-22Try to avoid scanning the fixed list. On architectures with a non-stupidChris Lattner
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
2005-08-22Move some code in the register assignment case that only needs to happen ifChris Lattner
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
2005-08-22Speed up this loop a bit, based on some observations that Nate made, andChris Lattner
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
2005-04-21Remove trailing whitespaceMisha Brukman
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21420 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-23Update these register allocators to set the PhysRegUsed info in MachineFunction.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19791 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-08Silence VS warningsChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19385 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-15Move virtual method call out of loopChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18955 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-07Move virtual function call out of loop to speed up getFreePhysReg by aboutNate Begeman
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
2004-11-18* There is no reason for SpillWeights to be an instance varChris Lattner
* 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
2004-11-18Fix a couple of bugs where we considered physregs past their range as possiblyChris Lattner
intersecting an interval. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17939 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-18Start using the iterators in the fixed_ intervals to avoid having to binaryChris Lattner
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
2004-11-18Add a counter for the number of times linscan has to backtrack. Start usingChris Lattner
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
2004-11-18* Improve comments/documentation substantiallyChris Lattner
* 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
2004-11-18Rename some methods, use 'begin' instead of 'start', add new LiveIntervalChris Lattner
iterator/begin/end members. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17930 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-05Do not make i have bigger scope that we needChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17483 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-30Free the VirtRegMap at the end of MachineFunction processing instead of atChris Lattner
the beginning of processing the next one. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16605 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-03Fixes to make LLVM compile with vc7.1.Alkis Evlogimenos
Patch contributed by Paolo Invernizzi! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16152 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-02Change the way we choose a free register: instead of picking the firstAlkis Evlogimenos
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
2004-09-02We don't need to sort the added vector as unhandled intervals areAlkis Evlogimenos
stored in a binary heap. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16143 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-01Changes For Bug 352Reid Spencer
Move include/Config and include/Support into include/llvm/Config, include/llvm/ADT and include/llvm/Support. From here on out, all LLVM public header files must be under include/llvm/. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16137 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-01Be a bit more efficient when processing the active and inactiveAlkis Evlogimenos
lists. Instead of scanning the vector backwards, scan it forward and swap each element we want to erase. Then at the end erase all removed intervals at once. This doesn't save much: 0.08s out of 4s when compiling 176.gcc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16136 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-27Now that LiveIntervals::addIntervalsForSpills is fixed, do not requireAlkis Evlogimenos
LiveVariables. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16076 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-27Back out this change as it broke the build last night. This should beAlkis Evlogimenos
investicated further as the linearscan variants don't really need LiveVariables... git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16074 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-27The linear scan variants do not require the LiveVariables analysis.Alkis Evlogimenos
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16071 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-04Convert indentation to 2 spaces.Alkis Evlogimenos
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15489 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-25Add some comments to the backtracking code.Alkis Evlogimenos
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15200 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-24Change std::map<unsigned, LiveInterval*> into a std::map<unsigned,Alkis Evlogimenos
LiveInterval>. This saves some space and removes the pointer indirection caused by following the pointer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15167 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-24Completely eliminate the intervals_ list. instead, the r2iMap_ maintainsChris Lattner
ownership of the intervals. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15155 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-23Rename LiveIntervals.(cpp|h) -> LiveIntervalAnalysis.(cpp|h)Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15135 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-22Some compile time improvements resulting in a 1sec speedup in the 5secAlkis Evlogimenos
compilation of gcc: * Use vectors instead of lists for the intervals sets * Use a heap for the unhandled set to keep intervals always sorted and makes insertions back to the heap very fast (compared to scanning a list) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15103 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-21These files don't need to include <iostream> since they include ↵Brian Gaeke
"Support/Debug.h". git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15089 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-19Remove dead code.Alkis Evlogimenos
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15011 91177308-0d34-0410-b5e6-96231b3b80d8