Commit Graph

13337 Commits

Author SHA1 Message Date
Chris Lattner e0afd9bd53 Provide timeout values to all abstract interpreters
llvm-svn: 15159
2004-07-24 07:48:50 +00:00
Chris Lattner f5da5de94a Add support for killing the program if it executes for too long.
llvm-svn: 15158
2004-07-24 07:41:31 +00:00
Chris Lattner 8c595eb4bd whoops, didn't mean to remove this
llvm-svn: 15157
2004-07-24 04:32:22 +00:00
Chris Lattner d9bbbb8484 In the joiner, merge the small interval into the large interval. This restores
us back to taking about 10.5s on gcc, instead of taking 15.6s!  The net result
is that my big patches have hand no significant effect on compile time or code
quality.  heh.

llvm-svn: 15156
2004-07-24 03:41:50 +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 7efcdb7ca3 Big change to compute logical value numbers for each LiveRange added to an
Interval.  This generalizes the isDefinedOnce mechanism that we used before
to help us coallesce ranges that overlap.  As part of this, every logical
range with a different value is assigned a different number in the interval.
For example, for code that looks like this:

0  X = ...
4  X += ...
  ...
N    = X

We now generate a live interval that contains two ranges: [2,6:0),[6,?:1)
reflecting the fact that there are two different values in the range at
different positions in the code.

Currently we are not using this information at all, so this just slows down
liveintervals.  In the future, this will change.

Note that this change also substantially refactors the joinIntervalsInMachineBB
method to merge the cases for virt-virt and phys-virt joining into a single
case, adds comments, and makes the code a bit easier to follow.

llvm-svn: 15154
2004-07-24 02:59:07 +00:00
Chris Lattner d7b9e29327 Add a new differingRegisterClasses method
make overlapsAliases take pointers instead of references
fix indentation

llvm-svn: 15153
2004-07-24 02:53:43 +00:00
Chris Lattner 038747f5c0 Little stuff:
* Fix comment typeo
* add dump() methods
* add a few new methods like getLiveRangeContaining, removeRange & joinable
  (which is currently the same as overlaps)
* Remove the unused operator==

Bigger change:

* In LiveInterval, instead of using a boolean isDefinedOnce to keep track of
  if there are > 1 definitions in a particular interval, keep a counter,
  NumValues to keep track of exactly how many there are.
* In LiveRange, add a new ValId element to indicate which of the numbered
  values each LiveRange belongs to.   We now no longer merge LiveRanges if
  they are of differing value ID's even if they are neighbors.

llvm-svn: 15152
2004-07-24 02:52:23 +00:00
Misha Brukman 8930d4f24e Running list of bugs, unimplemented features, currently broken tests, until we
have a nightly tester set up for PowerPC.

llvm-svn: 15147
2004-07-23 22:37:22 +00:00
Misha Brukman c150bdb52e Eliminate spurious empty space; make code easier to page through.
llvm-svn: 15146
2004-07-23 22:35:49 +00:00
Misha Brukman 66c816a6a3 Simplify boolean test.
llvm-svn: 15145
2004-07-23 21:43:26 +00:00
Chris Lattner 1604b02c4c More minor changes:
* Inline some functions
 * Eliminate some comparisons from the release build

This is good for another .3 on gcc.

llvm-svn: 15144
2004-07-23 21:24:19 +00:00
Misha Brukman 26a04b79cb Implement casting a floating point to 32-bit unsigned value
llvm-svn: 15143
2004-07-23 20:32:59 +00:00
Brian Gaeke dfaa6ec48f bug fixed
llvm-svn: 15142
2004-07-23 19:41:13 +00:00
Chris Lattner b4acba49b1 Change addRange and join to be a little bit smarter. In particular, we don't
want to insert a new range into the middle of the vector, then delete ranges
one at a time next to the inserted one as they are merged.

Instead, if the inserted interval overlaps, just start merging.  The only time
we insert into the middle of the vector is when we don't overlap at all.  Also
delete blocks of live ranges if we overlap with many of them.

This patch speeds up joining by .7 seconds on a large testcase, but more
importantly gets all of the range adding code into addRangeFrom.

llvm-svn: 15141
2004-07-23 19:38:44 +00:00
Brian Gaeke 657e590c93 Fix problem with inserting FunctionPasses that depend on ImmutablePasses
(e.g., LICM) into FunctionPassManagers. The problem is that we were
using a C-style cast to cast required analysis passes to PassClass*, but
if it's a FunctionPassManager, and the required analysis pass is an
ImmutablePass, the types aren't really compatible, so the C-style cast
causes a crash.

