Chris Lattner
e44cc1372e
Insert functions into the module promptly, not lazily. This fixes a bug
...
I introduced last night. Note to self: test the *correct* tree...
llvm-svn: 12220
2004-03-08 16:14:19 +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
cf72011426
New testcase for folding in some important situations. The first two
...
come up a lot in the code generated by the C++ front-end for pointers
to member functions. See PR166.
llvm-svn: 12217
2004-03-08 06:17:15 +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
164ebd3be3
Remove Module::mutateConstantPointerRef, which is now thankfully dead!
...
llvm-svn: 12215
2004-03-08 06:15:33 +00:00
Chris Lattner
aa5d8cb72f
Eliminate nightmarish API
...
llvm-svn: 12214
2004-03-08 06:11:10 +00:00
Chris Lattner
db6e86b1ed
remove *THANKFULLY* dead method
...
llvm-svn: 12213
2004-03-08 06:10:32 +00:00
Chris Lattner
df5ebdc8b1
Eliminate a REALLY HORRIBLE API: mutateReferences, which is gross gross gross.
...
llvm-svn: 12212
2004-03-08 06:09:57 +00:00
Chris Lattner
1ecf76aab7
New testcase for PR269
...
llvm-svn: 12211
2004-03-08 05:35:12 +00:00
Chris Lattner
74d74316fe
Bug fixed
...
llvm-svn: 12210
2004-03-08 04:55:45 +00:00
Chris Lattner
66f3cfa109
Testcase that crashes the C front-end.
...
llvm-svn: 12209
2004-03-08 04:41:32 +00:00
Chris Lattner
1ae4150e31
Fix a bug handling globals that are constants, but are still external
...
llvm-svn: 12208
2004-03-08 03:52:24 +00:00
Chris Lattner
a7180252e6
Avoid allocating special registers a bit more robustly
...
llvm-svn: 12207
2004-03-08 03:48:07 +00:00
Chris Lattner
8cd89d333c
New code-quality testcase.
...
llvm-svn: 12205
2004-03-08 02:12:36 +00:00
Chris Lattner
a55628694a
Implement folding explicit load instructions into binary operations. For a
...
testcase like this:
int %test(int* %P, int %A) {
%Pv = load int* %P
%B = add int %A, %Pv
ret int %B
}
We now generate:
test:
mov %ECX, DWORD PTR [%ESP + 4]
mov %EAX, DWORD PTR [%ESP + 8]
add %EAX, DWORD PTR [%ECX]
ret
Instead of:
test:
mov %EAX, DWORD PTR [%ESP + 4]
mov %ECX, DWORD PTR [%ESP + 8]
mov %EAX, DWORD PTR [%EAX]
add %EAX, %ECX
ret
... saving one instruction, and often a register. Note that there are a lot
of other instructions that could use this, but they aren't handled. I'm not
really interested in adding them, but mul/div and all of the FP instructions
could be supported as well if someone wanted to add them.
llvm-svn: 12204
2004-03-08 01:58:35 +00:00
Chris Lattner
9a9b1c4822
Rearrange and refactor some code. No functionality changes.
...
llvm-svn: 12203
2004-03-08 01:18:36 +00:00
Chris Lattner
933f605592
Implement ArgumentPromotion/aggregate-promote.ll
...
This allows pointers to aggregate objects, whose elements are only read, to
be promoted and passed in by element instead of by reference. This can
enable a LOT of subsequent optimizations in the caller function.
It's worth pointing out that this stuff happens a LOT of C++ programs, because
objects in templates are generally passed around by reference. When these
templates are instantiated on small aggregate or scalar types, however, it is
more efficient to pass them in by value than by reference.
This transformation triggers most on C++ codes (e.g. 334 times on eon), but
does happen on C codes as well. For example, on mesa it triggers 72 times,
and on gcc it triggers 35 times. this is amazingly good considering that
we are using 'basicaa' so far.
llvm-svn: 12202
2004-03-08 01:04:36 +00:00
Chris Lattner
2340d903fa
New testcase
...
llvm-svn: 12201
2004-03-08 00:58:19 +00:00
Chris Lattner
ebebe8f4a0
Implement: ArgumentPromotion/chained.ll
...
llvm-svn: 12200
2004-03-07 22:52:53 +00:00
Chris Lattner
5a2ee65f6c
New testcase for missed case
...
llvm-svn: 12199
2004-03-07 22:52:41 +00:00
Chris Lattner
8494ba277f
Fix another minor bug, exposed by perlbmk
...
llvm-svn: 12198
2004-03-07 22:43:27 +00:00
Chris Lattner
ca3b90f308
Since 'load null' is undefined, we can make it do whatever we want. Returning
...
a zero value is the most likely way to cause further simplification, so we do it.
llvm-svn: 12197
2004-03-07 22:16:24 +00:00
Chris Lattner
0179360703
Run the new pass in gccld now that it passes all tests
...
llvm-svn: 12196
2004-03-07 22:12:40 +00:00
Chris Lattner
45cf084497
Fix a minor bug and turn debug output into, well, debug output.
...
llvm-svn: 12195
2004-03-07 21:54:50 +00:00
Chris Lattner
db27e586bf
Add prototype
...
llvm-svn: 12194
2004-03-07 21:30:08 +00:00
Chris Lattner
4415950211
New LLVM pass: argument promotion. This version only handles simple scalar
...
variables.
llvm-svn: 12193
2004-03-07 21:29:54 +00:00
Chris Lattner
f4fa087828
New testcase
...
llvm-svn: 12192
2004-03-07 21:28:54 +00:00
Alkis Evlogimenos
65649a50e9
Add memory operand version of conditional move.
...
llvm-svn: 12190
2004-03-07 03:19:11 +00:00
Alkis Evlogimenos
02e8f14c6a
As I wrote in the docs, simple is the default spiller :-)
...
llvm-svn: 12189
2004-03-06 23:08:44 +00:00
Alkis Evlogimenos
467364b706
Add simple spiller.
...
llvm-svn: 12188
2004-03-06 22:38:29 +00:00
Alkis Evlogimenos
224e6bdd1d
The default register allocator is local not simple.
...
llvm-svn: 12187
2004-03-06 22:27:41 +00:00
Brian Gaeke
4bb4ec2388
Support return values of basic integer types.
...
Emit RETL instruction to return instead of funny JMPL.
Fix indentation.
llvm-svn: 12186
2004-03-06 05:32:28 +00:00
Brian Gaeke
855518207c
Sort stanzas into Sparc V8 book page number order.
...
Add RET, RETL. Rename SAVE, RESTORE & JMPL for consistency.
llvm-svn: 12185
2004-03-06 05:32:13 +00:00
Brian Gaeke
813f0d8512
Hack it so we do not try to allocate values to G0.
...
llvm-svn: 12184
2004-03-06 05:31:32 +00:00
Brian Gaeke
a265c3c4df
Make prolog align stack properly. Make epilog not touch any registers.
...
llvm-svn: 12183
2004-03-06 05:31:21 +00:00
Brian Gaeke
b4258231ca
Emit register names in lowercase, as required by the assembler.
...
llvm-svn: 12182
2004-03-06 05:30:21 +00:00
Brian Gaeke
13f3e2f254
Teach getRegClassForType where to find FP registers
...
llvm-svn: 12180
2004-03-06 03:54:13 +00:00
Chris Lattner
5a9cae47a4
Fix a minor bug
...
llvm-svn: 12169
2004-03-05 22:04:07 +00:00
Misha Brukman
75729872be
Unbreak the build on Sparc.
...
llvm-svn: 12161
2004-03-05 20:04:40 +00:00
Brian Gaeke
689af03601
Asm output is looking a lot better; not correct for all operands yet though.
...
llvm-svn: 12143
2004-03-05 08:39:09 +00:00
Chris Lattner
f21e7a75d6
Fix a bug in a previous checkin that broke 175.vpr
...
llvm-svn: 12128
2004-03-04 21:36:57 +00:00
Chris Lattner
c885697daa
Add support for strto* and v*printf
...
llvm-svn: 12127
2004-03-04 21:03:54 +00:00
Chris Lattner
48b0fd7101
Add non-crappy support for varargs
...
llvm-svn: 12126
2004-03-04 20:33:47 +00:00
Chris Lattner
ac1eaa43fa
Implement a FIXME, improving the efficiency of DSA on povray.
...
This reduces CBU time from 145s -> 122s (debug build), reduces # allocated nodes
from 129420 to 116477.
llvm-svn: 12125
2004-03-04 19:47:04 +00:00
Brian Gaeke
a24ac9bf8b
Support -print-machineinstrs
...
llvm-svn: 12124
2004-03-04 19:22:16 +00:00
Chris Lattner
e3fc09a37e
Speed up the cbu pass from taking somewhere near the age of the universe to about 90s on povray
...
llvm-svn: 12123
2004-03-04 19:16:35 +00:00
Brian Gaeke
0b913593ae
make -print-machineinstrs work for both SparcV9 and X86
...
llvm-svn: 12122
2004-03-04 19:16:23 +00:00
Alkis Evlogimenos
e8ebdcc780
Add assertion for scale verification.
...
llvm-svn: 12120
2004-03-04 18:05:02 +00:00
Alkis Evlogimenos
64aa7f3708
Fix bug introduced by yesterday's changes.
...
llvm-svn: 12119
2004-03-04 18:02:07 +00:00
Alkis Evlogimenos
d6bb9674d9
Hide variable from other functions.
...
llvm-svn: 12118
2004-03-04 17:50:44 +00:00