Commit Graph

158 Commits

Author SHA1 Message Date
Reid Spencer
a54b7cbd45 For PR1064:
Implement the arbitrary bit-width integer feature. The feature allows
integers of any bitwidth (up to 64) to be defined instead of just 1, 8,
16, 32, and 64 bit integers.

This change does several things:
1. Introduces a new Derived Type, IntegerType, to represent the number of
   bits in an integer. The Type classes SubclassData field is used to
   store the number of bits. This allows 2^23 bits in an integer type.
2. Removes the five integer Type::TypeID values for the 1, 8, 16, 32 and
   64-bit integers. These are replaced with just IntegerType which is not
   a primitive any more.
3. Adjust the rest of LLVM to account for this change.

Note that while this incremental change lays the foundation for arbitrary
bit-width integers, LLVM has not yet been converted to actually deal with
them in any significant way. Most optimization passes, for example, will
still only deal with the byte-width integer types.  Future increments
will rectify this situation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33113 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-12 07:05:14 +00:00
Reid Spencer
4fe16d607d Rename BoolTy as Int1Ty. Patch by Sheng Zhou.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33076 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-11 18:21:29 +00:00
Reid Spencer
877e7ce051 Parameter attributes are part of a FunctionType and deserve to be factored
into comparisons of two FunctionTypes. Make it so.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33020 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-08 19:41:01 +00:00
Reid Spencer
2c261789d3 Change the syntax for parameter attributes:
1. The @ sign is no longer necessary.
2. We now support "function attributes" as parameter attribute 0.
3. Instead of locating the return type attributes after the type of a
   function result, they are now located after the function header's
   closing paranthesis and before any alignment or section options.
4. The way has been prepared for a new "noreturn" function attribute but
   there is no support for recognizing it in the lexer nor doing anything
   with it if it does get set.
5. The FunctionType::getParamAttrsText method now has support for
   returning multiple attributes. This required a change in its interface.

I'm unhappy that this change leads to 6 new shift/reduce conflicts, but
in each case bison's decision to choose the shift is correct so there
shouldn't be any damage from these conflicts.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32904 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-05 17:06:19 +00:00
Reid Spencer
1fd79b8c42 Fix a bug in getParamAttrs where an invalid value would be returned if the
index passed in was out of range for the number of parameter attributes set.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32794 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-31 17:50:33 +00:00
Reid Spencer
9c2e86a8d0 For PR950:
Implement signless integer types and FunctionType parameter attributes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32779 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-31 05:25:34 +00:00
Andrew Lenharth
38ecbf18eb Packed Structures
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32361 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-08 18:06:16 +00:00
Reid Spencer
3da59db637 For PR950:
The long awaited CAST patch. This introduces 12 new instructions into LLVM
to replace the cast instruction. Corresponding changes throughout LLVM are
provided. This passes llvm-test, llvm/test, and SPEC CPUINT2000 with the
exception of 175.vpr which fails only on a slight floating point output
difference.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31931 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-27 01:05:10 +00:00
Bill Wendling
2e3def1177 Removed iostream #includes. Replaced std::cerr with DOUT.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31814 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-17 08:03:48 +00:00
Chris Lattner
2e1c196470 Add isFPOrFPVector() method, which indicates if a type is either FP or a
vector of FP types.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31198 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-26 18:22:45 +00:00
Reid Spencer
b83eb6447b For PR950:
This patch implements the first increment for the Signless Types feature.
All changes pertain to removing the ConstantSInt and ConstantUInt classes
in favor of just using ConstantInt.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31063 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-20 07:07:24 +00:00
Chris Lattner
f53104051e label* is not a valid type, add an assertion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30968 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-15 23:21:12 +00:00
Chris Lattner
ab4fa4f377 Minor cleanups
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30668 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-28 23:45:00 +00:00
Chris Lattner
de65fb3a8b Now that ConstantBool::True/False are gone, we can modify Type.cpp to
eliminate its static dtors, without having code that depends on order of
initialization.  Eliminate static ctors/dtors from Type.cpp.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30667 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-28 23:38:07 +00:00
Chris Lattner
a4f0b3a084 s|llvm/Support/Visibility.h|llvm/Support/Compiler.h|
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29911 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-27 12:54:02 +00:00
Jim Laskey
8884060a25 No Need to live in the past.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29282 91177308-0d34-0410-b5e6-96231b3b80d8
2006-07-26 09:59:01 +00:00
Jim Laskey
a25dfd2963 Moving this function to a permanent home to prevent a dependency cycle created
by the inline heuristic.  Was preventing llvm-gcc4 from building.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29278 91177308-0d34-0410-b5e6-96231b3b80d8
2006-07-25 23:22:00 +00:00
Chris Lattner
f190d38055 Use hidden visibility to reduce the sizes of some .o files. This chops 60K off a release llvm-dis.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28969 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-28 21:38:54 +00:00
Reid Spencer
fd20c0ab00 Fix grammar in a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28534 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-29 02:34:34 +00:00
Chris Lattner
a5d824e90c Remove a hack required by V9.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27931 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-21 15:33:35 +00:00
Chris Lattner
a3124a3d1e vector casts never reinterpret bits
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27354 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-02 05:40:28 +00:00
Chris Lattner
3787c95e86 * Fix DerivedType::dropAllTypeUses to not change the number of types in a
type when it gets refined.  This allows us to hash on this crucial value.
* Fix several issues in TypeMap::RefineAbstractType that prevent it from
  handling hash values that change correctly.
