1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00
Commit Graph

961 Commits

Author SHA1 Message Date
Chris Lattner
b9f3b677ae Make sure people don't make functiontypes with an invalid return type
llvm-svn: 14654
2004-07-06 23:25:19 +00:00
Chris Lattner
5c1abfecfe Find bugs sooner rather than later. In this case, don't allow the creation
of instructions that don't have a first-class or void type.

llvm-svn: 14646
2004-07-06 17:44:17 +00:00
Reid Spencer
bfacdee814 Correct syntax typo .. ; -> :
llvm-svn: 14619
2004-07-04 12:15:11 +00:00
Reid Spencer
8a9a34f7ff - Changes for bug 122
- Remove Tabs
- Add inserters  needed since Value doesn't implement them any more
- Move some functions here to avoid cyclic header file dependencies.

llvm-svn: 14618
2004-07-04 12:14:17 +00:00
Reid Spencer
d02e1dc90d - #include <iostream> since its not in Value.h any more.
llvm-svn: 14617
2004-07-04 11:55:37 +00:00
Reid Spencer
d242724126 Constify SymbolTable's use of Type* so that it never modifies them.
llvm-svn: 14616
2004-07-04 11:55:08 +00:00
Reid Spencer
64a2a1c92b - #include <iostream> since its not in Value.h any more.
- constify use of Type* returned from symbol table.

llvm-svn: 14615
2004-07-04 11:52:49 +00:00
Reid Spencer
abf33934d2 #include <iostream> since its not in Value.h any more.
llvm-svn: 14614
2004-07-04 11:51:24 +00:00
Reid Spencer
93c3d80eb4 Adjust the slot machine to handle Types separately from Values. This was
done by doubling up the data structures so that Type based equivalents are
used. A consequence of this is overloading of function members that take a
Type* instead of a Value*. Various other cleanups related to Type != Value
(bug 122) were also implemented.

llvm-svn: 14613
2004-07-04 11:50:43 +00:00
Chris Lattner
f0af72ac49 Fix Type::isSized() to realize that "{ opaque }" is not sized
llvm-svn: 14585
2004-07-02 23:20:17 +00:00
Chris Lattner
f3e46315fb Add much better assertion checking for load and store insts.
Contributed by Vladimir Merzliakov!