llvm-svn: 15140
2004-07-23 19:35:50 +00:00
Chris Lattner 2fcc5e416d Search by the start point, not by the whole interval. This saves some
comparisons, reducing linscan by another .1 seconds :)

llvm-svn: 15139
2004-07-23 18:40:00 +00:00
Chris Lattner 60babd0431 New helper method
llvm-svn: 15138
2004-07-23 18:39:12 +00:00
Chris Lattner 848c7c59d4 Speedup debug builds a bit
llvm-svn: 15137
2004-07-23 18:38:52 +00:00
Chris Lattner c96d299569 Instead of searching for a live interval pair, search for a location. This gives
a very modest speedup of .3 seconds compiling 176.gcc (out of 20s).

llvm-svn: 15136
2004-07-23 18:13:24 +00:00
Chris Lattner 856383326a Rename LiveIntervals.(cpp|h) -> LiveIntervalAnalysis.(cpp|h)
llvm-svn: 15135
2004-07-23 17:56:30 +00:00
Chris Lattner 78f62e37f3 Pull the LiveRange and LiveInterval classes out of LiveIntervals.h (which
will soon be renamed) into their own file.  The new file should not emit
DEBUG output or have other side effects.  The LiveInterval class also now
doesn't know whether its working on registers or some other thing.

In the future we will want to use the LiveInterval class and friends to do
stack packing.  In addition to a code simplification, this will allow us to
do it more easily.

llvm-svn: 15134
2004-07-23 17:49:16 +00:00
Misha Brukman 7dba17d1ce * Codegen of GEPs dramatically improved by folding multiplies and adds
* Function pointers implemented correctly using appropriate stubs

Contributed by Nate Begeman.

llvm-svn: 15133
2004-07-23 16:08:20 +00:00
John Criswell 9537b0455f Revised the generation of files so that they follow the newer autoconf
standards.  This is in hopes of fixing configuration problems on
Windows Services for Unix.

llvm-svn: 15132
2004-07-23 15:40:57 +00:00
Chris Lattner 53280cd26e Improve comments a bit
Use an explicit LiveRange class to represent ranges instead of an std::pair.
This is a minor cleanup, but is really intended to make a future patch simpler
and less invasive.

Alkis, could you please take a look at LiveInterval::liveAt?  I suspect that
you can add an operator<(unsigned) to LiveRange, allowing us to speed up the
upper_bound call by quite a bit (this would also apply to other callers of
upper/lower_bound).  I would do it myself, but I still don't understand that
crazy liveAt function, despite the comment. :)

Basically I would like to see this:
    LiveRange dummy(index, index+1);
    Ranges::const_iterator r = std::upper_bound(ranges.begin(),
                                                ranges.end(),
                                                dummy);

Turn into:
    Ranges::const_iterator r = std::upper_bound(ranges.begin(),
                                                ranges.end(),
                                                index);

llvm-svn: 15130
2004-07-23 08:24:23 +00:00
Chris Lattner aaf1e74a85 Change column name
llvm-svn: 15129
2004-07-23 06:50:18 +00:00
Chris Lattner 2d75978bc6 Update live intervals more accurately for PHI elim. This slightly reduces
the live intervals for some registers.

llvm-svn: 15125
2004-07-23 05:27:43 +00:00
Chris Lattner b549420cd0 Force coallescing of live ranges that have a single definition, even if they
interfere.  Because these intervals have a single definition, and one of them
is a copy instruction, they are always safe to merge even if their lifetimes
interfere.  This slightly reduces the amount of spill code, for example on
252.eon, from:

 12837 spiller               - Number of loads added
  7604 spiller               - Number of stores added
  5842 spiller               - Number of register spills
 18155 liveintervals         - Number of identity moves eliminated after coalescing

to:

  12754 spiller               - Number of loads added
   7585 spiller               - Number of stores added
   5803 spiller               - Number of register spills
  18262 liveintervals         - Number of identity moves eliminated after coalescing

The much much bigger win would be to merge intervals with multiple definitions
(aka phi nodes) but this is not that day.

llvm-svn: 15124
2004-07-23 05:26:05 +00:00
Misha Brukman 6aa3c83f8d * Convert "\n" -> '\n'
* Print out another '\n' after printing out program execution status
* Make sure code wraps at 80 cols

llvm-svn: 15123
2004-07-23 01:30:49 +00:00
Misha Brukman 4fb48609dc Bool alignment on MacOSX/PowerPC is 4 bytes.
llvm-svn: 15122
2004-07-23 01:11:46 +00:00
Misha Brukman db72025d1d * Change class of BoolTy back to cInt
* Fix indentation back to 2 spaces

