Commit Graph

85 Commits

Author SHA1 Message Date
Chris Lattner
d85cbe8f69 Fix const correctness
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10229 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-25 21:28:00 +00:00
Chris Lattner
b9da9c137d Relax constrains on GEP type indexes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10228 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-25 21:21:46 +00:00
Chris Lattner
bb4a15ca57 Really, there was a reason for me factoring that out
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10089 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-19 19:20:20 +00:00
Chris Lattner
542d991451 *** Significantly speed up type resultion
This change speeds up type resolution by checking to see if a type is
  recursive, and if it's not, using a more efficient algorithm.

  This dramatically reduces bytecode loading time of kc++, reducing time-to-jit
  kc++ --version to 17s from 33s


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10088 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-19 19:10:23 +00:00
Chris Lattner
f2586d13d5 Finegrainify namespacification
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10080 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-19 06:14:38 +00:00
Brian Gaeke
d0fde30ce8 Put all LLVM code into the llvm namespace, as per bug 109.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9903 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-11 22:41:34 +00:00
Chris Lattner
5bc3e31c54 Fix InstCombine/2003-11-03-VarargsCallBug.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9681 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-03 18:44:58 +00:00
John Criswell
b576c94c15 Added LLVM project notice to the top of every C++ source file.
Header files will be on the way.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9298 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-20 19:43:21 +00:00
Chris Lattner
5af41974c3 Speed up TypesEqual by specializing it for all of the derived types, avoiding
a lot of virtual method dispatch overhead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9078 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-13 14:55:56 +00:00
Chris Lattner
1825009ba8 Avoid creating lots of pointless opaque types, with short lifetimes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9076 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-13 14:03:36 +00:00
Misha Brukman
6b63452c3a Fix spelling/grammar.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9023 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-10 17:54:14 +00:00
Chris Lattner
23c3288ce9 Explicit copy ctors are no longer needed
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8844 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-03 19:02:41 +00:00
Chris Lattner
af6f93ce35 Minor cleanups
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8843 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-03 18:57:54 +00:00
Chris Lattner
7685ac8d35 This checkin basically amounts to a complete rewrite of the type-resolution
machinery.  This dramatically simplifies how things works, removes irritating
little corner cases, and overall improves speed and reliability.

Highlights of this change are:

1. The exponential algorithm built into the code is now gone.  For example
   the time to disassemble one bytecode file from the mesa benchmark went
   from taking 12.5s to taking 0.16s.
2. The linker bugs should be dramatically reduced.  The one remaining bug
   has to do with constant handling, which I actually introduced in
   "union-find" checkins.
3. The code is much easier to follow, as a result of fewer special cases.
   It's probably also smaller.  yaay.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8842 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-03 18:46:24 +00:00
Chris Lattner
8ef852f4ea Dramatically simplify DerivedType::refineAbstractTypeToInternal
This makes use of the new PATypeHolder's to keep types from being deleted
prematurely, instead of the wierd "self reference" garbage.  This is easier
to understand and more efficient as well.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8834 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-03 04:48:21 +00:00
Chris Lattner
1c5164e9cf Make the PATypeHolder use a simple union-find implementation to handle
merging of types.  This makes it MUCH more efficient than before, also
making things simpler.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8833 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-02 23:35:57 +00:00
Chris Lattner
065a616ada Fix spell-o's
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8431 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-10 05:29:43 +00:00
Chris Lattner
c9b24a3bad Add asserts, move code around. This gets the dropAllTypeUses partially implemented
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8361 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-05 05:10:04 +00:00
Chris Lattner
8df956ccf2 Move functionality preserving changes.
Inline containsEquivalent
Remove some //'s


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8358 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-05 02:39:52 +00:00
Chris Lattner
266caa2c3d Refactor what has effectively become copy-and-pasted code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8357 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-05 02:30:47 +00:00
Chris Lattner
169726b113 Check in a bunch of minor fixes, plus a whole lot of #if 0'd out code, which will hopefully be enabled in the near future
This does not make any functionality changes


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8355 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-05 02:21:39 +00:00
Chris Lattner
663b479004 containsEquivalent never returns its argument
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8353 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-04 23:49:53 +00:00
Chris Lattner
a5112c768d Remove needless usage of getDescription()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8351 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-04 23:46:03 +00:00
Chris Lattner
e09a128df0 Inline method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8350 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-04 23:43:40 +00:00
Chris Lattner
a3057e8c89 Don't try to be sneaky, breaking recursive types in the process
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8348 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-04 23:41:03 +00:00
Chris Lattner
a3ad5b21e8 No need to rescan types when they are created.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8339 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-03 14:44:53 +00:00
Chris Lattner
a2f3e1d80b Another small speedup, this one to: 2.42s
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8335 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-02 22:52:49 +00:00
Chris Lattner
d8d6c76a9a Don't return bogus references, and don't add an entry to the Concrete map
unless it's not empty!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8334 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-02 22:50:02 +00:00
Chris Lattner
1bb626387b Another optimization, speed up the testcase to 2.7s
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8333 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-02 22:15:15 +00:00
Chris Lattner
bc4846d76c Removal of explicit stack, which requires the method to be a member (so it can
call setAbstract).  Now that we just compute abstractness we can also return
the computed value by value instead of as an argument.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8332 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-02 21:56:34 +00:00
Chris Lattner
87ca5faed7 Remove the "recursive bit", not only is it unused by anyone, it was also
not correctly calculated, and calculating it wrong for fun seems rather
pointless.  This also speeds up my favorite testcase by .25 seconds.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8330 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-02 21:41:05 +00:00
Chris Lattner
de73193f3e Don't bother doing an exhaustive recursive walk if we are at the limit of what
we need to know anyway.  This reduces the 2002-07-08-HugePerformanceProblem.llx
down to 3.210u:0.010s, which is back in the acceptable range again


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8323 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-02 20:06:29 +00:00
Chris Lattner
11e405061b Ugh, fix bugs. Ok, so the last fix wasn't as great as I thought it was.
Now we're back to: 131.730u, 0.330s, which is still quite an improvement,
but still quite unacceptable


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8322 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-02 19:14:12 +00:00
Chris Lattner
7ba77f2a63 Further simplifications
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8321 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-02 16:46:41 +00:00
Chris Lattner
dd4b421516 Change the code to no longer compute the "type description" immediately when
the type is analyzed.  Instead, only compute it when requested (with
getDescription), and cached for reuse later.