* Define hashTypeStructure to not always return 0.  :)

This last part (which depends on the first two) speeds up gccld time on eon
from 3.78s to 2.75s with a release build (a 28% speedup!).  This resolves
PR474.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24372 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-16 06:09:47 +00:00
Chris Lattner
c35abc2393 Add some dummy method impls
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24345 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-13 03:26:33 +00:00
Chris Lattner
cfe822728f Move some methods around. Refactor the parts of TypeMap that do not depend
on its template arguments into a base class so that the code isn't duplicated
5 times.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24343 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-13 03:14:09 +00:00
Chris Lattner
bcf6bc2610 Split the type refinement case completely out of the type-becomes-concrete
case, simplifying the code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24340 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-13 01:58:06 +00:00
Chris Lattner
66cafb33bc Separate the type-became-concrete case from the type-is-resolved case, the
former of which takes much less work than the later.  This speeds up linking
eon from 3.749 to 3.637s with a release build (about 3%).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24338 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-13 01:27:50 +00:00
Chris Lattner
7548590ecc Unswitch a loop, add more assertions, eliminate use of removeUserFromConcrete.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24324 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-12 08:39:48 +00:00
Chris Lattner
d4f328e8c1 Tiny speedup, improve comments and code organization.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24323 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-12 08:22:41 +00:00
Chris Lattner
d115ef8973 Force packed vectors to be a power of two in length.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24264 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-10 01:40:59 +00:00
Jeff Cohen
00b16889ab Eliminate all remaining tabs and trailing spaces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22523 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-27 06:12:32 +00:00
Chris Lattner
22cab6c752 Unbreak the sparc backend.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21598 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-27 18:57:15 +00:00
Chris Lattner
3f80a38859 don't let Reid build void*'s :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21571 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-26 20:03:33 +00:00
Chris Lattner
ea1049139e Fix a bug in my previous checkin
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21485 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-23 22:01:39 +00:00
Chris Lattner
4f0247c10d Add a method, remove last use of Type.def
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21483 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-23 22:00:09 +00:00
Misha Brukman
fd93908ae8 Remove trailing whitespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21427 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-21 23:48:37 +00:00
Chris Lattner
76da61621c correct the computation of the isAbstract bit for types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20533 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-09 17:34:27 +00:00
Chris Lattner
ded3613fef Fix a nasty order of evaluation bug that Gabor Greif ran into. Here's an
explanation from IRC:

	|sabre|	I think it's an order of evaluation thing
	|sabre|	for me, the RHS of the assignment is evaluated first
	|sabre|	getTypeDescription checks to see if ConcreteTypeDescription[Ty] contains anything
	|sabre|	since it doesn't, it computes and returns the value
	|sabre|	this gets put into the map.
	|sabre|	For you, the LHS is evaluated first.
	|sabre|	Map[Ty] (aka ConcreteTypeDescriptions[Ty]) inserts an empty string into the map, returning a reference
	|sabre|	getTypeDesc then sees the empty string in the map
	|sabre|	and returns it
	|sabre|	bork :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20394 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-02 03:54:43 +00:00
Chris Lattner
7d7a0ed4ec Allow arrays to have more than 4G elements.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19395 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-08 20:19:51 +00:00
Chris Lattner
f0228053f8 Get GEP's working with packed types. Contributed by Morten Ofstad!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18404 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-01 17:12:16 +00:00
Chris Lattner
8a7ad2d2c5 Add hooks to free all memory allocated by the singleton factories in these
files.  Patch contributed by Morten Ofstad!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17995 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-19 16:39:44 +00:00
Chris Lattner
bcb31d645d Minor cleanup and speedup. This reduces link-time for 252.eon from 35.5s
to 34.7s with a profile build.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17906 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-16 20:39:04 +00:00
Chris Lattner
8511c351dc Make this function work with non-abstract types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17905 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-16 20:30:53 +00:00
Chris Lattner
a6b10b6fcc Unfortunately the fix for the previous bug introduced the previous
exponential behavior (bork!).  This patch processes stuff with an
explicit SCC finder, allowing the algorithm to be more clear,
efficient, and also (as a bonus) correct!  This gets us back to taking
0.6s to disassemble my horrible .bc file that previously took something
> 30 mins.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16811 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-07 19:20:48 +00:00
Chris Lattner
f464ab5b86 Fix a bug in my previous change. Unfortunately this reverts most of the
speedup, but has the advantage of not breaking a bunch of programs!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16806 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-07 16:19:40 +00:00
Chris Lattner
b5c16705fd Change Type::isAbstract to have better comments, a more correct name
(PromoteAbstractToConcrete), and to use a set to avoid recomputation.
In particular, this set eliminates the potentially exponential cases
from this little recursive algorithm.

On a particularly nasty testcase, llvm-dis on the .bc file went from 34
minutes (which is when I killed it, it still hadn't finished) to 0.57s.
Remember kids, exponential algorithms are bad.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16772 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-06 16:36:46 +00:00
Reid Spencer
551ccae044 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/.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16137 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-01 22:55:40 +00:00
Brian Gaeke
715c90ba52 Packed types, brought to you by Brad Jones
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15938 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-20 06:00:58 +00:00
Chris Lattner
b4091e548e Catch aggregates passed by value sooner rather than later.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14800 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-13 20:09:51 +00:00
Chris Lattner
36002e43ec Remove unused method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14726 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-09 16:48:13 +00:00
Chris Lattner
51662c7beb The uid mapping is no more
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14708 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-08 22:31:09 +00:00