llvm-svn: 15121
2004-07-23 01:11:19 +00:00
Misha Brukman 3faa865508 * Add BoolAlignment to TargetData, default is 1 byte, size 1 byte
* Convert tabs to spaces

llvm-svn: 15120
2004-07-23 01:09:52 +00:00
Misha Brukman f0cfb33bbb * Add a BoolAlignment field to TargetData, default is 1 byte
* Fix spacing

llvm-svn: 15119
2004-07-23 01:08:13 +00:00
Chris Lattner 84b93bb107 costmetic changes
llvm-svn: 15118
2004-07-22 23:05:12 +00:00
Misha Brukman d859e170fc Let's not get carried away here, please.
llvm-svn: 15117
2004-07-22 22:43:21 +00:00
John Criswell ba60b3209b Give some credit to Oscar. Should help to address Bug#13.
llvm-svn: 15116
2004-07-22 22:11:16 +00:00
Chris Lattner 6b2b26c6f2 Fix broken -debug printing
llvm-svn: 15115
2004-07-22 21:54:22 +00:00
Chris Lattner 8799dd9e2e The default has not been 'simple' for AGES!
llvm-svn: 15114
2004-07-22 21:46:02 +00:00
Chris Lattner 87bf918bc0 Remove some abandoned code that was never finished. If needed in the future
it can be ressurected from CVS.

llvm-svn: 15113
2004-07-22 21:32:38 +00:00
Chris Lattner 8d06c43f01 Remove some (LARGE) abandoned code for the release. If this is ever needed
again in the future, it can be resurrected out of CVS

llvm-svn: 15112
2004-07-22 21:30:35 +00:00
Chris Lattner 68426e5ba6 Make linear scan the default
llvm-svn: 15111
2004-07-22 18:42:00 +00:00
Misha Brukman 333f58836c * Change bool from cInt to cByte (for now)
* Don't allow negative immediates to users of unsigned immediates
* Fix long compares
* Support <const int>, op as a potential immediate candidate
* Fix sign extension of short and byte loads
* Fix and improve integer casts
* Fix passing of doubles as vararg functions

Patch contributed by Nate Begeman.

llvm-svn: 15109
2004-07-22 15:58:04 +00:00
Alkis Evlogimenos c73b76a0a8 Put variable name to a separate line.
llvm-svn: 15108
2004-07-22 15:30:33 +00:00
Misha Brukman 6dd644e017 Fix indentation and wrap code at 80 cols
llvm-svn: 15107
2004-07-22 15:26:23 +00:00
Alkis Evlogimenos 61546f3e5b Sorting is now handled by both linearscan and iterative scan so live
intervals need not be sorted anymore. Removing this redundant step
improves LiveIntervals running time by 5% on 176.gcc.

llvm-svn: 15106
2004-07-22 15:18:10 +00:00
Alkis Evlogimenos 52cff0adf0 Fit to 80 columns.
llvm-svn: 15105
2004-07-22 14:29:31 +00:00
Chris Lattner 7ba1be09b3 Remove redundant SCCP pass
Add new DSE pass.  Add a temporary option to disable it in case we need it
This is going in after the July 22 nightly tester run, so we'll wait until the 23rd to see it
:)

llvm-svn: 15104
2004-07-22 08:34:33 +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
Chris Lattner a363ea488f New prototype
llvm-svn: 15102
2004-07-22 08:07:30 +00:00
Chris Lattner 3844c300de This is a trivial dead store elimination pass. It very very simple and
can be improved in many ways.  But: stop laughing, even with -basicaa it
deletes 15% of the stores in 252.eon :)

llvm-svn: 15101
2004-07-22 08:00:28 +00:00
Chris Lattner e82780c22e Trivial testcase for dse
llvm-svn: 15100
2004-07-22 07:59:20 +00:00
Chris Lattner 053427ff4f Clean up reference counting to stop "leaking" alias sets
llvm-svn: 15099
2004-07-22 07:58:18 +00:00
Chris Lattner f2b976bdd5 Remove extraneous punctuation
llvm-svn: 15098
2004-07-22 05:51:56 +00:00
Chris Lattner 51f7c9e56d Update GC intrinsics to take a pointer to the object as well as a pointer
to the field being updated.  Patch contributed by Tobias Nurmiranta

llvm-svn: 15097
2004-07-22 05:51:13 +00:00
Chris Lattner 001aba76fd Updates to gc intrinsics, contributed by Tobias Nurmiranta
llvm-svn: 15096
2004-07-22 05:50:01 +00:00
Chris Lattner 609111020f Update documentation for gc intrinsics change. Contributed by
Tobias Nurmiranta

