Commit Graph

118 Commits

Author SHA1 Message Date
Chris Lattner 2988921dc4 Code cleanups, no functionality change
llvm-svn: 26328
2006-02-23 06:44:17 +00:00
Chris Lattner de02d7727f Add explicit #includes of <iostream>
llvm-svn: 25515
2006-01-22 23:41:00 +00:00
Duraid Madina e47d9d0e92 HB is *the* code janitor.
llvm-svn: 25031
2005-12-28 04:55:42 +00:00
Duraid Madina f28b3bd8b4 I think I know what you meant here, but just to be safe I'll let you
do it. :)

    <_sabre_> excuses excuses

llvm-svn: 24471
2005-11-21 14:09:40 +00:00
Chris Lattner 2ea5c99eca Add section switching to common code generator code. Add a couple of
asserts.

llvm-svn: 24445
2005-11-21 07:06:27 +00:00
Chris Lattner b1f8982ff0 Expose the LiveInterval interfaces as public headers.
llvm-svn: 23400
2005-09-21 04:19:09 +00:00
Chris Lattner 4d602bed10 When checking the fixed intervals, don't forget to check for register aliases.
This fixes PR621 and Regression/CodeGen/X86/2005-08-30-RegAllocAliasProblem.ll

llvm-svn: 23158
2005-08-30 21:03:36 +00:00
Chris Lattner 22e91cc3b5 Keep track of which registers are related to which other registers.
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.

llvm-svn: 22986
2005-08-23 22:27:31 +00:00
Chris Lattner 834a2316a3 Try to avoid scanning the fixed list. On architectures with a non-stupid
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.

llvm-svn: 22972
2005-08-22 20:59:30 +00:00
Chris Lattner 95a157ae1a Move some code in the register assignment case that only needs to happen if
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.

llvm-svn: 22971
2005-08-22 20:20:42 +00:00
Chris Lattner 83b821b584 Speed up this loop a bit, based on some observations that Nate made, and
add some comments.  This loop really needs to be reevaluated!

llvm-svn: 22966
2005-08-22 16:55:22 +00:00
Misha Brukman 835702a094 Remove trailing whitespace
llvm-svn: 21420
2005-04-21 22:36:52 +00:00
Chris Lattner ae09d93b35 Update these register allocators to set the PhysRegUsed info in MachineFunction.
llvm-svn: 19791
2005-01-23 22:45:13 +00:00
Chris Lattner 78100c41ca Silence VS warnings
llvm-svn: 19385
2005-01-08 19:53:50 +00:00
Chris Lattner e09dbe2732 Move virtual method call out of loop
llvm-svn: 18955
2004-12-15 07:04:32 +00:00
Nate Begeman 784a0dcbd0 Move virtual function call out of loop to speed up getFreePhysReg by about
20%, shaving 0.1s off hbd compile time on my g5.  Yay.

llvm-svn: 18592
2004-12-07 05:25:53 +00:00
Chris Lattner b75e790a2b * There is no reason for SpillWeights to be an instance var
* 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.

llvm-svn: 17945
2004-11-18 06:01:45 +00:00
Chris Lattner 08ec603bb0 Fix a couple of bugs where we considered physregs past their range as possibly
intersecting an interval.

llvm-svn: 17939
2004-11-18 04:33:31 +00:00
Chris Lattner 49ff5f0477 Start using the iterators in the fixed_ intervals to avoid having to binary
search physreg intervals every time we access it.  This takes another
half second off of linscan.

llvm-svn: 17937
2004-11-18 04:13:02 +00:00
Chris Lattner 850852c789 Add a counter for the number of times linscan has to backtrack. Start using
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.

llvm-svn: 17935
2004-11-18 03:49:30 +00:00
Chris Lattner a1f7779876 * Improve comments/documentation substantially
* 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.

llvm-svn: 17933
2004-11-18 02:42:27 +00:00
Chris Lattner a51f5eeac1 Rename some methods, use 'begin' instead of 'start', add new LiveInterval
iterator/begin/end members.

llvm-svn: 17930
2004-11-18 01:29:39 +00:00
Chris Lattner c22ffc26b0 Do not make i have bigger scope that we need
llvm-svn: 17483
2004-11-05 04:47:37 +00:00
Chris Lattner ddd5229f3b Free the VirtRegMap at the end of MachineFunction processing instead of at
the beginning of processing the next one.

llvm-svn: 16605
2004-09-30 02:02:33 +00:00
Alkis Evlogimenos a5c04ee50f Fixes to make LLVM compile with vc7.1.
Patch contributed by Paolo Invernizzi!

llvm-svn: 16152
2004-09-03 18:19:51 +00:00
Alkis Evlogimenos 095c3a80f3 Change the way we choose a free register: instead of picking the first
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