llvm-svn: 14546
2004-07-01 20:23:52 +00:00
Chris Lattner
3d1c32ce27 Fold iType into Value::VTy
llvm-svn: 14435
2004-06-27 18:38:48 +00:00
Chris Lattner
56d4c0c8b2 User ctor is now inline
llvm-svn: 14431
2004-06-27 18:01:38 +00:00
Chris Lattner
476eace8f4 Instancevar was renamed
llvm-svn: 14428
2004-06-26 20:33:39 +00:00
Chris Lattner
ed76ea9025 Don't call getValueType directly. the LLVM optimizer will turn it into the same code anyway :)
llvm-svn: 14426
2004-06-26 19:40:40 +00:00
Misha Brukman
da2521c04f * Capitalize `Java'
* Sprinkle hypens liberally
* Fix some grammar in comments

llvm-svn: 14374
2004-06-24 21:47:35 +00:00
Misha Brukman
8a1352d1b3 Linker.h moved to include/llvm/Support
llvm-svn: 14349
2004-06-23 17:24:31 +00:00
Misha Brukman
cf1f753730 Moved to lib/VMCore
llvm-svn: 14348
2004-06-23 17:21:17 +00:00
Misha Brukman
f12181a902 Use a reference instead of a pointer for the ostream. The pointer was only
there to assist in the development of llvm-tv, and it no longer has a need to
modify the AsmWriter output stream.

llvm-svn: 14304
2004-06-21 21:53:56 +00:00
Chris Lattner
3a8e3bce6c Make ConstantBool act like a 1 bit ConstantInt, in order to simplify client
code.  Patch contributed by Vladimir Prus.

llvm-svn: 14280
2004-06-21 12:12:12 +00:00
Chris Lattner
fb800c656c IntrinsicLowering.cpp now lives in lib/CodeGen/
llvm-svn: 14269
2004-06-20 07:59:27 +00:00
Chris Lattner
cc465361d9 Move the IntrinsicLowering header into the CodeGen directory, as per PR346
llvm-svn: 14266
2004-06-20 07:49:54 +00:00
Chris Lattner
a1d29e1b15 compute dominator tree children in a deterministic order that does not depend
on the address of BasicBlock objects in memory.  This eliminates stuff like this:

 Inorder Dominator Tree:
   [1]  %entry
     [2]  %loopentry
-      [3]  %loopexit
       [3]  %no_exit
-        [4]  %endif
         [4]  %then
+        [4]  %endif
+      [3]  %loopexit
       [3]  %return

llvm-svn: 14253
2004-06-19 20:13:48 +00:00
Chris Lattner
ba131c993e Print out immediate dominators in program order, not in random order based on the address
of BasicBlock objects

llvm-svn: 14252
2004-06-19 20:04:47 +00:00
Chris Lattner
3c61b2dd70 Fix printing of Argument objects, problem found by Patrick Meredith
llvm-svn: 14215
2004-06-18 04:07:20 +00:00
Chris Lattner
0cd29ae2cd Rename Type::PrimitiveID to TypeId and ::getPrimitiveID() to ::getTypeID()
llvm-svn: 14201
2004-06-17 18:19:28 +00:00
Chris Lattner
18f8ae4e3e Minor cleanup
llvm-svn: 14199
2004-06-17 17:56:54 +00:00
Chris Lattner
7c3600a50e isnan is dead
llvm-svn: 14191
2004-06-15 21:52:58 +00:00
Chris Lattner
c9a6116586 Remove isnan support, correct isunordered support
llvm-svn: 14187
2004-06-15 21:42:23 +00:00
Chris Lattner
8ca8002f88 Do not dereference end iterators. It's really bad for the asmwriter's health.
This possibly fixes PR370

llvm-svn: 14181
2004-06-15 21:07:32 +00:00
Alkis Evlogimenos
173e9e832c Make assertions more consistent with the rest of the intrinsic
function verification and make it a requirement that both arguments to
llvm.isunordered are of the same type.

llvm-svn: 14165
2004-06-13 00:55:26 +00:00
Alkis Evlogimenos
9b28aef6cb Add the isunordered intrinsic.
llvm-svn: 14159
2004-06-12 19:19:14 +00:00
Chris Lattner
94a66c3038 Fix lowering to work correctly
llvm-svn: 14134
2004-06-11 02:54:02 +00:00
Chris Lattner
b07bf147cd I misled Alkis: LLVM should have isnan, not isunordered.
isunordered(X, Y) === isnan(X) | isnan(Y)

Remove isunordered, add isnan.

llvm-svn: 14132
2004-06-11 02:29:43 +00:00
Alkis Evlogimenos
1ae8b4e7c4 Add the isunordered intrinsic.
llvm-svn: 14127
2004-06-11 01:08:18 +00:00
Chris Lattner
2c6bea32de Share some code
llvm-svn: 14106
2004-06-10 01:57:38 +00:00
Chris Lattner
75e5aa4d22 Tolerate more errors
llvm-svn: 14104
2004-06-09 22:22:10 +00:00
Chris Lattner
3aa77d0e5e Make the asmwriter much more tolerant of errors (which are common when working
on new front-ends and stuff).  Also get rid of some tabs that snuck in.

llvm-svn: 14100
2004-06-09 19:41:19 +00:00
Reid Spencer
a07033fecd Made it possible for the printInfoComment method to invoke getSlot in
such a way that if the Value being printed is standalone that we don't
assert and abort but just print ":??" for the slot number instead.

llvm-svn: 14097
2004-06-09 15:26:53 +00:00
Chris Lattner
6a6148fda0 Workaround or a VS miscompilation bug
llvm-svn: 14078
2004-06-08 23:21:39 +00:00
Chris Lattner
4996a6e7cb Fix a link error using VS8.0
llvm-svn: 14071
2004-06-08 17:53:24 +00:00
Chris Lattner
a1c9755c7c Fix PR361.
Dominance properties don't hold in unreachable code

llvm-svn: 14053
2004-06-07 23:07:33 +00:00
Chris Lattner
6e63236846 Fix GCC warning
llvm-svn: 14045
2004-06-05 17:44:48 +00:00
Chris Lattner
dfca9d7f7b Fix GCC warnings
llvm-svn: 14044
2004-06-05 17:43:52 +00:00
Chris Lattner
c0f5e68d4d Remove an unused variable.
Work around for bogus errors: no those static functions don't need to
be executed to be initialized!

llvm-svn: 14040
2004-06-05 01:05:19 +00:00
Chris Lattner
c107a4d1c5 Add missing #include
llvm-svn: 14037
2004-06-05 00:24:59 +00:00
Chris Lattner
678cafb8a9 Work around VS bug
llvm-svn: 14036
2004-06-05 00:22:04 +00:00
Chris Lattner
6e6ab3888b As much as I dislike doing this, it's the only fix for VC8.0 that I can come
up with, even though it's perfectly conformant code.  :(

llvm-svn: 14034
2004-06-05 00:11:27 +00:00
Chris Lattner
cf111f5951 Remove unused var
llvm-svn: 14033
2004-06-05 00:03:27 +00:00
Chris Lattner
f609ec6329 Squelch a warning
llvm-svn: 14032
2004-06-04 23:53:20 +00:00
Chris Lattner
f6950439d6 Delete some unreachable code
llvm-svn: 14031
2004-06-04 23:52:36 +00:00
Misha Brukman
99137fd27a * No more CachedWriter::setStream()
* ostream is back to being a reference instead of a pointer
* Output single characters as chars, not as length-1 strings

llvm-svn: 14030
2004-06-04 21:11:51 +00:00
Chris Lattner
871a5eb37c Ugh, apparently there is no common ground here.
llvm-svn: 14026
2004-06-04 20:48:51 +00:00
Chris Lattner
4bd463c15e Squish a warning
llvm-svn: 14020
2004-06-04 20:14:29 +00:00
Chris Lattner
e78fedecf2 * Verify function prototypes, not just functions with bodies.
* Verify that functions do not take aggregates as arguments.

llvm-svn: 13984
2004-06-03 06:38:43 +00:00
John Criswell
1a6863e08b Modified calcTypeName() so that it does not allocate a std::string for
every recursive call.
This makes it more robust for deeply nested, unnamed types.

llvm-svn: 13915
2004-06-01 14:54:08 +00:00
Reid Spencer
d98738fe4d Fix a bug that Chris asserts emphatically is a bug. The changed clause
would always return false because the Type of a type value is always
Type::TypeTY and can never be a floating point type.

llvm-svn: 13902
2004-05-30 01:19:48 +00:00
Reid Spencer
00aca582a2 Moved this file to lib/Bytecode/Writer because its used there only.
llvm-svn: 13900
2004-05-30 00:09:32 +00:00
Chris Lattner
9bf4cbeb4b Don't use size() when you mean empty()
llvm-svn: 13876
2004-05-28 05:40:19 +00:00
Reid Spencer
0030dfe486 Clean up a comment.
llvm-svn: 13860
2004-05-27 22:04:46 +00:00
Reid Spencer
693dcc2f89 Fix for bug 348.
The SymbolTable changes caused this one too.

llvm-svn: 13859
2004-05-27 21:58:13 +00:00
Alkis Evlogimenos
2c463a8a99 Add constructors that take a BasicBlock to append to, to the rest of
the llvm::Instruction hierarchy.

llvm-svn: 13800
2004-05-27 00:15:23 +00:00
Alkis Evlogimenos
bf27c54995 Inline trivial constructors.
llvm-svn: 13797
2004-05-26 22:07:18 +00:00
Reid Spencer
b7b1b9d4b2 Several clean ups suggested by Chris: remove tabs, make SlotMachine do lazy
initialization so we don't scan large Modules/Functions needlessly, tighten
up restrictions on what can be put in SlotMachine (no Constants that aren't
GlobalValues).

llvm-svn: 13796
2004-05-26 21:56:09 +00:00
Alkis Evlogimenos
edff018f18 Refactor common initialization code in private init() functions.
This is a first step in supplying append to basic block constructors
for all instruction types.

llvm-svn: 13793
2004-05-26 21:41:09 +00:00
Reid Spencer
dccf1747a1 Part of bug 122:
This change removes the BuildBytecodeInfo flag from the SlotCalculator
class. This flag was needed to distinguish between the Bytecode/Writer
and the AsmWriter. Now that AsmWriter doesn't use SlotCalculator, we can
remove this flag and simplify some code. Also, some minor name changes
to CachedWriter.h needed to be committed (missed in previous commit).

llvm-svn: 13785
2004-05-26 07:37:11 +00:00
Reid Spencer
58bad426cc Part of bug 122. Removed dependency of AsmWriter on SlotCalculator by
incorporating a significantly simpler "SlotMachine" into this file. The
SlotMachine is tailored for use by only the AsmWriter whose requirements
for slot numbers are vastly different than from the Bytecode/Writer. Code
change passes all Feature and Regression tests.

llvm-svn: 13784
2004-05-26 07:18:52 +00:00
Reid Spencer
756f392365 Document a couple functions.
llvm-svn: 13761
2004-05-25 18:14:38 +00:00
Reid Spencer
2791d48685 Made it illegal to pass a Type* through one of the Value* interfaces. The
SymbolTable will now assert if this is done. This didn't find any incorrect
usage of SymbolTable but will prevent future mistakes until Type != Value.

llvm-svn: 13755
2004-05-25 15:20:47 +00:00
Reid Spencer
fec48b0d9d Convert to SymbolTable's new iteration interface.
llvm-svn: 13754
2004-05-25 08:53:40 +00:00
Reid Spencer
e6cf613d2a Convert to SymbolTable's new iteration interface. Remove tabs.
llvm-svn: 13753
2004-05-25 08:53:29 +00:00
Reid Spencer
e6e0da0b9f Completely rewrote the class. SymbolTable now separates Type* from Value* in preparation\
for making Type not derive from Value. There are now separate interfaces \
for looking up, finding, and inserting Types and Values. There are also \
three separate iterator interfaces, one for type planes, one for the types \
(type type plane), and one for values within a type plane. See the \
documentation in the Header file.

llvm-svn: 13752
2004-05-25 08:52:42 +00:00
Reid Spencer
08e75b22a5 Convert to SymbolTable's new lookup and iteration interfaces.
llvm-svn: 13751
2004-05-25 08:52:20 +00:00
Chris Lattner
84431acbf1 Implement some helpers
llvm-svn: 13738
2004-05-25 05:32:43 +00:00
Chris Lattner
5f65590915 Recognize and verify the new GC intrinsics.
llvm-svn: 13687
2004-05-23 21:16:51 +00:00
Chris Lattner
30cc4edfc3 Fix for PR340: Verifier misses malformed switch instruction
llvm-svn: 13618
2004-05-21 16:47:21 +00:00
Brian Gaeke
5d639ac9f3 Fold two assertions with backwards error messages into one with a
correct error message.

llvm-svn: 13590
2004-05-17 21:15:18 +00:00
Chris Lattner
da4ac5d876 Implement the AddPrototypes method
llvm-svn: 13432
2004-05-09 04:29:57 +00:00
John Criswell
ec6d378d21 Don't call getForwardedType() twice, as recommended by Chris.
llvm-svn: 13391
2004-05-06 22:15:47 +00:00
John Criswell
2d7c5ae892 Fix for PR#330.
When looking at getelementptr instructions, make sure to use a forwarded
type.  We want to do this because a DerivedType may drop its uses and then
refine its users, who may then use another user who hasn't been refined yet.
By getting the forwarded type, we always ensure that we're looking at a
Type that isn't in a halfway refined state.

Now, I should be able to put this stuff in PATypeHandle, but it doesn't work
for some reason.  This should do for now.

llvm-svn: 13386
2004-05-06 21:18:08 +00:00
John Criswell
b51e979c2c Fixed inconsistent indentation.
llvm-svn: 13363
2004-05-04 21:46:05 +00:00
Misha Brukman
5f5f6ca775 class AssemblyWriter:
* Make contained ostream pointer, not reference
* Allow setting of that ostream via setStream()

class CachedWriter:
* setStream() in turn calls setStream() on the AssemblyWriter

llvm-svn: 13247
2004-04-28 19:24:28 +00:00
Misha Brukman
d408a510b8 * Add ability to print out type as symbolic
* Add Module accessor to AssemblyWriter

llvm-svn: 13227
2004-04-28 15:31:21 +00:00
Chris Lattner
02c65b5395 Changes to fix up the inst_iterator to pass to boost iterator checks. This
patch was graciously contributed by Vladimir Prus.

llvm-svn: 13185
2004-04-27 15:13:33 +00:00
Misha Brukman
7d2413f9ec I'm allergic to the word `stuff'.
llvm-svn: 13096
2004-04-21 18:27:56 +00:00
Misha Brukman
cb5de6bca6 Fix retriving parent Function.
llvm-svn: 13001
2004-04-16 17:37:12 +00:00
Misha Brukman
aadcd46d25 Assert if deleting BasicBlock before removing it from Function.
llvm-svn: 12983
2004-04-16 15:47:21 +00:00
Chris Lattner
644ad23b21 Make sure to check for a very bad class of errors: an instruction
that does not dominate all of its users, but is in the same basic block as
its users.  This class of error is what caused the mysterious CBE only
failures last night.