llvm-svn: 15095
2004-07-22 05:49:38 +00:00
Chris Lattner 7324574660 Update gc intrinsics to take pointer to object as well as pointer to field.
Patch contributed by Tobias Nurmiranta

llvm-svn: 15094
2004-07-22 05:48:38 +00:00
Alkis Evlogimenos 120187935d Use reverse iterators when updating the vector, since scanning from
the end will reduce erase() runtimes.

llvm-svn: 15093
2004-07-22 02:16:53 +00:00
Chris Lattner 6ff6021712 That funny 2-address lowering pass can also cause multiple definitions,
fortunately, they are easy to handle if we know about them.  This patch fixes
some serious pessimization of code produced by the linscan register allocator.

llvm-svn: 15092
2004-07-22 00:04:14 +00:00
Chris Lattner adbbc62f82 Minor cleanups
llvm-svn: 15091
2004-07-21 23:17:57 +00:00
Chris Lattner fac8452acf Fix cases where we generated horrible code like this:
mov %EDI, 12
        add %EDI, %ECX
        mov %ECX, 12
        add %ECX, %EDX
        mov %EDX, 12
        add %EDX, %ESI

instead (really!) generate this:

        add %ECX, 12
        add %EDX, 12
        add %ESI, 12

llvm-svn: 15090
2004-07-21 21:28:26 +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
Brian Gaeke 025daeeee6 Include <iostream> here, because most people using DEBUG() want to use std::cerr too.
This means that users of this file do not also need to include <iostream>.

llvm-svn: 15088
2004-07-21 20:50:22 +00:00
Misha Brukman dbd14bc3e5 * Add the lost fix to define the second reg of a 2-reg representation of longs
* Fix opcode RLWNM -> RLWINM since it uses an immediate const shift value

llvm-svn: 15087
2004-07-21 20:30:18 +00:00
Misha Brukman 87e07f8596 * Speed up canUseAsImmediateForOpcode() by comparing Operand before
dyn_cast<>ing and checking Constant's value
* Convert tabs to spaces

llvm-svn: 15086
2004-07-21 20:22:06 +00:00
Chris Lattner d8f5e2ccac * Further cleanup.
* Test for whether bits are shifted out during the optzn.

If so, the fold is illegal, though it can be handled explicitly for setne/seteq

This fixes the miscompilation of 254.gap last night, which was a latent bug
exposed by other optimizer improvements.

llvm-svn: 15085
2004-07-21 20:14:10 +00:00
Misha Brukman 8d75aa4475 * Fix printing of signed immediate values (Nate Begeman)
* Fix printing of `zeroinitializer'
* Fix printing of `linkonce' globals, complete with stubs

llvm-svn: 15084
2004-07-21 20:11:11 +00:00
Misha Brukman 072af37088 * Fix printing of signed immediate values
* Generation of opcodes that take 16 bit immediates
* Rewrote multiply to be correct for 64 bit values
* Rewrote all the long handling to be correct for PowerPC
* Fix visitSelectInst() to define the upper register of the pair of regs
  representing a long value

Patch contributed by Nate Begeman.

llvm-svn: 15083
2004-07-21 20:09:08 +00:00
Chris Lattner 1638de4499 Make cast-cast code a bit more defensive
"simplify" a bit of code for comparison/and folding

llvm-svn: 15082
2004-07-21 19:50:44 +00:00
Misha Brukman 455622577a Use addSImm() instead of addImm() for stack offsets, which may be negative.
llvm-svn: 15081
2004-07-21 19:36:57 +00:00
Misha Brukman 00df656502 Reid doesn't need a definite article in front of his name.
llvm-svn: 15080
2004-07-21 18:04:27 +00:00
Misha Brukman 2887818206 Delete extra space; add <p> tags around text within a <div>
llvm-svn: 15079
2004-07-21 18:02:43 +00:00
Alkis Evlogimenos c74c7d1101 Fix analysis name.
llvm-svn: 15078
2004-07-21 17:23:44 +00:00
Misha Brukman 984bfdc702 Add SUBI instruction
llvm-svn: 15077
2004-07-21 15:53:04 +00:00
Misha Brukman ab25ccb9ea Fix spelling of `iterative scan'
llvm-svn: 15075
2004-07-21 12:53:14 +00:00
Misha Brukman 53bba06e37 * Uncomment rule for location of LLI (formerly commented out: typo?)
* Add space between VAR and `='

