Commit Graph

68 Commits

Author SHA1 Message Date
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
Chris Lattner
af93dbcc95 * FIX: test/Regression/Assembler/2002-02-19-TypeParsing.ll
That was due to the StructType object not getting called multiple times
   to remove itself from the ATU list for an object, because it stopped
   getting queried due to this wrong test

* Improve debug output when DEBUG_MERGE_TYPES is on


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2124 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-05 23:02:46 +00:00
Chris Lattner
3855f2f951 * Move DerivedType::addAbstractTypeUser from DerivedType.h
* Refactor a bunch of code.  Types now only remove one subelement at a time
  when they are told that they have changed
* Improve debugging output, add more assertions...
* FIX Bugs:
  * test/Regression/Assembler/2002-04-04-PureVirtMethCall.ll
  * test/Regression/Assembler/2002-04-04-PureVirtMethCall2.ll
  * The change to fix these bugs was the to ValTypeBase::refineAbstractType
    method.  Basically we #if 0'd out the chunk of code there and make the
    table get reorganized EVEN IF the type has the same pointer.  Merging
    opportunities were being missed!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2121 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-05 22:25:26 +00:00
Chris Lattner
cecb520d1c Clean up debugging code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2119 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-05 19:53:06 +00:00
Chris Lattner
3f59b7e933 * Refactor loop in removeAbstractTypeUser to be more clear
* Fix a bug in DerivedType::refineAbstractTypeTo that caused
  test/Regression/Assembler/2002-04-05-TypeParsing.ll to fail.
  The added comment describes the fix


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2118 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-05 19:44:07 +00:00
Chris Lattner
aa06d2c103 * Add debug support for PATypeHolder
* PATypeHolder is now not a template


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2108 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-04 19:26:02 +00:00
Chris Lattner
6bfd6a578a s/Method/Function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2034 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-29 03:44:36 +00:00
Chris Lattner
697954c15d Changes to build successfully with GCC 3.02
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1503 91177308-0d34-0410-b5e6-96231b3b80d8
2002-01-20 22:54:45 +00:00
Chris Lattner
6c42c310c6 Remove unsized array support
Add new SequentialType class


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1470 91177308-0d34-0410-b5e6-96231b3b80d8
2001-12-14 16:41:56 +00:00
Chris Lattner
7026107b70 Do not pessimize users of this function. Fix logic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1428 91177308-0d34-0410-b5e6-96231b3b80d8
2001-12-06 18:06:37 +00:00
Chris Lattner
7a17675206 Renamed inst_const_iterator -> const_inst_iterator
Renamed op_const_iterator   -> const_op_iterator
Renamed PointerType::getValueType() -> PointerType::getElementType()


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1408 91177308-0d34-0410-b5e6-96231b3b80d8
2001-12-04 00:03:30 +00:00
Chris Lattner
e9bb2df410 Rename ConstPoolVal -> Constant
Rename ConstPool*   -> Constant*
Rename ConstPoolVals.h -> ConstantVals.h


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1407 91177308-0d34-0410-b5e6-96231b3b80d8
2001-12-03 22:26:30 +00:00
Chris Lattner
cee8f9ae67 Create a new #include "Support/..." directory structure to move things
from "llvm/Support/..." that are not llvm dependant.

Move files and fix #includes


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1400 91177308-0d34-0410-b5e6-96231b3b80d8
2001-11-27 00:03:19 +00:00
Chris Lattner
58716b9791 Implement: isLosslesslyConvertableTo and new CompositeType base class
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1347 91177308-0d34-0410-b5e6-96231b3b80d8
2001-11-26 17:01:47 +00:00
Chris Lattner
ebef5e5ba2 Remove debugging info
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1093 91177308-0d34-0410-b5e6-96231b3b80d8
2001-11-03 03:31:39 +00:00
Chris Lattner
e244a25014 Fix major bugs in type resolution
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1092 91177308-0d34-0410-b5e6-96231b3b80d8
2001-11-03 03:27:53 +00:00
Chris Lattner
3b1e3f45c0 Dramatically simplify recursive type processing. Fixed a few bugs, a few still remain :(
Why does this stuff have to come up NOW?


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1089 91177308-0d34-0410-b5e6-96231b3b80d8
2001-11-02 07:51:31 +00:00
Chris Lattner
55fd998ce7 Initialize isRecursive. Found by Purify
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1043 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-30 16:39:16 +00:00