llvm-svn: 12979
2004-04-16 05:51:47 +00:00
John Criswell
bed6463449 Remove the return type check for llvm.readio. This check is done for all
functions and is not needed here.
Simplify the pointer type check per Chris's suggestions.

llvm-svn: 12945
2004-04-14 15:06:48 +00:00
John Criswell
e00ecd7e84 Added code to verify that llvm.readio's pointer argument returns something
that matches its return type.

llvm-svn: 12944
2004-04-14 14:49:36 +00:00
John Criswell
11f7f60028 Finish adding the llvm.readio and llvm.writeio intrinsics.
Sorry these didn't get in yesterday.

llvm-svn: 12942
2004-04-14 13:46:52 +00:00
Chris Lattner
226ea8166e Add a missing break, which caused a crash in an obscure situation
llvm-svn: 12825
2004-04-11 01:29:30 +00:00
John Criswell
c9c191c41b Reversed the order of the llvm.writeport() operands so that the value
is listed first and the address is listed second.

llvm-svn: 12795
2004-04-09 19:09:14 +00:00
John Criswell
07c581695d Added the llvm.readport and llvm.writeport intrinsics.
The Verifier ensures that their parameters are of integral types and have
the correct sign, but it does not enforce any size restrictions because
such restrictions are platform dependent.