llvm-svn: 16147
2004-09-02 21:23:32 +00:00
Alkis Evlogimenos dcbf893095 We don't need to sort the added vector as unhandled intervals are
stored in a binary heap.

llvm-svn: 16143
2004-09-02 18:00:38 +00:00
Reid Spencer 7c16caa336 Changes For Bug 352
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/.

llvm-svn: 16137
2004-09-01 22:55:40 +00:00
Alkis Evlogimenos fae8f6a4fb Be a bit more efficient when processing the active and inactive
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.

llvm-svn: 16136
2004-09-01 22:52:29 +00:00
Alkis Evlogimenos e2d962e0fd Now that LiveIntervals::addIntervalsForSpills is fixed, do not require
LiveVariables.

llvm-svn: 16076
2004-08-27 19:00:29 +00:00
Alkis Evlogimenos efd40bce75 Back out this change as it broke the build last night. This should be
investicated further as the linearscan variants don't really need
LiveVariables...

llvm-svn: 16074
2004-08-27 18:01:21 +00:00
Alkis Evlogimenos 11f0fc8eda The linear scan variants do not require the LiveVariables analysis.
llvm-svn: 16071
2004-08-27 04:51:13 +00:00
Alkis Evlogimenos a698308cce Convert indentation to 2 spaces.
llvm-svn: 15489
2004-08-04 09:46:26 +00:00
Alkis Evlogimenos 83d9b62b28 Add some comments to the backtracking code.
llvm-svn: 15200
2004-07-25 08:10:33 +00:00
Alkis Evlogimenos cf72e7f854 Change std::map<unsigned, LiveInterval*> into a std::map<unsigned,
LiveInterval>. This saves some space and removes the pointer
indirection caused by following the pointer.

llvm-svn: 15167
2004-07-24 11:44:15 +00:00
Chris Lattner c51866a20e Completely eliminate the intervals_ list. instead, the r2iMap_ maintains
ownership of the intervals.

llvm-svn: 15155
2004-07-24 03:32:06 +00:00
Chris Lattner 856383326a Rename LiveIntervals.(cpp|h) -> LiveIntervalAnalysis.(cpp|h)
llvm-svn: 15135
2004-07-23 17:56:30 +00:00
Alkis Evlogimenos 1a876fab64 Some compile time improvements resulting in a 1sec speedup in the 5sec
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)

llvm-svn: 15103
2004-07-22 08:14:44 +00:00
Brian Gaeke 902dcf0729 These files don't need to include <iostream> since they include "Support/Debug.h".
llvm-svn: 15089
2004-07-21 20:50:33 +00:00
Alkis Evlogimenos 12a71ea03e Remove dead code.
llvm-svn: 15011
2004-07-19 23:35:55 +00:00
Chris Lattner 8c8144b958 Fix assertion to not dereference end!
llvm-svn: 14991
2004-07-19 05:02:09 +00:00
Chris Lattner 70f8dca59b Add some asserts that the list of intervals returned by addIntervalsForSpills
is sorted.  This is not the case currently, which is causing no end of
problems.

llvm-svn: 14990
2004-07-19 04:47:36 +00:00
Alkis Evlogimenos 21b3a5b0de Correctly compute the ration of iterations/#intervals.
llvm-svn: 14626
2004-07-04 17:23:35 +00:00
Alkis Evlogimenos 8f3cc0316c Add efficiency statistic.
llvm-svn: 14590
2004-07-04 07:59:06 +00:00
Chris Lattner 4fbff990b0 Rename Interval class to LiveInterval to avoid conflicting with the already
existing llvm::Interval class.

Patch contributed by Vladimir Prus!
http://mail.cs.uiuc.edu/pipermail/llvmbugs/2004-June/000710.html

llvm-svn: 14281
2004-06-21 13:10:56 +00:00
Alkis Evlogimenos fbe799cfa2 Pull Interval class out of LiveIntervals.
llvm-svn: 13910
2004-05-30 07:46:27 +00:00
Alkis Evlogimenos a5268e8199 When spilling an register, introduce a new temporary for each of its
spills. This allows for more flexibility when allocating registers for
spill code.

llvm-svn: 13907
2004-05-30 07:24:39 +00:00
Alkis Evlogimenos 2a54b5d3e1 Add required header
llvm-svn: 13417
2004-05-08 03:50:03 +00:00
Chris Lattner 991425ae70 numeric_limits::infinity() apparently does not work on all systems. As a
workaround, use the C HUGE_VAL macro instead.

llvm-svn: 13377
2004-05-06 16:25:59 +00:00
Alkis Evlogimenos 02a5354d9b Make the set of fixed (preallocated) intervals be a fixed superset of
unhandled + handled. So unhandled is now including all fixed intervals
and fixed intervals never changes when processing a function.

llvm-svn: 12462
2004-03-17 00:48:59 +00:00