This dramatically speeds up LLVM in general because these descriptions almost
_never_ need to be constructed.  The only time they are used is when a type is
<<'d.  Printing of modules by themselves uses other code to print symbolic
types when possible, so these descriptions are really only used for debugging.

Also, this fixes the particularly bad case when lots of types get resolved to
each other, such as during linking of large programs.  In these cases, the type
descriptions would be repeatedly recomputed and discarded even though: A. noone
reads the description before it gets resolved, and B. many many resolutions
happen at intermediate steps, causing a HUGE waste of time.

Overall, this makes the getTypeDesc function much more light-weight, and fixes
bug: Assembler/2002-07-08-HugePerformanceProblem.llx, which went from taking
1048.770u/19.150s (which is 17.5 MINUTES, on apoc), to taking 0.020u/0.000s,
which is a nice little speedup.  :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8320 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-02 16:35:17 +00:00
Misha Brukman
ef6a6a69ff The word dependent' has no a'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8030 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-21 22:14:26 +00:00
Chris Lattner
949a362802 Remove redundant const qualifiers from cast<> expressions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7253 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-23 15:30:06 +00:00
Chris Lattner
893f025262 Detemplatize the PATypeHandle class, which was only really instantiated on 'Type'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6774 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-18 19:22:36 +00:00
Chris Lattner
950273b3e7 Fix static constructor ordering problem
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6302 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-22 21:31:52 +00:00
Chris Lattner
47697a18d2 Remove using declarations
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6300 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-22 21:21:43 +00:00
Misha Brukman
f117cc9ee6 s/convertable/convertible/g
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6248 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-20 18:45:36 +00:00
Chris Lattner
6a490cedb5 Make type resolution a bit more efficient
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5265 91177308-0d34-0410-b5e6-96231b3b80d8
2003-01-14 19:42:39 +00:00
Chris Lattner
0c4e886dbf - Renamed Type::isIntegral() to Type::isInteger()
- Added new method Type::isIntegral() that is the same as isInteger, but
    also accepts bool.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3574 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-03 01:08:28 +00:00
Chris Lattner
fe8041ae39 *** empty log message ***
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3065 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-24 22:08:53 +00:00
Chris Lattner
d44023ecb7 Implement getPrimitiveSize()
don't use isPointerType()


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2485 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-06 16:14:39 +00:00
Chris Lattner
31bcdb822f Split ConstantVals.h into Constant.h and Constants.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2378 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-28 19:55:58 +00:00
Chris Lattner
c72114ca72 Trivial simplification of code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2325 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-27 02:26:03 +00:00
Chris Lattner
f60c3fe8c8 *blush* somehow this debugging code got checked in...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2187 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-09 05:10:39 +00:00
Chris Lattner
417081c6b3 * Make all of the refineAbstractType functions work identically
* Remove ambiguous code that caused problems with understanding how stuff
  worked.
* Implement DerivedType::typeIsRefined right.  Add a big comment talking
  about it.
* The removeUserFromConcrete method already checks to see if the type is
  not abstract, so no need to duplicate the test all over this code

This checkin makes all of the type parsing related failures work.  All
Assembler Regression tests now pass!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2127 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-07 06:14:56 +00:00
Chris Lattner
339ba45f10 * Reenable apparently neccesary code, that breaks testcases when enabled,
but causes MANY FUNDAMENTAL PROBLEMS when not enabled. :(
* Add debugging function


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2125 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-06 00:21:11 +00:00