llvm-svn: 12781
2004-04-08 20:27:38 +00:00
Chris Lattner
9236135e8f Support getelementptr instructions which use uint's to index into structure
types and can have arbitrary 32- and 64-bit integer types indexing into
sequential types.

llvm-svn: 12653
2004-04-05 01:30:19 +00:00
Chris Lattner
eb1caeca2a Add ConstantExpr::get(Sign|Zero)Extend methods
llvm-svn: 12648
2004-04-04 23:20:30 +00:00
Chris Lattner
0d20ff2e86 Make the verifier API more complete and useful.
Patch contributed by Reid Spencer

llvm-svn: 12609
2004-04-02 15:45:08 +00:00
Chris Lattner
5a789b5e06 Add support for constant expr casts
llvm-svn: 12564
2004-03-31 02:56:11 +00:00
Chris Lattner
1d78eb6094 Fix a latent bug in select constantexpr handling that was broke 253.perlbmk
llvm-svn: 12562
2004-03-30 22:51:03 +00:00
Chris Lattner
50dc89f874 Handle -0.0 correctly
llvm-svn: 12530
2004-03-29 19:51:24 +00:00
Chris Lattner
7f5d56b43a Add a bunch of methods that should have been added a long time ago.
llvm-svn: 12526
2004-03-29 02:37:53 +00:00
Chris Lattner
27cbe8d690 Add another check
llvm-svn: 12525
2004-03-29 00:29:36 +00:00
Chris Lattner
44acd09520 Fix an assertion
Contributed by Reid Spencer

