Misha Brukman
c0ac8cae1c
If we're going to make the braces of functions line up for ease of readability
...
and aesthetic reasons, might as well finish the job
llvm-svn: 17140
2004-10-19 05:50:34 +00:00
Misha Brukman
be39800a89
Remove unnecessary spaces in function signature
...
llvm-svn: 17139
2004-10-19 05:49:46 +00:00
Brian Gaeke
62ecd75aeb
Simplify mapping info generation. In particular, the LLVM-to-MachineInstr map
...
is no longer emitted, and we do not reference any MachineCodeForInstruction
information.
llvm-svn: 17138
2004-10-19 05:15:21 +00:00
Misha Brukman
fd9bef227a
* Fit constructor initializer on a single line
...
* Delete blank chars at end of line to fit into 80 cols
llvm-svn: 17137
2004-10-19 00:29:16 +00:00
Reid Spencer
ce514b1c2c
Initial automake generated Makefile template
...
llvm-svn: 17136
2004-10-18 23:55:41 +00:00
Misha Brukman
56f2d0e5fe
Move code to redefine INT64_{MIN,MAX} on AIX/PowerPC to a separate header,
...
because #undef becomes commented out in DataTypes.h.in due to autoheader
llvm-svn: 17135
2004-10-18 22:14:48 +00:00
Nate Begeman
49e38c2185
Initial implementation of the strength reduction for GEP instructions in
...
loops. This optimization is not turned on by default yet, but may be run
with the opt tool's -loop-reduce flag. There are many FIXMEs listed in the
code that will make it far more applicable to a wide range of code, but you
have to start somewhere :)
This limited version currently triggers on the following tests in the
MultiSource directory:
pcompress2: 7 times
cfrac: 5 times
anagram: 2 times
ks: 6 times
yacr2: 2 times
llvm-svn: 17134
2004-10-18 21:08:22 +00:00
Misha Brukman
07479efa84
* AIX on Power defines INT64_MIN and INT64_MAX in ways that annoy GCC, so
...
special-case those definitions
* Add comments in #ifdef/#else/#endif clauses for ease of reading
llvm-svn: 17132
2004-10-18 18:35:21 +00:00
Misha Brukman
ed985abc65
AIX does not have mkdtemp() so emulate its behavior using mktemp() and mkdir()
...
llvm-svn: 17131
2004-10-18 17:39:45 +00:00
Chris Lattner
9f1c4d5b67
Fix miscompilations in the SparcV9 backend that were induced by this patch:
...
http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20041011/019311.html
llvm-svn: 17130
2004-10-18 17:19:20 +00:00
Chris Lattner
cac643c78f
Improve compatibility with VC++, patch contributed by Morten Ofstad!
...
llvm-svn: 17126
2004-10-18 15:54:17 +00:00
Chris Lattner
9e2649a7be
Get this file compiling with VC++, patch contributed by Morten Ofstad. Thanks Morten!
...
llvm-svn: 17125
2004-10-18 15:43:46 +00:00
Reid Spencer
a5b7b341a4
Declare a function in the correct namespace.
...
Patch contributed by Morten Ofstad. Thanks Morten!
llvm-svn: 17124
2004-10-18 14:43:45 +00:00
Reid Spencer
2b5cfe8be8
Correction to allow compilation with Visual C++.
...
Patch contributed by Morten Ofstad. Thanks Morten!
llvm-svn: 17123
2004-10-18 14:38:48 +00:00
Chris Lattner
b1827a765a
Simplify code by deleting instructions that preceed unreachable instructions.
...
Simplify code by simplifying terminators that branch to blocks that start
with an unreachable instruction.
llvm-svn: 17116
2004-10-18 04:07:22 +00:00
Chris Lattner
e058c78728
New testcase
...
llvm-svn: 17115
2004-10-18 04:06:41 +00:00
Reid Spencer
19a45269fa
Actually link all the analysis passes and their dependencies.
...
llvm-svn: 17114
2004-10-18 03:32:12 +00:00
Reid Spencer
2f5d7cdf7e
Remove extra comma.
...
llvm-svn: 17113
2004-10-18 03:26:21 +00:00
Reid Spencer
6afd317860
Actually link in all the analysis passes.
...
llvm-svn: 17112
2004-10-18 03:22:48 +00:00
Chris Lattner
3c1be63b41
Turn store -> null/undef into the LLVM unreachable instruction! This simple
...
change hacks off 10K of bytecode from perlbmk (.5%) even though the front-end
is not generating them yet and we are not optimizing the resultant code.
This isn't too bad.
llvm-svn: 17111
2004-10-18 03:00:50 +00:00
Chris Lattner
18333c64de
Turn things with obviously undefined semantics into 'store -> null'
...
llvm-svn: 17110
2004-10-18 02:59:09 +00:00
Chris Lattner
dbfa9a5e9c
My friend the invoke instruction does not dominate all basic blocks if it
...
occurs in the entry node of a function
llvm-svn: 17109
2004-10-18 01:48:31 +00:00
Chris Lattner
f7bf129037
Fix a bug that occurs when the constant value is the result of an invoke. In
...
particular, invoke ret values are only live in the normal dest of the invoke
not in the unwind dest.
llvm-svn: 17108
2004-10-18 01:21:17 +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
44a7cf480d
Getting ADCE to interact well with unreachable instructions seems like a nontrivial
...
exercise that I'm not interested in tackling right now. Just punt and treat them
like unwind's.
This 'fixes' test/Regression/Transforms/ADCE/unreachable-function.ll
llvm-svn: 17106
2004-10-17 23:45:06 +00:00
Chris Lattner
215d4c9d22
New testcase that ADCE shouldn't crash on
...
llvm-svn: 17105
2004-10-17 23:44:02 +00:00
Chris Lattner
9e7ddf8596
Fix Regression/Transforms/Inline/2004-10-17-InlineFunctionWithoutReturn.ll
...
If a function had no return instruction in it, and the result of the inlined
call instruction was used, we would crash.
llvm-svn: 17104
2004-10-17 23:21:07 +00:00
Chris Lattner
062914f153
New testcase that crashes the inliner
...
llvm-svn: 17103
2004-10-17 23:20:29 +00:00
Nate Begeman
927c4cc3dc
Pass -single_module option to gcc when linking dynamic libraries for use with bugpoint, so that we can bugpoint multiple .cp files
...
llvm-svn: 17102
2004-10-17 23:03:32 +00:00
Nate Begeman
1c408f7319
Generate correct stubs for weak-linked symbols
...
llvm-svn: 17101
2004-10-17 23:01:34 +00:00
Chris Lattner
c088680a5f
fold gep undef, ... -> undef
...
This comes up many times in perlbmk and probably others.
llvm-svn: 17100
2004-10-17 21:54:55 +00:00
Chris Lattner
795ae57cde
Remove printout, realize that instructions in the entry block dominate all
...
other blocks.
llvm-svn: 17099
2004-10-17 21:31:34 +00:00
Chris Lattner
ac92e5fcd0
When inserting PHI nodes, don't insert any phi nodes that are obviously
...
unneccesary. This allows us to delete several hundred phi nodes of the
form PHI(x,x,x,undef) from 253.perlbmk and probably other programs as well.
This implements Mem2Reg/UndefValuesMerge.ll
llvm-svn: 17098
2004-10-17 21:25:56 +00:00
Chris Lattner
f47b3f67d9
New testcase, no PHI should be inserted.
...
llvm-svn: 17097
2004-10-17 21:25:32 +00:00
Chris Lattner
306dd8a44a
Enhance hasConstantValue to ignore undef values in phi nodes. This allows it
...
to think that PHI[4, undef] == 4.
llvm-svn: 17096
2004-10-17 21:23:26 +00:00
Chris Lattner
ef0888e493
hasConstantValue will soon return instructions that don't dominate the PHI node,
...
so prepare for this.
llvm-svn: 17095
2004-10-17 21:22:38 +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
f96fb0c946
Don't print stuff out from the code generator. This broke the JIT horribly
...
last night. :) bork!
llvm-svn: 17093
2004-10-17 17:40:50 +00:00
Reid Spencer
eb6a51b3f0
Add HAVE_BZLIB_H and HAVE_ZLIB_H tests.
...
llvm-svn: 17092
2004-10-17 17:07:29 +00:00
Reid Spencer
c4abf55b69
Update to reflect building zlib for LLVM
...
llvm-svn: 17091
2004-10-17 15:02:47 +00:00
Reid Spencer
8c10b29823
Add missing targets for install/clean
...
llvm-svn: 17090
2004-10-17 15:01:59 +00:00
Reid Spencer
210d95cffb
Make the library name SparcV9 specific
...
llvm-svn: 17089
2004-10-17 15:01:12 +00:00
Reid Spencer
7ece7ff509
Consolidate the definitions
...
llvm-svn: 17088
2004-10-17 15:00:26 +00:00
Reid Spencer
9a97056275
PPC32GenCodeEmitter instead of PowerPCGenCodeEmitter
...
llvm-svn: 17087
2004-10-17 14:59:38 +00:00
Reid Spencer
021a407fd0
Add runtime directories
...
llvm-svn: 17086
2004-10-17 14:58:49 +00:00
Reid Spencer
b3942d7547
Support bytecode generation, GenCodeEmitter, etc.
...
llvm-svn: 17085
2004-10-17 14:57:12 +00:00
Reid Spencer
d3f282779f
Add runtime directory, include Makefile_rules
...
llvm-svn: 17084
2004-10-17 14:56:15 +00:00
Chris Lattner
63e6bdd207
Rewrite support for cast uint -> FP. In particular, we used to compile this:
...
double %test(uint %X) {
%tmp.1 = cast uint %X to double ; <double> [#uses=1]
ret double %tmp.1
}
into:
test:
sub %ESP, 8
mov %EAX, DWORD PTR [%ESP + 12]
mov %ECX, 0
mov DWORD PTR [%ESP], %EAX
mov DWORD PTR [%ESP + 4], %ECX
fild QWORD PTR [%ESP]
add %ESP, 8
ret
... which basically zero extends to 8 bytes, then does an fild for an
8-byte signed int.
Now we generate this:
test:
sub %ESP, 4
mov %EAX, DWORD PTR [%ESP + 8]
mov DWORD PTR [%ESP], %EAX
fild DWORD PTR [%ESP]
shr %EAX, 31
fadd DWORD PTR [.CPItest_0 + 4*%EAX]
add %ESP, 4
ret
.section .rodata
.align 4
.CPItest_0:
.quad 5728578726015270912
This does a 32-bit signed integer load, then adds in an offset if the sign
bit of the integer was set.
It turns out that this is substantially faster than the preceeding sequence.
Consider this testcase:
unsigned a[2]={1,2};
volatile double G;
void main() {
int i;
for (i=0; i<100000000; ++i )
G += a[i&1];
}
On zion (a P4 Xeon, 3Ghz), this patch speeds up the testcase from 2.140s
to 0.94s.
On apoc, an athlon MP 2100+, this patch speeds up the testcase from 1.72s
to 1.34s.
Note that the program takes 2.5s/1.97s on zion/apoc with GCC 3.3 -O3
-fomit-frame-pointer.
llvm-svn: 17083
2004-10-17 08:01:28 +00:00
Chris Lattner
bf114f32c0
Unify handling of constant pool indexes with the other code paths, allowing
...
us to use index registers for CPI's
llvm-svn: 17082
2004-10-17 07:49:45 +00:00
Chris Lattner
892b15538d
Give the asmprinter the ability to print memrefs with a constant pool index,
...
index reg and scale
llvm-svn: 17081
2004-10-17 07:16:32 +00:00