llvm-svn: 15074
2004-07-21 12:47:40 +00:00
Alkis Evlogimenos 701071a144 Clear spilled list at once. Remove unused vector.
llvm-svn: 15073
2004-07-21 12:00:10 +00:00
Alkis Evlogimenos a3efc03731 Change std::list into a std::vector for IntervalSets. This reduces
compile time for 176.gcc from 5.6 secs to 4.7 secs.

llvm-svn: 15072
2004-07-21 09:46:55 +00:00
Alkis Evlogimenos 29d020ab60 Add greater_ptr functor.
llvm-svn: 15070
2004-07-21 08:38:06 +00:00
Alkis Evlogimenos fbc436bbce Improve file comment.
llvm-svn: 15069
2004-07-21 08:28:39 +00:00
Alkis Evlogimenos d524e5bdf2 Add Iterative scan register allocator.
llvm-svn: 15068
2004-07-21 08:24:35 +00:00
Alkis Evlogimenos c03ccc225b Linearscan is no longer experimental.
llvm-svn: 15067
2004-07-21 08:18:50 +00:00
Chris Lattner abc4f4523f Add capability to remove aliasing aliassets from an AST
llvm-svn: 15066
2004-07-21 07:04:26 +00:00
Chris Lattner b2903c2a1e Add a bunch of new functionality, primarily to do with removing aliasing
pointers from an AST.

llvm-svn: 15065
2004-07-21 07:03:57 +00:00
Chris Lattner 2cfaef23e4 Make the AST interface a bit richer by returning whether an insertion caused
an insertion or not (because the pointer set already existed).

llvm-svn: 15064
2004-07-21 05:18:04 +00:00
Chris Lattner 4fbad968f8 Remove special casing of pointers and treat them generically as integers of
the appopriate size.  This gives us the ability to eliminate int -> ptr -> int

llvm-svn: 15063
2004-07-21 04:27:24 +00:00
Chris Lattner fdcf624939 Do not ignore casts unless they are pointer-pointer casts. This caused us
to miscompile the SingleSource/Regression/C++/pointer_member.cpp program.

llvm-svn: 15062
2004-07-21 03:56:54 +00:00
Brian Gaeke cd4ae3a3fd Regenerated using autoconf-2.57.
llvm-svn: 15061
2004-07-21 03:50:25 +00:00
Brian Gaeke b1ea500aa1 Add AC_MSG_CHECKING and AC_MSG_RESULT statements which were missing
from two of our custom checks.

llvm-svn: 15060
2004-07-21 03:50:01 +00:00
Brian Gaeke a87044523f Regenerated with autoconf/autoheader 2.57
llvm-svn: 15059
2004-07-21 03:33:58 +00:00
Brian Gaeke 84a69f1494 Solaris hack for isinf()
llvm-svn: 15058
2004-07-21 03:32:51 +00:00
Brian Gaeke a5adf7948c Add check for finite(). Solaris doesn't have isinf, but it has finite...go
figure!

llvm-svn: 15057
2004-07-21 03:30:27 +00:00
Brian Gaeke 1dde3fa94f Emit NaNs and INFs bit-identically to the bytecode file, if the system has
printf("%a") support.
Patch contributed by Bill Wendling.

llvm-svn: 15056
2004-07-21 03:15:26 +00:00
Brian Gaeke adcf66fb8f Add prototypes for platform-independent wrappers for isinf().
Patch contributed by Bill Wendling.

llvm-svn: 15055
2004-07-21 03:15:14 +00:00
Brian Gaeke 920f4dd59e Regenerated with autoheader-2.57.
Patch contributed by Bill Wendling.

llvm-svn: 15054
2004-07-21 03:15:02 +00:00
Brian Gaeke 499b01d29d Add call to check for isinf().
Patch contributed by Bill Wendling.

llvm-svn: 15053
2004-07-21 03:14:51 +00:00
Brian Gaeke 25318b1381 Add support for checking for isinf().
Patch contributed by Bill Wendling.

llvm-svn: 15052
2004-07-21 03:14:39 +00:00
Brian Gaeke 2698a6cb8e Regenerated with autoconf-2.57.
Patch contributed by Bill Wendling.

llvm-svn: 15051
2004-07-21 03:14:12 +00:00
Brian Gaeke 0810ebf56a Add platform-independent wrapper function for isinf().
Patch contributed by Bill Wendling.

llvm-svn: 15050
2004-07-21 03:13:50 +00:00
Brian Gaeke e2e0637a77 Move LLVM tool definitions to Makefile.rules
llvm-svn: 15049
2004-07-21 01:31:47 +00:00