llvm-svn: 12524
2004-03-29 00:17:20 +00:00
Chris Lattner
b34cfff038 Add two methods which have been needed for a long time: Type::get(Un)signedVersion
llvm-svn: 12522
2004-03-26 21:43:22 +00:00
Chris Lattner
f943b487c5 Catch some more cases of broken code. The loop extractor seems to be creating
situations where there is a branch that goes to a block in another function.

llvm-svn: 12379
2004-03-14 03:23:54 +00:00
Chris Lattner
17042ee9ad verifyFunction has been broken for a long time now. Fix it.
llvm-svn: 12377
2004-03-14 03:16:15 +00:00
Chris Lattner
f7bc6fd913 Rename the intrinsic enum values for llvm.va_* from Intrinsic::va_* to
Intrinsic::va*.  This avoid conflicting with macros in the stdlib.h file.

llvm-svn: 12356
2004-03-13 00:24:00 +00:00
Misha Brukman
6eb48bab7b Keep transitively-required passes alive for queries to work after the initial
user pass is destroyed.

llvm-svn: 12332
2004-03-12 06:16:28 +00:00
Chris Lattner
b53ea9f895 Add support for checking the select instruction
llvm-svn: 12325
2004-03-12 05:54:31 +00:00
Chris Lattner
a5cc2410f3 Know the opcode name of the select instruction
llvm-svn: 12324
2004-03-12 05:54:20 +00:00
Chris Lattner
c84ec93d3e Add support for select constant expressions. Use reserve a bit more to avoid
memory wasteage.

