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

438 Commits

Author SHA1 Message Date
Misha Brukman
e096a50cb7 Remove trailing whitespace, patch by Markus Oberhumer.
llvm-svn: 21379
2005-04-20 16:05:03 +00:00
Chris Lattner
f53c9e2578 Fix the 3 regressions last night, due to my buggy patch from yesterday.
llvm-svn: 20689
2005-03-19 17:35:11 +00:00
Chris Lattner
35084f46a3 remove use of getPrev() and getNext() on ilist nodes.
llvm-svn: 20673
2005-03-18 16:12:37 +00:00
Chris Lattner
7a9186cb47 stop using arg_front
llvm-svn: 20599
2005-03-15 05:03:36 +00:00
Chris Lattner
33f53a1f4f stop using arg_back
llvm-svn: 20598
2005-03-15 04:59:17 +00:00
Chris Lattner
4b688a1c70 This mega patch converts us from using Function::a{iterator|begin|end} to
using Function::arg_{iterator|begin|end}.  Likewise Module::g* -> Module::global_*.

This patch is contributed by Gabor Greif, thanks!

llvm-svn: 20597
2005-03-15 04:54:21 +00:00
Chris Lattner
667186f10f Make sure to remove all dead type names from the symbol table, not just
struct types.  This fixes Regression/CodeGen/CBackend/2005-03-08-RecursiveTypeCrash.ll,
a crash on Java output that Alkis reported.

llvm-svn: 20519
2005-03-08 16:19:59 +00:00
Misha Brukman
e29de97ab7 Single characters should be printed out as chars, not strings.
llvm-svn: 20515
2005-03-08 00:26:08 +00:00
Chris Lattner
a518cf568a simplify some code.
llvm-svn: 20471
2005-03-06 02:28:23 +00:00
Chris Lattner
4439f1686f Print -X like this:
double test(double l1_X) {
  return (-l1_X);
}

instead of like this:

double test(double l1_X) {
  return (-0x0p+0 - l1_X);
}

llvm-svn: 20423
2005-03-03 21:12:04 +00:00
Chris Lattner
8074739aa2 Do not lower malloc's to pass "sizeof" expressions like this:
ltmp_0_7 = malloc(((unsigned )(&(((signed char (*)[784])/*NULL*/0)[1u]))));

Instead, just emit the literal constant, like this:

  ltmp_0_7 = malloc(784u);