llvm-svn: 12323
2004-03-12 05:54:04 +00:00
Chris Lattner
9ca4f0776f Add new function
llvm-svn: 12322
2004-03-12 05:53:41 +00:00
Chris Lattner
f0a39f27e0 Teach the constant folder how to do select instructions
llvm-svn: 12321
2004-03-12 05:53:32 +00:00
Chris Lattner
aa815619b4 Print select instructions correctly
llvm-svn: 12320
2004-03-12 05:53:14 +00:00
Misha Brukman
8eac0e432a Fix indentation.
llvm-svn: 12298
2004-03-11 23:53:51 +00:00
Chris Lattner
94d2b3a524 Adjust to new interface
llvm-svn: 12231
2004-03-08 18:51:45 +00:00
Chris Lattner
38c2e1d1df Implement test/Regression/Assembler/2004-03-07-FunctionAddressAlignment.llx
llvm-svn: 12218
2004-03-08 06:17:35 +00:00
Chris Lattner
23980d3a7c Remove Module::mutateConstantPointerRef, which is now thankfully dead!
This is one small step towards the complete obliteration of
ConstantPointerRef's entirely!! Woot!

llvm-svn: 12216
2004-03-08 06:16:10 +00:00
Chris Lattner
aa5d8cb72f Eliminate nightmarish API
llvm-svn: 12214
2004-03-08 06:11:10 +00:00
Misha Brukman
754f11778f Doxygenify comments.
llvm-svn: 12071
2004-03-02 00:22:19 +00:00
Misha Brukman
d9ed820702 * If a badref has a name, print it out for ease of debugging
* Doxygenify (some) comments

llvm-svn: 12057
2004-03-01 19:48:13 +00:00
Chris Lattner
6728dfdfe8 Fix -debug-pass=Executions, which relied on Function, Module, and BasicBlock
being annotable

llvm-svn: 12013
2004-02-29 22:37:04 +00:00
Brian Gaeke
d551a8b5fe Fix typo in comment
llvm-svn: 11966
2004-02-28 21:55:18 +00:00
Chris Lattner
644af802c9 Fix Regression/Assembler/2004-02-27-SelfUseAssertError.ll
llvm-svn: 11913
2004-02-27 17:28:25 +00:00
Chris Lattner
aa6f7cb4e4 Make sure that at least one virtual method is defined in a .cpp file to avoid
having the compiler emit RTTI and vtables to EVERY translation unit.

llvm-svn: 11871
2004-02-26 07:24:18 +00:00
Chris Lattner
57ee51ae0b Make the verifier a little more explicit about this problem.
llvm-svn: 11811
2004-02-24 22:06:07 +00:00
Chris Lattner
727748b382 Get all instruction definitions
llvm-svn: 11706
2004-02-22 06:25:38 +00:00
Chris Lattner
28ab65caf2 Adjust to recent changes
llvm-svn: 11514
2004-02-17 03:03:47 +00:00
Chris Lattner
11c0e5b684 Move the folding of gep null, 0, 0, 0 to a place where it can be shared and
enjoyed by all, fixing a fixme.  Add an assert

llvm-svn: 11505
2004-02-16 20:46:13 +00:00
Chris Lattner
b5914223b8 By default, llvm.setjmp/llvm.longjmp intrinsics get lowered to their libc counterparts
llvm-svn: 11483
2004-02-15 22:24:51 +00:00
Chris Lattner
ded1ad2846 Refactor code. Now the intrinsic lowering pass tries to recycle preexisting
prototypes, even if they don't precisely match what it would prefer to use.
This fixes: CBackend/2004-02-15-PreexistingExternals.llx compiling it into:

  ltmp_0_30 = memcpy(l14_C, 4u, 17);
  ltmp_1_30 = memcpy(((int *)l27_A), ((unsigned )(long)l27_B), ((int )123u));

instead of:

  ltmp_0_30 = memcpy(l14_C, 4u, 17);
  ltmp_1_27 = l43_memcpy(l27_A, l27_B, 123u);

Which does the wrong thing as you could imagine.

llvm-svn: 11481
2004-02-15 22:16:39 +00:00
Chris Lattner
28131460da Adjustments to support the new ConstantAggregateZero class
llvm-svn: 11474
2004-02-15 05:55:15 +00:00
Chris Lattner
363cd9e4b8 Add a new ConstantAggregateZero class, to fix PR239. This makes zero
initializers for constant structs and arrays take constant space, instead of
space proportinal to the number of elements.  This reduces the memory usage of
the LLVM compiler by hundreds of megabytes when compiling some nasty SPEC95
benchmarks.

llvm-svn: 11470
2004-02-15 05:53:04 +00:00
Chris Lattner
0f819b9523 ConstantArray::get and ConstantStruct::get now just return pointers to
'Constant', instead of specific subclass pointers.  In the future, these will
return an instance of ConstantAggregateZero if all of the inputs are zeros.

llvm-svn: 11467
2004-02-15 04:14:47 +00:00
Chris Lattner
52cc69f39e Remove dependence on return type of ConstantStruct::get
llvm-svn: 11466
2004-02-15 04:07:32 +00:00
Chris Lattner
3fd2b573f1 Remove dependence on the return type of ConstantArray::get
llvm-svn: 11463
2004-02-15 04:05:58 +00:00
Chris Lattner
c8d0942108 Keep a cache of non-abstract null arrays and structs. This speeds up llvm-dis
from 16.57 -> 13.46s on 129.compress.

llvm-svn: 11462
2004-02-15 02:46:46 +00:00
Chris Lattner
a25668bd6d A target that doesn't support these intrinsics will still meet spec (the
intrinsic will always produce zero), but it will behave unexpectedly, so
warn like GCC does.

llvm-svn: 11444
2004-02-14 04:52:06 +00:00
Chris Lattner
cdfcb976c7 Add llvm.memset/frameaddress/returnaddress intrinsics.
llvm-svn: 11431
2004-02-14 02:47:17 +00:00
Chris Lattner
c908f6b738 Add support for the llvm.memmove intrinsic
Patch graciously contributed by Reid Spencer!

llvm-svn: 11355
2004-02-12 18:11:20 +00:00
Chris Lattner
0d988a0d14 Implement the llvm.memcpy intrinsic
llvm-svn: 11349
2004-02-12 17:01:09 +00:00
Chris Lattner
43553da3a0 Remove obsolete method
llvm-svn: 11302
2004-02-11 01:17:33 +00:00
Chris Lattner
ef4a05f780 Remove the statistics
llvm-svn: 11243
2004-02-09 21:01:23 +00:00
Chris Lattner
6deb7ad03b Speed up type resolution some more. On the testcase in PR224, for example,
this speeds up a release llvm-as from 21.95s to 11.21s, because before it
would do an expensive traversal of the type-graph of every type resolved.

llvm-svn: 11242
2004-02-09 20:23:44 +00:00
Chris Lattner
f7f7d11eac Implement the hashing scheme in an attempt to speed up the "slow" case in
type resolution.  Unfortunately it doesn't help.

Also delete some dead debugging code.

llvm-svn: 11237
2004-02-09 18:32:40 +00:00
Chris Lattner
57a6b877ba Code cleanup in preparation for later changes. Now that ContainedTy's are
consistent across the various type classes, we can factor out a LOT more
almost-identical code.  Also, add a couple of temporary statistics.

llvm-svn: 11232
2004-02-09 16:35:14 +00:00
Chris Lattner
f231cb60f4 Now that all of the derived types have disciplined interfaces, we can eliminate
all of the ad-hoc storage of contained types.  This allows getContainedType to
not be virtual, and allows us to entirely delete the TypeIterator class.

llvm-svn: 11230
2004-02-09 05:40:24 +00:00
Chris Lattner
16690fad3d Adjust to the changed StructType interface. In particular, getElementTypes() is gone.
llvm-svn: 11228
2004-02-09 04:37:31 +00:00
Chris Lattner
a1757d1d91 Start using the new and improve interface to FunctionType arguments
llvm-svn: 11224
2004-02-09 04:14:01 +00:00
Chris Lattner
b771939ef3 Two problems with these lines of code:
1. The "work" was not in the assert, so it was punishing the optimized release
 2. getNamedFunction is _very_ expensive in large programs.  It is not designed
    to be used like this, and was taking 7% of the execution time of the code
    generator on perlbmk.

Since the assert "can never fail", I'm just killing it.

llvm-svn: 11214
2004-02-09 00:59:07 +00:00