This works around a bug in ICC 8.1 compiling the CBE generated code.  :-(

llvm-svn: 20415
2005-03-03 01:04:50 +00:00
Chris Lattner
9d57998cda Remove tabs from file.
llvm-svn: 20380
2005-02-28 19:36:15 +00:00
Chris Lattner
b2720f5b57 Add support to the C backend for llvm.prefetch. Patch contributed by
Justin Wick!

llvm-svn: 20378
2005-02-28 19:29:46 +00:00
Chris Lattner
bf72146607 Fix volatile load/store of pointers. Consider this testcase:
void %test(int** %P) {
  %A = volatile load int** %P
  ret void
}

void %test2(int*** %Q) {
  %P = load int*** %Q
  volatile store int** %P, int*** %Q
  ret void
}

instead of emitting:

void test(int **l1_P) {
  int *l2_A;

  l2_A = (int **((volatile int **)l1_P));
  return;
}
void test2(int ***l2_Q) {
  int **l1_P;

  l1_P = *l2_Q;
  *((volatile int ***)l2_Q) = l1_P;
  return;
}

... which is loading/storing volatile pointers, not through volatile pointers,
emit this (which is right):

void test(int **l1_P) {
  int *l3_A;

  l3_A = *((int * volatile*)l1_P);
  return;
}
void test2(int ***l2_Q) {
  int **l1_P;

  l1_P = *l2_Q;
  *((int ** volatile*)l2_Q) = l1_P;
  return;
}

llvm-svn: 20191
2005-02-15 05:52:14 +00:00
Misha Brukman
7b6a863954 Write out single characters as chars, not strings.
llvm-svn: 20179
2005-02-14 18:52:35 +00:00
Chris Lattner
ef836a918e Implement CodeGen/CBackend/2005-02-14-VolatileOperations.ll
Volatile loads and stores need to emit volatile pointer operations in C.

llvm-svn: 20177
2005-02-14 16:47:52 +00:00
Misha Brukman
1e8e58b829 Fix hyphenation in output comment
llvm-svn: 19954
2005-01-31 06:19:57 +00:00
Reid Spencer
e48557f583 Fix alloca support for Cygwin. On cygwin its __alloca not __builtin_alloca
llvm-svn: 19776
2005-01-23 04:32:47 +00:00
Jeff Cohen
146e5504e5 Fix CBE code so that it compiles with VC++.
llvm-svn: 19303
2005-01-06 04:21:49 +00:00
Chris Lattner
37b9eef884 Fix PR490
Fix testcase CodeGen/CBackend/2004-12-28-LogicalConstantExprs.ll

llvm-svn: 19176
2004-12-29 04:00:09 +00:00
Chris Lattner
cf5cd542d4 Fix PR485, instead of emitting zero sized arrays, emit arrays of size 1.
llvm-svn: 18974
2004-12-15 23:13:15 +00:00
Chris Lattner
0e9a9d2098 When generating code for X86 targets, make sure the fp control word is set
to 64-bit precision, not 80 bits.

llvm-svn: 18915
2004-12-13 21:52:52 +00:00
Brian Gaeke
1da3720799 Emit correct prototype for __builtin_alloca on V8.
llvm-svn: 18745
2004-12-10 05:44:45 +00:00
Chris Lattner
bf9258ba8b Move lower intrinsics before FP constant emission, in case
intrinsic lowering ever introduces constants.

Rename local symbols before printing function bodies, fixing 255.vortex
with the CBE!!!

llvm-svn: 18534
2004-12-05 06:49:44 +00:00
Chris Lattner
40e7175e44 Fix test/Regression/CodeGen/CBackend/2004-12-03-ExternStatics.ll and
PR472

llvm-svn: 18459
2004-12-03 17:19:10 +00:00
John Criswell
faf1e07531 Reverting revision 1.209.
Including alloca.h on Solaris brings in the prototype of strftime(), which
breaks compilation of CBE generated code.

llvm-svn: 18435
2004-12-02 19:02:49 +00:00
Chris Lattner
0abd8109fa Do not let GCC emit a warning for INT64_MIN
llvm-svn: 18398
2004-11-30 21:33:58 +00:00
Brian Gaeke
48f8e8b05a Sparcs behave better if we use <alloca.h> and avoid messing with __builtin_alloca.
llvm-svn: 18397
2004-11-30 21:27:01 +00:00
Chris Lattner
3684294c71 Hack around stupidity in GCC, fixing Burg with the CBE and
CBackend/2004-11-13-FunctionPointerCast.llx

llvm-svn: 17710
2004-11-13 22:21:56 +00:00
Reid Spencer
d3f7233495 Change Library Names Not To Conflict With Others When Installed
llvm-svn: 17286
2004-10-27 23:18:45 +00:00
John Criswell
3c14d0815c Removed dead method, printPHICopiesForSuccessors().
llvm-svn: 17216
2004-10-25 18:41:50 +00:00
John Criswell
259f362897 Modified switch generation so that only the phi values associated with the
destination basic block are copied.

llvm-svn: 17212
2004-10-25 18:30:09 +00:00
Reid Spencer
e48ba34fd4 We won't use automake
llvm-svn: 17155
2004-10-22 03:35:04 +00:00
John Criswell
0ba9295e3c Small performance improvement in generated C code:
Instead of unconditionally copying all phi node values into temporaries for
all successor blocks, generate code that will determine what successor
block will be called and then copy only those phi node values needed by
the successor block.

This seems to cut down namd execution time from being 8% higher than GCC to
4% higher than GCC.

llvm-svn: 17144
2004-10-20 14:38:39 +00:00
Reid Spencer
ce514b1c2c Initial automake generated Makefile template
llvm-svn: 17136
2004-10-18 23:55:41 +00:00
Chris Lattner
5ae94ef614 Print a semicolon for the unreacahble instruction. This fixes problems
where C requires semicolons in some cases to indicate null statements.

llvm-svn: 17107
2004-10-17 23:49:11 +00:00
Chris Lattner
caf0d76a8a The first hunk corrects a bug when printing undef null values. We would print
0->field, which is illegal.  Now we print ((foo*)0)->field.

The second hunk is an optimization to not print undefined phi values.

llvm-svn: 17094
2004-10-17 17:48:59 +00:00
Chris Lattner
08ad95ec1f Add support for unreachable and undef
llvm-svn: 17048
2004-10-16 18:12:13 +00:00
Reid Spencer
e6418ec30f Update to reflect changes in Makefile rules.
llvm-svn: 16950
2004-10-13 11:46:52 +00:00
Chris Lattner
2bc979427d Fix a warning that is emitted on the suns
llvm-svn: 16917
2004-10-11 15:50:40 +00:00
Reid Spencer
1b7459b29d Initial version of automake Makefile.am file.
llvm-svn: 16893
2004-10-10 22:20:40 +00:00
Chris Lattner
c959314701 Really fix FreeBSD, which apparently doesn't tolerate the extern.
Thanks to Jeff Cohen for pointing out my goof.

llvm-svn: 16762
2004-10-06 04:21:52 +00:00
Chris Lattner
b2e8fdc431 FreeBSD uses GCC. Patch contributed by Jeff Cohen!
llvm-svn: 16756
2004-10-06 03:15:44 +00:00
Alkis Evlogimenos
7ff66b2884 Pull assignment out of for loop conditional in order for this to
compile under windows. Patch contributed by Paolo Invernizzi!

llvm-svn: 16534
2004-09-28 02:40:37 +00:00
Chris Lattner
43c0372c0b 'Pass' should now not be derived from by clients. Instead, they should derive
from ModulePass.  Instead of implementing Pass::run, then should implement
ModulePass::runOnModule.

llvm-svn: 16436
2004-09-20 04:48:05 +00:00
Reid Spencer
c4abcbefb1 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/.

llvm-svn: 16137
2004-09-01 22:55:40 +00:00
Brian Gaeke
69fc098326 Previous checkin broke printf(%a) support for fp constants-- re-fix it.
llvm-svn: 16051
2004-08-25 19:37:26 +00:00
Brian Gaeke
8b65b55ec1 New version of Bill Wendling's PR33 patch.
llvm-svn: 16050
2004-08-25 19:00:42 +00:00
Chris Lattner
43abe1a0d8 Paper over CBackend/2004-08-09-va-end-null.ll
Note that this indicates a serious problem with the way we are emitting varargs,
but this should not be properly fixed until after 1.3.

This patch SHOULD go into 1.3.

llvm-svn: 15602
2004-08-10 00:19:16 +00:00
Chris Lattner
1649c7d308 Temporarily disable this code, as it is emitting LLVM_NAN("nan") which results in a call to the
glibc 'nan' function because the initializer is not a string.  This breaks when used in a global
initializer.  Try compiling this testcase for example:

%X = global float <some nan value>

llvm-svn: 15223
2004-07-25 22:36:35 +00:00
Brian Gaeke
d8775ad4f1 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
Reid Spencer
7f33869f9b bug 122:
- Replace ConstantPointerRef usage with GlobalValue usage

llvm-svn: 14953
2004-07-18 00:44:37 +00:00
Chris Lattner
c4888ccda7 Patches towards fixing PR341
llvm-svn: 14841
2004-07-15 02:14:30 +00:00
Misha Brukman
da8ed5f4d5 Apple's MacOS X is another OS which does not provide alloca() via <alloca.h>
llvm-svn: 14781
2004-07-12 23:37:18 +00:00
Chris Lattner
9e183d06a6 Delete the allocate*TargetMachine function, which is now dead .
llvm-svn: 14755
2004-07-11 04:16:31 +00:00
Chris Lattner
b67e3b01bc Make these format a bit nicer
llvm-svn: 14747
2004-07-11 03:27:42 +00:00
Chris Lattner
2ada866a78 Auto-registrate target
llvm-svn: 14745
2004-07-11 02:48:49 +00:00
Reid Spencer
50ec3f9325 Add #include <iostream> since Value.h does not #include it any more.
llvm-svn: 14622
2004-07-04 12:19:56 +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
0cd29ae2cd Rename Type::PrimitiveID to TypeId and ::getPrimitiveID() to ::getTypeID()
llvm-svn: 14201
2004-06-17 18:19:28 +00:00
Chris Lattner
42730da855 <alloca.h> on cygwin pulls in a ton of stuff (macros and function protos)
that we REALLY don't want in the CBE code.

With this fix, the CBE passes all of the MultiSource tests on cygwin that
it does on linux.  Yaay!

llvm-svn: 13975
2004-06-02 23:10:26 +00:00
Chris Lattner
4e2777cb30 Stubs are no longer needed
llvm-svn: 13951
2004-06-02 05:53:52 +00:00
Chris Lattner
a49f11bec4 Fix the big regression that has been killing the nightly tester these last
few days.  Apparently the old symbol table used to auto rename collisions in
the type symbol table and the new one does not.  It doesn't really make sense
for the new one to do so, so we just make the client do it.

llvm-svn: 13877
2004-05-28 05:47:27 +00:00
Chris Lattner
75036dce04 Minor changes. Switch to a SymbolTable remove that does not take linear time
llvm-svn: 13874
2004-05-28 05:30:51 +00:00
Chris Lattner
a1a78f0b68 Fix PR344: the incorrect remove was being used.
llvm-svn: 13790
2004-05-26 17:20:52 +00:00
Reid Spencer
fec48b0d9d Convert to SymbolTable's new iteration interface.
llvm-svn: 13754
2004-05-25 08:53:40 +00:00
Chris Lattner
1e22b42cb6 Add support for accurate garbage collection to the LLVM code generators
llvm-svn: 13696
2004-05-23 21:23:35 +00:00
Chris Lattner
b92b7d2050 Fix to make the CBE always emit comparisons inline. Hopefully this will
fix the really bad code we're getting on PPC.

llvm-svn: 13609
2004-05-20 20:25:50 +00:00
Chris Lattner
8ccfc21a0f syntactically loopify natural loops so that the GCC loop optimizer can find them. This should *dramatically* improve the performance of CBE compiled code on targets that depend on GCC's loop optimizations (like PPC)
llvm-svn: 13438
2004-05-09 20:41:32 +00:00
Chris Lattner
c6a63660e6 Do not emit prototypes for setjmp/longjmp, as they are handled specially
llvm-svn: 13437
2004-05-09 16:03:29 +00:00
Chris Lattner
4926af5c32 Make the floating point constant pools local to each function, split the
FindUsedTypes manipulation stuff out to be a seperate pass, and make the
main CWriter be a function pass now!

llvm-svn: 13435
2004-05-09 06:20:51 +00:00
Chris Lattner
37abb037bf Get this looking more like a function pass.
llvm-svn: 13433
2004-05-09 04:30:20 +00:00
Chris Lattner
99b7c2b532 Print all PHI copies for successor blocks before the terminator, whether it be a conditional branch or switch.
llvm-svn: 13430
2004-05-09 03:42:48 +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
Chris Lattner
ef90bac3e3 Add support for select constant expressions to the CBE, fixing SIOD
llvm-svn: 12589
2004-04-01 05:28:26 +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
Chris Lattner
e536e15ce1 ADd support for select instructions
llvm-svn: 12316
2004-03-12 05:52:14 +00:00
Chris Lattner
6978f97701 SPECIFY a target data to initialize the CBE target with. Until now we have
been using the default target data layout object to lower malloc instructions,
causing us to allocate more memory than we needed!  This could improve the
performance of the CBE generated code substantially!

llvm-svn: 12088
2004-03-03 02:14:15 +00:00
Brian Gaeke
b78f8498f0 TargetCacheInfo has been removed; its only uses were to propagate a constant
(16) into certain areas of the SPARC V9 back-end. I'm fairly sure the US IIIi's
dcache has 32-byte lines, so I'm not sure where the 16 came from. However, in
the interest of not breaking things any more than they already are, I'm going
to leave the constant alone.

llvm-svn: 12043
2004-03-01 06:43:29 +00:00
John Criswell
0b01bff060 Fixes for PR258 and PR259.
Functions with linkonce linkage are declared with weak linkage.
Global floating point constants used to represent unprintable values
(such as NaN and infinity) are declared static so that they don't interfere
with other CBE generated translation units.

llvm-svn: 11884
2004-02-26 22:20:58 +00:00
Chris Lattner
9da41150e8 Fix some unexpected fallout from the config.h changes. Because the CBE no
longer was getting this #include, it always fell back on the less precise
floating point initializer values, causing some testsuite failures.

llvm-svn: 11803
2004-02-24 18:34:10 +00:00
Chris Lattner
b24f30de8d It is totally unacceptable to print out (literally) millions of zeros when
compiling 129.compress... so don't!

llvm-svn: 11649
2004-02-20 05:49:22 +00:00
Chris Lattner
336c99d138 Now that the lowerinvoke pass inserts calls to llvm.setjmp/llvm.longjmp, some
hacks can be banished.  Also, this gives us the opportunity to emit special code
for the setjmp/longjmps which alows the elimination of one GCC warning for every
setjmp/longjmp site (which is often THOUSANDS in C++ programs).  Yaay!

llvm-svn: 11484
2004-02-15 22:51:47 +00:00
Chris Lattner
99ed412516 Add support for the new ConstantAggregateZero class
llvm-svn: 11473
2004-02-15 05:54:27 +00:00
Chris Lattner
b8ecb673d1 Add support for the returnaddress and frameaddress intrinsics
llvm-svn: 11433
2004-02-14 02:55:36 +00:00
Chris Lattner
83c5c942ca Use intrinsic lowering like the rest of the backends. Get rid of crufty hacky
code that worked around problems in the mangler

llvm-svn: 11426
2004-02-14 00:31:10 +00:00
Chris Lattner
3681a0bd3f Moved directory, update makefile
llvm-svn: 11417
2004-02-13 23:31:12 +00:00
Chris Lattner
9301df3932 CBackend now lives here
llvm-svn: 11415
2004-02-13 23:29:20 +00:00