Compare commits

...

4966 Commits

Author SHA1 Message Date
John Criswell
32e813e486 Merged from mainline.
llvm-svn: 15723
2004-08-13 18:52:00 +00:00
John Criswell
b6a9b36e21 Setup the llvm-gcc tarball the way we have always done.
llvm-svn: 15687
2004-08-12 14:34:38 +00:00
John Criswell
0fe9bd9e6d Merged from mainline.
llvm-svn: 15686
2004-08-12 14:28:44 +00:00
John Criswell
322e13176f Merged from mainline. This should fix 176.gcc.
llvm-svn: 15685
2004-08-12 14:20:45 +00:00
John Criswell
ab686a51f1 Updated code sizes for LLVM.
llvm-svn: 15666
2004-08-11 19:48:12 +00:00
John Criswell
f2a68db009 Adding 2004-08-10-BoolSetCC.ll (written by Chris) as a new regression test.
Merged from mainline.

llvm-svn: 15641
2004-08-11 01:28:05 +00:00
John Criswell
ef095995c7 Merged in revision 1.239 from mainline.
llvm-svn: 15640
2004-08-11 01:23:22 +00:00
CVS to SVN Conversion
841e6949d7 This commit was manufactured by cvs2svn to create branch 'release_13'.
llvm-svn: 15638
2004-08-11 00:49:50 +00:00
John Criswell
a98c3d19a5 Merged from mainline on August 10, 2004.
llvm-svn: 15619
2004-08-10 18:33:39 +00:00
CVS to SVN Conversion
10b4a6323f This commit was manufactured by cvs2svn to create branch 'release_13'.
llvm-svn: 15618
2004-08-10 18:33:39 +00:00
John Criswell
7d4bacd1af Merged in mainline.
llvm-svn: 15617
2004-08-10 18:32:06 +00:00
John Criswell
f0958ae6eb Merged in changes to the instruction combining pass.
llvm-svn: 15598
2004-08-09 21:34:34 +00:00
John Criswell
7ee0099de5 Merged in new regression test.
llvm-svn: 15597
2004-08-09 21:33:52 +00:00
CVS to SVN Conversion
7aa6c01be2 This commit was manufactured by cvs2svn to create branch 'release_13'.
llvm-svn: 15596
2004-08-09 21:33:52 +00:00
John Criswell
1e34901d4d Fix capitalization of URL.
llvm-svn: 15595
2004-08-09 21:17:16 +00:00
John Criswell
362f4b3e5d Updated release notes from mainline.
llvm-svn: 15594
2004-08-09 21:15:20 +00:00
John Criswell
67dee05f54 Merged in changes Chris commited over the weekend. Merge done on August 9,
2004.

llvm-svn: 15576
2004-08-09 15:35:51 +00:00
John Criswell
0ccbe35d71 Added note about new PowerPC code generator.
Updated versions to 1.3.

llvm-svn: 15560
2004-08-06 21:26:30 +00:00
John Criswell
7f6d3e7317 Fixed the link to the Command Guide. The previous revision only worked
if the browser is getting the file from a web server that autocompletes
the URL.

llvm-svn: 15559
2004-08-06 21:12:44 +00:00
John Criswell
fb63a35c3c Created script to help automate part of the release process.
llvm-svn: 15558
2004-08-06 21:03:59 +00:00
John Criswell
6dbb267760 Merge in test for structures with more than 256 members, courtesy of Chris.
llvm-svn: 15557
2004-08-06 19:57:05 +00:00
CVS to SVN Conversion
50fe9297ba This commit was manufactured by cvs2svn to create branch 'release_13'.
llvm-svn: 15556
2004-08-06 19:57:05 +00:00
John Criswell
395900dcf5 Updated version.
llvm-svn: 15549
2004-08-06 16:21:48 +00:00
CVS to SVN Conversion
a27fe0174c This commit was manufactured by cvs2svn to create branch 'release_13'.
llvm-svn: 15548
2004-08-06 16:21:48 +00:00
Chris Lattner
5064097632 Now without stinky dos newlines!
llvm-svn: 15537
2004-08-06 07:45:37 +00:00
Chris Lattner
a8dcf2423e Changes commited for Nate Begeman:
Use a PowerPC specific prolog epilog inserter to control where spilled
callee save regs are placed on the stack.
Get rid of implicit return address stack slot, save return address reg
(LR) in appropriate slot
Improve code generated for functions that don't have calls or access
globals


Note from Chris: PowerPCPEI will eventually be eliminated, once the
functionality is merged into CodeGen/PrologEpilogInserter.cpp

llvm-svn: 15536
2004-08-06 06:58:50 +00:00
Brian Gaeke
a1a0643e38 Update the To-Do list according to my notes + assertions
llvm-svn: 15535
2004-08-06 04:38:13 +00:00
John Criswell
2fc39a9c2f Added Louis Gerbarg. Louis is given credit in the CREDITS.TXT file, so I
assume Louis also holds copyright.

llvm-svn: 15534
2004-08-05 23:46:27 +00:00
Chris Lattner
d21e3d020e More prominantly mention ppc support, more accurately describe its status
llvm-svn: 15533
2004-08-05 21:53:13 +00:00
Misha Brukman
467ea6be23 * Mention PowerPC as new feature, and experimental feature
* Wrap long lines to 80 cols

llvm-svn: 15532
2004-08-05 21:04:03 +00:00
John Criswell
e7ccf6445e Add additional copyright notice for the PowerPC backend.
Thanks Nate!

llvm-svn: 15531
2004-08-05 20:36:00 +00:00
Brian Gaeke
c51892528b Split out -disable-codegen into -disable-llc and -disable-jit.
llvm-svn: 15530
2004-08-05 19:54:59 +00:00
Misha Brukman
72b2a27617 We now have the PowerPC backend, thanks to Nate Begeman and Luis Gerbarg!
llvm-svn: 15529
2004-08-05 19:09:47 +00:00
Misha Brukman
7d41ed5271 Simplify makefile by combining all TableGen dependencies into one variable
llvm-svn: 15527
2004-08-05 18:34:15 +00:00
Chris Lattner
c76471842a while we're at it, make the libraries be on separate lines
llvm-svn: 15526
2004-08-05 18:32:57 +00:00
Misha Brukman
eabe770156 Lines need to end with \ to make sure they're actually continued
llvm-svn: 15525
2004-08-05 18:31:33 +00:00
Misha Brukman
f7667b1845 * Add PowerPC library to LLC
* Fit used libraries on a few lines

llvm-svn: 15524
2004-08-05 18:24:11 +00:00
Misha Brukman
1d1d1c4676 PowerPC is a real target now.
llvm-svn: 15522
2004-08-05 18:22:30 +00:00
Chris Lattner
af1ad37f3b This file is obsolete
llvm-svn: 15521
2004-08-05 17:45:32 +00:00
Alkis Evlogimenos
f45cc7a56e Make GlobalVariable constructor assert when an initializer is of
incorrect type.

llvm-svn: 15519
2004-08-05 11:28:34 +00:00
Brian Gaeke
4c8a2120aa sparcv9select is history.
llvm-svn: 15516
2004-08-05 05:17:19 +00:00
Chris Lattner
0d5dc010fa C++ support does not live in the C runtime any longer
llvm-svn: 15515
2004-08-05 02:28:17 +00:00
Chris Lattner
fc9e8b6682 Two files are moved to libstdc++, and a NOTE gets added
llvm-svn: 15514
2004-08-05 02:27:28 +00:00
Chris Lattner
0f2aeea79c Add missing copyrights
llvm-svn: 15513
2004-08-05 00:20:51 +00:00
Reid Spencer
24fa5fd29b Turn a use of intptr_t into a reinterpret_cast<uint64_t> instead to get
rid of compilation warnings on some platforms.

llvm-svn: 15512
2004-08-04 22:56:46 +00:00
Chris Lattner
5e18a2489d Fix another minor problem that exists if you ahve multiple functions with
nonunifiable types but the same name.  Down with PR411!

llvm-svn: 15511
2004-08-04 22:39:54 +00:00
Chris Lattner
6722f851ef Fix a typeo
llvm-svn: 15510
2004-08-04 22:29:05 +00:00
Chris Lattner
20a4dab308 Add a hack to work around a problem my changes exposed
llvm-svn: 15509
2004-08-04 22:26:13 +00:00
Misha Brukman
8e5492e350 * Added documentation in the file header
* Shorten assert() text to make it fit within 80 cols

llvm-svn: 15508
2004-08-04 22:07:54 +00:00
Misha Brukman
95908889f4 Surround code element with <tt> tags
llvm-svn: 15507
2004-08-04 22:00:05 +00:00
Misha Brukman
283042bed3 Hand-propagate the constant TARGET_NAME which was making lines wrap anyway
llvm-svn: 15506
2004-08-04 21:48:45 +00:00
Misha Brukman
b2b9686b3a * Remove unnecessary comment
* Fix alignment of code
* Tabs to spaces

llvm-svn: 15505
2004-08-04 21:48:00 +00:00
Misha Brukman
2068654d68 Align dependencies so they don't hurt the eyes to look at them
llvm-svn: 15504
2004-08-04 21:37:41 +00:00
Misha Brukman
eecee636c1 * Convert C++ comments to C
* Add UIUC copyright notice headers

llvm-svn: 15503
2004-08-04 21:19:49 +00:00
Misha Brukman
24c7715e93 Shared libraries are usually prepended with `lib'
llvm-svn: 15502
2004-08-04 21:19:27 +00:00
Misha Brukman
cdd72aaa1f Remove unused instruction classes
llvm-svn: 15501
2004-08-04 21:18:57 +00:00
Misha Brukman
f74157ab15 Make tablegen targets depend on PowerPCInstrFormats.td as well
llvm-svn: 15500
2004-08-04 21:18:36 +00:00
Chris Lattner
29ca2c6f7a Fix a latent bug exposed by my recent changes
llvm-svn: 15498
2004-08-04 18:50:09 +00:00
Chris Lattner
2d1bb6ae2d Move method out of line
llvm-svn: 15497
2004-08-04 18:49:52 +00:00
Chris Lattner
46303fdbf8 It is not possible to catch SIGKILL, don't bother trying.
llvm-svn: 15496
2004-08-04 18:14:24 +00:00
Chris Lattner
08c58e63d9 getValues does not exist
llvm-svn: 15495
2004-08-04 17:29:14 +00:00
Chris Lattner
50c6df4ba0 getValues is gone
llvm-svn: 15494
2004-08-04 17:27:27 +00:00
Alkis Evlogimenos
4242241a69 Clean up whitespace.
llvm-svn: 15490
2004-08-04 09:46:56 +00:00
Alkis Evlogimenos
a698308cce Convert indentation to 2 spaces.
llvm-svn: 15489
2004-08-04 09:46:26 +00:00
Alkis Evlogimenos
ed7be9d7f5 Remove uneeded getValues() functions.
llvm-svn: 15488
2004-08-04 08:47:21 +00:00
Alkis Evlogimenos
832437255d Stop using getValues().
llvm-svn: 15487
2004-08-04 08:44:43 +00:00
Chris Lattner
a6241aed38 Fix a major regression in my previous checkin
llvm-svn: 15486
2004-08-04 08:30:43 +00:00
Alkis Evlogimenos
43252afdde Stop using getValues().
llvm-svn: 15485
2004-08-04 08:08:13 +00:00
Brian Gaeke
0f67209ffe getResultPos() is dead.
llvm-svn: 15484
2004-08-04 08:06:30 +00:00
Brian Gaeke
ef57e5b91a Get rid of the only use of TargetInstrInfo::getResultPos(), a deprecated method.
llvm-svn: 15483
2004-08-04 08:05:27 +00:00
Alkis Evlogimenos
f0cc814974 Stop using getValues().
llvm-svn: 15482
2004-08-04 08:02:59 +00:00
Chris Lattner
493bdcc4a5 Add note
llvm-svn: 15481
2004-08-04 08:00:45 +00:00
Chris Lattner
3706708ede FindGlobalNamed used to take 2.92s out of 8.39s running a profile build of
gccld -disable-opt on 252.eon.

This patch deletes it and replaces it with a map.  The proper fix for this
is to fix PR411, but this will do in the short term.

gccld on eon now takes 5.51s, which is 50% faster than before this patch. :)

llvm-svn: 15480
2004-08-04 07:44:58 +00:00
Brian Gaeke
6e5427c2b0 sparcv9select is history
llvm-svn: 15479
2004-08-04 07:39:21 +00:00
Brian Gaeke
ab93e34da0 libsparcv9select is history
llvm-svn: 15478
2004-08-04 07:38:52 +00:00
Brian Gaeke
b5dcc04220 These headers have been moved/merged into other files.
llvm-svn: 15477
2004-08-04 07:37:56 +00:00
Brian Gaeke
c017a2c269 Include SparcV9TmpInstr.h to pick up the def. of TmpInstruction,
instead of InstrSelection.h, which is dead.

llvm-svn: 15476
2004-08-04 07:34:57 +00:00
Brian Gaeke
e31a13ae07 Tighten up some whitespace. Include SparcV9TmpInstr.h to pick up
the def. of TmpInstruction, instead of InstrSelection.h, which is
dead.

llvm-svn: 15475
2004-08-04 07:34:44 +00:00
Brian Gaeke
def3b458b0 Include SparcV9BurgISel.h, to pick up the definition of
createSparcV9BurgInstSelector().

llvm-svn: 15474
2004-08-04 07:30:04 +00:00
Brian Gaeke
813d9f5023 Include SparcV9TmpInstr.h instead of llvm/CodeGen/InstrSelection.h, to pick
up the definition of class TmpInstruction.

llvm-svn: 15473
2004-08-04 07:29:53 +00:00
Brian Gaeke
4b621da631 Include SparcV9BurgISel.h, because PreSelection uses routines from within
the SparcV9 BURG instruction selector.  Eww!

llvm-svn: 15472
2004-08-04 07:29:40 +00:00
Brian Gaeke
908df3299f Add a Doxygen comment, and inline the constructor (which is now almost empty).
llvm-svn: 15471
2004-08-04 07:29:28 +00:00
Brian Gaeke
16f092fe93 The InstrForest data type has moved from llvm/CodeGen/InstrForest.h
to SparcV9InstrForest.h.

llvm-svn: 15470
2004-08-04 07:29:16 +00:00
Brian Gaeke
b3e3c539a4 Add a new file containing just TmpInstruction and its implementation.
Many other pieces of the SparcV9 backend want to use TmpInstruction, but
don't need any other instruction selector baggage.

llvm-svn: 15469
2004-08-04 07:29:04 +00:00
Brian Gaeke
61dd48425f All the SparcV9 BURG instruction selector pieces have been collected into the
new file SparcV9BurgISel.cpp, with exposed interfaces in SparcV9BurgISel.h.
The InstrSelection directory is now dead.

llvm-svn: 15468
2004-08-04 07:28:51 +00:00
Chris Lattner
dd40787390 I swear I compiled this, really I did.
llvm-svn: 15467
2004-08-04 07:28:06 +00:00
Chris Lattner
9262acaed7 Factor some code out, no substantial change.
llvm-svn: 15466
2004-08-04 07:05:54 +00:00
Chris Lattner
e19c36cc0f Concisify some code
Do not call FindGlobalNamed when we know we will ignore the result (because
we are not going to link a static symbol anyway).  This speeds up
gccld -disable-opt on 252.eon from 8.63s to 8.39s.

llvm-svn: 15465
2004-08-04 06:05:47 +00:00
Chris Lattner
e99bec7f9b Fix linkage types
llvm-svn: 15464
2004-08-04 05:10:48 +00:00
Chris Lattner
3e650aff8b Implement a FIXME, by not searching linearly through a map to remove an
element.  This speeds up the bytecode reader from 12.86s to 8.72s on 252.eon.

llvm-svn: 15463
2004-08-04 04:48:01 +00:00
Chris Lattner
4c244225d5 New methods
llvm-svn: 15462
2004-08-04 04:45:42 +00:00
Chris Lattner
949681f510 Minor efficiency improvements
llvm-svn: 15461
2004-08-04 04:45:29 +00:00
Chris Lattner
3e689f8070 Squelch warnings in release mode
llvm-svn: 15460
2004-08-04 03:51:55 +00:00
Chris Lattner
26dc86a8bd Now that ConstantPointerRef is gone, it is the case that all operands of constants
are themselves constants.  This should allow us to reduce a significant amount
of casting in the sourcebase.

llvm-svn: 15459
2004-08-04 02:43:00 +00:00
Chris Lattner
da340a9bd5 Add a special version of getType for ConstantPointerNull, exposing the fact
that all Null pointers have pointer type

llvm-svn: 15458
2004-08-04 02:42:17 +00:00
Chris Lattner
37b570a049 Add a cast
llvm-svn: 15457
2004-08-04 02:27:17 +00:00
Reid Spencer
639a702db8 Added note for PR413
Tools now respond to the --version option.

llvm-svn: 15456
2004-08-04 00:43:50 +00:00
Chris Lattner
ea3d501de3 Change SymbolTable::insertEntry to be more careful about how many map
lookups it does.  This shaves another 5% off of bcreading 252.eon.  Note that
the proper solution to this problem is to fix PR411, but that will have to
wait until later.

llvm-svn: 15455
2004-08-04 00:37:31 +00:00
Reid Spencer
ff6cc1233e Add a --version option for every tool that prints out:
Low Level Virtual Machine ($PACKAGE_NAME) $PACKAGE_VERSION

llvm-svn: 15454
2004-08-04 00:36:06 +00:00
Reid Spencer
a0e01ae3f7 Change the package identification to use one less level of quoting so that
PACKAGE_VERSION = "1.3" instead of "[1.3]". Rebuild configure script.

llvm-svn: 15453
2004-08-04 00:34:49 +00:00
Chris Lattner
bba09b3f7f Make getGlobalTableValue not use getTypeSlot, this speeds up the bc reader
by 5% on eon

llvm-svn: 15452
2004-08-04 00:19:23 +00:00
Chris Lattner
6494081cce The Type* is redundant with the TypeSlot
llvm-svn: 15451
2004-08-04 00:18:37 +00:00
Chris Lattner
cd84396b58 Do not do a linear std::find to reconstruct information we had, but later threw
away.  This speeds up by .bc reader by 30% in a profile build on 252.eon.

llvm-svn: 15450
2004-08-03 23:41:28 +00:00
Reid Spencer
02d7f92a79 Line length <= 80 cols.
llvm-svn: 15449
2004-08-03 20:57:56 +00:00
Reid Spencer
40e93a466d Fix some indentation (so brg can test commit script).
llvm-svn: 15448
2004-08-03 20:33:56 +00:00
Misha Brukman
8a1978fd72 Remove unused opcodes.
llvm-svn: 15447
2004-08-03 20:23:44 +00:00
Reid Spencer
435a1abd86 Fix line lengths.
llvm-svn: 15446
2004-08-03 20:21:05 +00:00
Brian Gaeke
df918687cf Testing the commit-diffs script again.
llvm-svn: 15445
2004-08-03 20:14:03 +00:00
Brian Gaeke
84393956c9 Let's try it again.
llvm-svn: 15444
2004-08-03 20:02:52 +00:00
Brian Gaeke
0497bba81b Another test.
llvm-svn: 15443
2004-08-03 20:01:10 +00:00
Brian Gaeke
7ce6747863 Testing...one more time.
llvm-svn: 15442
2004-08-03 20:00:04 +00:00
Reid Spencer
a54f110e0e Properly wrap some lines.
llvm-svn: 15440
2004-08-03 19:20:18 +00:00
Reid Spencer
000bef1321 Added llvmcs to my list.
llvm-svn: 15439
2004-08-03 19:13:16 +00:00
Brian Gaeke
92baeddf2c Testing... One more time...
llvm-svn: 15438
2004-08-03 19:07:20 +00:00
Brian Gaeke
5c7104a478 Just testing
llvm-svn: 15437
2004-08-03 19:06:08 +00:00
Brian Gaeke
0254fcb54f testing
llvm-svn: 15436
2004-08-03 19:04:14 +00:00
Brian Gaeke
bc1cf403db Testing commit-diffs.pl
llvm-svn: 15435
2004-08-03 18:59:19 +00:00
Chris Lattner
ac6c18c134 Moved into SparcV9 directory
llvm-svn: 15430
2004-08-03 04:15:32 +00:00
Chris Lattner
9e92b19182 Move this file out of the top-level docs directory
llvm-svn: 15429
2004-08-03 04:15:02 +00:00
Chris Lattner
298f9f85bc Simplify the first example, as the LLVM IR interfaces have evolved. Other
examples in this doc could also be simplified dramatically in similar ways.

llvm-svn: 15428
2004-08-03 00:17:21 +00:00
John Criswell
caceaafada Use the new prcontext script.
llvm-svn: 15427
2004-08-02 22:31:58 +00:00
John Criswell
8b25914667 Add support for using the prcontext python script instead of grep -C.
llvm-svn: 15426
2004-08-02 22:29:38 +00:00
John Criswell
bb4494c93a New python script that print a specified number of lines surrounding a
located pattern.
In other words, grep -C for Solaris.

llvm-svn: 15425
2004-08-02 22:28:50 +00:00
John Criswell
9245f97f97 Set a variable so that we can find the python interpreter.
llvm-svn: 15424
2004-08-02 22:24:39 +00:00
Misha Brukman
570dcf63e6 * Use simpler instruction templates to define instructions
* Fix several extended opcodes

llvm-svn: 15423
2004-08-02 21:58:52 +00:00
Misha Brukman
6b21bde2d6 Replace patterns 0, 4, and 5 with simpler heirarchical definitions that use the
official PowerPC instruction format lingo: X- and D-form.

llvm-svn: 15422
2004-08-02 21:56:35 +00:00
Chris Lattner
baf2b6e9b5 Add link for IRC
llvm-svn: 15421
2004-08-02 21:37:11 +00:00
Chris Lattner
e1972b13c3 Written by
llvm-svn: 15420
2004-08-02 21:33:45 +00:00
Chris Lattner
07414cb817 continue hacking
llvm-svn: 15419
2004-08-02 21:32:08 +00:00
Chris Lattner
fcc7688b89 Revamp the index page
llvm-svn: 15418
2004-08-02 21:29:20 +00:00
Chris Lattner
2fd93493d3 ... now real HTML 4.01 strict!
llvm-svn: 15417
2004-08-02 20:29:51 +00:00
Chris Lattner
5cd4092500 Substantially hack on and clean up the release notes
llvm-svn: 15416
2004-08-02 20:28:44 +00:00
Chris Lattner
7e36902bd9 Hide this option
llvm-svn: 15415
2004-08-02 20:16:21 +00:00
Misha Brukman
cd4f51b4b6 Separate instruction formats from instruction definitions.
llvm-svn: 15414
2004-08-02 16:54:54 +00:00
Misha Brukman
a297dc2480 Add #include <cstdlib> and abort() to silence a warning
llvm-svn: 15413
2004-08-02 14:02:21 +00:00
Misha Brukman
8481785391 * ceil() requires #include <cmath> for compilation
* Alphabetize #includes
* Fix some lines to fit within 80 cols

llvm-svn: 15412
2004-08-02 13:59:10 +00:00
Chris Lattner
ac44389c83 This pass has proven its metal, remove -disable option.
llvm-svn: 15411
2004-08-02 10:10:08 +00:00
Chris Lattner
7aa2d4747a Fix a regression in InstCombine/xor.ll
llvm-svn: 15410
2004-08-01 19:42:59 +00:00
Chris Lattner
4d7af1c680 Fix a warning
llvm-svn: 15409
2004-08-01 19:31:30 +00:00
Tanya Lattner
dfd402ea8d Adding ModuloScheduling so that it compiles for everyone.
llvm-svn: 15408
2004-08-01 19:00:17 +00:00
Tanya Lattner
af1fcbb8ce Adding friend MSSchedule for ModuloScheduling pass.
llvm-svn: 15407
2004-08-01 18:57:38 +00:00
Chris Lattner
270b5b1311 Fix warning
llvm-svn: 15406
2004-08-01 18:17:36 +00:00
Chris Lattner
803c789d21 Initial testcase for bytecode compatibility regression test.
llvm-svn: 15405
2004-08-01 18:06:28 +00:00
Reid Spencer
89ff062fa2 Update.
llvm-svn: 15404
2004-08-01 16:30:24 +00:00
Chris Lattner
2b47c02b64 Convert all I<> instructions to asmformat.
Delete the 'name' field of all instructions that have asmformats.

llvm-svn: 15403
2004-08-01 09:52:59 +00:00
Chris Lattner
356f5a13f5 Dereferencing end() is bad.
llvm-svn: 15402
2004-08-01 09:51:42 +00:00
Chris Lattner
1cabced74b Add some immediate forms, make name optional
llvm-svn: 15401
2004-08-01 09:36:44 +00:00
Chris Lattner
f40e4ebf19 Be picky
llvm-svn: 15400
2004-08-01 08:55:34 +00:00
Chris Lattner
29d8ac77e1 Instructions no longer need to have names.
llvm-svn: 15399
2004-08-01 08:38:17 +00:00
Chris Lattner
27fcf976f2 Eliminate 3 of the X86 printImplicit* flags.
llvm-svn: 15398
2004-08-01 08:23:17 +00:00
Chris Lattner
e42675f5af Get rid of 3 of the 4 'printimplicit' flags. Implicit operands are now
explicitly listed in the asm string.

llvm-svn: 15397
2004-08-01 08:22:29 +00:00
Chris Lattner
f6bd77190e Convert more instructions over to the asmprinter
llvm-svn: 15396
2004-08-01 08:13:11 +00:00
Chris Lattner
06cf67ee14 Handle registers a bit more efficiently
llvm-svn: 15395
2004-08-01 08:12:41 +00:00
Chris Lattner
ba52a58836 give FP stack registers names
llvm-svn: 15394
2004-08-01 08:12:13 +00:00
Chris Lattner
275d98dcbb Switch more instructions over to using the asmprinter. Fix bugs in the emission
of in/out instructions (missing %'s on registers).

llvm-svn: 15393
2004-08-01 07:44:35 +00:00
Chris Lattner
d5540021fc The tblgen'erated asmparser wants a way to print operands.
llvm-svn: 15392
2004-08-01 07:43:46 +00:00
Chris Lattner
65512a0c49 Add support for asm printing machine instructions that have operands.
llvm-svn: 15391
2004-08-01 07:43:02 +00:00
Chris Lattner
5572682faa Parse the operand list of the instruction. We currently support register and immediate operands.
llvm-svn: 15390
2004-08-01 07:42:39 +00:00
Chris Lattner
9520d20c83 Rename the Printer class -> X86AsmPrinter.
Include the tablegenerated assembly writer.

llvm-svn: 15389
2004-08-01 06:02:08 +00:00
Chris Lattner
1d21ea7f1f Factor a bunch of the rules and add support for generating the asmwriter.
llvm-svn: 15388
2004-08-01 06:01:32 +00:00
Chris Lattner
321763358b Specify an asm string and operands lists for a bunch of instructions.
This only really covers no-operand instructions so far.

llvm-svn: 15387
2004-08-01 06:01:00 +00:00
Chris Lattner
1c4ae85035 Initial cut at an asm writer emitter. So far, this only handles emission of
instructions, and only instructions that take no operands at that!

llvm-svn: 15386
2004-08-01 05:59:33 +00:00
Chris Lattner
c860ecafe1 Add, and start using, the CodeGenInstruction class. This class represents
an instance of the Instruction tablegen class.

llvm-svn: 15385
2004-08-01 05:04:00 +00:00
Chris Lattner
fd6893837c Add the 'ops' marker, add an AsmString initializer
llvm-svn: 15383
2004-08-01 04:40:43 +00:00
Chris Lattner
fce9603387 Rename CodeGenWrappers.(cpp|h) -> CodeGenTarget.(cpp|h)
llvm-svn: 15382
2004-08-01 04:04:35 +00:00
Chris Lattner
6847866400 Finegrainify namespacification
llvm-svn: 15381
2004-08-01 03:55:39 +00:00
Chris Lattner
6971be8159 Completely disable the pattern isel until it is more substantial.
llvm-svn: 15380
2004-08-01 03:28:02 +00:00
Chris Lattner
70d2260eb9 Entirely eliminate all patterns and expanders from this file. We shall go
with an incremental approach rather than a revolutionary approach.

llvm-svn: 15379
2004-08-01 03:25:01 +00:00
Chris Lattner
fc24e838a6 Move the 'Expander' node to later in the file, with the other experimental
stuff.  The pattern becomes a list, add some stuff, add some comments.

llvm-svn: 15378
2004-08-01 03:23:34 +00:00
Chris Lattner
06bfc0d930 Remove obsolete file
llvm-svn: 15377
2004-08-01 03:19:28 +00:00
Alkis Evlogimenos
62c979ba07 Make OptimizeBlock take a MachineFunction::iterator instead of a
MachineBasicBlock* as a parameter so that nxext() and prior() helper
functions can work naturally on it.

llvm-svn: 15376
2004-07-31 19:24:41 +00:00
Chris Lattner
0f1c2ed907 Next on a pointer increments the pointer, not an iterator
llvm-svn: 15375
2004-07-31 18:40:36 +00:00
Alkis Evlogimenos
2303d3f660 Use next() helper to make code more readable. Use
MachineFunction::iterator instead of MachineBasicBlock* to avoid
dereferencing end iterators.

llvm-svn: 15373
2004-07-31 15:14:29 +00:00
Alkis Evlogimenos
1e8d8fd81f Use MachineFunction::iterator instead of a MachineBasicBlock* because
FallThrough maybe == to MF.end().

llvm-svn: 15372
2004-07-31 15:03:52 +00:00
Alkis Evlogimenos
bb635a27a4 Align breaks.
llvm-svn: 15371
2004-07-31 10:05:44 +00:00
Chris Lattner
05f716a972 Expose breakcriticaledges as a functionpass
llvm-svn: 15370
2004-07-31 10:02:24 +00:00
Chris Lattner
7471b96a05 Expose this as a functionpass
llvm-svn: 15369
2004-07-31 10:01:58 +00:00
Chris Lattner
25e48dd2e0 Implement a simple target-independent CFG cleanup pass
llvm-svn: 15368
2004-07-31 10:01:27 +00:00
Chris Lattner
e9d767aa75 New pass
llvm-svn: 15367
2004-07-31 09:59:14 +00:00
Chris Lattner
7e7739c431 Expose some helpful methods
llvm-svn: 15366
2004-07-31 09:59:04 +00:00
Chris Lattner
fcef7655fa Add breaks
llvm-svn: 15365
2004-07-31 09:53:31 +00:00
Alkis Evlogimenos
ce15f8f4c9 Simplify code a bit.
llvm-svn: 15364
2004-07-31 09:44:32 +00:00
Alkis Evlogimenos
aaf642103a Correctly spell 'unconditional'.
llvm-svn: 15363
2004-07-31 09:41:44 +00:00
Alkis Evlogimenos
f57d78a87d Implement insertGoto and reverseBranchCondition for the X86.
llvm-svn: 15362
2004-07-31 09:38:47 +00:00
Alkis Evlogimenos
cf63cb8be2 Change signature to take two basic blocks: the target and the one
where the goto will be appended.

llvm-svn: 15361
2004-07-31 09:37:52 +00:00
Alkis Evlogimenos
d6e20fbe12 Doxygenify some comments.
llvm-svn: 15360
2004-07-31 08:57:27 +00:00
Alkis Evlogimenos
91eae7e3d2 Remove const from iterators passed by value.
llvm-svn: 15359
2004-07-31 08:55:23 +00:00
Alkis Evlogimenos
12312ecfef Add declarations for insertGoto and reverseBranchCondition.
llvm-svn: 15358
2004-07-31 08:52:30 +00:00
Chris Lattner
4504b95801 I'm pretty sure that ba is branch always, which is a barrier. Brg should
check this :)

llvm-svn: 15357
2004-07-31 02:24:37 +00:00
Chris Lattner
66a13e230d Mark barrier instructions. Execution does not fall through uncond branches
or return intructions.

llvm-svn: 15356
2004-07-31 02:10:53 +00:00
Chris Lattner
fd4558862c Support new flag
llvm-svn: 15355
2004-07-31 02:07:26 +00:00
Chris Lattner
2ab1142138 New flag
llvm-svn: 15354
2004-07-31 02:07:07 +00:00
Chris Lattner
8b3f7d93ea Add new M_BARRIER_FLAG flag, and isBarrier() method to TargetInstrInfo
opCode -> Opcode

llvm-svn: 15353
2004-07-31 02:06:48 +00:00
Chris Lattner
3bf31d75a0 Add some machine CFG related stuff
llvm-svn: 15352
2004-07-31 01:59:11 +00:00
Tanya Lattner
081fbd1bde Updated ModuloScheduling. It makes it all the wya through register allocation on the new code!!
llvm-svn: 15351
2004-07-30 23:36:10 +00:00
Misha Brukman
695d50d030 * Conditional save/restore of LR disabled as it's not quite correct
* sumarray2d fixed: large fixed-size alloca
* make is now compileable
* Re-organized tests to fit them under proper headings

Patch by Nate Begeman.

llvm-svn: 15347
2004-07-30 15:53:09 +00:00
Misha Brukman
c102577ff1 Do not mark LR as callee-save: not quite correctly done. Patch: Nate Begeman.
llvm-svn: 15346
2004-07-30 15:51:51 +00:00
Misha Brukman
471b43a357 * Temporarily suspend LR save/restore optimization as it is not quite correct
* Implement large fixed-size allocas            Entire patch by Nate Begeman.

llvm-svn: 15345
2004-07-30 15:50:45 +00:00
Misha Brukman
24dac3044f Enable compilation.
llvm-svn: 15344
2004-07-30 14:33:07 +00:00
Misha Brukman
9c003d8f65 Fix De Morgan's name.
llvm-svn: 15343
2004-07-30 12:50:08 +00:00
Chris Lattner
d4252a7c64 Start using the PatternMatcher a bit.
llvm-svn: 15342
2004-07-30 07:50:03 +00:00
Chris Lattner
308bbe2dd3 Check in some useful helper routines for doing ML-style pattern matching on
the LLVM IR.

llvm-svn: 15341
2004-07-30 07:45:00 +00:00
Chris Lattner
5af538f6aa I demand the ability to say 'if (isa<Value>(V))'!
llvm-svn: 15340
2004-07-30 06:59:15 +00:00
Brian Gaeke
b10778dc07 Convert a few assertions with side-effects into regular old runtime checks.
These side-effects seem to make a difference when using llc -march=sparcv9
in Release mode (i.e., with -DNDEBUG); when they are left out, lots of
instructions just get dropped on the floor, because they never end up
in the schedule.

llvm-svn: 15339
2004-07-29 21:31:20 +00:00
Chris Lattner
5de840d03b Fix #includes of i*.h => Instructions.h as per PR403:
http://llvm.cs.uiuc.edu/PR403 .

llvm-svn: 15338
2004-07-29 17:31:57 +00:00
Misha Brukman
f4a410f907 Fix #includes of i*.h => Instructions.h as per PR403.
llvm-svn: 15337
2004-07-29 17:30:57 +00:00
Misha Brukman
63b38bd2ed Fix #includes of i*.h => Instructions.h as per PR403.
llvm-svn: 15334
2004-07-29 17:30:56 +00:00
Chris Lattner
b5ada398a2 Fix #includes of i*.h => Instructions.h as per PR403:
http://llvm.cs.uiuc.edu/PR403 .

llvm-svn: 15333
2004-07-29 17:23:00 +00:00
Chris Lattner
5305437005 Header moved
llvm-svn: 15332
2004-07-29 17:15:38 +00:00
Chris Lattner
66a64fb997 Fix #includes of i*.h => Instructions.h as per PR403:
http://llvm.cs.uiuc.edu/PR403 .

llvm-svn: 15331
2004-07-29 17:11:37 +00:00
Misha Brukman
2b3387a6d9 Fix #includes of i*.h => Instructions.h as per PR403.
llvm-svn: 15328
2004-07-29 17:05:13 +00:00
Misha Brukman
2d3fa9e18e Fix #includes of i*.h files => Instructions.h as per PR403
llvm-svn: 15327
2004-07-29 16:53:53 +00:00
Alkis Evlogimenos
93a7c060db Merge i*.cpp definitions into Instructions.cpp as part of bug403.
llvm-svn: 15326
2004-07-29 12:33:25 +00:00
Alkis Evlogimenos
fd7a2d4477 Merge i*.h headers into Instructions.h as part of bug403.
llvm-svn: 15325
2004-07-29 12:17:34 +00:00
Chris Lattner
c21acbfea4 Fix test/Regression/Analysis/BasicAA/2004-07-28-MustAliasbug.llx
This also fixes the miscompilation of MallocBench/gs with dead store
elimination enabled.

llvm-svn: 15324
2004-07-29 07:56:39 +00:00
Brian Gaeke
690bdefb5f Get rid of a few dead method declarations.
llvm-svn: 15323
2004-07-29 06:43:10 +00:00
Brian Gaeke
d7b36632af Get rid of calls to void llvm::printSet(const ValueSet &).
llvm-svn: 15322
2004-07-29 06:43:09 +00:00
Brian Gaeke
8f8a2ed0b3 Get rid of calls to void llvm::printSet(const ValueSet &).
Use LiveRange's iterator types and operations instead of ValueSet's.

llvm-svn: 15321
2004-07-29 06:43:08 +00:00
Brian Gaeke
3073fe3cee Don't derive from ValueSet to implement class LiveRange; instead, use a
SetVector<Value *> data member.
Add << operator for LiveRanges (a dumb one, for now.)

llvm-svn: 15320
2004-07-29 06:43:06 +00:00
Brian Gaeke
818b3631f3 Fix a few typoes and grammaroes in comments.
llvm-svn: 15319
2004-07-29 04:25:43 +00:00
Brian Gaeke
2795a34a92 Fix typo in comment.
llvm-svn: 15318
2004-07-29 04:22:30 +00:00
Brian Gaeke
3cf8d5b0a2 Remove mustSaveAcrossCalls flag, which isn't ever read, and its mutator,
markForSaveAcrossCalls.

llvm-svn: 15317
2004-07-29 04:15:36 +00:00
Chris Lattner
d78935ab60 Move Transforms/BasicAA to Analysis/BasicAA
llvm-svn: 15316
2004-07-29 01:34:10 +00:00
Chris Lattner
096a8f7f82 Due to a bug in BasicAA, DSE is incorrectly deleting the first store in
this testcase, causing the miscompilation of MallocBench/gs.

llvm-svn: 15315
2004-07-29 01:33:05 +00:00
Reid Spencer
e831f0b761 Updates to reflect most recent changes to bytecode file format:
* Dependent libraries & target triple
* Short block headers
* 24-bit type slot ids.

llvm-svn: 15314
2004-07-29 00:13:04 +00:00
Misha Brukman
0d640e87d1 Fix grammar, eliminate double parenthesized sentence fragment.
llvm-svn: 15313
2004-07-28 22:37:57 +00:00
Misha Brukman
b2246154df * Wrap code listings in <div class="doc_code">
* Wrap keywords in <tt>
* Wrap lines at 80 cols

llvm-svn: 15312
2004-07-28 22:31:54 +00:00
Misha Brukman
2361fcff41 * Use the doc_code class for code listings to make it stand out from text
* Wrap text in soft, comfortable <div>s and <p>s
* Wrap lines at 80 cols

llvm-svn: 15311
2004-07-28 22:18:33 +00:00
Misha Brukman
0fc57a6c47 Put <tt> around verbatim code elements.
llvm-svn: 15310
2004-07-28 22:09:29 +00:00
Chris Lattner
07fad1cdee Minor corrections
llvm-svn: 15309
2004-07-28 20:18:53 +00:00
Brian Gaeke
5eb1150db6 TargetInstrInfo::hasOperandInterlock() is always true, because it is
never overridden by any target.

llvm-svn: 15308
2004-07-28 19:24:48 +00:00
Misha Brukman
7f01b2539b Add notes on bug involving casting ulong -> double, thanks to Nate Begeman.
llvm-svn: 15307
2004-07-28 19:16:10 +00:00
Misha Brukman
862bb562cc Simplify loading (un)signed constants to registers, patch by Nate Begeman.
llvm-svn: 15306
2004-07-28 19:13:49 +00:00
Misha Brukman
db13b6edba Remove an extra 8 byte distance penalty. Patch by Nate Begeman.
llvm-svn: 15305
2004-07-28 19:13:07 +00:00
Misha Brukman
ca5880025d Find longs by type, not by their primitive size being 64. Patch by Nate Begeman.
llvm-svn: 15304
2004-07-28 19:12:24 +00:00
Misha Brukman
f7037385e2 LI can only take signed values, so values > 32767 can only be loaded with ORI
llvm-svn: 15299
2004-07-28 00:56:04 +00:00
Misha Brukman
bd1d7dceb7 Reorganize tests to place them in proper directories.
llvm-svn: 15298
2004-07-28 00:55:12 +00:00
Misha Brukman
04dee3bb66 UnitTests 2003-05-26-Shorts and 2003-07-09-LoadShorts have been fixed;
2003-05-22-VarSizeArray is broken.

llvm-svn: 15297
2004-07-28 00:01:41 +00:00
Misha Brukman
47d5a22f8b Fix printing of immediate operands by looking at their operand types in
the TargetInstrInfo.  This fixes UnitTests 2003-05-26-Shorts and
2003-07-09-LoadShorts.

llvm-svn: 15296
2004-07-28 00:00:48 +00:00
Misha Brukman
92ca8eccd8 Renamed files:
* PowerPCReg.td => PowerPCRegisterinfo.td
* PowerPCInstrs.td => PowerPCInstrInfo.td

llvm-svn: 15295
2004-07-27 23:29:16 +00:00
Brian Gaeke
fa8ab0ab6d ConstantTypeMustBeLoaded has been incorporated into SparcV9PreSelection, its
only user.

llvm-svn: 15294
2004-07-27 21:43:38 +00:00
Brian Gaeke
28f75c2140 This was the only user of TargetInstrInfo::ConstantTypeMustBeLoaded().
llvm-svn: 15293
2004-07-27 21:11:20 +00:00
Robert Bocchino
1256571c0d This is the regression test for the change to InstructionCombining.cpp
that I made today.  It illustrates that the old version of the code
would crash if the RHS of a multiplication were a ConstantExpr that
could not be resolved into a ConstantInt or ConstantFP.

llvm-svn: 15292
2004-07-27 21:06:34 +00:00
Robert Bocchino
7b5b86cd0f This change fixed a bug in the function visitMul. The prior version
assumed that a constant on the RHS of a multiplication was either an
IntConstant or an FPConstant.  It checked for an IntConstant and then,
if it did not find one, did a hard cast to an FPConstant.  That code
would crash if the RHS were a ConstantExpr that was neither an
IntConstant nor an FPConstant.  This version replaces the hard cast
with a dyn_cast.  It performs the same way for IntConstants and
FPConstants but does nothing, instead of crashing, for constant
expressions.

The regression test for this change is 2004-07-27-ConstantExprMul.ll.

llvm-svn: 15291
2004-07-27 21:02:21 +00:00
Robert Bocchino
22fddc7d16 *** empty log message ***
llvm-svn: 15290
2004-07-27 20:50:02 +00:00
Brian Gaeke
c3259f6413 Get rid of the (apparently non-working) filePrinterEmitter which is added in
debug mode.  Its only effect seems to be the creation of an empty file...

llvm-svn: 15289
2004-07-27 19:37:37 +00:00
Misha Brukman
2ffb787446 Branch selection support implemented by Nate Begeman for long branches.
llvm-svn: 15288
2004-07-27 18:43:04 +00:00
Chris Lattner
e4a72a0268 Fix the nightly tester to default to using gnuplot in /usr/bin
llvm-svn: 15287
2004-07-27 18:41:49 +00:00
Misha Brukman
a594740016 Correctly print out long branches, assert on finding pseudo instr COND_BRANCH
Patch by Nate Begeman.

llvm-svn: 15286
2004-07-27 18:40:39 +00:00
Misha Brukman
09396bf158 Run the branch selection pass right before the asm printer.
Patch by Nate Begeman.

llvm-svn: 15285
2004-07-27 18:39:34 +00:00
Misha Brukman
4d66925aea Remove empty unused method processFunctionBeforeFrameFinalized()
llvm-svn: 15284
2004-07-27 18:38:40 +00:00
Misha Brukman
83df71af70 Add COND_BRANCH pseudo instruction, patch by Nate Begeman.
llvm-svn: 15283
2004-07-27 18:35:54 +00:00
Misha Brukman
5b092c15c6 Build COND_BRANCHes which may become long or short, decided by a later pass.
Patch by Nate Begeman.

llvm-svn: 15282
2004-07-27 18:35:23 +00:00
Misha Brukman
a783ee55a9 Moved definition of invertPPCBranchOpcode() into PowerPCInstrInfo class.
Patch by Nate Begeman.

llvm-svn: 15281
2004-07-27 18:34:11 +00:00
Misha Brukman
ef8cf023a0 Add PowerPCBranchSelector to discover which are `long' branches.
Contributed by Nate Begeman.

llvm-svn: 15280
2004-07-27 18:33:06 +00:00
Brian Gaeke
f4c1d1ee34 TargetInstrInfo::getNOPOpCode() has been replaced by a reference to V9::NOP.
llvm-svn: 15279
2004-07-27 17:43:24 +00:00
Brian Gaeke
64f51df06d Convert many of the virtual TargetInstrInfo methods used as helper
functions in SparcV9InstrSelection and SparcV9PreSelection into regular
old global functions.  As it happens, none of them really have anything
to do with TargetInstrInfo.

llvm-svn: 15278
2004-07-27 17:43:23 +00:00
Brian Gaeke
b788626dc8 As it happens, none of these TargetInstrInfo methods which are only
used in the SparcV9 backend really have anything to do with
TargetInstrInfo, so we're converting them into regular old global
functions and moving their declarations to SparcV9InstrSelectionSupport.h.
(They're mostly used as helper functions for SparcV9InstrSelection.)

llvm-svn: 15277
2004-07-27 17:43:22 +00:00
Brian Gaeke
38b79e8fbc Make the create...() functions for some of these passes return a FunctionPass *.
llvm-svn: 15276
2004-07-27 17:43:21 +00:00
Misha Brukman
9eaa879f49 Fixed saving/restoring LR unconditionally, only done as necessary.
llvm-svn: 15275
2004-07-27 17:17:48 +00:00
Misha Brukman
bc1a2f96a6 Save and restore LR just like any other register and ONLY if we actually modify
it (due to calls or globals access).  We now compile `void empty(){}' to `blr'.

llvm-svn: 15274
2004-07-27 17:17:18 +00:00
Misha Brukman
26978c3730 LR is a 32-bit int reg
llvm-svn: 15273
2004-07-27 17:15:32 +00:00
Misha Brukman
f1a7e941fb MovePCtoLR (which is `bl' in disguise) modifies LR implicitly
llvm-svn: 15272
2004-07-27 17:15:05 +00:00
Misha Brukman
2bcffa484b Register LR is callee-saved
llvm-svn: 15271
2004-07-27 17:14:34 +00:00
Misha Brukman
640ec1e5e6 Add IMPLICIT_DEF of LR for branch-and-link instrs (calls and global accesses)
llvm-svn: 15270
2004-07-27 17:13:58 +00:00
Chris Lattner
5174f436d2 Ugh, the upgrade of zion brought in GCC 3.3.2, our arch nemesis.
llvm-svn: 15269
2004-07-27 08:29:06 +00:00
Chris Lattner
aa5b25eae6 Run DSE at link-time, and turn on an IP alias analysis by default in gccld!
The -disable-globalsmodref is temporary and will be removed eventually.

llvm-svn: 15268
2004-07-27 08:13:15 +00:00
Chris Lattner
036d2b0c4d nuke pointless -debug output
llvm-svn: 15267
2004-07-27 08:03:18 +00:00
Chris Lattner
d138437ffc New functionality
llvm-svn: 15266
2004-07-27 07:50:07 +00:00
Chris Lattner
cea15a64a2 Document new syntax
llvm-svn: 15265
2004-07-27 07:49:39 +00:00
Chris Lattner
b696462260 Fix conservative assumption, which was quite broken. Also, notice that
functions known to not access memory (like sin/cos) don't access memory! :)

llvm-svn: 15264
2004-07-27 07:46:26 +00:00
Chris Lattner
50eb771d37 Fix hoisting of void typed values, e.g. calls
llvm-svn: 15263
2004-07-27 07:38:32 +00:00
Chris Lattner
89c0c0ae3f alloca void makes no sense
llvm-svn: 15262
2004-07-27 07:30:02 +00:00
Chris Lattner
731381dc0e Remove a bogus assertion
llvm-svn: 15261
2004-07-27 07:22:21 +00:00
Chris Lattner
3a353e84b7 Complete rewrite of this pass to be faster, use less memory, be easier to
understand, and more accurate to boot!  This implements
GlobalModRef/purecse.ll over the previous impl.

llvm-svn: 15260
2004-07-27 06:40:37 +00:00
Chris Lattner
0373d994a0 new testcase
llvm-svn: 15259
2004-07-27 06:35:11 +00:00
Chris Lattner
e30d3c8292 Have some testcases
llvm-svn: 15258
2004-07-27 06:26:08 +00:00
Chris Lattner
cf146d4e6e Add a note
llvm-svn: 15257
2004-07-27 04:00:54 +00:00
Chris Lattner
b46f558bed Fix out of date comment
llvm-svn: 15256
2004-07-27 03:04:30 +00:00
Chris Lattner
7ef55da237 Simplify code and silence warning
llvm-svn: 15255
2004-07-27 02:34:49 +00:00
Chris Lattner
9b323c3521 Use context-sensitive alias analysis to avoid pessimization in clients of
AliasSetTracker (dse and licm).  This implements
DeadStoreElimination/context-sensitive.llx

llvm-svn: 15254
2004-07-27 02:20:26 +00:00
Chris Lattner
0a0fc220cc New testcase. DSE should delete all of the DEAD instructions.
llvm-svn: 15253
2004-07-27 02:19:27 +00:00
Chris Lattner
aa05a6e5a1 Make basicaa a bit more aggressive
llvm-svn: 15252
2004-07-27 02:18:52 +00:00
Chris Lattner
6b570266b8 basic-aa can actually provide simple mod/ref info
llvm-svn: 15251
2004-07-27 02:13:55 +00:00
Chris Lattner
782ab98c56 This was implemented back in march
llvm-svn: 15250
2004-07-27 01:59:42 +00:00
Chris Lattner
577fc3f576 Implement test/Regression/TableGen/ListSlices.td
llvm-svn: 15249
2004-07-27 01:01:21 +00:00
Chris Lattner
0ff7eb9ba9 New testcase for list slicing
llvm-svn: 15248
2004-07-27 01:00:56 +00:00
Chris Lattner
8bf9e06ddd Add initial support for list slices. This currently allows you to do stuff
like this:

def B {
  list<int> X = [10, 20, 30, 4, 1, 1231, 20] [2-4,2,2,0-6];
}

... which isn't particularly useful, but more is to come.

llvm-svn: 15247
2004-07-26 23:21:34 +00:00
Reid Spencer
a559cb8e10 A utility to run an arbitrary program on each of the LLVM source files.
This is like llvmgrep but instead of running grep, it runs the command
given by the first argument. For example, to find the top ten files with
the most lines in llvm, you could:

utils/llvmdo wc -l | sort -nb | tail

Or, to find any source files with the wrong permissions, you could:

utils/llvmdo ls -l | grep -v rw-r--r--

Hopefully, you get the idea.

llvm-svn: 15246
2004-07-26 22:52:44 +00:00
Misha Brukman
b5ed14486b Do not store the stack pointer if the stack size is 0.
Also, convert C-style comments to C++ and make sure code wraps at 80 cols.

llvm-svn: 15245
2004-07-26 22:00:26 +00:00
Misha Brukman
58499ead7d ADDI can take several forms, including:
addi r1, r2, 0
  addi r1, <frame index #n>, 0

so we must check for the second parameter being a register for this instruction
to be considered a reg-to-reg copy.

llvm-svn: 15244
2004-07-26 21:50:38 +00:00
Misha Brukman
6c125a92d7 assert() on MachineInstr properties instead of checking them dynamically
llvm-svn: 15243
2004-07-26 21:35:58 +00:00
Misha Brukman
43f1c4045a * Recognize `addi r1, r2, 0' a move instruction
* List formats of instructions currently recognized as moves

llvm-svn: 15242
2004-07-26 21:29:00 +00:00
Chris Lattner
7f50013b0e Remove dead section
llvm-svn: 15241
2004-07-26 21:16:55 +00:00
Misha Brukman
a332a646a0 Fix indentation: should be 2 spaces.
llvm-svn: 15240
2004-07-26 18:48:58 +00:00
Misha Brukman
cf7d3af07f Fix file header as it has been renamed.
llvm-svn: 15239
2004-07-26 18:45:48 +00:00
Misha Brukman
bca562404c Renamed files to have the `X86' prefix for uniqueness purposes.
All CVS history was renamed, the *,v were copied over.  No worries.

llvm-svn: 15238
2004-07-26 18:43:11 +00:00
Misha Brukman
74e3a17958 * Rewrote casts
* Implemented GEP folding
* Dynamically output global address stuff once per function
* Fix casting fp<->short/byte

Patch contributed by Nate Begeman.

llvm-svn: 15237
2004-07-26 18:13:24 +00:00
Misha Brukman
ed664f91a4 Increment the label number in runOnFunction() rather than while printing out
some instruction.  Patch by Nate Begeman.

llvm-svn: 15236
2004-07-26 16:28:33 +00:00
Misha Brukman
d815472ebd More notes on bugs, unimplemented features, and suggested code improvements.
Written by Nate Begeman.

llvm-svn: 15235
2004-07-26 16:23:55 +00:00
Misha Brukman
40f07ec771 Fix subtracting values > 2^15 in the prologue/epilogue, by Nate Begeman.
llvm-svn: 15234
2004-07-26 16:22:52 +00:00
Reid Spencer
084010444f Added another test case for double FP constants as well.
llvm-svn: 15233
2004-07-26 15:04:13 +00:00
Chris Lattner
f29807169a Implement DeadStoreElim/alloca.llx by observing that allocas are dead at the
end of the function (either return or unwind)

llvm-svn: 15232
2004-07-26 06:14:11 +00:00
Chris Lattner
988d70c732 New testcase
llvm-svn: 15231
2004-07-26 06:11:42 +00:00
Chris Lattner
bf8c3c405e Add some new methods
llvm-svn: 15230
2004-07-26 05:50:23 +00:00
Chris Lattner
d1818f008f New methods
llvm-svn: 15229
2004-07-26 05:50:09 +00:00
Chris Lattner
a2311dac5f Update test
llvm-svn: 15228
2004-07-26 05:04:25 +00:00
Chris Lattner
e5ad26dbb3 Throttle back indvar substitution from creating multiplies in loops. This is bad bad bad.
llvm-svn: 15227
2004-07-26 02:47:12 +00:00
Chris Lattner
87dc093b10 Fix bug in previous patch :(
llvm-svn: 15226
2004-07-26 01:40:20 +00:00
Chris Lattner
c2cb34ae61 Fix an extremely serious regression that was causing LLVM basic blocks to be
scrambled around almost at random, having really bad effects on icache locality.

llvm-svn: 15225
2004-07-26 01:22:59 +00:00
Chris Lattner
74635dc879 Fix a serious bug in the double constant reader. In particular, because
(At[3] << 24) is an int type and it is being coerced to uint64_t, it was
getting sign extended, causing us to get FFFFFFFFxxxxxxxx constants all of
the time.

llvm-svn: 15224
2004-07-25 23:15:44 +00:00
Chris Lattner
21a015c12f 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
Reid Spencer
4b7a38d455 Bugs fixed.
llvm-svn: 15222
2004-07-25 22:15:33 +00:00
Reid Spencer
48f98c8545 Avoid use of size(), which counts, in favor of other mechanisms.
llvm-svn: 15221
2004-07-25 21:44:54 +00:00
Reid Spencer
9a5f371ce9 Always write FP values correctly.
Adjust for new Module.h interface for dependent libraries.
Excise unused backwards compatibility flag.

llvm-svn: 15220
2004-07-25 21:36:26 +00:00
Reid Spencer
bd72920331 Don't create a backwards compatibility flag for something that was a
regression bug introduced in release 1.2

llvm-svn: 15219
2004-07-25 21:32:51 +00:00
Reid Spencer
b95885b210 Adjust to new Module.h interface for dependent libraries.
llvm-svn: 15218
2004-07-25 21:32:02 +00:00
Reid Spencer
62c6da9a64 Adjust to new Module.h interface for dependent libraries
Remove mem leaks resulting from not freeing parse strings.

llvm-svn: 15217
2004-07-25 21:30:51 +00:00
Reid Spencer
ffec7df2c1 Adjust to new Module.h interface for dependent libraries
Only write the target triple and deplibs if they are non-empty.

llvm-svn: 15216
2004-07-25 21:29:43 +00:00
Reid Spencer
08a6508e5d Reduce the footprint of the dependent library interface
Document the dependent library interface
Constify the std::string& parameters in the dep lib interface.

llvm-svn: 15215
2004-07-25 21:28:19 +00:00
Chris Lattner
0c73a1ff05 Fix a latent bug in the AliasSetTracker that was exposed by the FreeInst additions and broke a bunch of programs last night.
llvm-svn: 15214
2004-07-25 18:32:01 +00:00
Reid Spencer
8c1f5c5c64 bug 263:
Add target triple and dependent libraries support to this test.

llvm-svn: 15213
2004-07-25 18:09:47 +00:00
Reid Spencer
a0b05b399d bug 263:
Ensure the list of libraries is cleared.

llvm-svn: 15212
2004-07-25 18:08:57 +00:00
Reid Spencer
cc5ff64416 bug 263:
Add ability to write target triple and dependent libraries information.

llvm-svn: 15211
2004-07-25 18:08:18 +00:00
Reid Spencer
b2bdb943b5 bug 263:
- encode/decode target triple and dependent libraries
bug 401:
- fix encoding/decoding of FP values to be little-endian only
bug 402:
- initial (compatible) cut at 24-bit types instead of 32-bit
- reduce size of block headers by 50%
Other:
- cleanup Writer by consolidating to one compilation unit, rem. other files
- use a std::vector instead of std::deque so the buffer can be allocated
  in multiples of 64KByte chunks rather than in multiples of some smaller
  (default) number.

llvm-svn: 15210
2004-07-25 18:07:36 +00:00
Reid Spencer
a24de0d15d bug 263:
Provide parsing for the target triple and dependent libraries.

llvm-svn: 15209
2004-07-25 17:58:28 +00:00
Reid Spencer
4add91957c bug 263:
Provide new tokens for target triples and dependent libraries.

llvm-svn: 15208
2004-07-25 17:56:00 +00:00
Reid Spencer
2b8548cdf1 bug 263:
The necessary changes to module in order to support both target triples and
a list of dependent libraries.

llvm-svn: 15207
2004-07-25 17:52:27 +00:00
Reid Spencer
e7dfd77424 bug 402:
A new set of block identifiers has been added for version 1.3 so that the
range of values can fit within 5 bits. This aids in halving the size of
block headers.

llvm-svn: 15206
2004-07-25 17:50:00 +00:00
Chris Lattner
3afbb93c67 Codify my thoughts on where we want to end up with the target-independent
code generator.  Comments welcome.

llvm-svn: 15205
2004-07-25 12:13:35 +00:00
Chris Lattner
7b25bcdf52 * Substantially simplify how free instructions are handled (potentially fixing
a bug in DSE).
* Delete dead operand uses iteratively instead of recursively, using a
  SetVector.
* Defer deletion of dead operand uses until the end of processing, which means
  we don't have to bother with updating the AliasSetTracker.  This speeds up
  DSE substantially.

llvm-svn: 15204
2004-07-25 11:09:56 +00:00
Chris Lattner
461c1f9857 Add back() and pop_back() methods to SetVector
Move clear to the end of the class
Add assertions

llvm-svn: 15203
2004-07-25 11:07:02 +00:00
Alkis Evlogimenos
83d9b62b28 Add some comments to the backtracking code.
llvm-svn: 15200
2004-07-25 08:10:33 +00:00
Chris Lattner
4c1c1ac7e4 Free instructions kill values too. This implements DeadStoreElim/free.llx
llvm-svn: 15199
2004-07-25 07:58:38 +00:00
Chris Lattner
fb7dd4c1a3 New testcase for DSE
llvm-svn: 15198
2004-07-25 07:57:50 +00:00
Chris Lattner
924c68dcb2 Add support for free instructions
llvm-svn: 15197
2004-07-25 07:57:37 +00:00
Chris Lattner
bbe845b969 Fix the sense of joinable
llvm-svn: 15196
2004-07-25 07:47:25 +00:00
Chris Lattner
d1980dbeba Remove linux/solaris specific stuff.
llvm-svn: 15195
2004-07-25 07:34:00 +00:00
Chris Lattner
ccc75d4f32 This patch makes use of the infrastructure implemented before to safely and
aggressively coallesce live ranges even if they overlap.  Consider this LLVM
code for example:

int %test(int %X) {
        %Y = mul int %X, 1      ;; Codegens to Y = X
        %Z = add int %X, %Y
        ret int %Z
}

The mul is just there to get a copy into the code stream.  This produces
this machine code:

 (0x869e5a8, LLVM BB @0x869b9a0):
        %reg1024 = mov <fi#-2>, 1, %NOREG, 0    ;; "X"
        %reg1025 = mov %reg1024                 ;; "Y"  (subsumed by X)
        %reg1026 = add %reg1024, %reg1025
        %EAX = mov %reg1026
        ret

Note that the life times of reg1024 and reg1025 overlap, even though they
contain the same value.  This results in this machine code:

test:
        mov %EAX, DWORD PTR [%ESP + 4]
        mov %ECX, %EAX
        add %EAX, %ECX
        ret

Another, worse case involves loops and PHI nodes.  Consider this trivial loop:
testcase:

int %test2(int %X) {
entry:
        br label %Loop
Loop:
        %Y = phi int [%X, %entry], [%Z, %Loop]
        %Z = add int %Y, 1
        %cond = seteq int %Z, 100
        br bool %cond, label %Out, label %Loop
Out:
        ret int %Z
}

Because of interactions between the PHI elimination pass and the register
allocator, this got compiled to this code:

test2:
        mov %ECX, DWORD PTR [%ESP + 4]
.LBBtest2_1:
***     mov %EAX, %ECX
        inc %EAX
        cmp %EAX, 100
***     mov %ECX, %EAX
        jne .LBBtest2_1

        ret

Or on powerpc, this code:

_test2:
        mflr r0
        stw r0, 8(r1)
        stwu r1, -60(r1)
.LBB_test2_1:
        addi r2, r3, 1
        cmpwi cr0, r2, 100
***     or r3, r2, r2
        bne cr0, .LBB_test2_1

***     or r3, r2, r2
        lwz r0, 68(r1)
        mtlr r0
        addi r1, r1, 60
        blr 0



With this improvement in place, we now generate this code for these two
testcases, which is what we want:


test:
        mov %EAX, DWORD PTR [%ESP + 4]
        add %EAX, %EAX
        ret

test2:
        mov %EAX, DWORD PTR [%ESP + 4]
.LBBtest2_1:
        inc %EAX
        cmp %EAX, 100
        jne .LBBtest2_1 # Loop
        ret

Or on PPC:

_test2:
        mflr r0
        stw r0, 8(r1)
        stwu r1, -60(r1)
.LBB_test2_1:
        addi r3, r3, 1
        cmpwi cr0, r3, 100
        bne cr0, .LBB_test2_1

        lwz r0, 68(r1)
        mtlr r0
        addi r1, r1, 60
        blr 0


Static numbers for spill code loads/stores/reg-reg copies (smaller is better):

em3d:       before: 47/25/26         after: 44/22/24
164.gzip:   before: 433/245/310      after: 403/231/278
175.vpr:    before: 3721/2189/1581   after: 4144/2081/1423
176.gcc:    before: 26195/8866/9235  after: 25942/8082/8275
186.crafty: before: 4295/2587/3079   after: 4119/2519/2916
252.eon:    before: 12754/7585/5803  after: 12508/7425/5643
256.bzip2:  before: 463/226/315      after: 482:241/309


Runtime perf number samples on X86:

gzip: before: 41.09 after: 39.86
bzip2: runtime: before: 56.71s after: 57.07s
gcc: before: 6.16 after: 6.12
eon: before: 2.03s after: 2.00s
llvm-svn: 15194
2004-07-25 07:11:19 +00:00
Chris Lattner
c8002d49e3 Make a method const, no functionality changes
llvm-svn: 15193
2004-07-25 06:23:01 +00:00
Chris Lattner
51ebdec5c0 I think that V8 should coallesce registers, don't you?
llvm-svn: 15192
2004-07-25 06:19:04 +00:00
Alkis Evlogimenos
74614b0c30 Use name.empty() instead of testing against equality with the empty
string.

llvm-svn: 15191
2004-07-25 06:16:52 +00:00
Alkis Evlogimenos
2f130282bd Disallow creation of named values of type void.
llvm-svn: 15190
2004-07-25 06:07:15 +00:00
Chris Lattner
83b9c50f8f Fix a bug where we incorrectly value numbered the first PHI definition the
same as the PHI use.  This is not correct as the PHI use value is different
depending on which branch is taken.  This fixes espresso with aggressive
coallescing, and perhaps others.

llvm-svn: 15189
2004-07-25 05:45:18 +00:00
Chris Lattner
af7e898e84 Fix a bug in the range remover
llvm-svn: 15188
2004-07-25 05:43:53 +00:00
Chris Lattner
0e58e5e48c Add debugging output for joining assignments
llvm-svn: 15187
2004-07-25 03:24:11 +00:00
Alkis Evlogimenos
e0ab16fe54 Remove implementation of operator= and make it private so that it is
not used accidentally.

llvm-svn: 15172
2004-07-24 18:55:15 +00:00
Alkis Evlogimenos
cf72e7f854 Change std::map<unsigned, LiveInterval*> into a std::map<unsigned,
LiveInterval>. This saves some space and removes the pointer
indirection caused by following the pointer.

llvm-svn: 15167
2004-07-24 11:44:15 +00:00
Chris Lattner
4e0969b500 Finally give bugpoint -timeout support!
llvm-svn: 15163
2004-07-24 07:53:26 +00:00
Chris Lattner
bad6478b00 obvious fix
llvm-svn: 15162
2004-07-24 07:51:27 +00:00
Chris Lattner
2731ead702 Get rid of the printout from the low-level system interface
llvm-svn: 15161
2004-07-24 07:50:48 +00:00
Chris Lattner
8171b14fcc Pass timeouts into the low level "execute program with timeout" function
llvm-svn: 15160
2004-07-24 07:49:11 +00:00
Chris Lattner
e0afd9bd53 Provide timeout values to all abstract interpreters
llvm-svn: 15159
2004-07-24 07:48:50 +00:00
Chris Lattner
f5da5de94a Add support for killing the program if it executes for too long.
llvm-svn: 15158
2004-07-24 07:41:31 +00:00
Chris Lattner
8c595eb4bd whoops, didn't mean to remove this
llvm-svn: 15157
2004-07-24 04:32:22 +00:00
Chris Lattner
d9bbbb8484 In the joiner, merge the small interval into the large interval. This restores
us back to taking about 10.5s on gcc, instead of taking 15.6s!  The net result
is that my big patches have hand no significant effect on compile time or code
quality.  heh.

llvm-svn: 15156
2004-07-24 03:41:50 +00:00
Chris Lattner
c51866a20e Completely eliminate the intervals_ list. instead, the r2iMap_ maintains
ownership of the intervals.

llvm-svn: 15155
2004-07-24 03:32:06 +00:00
Chris Lattner
7efcdb7ca3 Big change to compute logical value numbers for each LiveRange added to an
Interval.  This generalizes the isDefinedOnce mechanism that we used before
to help us coallesce ranges that overlap.  As part of this, every logical
range with a different value is assigned a different number in the interval.
For example, for code that looks like this:

0  X = ...
4  X += ...
  ...
N    = X

We now generate a live interval that contains two ranges: [2,6:0),[6,?:1)
reflecting the fact that there are two different values in the range at
different positions in the code.

Currently we are not using this information at all, so this just slows down
liveintervals.  In the future, this will change.

Note that this change also substantially refactors the joinIntervalsInMachineBB
method to merge the cases for virt-virt and phys-virt joining into a single
case, adds comments, and makes the code a bit easier to follow.

llvm-svn: 15154
2004-07-24 02:59:07 +00:00
Chris Lattner
d7b9e29327 Add a new differingRegisterClasses method
make overlapsAliases take pointers instead of references
fix indentation

llvm-svn: 15153
2004-07-24 02:53:43 +00:00
Chris Lattner
038747f5c0 Little stuff:
* Fix comment typeo
* add dump() methods
* add a few new methods like getLiveRangeContaining, removeRange & joinable
  (which is currently the same as overlaps)
* Remove the unused operator==

Bigger change:

* In LiveInterval, instead of using a boolean isDefinedOnce to keep track of
  if there are > 1 definitions in a particular interval, keep a counter,
  NumValues to keep track of exactly how many there are.
* In LiveRange, add a new ValId element to indicate which of the numbered
  values each LiveRange belongs to.   We now no longer merge LiveRanges if
  they are of differing value ID's even if they are neighbors.

llvm-svn: 15152
2004-07-24 02:52:23 +00:00
Misha Brukman
8930d4f24e Running list of bugs, unimplemented features, currently broken tests, until we
have a nightly tester set up for PowerPC.

llvm-svn: 15147
2004-07-23 22:37:22 +00:00
Misha Brukman
c150bdb52e Eliminate spurious empty space; make code easier to page through.
llvm-svn: 15146
2004-07-23 22:35:49 +00:00
Misha Brukman
66c816a6a3 Simplify boolean test.
llvm-svn: 15145
2004-07-23 21:43:26 +00:00
Chris Lattner
1604b02c4c More minor changes:
* Inline some functions
 * Eliminate some comparisons from the release build

This is good for another .3 on gcc.

llvm-svn: 15144
2004-07-23 21:24:19 +00:00
Misha Brukman
26a04b79cb Implement casting a floating point to 32-bit unsigned value
llvm-svn: 15143
2004-07-23 20:32:59 +00:00
Brian Gaeke
dfaa6ec48f bug fixed
llvm-svn: 15142
2004-07-23 19:41:13 +00:00
Chris Lattner
b4acba49b1 Change addRange and join to be a little bit smarter. In particular, we don't
want to insert a new range into the middle of the vector, then delete ranges
one at a time next to the inserted one as they are merged.

Instead, if the inserted interval overlaps, just start merging.  The only time
we insert into the middle of the vector is when we don't overlap at all.  Also
delete blocks of live ranges if we overlap with many of them.

This patch speeds up joining by .7 seconds on a large testcase, but more
importantly gets all of the range adding code into addRangeFrom.

llvm-svn: 15141
2004-07-23 19:38:44 +00:00
Brian Gaeke
657e590c93 Fix problem with inserting FunctionPasses that depend on ImmutablePasses
(e.g., LICM) into FunctionPassManagers. The problem is that we were
using a C-style cast to cast required analysis passes to PassClass*, but
if it's a FunctionPassManager, and the required analysis pass is an
ImmutablePass, the types aren't really compatible, so the C-style cast
causes a crash.

llvm-svn: 15140
2004-07-23 19:35:50 +00:00
Chris Lattner
2fcc5e416d Search by the start point, not by the whole interval. This saves some
comparisons, reducing linscan by another .1 seconds :)

llvm-svn: 15139
2004-07-23 18:40:00 +00:00
Chris Lattner
60babd0431 New helper method
llvm-svn: 15138
2004-07-23 18:39:12 +00:00
Chris Lattner
848c7c59d4 Speedup debug builds a bit
llvm-svn: 15137
2004-07-23 18:38:52 +00:00
Chris Lattner
c96d299569 Instead of searching for a live interval pair, search for a location. This gives
a very modest speedup of .3 seconds compiling 176.gcc (out of 20s).

llvm-svn: 15136
2004-07-23 18:13:24 +00:00
Chris Lattner
856383326a Rename LiveIntervals.(cpp|h) -> LiveIntervalAnalysis.(cpp|h)
llvm-svn: 15135
2004-07-23 17:56:30 +00:00
Chris Lattner
78f62e37f3 Pull the LiveRange and LiveInterval classes out of LiveIntervals.h (which
will soon be renamed) into their own file.  The new file should not emit
DEBUG output or have other side effects.  The LiveInterval class also now
doesn't know whether its working on registers or some other thing.

In the future we will want to use the LiveInterval class and friends to do
stack packing.  In addition to a code simplification, this will allow us to
do it more easily.

llvm-svn: 15134
2004-07-23 17:49:16 +00:00
Misha Brukman
7dba17d1ce * Codegen of GEPs dramatically improved by folding multiplies and adds
* Function pointers implemented correctly using appropriate stubs

Contributed by Nate Begeman.

llvm-svn: 15133
2004-07-23 16:08:20 +00:00
John Criswell
9537b0455f Revised the generation of files so that they follow the newer autoconf
standards.  This is in hopes of fixing configuration problems on
Windows Services for Unix.

llvm-svn: 15132
2004-07-23 15:40:57 +00:00
Chris Lattner
53280cd26e Improve comments a bit
Use an explicit LiveRange class to represent ranges instead of an std::pair.
This is a minor cleanup, but is really intended to make a future patch simpler
and less invasive.

Alkis, could you please take a look at LiveInterval::liveAt?  I suspect that
you can add an operator<(unsigned) to LiveRange, allowing us to speed up the
upper_bound call by quite a bit (this would also apply to other callers of
upper/lower_bound).  I would do it myself, but I still don't understand that
crazy liveAt function, despite the comment. :)

Basically I would like to see this:
    LiveRange dummy(index, index+1);
    Ranges::const_iterator r = std::upper_bound(ranges.begin(),
                                                ranges.end(),
                                                dummy);

Turn into:
    Ranges::const_iterator r = std::upper_bound(ranges.begin(),
                                                ranges.end(),
                                                index);

llvm-svn: 15130
2004-07-23 08:24:23 +00:00
Chris Lattner
aaf1e74a85 Change column name
llvm-svn: 15129
2004-07-23 06:50:18 +00:00
Chris Lattner
2d75978bc6 Update live intervals more accurately for PHI elim. This slightly reduces
the live intervals for some registers.

llvm-svn: 15125
2004-07-23 05:27:43 +00:00
Chris Lattner
b549420cd0 Force coallescing of live ranges that have a single definition, even if they
interfere.  Because these intervals have a single definition, and one of them
is a copy instruction, they are always safe to merge even if their lifetimes
interfere.  This slightly reduces the amount of spill code, for example on
252.eon, from:

 12837 spiller               - Number of loads added
  7604 spiller               - Number of stores added
  5842 spiller               - Number of register spills
 18155 liveintervals         - Number of identity moves eliminated after coalescing

to:

  12754 spiller               - Number of loads added
   7585 spiller               - Number of stores added
   5803 spiller               - Number of register spills
  18262 liveintervals         - Number of identity moves eliminated after coalescing

The much much bigger win would be to merge intervals with multiple definitions
(aka phi nodes) but this is not that day.

llvm-svn: 15124
2004-07-23 05:26:05 +00:00
Misha Brukman
6aa3c83f8d * Convert "\n" -> '\n'
* Print out another '\n' after printing out program execution status
* Make sure code wraps at 80 cols

llvm-svn: 15123
2004-07-23 01:30:49 +00:00
Misha Brukman
4fb48609dc Bool alignment on MacOSX/PowerPC is 4 bytes.
llvm-svn: 15122
2004-07-23 01:11:46 +00:00
Misha Brukman
db72025d1d * Change class of BoolTy back to cInt
* Fix indentation back to 2 spaces

llvm-svn: 15121
2004-07-23 01:11:19 +00:00
Misha Brukman
3faa865508 * Add BoolAlignment to TargetData, default is 1 byte, size 1 byte
* Convert tabs to spaces

llvm-svn: 15120
2004-07-23 01:09:52 +00:00
Misha Brukman
f0cfb33bbb * Add a BoolAlignment field to TargetData, default is 1 byte
* Fix spacing

llvm-svn: 15119
2004-07-23 01:08:13 +00:00
Chris Lattner
84b93bb107 costmetic changes
llvm-svn: 15118
2004-07-22 23:05:12 +00:00
Misha Brukman
d859e170fc Let's not get carried away here, please.
llvm-svn: 15117
2004-07-22 22:43:21 +00:00
John Criswell
ba60b3209b Give some credit to Oscar. Should help to address Bug#13.
llvm-svn: 15116
2004-07-22 22:11:16 +00:00
Chris Lattner
6b2b26c6f2 Fix broken -debug printing
llvm-svn: 15115
2004-07-22 21:54:22 +00:00
Chris Lattner
8799dd9e2e The default has not been 'simple' for AGES!
llvm-svn: 15114
2004-07-22 21:46:02 +00:00
Chris Lattner
87bf918bc0 Remove some abandoned code that was never finished. If needed in the future
it can be ressurected from CVS.

llvm-svn: 15113
2004-07-22 21:32:38 +00:00
Chris Lattner
8d06c43f01 Remove some (LARGE) abandoned code for the release. If this is ever needed
again in the future, it can be resurrected out of CVS

llvm-svn: 15112
2004-07-22 21:30:35 +00:00
Chris Lattner
68426e5ba6 Make linear scan the default
llvm-svn: 15111
2004-07-22 18:42:00 +00:00
Misha Brukman
333f58836c * Change bool from cInt to cByte (for now)
* Don't allow negative immediates to users of unsigned immediates
* Fix long compares
* Support <const int>, op as a potential immediate candidate
* Fix sign extension of short and byte loads
* Fix and improve integer casts
* Fix passing of doubles as vararg functions

Patch contributed by Nate Begeman.

llvm-svn: 15109
2004-07-22 15:58:04 +00:00
Alkis Evlogimenos
c73b76a0a8 Put variable name to a separate line.
llvm-svn: 15108
2004-07-22 15:30:33 +00:00
Misha Brukman
6dd644e017 Fix indentation and wrap code at 80 cols
llvm-svn: 15107
2004-07-22 15:26:23 +00:00
Alkis Evlogimenos
61546f3e5b Sorting is now handled by both linearscan and iterative scan so live
intervals need not be sorted anymore. Removing this redundant step
improves LiveIntervals running time by 5% on 176.gcc.

llvm-svn: 15106
2004-07-22 15:18:10 +00:00
Alkis Evlogimenos
52cff0adf0 Fit to 80 columns.
llvm-svn: 15105
2004-07-22 14:29:31 +00:00
Chris Lattner
7ba1be09b3 Remove redundant SCCP pass
Add new DSE pass.  Add a temporary option to disable it in case we need it
This is going in after the July 22 nightly tester run, so we'll wait until the 23rd to see it
:)

llvm-svn: 15104
2004-07-22 08:34:33 +00:00
Alkis Evlogimenos
1a876fab64 Some compile time improvements resulting in a 1sec speedup in the 5sec
compilation of gcc:

* Use vectors instead of lists for the intervals sets
* Use a heap for the unhandled set to keep intervals always sorted and
  makes insertions back to the heap very fast (compared to scanning a
  list)

llvm-svn: 15103
2004-07-22 08:14:44 +00:00
Chris Lattner
a363ea488f New prototype
llvm-svn: 15102
2004-07-22 08:07:30 +00:00
Chris Lattner
3844c300de This is a trivial dead store elimination pass. It very very simple and
can be improved in many ways.  But: stop laughing, even with -basicaa it
deletes 15% of the stores in 252.eon :)

llvm-svn: 15101
2004-07-22 08:00:28 +00:00
Chris Lattner
e82780c22e Trivial testcase for dse
llvm-svn: 15100
2004-07-22 07:59:20 +00:00
Chris Lattner
053427ff4f Clean up reference counting to stop "leaking" alias sets
llvm-svn: 15099
2004-07-22 07:58:18 +00:00
Chris Lattner
f2b976bdd5 Remove extraneous punctuation
llvm-svn: 15098
2004-07-22 05:51:56 +00:00
Chris Lattner
51f7c9e56d Update GC intrinsics to take a pointer to the object as well as a pointer
to the field being updated.  Patch contributed by Tobias Nurmiranta

llvm-svn: 15097
2004-07-22 05:51:13 +00:00
Chris Lattner
001aba76fd Updates to gc intrinsics, contributed by Tobias Nurmiranta
llvm-svn: 15096
2004-07-22 05:50:01 +00:00
Chris Lattner
609111020f Update documentation for gc intrinsics change. Contributed by
Tobias Nurmiranta

llvm-svn: 15095
2004-07-22 05:49:38 +00:00
Chris Lattner
7324574660 Update gc intrinsics to take pointer to object as well as pointer to field.
Patch contributed by Tobias Nurmiranta

llvm-svn: 15094
2004-07-22 05:48:38 +00:00
Alkis Evlogimenos
120187935d Use reverse iterators when updating the vector, since scanning from
the end will reduce erase() runtimes.

llvm-svn: 15093
2004-07-22 02:16:53 +00:00
Chris Lattner
6ff6021712 That funny 2-address lowering pass can also cause multiple definitions,
fortunately, they are easy to handle if we know about them.  This patch fixes
some serious pessimization of code produced by the linscan register allocator.

llvm-svn: 15092
2004-07-22 00:04:14 +00:00
Chris Lattner
adbbc62f82 Minor cleanups
llvm-svn: 15091
2004-07-21 23:17:57 +00:00
Chris Lattner
fac8452acf Fix cases where we generated horrible code like this:
mov %EDI, 12
        add %EDI, %ECX
        mov %ECX, 12
        add %ECX, %EDX
        mov %EDX, 12
        add %EDX, %ESI

instead (really!) generate this:

        add %ECX, 12
        add %EDX, 12
        add %ESI, 12

llvm-svn: 15090
2004-07-21 21:28:26 +00:00
Brian Gaeke
902dcf0729 These files don't need to include <iostream> since they include "Support/Debug.h".
llvm-svn: 15089
2004-07-21 20:50:33 +00:00
Brian Gaeke
025daeeee6 Include <iostream> here, because most people using DEBUG() want to use std::cerr too.
This means that users of this file do not also need to include <iostream>.

llvm-svn: 15088
2004-07-21 20:50:22 +00:00
Misha Brukman
dbd14bc3e5 * Add the lost fix to define the second reg of a 2-reg representation of longs
* Fix opcode RLWNM -> RLWINM since it uses an immediate const shift value

llvm-svn: 15087
2004-07-21 20:30:18 +00:00
Misha Brukman
87e07f8596 * Speed up canUseAsImmediateForOpcode() by comparing Operand before
dyn_cast<>ing and checking Constant's value
* Convert tabs to spaces

llvm-svn: 15086
2004-07-21 20:22:06 +00:00
Chris Lattner
d8f5e2ccac * Further cleanup.
* Test for whether bits are shifted out during the optzn.

If so, the fold is illegal, though it can be handled explicitly for setne/seteq

This fixes the miscompilation of 254.gap last night, which was a latent bug
exposed by other optimizer improvements.

llvm-svn: 15085
2004-07-21 20:14:10 +00:00
Misha Brukman
8d75aa4475 * Fix printing of signed immediate values (Nate Begeman)
* Fix printing of `zeroinitializer'
* Fix printing of `linkonce' globals, complete with stubs

llvm-svn: 15084
2004-07-21 20:11:11 +00:00
Misha Brukman
072af37088 * Fix printing of signed immediate values
* Generation of opcodes that take 16 bit immediates
* Rewrote multiply to be correct for 64 bit values
* Rewrote all the long handling to be correct for PowerPC
* Fix visitSelectInst() to define the upper register of the pair of regs
  representing a long value

Patch contributed by Nate Begeman.

llvm-svn: 15083
2004-07-21 20:09:08 +00:00
Chris Lattner
1638de4499 Make cast-cast code a bit more defensive
"simplify" a bit of code for comparison/and folding

llvm-svn: 15082
2004-07-21 19:50:44 +00:00
Misha Brukman
455622577a Use addSImm() instead of addImm() for stack offsets, which may be negative.
llvm-svn: 15081
2004-07-21 19:36:57 +00:00
Misha Brukman
00df656502 Reid doesn't need a definite article in front of his name.
llvm-svn: 15080
2004-07-21 18:04:27 +00:00
Misha Brukman
2887818206 Delete extra space; add <p> tags around text within a <div>
llvm-svn: 15079
2004-07-21 18:02:43 +00:00
Alkis Evlogimenos
c74c7d1101 Fix analysis name.
llvm-svn: 15078
2004-07-21 17:23:44 +00:00
Misha Brukman
984bfdc702 Add SUBI instruction
llvm-svn: 15077
2004-07-21 15:53:04 +00:00
Misha Brukman
ab25ccb9ea Fix spelling of `iterative scan'
llvm-svn: 15075
2004-07-21 12:53:14 +00:00
Misha Brukman
53bba06e37 * Uncomment rule for location of LLI (formerly commented out: typo?)
* Add space between VAR and `='

llvm-svn: 15074
2004-07-21 12:47:40 +00:00
Alkis Evlogimenos
701071a144 Clear spilled list at once. Remove unused vector.
llvm-svn: 15073
2004-07-21 12:00:10 +00:00
Alkis Evlogimenos
a3efc03731 Change std::list into a std::vector for IntervalSets. This reduces
compile time for 176.gcc from 5.6 secs to 4.7 secs.

llvm-svn: 15072
2004-07-21 09:46:55 +00:00
Alkis Evlogimenos
29d020ab60 Add greater_ptr functor.
llvm-svn: 15070
2004-07-21 08:38:06 +00:00
Alkis Evlogimenos
fbc436bbce Improve file comment.
llvm-svn: 15069
2004-07-21 08:28:39 +00:00
Alkis Evlogimenos
d524e5bdf2 Add Iterative scan register allocator.
llvm-svn: 15068
2004-07-21 08:24:35 +00:00
Alkis Evlogimenos
c03ccc225b Linearscan is no longer experimental.
llvm-svn: 15067
2004-07-21 08:18:50 +00:00
Chris Lattner
abc4f4523f Add capability to remove aliasing aliassets from an AST
llvm-svn: 15066
2004-07-21 07:04:26 +00:00
Chris Lattner
b2903c2a1e Add a bunch of new functionality, primarily to do with removing aliasing
pointers from an AST.

llvm-svn: 15065
2004-07-21 07:03:57 +00:00
Chris Lattner
2cfaef23e4 Make the AST interface a bit richer by returning whether an insertion caused
an insertion or not (because the pointer set already existed).

llvm-svn: 15064
2004-07-21 05:18:04 +00:00
Chris Lattner
4fbad968f8 Remove special casing of pointers and treat them generically as integers of
the appopriate size.  This gives us the ability to eliminate int -> ptr -> int

llvm-svn: 15063
2004-07-21 04:27:24 +00:00
Chris Lattner
fdcf624939 Do not ignore casts unless they are pointer-pointer casts. This caused us
to miscompile the SingleSource/Regression/C++/pointer_member.cpp program.

llvm-svn: 15062
2004-07-21 03:56:54 +00:00
Brian Gaeke
cd4ae3a3fd Regenerated using autoconf-2.57.
llvm-svn: 15061
2004-07-21 03:50:25 +00:00
Brian Gaeke
b1ea500aa1 Add AC_MSG_CHECKING and AC_MSG_RESULT statements which were missing
from two of our custom checks.

llvm-svn: 15060
2004-07-21 03:50:01 +00:00
Brian Gaeke
a87044523f Regenerated with autoconf/autoheader 2.57
llvm-svn: 15059
2004-07-21 03:33:58 +00:00
Brian Gaeke
84a69f1494 Solaris hack for isinf()
llvm-svn: 15058
2004-07-21 03:32:51 +00:00
Brian Gaeke
a5adf7948c Add check for finite(). Solaris doesn't have isinf, but it has finite...go
figure!

llvm-svn: 15057
2004-07-21 03:30:27 +00:00
Brian Gaeke
1dde3fa94f 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
Brian Gaeke
adcf66fb8f Add prototypes for platform-independent wrappers for isinf().
Patch contributed by Bill Wendling.

llvm-svn: 15055
2004-07-21 03:15:14 +00:00
Brian Gaeke
920f4dd59e Regenerated with autoheader-2.57.
Patch contributed by Bill Wendling.

llvm-svn: 15054
2004-07-21 03:15:02 +00:00
Brian Gaeke
499b01d29d Add call to check for isinf().
Patch contributed by Bill Wendling.

llvm-svn: 15053
2004-07-21 03:14:51 +00:00
Brian Gaeke
25318b1381 Add support for checking for isinf().
Patch contributed by Bill Wendling.

llvm-svn: 15052
2004-07-21 03:14:39 +00:00
Brian Gaeke
2698a6cb8e Regenerated with autoconf-2.57.
Patch contributed by Bill Wendling.

llvm-svn: 15051
2004-07-21 03:14:12 +00:00
Brian Gaeke
0810ebf56a Add platform-independent wrapper function for isinf().
Patch contributed by Bill Wendling.

llvm-svn: 15050
2004-07-21 03:13:50 +00:00
Brian Gaeke
e2e0637a77 Move LLVM tool definitions to Makefile.rules
llvm-svn: 15049
2004-07-21 01:31:47 +00:00
Misha Brukman
75f3291ef3 Shorts are aligned to 2 bytes, bools to 1 byte (in structs).
llvm-svn: 15048
2004-07-20 20:59:57 +00:00
Misha Brukman
8e36261aa8 Treat external variables similarly to those with weak linkage: load indirect.
llvm-svn: 15047
2004-07-20 20:43:05 +00:00
Misha Brukman
288b211afb Refer would-be llvm-gcc source users/hackers to the compilation guide.
llvm-svn: 15046
2004-07-20 20:25:18 +00:00
Misha Brukman
3475be9a62 Use C++-style <cstdio> instead of C-style <stdio.h>
llvm-svn: 15042
2004-07-20 16:14:06 +00:00
Misha Brukman
4aab086eda Differentiate between global and weak symbol loads
llvm-svn: 15037
2004-07-20 15:52:25 +00:00
Misha Brukman
684ef6ca20 * Differentiate between global and weak symbol loads
* Fix functions that take more than 32 bytes of args
* Alignment of doubles in structs is 4 bytes, not 8
* Fix passing long args: rN = hi, rN+1 = lo
* Rewrite signed divide
* Rewrite Intrinsic::returnaddress

Patch courtesy of Nate Begeman.

llvm-svn: 15036
2004-07-20 15:51:37 +00:00
Misha Brukman
42666aed5e Differentiate between global and weak symbol loads
llvm-svn: 15035
2004-07-20 15:45:27 +00:00
Misha Brukman
dff882a230 Double alignment in structs is 4 bytes, not 8. Patch by Nate Begeman.
llvm-svn: 15034
2004-07-20 15:43:25 +00:00
Alkis Evlogimenos
7eb2b1892b Add function to clear all virtual->physical mappings but not assigned
stack slots. This is in preparation for the iterative linear scan.

llvm-svn: 15032
2004-07-20 13:28:17 +00:00
Alkis Evlogimenos
f616d8328c Remove unneeded functor. LiveInterval has a < operator.
llvm-svn: 15031
2004-07-20 10:20:03 +00:00
Chris Lattner
45b50d14c9 Fix a serious code pessimization problem. If an inlined function has a single
return, clone the 'ret' BB code into the block AFTER the inlined call, not the
other way around.

llvm-svn: 15030
2004-07-20 05:45:24 +00:00
Chris Lattner
11ffd59e37 Implement Transforms/InstCombine/IntPtrCast.ll
llvm-svn: 15029
2004-07-20 05:21:00 +00:00
Chris Lattner
4269e40e67 new testcase
llvm-svn: 15028
2004-07-20 05:20:39 +00:00
Chris Lattner
ec67df0ed1 Ignore instructions that are in trivially dead functions. This allows us
to constify 14 globals instead of 4 in a trivial C++ testcase.

llvm-svn: 15027
2004-07-20 03:58:07 +00:00
Misha Brukman
e036ff8b32 Fix stack frame layout in prologue/epilogue. Patch courtesy of Nate Begeman.
llvm-svn: 15026
2004-07-20 02:23:09 +00:00
Misha Brukman
9bd41d54c5 Dump the old-fashioned C-style <ctype.h> in favor of new `C++'-style <cctype>
llvm-svn: 15025
2004-07-20 02:18:25 +00:00
Chris Lattner
44d0b9502a Implement InstCombine/GEPIdxCanon.ll
llvm-svn: 15024
2004-07-20 01:48:15 +00:00
Chris Lattner
9492af43c4 New testcase that instcombine should help out with.
llvm-svn: 15023
2004-07-20 01:47:49 +00:00
Chris Lattner
5823ac1c21 Implement SimplifyCFG/BrUnwind.ll
llvm-svn: 15022
2004-07-20 01:17:38 +00:00
Chris Lattner
d4cecb9e2f test that unconditional branches to unwinds are always eliminated
llvm-svn: 15021
2004-07-20 01:17:19 +00:00
Misha Brukman
5e744fa1a3 Move handing of GlobalValues from getReg() to copyConstantToRegister(), this
will avoid extra register-to-register copies.  Thanks to Chris for the idea.

llvm-svn: 15019
2004-07-20 00:59:38 +00:00
Chris Lattner
4e2dbc6b4a Rewrite cast->cast elimination code completely based on the information we
actually care about.  Someday when the cast instruction is gone, we can do
better here, but this will do for now.  This implements
instcombine/cast.ll:test17/18 as well.

llvm-svn: 15018
2004-07-20 00:59:32 +00:00
Chris Lattner
10a4194651 Testcases missed by the instruction combiner
llvm-svn: 15017
2004-07-20 00:57:21 +00:00
Misha Brukman
d21ef91bc4 isupper() and tolower() are declared in <ctype.h>
llvm-svn: 15016
2004-07-20 00:52:16 +00:00
Misha Brukman
22802cc6cd * Fn args passed in registers are now recorded as used by the call instruction
`-> asm printer updated to not print out those registers with the call instr

All of Shootout tests now work.  Great thanks to Nate Begeman for the patch!

llvm-svn: 15015
2004-07-20 00:42:19 +00:00
Misha Brukman
818a9dc317 * cFP class split into cFP32 and cFP64
* Fn args passed in registers are now recorded as used by the call instruction
`-> asm printer updated to not print out those registers with the call instr
* Stack frame layout in prolog/epilog fixed, spills and vararg fns now work
* float/double to signed int codegen now correct
* various single precision float codegen bugs fixed
* const integer multiply codegen fixed
* select and setcc blocks inserted into the correct place in machine CFG
* load of integer constant code optimized

All of Shootout tests now work.  Great thanks to Nate Begeman for the patch!

llvm-svn: 15014
2004-07-20 00:41:46 +00:00
Chris Lattner
f8cf35855a While I'm at it, don't break codegen of mul by 3,5,9.
llvm-svn: 15013
2004-07-19 23:50:57 +00:00
Chris Lattner
7c06d44f42 Generate better code for multiplies by negative constants like -4, -1, -9, etc.
llvm-svn: 15012
2004-07-19 23:47:21 +00:00
Alkis Evlogimenos
12a71ea03e Remove dead code.
llvm-svn: 15011
2004-07-19 23:35:55 +00:00
Misha Brukman
8e677e88f6 Tabs to spaces.
llvm-svn: 15010
2004-07-19 21:22:02 +00:00
Misha Brukman
a270467ceb Convert tabs to spaces; fix name of function in assert() description.
llvm-svn: 15009
2004-07-19 21:11:45 +00:00
Chris Lattner
8a92e19ba1 Fix broken link
llvm-svn: 15008
2004-07-19 19:30:40 +00:00
Chris Lattner
c88858f576 Just run 'make', not all-gcc
llvm-svn: 15007
2004-07-19 18:47:59 +00:00
John Criswell
b92c7c2270 Added support for stdint.h. It is now automatically included by
DataTypes.h.  So far, it doesn't seem to break Linux, Solaris, or MacOS X.
This should automatically include it for those people who need it.

llvm-svn: 15006
2004-07-19 16:12:29 +00:00
Chris Lattner
15dfdb4e01 Fix a bug that occurs when the last instruction in a range is dead
llvm-svn: 15005
2004-07-19 15:16:53 +00:00
Chris Lattner
c8fb1fb5bb When joining intervals, join intervals in deeply nested loops first. This
is a simple change, but seems to improve code a little.  For example, on
256.bzip2, we went from 75.0s -> 73.33s (2% speedup).

llvm-svn: 15004
2004-07-19 14:40:29 +00:00
Chris Lattner
d10d373ce9 Split joinIntervals into two methods
llvm-svn: 15003
2004-07-19 14:08:10 +00:00
Chris Lattner
6345fbe820 Fix comment
llvm-svn: 15002
2004-07-19 13:28:39 +00:00
Reid Spencer
82e7fe5b5b bug 122:
Simplify a conditional operator for a constant result from
GV->isNullValue()

llvm-svn: 15001
2004-07-19 13:25:02 +00:00
Chris Lattner
57ca7382d9 Inline 4 methods
llvm-svn: 15000
2004-07-19 07:52:35 +00:00
Chris Lattner
056ee8a0a5 Delete 4 methods, make clients use hte mark* methods directly
llvm-svn: 14999
2004-07-19 07:52:25 +00:00
Chris Lattner
aef6c2a350 There is no need to store the MBB along with the MI any more, we can now
ask instructions for their parent.

llvm-svn: 14998
2004-07-19 07:04:55 +00:00
Chris Lattner
a74cf5a7d9 Simplify the interface to LiveVariables::addVirtualRegister(Killed|Dead)
llvm-svn: 14997
2004-07-19 06:55:21 +00:00
Chris Lattner
5027de35ed Remove the DefBlock element of VarInfo. DefBlock is always DefInst->getParent()
llvm-svn: 14996
2004-07-19 06:26:50 +00:00
Chris Lattner
46c48a9654 Err, fix last checkin
llvm-svn: 14995
2004-07-19 06:03:51 +00:00
Chris Lattner
874ffdd592 Fix bugpoint miscompilation support on OS/X
Patch contributed by the fabulous Nate Begeman.

llvm-svn: 14994
2004-07-19 06:00:17 +00:00
Chris Lattner
a618e13c83 Two changes, both very significant:
* vreg <-> vreg joining now works, enable it unconditionally when joining
  is enabled (which is the default).
* Fix a serious pessimization of spill code where we were saying that a
  spilled DEF operand was live into the subsequent instruction.  This allows
  for substantially better code when spilling starts to happen.

llvm-svn: 14993
2004-07-19 05:55:50 +00:00
Chris Lattner
c56f90d156 See comments. The live intervals were not coming out of the spiller in sorted
order, causing the inactive list in the linearscan list to get unsorted, which
basically fuxored everything up severely.

These seems to fix the joiner, so with more testing I will enable it by default.

llvm-svn: 14992
2004-07-19 05:15:10 +00:00
Chris Lattner
8c8144b958 Fix assertion to not dereference end!
llvm-svn: 14991
2004-07-19 05:02:09 +00:00
Chris Lattner
70f8dca59b Add some asserts that the list of intervals returned by addIntervalsForSpills
is sorted.  This is not the case currently, which is causing no end of
problems.

llvm-svn: 14990
2004-07-19 04:47:36 +00:00
Chris Lattner
4f2e2a3f80 remove the mbbi2mbbMap_, which was just keeping track of mbb order anyway.
Heavily refactor handleVirtualRegisterDef, adding comments and making it more
efficient.  It is also much easier to follow and convince ones self that it is
correct :)

Add -debug output to the joine, showing the result of joining the intervals.

llvm-svn: 14989
2004-07-19 02:15:56 +00:00
Chris Lattner
05920e7a70 fill comment to 80 cols
remove map that is not needed

llvm-svn: 14988
2004-07-19 02:13:59 +00:00
Chris Lattner
5230e70834 classof implementations are now inlined
llvm-svn: 14987
2004-07-19 00:59:10 +00:00
Chris Lattner
370f8871a6 inline classof implementations, eliminate use of virtual methods.
classof<ConstantXXX> is now MUCH faster than it used to be.

llvm-svn: 14986
2004-07-19 00:58:47 +00:00
Chris Lattner
1f46ad5a2d eliminate isConstantExpr, changes to isa<Constant> implementation
llvm-svn: 14985
2004-07-19 00:58:02 +00:00
Chris Lattner
afde969989 Add new enum entries for ConstantAggregateZeroVal/ConstantExprVal and
rename ConstantVal to SimpleConstantVal

llvm-svn: 14984
2004-07-19 00:57:40 +00:00
Chris Lattner
2730e6aef1 Method now returns null, dtor is inlined
llvm-svn: 14983
2004-07-19 00:55:35 +00:00
Chris Lattner
d20f27064b Change method to return void. Inline dtor
llvm-svn: 14982
2004-07-19 00:55:19 +00:00
Chris Lattner
1bfcb28da4 Remove dead file
llvm-svn: 14981
2004-07-18 23:44:15 +00:00
Chris Lattner
421cd083d6 Remove this printer
llvm-svn: 14980
2004-07-18 23:43:34 +00:00
Reid Spencer
44a81c6bdd A description of what this library is about, reference to the documentation
and a list of don'ts for the library. All so future maintainers don't
break the important contract this library has with its user: LLVM.

llvm-svn: 14979
2004-07-18 22:33:08 +00:00
Chris Lattner
e0050f06b0 Add note about GCC 3.3.2 being completely broken
llvm-svn: 14978
2004-07-18 22:32:22 +00:00
Reid Spencer
9673fb744c Initiali Makefile for this library.
llvm-svn: 14977
2004-07-18 22:31:28 +00:00
Chris Lattner
13e5831bd0 Add a workaround for a GCC 3.3.2 bug
llvm-svn: 14976
2004-07-18 21:56:20 +00:00
Chris Lattner
517f1847ba Doesn't exist
llvm-svn: 14975
2004-07-18 21:44:13 +00:00
Chris Lattner
e2774757fe Fix a performance regression from the CPR patch, simplify code
llvm-svn: 14974
2004-07-18 21:34:16 +00:00
Chris Lattner
d47504d9db Strip out and simplify some code. This also fixes the regression last
night compiling cfrac.  It did not realize that code like this:

int G; int *H = &G;

takes the address of G.

llvm-svn: 14973
2004-07-18 19:56:20 +00:00
Chris Lattner
f3edc49ae2 Minor cleanup, no functionality change
llvm-svn: 14972
2004-07-18 18:59:44 +00:00
Chris Lattner
6bdfbaf80d Fix infinite loop
llvm-svn: 14971
2004-07-18 18:45:01 +00:00
Reid Spencer
fa49f86cee bug 122:
Updated to remove references to ConstantPointerRef and reflect the change
in the inheritance hierarchy: GlobalValue now derives from Constant.

llvm-svn: 14969
2004-07-18 13:10:31 +00:00
Reid Spencer
3b4e83ec83 Remove an if statement that would never be reached.
llvm-svn: 14968
2004-07-18 08:41:47 +00:00
Reid Spencer
f0a5bcaae4 Delete a redundant if branch.
llvm-svn: 14967
2004-07-18 08:34:52 +00:00
Reid Spencer
c44cb6bd9f Expand the coercion of constants to include the newly constant Globals.
llvm-svn: 14966
2004-07-18 08:34:19 +00:00
Reid Spencer
539429d9b5 Delete a no-op loop.
llvm-svn: 14965
2004-07-18 08:32:43 +00:00
Reid Spencer
6c2b627e23 Expand the scope to include global values because they are now constants
too.

llvm-svn: 14964
2004-07-18 08:32:10 +00:00
Reid Spencer
199aeb7f59 Avoid an unnecessary isa<Constant>.
llvm-svn: 14963
2004-07-18 08:31:18 +00:00
Chris Lattner
0145eb7835 Fix infinite loop gccld'ing povray
llvm-svn: 14962
2004-07-18 08:12:57 +00:00
Chris Lattner
aba6c47900 CPR Fixes
llvm-svn: 14961
2004-07-18 07:29:35 +00:00
Chris Lattner
9ce34cb323 CPR fixes
llvm-svn: 14960
2004-07-18 07:26:17 +00:00
Reid Spencer
d166ac7f36 Bug 122 fixed.
llvm-svn: 14959
2004-07-18 07:25:14 +00:00
Chris Lattner
9238d78dc3 Remove useless statistic, fix some slightly broken logic
llvm-svn: 14958
2004-07-18 07:22:58 +00:00
Chris Lattner
2da5eee33c Fix a rather serious bug in previous checkin
llvm-svn: 14957
2004-07-18 06:56:58 +00:00
Reid Spencer
c9c90cfb29 Shrink some code.
llvm-svn: 14956
2004-07-18 01:04:19 +00:00
Reid Spencer
7c6b3d17f0 Add a missing space to align comments.
llvm-svn: 14955
2004-07-18 00:56:58 +00:00
Reid Spencer
e5a4cee9ab Fix typeos in comments.
llvm-svn: 14954
2004-07-18 00:55:49 +00:00
Reid Spencer
cb3fb5d4f5 bug 122:
- Replace ConstantPointerRef usage with GlobalValue usage

llvm-svn: 14953
2004-07-18 00:44:37 +00:00
Reid Spencer
e5914d8555 bug 122:
- Minimize redundant isa<GlobalValue> usage

llvm-svn: 14952
2004-07-18 00:44:14 +00:00
Reid Spencer
6a0fd73bee bug 122:
- Replace ConstantPointerRef usage with GlobalValue usage
- Correct isa<Constant> for GlobalValue subclass

llvm-svn: 14951
2004-07-18 00:41:27 +00:00
Reid Spencer
874368790f bug 122:
- Replace ConstantPointerRef usage with GlobalValue usage
- Minimize redundant isa<GlobalValue> usage
- Correct isa<Constant> for GlobalValue subclass

llvm-svn: 14950
2004-07-18 00:38:32 +00:00
Reid Spencer
3074d3cfe7 bug 122:
- Correct isa<Constant> for GlobalValue subclass

llvm-svn: 14949
2004-07-18 00:37:35 +00:00
Reid Spencer
ef784f01dd bug 122:
- Minimize redundant isa<GlobalValue> usage

llvm-svn: 14948
2004-07-18 00:32:14 +00:00
Reid Spencer
c5afc9512b bug 122:
- Replace ConstantPointerRef usage with GlobalValue usage
- Correct isa<Constant> for GlobalValue subclass

llvm-svn: 14947
2004-07-18 00:31:05 +00:00
Reid Spencer
9e855c6832 bug 122:
- Minimize redundant isa<GlobalValue> usage
- Correct isa<Constant> for GlobalValue subclass

llvm-svn: 14946
2004-07-18 00:29:57 +00:00
Reid Spencer
5f6815980b bug 122:
- Replace ConstantPointerRef usage with GlobalValue usage
- Rename methods to get ride of ConstantPointerRef usage

llvm-svn: 14945
2004-07-18 00:25:04 +00:00
Reid Spencer
83cae64faf bug 122:
- Excise dead CPR procesing.

llvm-svn: 14944
2004-07-18 00:23:51 +00:00
Reid Spencer
e4de22874e bug 122:
- Replace ConstantPointerRef usage with GlobalValue usage
- Correct test ordering for GlobalValue subclass

llvm-svn: 14943
2004-07-18 00:19:45 +00:00
Reid Spencer
30d69a5af9 bug 122:
- Replace ConstantPointerRef usage with GlobalValue usage
- Minimize redundant isa<GlobalValue> usage
- Correct isa<Constant> for GlobalValue subclass

llvm-svn: 14942
2004-07-18 00:18:30 +00:00
Reid Spencer
51fe3361b6 bug 122:
- Correct ordering of tests because for GlobalValue isa Constant

llvm-svn: 14941
2004-07-18 00:16:21 +00:00
Reid Spencer
1d8d08f34a User ValueListTy as the type of the ValueList. This avoides the ValueList
from being treated like a Function which can cause the contents of the list
to be come invalidated.

llvm-svn: 14940
2004-07-18 00:13:12 +00:00
Reid Spencer
db1863d50c bug 122:
- Replace ConstantPointerRef usage with GlobalValue usage
- Correct isa<Constant> for GlobalValue subclass

llvm-svn: 14939
2004-07-18 00:12:03 +00:00
Reid Spencer
edbb40b23c bug 122:
- Update for BytecodeHandler interface change resuing from CPRs going away

llvm-svn: 14938
2004-07-18 00:10:36 +00:00
Reid Spencer
ce6adaff1c bug 122:
- Replace ConstantPointerRef usage with GlobalValue usage
- Minimize redundant isa<GlobalValue> usage
- Correct isa<Constant> for GlobalValue subclass
- Remove tabs
- Fix coments refering to ConstantPointerRef

llvm-svn: 14937
2004-07-18 00:08:11 +00:00
Reid Spencer
3d169b1c0d bug 122:
- Move these functions from other places
- Provide implementations of Constant class overrides in GlobalValue

llvm-svn: 14936
2004-07-18 00:06:26 +00:00
Reid Spencer
37e4e78cd5 bug 122:
- Replace ConstantPointerRef usage with GlobalValue usage
- Replace tabs.

llvm-svn: 14935
2004-07-18 00:03:48 +00:00
Reid Spencer
49fc8a746e bug 122:
- Correct an assert to not have redundant isa<GlobalValue>

llvm-svn: 14934
2004-07-18 00:02:41 +00:00
Reid Spencer
bbddbf3aed bug 122:
- Correct isa<Constant> for GlobalValue subclass

llvm-svn: 14933
2004-07-18 00:01:50 +00:00
Reid Spencer
784638bbd5 bug 122:
- Correct isa<Constant> for GlobalValue subclass
- Fix some tabs and indentation.

llvm-svn: 14932
2004-07-17 23:57:36 +00:00
Reid Spencer
3c4824af7c bug 122:
- Module doesn't need to manage ConstantPointerRefs any more.

llvm-svn: 14931
2004-07-17 23:53:23 +00:00
Reid Spencer
cd3936ee04 bug 122:
- Replace ConstantPointerRef usage with GlobalValue usage
- Correct isa<Constant> for GlobalValue subclass

llvm-svn: 14930
2004-07-17 23:50:57 +00:00
Reid Spencer
c49dd8dec1 bug 122:
- Move GlobalValue and GlobalVariable implementations to Globals.cpp

llvm-svn: 14929
2004-07-17 23:50:19 +00:00
Reid Spencer
1ebe1abe22 bug 122:
- Replace ConstantPointerRef usage with GlobalValue usage
- Minimize redundant isa<GlobalValue> usage
- Correct isa<Constant> for GlobalValue subclass
- Delete ConstantPointerRef member function implementations

llvm-svn: 14928
2004-07-17 23:48:33 +00:00
Reid Spencer
accd7c708d bug 122:
- Replace ConstantPointerRef usage with GlobalValue usage
- Minimize redundant isa<GlobalValue> usage
- Correct isa<Constant> for GlobalValue subclass

llvm-svn: 14927
2004-07-17 23:47:01 +00:00
Reid Spencer
f47c779690 bug 122:
remove redundant isa<GlobalValue>
ensure isa<GlobalValue> case is processed before is<Constant>

llvm-svn: 14926
2004-07-17 23:36:58 +00:00
Reid Spencer
6dd4c27c7c bug 122:
- Add ValueListTy to TypeTy so that the bcreader can have its own User
  category that won't get factored into any optimizations or cleanup.
- Correct an isa_impl to correctly include GlobalValue now that it isa
  Constant.

llvm-svn: 14925
2004-07-17 23:34:47 +00:00
Reid Spencer
f820a23365 bug 122:
Remove redundancy in User::classof(Value*); GlobalValue isa Constant now.

llvm-svn: 14924
2004-07-17 23:32:11 +00:00
Reid Spencer
591fc1ebf5 Fix a comment.
llvm-svn: 14923
2004-07-17 23:30:45 +00:00
Reid Spencer
fdc497d049 bug 122:
We don't need to keep track of CPRs any more.

llvm-svn: 14922
2004-07-17 23:30:11 +00:00
Reid Spencer
82b7ce69e1 bug 122:
Now that GlobalVariable is a constant (via derivation from GlobalValue),
override the replaceUsesOfWithOnConstant method.

llvm-svn: 14921
2004-07-17 23:29:46 +00:00
Reid Spencer
1a76c27988 bug 122:
- derive from Constant
- declare needed overrides from Constant class

llvm-svn: 14920
2004-07-17 23:28:28 +00:00
Reid Spencer
c5098ac9d4 ****** ABOLISH ConstantPointerRef *****
llvm-svn: 14919
2004-07-17 23:26:57 +00:00
Reid Spencer
88cda9db1e Extend constructor so that it can support GlobalValue's (with names).
Make GlobalValue a "classof" Constant
Fix the classof(Value*) to include GlobalValue's

llvm-svn: 14918
2004-07-17 23:26:12 +00:00
Reid Spencer
9521143ab7 Constant value not needed after CPR's disappear.
llvm-svn: 14917
2004-07-17 23:23:30 +00:00
Chris Lattner
e62af95bef It looks like physref->virtreg joining is working fine. Enable it by default
but make virtreg->virtreg joining stay off by default

llvm-svn: 14916
2004-07-17 21:51:25 +00:00
Chris Lattner
c856e90d1d Make sure to emit the immediate byte for instructions like:
shrd [mem], reg, imm

This fixes the jit-ls failure on 186.crafty.

llvm-svn: 14914
2004-07-17 20:26:14 +00:00
Chris Lattner
8a4039ed9a Reserve the correct amt of space.
llvm-svn: 14913
2004-07-17 20:24:05 +00:00
Chris Lattner
96591356f7 Hrm, I think we need a "Reid is buggy" bug ;-)
llvm-svn: 14912
2004-07-17 18:50:19 +00:00
Misha Brukman
e6f4a5ebb0 We don't really need to #include IPO.h into this file.
llvm-svn: 14911
2004-07-17 18:37:46 +00:00
Reid Spencer
0fce16f6b1 Initial (outline only) draft of the System Library requirements, design
and details documentation.

llvm-svn: 14910
2004-07-17 10:04:49 +00:00
Reid Spencer
6d4c03ebfd Added a README to point users to the documentation on the design of this
library which is a prerequisite for maintaining the library.

llvm-svn: 14909
2004-07-17 08:39:53 +00:00
Chris Lattner
3bbaaaa940 Fix incorrect computation of mod/ref sets. Do not ask for mod/ref information
for objects of size 0.

llvm-svn: 14908
2004-07-17 07:40:34 +00:00
Chris Lattner
2e8690bf57 Print modref information in a useful way.
llvm-svn: 14907
2004-07-17 06:43:20 +00:00
Chris Lattner
eed1a6f3dc Cleanups: fold two loops into one
New features: -print-all-alias-modref-info option, print more info

llvm-svn: 14906
2004-07-17 06:28:49 +00:00
Chris Lattner
1dd789d775 link.h causes problems on some platforms and is not needed on solaris, where
the comment came from.

llvm-svn: 14905
2004-07-17 03:09:12 +00:00
Chris Lattner
2ed243b3a9 Remove dead file
llvm-svn: 14904
2004-07-17 02:56:48 +00:00
Chris Lattner
041e6c9fbe Add note about IA64 C++
llvm-svn: 14903
2004-07-17 02:04:41 +00:00
Brian Gaeke
9905a2eb63 Fix warning on 64-bit machines
llvm-svn: 14902
2004-07-16 21:40:32 +00:00
Misha Brukman
b85c2522fa * Use LI(S) to copy constants into registers intead of ADDI(S) as the latter is
a funky way to "use" R0 for a 0-valued operand
* Add IMPLICIT_DEFs for incoming function arguments via registers to help the
  register allocator not clobber those registers
* Implement comparisons with longs
* Teach emitSelectOperation() to fold the SetCC operation

Patch contributed by Nate Begeman

llvm-svn: 14901
2004-07-16 21:06:24 +00:00
Misha Brukman
db032fb1f9 * Store all non-volatile int registers R13-31 on the stack, restore on exit
* Fix comment formatting

llvm-svn: 14900
2004-07-16 20:55:20 +00:00
Misha Brukman
780da8425f Fix code formatting
llvm-svn: 14899
2004-07-16 20:54:25 +00:00
Misha Brukman
3adf84ba0d Implement PowerPCInstrInfo::isMoveInstr(), patch by Nate Begeman
llvm-svn: 14898
2004-07-16 20:51:55 +00:00
Misha Brukman
f0def96a36 Add prototype for TargetInstrInfo::isMoveInstr()
llvm-svn: 14897
2004-07-16 20:50:55 +00:00
Misha Brukman
9c2c293225 * Enable allocation of registers r2-r10
* Allocate registers 13-31 backwards (to be able to store them all at once)

llvm-svn: 14896
2004-07-16 20:35:20 +00:00
Misha Brukman
6ed15fd181 Add IMPLICIT_DEFS pseudo-instruction; patch by: Nate Begeman
llvm-svn: 14895
2004-07-16 20:33:41 +00:00
Misha Brukman
8c9938654a The generated instruction selector isn't (yet) functional
llvm-svn: 14894
2004-07-16 20:31:13 +00:00
Misha Brukman
d4ac818593 * Output non-lazy linking stubs for external global variables
* Get rid of dead and #if 0'd code
* Minor for loop speed-up: save end iterator instead of querying every time

llvm-svn: 14893
2004-07-16 20:29:04 +00:00
Misha Brukman
06773822b9 Correctly build shared objects on MacOS X for debugging code generators
llvm-svn: 14892
2004-07-16 19:45:45 +00:00
Misha Brukman
a6b9a566b9 Define double alignment as 8 bytes now that assert(DoubleAlignment == PointerSize)
has been eliminated

llvm-svn: 14891
2004-07-16 19:32:12 +00:00
Misha Brukman
d350b64352 * Add spaces between words and numbers in comments printed out for longs/floats
* Print out IMPLICIT_DEFS as comments in the assembly, patch by Nate Begeman

llvm-svn: 14890
2004-07-16 19:01:13 +00:00
Misha Brukman
65728ddf45 Fix grammar.
llvm-svn: 14888
2004-07-16 17:40:28 +00:00
Alkis Evlogimenos
763d930d22 Add convinience constructor for function calls with two args.
llvm-svn: 14885
2004-07-16 12:04:28 +00:00
Brian Gaeke
135b870f72 Add a class for pseudo-instructions. Use it.
Add IMPLICIT_USE and IMPLICIT_DEF, a la X86.

llvm-svn: 14884
2004-07-16 10:32:10 +00:00
Brian Gaeke
a57943154e Add what will eventually be the TSFlags. Big switch(opcode) statements are bad.
llvm-svn: 14883
2004-07-16 10:31:59 +00:00
Brian Gaeke
f486726c56 Add special handling for pseudo-instructions (print them as comments).
llvm-svn: 14882
2004-07-16 10:31:47 +00:00
Brian Gaeke
97b71c9fa9 Add to-do list.
llvm-svn: 14881
2004-07-16 10:31:36 +00:00
Brian Gaeke
5ce1408537 Do IMPLICIT_DEFs on incoming args' hard regs, to avoid confusing the regalloc.
Support single-fp incoming args.
Support single-fp outgoing args ('call' operands).
Support double-fp return values.

llvm-svn: 14880
2004-07-16 10:31:25 +00:00
Chris Lattner
2453818b8a The powerpc is now gone. However it is now just known as the Skeleton target.
llvm-svn: 14877
2004-07-16 07:14:34 +00:00
Chris Lattner
f1b8afb3b4 Build skeleton target
llvm-svn: 14876
2004-07-16 07:12:46 +00:00
Chris Lattner
a46d2a63c7 Build the skeleton target
llvm-svn: 14875
2004-07-16 07:11:53 +00:00
Chris Lattner
ed85542ad7 Initial checkin of the rest of the skeleton target
llvm-svn: 14874
2004-07-16 07:11:15 +00:00
Chris Lattner
3d53a4752d Initial skeleton tablegen files
llvm-svn: 14873
2004-07-16 06:29:19 +00:00
Chris Lattner
42023220fa Add skeleton makefile
llvm-svn: 14872
2004-07-16 06:20:55 +00:00
Chris Lattner
e8a034901d Initial readme
llvm-svn: 14871
2004-07-16 06:12:28 +00:00
Chris Lattner
fe05024b0f Fix the regressions handling unnamed global variables
llvm-svn: 14870
2004-07-16 01:18:09 +00:00
Chris Lattner
1fbd76ecba For 64-bit platform support, we now use the clEnumValEnd macro to terminate
cl::values lists

llvm-svn: 14869
2004-07-16 00:10:54 +00:00
Chris Lattner
9716100a5d IA64 compat
llvm-svn: 14867
2004-07-16 00:08:28 +00:00
Chris Lattner
34afafc190 Fix IA64 compatibility
llvm-svn: 14866
2004-07-16 00:06:01 +00:00
Chris Lattner
cc36c670e8 Use new macro
llvm-svn: 14865
2004-07-16 00:04:54 +00:00
Chris Lattner
597555fd45 Be compatible with IA64
llvm-svn: 14864
2004-07-16 00:04:13 +00:00
Chris Lattner
89ae115aa5 Passing integer 0 in for a pointer value doesn't work on IA64. Fix this
by using a new macro.

llvm-svn: 14863
2004-07-16 00:02:21 +00:00
Chris Lattner
b50070175d Add a new macro to be used for the end of enum lists.
llvm-svn: 14862
2004-07-16 00:01:05 +00:00
Chris Lattner
d79334df33 This patch was contributed by Daniel Berlin!
Speed up SCCP substantially by processing overdefined values quickly.  This
patch speeds up SCCP by about 30-40% on large testcases.

llvm-svn: 14861
2004-07-15 23:36:43 +00:00
Chris Lattner
f2c018c0c1 Fix PR404 try #2
This version takes about 1s longer than the previous one (down to 2.35s),
but on the positive side, it actually works :)

llvm-svn: 14856
2004-07-15 08:20:22 +00:00
Chris Lattner
9b1f3dc990 Give SetVector range support
llvm-svn: 14855
2004-07-15 08:18:31 +00:00
Chris Lattner
072a4c0091 Nuke a clearly bogus assertion
llvm-svn: 14854
2004-07-15 07:44:34 +00:00
Chris Lattner
daa12135da Revert previous patch until I get a bug fixed
llvm-svn: 14853
2004-07-15 05:36:31 +00:00
Chris Lattner
34cc695252 QOI issue fixed
llvm-svn: 14852
2004-07-15 04:30:35 +00:00
Chris Lattner
70177e402d Fix PR404: Loop simplify is really slow on 252.eon
This eliminates an N*N*logN algorithm from the loop simplify pass, replacing
it with a much simpler and faster alternative.  In a debug build, this reduces
gccas time on eon from 85s to 42s.

llvm-svn: 14851
2004-07-15 04:27:04 +00:00
Chris Lattner
a4d8ce6399 Bug fixed
llvm-svn: 14850
2004-07-15 02:59:24 +00:00
Chris Lattner
29850c5d62 Final fix for PR341: eliminate operator<<(ostream, Value*). Clients should
now send references to ostreams instead of pointers.  Sending pointers to
ostreams will print their addresses.

llvm-svn: 14849
2004-07-15 02:54:36 +00:00
Chris Lattner
5c4de70691 Fixes for PR341
llvm-svn: 14848
2004-07-15 02:51:32 +00:00
Chris Lattner
60a7dd16c4 Fixes for PR341
llvm-svn: 14847
2004-07-15 02:51:31 +00:00
Chris Lattner
f2b5817b1b Fix for PR341
llvm-svn: 14846
2004-07-15 02:50:38 +00:00
Chris Lattner
fcdab1b5f5 Fix for PR341
llvm-svn: 14845
2004-07-15 02:40:04 +00:00
Chris Lattner
c9819f09c2 Revert stuff that I didn't mean to checkin
llvm-svn: 14844
2004-07-15 02:33:38 +00:00
Chris Lattner
3c42077c37 Fixes for PR341
llvm-svn: 14843
2004-07-15 02:31:46 +00:00
Chris Lattner
558cebc775 Fix for PR341
llvm-svn: 14842
2004-07-15 02:26:49 +00:00
Chris Lattner
7dc9de5f43 Patches towards fixing PR341
llvm-svn: 14841
2004-07-15 02:14:30 +00:00
Chris Lattner
32c518e526 Progress on PR341
llvm-svn: 14840
2004-07-15 02:06:12 +00:00
Chris Lattner
9a63520b1a Fixes working towards PR341
llvm-svn: 14839
2004-07-15 01:50:47 +00:00
Chris Lattner
cae777bb4f Bug fixes for PR341
llvm-svn: 14838
2004-07-15 01:29:12 +00:00
Chris Lattner
4bbd409749 Implement folding of expressions like 'uint cast (int* getelementptr (int*
null, uint 1) to uint)' to a constant integer.  We can only do this with
primitive LLVM types, because other types have target-specific sizes.

llvm-svn: 14837
2004-07-15 01:16:59 +00:00
Chris Lattner
030f84f215 Yeah, how about those 'primative' types huh?
llvm-svn: 14836
2004-07-15 01:15:53 +00:00
Chris Lattner
ba7aef39fd Now that we codegen the portable "sizeof" efficiently, we can use it for
malloc lowering.  This means that lowerallocations doesn't need targetdata
anymore.  yaay.

llvm-svn: 14835
2004-07-15 01:08:08 +00:00
Chris Lattner
33930ad7bd Improve codegen for the LLVM offsetof/sizeof "operator". Before we compiled
this LLVM function:

int %foo() {
        ret int cast (int** getelementptr (int** null, int 1) to int)
}

into:

foo:
        mov %EAX, 0
        lea %EAX, DWORD PTR [%EAX + 4]
        ret

now we compile it into:

foo:
        mov %EAX, 4
        ret

This sequence is frequently generated by the MSIL front-end, and soon the malloc lowering pass and
Java front-ends as well..

-Chris

llvm-svn: 14834
2004-07-15 00:58:53 +00:00
Chris Lattner
969d6fbcee You cannot pass functions by value, what does that even mean??
llvm-svn: 14833
2004-07-14 23:14:07 +00:00
Chris Lattner
1e780d3d26 this "feature" is gone
llvm-svn: 14832
2004-07-14 23:12:09 +00:00
Chris Lattner
4babbe04e1 This is logically part of the last patch. Just more really horrible code
that is made unnecessary by it.

llvm-svn: 14831
2004-07-14 23:07:13 +00:00
Chris Lattner
8abe1a11b4 ** Finally DeclareNewGlobalValue is dead!
* Simplify a lot of code because type's cannot be in function symbol tables
* Fix memory leaks in handling of redefined function prototypes
* Don't use SymbolTable directly for stuff that we can go through the Module
  for.
* Fix some minor bugs on obscure testcases like:
      test/Feature/globalredefinition.ll
* Do not create GlobalVariable objects for forward referenced Functions!
* When forward referencing a function in a constant expression, do not create
  a placeholder, add a bunch of references to it, then turn around and
  replaceAllUsesOfWith on it with a new global, deleting the placeholder.
  Instead, when we find the real definition of the global, just use the
  placeholder instead of creating a new object.

This substantially simplifies the asmwriter and should even speed it up on
cases heavy in constantexprs (like C++, Java, MSIL)...

llvm-svn: 14830
2004-07-14 23:03:46 +00:00
Chris Lattner
7e40f4f9c5 New, horrible, testcase
llvm-svn: 14829
2004-07-14 22:59:47 +00:00
Chris Lattner
4c9210ed64 * Fairly substantial change. Instead of creating new globalvariables, then
replaceAllUsesWith'ing any forward references, just use the forward
  reference if it exists.

This introduces GetForwardRefForGlobal, which will eventually completely
replace the horrible DeclareNewGlobalValue function.

llvm-svn: 14828
2004-07-14 21:44:00 +00:00
Chris Lattner
e875d48a92 Fold setValueNameMergingDuplicates into ParseGlobalVariable, allowing us
to substantially simplify the result.  In particular, we no longer create
GlobalVariables and then immediately destroy them when they are duplciate
definitions.

The real point of this patch though is that it gets us closer to the
DeclareNewGlobalValue calls...

llvm-svn: 14827
2004-07-14 20:42:57 +00:00
Brian Gaeke
def1a51232 Actually set the endian/pointersize flags on the module being read in!
llvm-svn: 14826
2004-07-14 20:33:13 +00:00
Chris Lattner
cbdf371d30 Simplify logic.
llvm-svn: 14825
2004-07-14 20:27:12 +00:00
Chris Lattner
47fb34c00a Make PATypeHolder and friends return non-const pointers to the types they
hold.  Because types are basically immutable anyway, they should not be
referenced as "const Type*" everywhere.  Just "Type*" should suffice!

llvm-svn: 14824
2004-07-14 20:10:26 +00:00
Chris Lattner
91393ee84f Fix a regression from last night. Apparently the CFE is broken and outputs
functions multiple times, expecting them to be merged.  This should be fixed
in the CFE, then here.

llvm-svn: 14823
2004-07-14 19:33:47 +00:00
Misha Brukman
2661c50173 Make sure MTSPR instruction is inserted into the BasicBlock
llvm-svn: 14822
2004-07-14 18:26:31 +00:00
Chris Lattner
92aecc9e3c Implement new helper methods for creating two-index GEP instructions
llvm-svn: 14821
2004-07-14 18:14:33 +00:00
Chris Lattner
29f231ce4e * Change code to use a static_cast instead of reinterpret_cast
* Add comments
* Add two new gep ctors for the very common case of creating a two operand
  GEP instruction.

llvm-svn: 14820
2004-07-14 18:13:54 +00:00
Misha Brukman
5193410cd9 Don't define the same register twice when loading a ConstantPointerRef to a reg
llvm-svn: 14819
2004-07-14 17:57:04 +00:00
Misha Brukman
d4cbe67ce6 * Fix multiplication by powers of two and otherwise
* Clarify variable name (StoreInst SI instead of LI)

llvm-svn: 14818
2004-07-14 15:29:51 +00:00
Chris Lattner
42dd47437e Pull out code shared between GV forward-decl and definition processing.
This gives us only a single call site for setValueNameMergingDuplicates.
The next stage is the start merging them together.

llvm-svn: 14811
2004-07-14 08:23:52 +00:00
Chris Lattner
70ef57d001 Simplify code. Do not allow functions to be redefined more than once.
Since the stupid '%X = const int 4' thing is gone, we can now simplify
setValueNameMergingDuplicates a bit more.

llvm-svn: 14810
2004-07-14 07:12:48 +00:00
Chris Lattner
6652224c2a Remove a gross and crufty "feature" that was never documented and doesn't work.
llvm-svn: 14809
2004-07-14 06:44:56 +00:00
Chris Lattner
88357937b6 Finegrainify namespacification
llvm-svn: 14808
2004-07-14 06:39:48 +00:00
Chris Lattner
4accae9c3e Revamp handling of labels. In particular, if we create a forward reference
for a basic block, use it when the block is defined instead of deleting it
and creating a new one.  Also, only create at most ONE forward reference
for any block, instead of one for each forward reference.

llvm-svn: 14807
2004-07-14 06:28:35 +00:00
Brian Gaeke
590b5f12db Add Machine-CFG edges to SparcV9 MachineBasicBlocks.
llvm-svn: 14806
2004-07-14 05:40:50 +00:00
Chris Lattner
95230b0cbc Split the basic block handling case out of getVal into getBBVal.
llvm-svn: 14805
2004-07-14 01:33:11 +00:00
Chris Lattner
e52ed45890 Make Argument::print more resilient to non-verifiable IR
llvm-svn: 14801
2004-07-13 23:14:34 +00:00
Chris Lattner
8c54e58f7c Catch aggregates passed by value sooner rather than later.
llvm-svn: 14800
2004-07-13 20:09:51 +00:00
Misha Brukman
aa678b5ed4 * Specify that FP arith options have 3 operands
* Correctly load FP constants from the constant pool, should be refactored

llvm-svn: 14799
2004-07-13 15:35:45 +00:00
Chris Lattner
ab1aedab13 Actually, use an exception to stop verification. This gives us much better
error messages because verification stops at the first error.

llvm-svn: 14794
2004-07-13 08:48:04 +00:00
Chris Lattner
2c1bc9e7e2 There is no reason to abort and print a stack trace if there is a verification
error.  Just print the message like a good little tool.

llvm-svn: 14793
2004-07-13 08:45:41 +00:00
Chris Lattner
d25cad9f38 Fine-grainify namespacification, prune #include
llvm-svn: 14792
2004-07-13 08:42:12 +00:00
Chris Lattner
e84a2ba99f Fix typeo and refactor bb productions to make it possible for us to reuse any
forward reference blocks if they have been created (instead of creating a new
block, replaceAllUsesOfWith, then nuking the placeholder).   This is not yet
implemented.

llvm-svn: 14791
2004-07-13 08:39:15 +00:00
Chris Lattner
d9c9c496e6 Eliminate some mega-cruft here. There is no reason to DERIVE FROM IR CLASSES
just to keep track of some per-object state!  Gaah!  Whoever wrote this stuff...
oh wait, that would be me.  Never mind.

llvm-svn: 14790
2004-07-13 08:28:21 +00:00
Chris Lattner
30b35cf3f7 Inline the now trivial setValueNameInternal function into both callers
llvm-svn: 14789
2004-07-13 08:12:39 +00:00
Chris Lattner
85a351f78d Now that basic blocks are eagerly inserted into the Function, we can use
the funciton symbol table to check for conflicts instead of having to
keep a shadow named LocalSymtab.  Totally eliminate LocalSymtab.  Verified
that this did not cause a regression on the testcase for PR107.

llvm-svn: 14788
2004-07-13 08:10:10 +00:00
Chris Lattner
2ed776bb88 A couple of substantial cleanup fixes:
1. Split setValueName into two separate functions, one that is only used
     at function scope and doesn't have to deal with duplicates, and one
     that can be used either at global or function scope but that does deal
     with conflicts.  Conflicts were only in there because of the crappy old
     CFE and probably should be entirely eliminated.
  2. Insert BasicBlock's into the parent functions when they are created
     instead of when they are complete.  This effects name lookup (for the
     better), which will be exploited in the next patch.

llvm-svn: 14787
2004-07-13 07:59:27 +00:00
Brian Gaeke
b88d2a44f9 Fix warning on SparcV9, where sizeof (int) != sizeof (void *).
llvm-svn: 14786
2004-07-13 07:37:43 +00:00
Chris Lattner
cc459c9d66 Replace a bunch of complex ConstantPointerRef referring code with simple
code.

llvm-svn: 14785
2004-07-13 06:58:07 +00:00
Chris Lattner
8e30a4dfc5 Make tblgen not try to be smart. This is better handled in makefiles if
at all.  Patch contributed by Vladimir Prus!

llvm-svn: 14784
2004-07-13 06:11:46 +00:00
Chris Lattner
35e24774eb Factor some code to handle "load (constantexpr cast foo)" just like
"load (cast foo)".  This allows us to compile C++ code like this:

class Bclass {
  public: virtual int operator()() { return 666; }
};

class Dclass: public Bclass {
  public: virtual int operator()() { return 667; }
} ;

int main(int argc, char** argv) {
  Dclass x;
  return x();
}

Into this:

int %main(int %argc, sbyte** %argv) {
entry:
        call void %__main( )
        ret int 667
}

Instead of this:

int %main(int %argc, sbyte** %argv) {
entry:
        %x = alloca "struct.std::bad_typeid"            ; <"struct.std::bad_typeid"*> [#uses=3]
        call void %__main( )
        %tmp.1.i.i = getelementptr "struct.std::bad_typeid"* %x, uint 0, uint 0, uint 0         ; <int (...)***> [#uses=1]
        store int (...)** getelementptr ([3 x int (...)*]*  %vtable for Bclass, int 0, long 2), int (...)*** %tmp.1.i.i
        %tmp.3.i = getelementptr "struct.std::bad_typeid"* %x, int 0, uint 0, uint 0            ; <int (...)***> [#uses=1]
        store int (...)** getelementptr ([3 x int (...)*]*  %vtable for Dclass, int 0, long 2), int (...)*** %tmp.3.i
        %tmp.5 = load int ("struct.std::bad_typeid"*)** cast (int (...)** getelementptr ([3 x int (...)*]*  %vtable for Dclass, int 0, long 2) to int
("struct.std::bad_typeid"*)**)          ; <int ("struct.std::bad_typeid"*)*> [#uses=1]
        %tmp.6 = call int %tmp.5( "struct.std::bad_typeid"* %x )                ; <int> [#uses=1]
	ret int %tmp.6
        ret int 0
}

In order words, we now resolve the virtual function call.

llvm-svn: 14783
2004-07-13 01:49:43 +00:00
Misha Brukman
be1b680f54 Correctly load FP constants out of the constant pool.
llvm-svn: 14782
2004-07-12 23:49:47 +00:00
Misha Brukman
9dacda651f 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
Misha Brukman
dcb0eec80d Implement getModuleMatchQuality and getJITMatchQuality() for PowerPC
llvm-svn: 14780
2004-07-12 23:36:12 +00:00
Misha Brukman
b6ee60667b * Tabs to spaces
* Delete extra blank lines

llvm-svn: 14779
2004-07-12 22:58:07 +00:00
Misha Brukman
7596c249e9 New open proj: C/C++ compiler in C++, with link to Ed Willink's C++ yacc grammar
llvm-svn: 14778
2004-07-12 21:10:47 +00:00
Chris Lattner
5eb09d1ded Add a helper method. The StructType element is completely redundant in most
cases

llvm-svn: 14777
2004-07-12 20:36:08 +00:00
Chris Lattner
d6108ca27e implement new helper method
llvm-svn: 14776
2004-07-12 20:35:11 +00:00
Chris Lattner
420fd1425d Fix unused var warning
llvm-svn: 14775
2004-07-12 20:29:52 +00:00
Chris Lattner
534d252330 Fix a really nasty logic error that VC noticed.
Reid, this might matter to you :)

llvm-svn: 14774
2004-07-12 20:27:31 +00:00
Chris Lattner
049bb9e8d8 Add a missing #include
llvm-svn: 14773
2004-07-12 20:25:33 +00:00
Chris Lattner
e8439dced3 Fix warning compiling with VC++
llvm-svn: 14772
2004-07-12 20:25:04 +00:00
Chris Lattner
47bafde495 new feature
llvm-svn: 14770
2004-07-12 17:09:23 +00:00
Misha Brukman
a516e99ed6 * Clarify Sparc as SparcV9
* Add link to bugzilla bug with list of miscompiled SparcV9 programs
* Wrap long lines

llvm-svn: 14769
2004-07-12 16:55:41 +00:00
Chris Lattner
efcb25e5dc Implement a new method useful for things like the inliner
llvm-svn: 14768
2004-07-12 01:17:52 +00:00
Chris Lattner
3df3e050dd Implement new method
llvm-svn: 14767
2004-07-12 01:17:34 +00:00
Reid Spencer
a9e83604f1 Correct an output typo.
llvm-svn: 14766
2004-07-11 23:20:54 +00:00
Reid Spencer
194c576efc Various cleanups:
- Remove tabs
- Standardize use of space around ( and ).
- Consolidate the ConstantPlaceHolder class
- Rename two methods to be more meaningful (ParseType, ParseTypes)
- Correct indentation of blocks
- Add documentation
- Convert input dependent asserts to error(...) so it throws instead.
Provide placeholder implementations of read_float and read_double that
still read in platform-specific endianess. When I figure out how to do
this without knowing the endianess of the platform, it will get implemented
correctly.

llvm-svn: 14765
2004-07-11 17:28:43 +00:00
Reid Spencer
db3bf19ad0 - Rename two methods to give them more meaning
- Add read_float and read_double in preparation for a correct
  implementation of bytecode floating point support.

llvm-svn: 14764
2004-07-11 17:24:05 +00:00
Reid Spencer
cf5c6e4adb Remove tabs.
llvm-svn: 14763
2004-07-11 17:22:51 +00:00
Reid Spencer
a64b62ef6a Prepare the writer for a non-broken implementation of writing floating
point values. This will be fixed when I figure out how to do it correctly
without depending on knowing the endianess of a platform.

llvm-svn: 14762
2004-07-11 17:22:07 +00:00
Chris Lattner
802cffd928 The cleanup is done. Update comment.
llvm-svn: 14761
2004-07-11 08:24:02 +00:00
Chris Lattner
c4e6bb5f9f Make add constantexprs work with all types, fixing the regressions from last night
llvm-svn: 14760
2004-07-11 08:01:11 +00:00
Chris Lattner
c9c16a0e60 Implement TargetRegistrationListener
llvm-svn: 14759
2004-07-11 06:03:21 +00:00
Chris Lattner
53d2ac5514 Add a new listener class for things that want to be informed about new
targets that are loaded

llvm-svn: 14758
2004-07-11 06:02:59 +00:00
Chris Lattner
b889c6b261 Delete the allocate*TargetMachine function, which is now dead.
The shared command line options are now in a header that makes sense.

llvm-svn: 14757
2004-07-11 04:17:58 +00:00
Chris Lattner
c2726e63ed Delete the allocate*TargetMachine function, which is now dead .
The shared command line options are now in a header that makes sense.

llvm-svn: 14756
2004-07-11 04:17:10 +00:00
Chris Lattner
2beb4392cf Delete the allocate*TargetMachine function, which is now dead .
llvm-svn: 14755
2004-07-11 04:16:31 +00:00
Chris Lattner
92d1231800 Delete the allocate*TargetMachine functions. Move options to a header file
that makes sense.

llvm-svn: 14754
2004-07-11 04:15:52 +00:00
Chris Lattner
a29ca1b7df Prune unused #include
llvm-svn: 14753
2004-07-11 04:05:32 +00:00
Chris Lattner
6142ca8f4f Goodbye macro hell, hello nice clean and simple code. This also gives llc
the ability to dynamically load and use targets that are not linked into it
statically.  e.g.:

  llc -load libparisc.so -march=parisc foo.bc -o foo.s

llvm-svn: 14751
2004-07-11 04:03:24 +00:00
Chris Lattner
8267b7e17d Goodbye macro hell, hello nice clean simple extensible code. This change
also gives the JIT the ability to dynamically load targets. e.g.

lli -load libparisc.so -march=parisc foo.bc

llvm-svn: 14750
2004-07-11 04:02:06 +00:00
Chris Lattner
baf43cf335 Implement a couple of methods that TargetMachineRegistry now provides. See,
I told you this file wasn't useless :)

llvm-svn: 14749
2004-07-11 04:00:19 +00:00
Chris Lattner
d853629893 Add a new TargetNameParser class, which is useful for parsing options.
Add two methods which are useful for autoselecting targets.

llvm-svn: 14748
2004-07-11 03:59:46 +00:00
Chris Lattner
73eb9436ee Make these format a bit nicer
llvm-svn: 14747
2004-07-11 03:27:42 +00:00
Chris Lattner
b84e7c523a Provide better support for pointer-valued command line arguments
llvm-svn: 14746
2004-07-11 03:18:30 +00:00
Chris Lattner
4266f8017d Auto-registrate target
llvm-svn: 14745
2004-07-11 02:48:49 +00:00
Chris Lattner
97c176b639 Add compilability
llvm-svn: 14744
2004-07-11 02:48:28 +00:00
Chris Lattner
5842560090 Initial impl of this file. Yes this is pretty useless right now, but it
will grow in time.

llvm-svn: 14743
2004-07-11 02:44:26 +00:00
Chris Lattner
ab2a7f4336 First cut at TargetMachineRegistry and RegisterTarget classes
llvm-svn: 14742
2004-07-11 02:43:43 +00:00
Chris Lattner
fe6a18c154 Add two new "virtual static" methods to the TargetMachine class
llvm-svn: 14741
2004-07-11 02:43:07 +00:00
Chris Lattner
ec2a1566cc Add -load option
llvm-svn: 14740
2004-07-11 01:08:19 +00:00
Chris Lattner
4b6cdab582 Add a -load option
llvm-svn: 14739
2004-07-11 01:06:59 +00:00
Chris Lattner
99dcad4584 Implicitly getting a new option by linking to support.o instead of support.a
is a bad idea.  Make tools that want the option #include PluginSupport.h
explicitly.

llvm-svn: 14738
2004-07-11 01:04:33 +00:00
Chris Lattner
92f4e1e0aa Add a new header
llvm-svn: 14737
2004-07-11 01:03:57 +00:00
Reid Spencer
3c0249e916 - Correct grammar of -s description
- Normalize -s option specification

llvm-svn: 14736
2004-07-10 23:41:08 +00:00
Reid Spencer
c35d141fc8 Group the hidden command line arguments.
Make the -s option actually work and default to the right value.

llvm-svn: 14735
2004-07-10 23:35:46 +00:00
Chris Lattner
f61dbbaa7c Add link to the stkrc page
llvm-svn: 14734
2004-07-10 21:43:12 +00:00
Reid Spencer
487b1e5bf4 Command Guide for the Stacker language compiler, stkrc.
llvm-svn: 14733
2004-07-10 20:04:02 +00:00
Reid Spencer
f9776c34b6 Replace use of defunct Type::setName method with SymbolTable::insert.
Patch found and provided by Vladimir Merzliakov. Thanks Vladimir!

llvm-svn: 14732
2004-07-10 16:37:42 +00:00
Reid Spencer
e5e19daa1b Make the VBRSavings percentage make sense (as a fraction of the total
expanded size instead of the file size). Thanks Chris.

llvm-svn: 14731
2004-07-10 08:04:13 +00:00
Chris Lattner
517d650eb3 Minor cleanups:
* Mention the --help and --help-hidden options
 * Don't say program when we really mean any old bytecode file
 * Add a link to the man pages
 * Move analyze down in the list, as it's not as important as the rest

llvm-svn: 14730
2004-07-10 06:06:56 +00:00
Reid Spencer
f3905c8511 Error Handling Cleanup:
- get rid of PARSE_ERROR macro
- add error(std::string) function
- use error(std::string) for all errors
- make input dependent asserts call error(std::string) instead
- ensure asserts are only for logic bugs, not input discrepancies.

llvm-svn: 14729
2004-07-09 22:21:33 +00:00
Reid Spencer
6a218134e3 Fix a backwards compatibility bug found by Tanya. In version 1.2, the
global type plane starts with a length and the TypeTyID value to identify
the type plane has having type definitions. This doesn't happen in 1.3
because the types are read from a known position in the file. However, the
TypeTyID must be read in (and ignored) if its a 1.2 bytecode file.

llvm-svn: 14728
2004-07-09 21:13:53 +00:00
Chris Lattner
ed5f67f424 Removed unneeded forward decl
llvm-svn: 14727
2004-07-09 17:02:57 +00:00
Chris Lattner
848c8dd825 Remove unused method
llvm-svn: 14726
2004-07-09 16:48:13 +00:00
Chris Lattner
d47909e00a Add checks to ensure that there are no unreachable blocks in the function
llvm-svn: 14725
2004-07-09 16:44:37 +00:00
Chris Lattner
c18917c85c Don't call Type::setName()
llvm-svn: 14724
2004-07-09 16:43:55 +00:00
Misha Brukman
82a065dc41 * Add support for indexing into structures, thanks to Chris (x86)
The large diff is because of indentation of a whole region
* Fix querying predecessor blocks in SelectPHINodes(), thanks to Brian (v8)
* Add support for external functions malloc() and free()
* Fix some code indentation

Remember, kids: It's not plagiarism if you "creatively borrow" from your
sources.  It's called "research"!

llvm-svn: 14723
2004-07-09 15:45:07 +00:00
Misha Brukman
14d02cd2d8 Read/write the offset value for stack-relative loads via correct instr operand.
llvm-svn: 14722
2004-07-09 15:37:16 +00:00
Misha Brukman
b47ab7ae1c * Doxygenify comments
* Fix spacing, grammar in comment
* Make code layout consistent
* Wrap code at 80 cols
* Delete spurious blank lines

No functional changes.

llvm-svn: 14721
2004-07-09 14:45:17 +00:00
Alkis Evlogimenos
7300963c66 Fix typo.
llvm-svn: 14720
2004-07-09 11:25:27 +00:00
Alkis Evlogimenos
132ece8925 Improve code comments.
llvm-svn: 14719
2004-07-09 11:10:00 +00:00
Chris Lattner
3a3e5c42cd No really, he did finish!
llvm-svn: 14717
2004-07-09 06:58:43 +00:00
Chris Lattner
0fc190f305 Too much of a title for it's own good
llvm-svn: 14716
2004-07-09 05:05:39 +00:00
Chris Lattner
3e5d2a655e Fix Validation bugs
llvm-svn: 14715
2004-07-09 05:03:54 +00:00
Chris Lattner
2cb4f45a1d Eliminate the UID field in the Type class, bringing it down to 28 bytes.
llvm-svn: 14709
2004-07-08 22:31:37 +00:00
Chris Lattner
753026dae0 The uid mapping is no more
llvm-svn: 14708
2004-07-08 22:31:09 +00:00
Chris Lattner
0bba5dbe95 Eliminate uses of the UniqueID field on Type objects
llvm-svn: 14707
2004-07-08 22:30:50 +00:00
Chris Lattner
3a9fd4c421 Do not call Type::getUniqueID
llvm-svn: 14706
2004-07-08 22:09:34 +00:00
Chris Lattner
a6302c9059 Add a new method
llvm-svn: 14705
2004-07-08 22:09:07 +00:00
Reid Spencer
a039955283 Get rid of some cruft in the insert method.
llvm-svn: 14704
2004-07-08 21:50:33 +00:00
Misha Brukman
aefab3404e Add support for __fixdfdi(), __floatdisf(), and __floatdidf() external functions
llvm-svn: 14703
2004-07-08 19:41:16 +00:00
Reid Spencer
313aeb2b73 First version of a vector with uniqueness constraints (or a set with
deterministic, insertion-order iteration).

llvm-svn: 14702
2004-07-08 19:36:21 +00:00
Misha Brukman
4c4e044e65 * Use several Function* for external functions instead of a std::map
* Non-const FP values must be loaded into int regs (for vararg fns) via memory

llvm-svn: 14701
2004-07-08 18:27:59 +00:00
Misha Brukman
59b2d4ef9d * Add support for loading FP constants from the constant pool
* Load FP values into int regs as well for vararg functions; without memory ops!

llvm-svn: 14700
2004-07-08 18:02:38 +00:00
Misha Brukman
b604b4df21 * Fix header comment, excise references to X86
* Add suport for printing out references to constant pool indices

llvm-svn: 14699
2004-07-08 17:58:04 +00:00
Chris Lattner
0376545d26 statisfy the spelling police
llvm-svn: 14698
2004-07-08 17:49:37 +00:00
Misha Brukman
2d07af3e08 Fix spelling of `equivalent'
llvm-svn: 14697
2004-07-08 17:45:18 +00:00
Chris Lattner
f2e960c5ab Eliminate the SignedType and UnsignedType classes.
llvm-svn: 14695
2004-07-08 17:30:07 +00:00
Chris Lattner
417e85ebd7 isSigned/isUnsigned/isInteger methods do not need to be virtual
llvm-svn: 14694
2004-07-08 17:29:36 +00:00
Chris Lattner
e7fa4fc18b Update comment.
Remove unused forward decl of Value.h
Make Type 32 bytes instead of 36 bytes

llvm-svn: 14692
2004-07-08 16:09:38 +00:00
Chris Lattner
bf22fbb05e This file uses the Value class without a forward decl
llvm-svn: 14691
2004-07-08 15:54:29 +00:00
Chris Lattner
9ebc7eba24 Add a test that I have had in my tree for several months now, but apparently forgot to commit
llvm-svn: 14690
2004-07-08 15:41:08 +00:00
Chris Lattner
9b8881a3b3 Fix this testcase
llvm-svn: 14689
2004-07-08 15:38:23 +00:00
Brian Gaeke
8165863a9d Support setcc on fp values.
llvm-svn: 14687
2004-07-08 09:08:35 +00:00
Brian Gaeke
7b4722e62c Add floating-point branches and compares. Compares don't complete
until the next cycle, and there's no interlock, so they effectively
have a delay slot.

llvm-svn: 14686
2004-07-08 09:08:22 +00:00
Brian Gaeke
3b204c3f24 Fix bug where SwitchSection would fail to change to ".bss" successfully.
llvm-svn: 14685
2004-07-08 08:08:23 +00:00
Brian Gaeke
4fdd22b922 Fix bug involving bool arguments to binary operators.
Fix typo in comment.

llvm-svn: 14684
2004-07-08 08:08:10 +00:00
Brian Gaeke
dc5940794c Fix bug in copying long constants to register pairs. We were getting
the top and bottom halves backwards...how embarrassing.
Support 'cast long to long' and other similar no-op casts to long.
Support 'ret long'.

llvm-svn: 14683
2004-07-08 07:52:13 +00:00
Chris Lattner
b2db87a5ca Disable some code that isn't helping matters
llvm-svn: 14682
2004-07-08 07:25:51 +00:00
Brian Gaeke
4ba31a2e1e Support 'ret float'
llvm-svn: 14681
2004-07-08 07:22:27 +00:00
Chris Lattner
9ab4d88ab6 Really, it is not necessary to recompile all files in a profile build every
time!

llvm-svn: 14680
2004-07-08 03:42:20 +00:00
Alkis Evlogimenos
2c422bbefb Add viewCFG() and viewCFGOnly() APIs.
llvm-svn: 14679
2004-07-08 00:47:58 +00:00
Misha Brukman
4233155533 There is no error message to print out, end sentence with `!'
llvm-svn: 14678
2004-07-07 21:22:05 +00:00
Reid Spencer
1a4152fa2c Make error message consistent with the rest of LLVM by saying that bytecode
is read, not parsed.

llvm-svn: 14677
2004-07-07 21:20:28 +00:00
Reid Spencer
37e0ba969a Fix some thinkos in the script (error handling, proper argument handling).
llvm-svn: 14676
2004-07-07 21:19:01 +00:00
Reid Spencer
6652252f0f Bug 391 fixed.
llvm-svn: 14675
2004-07-07 21:06:28 +00:00
Reid Spencer
6967cd54f3 Fix for bug 391.
Improve exeception handling around bcreader invocations.

llvm-svn: 14674
2004-07-07 21:01:38 +00:00
Misha Brukman
3955f9079b * Use a map for caching lookups to external functions (fp div/rem)
* Tabs to spaces

llvm-svn: 14673
2004-07-07 20:07:22 +00:00
Misha Brukman
6ff655117d * Wrap long lines (comments and code)
* Tabs to spaces

llvm-svn: 14672
2004-07-07 20:01:36 +00:00
Chris Lattner
9df9afddcf Fix regressions in these testcases:
Regression.Assembler.2002-01-24-BadSymbolTableAssert
 Regression.Assembler.2002-01-24-ValueRefineAbsType

Found through the nightly tester :)

llvm-svn: 14671
2004-07-07 18:07:46 +00:00
Misha Brukman
ef84814ea9 Add fmod() to the Module being compiled so that it gets a stub in the asm file
llvm-svn: 14670
2004-07-07 15:36:18 +00:00
Reid Spencer
18a7abbc75 Insert a reference to uint32_vbr encoding.
llvm-svn: 14669
2004-07-07 15:02:54 +00:00
Reid Spencer
8e32af06f4 An update with corrections to content as well as using a regex style
notation that Chris' suggested to make the specification more compact and
succinct. Added a section to Describe the notation, made the VBR
description its own section, and otherwise generally cleaned things up.

llvm-svn: 14668
2004-07-07 13:34:26 +00:00
Chris Lattner
e9e13f593f The bytecode reader wants to be able to read types that are not quite resolved
yet, then resolve them in it's own sweet time.  We must support this.

llvm-svn: 14666
2004-07-07 06:48:27 +00:00
Chris Lattner
97cf20e1b8 Headers moved
llvm-svn: 14665
2004-07-07 06:35:22 +00:00
Chris Lattner
3e6a996063 All of these now live in the DataStructure directory
llvm-svn: 14664
2004-07-07 06:32:53 +00:00
Chris Lattner
f6118db088 Move all of the DSA headers into the Analysis/DataStructure subdir.
llvm-svn: 14663
2004-07-07 06:32:21 +00:00
Chris Lattner
c800b23c47 Move DSA headers into Analysis/DataStructure to make it more obvious
what is implemented by the DataStructure library.

llvm-svn: 14662
2004-07-07 06:29:26 +00:00
Chris Lattner
fccf172c22 Moving headers
llvm-svn: 14661
2004-07-07 06:22:54 +00:00
Chris Lattner
deb7676f0f As much as I hate to say it, the whole setNode interface for DSNodeHandles
is HOPELESSLY broken.  The problem is that the embedded getNode call can
change the offset of the node handle in unpredictable ways.

As it turns out, all of the clients of this method really want to set
both the node and the offset, thus it is more efficient (and less buggy)
to just do both of them in one method call.  This fixes some obscure bugs
handling non-forwarded node handles.

llvm-svn: 14660
2004-07-07 06:12:52 +00:00
Chris Lattner
71068a0462 When folding constant expr gep's, don't force the use of long indices.
llvm-svn: 14658
2004-07-07 04:45:13 +00:00
Chris Lattner
e549717d84 Bug fixed
llvm-svn: 14657
2004-07-07 02:25:24 +00:00
Chris Lattner
167d4b0e83 New testcase for PR396
llvm-svn: 14656
2004-07-07 02:20:02 +00:00
Alkis Evlogimenos
8a1be03090 Disable coalescing.
llvm-svn: 14655
2004-07-07 02:03:12 +00:00
Chris Lattner
8f23abebfc Make sure people don't make functiontypes with an invalid return type
llvm-svn: 14654
2004-07-06 23:25:19 +00:00
Misha Brukman
4556d889f4 * Add support for calling vararg functions (must pass doubles in int regs too)
* Make visitSetCondInst() share condition-generating code with EmitComparison()
* There are 13 FPRs for function-passing arguments, not 8
* Do not rely on registers being sequential, use an array lookup
* In unimplemented switch cases, send an error and abort instead of silent
  fall-through
* Add doInitialization() for adding function prototypes for external math fns
* Minor changes: fix indentation, spacing, code clarity

llvm-svn: 14653
2004-07-06 22:51:53 +00:00
Misha Brukman
2138f1b2b0 Use the more compact bl' instead of cryptic (but equivalent) bcl 20,31'
llvm-svn: 14652
2004-07-06 22:40:34 +00:00
Brian Gaeke
84e1bb8eff Work around apparent Apple compiler bug which was making all mangled
names start with l0_.

llvm-svn: 14651
2004-07-06 20:29:05 +00:00
Chris Lattner
810583d4c4 Punctuate
llvm-svn: 14650
2004-07-06 19:58:54 +00:00
Chris Lattner
9eb9ccd9f6 Check to make sure types are sized before calling getTypeSize on them.
llvm-svn: 14649
2004-07-06 19:28:42 +00:00
Brian Gaeke
a501be556f It doesn't matter what the 2nd operand is; if the GEP has 2 operands and
the first is a zero, we should leave it alone.

llvm-svn: 14648
2004-07-06 19:24:47 +00:00
Brian Gaeke
0e0fe8a2e9 Add helper function.
Don't touch GEPs for which DecomposeArrayRef is not going to do anything
special (e.g., < 2 indices, or 2 indices and the last one is a constant.)

llvm-svn: 14647
2004-07-06 18:15:39 +00:00
Chris Lattner
bea7247357 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
d448f17b7d Change the "rotate by 90" xtics specification to just "rotate" which is
equivalent. The "by <angle>" syntax is not acceptable for all output
devices. Apparently the Sparc and x86 output devices (no color) don't
accept this, but should accept the plain "rotate".

llvm-svn: 14645
2004-07-06 17:04:09 +00:00
Alkis Evlogimenos
3be9c5fbe7 Do not crash when joining two intervals of registers of different
classes: just ignore that move. Thanks to Vladimir Prus who found the
bug!

llvm-svn: 14644
2004-07-06 16:03:21 +00:00
Misha Brukman
e9b763a83f * Add utility functions: convert SetCC => PPC opcode and invert PPC opcode
* If SetCondInst is folded into BranchInst (and it is the only user), do not
  emit code for SetCondInst
* Fix assembly opcodes in comments in visitSetCondInst()
* Fix codegen of conditional branches

llvm-svn: 14643
2004-07-06 15:32:44 +00:00
Chris Lattner
23b47b6af9 Implement rem.ll:test3
llvm-svn: 14640
2004-07-06 07:38:18 +00:00
Chris Lattner
eca92d3106 New testcase
llvm-svn: 14639
2004-07-06 07:38:00 +00:00
Chris Lattner
98c6bdf251 Fix a minor bug where we would go into infinite loops on some constants
llvm-svn: 14638
2004-07-06 07:11:42 +00:00
Chris Lattner
7fd5f0745a Implement InstCombine/sub.ll:test15: X % -Y === X % Y
Also, remove X % -1 = 0, because it's not true for unsigneds, and the
signed case is superceeded by this new handling.

llvm-svn: 14637
2004-07-06 07:01:22 +00:00
Chris Lattner
2c9fdbe6cb New testcase
llvm-svn: 14636
2004-07-06 07:00:11 +00:00
Chris Lattner
520df8464b Fix a bug in the unreachable block elim pass. Dropping all references on a
basic block clear()'s all of the operands lists, including phis.  This
caused removePredecessor to get confused later.  Because of this, we just
nuke (without prejudice) PHI nodes in unreachable blocks.

llvm-svn: 14635
2004-07-06 06:36:11 +00:00
Reid Spencer
987e503e2e Remove definition and use of OtherVal enumerator. This just fixes a thinko.
llvm-svn: 14634
2004-07-06 01:30:36 +00:00
Reid Spencer
e2f97b3464 First draft completed. All sections written.
llvm-svn: 14633
2004-07-05 22:28:02 +00:00
Reid Spencer
2ae86fbd05 Caused the labels on the small plots to be drawn vertically instead of
horizontally so they no longer overlap.

This eye-strain-lessening patch contributed by Vladimir Merzliakov. Thanks!

llvm-svn: 14632
2004-07-05 19:09:32 +00:00
Reid Spencer
9ce11e44de Added sections for Constant Pool, Module Global Info, and Compaction
Tables. Two more sections to go.

llvm-svn: 14631
2004-07-05 19:04:27 +00:00
Chris Lattner
e5589eabcd Add a missing "terminator" :)
llvm-svn: 14630
2004-07-05 18:05:48 +00:00
Chris Lattner
8aa561992c Structures allow only uint
arrays allow int/uint/long/ulong

llvm-svn: 14629
2004-07-05 17:55:28 +00:00
Reid Spencer
4e0352d8c7 - Reorganized the document contents
- Provided a "General Layout" section that currently covers just the block
  structure of the bytecode file.
- Wrote the section on the Global Type Pool
- Wrote the section on differences between LLVM file format versions.

Only five sections left to write!

llvm-svn: 14628
2004-07-05 08:18:07 +00:00
Reid Spencer
02b6708e01 Finalize bytecode dumping. The "handleFinish" method was getting called
too soon so the function data was not getting dumped (it was generated
after the call handleFinish). Also cleaned up the output format for
proper indentation.

llvm-svn: 14627
2004-07-05 00:57:50 +00:00
Alkis Evlogimenos
21b3a5b0de Correctly compute the ration of iterations/#intervals.
llvm-svn: 14626
2004-07-04 17:23:35 +00:00
Chris Lattner
0969646d6e Add #includes
llvm-svn: 14625
2004-07-04 17:19:21 +00:00
Reid Spencer
00fc1c5fa4 Add #include <iostream> since Value.h doesn't include it any more.
llvm-svn: 14624
2004-07-04 12:22:14 +00:00
Reid Spencer
f0ebb25d2b Add #include <iostream> since Value.h does not include it any more.
llvm-svn: 14623
2004-07-04 12:20:55 +00:00
Reid Spencer
eb04d9bcb4 Add #include <iostream> since Value.h does not #include it any more.
llvm-svn: 14622
2004-07-04 12:19:56 +00:00
Reid Spencer
832fa92ab6 - remove use of isa<Type>(Val) since there's no inheritance relationship
any more. Needed for bug 122
- #include <iostream> since Value.h doesn't include it any more.

llvm-svn: 14621
2004-07-04 12:19:05 +00:00
Reid Spencer
e258e94af7 Remove use of Type::TypeTy which is no longer defined. This change needed
for bug 122 since the "Type Type" concept is gone now.

llvm-svn: 14620
2004-07-04 12:17:44 +00:00
Reid Spencer
e484cc1925 Correct syntax typo .. ; -> :
llvm-svn: 14619
2004-07-04 12:15:11 +00:00
Reid Spencer
1e8005d013 - 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
8baf8e270a - #include <iostream> since its not in Value.h any more.
llvm-svn: 14617
2004-07-04 11:55:37 +00:00
Reid Spencer
c107d6ff87 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
dbe02b7b1d - #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
cf394bf2d5 #include <iostream> since its not in Value.h any more.
llvm-svn: 14614
2004-07-04 11:51:24 +00:00
Reid Spencer
58d30f24bb 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
Reid Spencer
bf2bce3f74 Implementation of SlotTable went into header file. Note that this header
is currently not being used but is retained because it will be the basis
for a clean up of the SlotCalculator class.

llvm-svn: 14612
2004-07-04 11:47:22 +00:00
Reid Spencer
2fa95bcd68 Remove Tabs.
llvm-svn: 14611
2004-07-04 11:46:15 +00:00
Reid Spencer
a52b0009ea Implement new output functions for types and compacted type planes. Also
remove use of Type::TypeTyID and Type::TypeTy since Type no longer inherits
Value.

llvm-svn: 14610
2004-07-04 11:45:47 +00:00
Reid Spencer
3cdb4e88e5 Add new methods outputTypes and outputCompactionTypes for handling Types
separately from Values. This needed for bug 122.

llvm-svn: 14609
2004-07-04 11:44:27 +00:00
Reid Spencer
88f3e0731e For bug 122:
Separate Types from Values because Type no longer inherits from Value. The
changes for this are too numerous to list. In essence, any data structure
that contained a Value was doubled so that Types could be contained
similarly. New members include Types, TypeMap, CompactionTypes, and
CompactionTypeMap. Functions taking a Value* were overloaded with a variant
that takes a Type* that acts on the new data structures.

llvm-svn: 14608
2004-07-04 11:42:49 +00:00
Reid Spencer
25319569fb - Type::TypeTyID doesn't exist any more (bug 122)
- Types don't have names any more, just write them on ostream directly

llvm-svn: 14606
2004-07-04 11:37:54 +00:00
Reid Spencer
5ef4237089 Move SlotCalculator.h to lib/Bytecode/Writer since that is the only place
that needs it after the Type != Value changes (bug 122).

llvm-svn: 14605
2004-07-04 11:36:31 +00:00
Reid Spencer
bc70f74825 - Don't use macros to call the BytecodeHandler
- Don't use PARSE_ERROR macro unnecessarily (for simple strings)
- Add comments before each function
- Convert for bug 122 (Type != Value)
- Handle new value range on Type::PrimitiveTypeId enumeration by augmenting
  the reader with a new read_typeid method and sanitizeTypeId method.
- Remove BytecodeHandler's default method implementations to header file.

llvm-svn: 14604
2004-07-04 11:33:49 +00:00
Reid Spencer
6934ce8347 Make all the virtual function (except destructor) inline so there are
default implementations without taking up a ton of space in a .cpp file.

llvm-svn: 14603
2004-07-04 11:29:56 +00:00
Reid Spencer
e6c95490a0 - Make ValueList an "OtherVal" user of Values to ensure it doesn't get
mistaken for anything else.
- Move function descriptions to Reader.cpp file per Chris.
- Remove tabs.

llvm-svn: 14602
2004-07-04 11:04:56 +00:00
Reid Spencer
0421e6c843 Remove tabs. Move function declaration to Reader.h where it belongs.
llvm-svn: 14601
2004-07-04 11:03:03 +00:00
Reid Spencer
646f829e33 Add #include <iostream> which is needed now that Value.h doesn't include it
llvm-svn: 14600
2004-07-04 11:01:27 +00:00
Reid Spencer
6eecc40b2d Excise tabs.
llvm-svn: 14599
2004-07-04 11:00:39 +00:00
Reid Spencer
904b345c71 Add a new, compatible, interface function for writing types as operands.
This is necessary because Types are no longer Values.

llvm-svn: 14598
2004-07-04 10:59:05 +00:00
Reid Spencer
ca9fb19323 Added #include <iostream> since this header is no longer picked up from
the Value.h header.

llvm-svn: 14597
2004-07-04 10:58:20 +00:00
Reid Spencer
bc3919c074 - Remove enumerator TypeVal since Values can't be types any more
- Remove isa_impl relationship between Types and Values
- Add OtherVal so "other" users can interact with Values.

llvm-svn: 14596
2004-07-04 10:52:28 +00:00
Reid Spencer
fefe3d5ba3 There is no longer a "Type" primitive type because Values and Types are
now distinct.

llvm-svn: 14595
2004-07-04 10:50:43 +00:00
Reid Spencer
a7ae332182 Constify usage of Type* on the interface to ensure SymbolTable doesn't
modify types (it never should). Clean up some comments.

llvm-svn: 14594
2004-07-04 10:49:41 +00:00
Reid Spencer
50a334b2d6 Remove all of the classof(const Value*) methods of the derived types since
the Type base class no longer derives from Value.

llvm-svn: 14593
2004-07-04 10:48:27 +00:00
Reid Spencer
1431f7cf07 Make Type have no base classes. Previously it inherited Value. Also
removed the TypeTyID and TypeTy members so that the notion of the
"Type Type" is no longer present in LLVM. Various other adjustments
resulting from these changes were also made.

llvm-svn: 14592
2004-07-04 10:46:49 +00:00
Alkis Evlogimenos
8f3cc0316c Add efficiency statistic.
llvm-svn: 14590
2004-07-04 07:59:06 +00:00
Alkis Evlogimenos
ef72a7e963 Add more operators.
llvm-svn: 14589
2004-07-04 01:30:54 +00:00
Chris Lattner
d3ecc61840 Fix compilation on internix
llvm-svn: 14588
2004-07-03 01:21:05 +00:00
Chris Lattner
4c9c20af28 Implement add.ll:test22, a common case in MSIL files
llvm-svn: 14587
2004-07-03 00:26:11 +00:00
Chris Lattner
3a03c90085 Add a new testcase for folding an add into a switch
llvm-svn: 14586
2004-07-03 00:25:31 +00:00
Chris Lattner
971bbcb43a Fix Type::isSized() to realize that "{ opaque }" is not sized
llvm-svn: 14585
2004-07-02 23:20:17 +00:00
Chris Lattner
49df6cefa5 Do not call getTypeSize on a type that has no size
llvm-svn: 14584
2004-07-02 22:55:47 +00:00
Brian Gaeke
317ef96a3a Modernize example, so that you can paste it right into llvm-as
llvm-svn: 14583
2004-07-02 21:08:14 +00:00
Chris Lattner
bee3155b20 Since we are in the department of redundancy department, at least be correct
llvm-svn: 14582
2004-07-02 18:41:18 +00:00
Misha Brukman
4308baa0f1 Add FIXME notes for spilling int/fp regs (need to calculate stack space).
llvm-svn: 14581
2004-07-02 17:54:38 +00:00
Misha Brukman
0fdfcf147b * Wrap long lines
* Mention the HTML/man page output from single POD source file

llvm-svn: 14580
2004-07-02 16:23:17 +00:00
Misha Brukman
6c4644b4a9 * Standardize manpage output: program name bold, options italic/emphasized
* Make links in SEE ALSO section of manpages short without "the ... manpage"

llvm-svn: 14579
2004-07-02 16:06:19 +00:00
Misha Brukman
763855342b The HTML documentation is now automatically generated from POD source.
llvm-svn: 14578
2004-07-02 15:48:33 +00:00
Misha Brukman
cbbf9a1f8f * Link to the POD-generated HTML documentation
* Updated llvm-abcd to llvm-bcanalyzer

llvm-svn: 14577
2004-07-02 15:46:55 +00:00
Misha Brukman
bbd9759fd6 Make `args' stand out as bold, delete confusing elipsis at the end of cmdline.
llvm-svn: 14576
2004-07-02 15:42:20 +00:00
Misha Brukman
064e9b7cf0 HTML links in PODs must be absolute.
llvm-svn: 14575
2004-07-02 15:37:53 +00:00
Misha Brukman
0e21722a9f Simplify wording: the bugpoint tool' can just become bugpoint'.
llvm-svn: 14574
2004-07-02 15:36:29 +00:00
Misha Brukman
2410a8807e llvm-abcd has become llvm-bcanalyzer
llvm-svn: 14573
2004-07-02 15:32:49 +00:00
Brian Gaeke
f6d2471c5d Fix use-before-def thinko
llvm-svn: 14570
2004-07-02 07:01:31 +00:00
Reid Spencer
f03b63de59 Add a note about implementing interprocedural register allocation.
llvm-svn: 14569
2004-07-02 06:27:12 +00:00
Brian Gaeke
dcecac198e Build llvm-bcanalyzer
llvm-svn: 14568
2004-07-02 05:59:20 +00:00
Chris Lattner
a65b4eac3b Revert patches 1.79 and 1.80 which had to do with dead MBB's. Now that they
don't exist, we don't have to pretend to handle them.

llvm-svn: 14567
2004-07-02 05:52:23 +00:00
Chris Lattner
55256dbf9b Fix potential problems with unreachable basic blocks.
Also, while noone's looking, add support for constant expressions.  Wait,
I said not to look!

llvm-svn: 14566
2004-07-02 05:49:11 +00:00
Chris Lattner
3594324248 Fix all of those problems that the PPC backend has running 176.gcc :)
llvm-svn: 14565
2004-07-02 05:48:42 +00:00
Chris Lattner
6c322ecc31 Remove dead blocks
llvm-svn: 14564
2004-07-02 05:46:41 +00:00
Chris Lattner
693244fb33 Add a trivially simple pass to delete unreachable blocks from the CFG. This
pass is required to paper over problems in the code generator (primarily
live variables and its clients) which doesn't really have any well defined
semantics for unreachable code.

The proper solution to this problem is to have instruction selectors not
select blocks that are unreachable.  Until we have a instruction selection
framework available for use, however, we can't expect all instruction
selector writers to do this.  Until then, this pass should be used.

llvm-svn: 14563
2004-07-02 05:46:10 +00:00
Chris Lattner
1661358d7e Add a new pass for code generators to use
llvm-svn: 14562
2004-07-02 05:44:13 +00:00
Chris Lattner
1d6b5f38fe Make this testcase more interesting
llvm-svn: 14561
2004-07-02 05:43:51 +00:00
Brian Gaeke
e1a136fb4b Get rid of a dead variable, and fix a typo in a comment.
llvm-svn: 14560
2004-07-02 05:30:01 +00:00
Brian Gaeke
186e3d1098 Add M_TERMINATOR_FLAG to terminator instructions (branches and returns).
Also, the RETURN instructions are not used in the sparcv9 backend.

llvm-svn: 14559
2004-07-02 04:57:37 +00:00
Brian Gaeke
fb894bd864 RETURN instructions are not used in the sparc backend.
When in doubt, stamp it out!!

llvm-svn: 14558
2004-07-02 04:57:35 +00:00
Reid Spencer
7efe23752f llvm-abcd tool name changed to llvm-bcanalyzer: see llvm-bcanalyzer.pod.
llvm-svn: 14557
2004-07-02 03:45:32 +00:00
Reid Spencer
b703e0b32f Podified documentation for the llvm-bcanalyzer tool (nee llvm-abcd).
llvm-svn: 14556
2004-07-02 03:44:14 +00:00
Reid Spencer
5780de6219 Name Change: llvm-abcd -> llvm-bcanalyzer
llvm-svn: 14555
2004-07-02 03:22:53 +00:00
Misha Brukman
24a0371791 * Follow the PowerPC convention of leaving 24 bytes for linking on the stack.
* Also leave space for spilling integer registers (this should be calculated)

llvm-svn: 14554
2004-07-01 21:35:00 +00:00
Misha Brukman
d028593c6e * Get rid of constant-expr handling code: we use the ConstantExpr lowering pass
* Use the SetCC handling code in the format of Brian's V8
* Add FIXMEs where calls to functions are being made without adding them to the
  Module first... they cause missing symbols at assembly-time.

llvm-svn: 14553
2004-07-01 21:34:10 +00:00
Misha Brukman
1f3a7f0255 Wrap long line
llvm-svn: 14552
2004-07-01 21:27:59 +00:00
Misha Brukman
d575287551 * Do not allocate r0 as we use it indiscriminantly in the instr selector.
* Do not define CR register class because we don't (yet) have the i4 type

llvm-svn: 14551
2004-07-01 21:24:50 +00:00
Misha Brukman
fcc59bd0e0 Check if operand has an allocated reg before requesting it.
llvm-svn: 14550
2004-07-01 21:09:12 +00:00
Misha Brukman
20709326a1 * Doxygenify comments
* Tabs-to-spaces

llvm-svn: 14549
2004-07-01 20:42:00 +00:00
Chris Lattner
80b3aeafc0 Fix broken links
llvm-svn: 14548
2004-07-01 20:41:43 +00:00
Brian Gaeke
d4ba0a5721 bug. point. pod.
llvm-svn: 14547
2004-07-01 20:29:08 +00:00
Chris Lattner
5b20870830 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
153cd4ed30 Move init methods out of line to enable better assertions, contributed
by Vladimir Merzliakov!

llvm-svn: 14545
2004-07-01 20:22:31 +00:00
Brian Gaeke
3785ca3df3 bugpoint command guide has been designated a full-fledged "doc".
llvm-svn: 14544
2004-07-01 20:10:40 +00:00
Brian Gaeke
b8a340a3bf abcd pod document
llvm-svn: 14543
2004-07-01 20:07:15 +00:00
Brian Gaeke
cc7cafb371 llvm-nm pod format man page.
llvm-svn: 14542
2004-07-01 19:40:36 +00:00
Brian Gaeke
163c87fc32 Make this pass use a more specific debug message than "Processing:".
llvm-svn: 14541
2004-07-01 19:27:10 +00:00
Misha Brukman
fa3561c603 Fix grammar: remove `our' as it no longer makes sense.
llvm-svn: 14540
2004-07-01 18:34:46 +00:00
Chris Lattner
8a9d11b1bc This is more of an "llvm team" thing by now
llvm-svn: 14539
2004-07-01 18:25:59 +00:00
Misha Brukman
0667a12dcd llvm-db is in alpha stage, this document is a placeholder.
llvm-svn: 14538
2004-07-01 18:00:42 +00:00
Misha Brukman
3121ce052f Fix links to llvmgcc and llvmgxx
llvm-svn: 14537
2004-07-01 17:59:53 +00:00
Misha Brukman
ae8b03362c gccld enters the Hall of POD.
llvm-svn: 14536
2004-07-01 17:53:27 +00:00
Misha Brukman
082fe484ed Make the text of the link to llvmgxx.html more appropriate: `llvmg++'.
llvm-svn: 14535
2004-07-01 17:52:58 +00:00
Chris Lattner
18a08e702d Handle targets where alignment can be bigger than the size of the data.
Contributed by Vladimir Prus!

llvm-svn: 14534
2004-07-01 17:32:59 +00:00
Misha Brukman
3802014c51 Fix grammar in Stacker doc description.
llvm-svn: 14533
2004-07-01 17:20:53 +00:00
Misha Brukman
61a747f60b Mention llvm-abcd, point out difference between it and `analyze'.
llvm-svn: 14532
2004-07-01 16:59:05 +00:00
Misha Brukman
b410763f25 Change format of CommandGuide index page to look like other docs.
llvm-svn: 14531
2004-07-01 16:04:49 +00:00
Misha Brukman
3eef5d4715 * `The' isn't necessary in front of LLVM
* Wrap long line

llvm-svn: 14530
2004-07-01 15:33:24 +00:00
Misha Brukman
6836eaed42 Fresh from the LLVM baker's oven: opt and analyze pods.
llvm-svn: 14529
2004-07-01 15:25:04 +00:00
Misha Brukman
dfb5a7b925 Add llvm-g++ and llvm-gcc pod documentation.
llvm-svn: 14528
2004-07-01 14:51:26 +00:00
Misha Brukman
81e616976f Fix link to llvmgcc.
llvm-svn: 14527
2004-07-01 14:47:05 +00:00
Misha Brukman
0c7ed6e335 Make links relative instead of absolute.
llvm-svn: 14525
2004-07-01 13:52:35 +00:00
Chris Lattner
9a60c532a8 Make sure that we destroy the MBB's, with all of their instructions, before
any other data structures

llvm-svn: 14524
2004-07-01 06:29:07 +00:00
Chris Lattner
c85535c8be Now that MachineFunction/MachineBasicBlock keep a mapping of blocks to ID #'s
use them instead of a local LiveVariables numbering

llvm-svn: 14523
2004-07-01 06:15:32 +00:00
Chris Lattner
0c26b9cbbb Now that we have happy mappings from MBBs->numbers, use them instead of keeping
a LV private map

llvm-svn: 14522
2004-07-01 06:14:57 +00:00
Chris Lattner
449af59c7e Change MBB autonumber a bit to get the reverse mapping as well as a forward
mapping

llvm-svn: 14521
2004-07-01 06:02:27 +00:00
Chris Lattner
a47455dbd3 Instance var no longer exists
llvm-svn: 14520
2004-07-01 06:02:07 +00:00
Chris Lattner
6b2ac89e78 Change the implementation of the autonumbering for MBB's a bit to provide
the reverse mapping as well as the mapping from MBB->unsigned

llvm-svn: 14519
2004-07-01 06:01:36 +00:00
Chris Lattner
6c375e4926 Start using MBB numbers directly instead of going through the live variables
map.

llvm-svn: 14518
2004-07-01 04:29:47 +00:00
Chris Lattner
7c77fd50e7 Instead of building a private numbering of MBB's use brg's nifty auto-numbering.
Also convert df_iterator -> df_ext_iterator for subsequent stuff I'm doing.

llvm-svn: 14517
2004-07-01 04:24:29 +00:00
Chris Lattner
5cc223a7e2 Fix testcase
llvm-svn: 14516
2004-07-01 04:11:35 +00:00
Chris Lattner
8785e03d7c -debug option does not exist in a release build
llvm-svn: 14515
2004-07-01 04:10:15 +00:00
Chris Lattner
eee347209f Fix testcase. For some reason this was failing only with a release build and
not with a debug build?  Rather testrunner only caught it in that case.

llvm-svn: 14514
2004-07-01 04:09:14 +00:00
Reid Spencer
209ae4bd6d Added a command page for the llvm-abcd tool.
llvm-svn: 14513
2004-07-01 02:32:42 +00:00
Misha Brukman
b9125f462d Fix indentation to be 2 spaces.
llvm-svn: 14512
2004-06-30 22:11:03 +00:00
Misha Brukman
0648a903c7 * Coalesce the handy CALL* alias opcodes with the standard ones
* Congregate more branch-and-link opcodes together
* Mark FP, CPR, and special registers as volatile across calls

llvm-svn: 14511
2004-06-30 22:00:45 +00:00
Misha Brukman
299fa1b147 * Allow more registers to be allocated from the general register pool
* Define the condition register class

llvm-svn: 14510
2004-06-30 21:54:50 +00:00
Misha Brukman
fee5a22f8a * Inquire about the number of operands from the instruction directly
* Only check for a register if we are sure the instruction has one allocated

llvm-svn: 14509
2004-06-30 21:54:12 +00:00
Misha Brukman
04f07b4589 visitSetCondInst() takes a parameter of type `SetCondInst'
llvm-svn: 14508
2004-06-30 21:47:40 +00:00
Jonathan Manton
aff4a6a11b Fixed the tutorial to indicate that we needed to use the llvm namespace.
llvm-svn: 14507
2004-06-30 18:10:30 +00:00
Misha Brukman
2b9106f808 Always assume a function may have calls because the printer may add `bl' to get
the PC in a code sequence for global variables.

llvm-svn: 14506
2004-06-30 00:09:12 +00:00
Misha Brukman
351646f31e * Don't save LR when outputting globals: it's already saved on the stack once
for the function
* Registers aren't necessarily sequential wrt their enums, don't rely on it
  when emitting function arguments into sequential registers
* Remove X86-specific comments about AL/BL/AH/BH/EDX/etc
* Add an abort() for an unimplemented signed right shift
* The src operand for a GEP was never emitted!  Fixed.
* We can skip zero-valued GEP indices as they are no-ops.

"Hello, World!" now works.

llvm-svn: 14505
2004-06-29 23:45:05 +00:00
Misha Brukman
c794feab51 * Stop using BBNumbering, we don't really need it
* Only increment labelNumber once, because it's used by both Load{hi,lo}Addr
* There is no .bss section on PowerPC
* Use .align 2 instead of other random numbers

llvm-svn: 14504
2004-06-29 23:40:57 +00:00
Reid Spencer
b1076c4231 Fix order and line length of fixed bugs.
llvm-svn: 14503
2004-06-29 23:39:24 +00:00
Misha Brukman
d409669877 Set up the prologue and epilogue to be more like the manual and GCC output.
llvm-svn: 14502
2004-06-29 23:38:26 +00:00
Misha Brukman
7454c6fff0 * Use LA instead of LWZ for LoadLoAddr
* Specify the isCall bit and caller-save registers for some call instrs

llvm-svn: 14501
2004-06-29 23:37:36 +00:00
Misha Brukman
5459dfb47b Only allocate non-volatile registers R13-31 (for now).
llvm-svn: 14500
2004-06-29 23:35:32 +00:00
Reid Spencer
938be23e90 Implement verification feature.
Ensure output occurs even in the face of an error.

llvm-svn: 14499
2004-06-29 23:34:27 +00:00
Reid Spencer
002dd98ce0 The analyzer code now lives in the bcreader library. The bcanalyzer lib
is no more.

llvm-svn: 14498
2004-06-29 23:33:31 +00:00
Misha Brukman
4efe3da794 Lower ConstantExpressions before the code generator.
llvm-svn: 14497
2004-06-29 23:33:20 +00:00
Reid Spencer
fddebf7ff2 Remove files no longer needed. ConstantReader and InstructionReader were
integrated into Reader. Parser.* was just a bad idea. AnalyzerInternals.h
is no longer needed. ReaderPrimitives.h was integrated into Reader.h and
Reader.cpp. Dumper.cpp was integrated into Analyzer.cpp. ReaderInternals.h
became Reader.h. AnalyzerWrappers.cpp was integerated into
ReaderWrappers.cpp

llvm-svn: 14496
2004-06-29 23:32:41 +00:00
Reid Spencer
f4ec6383c0 This is a slimming down of the previous ReaderInternals.h that just
declares the BytecodeReader class.

llvm-svn: 14495
2004-06-29 23:31:01 +00:00
Reid Spencer
284b7c7174 MAJOR REWRITE.
- stop passing Buf/BufEnd to every function (now member vars)
- internalize things that used to be in a header file that no one else
  included/needed.
- Remove defunct BCR_TRACE lines
- Standardize error handling with the PARSE_ERROR macro.
- Integrate ConstantReader.cpp and InstructionReader.cpp and reorgnize
  the definition order so that gcc has a chance at optimizing this module
- Standardize case and style of method names.
- Eliminate unneeded header files
- Prepare for Type != Value (bug122) change by splitting Types into their
  own data structures.
- Implement the BytecodeHandler interface calls.
- Provide default implementation of BytecodeHandler interface.

llvm-svn: 14494
2004-06-29 23:29:38 +00:00
Reid Spencer
891cb9d925 Adjustments to allow Bytecode Reading to support the BytecodeHandler
interface which is called by the reader if a BytecodeHandler is provided.

llvm-svn: 14493
2004-06-29 23:24:14 +00:00
Reid Spencer
351f6bf714 Merge Dumper.cpp and AnalyzerWrappers.cpp into this file. Also, adjust the
dumping facility to produce useful output.

llvm-svn: 14492
2004-06-29 23:23:12 +00:00
Reid Spencer
c7b9419add Analyzer moved to ../Reader directory.
llvm-svn: 14491
2004-06-29 23:21:53 +00:00
Reid Spencer
75923a4f93 Remove newly defunct Analyzer directory.
llvm-svn: 14490
2004-06-29 23:21:16 +00:00
Reid Spencer
5a45200992 Provide support for the BytecodeHandler interface which will be called by
the bcreader if one is supplied to the bytecode reader's interface
functions.

llvm-svn: 14489
2004-06-29 23:20:03 +00:00
Reid Spencer
53213ce347 Fix include guard
Adjust comments
Make handlers for constants provide useful information.

llvm-svn: 14488
2004-06-29 23:18:52 +00:00
Reid Spencer
d190ecc669 Adjust comments to match code.
Allow analysis to return the module created by the bcreader.

llvm-svn: 14487
2004-06-29 23:17:34 +00:00
Misha Brukman
887fd23dfc Fix associativity of parameters to assert(): now it actually makes sense.
llvm-svn: 14483
2004-06-29 19:43:20 +00:00
Misha Brukman
c968b87d94 Convert tabs to spaces.
llvm-svn: 14482
2004-06-29 19:28:53 +00:00
Misha Brukman
802403723b * Fix saving LR in function prologue
* Adjust epilogue restore sequence to match the PowerPC documentation

llvm-svn: 14480
2004-06-29 17:14:42 +00:00
Misha Brukman
811f5c2c4c Assembly syntax/comment fixes by Nate Begeman.
llvm-svn: 14479
2004-06-29 17:13:26 +00:00
Vikram S. Adve
1097ed8467 Restoring this file.
llvm-svn: 14478
2004-06-29 14:20:27 +00:00
Chris Lattner
c5f9b356af The code generator should work with unreachable blocks. If not, then this
is a bug that should be fixed in the code generator, not papered over with
the simplifycfg pass.  Eliminating this makes bugpoint much more useful

llvm-svn: 14477
2004-06-29 07:20:16 +00:00
Chris Lattner
e6e1b48023 I believe that the code generator now properly handles dead basic blocks. If not,
this is a bug, and should be fixed.

llvm-svn: 14476
2004-06-29 07:17:12 +00:00
Chris Lattner
4cda555346 In line with the previous patch, do not assert out if analyzing a dead basic block.
llvm-svn: 14475
2004-06-29 07:16:23 +00:00
Chris Lattner
49b34f3f51 Do not dereference end iterators. It hurts when you do that.
llvm-svn: 14474
2004-06-29 06:56:51 +00:00
Chris Lattner
1a920d49f6 Fix a regression from r1.224. In particular, codegen a cast from double ->
float as a truncation by going through memory.  This truncation was being
skipped, which caused 175.vpr to fail after aggressive register promotion.

llvm-svn: 14473
2004-06-29 00:14:38 +00:00
Misha Brukman
15c10883ff Can't print out machine code before it is constructed.
llvm-svn: 14472
2004-06-28 21:16:57 +00:00
Chris Lattner
9475b96a3c document new pass
llvm-svn: 14471
2004-06-28 19:19:47 +00:00
Misha Brukman
3aad397726 Fix the assembly opcode on LOADLoAddr, courtesy of Nate Begeman.
llvm-svn: 14470
2004-06-28 18:27:08 +00:00
Misha Brukman
767fa11096 Set isBranch and isTerminator bits on all branch instructions.
llvm-svn: 14469
2004-06-28 18:23:35 +00:00
Misha Brukman
2f0cda8b2a Fix loading and storing PC-relative static variables, courtesy of Nate Begeman.
llvm-svn: 14468
2004-06-28 18:20:59 +00:00
Misha Brukman
75985d725c No need to generate a lazy-linking stub for internal functions, they can be
resolved by the static linker.

llvm-svn: 14467
2004-06-28 18:03:37 +00:00
Misha Brukman
8455e0177b Do not set the `link' bit when branching to the first BB of a function, as it
will cause an infinite loop.  The link bit is only used for calling functions.

llvm-svn: 14466
2004-06-28 17:57:40 +00:00
Chris Lattner
3337c82745 Add a link to the CFE build instrs next to the CFE download instructions
llvm-svn: 14465
2004-06-28 17:14:01 +00:00
Chris Lattner
7d60ee3dcf Building the C FE is a user-level process
llvm-svn: 14464
2004-06-28 17:11:10 +00:00
Misha Brukman
9cb88aae40 Fix spacing around function arguments.
llvm-svn: 14463
2004-06-28 15:53:27 +00:00
Chris Lattner
26dff501a4 Initial checkin of a simple mod/ref analysis for global variables. This is
still overly conservative and uses very simple data structures, but it is a
start, and allows elimination of a lot of loads.

llvm-svn: 14462
2004-06-28 06:33:13 +00:00
Chris Lattner
8f12ca4d92 Add new header
llvm-svn: 14461
2004-06-28 06:31:26 +00:00
Chris Lattner
3b11d3b294 Remove unused file
llvm-svn: 14460
2004-06-28 00:46:58 +00:00
Chris Lattner
30a2e1725f Remove dead file
llvm-svn: 14459
2004-06-28 00:46:54 +00:00
Chris Lattner
9958350f42 Bad passes are gone
llvm-svn: 14458
2004-06-28 00:44:45 +00:00
Chris Lattner
924882f775 These passes are long dead/obsolete. They never worked in the first place
and are a maintenence burden.  Nuke nuke nuke

llvm-svn: 14457
2004-06-28 00:44:18 +00:00
Chris Lattner
356b067d69 Remove two dead passes
llvm-svn: 14456
2004-06-28 00:43:25 +00:00
Chris Lattner
9b55c11c56 Moved IPModRef out of the public include dir
llvm-svn: 14455
2004-06-28 00:41:23 +00:00
Chris Lattner
8676ad8aee Move file to lib/Analysis/DataStructure
llvm-svn: 14454
2004-06-28 00:40:43 +00:00
Chris Lattner
32c79788cc Move DependenceGraph.* to lib/Analysis/DataStructure
llvm-svn: 14452
2004-06-28 00:32:33 +00:00
Chris Lattner
317f89301b Moved to lib/analysis/datastructure
llvm-svn: 14451
2004-06-28 00:30:29 +00:00
Chris Lattner
135fb4be7c Moving to lib/Analysis/DataStructure
llvm-svn: 14450
2004-06-28 00:29:42 +00:00
Chris Lattner
e0e1db012c Moved to lib/Analysis/DataStructure
llvm-svn: 14449
2004-06-28 00:27:34 +00:00
Chris Lattner
dfe8056225 Move MemoryDepAnalysis.h into lib/Analysis/DataStructure
llvm-svn: 14448
2004-06-28 00:27:16 +00:00
Chris Lattner
b1775590e4 Moved to lib/Analysis/DataStructure
llvm-svn: 14447
2004-06-28 00:20:39 +00:00
Chris Lattner
f6729a3bcc Move PgmDependenceGraph.h out of the public include hierarchy
llvm-svn: 14446
2004-06-28 00:20:04 +00:00
Brian Gaeke
81f67f60ec Allow saving and restoring of double and float registers.
Allow copying of float registers.

llvm-svn: 14445
2004-06-27 22:59:56 +00:00
Brian Gaeke
b3d33c7994 Add FITOS, FITOD, and F{ADD,SUB,MUL,DIV}{S,D}.
llvm-svn: 14444
2004-06-27 22:53:56 +00:00
Chris Lattner
6e07936ed2 Implement InstCombine/add.ll:test21
llvm-svn: 14443
2004-06-27 22:51:36 +00:00
Chris Lattner
0da061fa1e new testcase
llvm-svn: 14442
2004-06-27 22:51:19 +00:00
Brian Gaeke
187ff172b6 Support printing constant pool indices.
If we see an "unknown operand", abort so it's easier to fix it.

llvm-svn: 14441
2004-06-27 22:50:44 +00:00
Brian Gaeke
c81b5a5331 Trim whitespace.
Support cast of ints (and narrower) to float and double.
Support cast double to double (using load and store).
Abort if we see a CallInst or SetCondInst with long/fp args, instead
of producing bad code.
Support add, sub, mul, div of float and double.

llvm-svn: 14440
2004-06-27 22:47:33 +00:00
Chris Lattner
59b2c40286 Now that the SparcV9 specific MachineCodeForInstruction class uses it's own
map on the side, Instruction no longer has to be Annotable.  This reduces
the size of the Instruction class by another 4 bytes (on a 32-bit system).

llvm-svn: 14439
2004-06-27 18:57:34 +00:00
Chris Lattner
d22d9cb800 Do not find these ugly sparc-specific objects by using the annotation API on
instructions.  Instead, keep a map of instructions -> MCFI objects in the
already sparc-specific class MachineFunctionInfo.  This will slow down the
sparc backend a bit, but it does not penalize the rest of LLVM!

llvm-svn: 14438
2004-06-27 18:52:17 +00:00
Chris Lattner
2b04d102f0 This class is no longer an annotation
llvm-svn: 14437
2004-06-27 18:50:49 +00:00
Chris Lattner
3a3bd6f29c Add a map of MachineCodeForInstruction objects to MachineFunctionInfo
llvm-svn: 14436
2004-06-27 18:50:30 +00:00
Chris Lattner
dd7a707897 Fold iType into Value::VTy
llvm-svn: 14435
2004-06-27 18:38:48 +00:00
Chris Lattner
a7c0a11647 Eliminate the Instruction::iType field, folding it into the Value::VTy field.
This reduces the size of the instruction class by 4 bytes, and means that
isa<CallInst>(V) (for example) only needs to do one load from memory instead
of two.

llvm-svn: 14434
2004-06-27 18:38:24 +00:00
Chris Lattner
8e55b75913 Get rid of Annotable's vtable. If anyone deletes an object through an Annotable*,
they get what they deserve.

This reduces the size of Instruction & Function by 4 bytes each.

llvm-svn: 14433
2004-06-27 18:36:39 +00:00
Chris Lattner
6b62f225f6 Make it obvious that this file is bad bad bad
llvm-svn: 14432
2004-06-27 18:21:20 +00:00
Chris Lattner
60a29a77aa User ctor is now inline
llvm-svn: 14431
2004-06-27 18:01:38 +00:00
Chris Lattner
d2f55b69e0 Make ctor inline, change ValueTy ->unsigned
llvm-svn: 14430
2004-06-27 18:01:15 +00:00
Chris Lattner
f758330347 Consider anything with a ValueType that is >= Instruction to be an instruction
llvm-svn: 14429
2004-06-26 20:51:50 +00:00
Chris Lattner
d0b0b454e5 Instancevar was renamed
llvm-svn: 14428
2004-06-26 20:33:39 +00:00
Chris Lattner
4a9134ecac Rearrange some code.
llvm-svn: 14427
2004-06-26 20:33:27 +00:00
Chris Lattner
80d2d53fbf 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
Chris Lattner
6fb22cd7ef There is no reason to print ValueType here
llvm-svn: 14425
2004-06-26 19:36:34 +00:00
Chris Lattner
74e2acfcdd Simplify code
llvm-svn: 14424
2004-06-26 19:31:26 +00:00
Chris Lattner
f11b67bb8f Hey, why not just make 'new ReturnInst(BB)' DTRT?
llvm-svn: 14422
2004-06-25 23:10:30 +00:00
Chris Lattner
0c8053cace new ReturnInst(BB) does not "do the right thing". Add an assert to catch it
sooner rather than later.

llvm-svn: 14421
2004-06-25 23:06:57 +00:00
Chris Lattner
3c53efa48b Add credits entry
llvm-svn: 14420
2004-06-25 21:00:10 +00:00
Chris Lattner
9a844696f9 Fix relative links for nightly testers not hosted on llvm.cs.
Patch contributed by Vladimir Merzliakov!

llvm-svn: 14419
2004-06-25 20:57:19 +00:00
Chris Lattner
10247b13c0 Write .bc files to binary ostreams. This shouldn't change anything on unix,
but allows us to generate valid code on hosts (like windows) that do newline
translation for text files.

llvm-svn: 14418
2004-06-25 20:54:43 +00:00
Chris Lattner
4ba8a8d1ef No functionality changes here:
* Some warning fixes for MSVC
  * Minor simplification to the deque scanning code

llvm-svn: 14417
2004-06-25 20:52:10 +00:00
Misha Brukman
c52ea2574d Allow debugging machine instrs (by printout) before/after isel and regalloc
llvm-svn: 14416
2004-06-25 19:57:47 +00:00
Misha Brukman
26e36e5758 Combine several if stmts with returns into an if-then-elseif-else chain.
llvm-svn: 14414
2004-06-25 19:24:52 +00:00
Misha Brukman
c22fd9a6a5 Do not move any values into registers for a void return (there isn't anything).
llvm-svn: 14413
2004-06-25 19:04:27 +00:00
Misha Brukman
b5932a5708 Convert tabs to spaces.
llvm-svn: 14412
2004-06-25 18:45:07 +00:00
Misha Brukman
5dbf760e00 Fix opcode: no immediate in an `or r1, r2, r3' (all registers) instr.
llvm-svn: 14411
2004-06-25 18:36:53 +00:00
John Criswell
726de6f9b0 Removed the interrupt_handler instrinsic section that I accidently added
in my previous commits.  It's not implemented and is out of date.

llvm-svn: 14410
2004-06-25 16:42:50 +00:00
John Criswell
bcbb18c7a0 Grammar and punctuation fixes.
llvm-svn: 14409
2004-06-25 16:05:06 +00:00
Misha Brukman
c56b66f504 * Be consistent about MachineBB labels and references to them in instr stream
* Use MachineBB's built-in numbering system instead of reinventing one

llvm-svn: 14408
2004-06-25 15:42:10 +00:00
John Criswell
40db33f642 Added missing quote.
llvm-svn: 14407
2004-06-25 15:16:57 +00:00
Misha Brukman
a27375832b * Initialize the entire array statically, not member-at-a-time
* Remove x86-specific comment re: intel vs. at&t assembly syntax

llvm-svn: 14406
2004-06-25 15:11:34 +00:00
Misha Brukman
468d9a0087 Fix bug in previous checkin.
llvm-svn: 14405
2004-06-25 14:57:19 +00:00
Misha Brukman
9ff1cda1a8 * Wrap long lines
* Replace silent fall-through FIXME comments with an error to cerr and an abort
* No need to set size of statically initialized arrays

llvm-svn: 14404
2004-06-25 14:50:41 +00:00
Misha Brukman
08b0e61841 Excise X86-specific comments.
llvm-svn: 14403
2004-06-25 14:13:26 +00:00
Misha Brukman
7ce853616d Vladimir Prus also contributed the LowerConstantExprs pass.
llvm-svn: 14402
2004-06-25 13:37:03 +00:00
Chris Lattner
7f4222237d New constant expression lowering pass to simplify your instruction selection needs.
Contributed by Vladimir Prus!

llvm-svn: 14399
2004-06-25 07:48:09 +00:00
Chris Lattner
8b0c935145 New testcase for constant expression lowering pass, contributed by Vladimir Prus!
llvm-svn: 14398
2004-06-25 07:47:13 +00:00
Chris Lattner
5ea1317e3c Prototype for new ConstantExpr lowering pass, contributed by Vladimir Prus!
llvm-svn: 14397
2004-06-25 07:41:06 +00:00
Brian Gaeke
537851f6e7 Don't try to run qmtests if we fail to build the tree. The qmtests (at
least, on macosx) will spiral out of control instead of failing gracefully.

llvm-svn: 14396
2004-06-25 07:25:28 +00:00
Chris Lattner
e67d8400f6 Make sure to link all IPA's into opt, so that it has access to stuff like
anders-aa

llvm-svn: 14395
2004-06-25 05:19:17 +00:00
Chris Lattner
f019e346f4 Fix header
llvm-svn: 14394
2004-06-25 04:24:22 +00:00
Reid Spencer
1800529834 - Changed Handler.h -> BytecodeHandler.h
- Fixed some small coding standard compliance issues in BytecodeHandler.h

llvm-svn: 14393
2004-06-25 02:32:27 +00:00
Chris Lattner
6995c9bced Okay, Module have not been known as 'C' for a LONG time now
llvm-svn: 14392
2004-06-25 00:42:23 +00:00
Chris Lattner
ccd8ed145a Fix more warnings building with VC++
llvm-svn: 14391
2004-06-25 00:35:55 +00:00
Chris Lattner
6b9598db89 Unbreak the build. tsk tsk
llvm-svn: 14390
2004-06-25 00:18:02 +00:00
Tanya Lattner
23dbc8170c Made a fix so that you can print out MachineInstrs that belong to a MachineBasicBlock that is not yet attached to a MachineFunction. This change includes changing the third operand (TargetMachine) to a pointer for the MachineInstr::print function.
llvm-svn: 14389
2004-06-25 00:13:11 +00:00
Chris Lattner
521eb8752b fix warnings
llvm-svn: 14388
2004-06-25 00:11:25 +00:00
Misha Brukman
5e3afa0d4c Add option to print out machine code before register allocation.
llvm-svn: 14387
2004-06-24 23:55:01 +00:00
Misha Brukman
a79dd915b7 Use DEBUG() guard for printing out debug info.
llvm-svn: 14386
2004-06-24 23:54:05 +00:00
Misha Brukman
c45a5a369d Add a `break' in the switch/case statement between the int/fp sections.
llvm-svn: 14385
2004-06-24 23:53:24 +00:00
Misha Brukman
a08a2363ec * Lowercase the register names
* Parenthesize assert() expressions correctly
* Fix spacing around for() and if() statements

llvm-svn: 14384
2004-06-24 23:51:00 +00:00
Misha Brukman
3bac9e4430 Add a LowercaseString() utility function, courtesy of brg.
llvm-svn: 14383
2004-06-24 23:38:52 +00:00
Misha Brukman
c562342751 * LowercaseString moved to StringExtras.h
* Wrap long line to 80 cols

llvm-svn: 14382
2004-06-24 23:38:20 +00:00
Misha Brukman
842c710028 * Tabs to spaces
* Send an error message to std::cerr before abort()ing

llvm-svn: 14381
2004-06-24 23:19:36 +00:00
Reid Spencer
1c9d4f9678 Definition of the Bytecode Handler interface. Subclasses can override just
the methods they are interested in to perform out-of-band tasks while the
BytecodeReader is constructing a module. Handlers should *not* modify any
of the LLVM IR objects during this process.

llvm-svn: 14380
2004-06-24 23:05:07 +00:00
Misha Brukman
f62ee7a11b * Tabs to spaces
* Remove unnecessary parens, braces, clean up code layout

llvm-svn: 14379
2004-06-24 23:04:11 +00:00
Misha Brukman
9adccb6a50 Unindent some more code to be consistent.
llvm-svn: 14377
2004-06-24 22:00:15 +00:00
Misha Brukman
1e057bf1b7 Unindent some code, it only needs 2 spaces.
llvm-svn: 14376
2004-06-24 21:56:15 +00:00
Misha Brukman
29b3dd7d35 In emitting code for a GEP instr, iterate over GEPTypes because there is one
more operand in GEPOps than there are types in GEPTypes: the pointer that is the
first operand of the GEP instruction.

llvm-svn: 14375
2004-06-24 21:54:47 +00:00
Misha Brukman
1c9de4699a * Capitalize `Java'
* Sprinkle hypens liberally
* Fix some grammar in comments

llvm-svn: 14374
2004-06-24 21:47:35 +00:00
Misha Brukman
7d11fbf971 Convert tabs to spaces.
llvm-svn: 14373
2004-06-24 21:31:16 +00:00
Brian Gaeke
27966ba77b Add FSTOD and FDTOS conversion instructions.
llvm-svn: 14372
2004-06-24 21:22:09 +00:00
Brian Gaeke
72490c8d86 Support cast float to float, cast double to float, and cast float to double.
(It's not yet clear how to copy doubles from register to register.)

llvm-svn: 14371
2004-06-24 21:22:08 +00:00
Chris Lattner
c4f2252374 Add a section about running the nightly tester proper.
llvm-svn: 14370
2004-06-24 20:53:09 +00:00
Vikram S. Adve
463556f889 This file is unused, and duplicates functionality in TraceValues.cpp.
llvm-svn: 14369
2004-06-24 20:16:22 +00:00
Chris Lattner
b9df0c004a etags isn't portable at all. Make it not run by default. If you still
want it, just type 'make tags'

llvm-svn: 14368
2004-06-24 18:19:42 +00:00
Misha Brukman
f57c3cd1e8 * Order #includes
* Use the DEBUG() guard for debug printouts

llvm-svn: 14367
2004-06-24 17:31:42 +00:00
Brian Gaeke
eea4b17cf8 Make the double-fp pseudo registers be "NamedRegs".
llvm-svn: 14366
2004-06-24 09:23:21 +00:00
Brian Gaeke
2f6741f4f3 Fix a dyn_cast in copyConstantToRegister which should have been a cast.
Compactify the code that emits copies of constant ints into registers.

llvm-svn: 14365
2004-06-24 09:17:47 +00:00
Brian Gaeke
c605ae6754 The long integer pseudo-regs are history. So long, we hardly knew ye.
llvm-svn: 14364
2004-06-24 08:55:21 +00:00
Brian Gaeke
4ed2826ce5 Use correct add*Imm form in more BuildMI calls.
Fix bug in emitGEPOperation where we weren't passing MBB, IP to getReg.
(hey, wouldn't a constant expression lowering pass be cool? huh huhuhuh)
Fix bug in emitGEPOperation where we might try to OR a constant into a
register which was too big to fit in the immediate field.
Support and, or, xor of longs.

llvm-svn: 14363
2004-06-24 08:55:09 +00:00
Brian Gaeke
7777e66704 Rename the load and store opcodes. The non-fp ones only have one
variant worth worrying about; the fp ones have two.

llvm-svn: 14362
2004-06-24 07:37:12 +00:00
Brian Gaeke
c8e1b5abe8 Rename the load and store opcodes. The non-fp ones only have one
variant worth worrying about; the fp ones have two.
Add fp stores.

llvm-svn: 14361
2004-06-24 07:36:59 +00:00
Brian Gaeke
9f455efff1 Rename the load and store opcodes. The non-fp ones only have one
variant worth worrying about; the fp ones have two.
Stub out the case analysis of int-to-fp casts (no code yet).
I think the number of operands passed to BuildMI for loads was wrong.
Support load and store of float and double.

llvm-svn: 14360
2004-06-24 07:36:48 +00:00
Chris Lattner
5e08b93a34 Remove distasteful method which is really part of the indvars pass
llvm-svn: 14359
2004-06-24 06:52:20 +00:00
Chris Lattner
7a002d6010 Two fixes. First, stop using the ugly shouldSubstituteIndVar method.
Second, disable substitution of quadratic addrec expressions to avoid putting
multiplies in loops!

llvm-svn: 14358
2004-06-24 06:49:18 +00:00
Brian Gaeke
8863de761d Strange as it may sound, we'll not use LDD/STD to store longs. For reasons of
representational consistency, we want to address the halves of each 64-bit value
separately.

llvm-svn: 14356
2004-06-24 06:44:57 +00:00
Brian Gaeke
1e8cc73ea3 Support constant cast expressions.
llvm-svn: 14355
2004-06-24 06:33:00 +00:00
Brian Gaeke
ae6fb8ae5c Make the most commonly preselected instructions add to the names of the
instructions they augment, instead of replacing them.  It's good for debugging,
and it's OK for the sparcv9 backend.

llvm-svn: 14353
2004-06-23 21:41:32 +00:00
Misha Brukman
8604fde39d TransformUtils library is no longer needed since Linker.cpp is in VMCore
llvm-svn: 14352
2004-06-23 17:36:17 +00:00
Misha Brukman
28ee8f0f30 Linker.h moved to include/llvm/Support
llvm-svn: 14351
2004-06-23 17:33:09 +00:00
Misha Brukman
aff11a1001 Moved to include/llvm/Support
llvm-svn: 14350
2004-06-23 17:24:53 +00:00
Misha Brukman
09f04aa331 Linker.h moved to include/llvm/Support
llvm-svn: 14349
2004-06-23 17:24:31 +00:00
Misha Brukman
49bb82a4b8 Moved to lib/VMCore
llvm-svn: 14348
2004-06-23 17:21:17 +00:00
Reid Spencer
250b03184a Move the tests for readability of the template and gnuplot files so they
occur AFTER the source is checked out. This ensures that if either of the
-gnuplotscript or -templatefile options are not given, that they get picked
up from the checkout directory and don't abort the test unnecessarily.

llvm-svn: 14346
2004-06-23 14:07:12 +00:00
Reid Spencer
2e44d8748c Added a -noexternals options to avoid performing the externals tests on
test environments that don't have Povray or SPEC.

llvm-svn: 14345
2004-06-23 07:45:46 +00:00
Reid Spencer
64889c65e5 Make sure GetRegEx returns something gnuplot can deal with (a number, not
a ?) so that graphs don't bail if something fails in a test.

llvm-svn: 14344
2004-06-23 06:36:34 +00:00
Reid Spencer
3a4916ea32 Added a note about the new llvmgrep utility.
llvm-svn: 14343
2004-06-23 06:33:15 +00:00
Chris Lattner
0441388aff Fix merging of nodes whose incoming offset is not zero. This unbreaks DSA on
several mallocbench programs, including perl.

llvm-svn: 14342
2004-06-23 06:29:59 +00:00
Brian Gaeke
1ea8447089 Use new IsNAN() wrapper.
llvm-svn: 14340
2004-06-23 00:25:35 +00:00
Brian Gaeke
a9a9696767 Provide prototypes for IsNAN() wrapper.
llvm-svn: 14339
2004-06-23 00:25:24 +00:00
Brian Gaeke
ef178a43dd Wrapper for c99 isnan()
llvm-svn: 14338
2004-06-22 23:54:38 +00:00
Brian Gaeke
e9a33a8ff3 Regenerated.
It looks to me like people haven't been running AutoRegen.sh. Grumble grumble.

llvm-svn: 14337
2004-06-22 23:47:23 +00:00
Brian Gaeke
c77683ce1a Regenerated.
llvm-svn: 14336
2004-06-22 23:47:13 +00:00
Brian Gaeke
bc9bff960a Call custom check (AC_FUNC_ISNAN) instead of using the generic function check.
llvm-svn: 14335
2004-06-22 23:43:04 +00:00
Brian Gaeke
ba798f12d7 Implement isnan check (AC_FUNC_ISNAN) in terms of three calls to a fairly
generic macro AC_SINGLE_CXX_CHECK.

llvm-svn: 14334
2004-06-22 23:42:49 +00:00
John Criswell
3c99d0cc85 Added the llvm/test/Programs/Makefile.test Makefile.
Added a check for isnan() while I was at it.

llvm-svn: 14333
2004-06-22 21:35:10 +00:00
Brian Gaeke
5825bdd8b2 Add pseudo-registers and register class for 64-bit integer values.
llvm-svn: 14332
2004-06-22 20:14:41 +00:00
Brian Gaeke
255f1e1f88 link to qmtest-2.0.3 tar file
llvm-svn: 14331
2004-06-22 19:06:49 +00:00
Misha Brukman
44601805a6 File requires IPA, moved to lib/Analysis/IPA
llvm-svn: 14330
2004-06-22 19:04:53 +00:00
Misha Brukman
6c2cf08981 Mention a note about having gccas and gccld in the path when running llvm-gcc.
llvm-svn: 14328
2004-06-22 18:48:58 +00:00
Misha Brukman
c5300a4f04 File depends on MemoryDepAnalysis (DSA); moved to lib/Analysis/DataStructure
llvm-svn: 14327
2004-06-22 18:28:37 +00:00
Misha Brukman
df6339bee7 Files depend on DSA, moved to lib/Analysis/DataStructure
llvm-svn: 14326
2004-06-22 18:13:24 +00:00
Misha Brukman
ddc90adca3 File depends on DSA, moved to lib/Analysis/DataStructure
llvm-svn: 14325
2004-06-22 18:11:38 +00:00
Misha Brukman
cec9d0bcad Making an archive version of the CodeGen library is unnecessary if we just
move InstructionLowering itself.

llvm-svn: 14324
2004-06-22 17:52:30 +00:00
Misha Brukman
be667731ae Provide archive version of CodeGen library (for those tools that only need
IntrinsicLowering, for instance).

llvm-svn: 14323
2004-06-22 17:28:43 +00:00
Chris Lattner
f4dc3fd26e Isnan became unordered
llvm-svn: 14322
2004-06-22 16:13:57 +00:00
Reid Spencer
7b27d08aa9 - Added the -nice option for nicing the build processes.
- Added the -gnuplotscript option to specify the GnuPlot script to use.
- Added the -templatefile option to specify the HTML template to use.
- Moved subroutines to top of file.
- Used variables for file names in case we want to change to directories.
- Made program track its directory changes in $VERBOSE mode (for debugging)
- Added variables to support tracking start time, finish time, and platform
  details about each nightly test.

llvm-svn: 14321
2004-06-22 15:38:37 +00:00
Misha Brukman
c403338007 Regenerated with autoconf-2.57 for AIX detection support.
llvm-svn: 14320
2004-06-22 15:35:32 +00:00
Misha Brukman
fe16ae23c9 Add AIX to the list of recognized operating systems.
llvm-svn: 14319
2004-06-22 15:32:08 +00:00
Reid Spencer
3e8722fd9d Added start time, finish time, and platform (uname -a output) information
to the top of the template for identification purposes.

llvm-svn: 14318
2004-06-22 15:32:02 +00:00
Tanya Lattner
f31fdf895b Fixing broken links
llvm-svn: 14317
2004-06-22 08:02:25 +00:00
Chris Lattner
881d959fd4 If an edge points to a field of another memory object, actually reflect this
in the DOT visualization of the DSGraphs.

llvm-svn: 14316
2004-06-22 07:13:10 +00:00
Tanya Lattner
70d53125db Removed extra href close tag
llvm-svn: 14315
2004-06-22 05:44:31 +00:00
Chris Lattner
b449daeaf0 Elimiante ^M's
llvm-svn: 14314
2004-06-22 04:47:34 +00:00
Tanya Lattner
8ed32be935 Fixed broken links.
llvm-svn: 14313
2004-06-22 04:24:55 +00:00
Tanya Lattner
ce33a1bea0 Fixing broken link to gcc manual
llvm-svn: 14312
2004-06-22 03:48:17 +00:00
Chris Lattner
cf237fc684 test/Libraries have been long gone for a long time now. Since noone noticed
tehse were broken, just nuke them.

llvm-svn: 14310
2004-06-22 02:26:33 +00:00
Tanya Lattner
31d8921d1d Changing absolute link. Remembering to logout as root ;)
llvm-svn: 14309
2004-06-21 23:36:39 +00:00
Tanya Lattner
c197980246 Fixed small typo to symtab link.
llvm-svn: 14308
2004-06-21 23:29:40 +00:00
Tanya Lattner
c0b271710c Just a stub command guide for llvm-db for now. Will be filled in later. This is not linked off the main command guide web page, but should be once its completed.
llvm-svn: 14307
2004-06-21 23:27:57 +00:00
Chris Lattner
53e5e2accc Fix some broken links
llvm-svn: 14306
2004-06-21 22:52:48 +00:00
Misha Brukman
31f4df6b54 Order #includes as per style guide.
llvm-svn: 14305
2004-06-21 21:54:40 +00:00
Misha Brukman
a6619a9c3e 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
Misha Brukman
96041e58b9 Direct declaration of namespace-ified globals does not work, must enclose
them with a namespace declaration.

llvm-svn: 14303
2004-06-21 21:44:12 +00:00
Misha Brukman
d0bf6f17d1 Specify variables' namespace directly instead of using an enclosing namespace.
llvm-svn: 14302
2004-06-21 21:21:49 +00:00
Misha Brukman
0bfea680bb Move implemented interface header up to the top.
llvm-svn: 14301
2004-06-21 21:20:23 +00:00
Misha Brukman
c88c1ba066 Spell out `NoFramePointerElim'.
llvm-svn: 14300
2004-06-21 21:18:48 +00:00
Misha Brukman
c22299d21b Spell out `NoFramePointerElim' for readability.
llvm-svn: 14299
2004-06-21 21:17:44 +00:00
Misha Brukman
5cb198a9c6 Use the common `NoFPElim' setting instead of our own.
llvm-svn: 14298
2004-06-21 21:10:24 +00:00
Misha Brukman
069ca067e1 Implement `NoFPElim' in a target-agnostic fashion so it can be shared.
llvm-svn: 14297
2004-06-21 21:08:45 +00:00
Misha Brukman
ebfd11ffb7 Make a single `NoFPElim' switch available to all targets.
llvm-svn: 14296
2004-06-21 21:07:51 +00:00
Misha Brukman
5e323e10df * Make indentation consistent at 2 chars
* Doxygenify function comments
* Wrap code at 80 cols

llvm-svn: 14295
2004-06-21 20:22:03 +00:00
Misha Brukman
a97f29237e This file is no longer applicable.
llvm-svn: 14294
2004-06-21 20:17:41 +00:00
Misha Brukman
cba6532e05 Let's be consistent: listing format `os/arch'.
llvm-svn: 14293
2004-06-21 18:43:23 +00:00
Misha Brukman
302df232b5 llvm/IntrinsicLowering.h => llvm/CodeGen/IntrinsicLowering.h
llvm-svn: 14292
2004-06-21 18:30:31 +00:00
Misha Brukman
6752fb58b6 Handle shifts >= 32 bits.
llvm-svn: 14291
2004-06-21 18:01:47 +00:00
Misha Brukman
11f74d7072 Intrinsic::isnan has gone away, support for it commented out.
Intrinsic::isunordered has arrived, and we just use the standard lowering
pass for it.

llvm-svn: 14290
2004-06-21 17:58:36 +00:00
Misha Brukman
c3a0b330c9 Convert tabs to spaces.
llvm-svn: 14289
2004-06-21 17:41:12 +00:00
Misha Brukman
254d2cf452 Type::getPrimitiveID() -> getTypeID()
llvm-svn: 14288
2004-06-21 17:25:55 +00:00
Misha Brukman
6292a056a8 Type::getPrimitiveID() -> getTypeID()
llvm-svn: 14287
2004-06-21 17:19:08 +00:00
Misha Brukman
e05203fb40 Initial revision
llvm-svn: 14283
2004-06-21 16:55:25 +00:00
Misha Brukman
e54cbdd478 Mention the requirement of dlcompat for MacOS X.
llvm-svn: 14282
2004-06-21 14:00:44 +00:00
Chris Lattner
4fbff990b0 Rename Interval class to LiveInterval to avoid conflicting with the already
existing llvm::Interval class.

Patch contributed by Vladimir Prus!
http://mail.cs.uiuc.edu/pipermail/llvmbugs/2004-June/000710.html

llvm-svn: 14281
2004-06-21 13:10:56 +00:00
Chris Lattner
265eb6469a 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
Reid Spencer
afd6bfe736 Nullify this test as it causes infinite loop in optimized nightly test.
llvm-svn: 14279
2004-06-21 08:11:32 +00:00
Chris Lattner
f12c4a3d37 *FINALLY* Fix a really nasty nondeterministic bug that has been haunting us
since May 1st.  In this code, the pred iterator was being invalidated sometimes
causing the wrong entries to be added to PHI nodes.

The fix for this is to defererence and safe the *PI value before we hack on
branch instructions, which changes use/def chains, which SOMETIMES invalidates
the iterator.

llvm-svn: 14278
2004-06-21 07:19:01 +00:00
Chris Lattner
46f60890a3 Comment out the isnan stuff until we get a proper autoconf test for it
breaking the build on sparc is not acceptable.

llvm-svn: 14277
2004-06-21 06:17:21 +00:00
Chris Lattner
1c676f76b6 Make order of argument addition deterministic. In particular, the layout
of ConstantInt objects in memory used to determine which order arguments
were added in in some cases.

llvm-svn: 14276
2004-06-21 00:07:58 +00:00
Chris Lattner
baaed7ee90 REALLY fix PR378: crash in scalar evolution analysis
llvm-svn: 14275
2004-06-20 20:32:16 +00:00
Reid Spencer
ca578611cc Added a note about requiring QMTest 2.0.3 instead of any other version.
llvm-svn: 14274
2004-06-20 19:21:11 +00:00
Chris Lattner
b7a6a33ca9 Bug fixed
llvm-svn: 14273
2004-06-20 19:08:50 +00:00
Chris Lattner
6bfca8f5f1 Fix a bug in my change last night that caused a few test failures.
llvm-svn: 14270
2004-06-20 17:01:44 +00:00
Chris Lattner
5004e09ad2 IntrinsicLowering.cpp now lives in lib/CodeGen/
llvm-svn: 14269
2004-06-20 07:59:27 +00:00
Chris Lattner
58559b370a Update path
llvm-svn: 14268
2004-06-20 07:53:22 +00:00
Chris Lattner
243561d74b Header moved into the CodeGen directory
llvm-svn: 14267
2004-06-20 07:50:32 +00:00
Chris Lattner
bcdadf3765 Move the IntrinsicLowering header into the CodeGen directory, as per PR346
llvm-svn: 14266
2004-06-20 07:49:54 +00:00
Chris Lattner
4c96b0883f Move the IntrinsicLowering header into the CodeGen directory
llvm-svn: 14265
2004-06-20 07:46:18 +00:00
Chris Lattner
5f142cfc4d Start moving IntrinsicLowering out of VMCore into libcodegen, as per PR346
llvm-svn: 14264
2004-06-20 07:40:46 +00:00
Chris Lattner
eb3e84078d Do not sort SCEV objects by address: instead sort by complexity and group
by address.  This prevents the resultant SCEV objects from depending on
where in memory other scev objects happen to live.

llvm-svn: 14263
2004-06-20 06:23:15 +00:00
Chris Lattner
c9e06336ab Make use of BinaryOperator::create* methods to shrinkify code.
llvm-svn: 14262
2004-06-20 05:04:01 +00:00
Chris Lattner
e6115e471c Add methods like BinaryOperator::createAdd that take an instruction to insert
before.

llvm-svn: 14261
2004-06-20 05:02:56 +00:00
Chris Lattner
7d30a6c145 Fix the inliner to be deterministic, not letting its output depend on the
relative location of Function objects in memory.

llvm-svn: 14260
2004-06-20 04:11:48 +00:00
Chris Lattner
d537eb1264 Make fpcmp handle running off of the beginning or end of the file correctly.
llvm-svn: 14259
2004-06-20 03:12:18 +00:00
Chris Lattner
9734fd0980 Add some DEBUG output to the simplifycfg routines
Fix another non-deterministic behavior, this one should actually speed up the
code though as it was doing silly things.

llvm-svn: 14258
2004-06-20 01:13:18 +00:00
Reid Spencer
0277fd7b44 A utility to search the LLVM source tree for a grep pattern. This is a
replacement for getsrcs.sh which now generates too much text to put on a
Linux command line. The approach taken with llvmgrep is to execute a find
command and execute a grep on each file that matches the name pattern. The
arguments to this script are the same as those of egrep. Note that the -H
and -n options to egrep will always be passed so that you always get the
file and line number of matches.

llvm-svn: 14255
2004-06-19 20:32:55 +00:00
Chris Lattner
42ad646104 Now that dominator tree children are built in determinstic order, this horrible code
can go away

llvm-svn: 14254
2004-06-19 20:23:35 +00:00
Chris Lattner
39396e2df9 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
89f803bb32 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
940b7ba5ad This will hopefully fix a heisenbug that Vladimir Merzliakov is running
into valiantly trying to compile stuff on freebsd.

llvm-svn: 14251
2004-06-19 19:01:26 +00:00
Reid Spencer
006b386e6f Add a note about GCC 3.3.2 optimization bug that causes llc to spin.
llvm-svn: 14250
2004-06-19 18:24:05 +00:00
Chris Lattner
4027500e1c Fix a nasty bug, noticed by Reid
llvm-svn: 14249
2004-06-19 18:15:50 +00:00
Chris Lattner
ec2d34cc19 Fix one source of nondeterminism in the -licm pass: the hoist pass
was processing blocks in whatever order they happened to end up in the
dominator tree data structure.  Force an ordering.

llvm-svn: 14248
2004-06-19 08:56:43 +00:00
Chris Lattner
4db0f8260a Change to use the StableBasicBlockNumbering class
llvm-svn: 14247
2004-06-19 08:42:40 +00:00
Chris Lattner
d31410d824 Initial checkin of the StableBasicBlockNumbering, a little helper class for computing
(strangely enough) a stable (determinstic) numbering for basic blocks.

llvm-svn: 14246
2004-06-19 08:41:59 +00:00
Chris Lattner
feda9d0583 Fix a tiny bug in the -no-aa pass, in which it did not ever get a target data.
This is a regression from 1.2, though noone uses -no-aa anyway

llvm-svn: 14245
2004-06-19 08:05:58 +00:00
Chris Lattner
a52ab6f57f Do not let the numbering of PHI nodes placed in the function depend on
non-deterministic things like the ordering of blocks in the dominance
frontier of a BB.  Unfortunately, I don't know of a better way to solve
this problem than to explicitly sort the BB's in function-order before
processing them.  This is guaranteed to slow the pass down a bit, but
is absolutely necessary to get usable diffs between two different tools
executing the mem2reg or scalarrepl pass.

Before this, bazillions of spurious diff failures occurred all over the
place due to the different order of processing PHIs:

-       %tmp.111 = getelementptr %struct.Connector_struct* %upcon.0.0, uint 0, uint 0
+       %tmp.111 = getelementptr %struct.Connector_struct* %upcon.0.1, uint 0, uint 0

Now, the diffs match.

llvm-svn: 14244
2004-06-19 07:40:14 +00:00
Chris Lattner
b2b151d297 Do not sort by the address of LLVM ConstantInt* objects. This produces
nondeterministic results that depend on where these objects land in memory.
Instead, sort by the value of the constant, which is stable.

Before this patch, the -simplifycfg pass run from two different compilers
could cause different code to be generated, though it was semantically the
same:

@@ -12258,8 +12258,8 @@
        %s_addr.1 = phi sbyte* [ %s, %entry ], [ %inc.0, %no_exit ]             ; <sbyte*> [#uses=5]
        %tmp.1 = load sbyte* %s_addr.1          ; <sbyte> [#uses=1]
        switch sbyte %tmp.1, label %no_exit [
-                sbyte 0, label %loopexit
                 sbyte 46, label %loopexit
+                sbyte 0, label %loopexit
        ]

We need to stomp all of this stuff out.

llvm-svn: 14243
2004-06-19 07:02:14 +00:00
Chris Lattner
b5f8eb8315 Do not loop over uses as we delete them. This causes iterators to be
invalidated out from under us.  This bug goes back to revision 1.1: scary.

llvm-svn: 14242
2004-06-19 02:02:22 +00:00
Chris Lattner
2ef024b2c2 Bug fixed
llvm-svn: 14241
2004-06-19 01:11:02 +00:00
Chris Lattner
649154cace Test for PR374
llvm-svn: 14240
2004-06-19 01:08:12 +00:00
Misha Brukman
0bca699edd Fix relative link to the CVS mirrors.
llvm-svn: 14239
2004-06-18 20:18:31 +00:00
Chris Lattner
8c470182bb Add link to the CVS mirror hosted by Reid
llvm-svn: 14238
2004-06-18 20:15:58 +00:00
Misha Brukman
5f056c78c1 Add link documenting shared/static library differences across platforms.
llvm-svn: 14237
2004-06-18 18:39:00 +00:00
Chris Lattner
3daf984f71 Bug fixed
llvm-svn: 14236
2004-06-18 17:57:29 +00:00
Misha Brukman
35d842e75f Capitalize Cygwin.
llvm-svn: 14235
2004-06-18 15:54:54 +00:00
Misha Brukman
4b58581545 * Fix file header and name
* Order #includes alphabetically

llvm-svn: 14234
2004-06-18 15:38:49 +00:00
Misha Brukman
42a24823a1 Use the machine-independent method of querying the page size.
llvm-svn: 14233
2004-06-18 15:34:07 +00:00
Misha Brukman
5d87550ba7 Add a target-independent way to query page size.
llvm-svn: 14232
2004-06-18 15:30:25 +00:00
Brian Gaeke
5b433a5de9 .zero doesn't work in the Solaris assembler.
llvm-svn: 14231
2004-06-18 08:59:16 +00:00
Brian Gaeke
4125c92009 Get rid of selects the easy way
llvm-svn: 14230
2004-06-18 08:46:15 +00:00
Brian Gaeke
694f7b78d9 Make visitAllocaInst() look more like its X86 counterpart.
llvm-svn: 14229
2004-06-18 08:45:52 +00:00
Brian Gaeke
fcc30aca1b Mess around with allocation order. In particular, I think we ought to be
using the local & in regs first because they are not clobbered by calls.

llvm-svn: 14228
2004-06-18 08:19:08 +00:00
Brian Gaeke
b42345811e JMPL has a delay slot.
llvm-svn: 14227
2004-06-18 08:18:54 +00:00
Brian Gaeke
7d9af983de Clean up the commented-out F3_3 stuff.
Replace it with a working class for FP instrs.

llvm-svn: 14226
2004-06-18 06:28:21 +00:00
Brian Gaeke
75f3738969 Fix jmpl.
Add some FP moves.

llvm-svn: 14225
2004-06-18 06:28:10 +00:00
Brian Gaeke
12ee9a1e75 Support printing base+offset pairs where the offset is a register.
Use this for printing the jmpl indirect-call instruction.

llvm-svn: 14224
2004-06-18 06:27:59 +00:00
Brian Gaeke
5ebab28a8a Support intrinsic calls (although no particular intrinsics are supported yet).
Support indirect calls.
Support returning a float value.

llvm-svn: 14223
2004-06-18 06:27:48 +00:00
Chris Lattner
b7c4bac617 Calls to __builtin_isunordered and friends no longer cause llvmgcc to ICE.
llvm-svn: 14222
2004-06-18 06:26:29 +00:00
Chris Lattner
023a483c76 Implement Transforms/InstCombine/and.ll:test17, a common case that
occurs due to unordered comparison macros in math.h

llvm-svn: 14221
2004-06-18 06:07:51 +00:00
Chris Lattner
d5829aac27 New test
llvm-svn: 14220
2004-06-18 06:07:17 +00:00
Chris Lattner
1e1abdd6ed Do not function resolve intrinsics. This prevents warnings and possible bad
things from happening due to

declare bool %llvm.isunordered(double, double)
declare bool %llvm.isunordered(float, float)

llvm-svn: 14219
2004-06-18 05:50:48 +00:00
Chris Lattner
b62fa74253 Test that C99 unordered comparison functions are not being turned into libc calls
llvm-svn: 14218
2004-06-18 05:42:50 +00:00
Brian Gaeke
51d3c7b05b Add load instructions for floating-point registers.
llvm-svn: 14217
2004-06-18 05:19:27 +00:00
Brian Gaeke
21305c6f0c Support alloca instructions.
Support copying floating-point constants to registers.
Add assertion to visitCallInst to abort if we hit a NULL calledFunction, for now.

llvm-svn: 14216
2004-06-18 05:19:16 +00:00
Chris Lattner
fdf197ff6e Fix printing of Argument objects, problem found by Patrick Meredith
llvm-svn: 14215
2004-06-18 04:07:20 +00:00
Chris Lattner
388f43ac3d New testcase for GCC unordered comparison builtins
llvm-svn: 14214
2004-06-18 03:39:56 +00:00
Chris Lattner
aa27623b99 Codegen sub C, X a little bit better for register pressure. Instead of
mov REG, C
sub REG, X

generate:

neg X
add X, C

which uses one less reg

llvm-svn: 14213
2004-06-18 00:50:37 +00:00
Chris Lattner
b30d12292a Fold setcc instructions into select and branches that are not in the same BB as
the setcc.

llvm-svn: 14212
2004-06-18 00:29:22 +00:00
Brian Gaeke
c37af629b4 Make storeRegToStackSlot slightly shorter.
Make copyRegToReg return 1 instead of -1.
Edit a comment in emitPrologue().

llvm-svn: 14211
2004-06-17 22:34:48 +00:00
Brian Gaeke
eca9546dc3 Set the isBranch and isTerminator flags on branch instructions correctly.
Add a FIXME about the (currently unused) JMPL instructions.

llvm-svn: 14210
2004-06-17 22:34:29 +00:00
Brian Gaeke
63c1d6eda8 Emit stores correctly; don't fail an assertion.
llvm-svn: 14209
2004-06-17 22:34:19 +00:00
Brian Gaeke
c4ee938f55 Support generating machine instructions for Phi nodes (based on x86, but with
modifications for 1 LLVM BB --> many MBBs).
Fix store operand order: make it always be Base, Offset, SrcReg (think
"[ Base + Offset ] = SrcReg").
Rewrite visitBranchInst() to be even dumber (but working) -- give up on
the branch fallthrough trick, for the time being.
Make visitSetCondInst() work.

llvm-svn: 14208
2004-06-17 22:34:08 +00:00
Brian Gaeke
a067fb3e6b Recognize more branches.
llvm-svn: 14207
2004-06-17 22:33:57 +00:00
Brian Gaeke
27b13253d9 I love the smell of a freshly broken PowerPC build in the morning.
llvm-svn: 14206
2004-06-17 22:27:04 +00:00
Brian Gaeke
4300ca9d32 Make debugging dumps w/ multiple MachineBBs for a given LLVM BB readable.
llvm-svn: 14205
2004-06-17 22:26:53 +00:00
Chris Lattner
7887da36de Do not fold loads into instructions if it is used more than once. In particular
we do not want to fold the load in cases like this:

  X = load
    = add A, X
    = add B, X

llvm-svn: 14204
2004-06-17 22:15:25 +00:00
Chris Lattner
f03f320b79 Fix compilation problem on freebsd. Problem noted by Vladimir Merzliakov in
PR371

llvm-svn: 14203
2004-06-17 21:20:52 +00:00
Brian Gaeke
2f2b5f5b93 Use addGlobalAddress and addMBB for call & branch targets instead of addPCDisp.
Abort if we see a PCRelativeDisp MachineOperand, to be safe. This matches
the X86 backend.

llvm-svn: 14202
2004-06-17 19:39:23 +00:00
Chris Lattner
6b7275996c Rename Type::PrimitiveID to TypeId and ::getPrimitiveID() to ::getTypeID()
llvm-svn: 14201
2004-06-17 18:19:28 +00:00
Chris Lattner
97bfcea262 Rename Type::PrimitiveID to TypeId and ::getPrimitiveID() to ::getTypeID()
Delete two functions that are now methods on the Type class

llvm-svn: 14200
2004-06-17 18:16:02 +00:00
Chris Lattner
395e219a1c Minor cleanup
llvm-svn: 14199
2004-06-17 17:56:54 +00:00
Misha Brukman
b8561ebf21 Make header comment fit within 80 cols.
llvm-svn: 14198
2004-06-17 15:49:36 +00:00
Misha Brukman
a1237d00d6 Since the Great LLVM Tool Renaming(tm), we no longer have collisions between our
assembler/linker and the system equivalents.

llvm-svn: 14197
2004-06-17 15:39:58 +00:00
Brian Gaeke
661963c63f Fix typo in DEBUG printout.
llvm-svn: 14196
2004-06-17 07:26:52 +00:00
Chris Lattner
6f4a596234 Fix a recent regression in Applications/sgefa that Alkis pointed out to me.
The vector may actually be empty if the register that we are marking as
recently used is not actually allocatable.  This happens for physical registers
that are not allocatable, like the ST(x) registers on X86.

llvm-svn: 14195
2004-06-16 06:57:29 +00:00
Brian Gaeke
3b9474ecd7 Add int ferror(FILE *)
llvm-svn: 14194
2004-06-16 02:56:40 +00:00
Brian Gaeke
f6920d6f34 I'm afraid this doesn't exist.
llvm-svn: 14193
2004-06-16 00:26:45 +00:00
Brian Gaeke
20e09e5c7b Um, did someone make a typo or something?
llvm-svn: 14192
2004-06-15 23:09:50 +00:00
Chris Lattner
fbf4dc3bd0 isnan is dead
llvm-svn: 14191
2004-06-15 21:52:58 +00:00
Chris Lattner
f64f794cad llvm.isnan is dead, long live llvm.isunordered!
llvm-svn: 14190
2004-06-15 21:50:46 +00:00
Chris Lattner
7011d35594 Remove support for llvm.isnan. Alkis wins :)
llvm-svn: 14189
2004-06-15 21:48:07 +00:00
Chris Lattner
ee92bfca97 This testcase is a bit silly now, but oh well :)
llvm-svn: 14188
2004-06-15 21:46:16 +00:00
Chris Lattner
de2f567a20 Remove isnan support, correct isunordered support
llvm-svn: 14187
2004-06-15 21:42:23 +00:00
Chris Lattner
5a542aadc8 Remove support for the isnan intrinsic
llvm-svn: 14186
2004-06-15 21:37:54 +00:00
Chris Lattner
70dfc06e02 Add basic support for the isunordered intrinsic. The isnan stuff still needs to go
llvm-svn: 14185
2004-06-15 21:36:44 +00:00
Chris Lattner
75bcc59f1c Right, stop being silly
llvm-svn: 14184
2004-06-15 21:29:40 +00:00
Chris Lattner
ce4ac095f0 Add a nan, stop testing isnan
llvm-svn: 14183
2004-06-15 21:29:01 +00:00
Brian Gaeke
476c73b241 Fix thinko in visitor... ShiftInsts should currently be delegated
to visitBinaryOperator.

llvm-svn: 14182
2004-06-15 21:09:46 +00:00
Chris Lattner
b1f0478f1d 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
Brian Gaeke
675c0e9701 I think we'll use the standard lowering passes for now.
llvm-svn: 14179
2004-06-15 20:37:12 +00:00
Brian Gaeke
0c8ee30d53 Fix bug generating code for void call instructions: don't call
getReg() on void value.

llvm-svn: 14178
2004-06-15 20:06:32 +00:00
Brian Gaeke
065a6cb93a Squash a warning from the Solaris assembler by aligning the stack
on a double-word boundary instead of a single-word boundary.

llvm-svn: 14177
2004-06-15 19:53:10 +00:00
Brian Gaeke
ad98a9b526 Allow special-casing of operand printing based on opcode. Print
non-register, non-immed. arguments to SETHI and OR using %hi() and
%lo() respectively.

llvm-svn: 14176
2004-06-15 19:52:59 +00:00
Brian Gaeke
19fbd28a06 Support constant GEP expressions.
Support copying long constants to register pairs.
Support copying ConstantPointerNulls and ConstantPointerRefs to registers.

llvm-svn: 14175
2004-06-15 19:16:07 +00:00
Misha Brukman
342693e35b The correct prototype is `int atoi(CONST char*)'. Unbroke AIX build.
llvm-svn: 14173
2004-06-14 16:30:05 +00:00
Misha Brukman
bba0f0e492 Add file comment.
llvm-svn: 14172
2004-06-14 15:13:59 +00:00
Brian Gaeke
21370771ba Quick hack to get this file compiling again on Mac OS X. The right thing to do
is write an autoconf macro that checks whether __isnan or isnan actually works
**using the C++ compiler after #include <cmath>**, instead of doing it the easy
way with AC_CHECK_FUNCS().

llvm-svn: 14171
2004-06-14 06:33:19 +00:00
Brian Gaeke
99c6539bce Make -print-machineinstrs even stronger. You get to see the final code after
peepholing, and make it work the same way in the JIT as in LLC.

llvm-svn: 14170
2004-06-14 05:05:45 +00:00
Reid Spencer
d5a21b0575 Get rid of "might be uninitialized" warnings when compiling with GCC 3.3.2
llvm-svn: 14169
2004-06-13 19:17:49 +00:00
Alkis Evlogimenos
e395468ae5 Add constant folding capabilities to the isunordered intrinsic.
llvm-svn: 14168
2004-06-13 01:23:56 +00:00
Alkis Evlogimenos
0fa392310a Really add the docs this time :-)
llvm-svn: 14167
2004-06-13 01:16:15 +00:00
Alkis Evlogimenos
cf9f8f1762 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
9d740629a0 Add the isunordered intrinsic.
llvm-svn: 14159
2004-06-12 19:19:14 +00:00
Reid Spencer
0a70ceb55f Reduce the number of columns in the alpha index to 4 so that it fits
on a 1280x1024 screen!

llvm-svn: 14158
2004-06-12 14:46:02 +00:00
Chris Lattner
27f44fe1f8 It is no longer 2001
llvm-svn: 14157
2004-06-11 21:12:22 +00:00
Brian Gaeke
787ed2f377 Don't trim @PrevDays (causing an error) if it isn't long enough.
llvm-svn: 14156
2004-06-11 19:55:30 +00:00
Misha Brukman
fb35b09738 Fix grammar: 's is for possessive only.
llvm-svn: 14155
2004-06-11 16:50:21 +00:00
Reid Spencer
c0999e134e Implement tracking of bytecode instruction size and the number of long
instructions generated.

llvm-svn: 14154
2004-06-11 15:10:38 +00:00
Reid Spencer
80ae844ea8 Add two options to the program:
-release causes ENABLE_OPTIMIZED=1 to be added to the make line so that
         the test runs against optimized code.
-pedantic causes the CompileOptimizeOpts variable to be overridden to
          add several additional warnings not picked up by -Wall. This
	  should help catch additional programming faux pas. See the diff
	  for the specific details.

llvm-svn: 14153
2004-06-11 07:06:22 +00:00
Chris Lattner
5888b5d4b1 Fix fallout from getOffsetOfLocalArea() being negated. Debugging dumps were being
printed incorrectly, and we were reserving 8 extra bytes of stack space for functions
on X86.

llvm-svn: 14152
2004-06-11 06:37:11 +00:00
Chris Lattner
66f313725c llvm.isnan doesn't access memory
llvm-svn: 14151
2004-06-11 06:17:13 +00:00
Chris Lattner
ec941f7abb Constant fold the isnan intrinsic
llvm-svn: 14150
2004-06-11 06:16:23 +00:00
Chris Lattner
b82f707e30 Add tests for isnan
llvm-svn: 14149
2004-06-11 06:16:13 +00:00
Chris Lattner
1c2be0e5a9 By far, one of the most common uses of isnan is to make 'isunordered'
comparisons.  In an 'isunordered' predicate, which looks like this at
the LLVM level:

        %a = call bool %llvm.isnan(double %X)
        %b = call bool %llvm.isnan(double %Y)
        %COM = or bool %a, %b

We used to generate this code:

        fxch %ST(1)
        fucomip %ST(0), %ST(0)
        setp %AL
        fucomip %ST(0), %ST(0)
        setp %AH
        or %AL, %AH

With this patch, we generate this code:

        fucomip %ST(0), %ST(1)
        fstp %ST(0)
        setp %AL

Which should make alkis happy.  Tested as X86/compare_folding.llx:test1

llvm-svn: 14148
2004-06-11 05:33:49 +00:00
Chris Lattner
858cb55a5c Test that the X86 backend is only emitting one fucom instruction
for each 'COM =' line.

llvm-svn: 14147
2004-06-11 05:30:34 +00:00
Chris Lattner
71186e2fb6 Fix bug in previous checkin
llvm-svn: 14146
2004-06-11 05:22:44 +00:00
Chris Lattner
5ed9113e14 No really, these are dead now
llvm-svn: 14145
2004-06-11 04:50:14 +00:00
Chris Lattner
b35f47627d Now that compare instructions aren't lumped in with the other twoargfp instructions,
we can get rid of the FpUCOM/FpUCOMi pseudo instructions, which makes stuff simpler
and faster.

llvm-svn: 14144
2004-06-11 04:49:02 +00:00
Chris Lattner
0876edf122 Introduce a new FP instruction type to separate the compare cases from the
twoarg cases.

llvm-svn: 14143
2004-06-11 04:41:24 +00:00
Chris Lattner
4e71aa84d5 Bug fixed, new feature
llvm-svn: 14142
2004-06-11 04:35:21 +00:00
Chris Lattner
26a964f88e Add direct support for the isnan intrinsic, implementing test/Regression/CodeGen/X86/isnan.llx
testcase

llvm-svn: 14141
2004-06-11 04:31:10 +00:00
Chris Lattner
a0cfedef3a Add support for the setp instructions
llvm-svn: 14140
2004-06-11 04:30:06 +00:00
Chris Lattner
94ff2c3210 Split compare instruction handling OUT of handleTwoArgFP into handleCompareFP.
This makes the code much simpler, and the two cases really do belong apart.
Once we do it, it's pretty obvious how flawed the logic was for A != A case,
so I fixed it (fixing PR369).

This also uses freeStackSlotAfter instead of inserting an fxchg then
popStackAfter'ing in the case where there is a dead result (unlikely, but
possible), producing better code.

llvm-svn: 14139
2004-06-11 04:25:06 +00:00
Reid Spencer
95290c7d33 Change tags rule to pipe output from find through etags command so that it
doesn't break on machines with limited command line lengths.

llvm-svn: 14138
2004-06-11 03:10:27 +00:00
Reid Spencer
c22be9f9d5 Revert an unneeded interface change to Instruction.h
llvm-svn: 14137
2004-06-11 03:06:43 +00:00
Chris Lattner
a5ddab2779 Testcase for PR369
llvm-svn: 14136
2004-06-11 02:59:47 +00:00
Chris Lattner
434cc49bca Check to make sure that isnan doesn't require calling a function
llvm-svn: 14135
2004-06-11 02:54:54 +00:00
Chris Lattner
0c6db524d6 Fix lowering to work correctly
llvm-svn: 14134
2004-06-11 02:54:02 +00:00
Chris Lattner
8f40e35934 I misled Alkis: LLVM should have isnan, not isunordered.
isunordered(X, Y) === isnan(X) | isnan(Y)

Remove isunordered, add isnan.

Modernize testcase

llvm-svn: 14133
2004-06-11 02:29:57 +00:00
Chris Lattner
8f69c9e439 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
Chris Lattner
3b4f437526 Document the llvm.isnan intrinsic
llvm-svn: 14131
2004-06-11 02:28:03 +00:00
Brian Gaeke
522235efbf Bug fixed.
llvm-svn: 14130
2004-06-11 02:15:39 +00:00
Brian Gaeke
5caed4e7dd Test case for PR368
llvm-svn: 14129
2004-06-11 02:11:43 +00:00
Brian Gaeke
2655aab200 Turn loads of ConstantPointerNulls into loads of zero... don't spill
them into the constant pool.

llvm-svn: 14128
2004-06-11 02:03:48 +00:00
Alkis Evlogimenos
d0b5d0c7cc Add the isunordered intrinsic.
llvm-svn: 14127
2004-06-11 01:08:18 +00:00
Alkis Evlogimenos
2baa85e8be Add feature test for llvm intrinsics. It currently contains only the "isunordered" intrinsic
llvm-svn: 14126
2004-06-11 01:06:40 +00:00
Reid Spencer
c4bbb8f70b Updated the BytecodeAnalysis data structure to contain additional fields
needed for analysis of individual functions.

llvm-svn: 14125
2004-06-10 22:28:11 +00:00
Reid Spencer
7e5d80033d Added an isPhiNode(unsigned) static method to determine if an opcode is
a PhiNode or not. Needed by Bytecode Analyzer.

llvm-svn: 14124
2004-06-10 22:27:10 +00:00
Reid Spencer
8395e67fb1 Remove tabs.
llvm-svn: 14123
2004-06-10 22:03:00 +00:00
Reid Spencer
7670bbdfb9 Implement detailed function level data collection and reporting.
llvm-svn: 14122
2004-06-10 22:00:54 +00:00
Reid Spencer
90f0032664 Adjust prototypes to new Handler interface.
llvm-svn: 14121
2004-06-10 22:00:29 +00:00
Reid Spencer
2491b0959e Make the parser deal with functions instead of just function types.
llvm-svn: 14120
2004-06-10 21:59:20 +00:00
Reid Spencer
b3a4e0b9bd Clean up documentation and naming of variables.
llvm-svn: 14119
2004-06-10 18:38:44 +00:00
Misha Brukman
ffdffe1d76 Remove extra space.
llvm-svn: 14117
2004-06-10 12:51:35 +00:00
Reid Spencer
ff35cf92c5 Doxygenize a comment.
llvm-svn: 14115
2004-06-10 08:27:00 +00:00
Reid Spencer
1080b373a2 Made detailed output the default and changed -details option to -nodetails.
llvm-svn: 14114
2004-06-10 08:24:42 +00:00
Reid Spencer
8e5de9cd75 Implemented the bulk of the functionality. Cleaned up the code.
llvm-svn: 14113
2004-06-10 08:09:13 +00:00
Brian Gaeke
966938cff2 Allow dates with slashes in them in $DateRE.
Don't match on $Filename (which will be unset) if we hit 'UNMATCHABLE:'.

llvm-svn: 14112
2004-06-10 07:44:28 +00:00
Chris Lattner
175532bb1e Fix the prolog epilog code inserter to match the documentation and support
targets whose stack grows up.

Patch contributed by Vladimir Prus

llvm-svn: 14111
2004-06-10 06:23:35 +00:00
Chris Lattner
6d6b3b3ce9 Fix the fixed stack offset, patch contributed by Vladimir Prus
llvm-svn: 14110
2004-06-10 06:19:25 +00:00
Chris Lattner
ee59d4bf04 Fix a bug in my checkin from last night that caused miscompilations of
186.crafty, fhourstones and 132.ijpeg.

Bugpoint makes really nasty miscompilations embarassingly easy to find.  It
narrowed it down to the instcombiner and this testcase (from fhourstones):

bool %l7153_l4706_htstat_loopentry_2E_4_no_exit_2E_4(int* %i, [32 x int]* %works, int* %tmp.98.out) {
newFuncRoot:
        %tmp.96 = load int* %i          ; <int> [#uses=1]
        %tmp.97 = getelementptr [32 x int]* %works, long 0, int %tmp.96         ; <int*> [#uses=1]
        %tmp.98 = load int* %tmp.97             ; <int> [#uses=2]
        %tmp.99 = load int* %i          ; <int> [#uses=1]
        %tmp.100 = and int %tmp.99, 7           ; <int> [#uses=1]
        %tmp.101 = seteq int %tmp.100, 7                ; <bool> [#uses=2]
        %tmp.102 = cast bool %tmp.101 to int            ; <int> [#uses=0]
        br bool %tmp.101, label %codeRepl4.exitStub, label %codeRepl3.exitStub

codeRepl4.exitStub:             ; preds = %newFuncRoot
        store int %tmp.98, int* %tmp.98.out
        ret bool true

codeRepl3.exitStub:             ; preds = %newFuncRoot
        store int %tmp.98, int* %tmp.98.out
        ret bool false
}

... which only has one combination performed on it:

$ llvm-as < t.ll | opt -instcombine -debug | llvm-dis
IC: Old =       %tmp.101 = seteq int %tmp.100, 7                ; <bool> [#uses=1]
    New =       setne int %tmp.100, 0           ; <bool>:<badref> [#uses=0]
IC: MOD =       br bool %tmp.101, label %codeRepl3.exitStub, label %codeRepl4.exitStub
IC: MOD =       %tmp.97 = getelementptr [32 x int]* %works, uint 0, int %tmp.96         ; <int*> [#uses=1]

It doesn't get much better than this.  :)

llvm-svn: 14109
2004-06-10 02:33:20 +00:00
Chris Lattner
c8e7e298c1 More minor cleanups
llvm-svn: 14108
2004-06-10 02:12:35 +00:00
Chris Lattner
df20a4d589 Eliminate many occurrances of Instruction::
llvm-svn: 14107
2004-06-10 02:07:29 +00:00
Chris Lattner
88ba175c1e Share some code
llvm-svn: 14106
2004-06-10 01:57:38 +00:00
Chris Lattner
867653ad6a Add new BinaryOperator::createAdd/Sub/... methods to avoid having to type
llvm::Instruction:: all of the time.

llvm-svn: 14105
2004-06-10 01:43:29 +00:00
Chris Lattner
68a038e6a1 Tolerate more errors
llvm-svn: 14104
2004-06-09 22:22:10 +00:00
Brian Gaeke
5b03a0628f Encode %fsr correctly; don't fail an assertion.
llvm-svn: 14103
2004-06-09 21:54:59 +00:00
Brian Gaeke
87d8878f6d Fix encoding of ST*FSR instructions.
llvm-svn: 14102
2004-06-09 21:54:58 +00:00
Brian Gaeke
87c75632ee Fix assertion failure message to have the right method name.
llvm-svn: 14101
2004-06-09 20:44:42 +00:00
Chris Lattner
757ee0b533 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
f8d610ca73 Columnized the compilation statistics for easier reading.
llvm-svn: 14099
2004-06-09 18:29:15 +00:00
Chris Lattner
4408630c67 Fix the really bizarre stuff that happened last night in the tester
due to non-numeric diff failures that caused fpcmp to go into infinite loops

llvm-svn: 14098
2004-06-09 18:28:53 +00:00
Reid Spencer
8beac69819 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
John Criswell
9095c64147 Fix for PR#366. We use getClassB() so that we can handle cast instructions
that cast to bool.

llvm-svn: 14096
2004-06-09 15:18:51 +00:00
Chris Lattner
35167c3087 Implement InstCombine/select.ll:test15*
llvm-svn: 14095
2004-06-09 07:59:58 +00:00
Chris Lattner
ce527c8e6d More instcombine testcases
llvm-svn: 14094
2004-06-09 07:59:40 +00:00
Reid Spencer
2acee7e4d6 Cleanup alignment of output.
llvm-svn: 14093
2004-06-09 06:22:00 +00:00
Reid Spencer
1e47e066ad Add some new fields for bytecode analysis.
llvm-svn: 14092
2004-06-09 06:18:53 +00:00
Reid Spencer
cc4e35a404 Implement analysis output. Don't dump function details unless requested.
llvm-svn: 14091
2004-06-09 06:17:58 +00:00
Reid Spencer
839fa681f6 Implement some rudimentary analysis.
llvm-svn: 14090
2004-06-09 06:16:43 +00:00
Reid Spencer
f1598b0efa Clean up indentation of file body output.
Don't dump functions unless "detailedResults" is requested.

llvm-svn: 14089
2004-06-09 06:16:19 +00:00
Reid Spencer
fc6f5508aa Move parsing details to Parser.cpp.
llvm-svn: 14088
2004-06-09 06:15:21 +00:00
Reid Spencer
670c26d3af Bring some things out of header files that belong only in this file.
llvm-svn: 14087
2004-06-09 06:14:52 +00:00
Chris Lattner
396dbfe327 Be more careful about the order we put stuff onto the worklist. This allow us to
collapse this:
bool %le(int %A, int %B) {
        %c1 = setgt int %A, %B
        %tmp = select bool %c1, int 1, int 0
        %c2 = setlt int %A, %B
        %result = select bool %c2, int -1, int %tmp
        %c3 = setle int %result, 0
        ret bool %c3
}

into:

bool %le(int %A, int %B) {
        %c3 = setle int %A, %B          ; <bool> [#uses=1]
        ret bool %c3
}

which is handy, because the Java FE makes these sequences all over the place.

This is tested as: test/Regression/Transforms/InstCombine/JavaCompare.ll

llvm-svn: 14086
2004-06-09 05:08:07 +00:00
Chris Lattner
7ed7d82512 New testcase that is important for the Java FE
llvm-svn: 14085
2004-06-09 05:07:01 +00:00
Reid Spencer
e73febc64a Cleaned up a dead header file to prevent duplicate definition warnings
in doxygen.

llvm-svn: 14084
2004-06-09 04:38:34 +00:00
Chris Lattner
2dd017402b Implement select.ll:test14*
llvm-svn: 14083
2004-06-09 04:24:29 +00:00
Chris Lattner
52d7430fc5 New testcase for the instruction combiner that happen often in the Java FE
llvm-svn: 14082
2004-06-09 04:23:57 +00:00
Chris Lattner
0c09852909 Minor tweaks
llvm-svn: 14081
2004-06-09 03:59:05 +00:00
Reid Spencer
4d598edc59 Regularize title of Regression Test section. Clean up some blank space.
llvm-svn: 14080
2004-06-09 02:07:25 +00:00
Chris Lattner
4769612be1 Bug fixed
llvm-svn: 14079
2004-06-09 01:09:16 +00:00
Chris Lattner
74248512eb Workaround or a VS miscompilation bug
llvm-svn: 14078
2004-06-08 23:21:39 +00:00
Chris Lattner
8b52a68356 I checked and no clients expect this to return null for unconditional branches
Simplify code and make it more uniform.

llvm-svn: 14077
2004-06-08 22:03:05 +00:00
Chris Lattner
4c7a24af44 Don't grab the condition of unconditional branches!
This fixes PR363

llvm-svn: 14076
2004-06-08 21:50:30 +00:00
Brian Gaeke
c365e7cc99 Fix a minor bug in the map - since this pass adds a global symbol, it must be
accounted for in the map (at least, in its current format).

llvm-svn: 14075
2004-06-08 20:08:30 +00:00
Brian Gaeke
78d03b523f Add a forwarding method pop_front() that allows you to delete instructions
from the beginning of a MBB.

llvm-svn: 14074
2004-06-08 18:52:47 +00:00
Brian Gaeke
76b6426a8c Add a TmpInstruction ctor that doesn't take a MCFI.
llvm-svn: 14073
2004-06-08 18:52:46 +00:00
Brian Gaeke
223b345279 Explicitly specify libtool tag "CXX" so that if you setenv CXX to something
libtool can't parse, e.g., "/path/to/g++ -some-funny-options",
then it will still be able to compile and link.

llvm-svn: 14072
2004-06-08 18:52:45 +00:00
Chris Lattner
a20f4aab7f Fix a link error using VS8.0
llvm-svn: 14071
2004-06-08 17:53:24 +00:00
Chris Lattner
4409487746 Apparently a particular vendor compiler uses the struct/class tag to MANGLE
symbols with.  Therefore, if you do not use struct/class consistently, you can
get LINK ERRORS.  grr.

This fixes the link errors for libsupport and vmcore.

-Chris

llvm-svn: 14070
2004-06-08 17:44:21 +00:00
Misha Brukman
23c2f67fda Fix case of doxygen directive `\p': it's lowercase.
llvm-svn: 14068
2004-06-08 13:49:17 +00:00
Reid Spencer
7d4b814e86 * Fix indentation of Regression Test Results by making sure the
GetQMTestResults function closes all its open tags.
* Cause XFAIL results to not be reported at all except in the stats.

llvm-svn: 14067
2004-06-08 08:01:33 +00:00
Reid Spencer
b14a0a69fc Put in a place holder for describing the differences in bytecode format
between LLVM versions. This is just a reminder so I don't forget to
document it.

llvm-svn: 14066
2004-06-08 07:41:41 +00:00
Reid Spencer
850f85f81f Add a note about llvm-abcd, the Analysis of ByteCode Dumper
llvm-svn: 14065
2004-06-08 07:30:31 +00:00
Chris Lattner
bd948cfe38 Ooh, that fixed the annoying warning!!
llvm-svn: 14064
2004-06-08 07:19:29 +00:00
Chris Lattner
25b3a03e17 Bug fixed
llvm-svn: 14063
2004-06-08 07:15:52 +00:00
Chris Lattner
79dd360555 New testcase for PR355
llvm-svn: 14062
2004-06-08 07:11:14 +00:00
Chris Lattner
12eb60f213 Testcase for PR355
llvm-svn: 14061
2004-06-08 07:10:11 +00:00
Chris Lattner
522ef67fb2 Add documentation to the TargetFrameInfo class, contributed by Vladimir Prus
llvm-svn: 14060
2004-06-08 06:23:17 +00:00
Reid Spencer
ddc6fb125e Clean up the documentation.
Simplify the file handling. It now only writes to std::cout.

llvm-svn: 14059
2004-06-08 05:56:58 +00:00
Reid Spencer
2eb0f1d44c Clean up documentation and make it possible for the BytecodeAnalyzer to
store the output of the bytecode dumper.

llvm-svn: 14058
2004-06-08 05:55:53 +00:00
Reid Spencer
42427f0ccb Fix the bug that was preventing the parser from working on all bytecode
files. It was reading non-initialized global vars when the flag said it was
initialized and vice versa. Causes mis-alignment since initialized and
non-initialized constants have different bytecode lengths.

llvm-svn: 14057
2004-06-08 05:54:47 +00:00
Reid Spencer
2c5613d1c3 Make it #include Parser.h instead of AnalyzerInternals.h since it only
needs the BytecodeHandler interface which is now in Parser.h

llvm-svn: 14056
2004-06-08 05:53:14 +00:00
Reid Spencer
621a4ad111 Adjust what's included to compensate for changes in Parser.h
llvm-svn: 14055
2004-06-08 05:52:29 +00:00
Reid Spencer
fbe659d435 Merged BytecodeHandler.h into Parser.h since the parser and the handler
must always coexist. Cleaned up the documentation on these interfaces
significantly. This is in preparation for moving Parser.h to the include
directories to make it a public interface.

llvm-svn: 14054
2004-06-08 05:51:18 +00:00
Chris Lattner
71dbebf411 Fix PR361.
Dominance properties don't hold in unreachable code

llvm-svn: 14053
2004-06-07 23:07:33 +00:00
Chris Lattner
3b2e067386 New testcase for PR361
llvm-svn: 14052
2004-06-07 23:07:09 +00:00
Chris Lattner
07ab2d1d2d Make all of this functionality work directly on win32. Properly conditionalize
system specific stuff on HAVE_MKSTEMP

llvm-svn: 14051
2004-06-07 19:37:24 +00:00
Chris Lattner
6068345cc5 Implement getTimeRecord natively in Win32, properly conditionalize the
getrusage implementation on HAVE_GETRUSAGE

llvm-svn: 14050
2004-06-07 19:34:51 +00:00
Chris Lattner
bbc373bf8b Eliminate more traces of the -c option
llvm-svn: 14049
2004-06-07 18:10:01 +00:00
Reid Spencer
db5c86d0b1 Commit For New Tool: llvm-abcd (Analysis of ByteCode Dumper). This tool
will (eventually) provide statistical analysis of bytecode files as well
as the ability to dump them in a low level format (slot numbers not
resolved). The purpose of this is to aid in the Type!=Value change of
bug 122. With this initial release, llvm-abcd merely dumps out the
bytecode. However, the infrastructure for separating bytecode parsing from
handling the parsing events is in place. The style chosen is similar to
SAX XML parsing where a handler object is called to handlign the parsing
events. This probably isn't useful to anyone but me right now as there is
no analysis yet, and the dumper doesn't work on every bytecode file. It
will probably be useful by the end of this week. Note that there is some
duplication of code from the bytecode reader.  This was done to eliminate
errors from being introduced in the reader and to minimize the impact to
other LLVM developers. At some point, the Analyzer and the Reader will be
integrated to use the same infrastructure. Also, sorry for the minor change
to Instruction.h but I just couldn't bring myself to write code that
depends on Instruction internals.

llvm-svn: 14048
2004-06-07 17:53:43 +00:00
John Criswell
b0a352c94f Added checks for mkstemp and getrusage.
llvm-svn: 14047
2004-06-07 14:26:24 +00:00
Chris Lattner
2738b7ea61 Add some notes so I can throw away one of my many todo lists.
llvm-svn: 14046
2004-06-05 20:12:36 +00:00
Chris Lattner
307e1df0d1 Fix GCC warning
llvm-svn: 14045
2004-06-05 17:44:48 +00:00
Chris Lattner
08d1b9db1e Fix GCC warnings
llvm-svn: 14044
2004-06-05 17:43:52 +00:00
Reid Spencer
1253fb9d83 Fix a few typos, spellos, grammaros.
llvm-svn: 14043
2004-06-05 14:39:24 +00:00
Reid Spencer
242ddb92bc Add "work in progress" warning.
llvm-svn: 14042
2004-06-05 14:18:02 +00:00
Alkis Evlogimenos
2c0735446b Include cerrno.
llvm-svn: 14041
2004-06-05 08:59:43 +00:00
Chris Lattner
0d63958706 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
0a5f63d5f4 Macros are baaad.
llvm-svn: 14039
2004-06-05 00:54:11 +00:00
Chris Lattner
28461fa83c Don't #include <unistd.h> directly, go through the config files
llvm-svn: 14038
2004-06-05 00:27:38 +00:00
Chris Lattner
c5e0be647c Add missing #include
llvm-svn: 14037
2004-06-05 00:24:59 +00:00
Chris Lattner
61bd8b3810 Work around VS bug
llvm-svn: 14036
2004-06-05 00:22:04 +00:00
Chris Lattner
2e7ceee89f Warning foo
llvm-svn: 14035
2004-06-05 00:17:13 +00:00
Chris Lattner
708ee9d965 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
5c391ce004 Remove unused var
llvm-svn: 14033
2004-06-05 00:03:27 +00:00
Chris Lattner
aa6ff271d0 Squelch a warning
llvm-svn: 14032
2004-06-04 23:53:20 +00:00
Chris Lattner
42d5b0878b Delete some unreachable code
llvm-svn: 14031
2004-06-04 23:52:36 +00:00
Misha Brukman
21bbdb9533 * 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
Misha Brukman
a415858fc2 Revert ostream back to reference: the only user (llvm-tv) no longer needs it.
llvm-svn: 14029
2004-06-04 21:10:35 +00:00
Chris Lattner
603b1ca393 Add some constants for VC
llvm-svn: 14028
2004-06-04 20:58:34 +00:00
Brian Gaeke
78faa9a9e6 Fix up some spacing & fix a typo in an assertion in cpValue2Value.
llvm-svn: 14027
2004-06-04 20:51:40 +00:00
Chris Lattner
dcffa86719 Ugh, apparently there is no common ground here.
llvm-svn: 14026
2004-06-04 20:48:51 +00:00
Chris Lattner
214e58ded5 Fix a *really* dumb warning on VC
llvm-svn: 14025
2004-06-04 20:47:19 +00:00
Chris Lattner
a429db82bf Fix more warnings
llvm-svn: 14024
2004-06-04 20:39:05 +00:00
Chris Lattner
fd427c1edd Remove support for printing strings from the cached writer
llvm-svn: 14023
2004-06-04 20:34:51 +00:00
Chris Lattner
75019ba397 Don't send random junk to CachedWriter's. Also remove a cast that could be
problematic when Type does not derive from Value.

llvm-svn: 14022
2004-06-04 20:25:55 +00:00
Chris Lattner
875779a87a GCC doesn't like prefix form of cast with two identifiers I guess.
llvm-svn: 14021
2004-06-04 20:21:53 +00:00
Chris Lattner
1278759a2c Squish a warning
llvm-svn: 14020
2004-06-04 20:14:29 +00:00
Chris Lattner
505b2c6b77 Silence a warning
llvm-svn: 14019
2004-06-04 20:10:17 +00:00
Chris Lattner
a36804a2ff Add ssize_t for VC++
llvm-svn: 14018
2004-06-04 20:06:33 +00:00
Chris Lattner
49dc039eeb <io.h> provides read/write/open/...
llvm-svn: 14017
2004-06-04 20:05:35 +00:00
Chris Lattner
5cc1b64528 Visual C has something resembling a stat function, but it doesn't provide S_ISREG
llvm-svn: 14016
2004-06-04 20:03:06 +00:00
Chris Lattner
3df4beffa5 Make this work on VC++, pull the HAVE_ALLOCA_H case out instead of duplicating
it.  This code can probably be dramatically simplified, as I suspect that the
pragma and other stuff is not needed with C++ compilers.

llvm-svn: 14015
2004-06-04 19:25:50 +00:00
Chris Lattner
72e76982f7 Add more needed typedefs
llvm-svn: 14014
2004-06-04 19:11:04 +00:00
Chris Lattner
b80110f667 Add explicit casts to silence warnings. There is no need to use snprintf here.
llvm-svn: 14013
2004-06-04 19:10:30 +00:00
Chris Lattner
5034a983ff Make this work with VC++
llvm-svn: 14012
2004-06-04 19:01:49 +00:00
Chris Lattner
1d79ba7edb Fix a nasty bug that caused areAliases to always return false.
Bug fix courtesy of Anshu Dasgupta

llvm-svn: 14011
2004-06-04 17:03:11 +00:00
Misha Brukman
aff10d0461 Emit a more sensible error message if no subclasses of Target are defined.
Patch contributed by Vladimir Prus.

llvm-svn: 14010
2004-06-04 14:59:42 +00:00
Misha Brukman
57c586cf78 Clarify documentation and use correct doxygen comment form /// vs. // .
Thanks to Vladimir Prus for corrections.

llvm-svn: 14009
2004-06-04 14:51:25 +00:00
Chris Lattner
881cc1549f Fix extraneous tag
llvm-svn: 14008
2004-06-04 00:40:53 +00:00
Chris Lattner
a7fac9566d New doc
llvm-svn: 14007
2004-06-04 00:40:11 +00:00
Chris Lattner
b4e5664f98 Fix PR356: [doc] lib/Target/X86/README.txt needs update
Also add some documentation about how instructions work

llvm-svn: 14006
2004-06-04 00:16:02 +00:00
Chris Lattner
add9f29fdf This file is obsolete
llvm-svn: 14005
2004-06-04 00:15:21 +00:00
Brian Gaeke
2948d2e724 Honor DISABLE_CBE, etc., even when doing the "running tests" (i.e., Olden)
llvm-svn: 14004
2004-06-04 00:07:12 +00:00
Misha Brukman
1d3b7a3f52 Fix broken internal link; add stub for missing subsection.
llvm-svn: 14003
2004-06-03 23:47:34 +00:00
Misha Brukman
3155159ef9 Fix broken internal link.
llvm-svn: 14002
2004-06-03 23:42:24 +00:00
Misha Brukman
d72c7f9fc9 GCSE has suddenly become a struct, not a class; fix broken link.
llvm-svn: 14001
2004-06-03 23:39:36 +00:00
Misha Brukman
18a94d6f21 Fix more broken links as a result of the llvm namespace.
llvm-svn: 14000
2004-06-03 23:35:54 +00:00
Misha Brukman
aa8db1845e Fix broken internal links.
llvm-svn: 13999
2004-06-03 23:33:10 +00:00
Misha Brukman
fdcb3c209c Fix broken links as a result of the llvm namespace.
llvm-svn: 13998
2004-06-03 23:29:12 +00:00
Chris Lattner
10ee9654c9 Fix some broken links
llvm-svn: 13997
2004-06-03 22:57:15 +00:00
Chris Lattner
249b3558bc CQ bug implemented
llvm-svn: 13996
2004-06-03 22:35:13 +00:00
Chris Lattner
e0c83d2566 The prototype for ParseCommandLineOptions changed at some point, but this
was never updated.  I guess GCC just ignores the prototype

llvm-svn: 13995
2004-06-03 22:07:26 +00:00
Brian Gaeke
0a71673115 Allow script to set configure args.
Allow environment to set llvmgccdir.

llvm-svn: 13994
2004-06-03 21:46:56 +00:00
Chris Lattner
5a8676a3f8 Adjust argument to match destination data type
llvm-svn: 13993
2004-06-03 21:14:56 +00:00
Chris Lattner
9e650d4583 Don't use identifiers that start with an _
llvm-svn: 13992
2004-06-03 21:12:02 +00:00
Chris Lattner
a24b5d0286 Only use the non-standards-compliant std::distance on the compiler that is
buggy, not for all compilers that are not GCC 3

llvm-svn: 13990
2004-06-03 18:48:59 +00:00
Misha Brukman
94192b638c Specify div type "doc_text" to get proper indentation for paragraphs.
llvm-svn: 13989
2004-06-03 16:59:59 +00:00
Misha Brukman
df55bdfb5f Add a hyphen.
llvm-svn: 13988
2004-06-03 16:55:57 +00:00
Misha Brukman
d888b5d54e Properly close the footer paragraph.
llvm-svn: 13987
2004-06-03 15:25:16 +00:00
Misha Brukman
b18cc84921 Wrap long lines.
llvm-svn: 13986
2004-06-03 15:23:59 +00:00
Misha Brukman
313373d4d7 Fix case of doxygen directive \p.
llvm-svn: 13985
2004-06-03 15:14:00 +00:00
Chris Lattner
f75832b015 * 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
Brian Gaeke
6973e85b16 Add new internal-global-symbol mapping info pass... may its life be short
and sweet.

llvm-svn: 13983
2004-06-03 05:03:37 +00:00
Brian Gaeke
a9c5779a86 Expand head-of-file comment.
llvm-svn: 13982
2004-06-03 05:03:02 +00:00
Brian Gaeke
0a48c0d913 Add new mapping info pass, when EmitMappingInfo is on.
llvm-svn: 13981
2004-06-03 05:03:01 +00:00
Brian Gaeke
25c6fa0e83 Fix big mistake in my last checkin... the big question is, how did I ever
get this to link before?

llvm-svn: 13980
2004-06-03 05:03:00 +00:00
Brian Gaeke
11cfb090b8 Add decl. for new mapping info pass factory method.
llvm-svn: 13979
2004-06-03 05:02:59 +00:00
Chris Lattner
1c0a0e2e36 Add -disable-codegen option to disable LLC and JIT targets
llvm-svn: 13978
2004-06-03 03:29:39 +00:00
Brian Gaeke
dca24ddfc7 Collapse together the abstract superclass TargetRegInfo and SparcV9RegInfo, its
only concrete implementation.

llvm-svn: 13977
2004-06-03 02:45:09 +00:00
Chris Lattner
f55aa9c49c Recognize cygwin
llvm-svn: 13976
2004-06-02 23:32:17 +00:00
Chris Lattner
4f816d2e38 <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
Brian Gaeke
60f37d6df7 Another pod
llvm-svn: 13969
2004-06-02 20:55:52 +00:00
Brian Gaeke
51b3ef02ad The llvm-dis.html page was a little out of date, but this pod file can supersede it.
llvm-svn: 13968
2004-06-02 20:45:25 +00:00
Chris Lattner
0379351667 Update to include llc on x86 and other systems
llvm-svn: 13967
2004-06-02 20:37:02 +00:00
Brian Gaeke
e35ca2ec1c Tasty, tasty pods...
llvm-svn: 13966
2004-06-02 20:29:49 +00:00
Chris Lattner
05a292a37f The -q option is gone
llvm-svn: 13965
2004-06-02 19:51:09 +00:00
Chris Lattner
7113171f63 The --enable-correct-eh-support option is meaningless when provided to
gccas.

llvm-svn: 13964
2004-06-02 19:30:23 +00:00
Chris Lattner
8c85ec93be cygwin apparently doesn't have widechar support. But when disabled, the whole
C/C++ front-end and runtime libraries finally build!

llvm-svn: 13963
2004-06-02 19:27:50 +00:00
Chris Lattner
4123104202 Add a link to the code gen document
llvm-svn: 13962
2004-06-02 19:24:10 +00:00
Brian Gaeke
098fc08d54 Here's another pod.
llvm-svn: 13961
2004-06-02 19:21:26 +00:00
Brian Gaeke
9e8f8628c3 Look, it's a gccas pod.
llvm-svn: 13960
2004-06-02 19:12:38 +00:00
Chris Lattner
e6cad6c5ae Add a note about the V9 backend.
llvm-svn: 13959
2004-06-02 07:06:06 +00:00
Chris Lattner
7b4d0f9c22 Oops, this was not to go in
llvm-svn: 13958
2004-06-02 06:06:45 +00:00
Chris Lattner
2805c189dc Adjust to the new TargetMachine interface
llvm-svn: 13957
2004-06-02 06:06:20 +00:00
Chris Lattner
2150542af9 Adjust to new TargetMachine interface
llvm-svn: 13956
2004-06-02 05:57:12 +00:00
Chris Lattner
185fa54c68 Inline findOptimalStorageSize into it's caller, both of which are sparc specific
llvm-svn: 13955
2004-06-02 05:56:52 +00:00
Chris Lattner
562d15636e Adjust to new TM interface
llvm-svn: 13954
2004-06-02 05:56:04 +00:00
Chris Lattner
c832e546d0 Method has been inlined into all callers
llvm-svn: 13953
2004-06-02 05:55:48 +00:00
Chris Lattner
82baa9c394 Convert to the new TargetMachine interface.
llvm-svn: 13952
2004-06-02 05:55:25 +00:00
Chris Lattner
535e8db0da Stubs are no longer needed
llvm-svn: 13951
2004-06-02 05:53:52 +00:00
Chris Lattner
e5892f32d6 Delete the V9 specific findOptimalStorageSize method, inlining it into all callers.
Substantially clean up all target implementations by having the OPTIONAL get*Info
methods return a pointer instead of a reference.  This allows us to have default
implementations!

llvm-svn: 13950
2004-06-02 05:53:25 +00:00
Chris Lattner
63c07bf246 Adjust to new TM interfaces
llvm-svn: 13949
2004-06-02 05:47:26 +00:00
Chris Lattner
560b5e42ab Finegrainify namespacification
llvm-svn: 13948
2004-06-02 04:28:06 +00:00
Chris Lattner
71f1d6d9d8 Fix a trivial but blatant bug
llvm-svn: 13947
2004-06-02 03:57:43 +00:00
Chris Lattner
6662d33f8a Make gccld copy the llvm-stub program to be the execution wrapper for
bytecode files on win32 systems.  We keep the shell script on unix systems
because it is much more transparent for the users and supports -load
options.

This allows llvmgcc work correctly on win32 systems without the -native or
-native-cbe options.

llvm-svn: 13946
2004-06-02 00:53:57 +00:00
Chris Lattner
80adb79be2 Implement the new CopyFile function
llvm-svn: 13945
2004-06-02 00:52:22 +00:00
Chris Lattner
5bcd2323ff Add a new CopyFile function
llvm-svn: 13944
2004-06-02 00:51:20 +00:00
Misha Brukman
e5a7239cae Fix a double negation (in grammar).
llvm-svn: 13943
2004-06-02 00:29:52 +00:00
Chris Lattner
85b943dd06 Move some functions out of gccld.cpp to GenerateCode.cpp. This allows us
to reduce the inter-file interface in the gccld tool and gets some
uninteresting code out of gccld.cpp.

llvm-svn: 13942
2004-06-02 00:22:24 +00:00
Chris Lattner
fdcb868fef Refactor a bit of code into a function, no functionality changes.
llvm-svn: 13941
2004-06-02 00:10:19 +00:00
Misha Brukman
140f26ea46 Fix spelling, trim empty space, tighten up function header comment.
llvm-svn: 13940
2004-06-02 00:09:46 +00:00
Chris Lattner
7f6a0343fc No really cygwin, we LIKE .exe'ness.
llvm-svn: 13939
2004-06-02 00:04:54 +00:00
Chris Lattner
cb043e4ab6 Build the llvm-stub directory
llvm-svn: 13938
2004-06-01 23:49:55 +00:00
Chris Lattner
10d7d569db Initial checkin of a stub executable that can be used by gccld to forward to
bytecode files on systems that don't support #!/bin/sh natively (ie, win32).

llvm-svn: 13937
2004-06-01 23:48:45 +00:00
Chris Lattner
8e71bc09ff On win32, process.h provides some of the traditional stuff that unistd
provides.  This seems like a relatively clean way to get it.

llvm-svn: 13936
2004-06-01 23:47:00 +00:00
Chris Lattner
3edb94bff1 Bug fixed
llvm-svn: 13935
2004-06-01 21:52:45 +00:00
Chris Lattner
a32ca86c21 Implement PR315: abort, don't warn, when missing external functions encountered
This fixes some critical problems building libstdc++ on cygwin.

llvm-svn: 13934
2004-06-01 21:49:00 +00:00
Brian Gaeke
31d599adca Add spiff
llvm-svn: 13933
2004-06-01 20:37:41 +00:00
Brian Gaeke
c0b9b83450 Use new form of unconditional branch constructor.
llvm-svn: 13930
2004-06-01 20:06:10 +00:00
Brian Gaeke
84c8bd0dd4 Call Cygwin by its proper name, and give it a link. :-)
llvm-svn: 13929
2004-06-01 20:02:56 +00:00
Brian Gaeke
7ed1d1b320 Maybe this will keep people from breaking -branch-combine!
llvm-svn: 13928
2004-06-01 20:01:05 +00:00
Chris Lattner
ce1a3843b0 Add a note about cygwin
llvm-svn: 13927
2004-06-01 19:41:30 +00:00
Chris Lattner
4f120545a7 Make tool names end with .exe on windows. This isn't needed to run the
tools, but is required for rules that depend on the executables, e.g.:

a: b $(LLVMAS)
llvm-svn: 13926
2004-06-01 19:06:43 +00:00
John Criswell
8a76df0bd7 Added the EXEEXT variable so that Makefiles can figure out what extension
to put on executable files.

llvm-svn: 13925
2004-06-01 19:04:38 +00:00
Misha Brukman
5363e38618 * Standardize footer
* HTML 4.01 (Strict) compliance

llvm-svn: 13924
2004-06-01 18:51:03 +00:00
Chris Lattner
d9be5faada Finish the thought that got interrupted when my train arrived. :)
llvm-svn: 13923
2004-06-01 18:35:00 +00:00
Chris Lattner
2c7b08766d Fix wandering </a>, add note about cygwin being supported.
llvm-svn: 13922
2004-06-01 18:22:41 +00:00
Misha Brukman
49c28757b9 * Use sans-serif fonts just like in the rest of doxygen
* Reference the lines image correctly
* Set font size to make the title stand out

llvm-svn: 13921
2004-06-01 18:19:28 +00:00
Chris Lattner
bbdec0365c * Make it HTML4.01
* Add information about cygwin
* Simplify instructions a little and make it more robust (have people just
  reconfig and build after buildint the CFE)
* Remove some obsolete stuff

llvm-svn: 13920
2004-06-01 18:13:05 +00:00
Misha Brukman
c9555decd1 Make doxygen pages look like our own documentation.
llvm-svn: 13919
2004-06-01 18:09:32 +00:00
Misha Brukman
a1c4fcce3f * Add the year 2003 back to the copyright line
* Remove doxygen image from page, make LLVM link inline with the text

llvm-svn: 13918
2004-06-01 18:00:39 +00:00
Misha Brukman
2a75e7246a * It's now the year 2004
* Our main page is index.html, not index.php
* Wrap lines at 80 cols

llvm-svn: 13917
2004-06-01 17:35:10 +00:00
Chris Lattner
f249fdc1c9 Add a warning about incompleteness, fix validation errors
llvm-svn: 13916
2004-06-01 17:18:11 +00:00
John Criswell
cd116ba64c 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
Chris Lattner
565d7d567d It's a small start, but it is certainly needed. Contributions are certainly
welcomed.  :)

llvm-svn: 13914
2004-06-01 06:48:00 +00:00
Reid Spencer
26b9a3b747 Align the lower portion of the page with the left margin so that the page
width is not made excessive by the large table of results. Improves
readability of the page.

llvm-svn: 13913
2004-05-31 21:38:56 +00:00
Reid Spencer
8ac57711b0 Clean up the Feature and Regression test output to (a) use section headers,
(b) avoid <pre> tag so page width doesn't become excessive, (c) omit the
execution time stats, (d) format each reported test in a list with bold
headings for readability, (e) omit long lines of dashes.

llvm-svn: 13912
2004-05-31 20:59:55 +00:00
Brian Gaeke
4cc9328b5d There is no "mcff" here; delete the confusing comments that refer to it.
llvm-svn: 13911
2004-05-30 08:29:16 +00:00
Alkis Evlogimenos
fbe799cfa2 Pull Interval class out of LiveIntervals.
llvm-svn: 13910
2004-05-30 07:46:27 +00:00
Alkis Evlogimenos
34f6bcc8d2 Add comparator useful for natural comparisons on collections with
pointers to objects.

llvm-svn: 13909
2004-05-30 07:45:09 +00:00
Brian Gaeke
7a8734af7f Transform an occurrence of if(...) { assert (0) }.
llvm-svn: 13908
2004-05-30 07:34:01 +00:00
Alkis Evlogimenos
a5268e8199 When spilling an register, introduce a new temporary for each of its
spills. This allows for more flexibility when allocating registers for
spill code.

llvm-svn: 13907
2004-05-30 07:24:39 +00:00
Brian Gaeke
01c1f3279d Reduce the amount of LLVM Values for which we save reg. allocator
state. Also, save the state for the incoming register of each phi
node.

llvm-svn: 13906
2004-05-30 07:08:43 +00:00
Brian Gaeke
9836668944 Rename verifySavedState to dumpSavedState. Give it a new comment.
Call it at a more appropriate point.

llvm-svn: 13905
2004-05-30 04:22:24 +00:00
Brian Gaeke
bc3d8652ec Insert machine instructions generated for Phi nodes into their
corresponding MachineCodeForInstruction vectors.

I need to be able to get the register allocated for the thing which is
called PhiCpRes in this code; this should make that task easier, plus,
Phi nodes are no longer "special" in the sense that their
MachineCodeForInstruction is empty.

llvm-svn: 13904
2004-05-30 03:33:49 +00:00
Brian Gaeke
a8b396fe29 Fix typo in head-of-file comment.
llvm-svn: 13903
2004-05-30 03:33:48 +00:00
Reid Spencer
8eb06df5ab 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
3b4302290d Make the Regression/Feature test support excise all ": PASS" lines that
indicate successful tests. We're really only interested in the bad news
in this output :)

llvm-svn: 13901
2004-05-30 00:17:47 +00:00
Reid Spencer
9163bcdf0f Moved this file to lib/Bytecode/Writer because its used there only.
llvm-svn: 13900
2004-05-30 00:09:32 +00:00
Brian Gaeke
24c18879f0 Remove unused #include.
llvm-svn: 13899
2004-05-29 23:26:13 +00:00
Brian Gaeke
42112b4a09 Add comments.
llvm-svn: 13898
2004-05-29 23:10:20 +00:00
Brian Gaeke
2398b17a57 Trim whitespace.
llvm-svn: 13897
2004-05-29 22:49:51 +00:00
Brian Gaeke
7fa398d850 Give InsertCodeForPhis() a new documentation comment.
llvm-svn: 13896
2004-05-29 22:20:59 +00:00
Alkis Evlogimenos
fd735bcf28 Add method to assign stack slot to virtual register without creating a
new one.

llvm-svn: 13895
2004-05-29 20:38:05 +00:00
Alkis Evlogimenos
e3cec71bdc Add grow() member that grows the maps when the number of virtual
registers in the function has changed.

llvm-svn: 13893
2004-05-29 19:03:29 +00:00
Alkis Evlogimenos
1010116a8f Remove defs vector from live intervals.
llvm-svn: 13892
2004-05-29 16:18:57 +00:00
Chris Lattner
446ac25072 Thoroughly rehack the dynamic linking mechanisms on Win32. The Win32
dynamic linker does not automatically search libraries when looking up
symbols with GetProcAddress.  Because of this we have to emulate it.  The
only detail is that there doesn't seem to be a way to enumerate the
libraries loaded, so we have a gross hack (tm).

This make the JIT functional on win32 under cygwin.

llvm-svn: 13887
2004-05-28 23:54:07 +00:00
Chris Lattner
972c68fbdf Prune #includes
llvm-svn: 13886
2004-05-28 23:35:39 +00:00
Chris Lattner
fc69b6a538 Fix bizzare problems when you include Config/dlfcn and Config/windows.h in
the same xlation unit

llvm-svn: 13885
2004-05-28 21:07:11 +00:00
Chris Lattner
f28766ed39 Add links to new-featuer and code-cleanup bugs
llvm-svn: 13884
2004-05-28 20:41:37 +00:00
Chris Lattner
c2506037ae Reid implemented this.
llvm-svn: 13883
2004-05-28 20:30:48 +00:00
Chris Lattner
a9e9d2cbcf Changes to make the nightly tester run the regression tests at night, yaay!
Change contributed by Reid Spencer.

llvm-svn: 13882
2004-05-28 20:30:23 +00:00
Tanya Lattner
50cbb9ad3e updates to ModuloSched
llvm-svn: 13881
2004-05-28 20:14:12 +00:00
Brian Gaeke
90dc744ac0 Give PhiCp nodes better names in many cases.
Simplify InsertPhiElimInstructions(), and give it a better doxygen comment.

llvm-svn: 13880
2004-05-28 19:34:00 +00:00
Brian Gaeke
26925ff857 Make debugging output with -print-machineinstrs more useful: always print out
the transformed LLVM code which is the input to the instruction selector.

llvm-svn: 13879
2004-05-28 19:33:59 +00:00
Chris Lattner
3709627b7d Unbreak the bugpoint image
llvm-svn: 13878
2004-05-28 16:49:54 +00:00
Chris Lattner
c53c2a3a62 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
1bb9661818 Don't use size() when you mean empty()
llvm-svn: 13876
2004-05-28 05:40:19 +00:00
Chris Lattner
49cdc6b564 Minor efficiency gain: do 1 nlogn lookup instead of two
Code cleanup

llvm-svn: 13875
2004-05-28 05:36:49 +00:00
Chris Lattner
c7e2ff2980 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
5b7b6bbd38 Eliminate this form of SymbolTable::remove. It ignores the type argument
anyway.  Add a form that takes a type_iterator for the C backend.

llvm-svn: 13873
2004-05-28 05:30:29 +00:00
Chris Lattner
523d3e6674 Fix one of the major things that is causing the C Backend to infinite loop
llvm-svn: 13872
2004-05-28 05:02:13 +00:00
Chris Lattner
b6d6b931cc Add support for getting executable memory on Windows. This is actually
much easier than on unix.  :)  The only evil thing is that windows.h defines
a macro named FindExecutable, which collides with one of our names.

The JIT now runs on windows, but it cannot resolve external functions
(like printf) yet.

llvm-svn: 13871
2004-05-28 01:20:58 +00:00
Chris Lattner
d54358279d Add a new function for the JIT. libsupport is now the only library that
includes mman.h

llvm-svn: 13870
2004-05-28 00:59:40 +00:00
Chris Lattner
5374edb8ef Add a new function for the JIT
llvm-svn: 13869
2004-05-28 00:58:48 +00:00
Chris Lattner
0bd7797446 Use the SystemUtils.h file to do our dirty work.
llvm-svn: 13868
2004-05-28 00:57:27 +00:00
Chris Lattner
abb26eac9d Right: the #includes are not needed either
llvm-svn: 13867
2004-05-28 00:35:51 +00:00
Chris Lattner
acc6cdda85 Add support for zero length files
llvm-svn: 13866
2004-05-28 00:34:42 +00:00
Chris Lattner
06e381d31e Use fileutilities instead of mmap directly
llvm-svn: 13865
2004-05-28 00:31:36 +00:00
Chris Lattner
9063461603 Use the new FileUtilities.h API for mapping a file into an address
space

llvm-svn: 13864
2004-05-28 00:24:41 +00:00
Chris Lattner
0e713bc208 Add a pair of functions to hide system specific details of mapping a file in for reading.
llvm-svn: 13863
2004-05-28 00:23:48 +00:00
Reid Spencer
9a6bb5fab7 Remove some more dead code resulting from adding setTypeName().
llvm-svn: 13862
2004-05-28 00:21:06 +00:00
Reid Spencer
3ae29942bf Remove an assertion that uses Type::TypeTy that is never hit and will
break when Type::TypeTy goes away. Also remove a dead block of code and
dead comments.

llvm-svn: 13861
2004-05-27 22:05:50 +00:00
Reid Spencer
f43ac62dec Clean up a comment.
llvm-svn: 13860
2004-05-27 22:04:46 +00:00
Reid Spencer
4148139dd9 Fix for bug 348.
The SymbolTable changes caused this one too.

llvm-svn: 13859
2004-05-27 21:58:13 +00:00
Brian Gaeke
1c6f9b4304 Make comment lines stick out less.
llvm-svn: 13858
2004-05-27 21:41:48 +00:00
Chris Lattner
cef00ec3da Remove long unused #includes
llvm-svn: 13857
2004-05-27 21:25:44 +00:00
Chris Lattner
cb9ccac8a7 These #includes are long dead
llvm-svn: 13856
2004-05-27 21:24:38 +00:00
John Criswell
37d2ae92a7 Fix a bug in the -deadtypeelim pass. The SymbolTable re-write changed it
to eliminate the wrong type.

llvm-svn: 13855
2004-05-27 21:16:46 +00:00
Chris Lattner
fc7509b7d4 Fix warnings about reaching end of non-void function
llvm-svn: 13852
2004-05-27 20:57:01 +00:00
Chris Lattner
db3da22f4b Add DynamicLinker support for systems that provide windows.h
llvm-svn: 13851
2004-05-27 20:53:10 +00:00
Chris Lattner
94aac779e1 An "autoconf wrapper" for the infamous windows.h file
llvm-svn: 13849
2004-05-27 20:51:22 +00:00
Reid Spencer
d2eca3d441 Make the test pass by using the correct RUN: syntax.
llvm-svn: 13848
2004-05-27 20:49:16 +00:00
John Criswell
1cd5f920e3 Added a check for a new header file.
My apologies for changing config.h.in.  Now you will all have to
re-configure.

llvm-svn: 13846
2004-05-27 20:40:39 +00:00
Chris Lattner
1553edc2da Neuter the -q option. Stop printing the "program modified" message, ever
llvm-svn: 13844
2004-05-27 20:32:10 +00:00
Reid Spencer
f2f34b3052 Use the SymbolTable::isEmpty() method instead of checking for no value
planes. A SymbolTable could still have types in it! This fixes problems
with two regression tests that failed because a symbol table that only
contained types was being omitted from bytecode files. Thanks to Chris
for the reduced test case that helped find this immediately.

llvm-svn: 13842
2004-05-27 20:18:51 +00:00
Chris Lattner
781479c7d7 Add support for dos-style files
llvm-svn: 13840
2004-05-27 18:28:32 +00:00
Chris Lattner
8232621124 This code is a real mess, but at least get the JIT *building* on platforms
(such as plan 9) without mmap.  Of course it won't RUN... but that's another
step.  :)

llvm-svn: 13839
2004-05-27 18:03:56 +00:00
Chris Lattner
e7bda9c022 doxygen no longer builds into the docs tree, and we no longer have boost
in the tree

llvm-svn: 13838
2004-05-27 17:58:45 +00:00
Chris Lattner
604e19e707 Add support for dos-style files
llvm-svn: 13837
2004-05-27 17:49:14 +00:00
Chris Lattner
1f4e545a89 Add support for dos style files.
llvm-svn: 13836
2004-05-27 17:44:18 +00:00
Chris Lattner
3a45149bd5 Add back a test I accidentally removed
llvm-svn: 13835
2004-05-27 17:43:33 +00:00
Chris Lattner
ed79d8af53 Fix InstCombine/load.ll & PR347.
This code hadn't been updated after the "structs with more than 256 elements"
related changes to the GEP instruction.  Also it was not handling the
ConstantAggregateZero class.

Now it does!

llvm-svn: 13834
2004-05-27 17:30:27 +00:00
Chris Lattner
9b38743684 Add another testcase
llvm-svn: 13833
2004-05-27 17:28:55 +00:00
Reid Spencer
c8878edc5a Re-introduce the -q option and make opt always return 0, even if the
optimization pasess fail. This is necessary to avoid breaking feature
tests in the tests suite that depend on this behavior. *sigh*

llvm-svn: 13832
2004-05-27 16:28:54 +00:00
Reid Spencer
09fabea814 Added a "RUN:" line so this file can be executed by TestRunner.sh
llvm-svn: 13829
2004-05-27 08:28:42 +00:00
Reid Spencer
7873671463 Removed the -q option and the default message written to stderr. The
output produces confusing results in TestRunner.sh

llvm-svn: 13828
2004-05-27 08:26:22 +00:00
Chris Lattner
d4065a6c94 remove bogus test
llvm-svn: 13827
2004-05-27 07:39:51 +00:00
Chris Lattner
076f7493bf Make the test test what it is supposed to
llvm-svn: 13826
2004-05-27 07:37:45 +00:00
Chris Lattner
97462838b2 The -exprs pass is no longer with LLVM. *sniff*
llvm-svn: 13825
2004-05-27 07:36:08 +00:00
Chris Lattner
0ceb07b09e Correct test. use "not grep" instead of "grep -v"
llvm-svn: 13824
2004-05-27 07:32:25 +00:00
Chris Lattner
c6e21fbd5c Implement constant folding of fmod, which is used a lot in povray
llvm-svn: 13823
2004-05-27 07:25:00 +00:00
Chris Lattner
5f1a5bb735 Right, globals aren't values yet..
llvm-svn: 13822
2004-05-27 06:43:37 +00:00
Chris Lattner
06158d140c Restructure call constant folding code a bit to make it simpler
Add support for acos/asin/atan.  188.ammp contains three calls to acos with
constant arguments.  Constant folding it allows elimination of those 3 calls
and three FP divisions of the results.

llvm-svn: 13821
2004-05-27 06:26:28 +00:00
Chris Lattner
8082c74e0a Add a simple pass.
llvm-svn: 13820
2004-05-27 06:13:36 +00:00
Chris Lattner
716793336f Continue the exposition
llvm-svn: 13819
2004-05-27 05:52:10 +00:00
Chris Lattner
c2ee70db2d Continue the implementation
llvm-svn: 13818
2004-05-27 05:51:31 +00:00
Chris Lattner
f74b2868c8 A few more microsteps
llvm-svn: 13817
2004-05-27 05:51:13 +00:00
Chris Lattner
d74befe02a gc_init now gets an argument
llvm-svn: 13816
2004-05-27 05:51:00 +00:00
Chris Lattner
5a4d17bb57 Uhh, that doesn't exist.
llvm-svn: 13815
2004-05-27 05:44:22 +00:00
Chris Lattner
0c4fa93d25 Beta-test moving a header from include/Support into the llvm hierarchy:
it seems to work :)

llvm-svn: 13814
2004-05-27 05:42:33 +00:00
Chris Lattner
278f5152d3 Header file moved
llvm-svn: 13813
2004-05-27 05:41:36 +00:00
Chris Lattner
84647525f6 Header moved
llvm-svn: 13812
2004-05-27 05:37:32 +00:00
Chris Lattner
ed317b2a29 Signals.h header moved. Eventually this should move into a lib/System library,
but not right now.

llvm-svn: 13811
2004-05-27 05:31:24 +00:00
Chris Lattner
8e6c1d1a9b Moved header from include/Support/ to include/llvm/System
llvm-svn: 13810
2004-05-27 05:30:18 +00:00
Chris Lattner
1760ccd7b0 Changes to make libSupport build on systems that don't have the wait syscall.
llvm-svn: 13806
2004-05-27 01:20:55 +00:00
Alkis Evlogimenos
67150528d4 Add section on the newly added Instruction and subclasses constructor
variant.

llvm-svn: 13802
2004-05-27 00:57:51 +00:00
John Criswell
b82cbbfc70 Only give warnings if the user doesn't have mmap(). This is pretty much
a hack that allows users to fight through a build if they don't have mmap().
When I get into the office, I'll make something better.

llvm-svn: 13801
2004-05-27 00:57:50 +00:00
Alkis Evlogimenos
e3260007bc 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
Chris Lattner
52a71340c1 Fix a test that was "broken" by new optimizations. The transformation we
are doing is certainly correct, its just that we didn't have the capability
to do it when the testcase was written (no select instr)

llvm-svn: 13799
2004-05-26 23:51:29 +00:00
Alkis Evlogimenos
0eefdcd73f Do not pass a null pointer if this instruction is not prepended or
appended anywhere.

llvm-svn: 13798
2004-05-26 22:50:28 +00:00
Alkis Evlogimenos
af494c5f13 Inline trivial constructors.
llvm-svn: 13797
2004-05-26 22:07:18 +00:00
Reid Spencer
56010e4077 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
Reid Spencer
5b4413cb03 Provide the correct patch for bug 345. The solution is to add a setTypeName
function to llvmAsmParser.y and then use it in the one place in the grammar
that needs it. Also had to make Type::setName public because setTypeName
needs it in order to retain compatibility with setValueName.

llvm-svn: 13795
2004-05-26 21:48:31 +00:00
Reid Spencer
ebb1569d38 Tighten up checking on SymbolTable interface to make it illegal to pass a
Type* where a Value* is expected.

llvm-svn: 13794
2004-05-26 21:46:18 +00:00
Alkis Evlogimenos
9f0fdf7482 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
Alkis Evlogimenos
9e84b503f0 Use one destination constructor for the unconditional branch.
llvm-svn: 13792
2004-05-26 21:38:14 +00:00
Misha Brukman
6d6f276813 Fix spelling of doxygen directive.
llvm-svn: 13791
2004-05-26 17:42:51 +00:00
Chris Lattner
83d067a103 Fix PR344: the incorrect remove was being used.
llvm-svn: 13790
2004-05-26 17:20:52 +00:00
Chris Lattner
6eea16e526 Make the test use the %A type
llvm-svn: 13789
2004-05-26 17:14:49 +00:00
Chris Lattner
1f08746f72 A quick and ugly hack to fix PR345. I used TypeTy specifically to make
Reid cringe :)

llvm-svn: 13788
2004-05-26 17:08:25 +00:00
Chris Lattner
cc83417e6c Fix a bug in reid's checkin
llvm-svn: 13787
2004-05-26 16:52:55 +00:00
Reid Spencer
9aed59b2c8 Added a section on the SymbolTable class.
llvm-svn: 13786
2004-05-26 08:41:35 +00:00
Reid Spencer
0aff01a239 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
16f2f7fba0 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
Tanya Lattner
642685a400 Adding scheduling class.
llvm-svn: 13783
2004-05-26 06:27:36 +00:00
Tanya Lattner
a066df6bd7 Updating my cvs versions. THis is still in progress and much will be changed.
llvm-svn: 13782
2004-05-26 06:27:18 +00:00
Brian Gaeke
230deea60f Add a (not very meaningful) default constructor for AllocInfo objects.
llvm-svn: 13773
2004-05-25 20:43:47 +00:00
Reid Spencer
abac0ef0b7 Put SlotTable.h inclusion back at front of list to be coding standards
compliant. Thanks, Chris.

llvm-svn: 13771
2004-05-25 20:09:05 +00:00
Reid Spencer
d936d812bc Change the install-includes target to completely ignore the llvm/Internal
directory. Headers located there are not public to LLVM but are shared
between LLVM modules.

llvm-svn: 13769
2004-05-25 20:01:25 +00:00
Reid Spencer
6244bc7831 Make the constructor explicit so we can't implicitly convert bool to
SlotTable.

llvm-svn: 13766
2004-05-25 19:09:25 +00:00
Reid Spencer
37dd30c00a Make some improvements suggested by Chris.
llvm-svn: 13765
2004-05-25 19:03:21 +00:00
Reid Spencer
4feb245a31 Adding the initial implementation of the SlotTable class. This class is
the Abstract Data Type that holds slot number values and associates them
with Type* and Value*. The SlotTable is simply the holder of the slot
numbers and provides a controlled interface for building the table. It does
not enforce any particular idiom or functionality for manipulating the slot
numbers.

This is part of bug_122. The SlotCalculator and SlotMachine classes will
follow.

llvm-svn: 13764
2004-05-25 18:44:51 +00:00
Alkis Evlogimenos
40f9a8730a Remove this file as well as it is no longer needed nor it compiles
llvm-svn: 13762
2004-05-25 18:24:27 +00:00
Reid Spencer
5264183123 Document a couple functions.
llvm-svn: 13761
2004-05-25 18:14:38 +00:00
Chris Lattner
e7d5ec2b68 Make use of the doc_author and doc_code styles. <tt>'ify llvm names. Minor
other edits

llvm-svn: 13760
2004-05-25 17:44:58 +00:00
Reid Spencer
660ea5fadb Changed to use SymbolTable's new iteration interfaces.
llvm-svn: 13759
2004-05-25 17:29:59 +00:00
Reid Spencer
ea41b4fb83 Changed to use SymbolTable's new lookup interface.
llvm-svn: 13758
2004-05-25 17:29:21 +00:00
Reid Spencer
15e969a45e Removed unused, useless header file.
llvm-svn: 13757
2004-05-25 17:28:35 +00:00
Reid Spencer
49ad21ce7b Added a bit on slot numbers.
llvm-svn: 13756
2004-05-25 15:47:57 +00:00
Reid Spencer
877b9a2f31 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
e7e9671cad Convert to SymbolTable's new iteration interface.
llvm-svn: 13754
2004-05-25 08:53:40 +00:00
Reid Spencer
47cf71a61e Convert to SymbolTable's new iteration interface. Remove tabs.
llvm-svn: 13753
2004-05-25 08:53:29 +00:00
Reid Spencer
3f6a692a21 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
abb6f008ca Convert to SymbolTable's new lookup and iteration interfaces.
llvm-svn: 13751
2004-05-25 08:52:20 +00:00
Reid Spencer
297d7fe7e6 Remove unused header file.
llvm-svn: 13750
2004-05-25 08:51:36 +00:00
Reid Spencer
1cc31f264f Make this pass simply invoke SymbolTable::strip().
llvm-svn: 13749
2004-05-25 08:51:25 +00:00
Reid Spencer
14428ac740 Remove use of Type::TypeTy from an assert. It will go away soon.
llvm-svn: 13748
2004-05-25 08:50:52 +00:00
Reid Spencer
7b8a3b550a Get rid of a wart: useless getFILE function is now a cast macro.
llvm-svn: 13747
2004-05-25 08:46:15 +00:00
Reid Spencer
50e3db3a64 Give Type its own dump() method in preparation for Type != Value.
llvm-svn: 13746
2004-05-25 08:46:04 +00:00
Reid Spencer
1eb1ef009e 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: 13745
2004-05-25 08:45:53 +00:00
Reid Spencer
303a74d2b7 Convert dump() method to call Type::dump() instead of Value::dump().
llvm-svn: 13744
2004-05-25 08:45:42 +00:00
Reid Spencer
bbea18c182 Fix a small typo.
llvm-svn: 13743
2004-05-25 08:45:31 +00:00
Vikram S. Adve
f6c4ee0744 Recognize memalign and friends, and handle them specially.
llvm-svn: 13741
2004-05-25 08:14:52 +00:00
Chris Lattner
e1e10e1883 Implement InstCombine:shift.ll:test16, which turns (X >> C1) & C2 != C3
into (X & (C2 << C1)) != (C3 << C1), where the shift may be either left or
right and the compare may be any one.

This triggers 1546 times in 176.gcc alone, as it is a common pattern that
occurs for bitfield accesses.

llvm-svn: 13740
2004-05-25 06:32:08 +00:00
Chris Lattner
6a02158bc5 New testcase
llvm-svn: 13739
2004-05-25 06:30:49 +00:00
Chris Lattner
db8bdba593 Implement some helpers
llvm-svn: 13738
2004-05-25 05:32:43 +00:00
Chris Lattner
bbdd577a00 Add some helpers
llvm-svn: 13737
2004-05-25 05:32:13 +00:00
Chris Lattner
03841659a4 Implement instcombine/cast.ll:test16:
Canonicalize cast X to bool into a setne instruction

llvm-svn: 13736
2004-05-25 04:29:21 +00:00
Chris Lattner
608c18f20c Add a new test16 and fix some other tests that were not properly written
llvm-svn: 13735
2004-05-25 04:28:43 +00:00
Chris Lattner
64556f042a Make doc_code shrink-to-fit. This only works in mozilla, but it doesn't
hurt legibility on IE

llvm-svn: 13720
2004-05-24 18:05:58 +00:00
Tanya Lattner
91fa3a9908 Moved MachineBasicBlock deconstructor to cpp file and removed it from LeakDetector to fix memory leak bug.
llvm-svn: 13718
2004-05-24 07:14:35 +00:00
Chris Lattner
6f02714a10 Fix a bug in my previous checkin
llvm-svn: 13717
2004-05-24 06:24:46 +00:00
Tanya Lattner
a578cb7a65 Added MachineFunction parent* to MachineBasicBlock. Customized ilist template
to set the parent when a MachineBasicBlock is added to a MachineFunction.

llvm-svn: 13716
2004-05-24 06:11:51 +00:00
Chris Lattner
a0390ec7f9 Lots of minor typo fixes, some minor inaccuracies fixed, and some new material.
llvm-svn: 13715
2004-05-24 05:35:17 +00:00
Chris Lattner
57e7a4cd56 new feature
llvm-svn: 13714
2004-05-24 05:34:32 +00:00
Chris Lattner
b97a9b2e7e Fix a couple of busted li's
llvm-svn: 13713
2004-05-24 04:55:32 +00:00
Chris Lattner
1224615f62 Add a todo to make it clear that the section is not done
llvm-svn: 13712
2004-05-24 04:54:31 +00:00
Chris Lattner
f10ccbfab8 Personally, I think that documentation is as important as code. Increase
the visibility of dox changes

llvm-svn: 13711
2004-05-24 04:53:32 +00:00
Chris Lattner
21a9040464 Fix a div problem that was causing some wierd indentation. Get more div'y
llvm-svn: 13710
2004-05-24 04:50:25 +00:00
Chris Lattner
eda4f47d87 Add some notes
llvm-svn: 13709
2004-05-24 04:45:52 +00:00
Chris Lattner
e0de86c36c Add a link to the GC doc
llvm-svn: 13708
2004-05-24 04:43:49 +00:00
Chris Lattner
18dad6ed52 Eliminate an explicit use of the LLVM basic block, using getParent instead,
which simplifies the code

llvm-svn: 13707
2004-05-24 03:44:52 +00:00
Tanya Lattner
bcee21b491 Changed clone to be const.
Changed copy constructor to set parent, prev, and next pointers to null.

llvm-svn: 13706
2004-05-24 03:14:18 +00:00
Alkis Evlogimenos
4da5264253 Eliminate warnings
llvm-svn: 13704
2004-05-23 23:02:35 +00:00
Chris Lattner
c4e2053767 Testcases for andersen's alias analysis.
I think this is all of the stuff I had pending in my tree..

llvm-svn: 13703
2004-05-23 21:31:00 +00:00
Chris Lattner
99173879ad Spelling people's names right is kinda important
llvm-svn: 13702
2004-05-23 21:27:29 +00:00
Chris Lattner
48ae330f2e Build the garbage collectors
llvm-svn: 13701
2004-05-23 21:26:29 +00:00
Chris Lattner
9656fe9cdc Initial checkin of GC implementation support files
llvm-svn: 13700
2004-05-23 21:25:59 +00:00
Reid Spencer
e1a5727733 Create a new style for tables that have no width (.doc_table_nw) so the
table doesn't stretch across the whole page. Change for BytecodeFormat.html

llvm-svn: 13699
2004-05-23 21:25:50 +00:00
Chris Lattner
843cef8f3b Check in an EARLY START on a simple copying collector
llvm-svn: 13698
2004-05-23 21:25:45 +00:00
Chris Lattner
acd339ea4f Add a simple testcase for garbage collection support
llvm-svn: 13697
2004-05-23 21:24:50 +00:00
Chris Lattner
6e4edd65ab Add support for accurate garbage collection to the LLVM code generators
llvm-svn: 13696
2004-05-23 21:23:35 +00:00
Chris Lattner
3ef067ff33 Add some notes to myself, no functional changes
llvm-svn: 13695
2004-05-23 21:23:12 +00:00
Chris Lattner
66911019e7 minor wording change
llvm-svn: 13694
2004-05-23 21:22:55 +00:00
Chris Lattner
6754b827c6 Fix cases where we missed inlining some more obvious candidates because the
caller was in an SCC.

llvm-svn: 13693
2004-05-23 21:22:17 +00:00
Chris Lattner
8d7ff5e3dd Simplify the interface and remove an unneeded #include
llvm-svn: 13692
2004-05-23 21:21:35 +00:00
Chris Lattner
254f8f8ad5 Fairly substantial changes to update the alias analysis we are querying as
we make the transformation.  This allows us to use interprocedural alias
analyses successfully.

llvm-svn: 13691
2004-05-23 21:21:17 +00:00
Chris Lattner
289ba2ac4d Adjust to the changes in the AliasSetTracker interface
llvm-svn: 13690
2004-05-23 21:20:19 +00:00
Chris Lattner
e67dbc2ae2 Add support for replacement of formal arguments with simpler expressions.
llvm-svn: 13689
2004-05-23 21:19:55 +00:00
Chris Lattner
099c8cfe90 Implement the -lowergc pass which is used by code generators (like the CBE)
that do not have builtin support for garbage collection.

llvm-svn: 13688
2004-05-23 21:19:22 +00:00
Chris Lattner
9c251eb0ad Recognize and verify the new GC intrinsics.
llvm-svn: 13687
2004-05-23 21:16:51 +00:00
Chris Lattner
abc125169b Add the new GC intrinsics
llvm-svn: 13686
2004-05-23 21:16:33 +00:00
Chris Lattner
e6113c06b1 Add a new prototype
llvm-svn: 13685
2004-05-23 21:16:13 +00:00
Chris Lattner
62c37008a4 Changes to work with the changes to the AliasAnalysis interface. The -no-aa
class is now in the BasicAliasAnalysis.cpp file

llvm-svn: 13684
2004-05-23 21:15:48 +00:00
Chris Lattner
59c8ed8843 Move the -no-aa AA implementation into this file since both of these
alias analysis implementations are special: they do not autoforward to a
chained implementation of alias analysis

llvm-svn: 13683
2004-05-23 21:15:12 +00:00
Chris Lattner
e345f6b5ab Updates to work with the new auto-forwarding AA interface changes
llvm-svn: 13682
2004-05-23 21:14:27 +00:00
Chris Lattner
e657eb17cc Fix a really nasty bug with the -disable-ds-field-sensitivity option
llvm-svn: 13681
2004-05-23 21:14:09 +00:00
Chris Lattner
befe4c510e Update to match the autochaining interface that the AA interface uses
llvm-svn: 13680
2004-05-23 21:13:51 +00:00
Chris Lattner
32502b8d4a Implement the interfaces to update value numbering information. Add an
assert.

llvm-svn: 13679
2004-05-23 21:13:24 +00:00
Chris Lattner
8f2b467feb Several *major* changes to the AA interfaces:
1. Provide interfaces so that clients can update alias analyses to reflect
   the changes made by the transformations.
2. Change how alias analysis implementations work overall.  In particular,
   now clients will automatically forward to chained AA implementations: they
   don't have to remember to do it themselves.

llvm-svn: 13678
2004-05-23 21:12:38 +00:00
Chris Lattner
98da971901 Add interfaces to update value numbering results
llvm-svn: 13677
2004-05-23 21:11:17 +00:00
Chris Lattner
746e1e1808 Rename a method
llvm-svn: 13676
2004-05-23 21:10:58 +00:00
Chris Lattner
020e1fc733 Make use of the new doc_author class. "Seperate content from presentation" they said.
llvm-svn: 13675
2004-05-23 21:07:27 +00:00
Chris Lattner
4dd45ffdb6 Lots of minor cleanups and clarifications
llvm-svn: 13674
2004-05-23 21:06:58 +00:00
Chris Lattner
ed0ec7afbb Remove implemented stuff
llvm-svn: 13673
2004-05-23 21:06:21 +00:00
Chris Lattner
757528b0b6 Describe the new garbage collector intrinsics
llvm-svn: 13672
2004-05-23 21:06:01 +00:00
Chris Lattner
411eba181a Lots of minor fixes and formatting improvements
llvm-svn: 13671
2004-05-23 21:05:39 +00:00
Chris Lattner
1dab192f22 Update the coding standards, removign the bit about avoiding exceptions and
rtti (they shouldn't be used in the main compiler, but that's because
optimizations aren't allowed to fail!)

Remove the big section about iterators, because people who do not know what
they are doing shouldn't be writing them.  :)

llvm-svn: 13670
2004-05-23 21:05:07 +00:00
Chris Lattner
2a19d83689 Substantially expand and update the alias analysis documentation, including
adding blurbs about all of the implementations we have

llvm-svn: 13669
2004-05-23 21:04:01 +00:00
Chris Lattner
e25f4fffff Various changes to make the docs look nicer. Add a new doc_author class.
The one thing that someone (misha?) should look at is fixing doc_code so that it sizes to fit the code instead of going to the right margin all of the way.  Fixing it at a particular number of pixels was just wrong. :)

llvm-svn: 13668
2004-05-23 21:03:30 +00:00
Chris Lattner
f689d57f0f Add a new document describing the LLVM accurate garbage collection support.
llvm-svn: 13667
2004-05-23 21:02:20 +00:00
Chris Lattner
5758134505 Add a simple implementation of Andersen's interprocedural pointer analysis
llvm-svn: 13666
2004-05-23 21:00:47 +00:00
Tanya Lattner
9953d86e63 Fixed up my changes to add support for cloning Machine Instructions.
llvm-svn: 13665
2004-05-23 20:58:02 +00:00
Alkis Evlogimenos
ee4dcae9ba Remove virtual destructor from InstVisitor. This class should never be
used through a base pointer/reference so inproper destruction should
never be an issue. Removing this last virtual function also saves 4
bytes off each InstVisitor instance.

llvm-svn: 13664
2004-05-23 20:54:39 +00:00
Chris Lattner
23257069b6 Fix a couple misplaced div tags
llvm-svn: 13663
2004-05-23 20:42:08 +00:00
Chris Lattner
f45d23b85c Revert back to the previous version, as it doesn't work with mozilla, and people REALLY CAN just click the link. :)
llvm-svn: 13662
2004-05-23 20:29:35 +00:00
Tanya Lattner
e6a4a7dbcf Adding support to clone MachineInstr
llvm-svn: 13661
2004-05-23 19:35:12 +00:00
Reid Spencer
3e58f5880a Added a "Miscellaneous Improvements" section to cover things like the
Bytecode File Format documentation, getting all documents in HTML 4.01
(Strict) compliance, and any other minor improvement that shoud be noted.

llvm-svn: 13660
2004-05-23 17:23:13 +00:00
Reid Spencer
ac9cc8c82d Make the file HTML 4.01 (Strict) clean.
llvm-svn: 13659
2004-05-23 17:12:45 +00:00
Reid Spencer
eca340ba12 Additional content describing variable bit rate encoding, correcting the
definition of the signature block and module block, and adding definitions
of the global type pool and symbol table. More still to come.

llvm-svn: 13658
2004-05-23 17:05:09 +00:00
Alkis Evlogimenos
22acc1268d Put back the inlined bug list. Use the OBJECT tag to make it HTML-4.01
(Strict)-compliant.

llvm-svn: 13655
2004-05-23 11:10:55 +00:00
Vikram S. Adve
189d626ad6 Remember the set of leaders. Also compute on demand and cache the equiv
class for each leader.   Finally, rename Elem2ECLeaderMap to Elem2LeaderMap
(most of the changed lines are only due to the latter).

llvm-svn: 13651
2004-05-23 08:05:14 +00:00
Vikram S. Adve
16f29f349d Add getCaller() method.
llvm-svn: 13650
2004-05-23 08:02:45 +00:00
Vikram S. Adve
159ed21b67 Inline both direct and indirect callees in the CBU phase because
a direct callee may have indirect callees and so may have changed.

llvm-svn: 13649
2004-05-23 08:00:34 +00:00
Vikram S. Adve
c5e27638dd Complete rewrite of the code that merges DS graphs for equivalence classes
of functions called at a common call site.  The rewrite inlines the
resulting graphs bottom-up on the SCCs of the CBU call graph.  It also
simplifies the merging of equivalence classes by exploiting the fact that
functions in non-trivial SCCs are already merged.

llvm-svn: 13645
2004-05-23 07:54:02 +00:00
Vikram S. Adve
f44d32d9e2 Fix size/offset assertion to allow negative offsets and folded nodes.
llvm-svn: 13644
2004-05-23 07:34:53 +00:00
Brian Gaeke
d4889be5ca Fix a typo in a comment.
llvm-svn: 13643
2004-05-23 05:10:06 +00:00
Brian Gaeke
74b08516e9 Fix a typo in the head-of-file comment.
Rewrite the comments about the different versions of BuildMI, to
better emphasize their differences.

llvm-svn: 13642
2004-05-23 05:04:00 +00:00
Reid Spencer
257dbb00fe Some additional data added to the bytecode specification.
llvm-svn: 13626
2004-05-22 05:56:41 +00:00
Reid Spencer
9acd412316 Added an initial template/overview for documentation of the LLVM Bytecode
file format. This format is being extracted from the source code and the
small recesses of Chris' brain.

llvm-svn: 13625
2004-05-22 02:28:36 +00:00
Reid Spencer
deea18188e Removed the 64-bit fix from the "to do" list since the bug is fixed.
llvm-svn: 13624
2004-05-22 01:04:19 +00:00
Misha Brukman
144c77b515 Pass the Makefile flags to recursive makes in {PARALLEL,OPTIONAL}_DIRS targets.
llvm-svn: 13623
2004-05-21 23:21:11 +00:00
Chris Lattner
37c653a28e It's not clear to me whether the old version was correct C++ code, but in
any case it's not portable.

llvm-svn: 13621
2004-05-21 18:38:16 +00:00
Chris Lattner
54291f6005 Starting an identifier with an _ is not legal C/C++ code.
llvm-svn: 13620
2004-05-21 18:37:13 +00:00
Chris Lattner
8f7cf27241 Bug fixed
llvm-svn: 13619
2004-05-21 16:48:20 +00:00
Chris Lattner
ab5aa14403 Fix for PR340: Verifier misses malformed switch instruction
llvm-svn: 13618
2004-05-21 16:47:21 +00:00
Chris Lattner
6041fee872 Testcase for PR340: Verifier misses malformed switch instruction
This testcase was reduced by John, thanks!

llvm-svn: 13617
2004-05-21 16:47:02 +00:00
Misha Brukman
3e810058a7 Pass given flags on to recursive sub-makes.
llvm-svn: 13616
2004-05-21 00:09:21 +00:00
Alkis Evlogimenos
e716bafbc8 Change DEPRECATED macro to ATTR_DEPRECATED as this conflicts with some
java constants.

llvm-svn: 13611
2004-05-20 21:31:43 +00:00
Chris Lattner
83c139d575 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
Brian Gaeke
7b7a14d718 Fix a bug in outputting branches to constant PCs. Since the PC is supplied as
a full 64-bit address, it must be adjusted to fit in the branch instruction's
immediate field. (This is only used in the reoptimizer, for now.)

llvm-svn: 13608
2004-05-20 07:43:40 +00:00
Brian Gaeke
e8949b3083 Minor simplification: eliminate a dyn_cast.
Fix a typo in a debug message.

llvm-svn: 13607
2004-05-19 21:30:01 +00:00
Misha Brukman
bd094e73d2 Add hint about syntax-highlighting non-standardly-named LLVM Makefiles.
llvm-svn: 13606
2004-05-19 21:20:40 +00:00
Alkis Evlogimenos
c5bd926a62 Declare function defined in namespace llvm as gcc-3.4 doesn't accept a definition in a namespace of a non-declared function.
llvm-svn: 13602
2004-05-19 19:17:48 +00:00
Brian Gaeke
72185765bc Add CloneTraceInto(), which is based on (and has mostly the same
effects as) CloneFunctionInto().

llvm-svn: 13601
2004-05-19 09:08:14 +00:00
Brian Gaeke
6182acf92a Move RemapInstruction() to ValueMapper, so that it can be shared with
CloneTrace, and because it is primarily an operation on ValueMaps.  It
is now a global (non-static) function which can be pulled in using
ValueMapper.h.

llvm-svn: 13600
2004-05-19 09:08:12 +00:00
Misha Brukman
926e0f9eef Minor aesthetic alignments; no functional changes.
llvm-svn: 13593
2004-05-17 22:28:21 +00:00
Misha Brukman
40c6d6d307 * Minor aesthetic alignment of iterator declarations
* Removed redundant function comments

llvm-svn: 13592
2004-05-17 22:25:12 +00:00
Brian Gaeke
fced05bd44 Define erase forwarding method on traces
llvm-svn: 13591
2004-05-17 21:17:21 +00:00
Brian Gaeke
e8a6bf3d21 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
Brian Gaeke
27e4943516 Clean up this pass somewhat:
Add better comments, including a better head-of-file comment.
Prune #includes.
Fix a FIXME that Chris put here by using doInitialization().
Use DEBUG() to print out debug msgs.
Give names to basic blocks inserted by this pass.
Expand tabs.
Use InsertProfilingInitCall() from ProfilingUtils to insert the initialize call.

llvm-svn: 13581
2004-05-14 21:21:52 +00:00
Misha Brukman
7e39a19ecb Rename "User's Guide" to "Command Guide" to be consistent with current scheme.
llvm-svn: 13580
2004-05-14 20:29:11 +00:00
Misha Brukman
0dbe2acf5f Ignore generated ps files.
llvm-svn: 13579
2004-05-14 20:26:45 +00:00
Misha Brukman
d198ac5470 Ignore generated man files.
llvm-svn: 13578
2004-05-14 20:26:39 +00:00
Misha Brukman
caed51e6f7 Ignore generated HTML files.
llvm-svn: 13577
2004-05-14 20:26:34 +00:00
Misha Brukman
5ac525ba39 This is the stylesheet used by perldoc.com; we shall modify it as we see fit.
llvm-svn: 13576
2004-05-14 20:25:35 +00:00
Misha Brukman
13b433ecf5 Put outputs of each type into a separate subdirectory.
llvm-svn: 13575
2004-05-14 20:24:59 +00:00
Brian Gaeke
ee7068ef6d More pods... work in progress
llvm-svn: 13574
2004-05-14 19:50:33 +00:00
Misha Brukman
67abadb055 Use <pre> instead of <p><tt> combo to decrease space used for code blocks.
llvm-svn: 13573
2004-05-14 19:04:07 +00:00
Misha Brukman
c050f9fbc3 Mention the --tool-args option that Brian and Chris added.
llvm-svn: 13572
2004-05-14 18:57:24 +00:00
Misha Brukman
0c05819cf5 Make link to HowToSubmitABug.html local instead of to LLVM website.
llvm-svn: 13571
2004-05-14 18:54:04 +00:00
Brian Gaeke
1274e44002 NAME section is supposed to have a brief description, for apropos(1) & whatis(1)
llvm-svn: 13570
2004-05-14 18:31:13 +00:00
Brian Gaeke
c5565949df This seems like as good a place as any to keep POD files.
llvm-svn: 13569
2004-05-14 18:03:22 +00:00
Brian Gaeke
de5ccc18e3 Don't keep track of references to LLVM BasicBlocks while emitting; use
MachineBasicBlocks instead.

llvm-svn: 13568
2004-05-14 06:54:58 +00:00
Brian Gaeke
2b3a81cd33 Support MachineBasicBlock operands on RawFrm instructions.
Get rid of separate numbering for LLVM BasicBlocks; use the automatically
generated MachineBasicBlock numbering.

llvm-svn: 13567
2004-05-14 06:54:57 +00:00
Brian Gaeke
35e73e1ca4 Generate branch machine instructions with MachineBasicBlock operands instead of
LLVM BasicBlock operands.

llvm-svn: 13566
2004-05-14 06:54:56 +00:00
Chris Lattner
0026512bac This was not meant to be committed
llvm-svn: 13565
2004-05-13 20:56:34 +00:00
Chris Lattner
c12c945cc4 Fix a nasty bug that caused us to unroll EXTREMELY large loops due to overflow
in the size calculation.

This is not something you want to see:
Loop Unroll: F[main] Loop %no_exit Loop Size = 2 Trip Count = 2147483648 - UNROLLING!

The problem was that 2*2147483648 == 0.

Now we get:
Loop Unroll: F[main] Loop %no_exit Loop Size = 2 Trip Count = 2147483648 - TOO LARGE: 4294967296>100

Thanks to some anonymous person playing with the demo page that repeatedly
caused zion to go into swapping land.  That's one way to ensure you'll get
a quick bugfix.  :)

Testcase here: Transforms/LoopUnroll/2004-05-13-DontUnrollTooMuch.ll

llvm-svn: 13564
2004-05-13 20:43:31 +00:00
Chris Lattner
535a48942a New testcase that used to cause the unroller to try to unroll the loop 2G times. :(
llvm-svn: 13563
2004-05-13 20:43:15 +00:00
Misha Brukman
7dcf665ed0 Specify units in padding length.
llvm-svn: 13560
2004-05-13 16:37:52 +00:00
Misha Brukman
603492299a Make page HTML-4.01 compliant (& => &amp; in URL).
llvm-svn: 13559
2004-05-13 16:37:23 +00:00
Chris Lattner
8e7aea026a Two more improvements for null pointer handling: storing a null pointer
and passing a null pointer into a function.

For this testcase:

void %test(int** %X) {
  store int* null, int** %X
  call void %test(int** null)
  ret void
}

we now generate this:

test:
        sub %ESP, 12
        mov %EAX, DWORD PTR [%ESP + 16]
        mov DWORD PTR [%EAX], 0
        mov DWORD PTR [%ESP], 0
        call test
        add %ESP, 12
        ret

instead of this:

test:
        sub %ESP, 12
        mov %EAX, DWORD PTR [%ESP + 16]
        mov %ECX, 0
        mov DWORD PTR [%EAX], %ECX
        mov %EAX, 0
        mov DWORD PTR [%ESP], %EAX
        call test
        add %ESP, 12
        ret

llvm-svn: 13558
2004-05-13 15:26:48 +00:00
Chris Lattner
593d22d666 Second half of my fixed-sized-alloca patch. This folds the LEA to compute
the alloca address into common operations like loads/stores.

In a simple testcase like this (which is just designed to excersize the
alloca A, nothing more):

int %test(int %X, bool %C) {
        %A = alloca int
        store int %X, int* %A
        store int* %A, int** %G
        br bool %C, label %T, label %F
T:
        call int %test(int 1, bool false)
        %V = load int* %A
        ret int %V
F:
        call int %test(int 123, bool true)
        %V2 = load int* %A
        ret int %V2
}

We now generate:

test:
        sub %ESP, 12
        mov %EAX, DWORD PTR [%ESP + 16]
        mov %CL, BYTE PTR [%ESP + 20]
***     mov DWORD PTR [%ESP + 8], %EAX
        mov %EAX, OFFSET G
        lea %EDX, DWORD PTR [%ESP + 8]
        mov DWORD PTR [%EAX], %EDX
        test %CL, %CL
        je .LBB2 # PC rel: F
.LBB1:  # T
        mov DWORD PTR [%ESP], 1
        mov DWORD PTR [%ESP + 4], 0
        call test
***     mov %EAX, DWORD PTR [%ESP + 8]
        add %ESP, 12
        ret
.LBB2:  # F
        mov DWORD PTR [%ESP], 123
        mov DWORD PTR [%ESP + 4], 1
        call test
***     mov %EAX, DWORD PTR [%ESP + 8]
        add %ESP, 12
        ret

Instead of:

test:
        sub %ESP, 20
        mov %EAX, DWORD PTR [%ESP + 24]
        mov %CL, BYTE PTR [%ESP + 28]
***     lea %EDX, DWORD PTR [%ESP + 16]
***     mov DWORD PTR [%EDX], %EAX
        mov %EAX, OFFSET G
        mov DWORD PTR [%EAX], %EDX
        test %CL, %CL
***     mov DWORD PTR [%ESP + 12], %EDX
        je .LBB2 # PC rel: F
.LBB1:  # T
        mov DWORD PTR [%ESP], 1
        mov %EAX, 0
        mov DWORD PTR [%ESP + 4], %EAX
        call test
***     mov %EAX, DWORD PTR [%ESP + 12]
***     mov %EAX, DWORD PTR [%EAX]
        add %ESP, 20
        ret
.LBB2:  # F
        mov DWORD PTR [%ESP], 123
        mov %EAX, 1
        mov DWORD PTR [%ESP + 4], %EAX
        call test
***     mov %EAX, DWORD PTR [%ESP + 12]
***     mov %EAX, DWORD PTR [%EAX]
        add %ESP, 20
        ret

llvm-svn: 13557
2004-05-13 15:12:43 +00:00
Chris Lattner
2bb3325965 Substantially improve code generation for address exposed locals (aka fixed
sized allocas in the entry block).  Instead of generating code like this:

entry:
  reg1024 = ESP+1234
... (much later)
  *reg1024 = 17


Generate code that looks like this:
entry:
  (no code generated)
... (much later)
  t = ESP+1234
  *t = 17

The advantage being that we DRAMATICALLY reduce the register pressure for these
silly temporaries (they were all being spilled to the stack, resulting in very
silly code).  This is actually a manual implementation of rematerialization :)

I have a patch to fold the alloca address computation into loads & stores, which
will make this much better still, but just getting this right took way too much time
and I'm sleepy.

llvm-svn: 13554
2004-05-13 07:40:27 +00:00
Reid Spencer
1b3b3ef375 Reduce line length to about 80 chars.
llvm-svn: 13538
2004-05-13 03:40:27 +00:00
Misha Brukman
53dd5e66eb Insert spacing between the table and the next section.
llvm-svn: 13523
2004-05-13 00:37:23 +00:00
Misha Brukman
4642d92b12 * Use stylesheets for table borders so we factor out the formatting and can
adjust it much easier. Also changed border to gray to fit into the current
  color scheme.
* Convert < and > to &lt; and &gt;, respectively.
* Wrap long lines at 80 cols

llvm-svn: 13522
2004-05-13 00:24:43 +00:00
Brian Gaeke
99e7c1cf44 Fix a comment.
llvm-svn: 13518
2004-05-12 21:57:23 +00:00
Chris Lattner
6307b8d061 Fix a really nasty bug from my changes on Monday to PHIElim. These changes
broke obsequi and a lot of other things.  It all boiled down to MBB being
overloaded in an inner scope and me confusing it with the one in the outer
scope.  Ugh!

llvm-svn: 13517
2004-05-12 21:47:57 +00:00
Misha Brukman
fa50a224bf Break lines at 80 cols; eliminate extra space caused by a single <p> tag on a
line by itself.

llvm-svn: 13516
2004-05-12 21:46:05 +00:00
Brian Gaeke
4cf17775e8 Start NextMBBNumber out at zero.
llvm-svn: 13515
2004-05-12 21:35:23 +00:00
Brian Gaeke
cb5d22a0cb Add non-const MachineBasicBlock::getParent() accessor method.
MBBs start out as #-1. When a MBB is added to a MachineFunction, it
gets the next available unique MBB number. If it is removed from a
MachineFunction, it goes back to being #-1.

llvm-svn: 13514
2004-05-12 21:35:22 +00:00
Brian Gaeke
379e609e3d Add a NextMBBNumber field w/ incrementing accessor method, for
function-level unique numbering of MBBs.

llvm-svn: 13513
2004-05-12 21:35:21 +00:00
Brian Gaeke
00db6be879 Add a Number field w/ accessor method, for function-level unique numbering
of MBBs.

Add non-const MachineBasicBlock::getParent() accessor method.

llvm-svn: 13512
2004-05-12 21:35:20 +00:00
Chris Lattner
c9ebda0fcd Make the subsubsections stand out a bit more
llvm-svn: 13511
2004-05-12 21:28:08 +00:00
Misha Brukman
fdb2b17b3c These images have been moved to img/
llvm-svn: 13510
2004-05-12 21:26:39 +00:00
Misha Brukman
3c1f8e7aa7 Use the images in the img/ directory.
llvm-svn: 13509
2004-05-12 21:26:16 +00:00
Misha Brukman
746c5181cd Finally, switch to a stylesheet that makes the documentation easier on the eyes
and consistent with the LLVM website.

llvm-svn: 13508
2004-05-12 21:20:56 +00:00
Misha Brukman
9d05fbf7be Centralize images in this dir; add lines.gif from website for consistent
formatting.

llvm-svn: 13507
2004-05-12 21:20:13 +00:00
Misha Brukman
e15655b404 Make file use stylesheets and be HTML-4.01 (Strict)-compliant.
llvm-svn: 13506
2004-05-12 20:57:43 +00:00
Misha Brukman
6eb0085f65 Made document HTML-4.01 (Strict)-compliant.
llvm-svn: 13505
2004-05-12 19:52:00 +00:00
Misha Brukman
c1aac03803 Make file standard-compliant once again.
llvm-svn: 13504
2004-05-12 19:25:59 +00:00
Misha Brukman
f91d994801 Made file comply with HTML-4.01 (Strict)
llvm-svn: 13503
2004-05-12 19:21:57 +00:00
Chris Lattner
5f49573cf6 Turn the block extractor on by default now that it basically works, eliminating the option.
llvm-svn: 13502
2004-05-12 19:02:44 +00:00
Misha Brukman
c06c9332ab Made file HTML-4.01 (Strict)-compliant.
llvm-svn: 13501
2004-05-12 18:57:54 +00:00
Misha Brukman
4478f2b039 Made to be HTML-4.01 (Strict)-compliant.
llvm-svn: 13500
2004-05-12 18:49:47 +00:00
Misha Brukman
374258e5ce Made to be HTML-4.01 (Strict) -compliant.
llvm-svn: 13499
2004-05-12 18:42:35 +00:00
Misha Brukman
d4f290a8ae Add proper footer since this file is HTML-4.01 compliant.
llvm-svn: 13498
2004-05-12 18:37:22 +00:00
Misha Brukman
692cec07db Make document HTML-4.01 (Strict) compliant.
llvm-svn: 13497
2004-05-12 18:31:21 +00:00
Misha Brukman
55ba220cee Fix grammar: remove `the' before LLVM.
llvm-svn: 13496
2004-05-12 18:02:00 +00:00
Misha Brukman
8e33feddac * Make the document format follow the stringent purple standards (like the rest
of the documentation)
* Do not make the link text be the link itself, use some keywords
* Make doc use stylesheets and HTML markup for lists instead of definitions
* Shorten page by not making multiple lines per link with description + link of
  the same name as the target

llvm-svn: 13495
2004-05-12 18:00:48 +00:00
Chris Lattner
e2d382e1a4 Pass boolean constants into function calls more efficiently, generating:
mov DWORD PTR [%ESP + 4], 1

instead of:

        mov %EAX, 1
        mov DWORD PTR [%ESP + 4], %EAX

llvm-svn: 13494
2004-05-12 16:35:04 +00:00
Chris Lattner
66219abac7 Do not pass in the same argument to the extracted function more than once, and
give the extracted function a more useful name than just foo_code.

llvm-svn: 13493
2004-05-12 16:26:18 +00:00
Chris Lattner
6c0c313daf Check to see if all blocks are extractible first.
llvm-svn: 13491
2004-05-12 16:08:01 +00:00
Chris Lattner
13d2ddfe9c Implement support for code extracting basic blocks that have a return
instruction in them.

llvm-svn: 13490
2004-05-12 16:07:41 +00:00
Chris Lattner
795c9933e2 Implement splitting of PHI nodes, allowing block extraction of BB's that have
PHI node entries from multiple outside-the-region blocks.  This also fixes
extraction of the entry block in a function.  Yaay.

This has successfully block extracted all (but one) block from the score_move
function in obsequi (out of 33).  Hrm, I wonder which block the bug is in.  :)

llvm-svn: 13489
2004-05-12 15:29:13 +00:00
Chris Lattner
3b2917bfcf * Pull some code out into the definedInRegion/definedInCaller methods
* Add a stub for the severSplitPHINodes which will allow us to bbextract
  bb's with PHI nodes in them soon.
* Remove unused arguments from findInputsOutputs
* Dramatically simplify the code in findInputsOutputs.  In particular,
  nothing really cares whether or not a PHI node is using something.
* Move moveCodeToFunction to after emitCallAndSwitchStatement as that's the
  order they get called.
* Fix a bug where we would code extract a region that included a call to
  vastart.  Like 'alloca', calls to vastart must stay in the function that
  they are defined in.
* Add some comments.

llvm-svn: 13482
2004-05-12 06:01:40 +00:00
Chris Lattner
ffc4926263 Generate substantially better code when there are a limited number of exits
from the extracted region.  If the return has 0 or 1 exit blocks, the new
function returns void.  If it has 2 exits, it returns bool, otherwise it
returns a ushort as before.

This allows us to use a conditional branch instruction when there are two
exit blocks, as often happens during block extraction.

llvm-svn: 13481
2004-05-12 04:14:24 +00:00
Chris Lattner
3d1ca67fdd Two minor improvements:
1. Get rid of the silly abort block.  When doing bb extraction, we get one
     abort block for every block extracted, which is kinda annoying.
  2. If the switch ends up having a single destination, turn it into an
     unconditional branch.

I would like to add support for conditional branches, but to do this we will
want to have the function return a bool instead of a ushort.

llvm-svn: 13478
2004-05-12 03:22:33 +00:00
Chris Lattner
af24e90c51 Don't leave dead bytecode.output files around if the optimizer/block extractor crashes.
llvm-svn: 13477
2004-05-12 02:55:45 +00:00
Misha Brukman
5ed8cf5f1e This file has been superseded by docs/index.html .
llvm-svn: 13476
2004-05-12 02:48:30 +00:00
Chris Lattner
49e4a33c98 Implement the final missing bits for block extractor support. Now bugpoint
can extract basic blocks up to the limit of the block extractor implementation.

llvm-svn: 13475
2004-05-12 02:43:24 +00:00
Misha Brukman
b797a4f968 Add link to Valgrind.
llvm-svn: 13472
2004-05-12 00:57:24 +00:00
Chris Lattner
a060b10ee5 Implement basic block extraction for the miscompilation debugger. This still needs
two things: the FIXME in ExtractBlocks needs to be implemented, and the basic block
extractor itself needs to have enough bugs fixed for this to be more or less
useful.

Until the time that this is generally useful, it is hidden behind the new bugpoint
-enable-block-extraction option.  I hope to get the FIXME done tonight.

Also of note, this patch adds a -extract-bbs option to bugpoint which can be used
to debug the block extractor.  (hint hint Misha :)

llvm-svn: 13471
2004-05-11 21:54:13 +00:00
Chris Lattner
d7d574db01 A class that is meant to be a base class should have a virtual destructor
llvm-svn: 13470
2004-05-11 20:41:07 +00:00
Chris Lattner
415532491a Add a note to make sure the program is memory correct
llvm-svn: 13464
2004-05-11 19:34:27 +00:00
John Criswell
1aaea06cbc Added obsequi.
llvm-svn: 13462
2004-05-11 19:29:59 +00:00
Brian Gaeke
4db22f625e Use inttypes.h, which exists on all of Linux, Solaris and Darwin.
llvm-svn: 13461
2004-05-11 16:14:53 +00:00
Chris Lattner
9dca2d7852 Unbreak the build on X86.
llvm-svn: 13460
2004-05-11 14:08:54 +00:00
Brian Gaeke
a9cfeeb826 Squash warnings on Solaris/sparc... the test suite is not working for me so I
can't be sure if these are OK, but they look OK.

llvm-svn: 13459
2004-05-11 07:45:28 +00:00
Brian Gaeke
f120c9d69b Do not hardcode the name of gcc, because its full pathname may have been
specified by top-level configure

llvm-svn: 13458
2004-05-11 07:42:58 +00:00
Brian Gaeke
b6b0f46220 Do not depend on the path to bash
llvm-svn: 13457
2004-05-11 07:42:19 +00:00
Brian Gaeke
940c2a8306 Include <sys/types.h> to get the definition of int64_t on Solaris.
llvm-svn: 13456
2004-05-11 07:18:02 +00:00
Chris Lattner
24f200ad7b Switch this from using an std::map to using a DenseMap. This speeds up
phi-elimination from 0.6 to 0.54s on kc++.

llvm-svn: 13454
2004-05-10 19:17:36 +00:00
Chris Lattner
39a1e0a33e Use a new VRegPHIUseCount to compute uses of PHI values by other phi values
in the basic block being processed.  This fixes PhiElimination on kimwitu++
from taking 105s to taking a much more reasonable 0.6s (in a debug build).

llvm-svn: 13453
2004-05-10 19:06:37 +00:00
Chris Lattner
a2f7b9bddc Now that we use an ilist of machine instructions, iterators are more robust
than before.  Because this is the case, we can compute the first non-phi
instruction once when de-phi'ing a block.  This shaves ~4s off of
phielimination of _Z7yyparsev in kimwitu++ from 109s -> 105s.  There are
still much more important gains to come.

llvm-svn: 13452
2004-05-10 18:47:18 +00:00
Chris Lattner
72fb3256f8 Fix a fairly serious pessimizaion that was preventing us from efficiently
compiling things like 'add long %X, 1'.  The problem is that we were switching
the order of the operands for longs even though we can't fold them yet.

llvm-svn: 13451
2004-05-10 15:15:55 +00:00
Chris Lattner
eefb8a7dd0 Bug fixed
llvm-svn: 13450
2004-05-10 14:28:09 +00:00
Chris Lattner
5eb8094c2d Patch to fix PR337. Make sure to mark all aliased physical registers as used
when we see a read of a register.  This is important in cases like:

AL = ...
AH = ...

   = AX

The read of AX must make both the AL and AH defs live until the use.

llvm-svn: 13444
2004-05-10 05:12:43 +00:00
Chris Lattner
60ef22da3d Testcase for PR337, which was reduced by Reid Spencer.
llvm-svn: 13443
2004-05-10 05:11:24 +00:00
Reid Spencer
45e25d8295 Bug 178 Fixed
llvm-svn: 13442
2004-05-09 23:32:39 +00:00
Reid Spencer
be4fadf1b8 Changes to make the Stacker Stack use 64 bit values. This *should* get
around the problem with Stacker on Solaris because the Stack can handle
64-bit entries (pointer sized).

llvm-svn: 13441
2004-05-09 23:20:19 +00:00
Chris Lattner
a367dd745b Fix some comments, avoid sign extending booleans when zero extend works fine
llvm-svn: 13440
2004-05-09 23:16:33 +00:00
Chris Lattner
1542a98e7b Generate more efficient code for casting booleans to integers (no sign extension required)
llvm-svn: 13439
2004-05-09 22:28:45 +00:00
Chris Lattner
f719a52088 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
87d036caf2 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
17fcb67a20 Fine grainify namespacification
llvm-svn: 13436
2004-05-09 06:22:29 +00:00
Chris Lattner
9c29991970 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
Brian Gaeke
e3e557e553 Bug fixed.
Rewrite portability intro.

llvm-svn: 13434
2004-05-09 05:28:35 +00:00
Chris Lattner
14d328e2a5 Get this looking more like a function pass.
llvm-svn: 13433
2004-05-09 04:30:20 +00:00
Chris Lattner
254677fe0a Implement the AddPrototypes method
llvm-svn: 13432
2004-05-09 04:29:57 +00:00
Chris Lattner
e7cc64f6e7 Add support for inserting all prototypes up-front
llvm-svn: 13431
2004-05-09 04:29:49 +00:00
Chris Lattner
2484a6336f 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
8ec5f88c79 Fix stupid bug in my checkin yesterday
llvm-svn: 13429
2004-05-08 22:41:42 +00:00
Tanya Lattner
090365b154 Fixed up sched graph.
llvm-svn: 13428
2004-05-08 16:14:24 +00:00
Tanya Lattner
f751ca6767 Registering the ModuloScheduling pass.
llvm-svn: 13427
2004-05-08 16:14:02 +00:00
Tanya Lattner
8ad6335dfa Changed CPUResource to allow access to max num users for a resource.
Also added ModuloScheduling as a friend.

llvm-svn: 13426
2004-05-08 16:13:26 +00:00
Tanya Lattner
39bd20d6eb Changed CPUResource to allow access to maxnum users.
llvm-svn: 13425
2004-05-08 16:12:50 +00:00
Tanya Lattner
a6820d6704 Updating my versions of ModuloScheduling in cvs. Still not complete.
llvm-svn: 13424
2004-05-08 16:12:10 +00:00
Brian Gaeke
1096ba9422 Add support for widening integral casts.
Flesh out the SetCC support... which currently ends in a little bit
of unfinished code (which is probably completely hilarious) for
generating the condition value splitting the basic block up into 4
blocks, like this (clearly a better API is needed for this!):

       BB
   cond. branch
     /         /          R1=1    R2=0
     \      /
      \    /
    R=phi(R1,R2)

Other minor edits.

llvm-svn: 13423
2004-05-08 06:36:14 +00:00
Brian Gaeke
91bf7cb79b Add a bunch more branches
llvm-svn: 13422
2004-05-08 06:08:29 +00:00
Brian Gaeke
7a66e5fff9 Flesh out GEP support
llvm-svn: 13421
2004-05-08 05:27:20 +00:00
Brian Gaeke
d18b330605 Add ADD with immediate
llvm-svn: 13420
2004-05-08 05:26:55 +00:00
Brian Gaeke
b56f1c9c10 Add forms of CMP, SUBCC, and a few branches, and some comments.
llvm-svn: 13419
2004-05-08 04:21:32 +00:00
Brian Gaeke
f3a479f04a Add stub support for GEPs.
Add support for branches (based loosely on X86/InstSelectSimple).
Add support for not visiting phi nodes in the first pass.
Add support for loading bools.
Flesh out support for stores.

llvm-svn: 13418
2004-05-08 04:21:17 +00:00
Alkis Evlogimenos
2a54b5d3e1 Add required header
llvm-svn: 13417
2004-05-08 03:50:03 +00:00
Alkis Evlogimenos
54a89b7c72 Remove unneeded header
llvm-svn: 13416
2004-05-08 03:49:35 +00:00
Chris Lattner
5f667a6f58 Implement folding of GEP's like:
%tmp.0 = getelementptr [50 x sbyte]* %ar, uint 0, int 5         ; <sbyte*> [#uses=2]
        %tmp.7 = getelementptr sbyte* %tmp.0, int 8             ; <sbyte*> [#uses=1]

together.  This patch actually allows us to simplify and generalize the code.

llvm-svn: 13415
2004-05-07 22:09:22 +00:00
Brian Gaeke
9a7b9d07f0 Allow the user to set the LLVMINTERP environment variable as a workaround, for
when they have to run a gccld shell script without having lli in their path.
This is intended to address Bug 289.

Also, emit the traditional syntax ${1+"$@"} for passing all of a shell script's
args to a subprocess. If you have arguments that have spaces in them, $* will
not preserve the quoting (i.e., the quoted string "foo bar" as an argument will
end up as two arguments "foo" "bar" to lli.)

llvm-svn: 13414
2004-05-07 21:47:36 +00:00
Brian Gaeke
584308b71a Add support for copying bool constants to registers.
Disable the code that copies long constants to registers - it looks fishy.
Implement some simple casts: integral, smaller than longs, and equal-width
 or narrowing only.

llvm-svn: 13413
2004-05-07 21:39:30 +00:00
Chris Lattner
a2dc6bf6e6 Codegen floating point stores of constants into integer instructions. This
allows us to compile:

store float 10.0, float* %P

into:
        mov DWORD PTR [%EAX], 1092616192

instead of:

.CPItest_0:                                     # float 0x4024000000000000
.long   1092616192      # float 10
...
        fld DWORD PTR [.CPItest_0]
        fstp DWORD PTR [%EAX]

llvm-svn: 13409
2004-05-07 21:18:15 +00:00
Brian Gaeke
1edc9637d0 Add more casts. You can never have enough casts.
llvm-svn: 13408
2004-05-07 21:10:28 +00:00
Chris Lattner
cecf3f94a4 Make comparisons against the null pointer as efficient as integer comparisons
against zero.  In particular, don't emit:

        mov %ESI, 0
        cmp %ECX, %ESI

instead, emit:

       test %ECX, %ECX

llvm-svn: 13407
2004-05-07 19:55:55 +00:00
Chris Lattner
cf5822a2be PR implemented
llvm-svn: 13406
2004-05-07 19:23:05 +00:00
Chris Lattner
3553fe3a5b Bug fixed
llvm-svn: 13403
2004-05-07 18:40:38 +00:00
Chris Lattner
798b5e4a6f New testcase
llvm-svn: 13402
2004-05-07 18:38:59 +00:00
Chris Lattner
0a8ee61c51 New testcase for PR336
llvm-svn: 13401
2004-05-07 15:38:50 +00:00
Chris Lattner
d9e5813821 Fix PR336: The instcombine pass asserts when visiting load instruction
llvm-svn: 13400
2004-05-07 15:35:56 +00:00
John Criswell
e0727fe00d Regression test for PR#330.
llvm-svn: 13399
2004-05-07 13:57:19 +00:00
Chris Lattner
c6fdf8ddb3 Add the enum corresponding to the source change I made earlier
llvm-svn: 13395
2004-05-07 02:27:32 +00:00
John Criswell
6956afa7c5 Bug fixed.
llvm-svn: 13392
2004-05-06 22:23:24 +00:00
John Criswell
2af0fd3ca8 Don't call getForwardedType() twice, as recommended by Chris.
llvm-svn: 13391
2004-05-06 22:15:47 +00:00
Chris Lattner
6aee736d1b Use the new commandline flag to allow us to call bugpoint like this:
bugpoint ... --tool-args -enable-correct-eh-support -regalloc=linearscan --args -- -foo

So that tool-args option gets the -enable-correct-eh-support -regalloc=linearscan flags instead of bugpoint.

llvm-svn: 13389
2004-05-06 22:05:35 +00:00
Chris Lattner
a60f355c87 Implement the new cl::PositionalEatsArgs flag, refactor code a bit
llvm-svn: 13388
2004-05-06 22:04:31 +00:00
Chris Lattner
b68bd76978 Add a new cl::PositionalEatsArgs flag
llvm-svn: 13387
2004-05-06 22:03:59 +00:00
John Criswell
f6709bc579 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
Chris Lattner
8737169a6a Remove a really old comment
llvm-svn: 13385
2004-05-06 19:29:58 +00:00
Reid Spencer
432f53b47f Just testing the "Reid has CVS commit access" system
llvm-svn: 13384
2004-05-06 18:06:18 +00:00
Misha Brukman
afdd8a0608 Give props to Vladimir Prus for the inst_iterator patch.
llvm-svn: 13383
2004-05-06 16:53:18 +00:00
Chris Lattner
991425ae70 numeric_limits::infinity() apparently does not work on all systems. As a
workaround, use the C HUGE_VAL macro instead.

llvm-svn: 13377
2004-05-06 16:25:59 +00:00
Alkis Evlogimenos
4c4497e834 Fix for gcc3.4: invalid use of forward delacred class on line 93
llvm-svn: 13370
2004-05-06 02:07:42 +00:00
Brian Gaeke
e330adf842 Move the stuff that fixes the size, orientation & fonts of graphs to
the debugging functions that call "dot". These fixed settings have
various problems: for example, the fixed size that is set in the graph
traits classes is not appropriate for turning the dot file into a PNG,
and if TrueType font rendering is being used, the 'Courier' TrueType font
may not be installed. It seems easy enough to specify these things on the
command line, anyhow.

llvm-svn: 13366
2004-05-05 06:10:06 +00:00
Brian Gaeke
706bd5bf2b Apply simplification suggested by Chris: why assign() when operator = will do?
llvm-svn: 13364
2004-05-04 22:02:41 +00:00
John Criswell
987ad1945d Fixed inconsistent indentation.
llvm-svn: 13363
2004-05-04 21:46:05 +00:00
Brian Gaeke
d26074eef1 Missing piece of fix for Bug 333
llvm-svn: 13362
2004-05-04 21:41:45 +00:00
Brian Gaeke
e307f8a791 Bugs fixed
llvm-svn: 13360
2004-05-04 21:22:57 +00:00
Brian Gaeke
48ef3f0fa1 update command guide to have --tool-args
llvm-svn: 13359
2004-05-04 21:13:35 +00:00
Brian Gaeke
4a278f0b1b Add --tool-args flag which lets you pass arguments to llc or lli.
This is intended to address Bug 40.

llvm-svn: 13358
2004-05-04 21:09:16 +00:00
Brian Gaeke
f2ff5dd442 Correctly mangle function names when they are used as part of a
constant pool member's name.
This is intended to address Bug 333.

Also, fix an anachronistic usage of "M" as a parameter of type Function *.

llvm-svn: 13357
2004-05-04 21:09:02 +00:00
Brian Gaeke
b3a9a0fcbd Add "Args" optional argument to AbstractInterpreter factory methods, which
fills in a ToolArgs vector in the AbstractInterpreter if it is set. This
ToolArgs vector is used to pass additional arguments to LLI and/or LLC.
This is intended to address Bug 40.

Also, make -debug-only=toolrunner work for the LLC and CBE
AbstractInterpreters.

llvm-svn: 13356
2004-05-04 21:09:01 +00:00
Chris Lattner
c6f601310f Remove unneeded check
llvm-svn: 13355
2004-05-04 19:35:11 +00:00
Chris Lattner
22df9a59b4 Improve signed division by power of 2 *dramatically* from this:
div:
        mov %EDX, DWORD PTR [%ESP + 4]
        mov %ECX, 64
        mov %EAX, %EDX
        sar %EDX, 31
        idiv %ECX
        ret

to this:

div:
        mov %EAX, DWORD PTR [%ESP + 4]
        mov %ECX, %EAX
        sar %ECX, 5
        shr %ECX, 26
        mov %EDX, %EAX
        add %EDX, %ECX
        sar %EAX, 6
        ret

Note that the intel compiler is currently making this:

div:
        movl      4(%esp), %edx                                 #3.5
        movl      %edx, %eax                                    #4.14
        sarl      $5, %eax                                      #4.14
        shrl      $26, %eax                                     #4.14
        addl      %edx, %eax                                    #4.14
        sarl      $6, %eax                                      #4.14
        ret                                                     #4.14

Which has one less register->register copy.  (hint hint alkis :)

llvm-svn: 13354
2004-05-04 19:33:58 +00:00
Misha Brukman
bc1ccfd053 Provide visit(Module&) and visitModule(Module&) functionality.
llvm-svn: 13353
2004-05-04 18:30:38 +00:00
Brian Gaeke
600f2045a9 Add stub support for reading BBTraces.
llvm-svn: 13352
2004-05-04 17:11:14 +00:00
Brian Gaeke
9a1b8c73a8 Add BBTrace accessor method and data member.
llvm-svn: 13351
2004-05-04 17:11:13 +00:00
Chris Lattner
ea309ff082 Bug fixed
llvm-svn: 13350
2004-05-04 17:04:09 +00:00
Chris Lattner
9490849028 Do not mark instructions in unreachable sections of the function as live.
This fixes PR332 and ADCE/2004-05-04-UnreachableBlock.llx

llvm-svn: 13349
2004-05-04 17:00:46 +00:00
Chris Lattner
1190a4de0b New testcase for PR332
llvm-svn: 13348
2004-05-04 17:00:10 +00:00
Brian Gaeke
ba7b0d7a0e New header file containing profile info enums shared between the C++ analysis
libraries and the C runtime support library

llvm-svn: 13347
2004-05-04 16:57:57 +00:00
Brian Gaeke
34c13fbe94 Share ProfilingType enum with the C profiling runtime libraries.
llvm-svn: 13346
2004-05-04 16:53:07 +00:00
Brian Gaeke
495d9340e9 Share the profile info type enum with the C++ analysis libraries.
Add a documentation comment for write_profiling_data().

llvm-svn: 13345
2004-05-04 16:51:48 +00:00
Brian Gaeke
875d70b3c0 Constants for profile info type changed names to match the C++ ones.
llvm-svn: 13344
2004-05-04 16:51:47 +00:00
Brian Gaeke
6e72e2a6e9 Constants for profile info type changed names to match the C++ ones.
Edited comments.

llvm-svn: 13343
2004-05-04 16:51:46 +00:00
Chris Lattner
8c22ece232 Improve code generated for integer multiplications by 2,3,5,9
llvm-svn: 13342
2004-05-04 15:47:14 +00:00
Chris Lattner
dd1a86d858 Minor efficiency tweak, suggested by Patrick Meredith
llvm-svn: 13341
2004-05-04 15:19:33 +00:00
Brian Gaeke
5237476f75 Fix typo
llvm-svn: 13340
2004-05-03 23:52:07 +00:00
Brian Gaeke
2157c9a49b Add initial implementation of basic block tracing runtime
llvm-svn: 13339
2004-05-03 23:51:50 +00:00
Brian Gaeke
417d555b6f Add basic block tracing functions as exported symbols.
llvm-svn: 13338
2004-05-03 23:49:17 +00:00
Brian Gaeke
213715bceb Add basic block tracing information as a type of "profiling" information.
llvm-svn: 13337
2004-05-03 23:49:16 +00:00
Brian Gaeke
e96196081e In InsertProfilingInitCall(), make it legal to pass in a null array, in
which case you'll get a null array and zero passed to the profiling function.

llvm-svn: 13336
2004-05-03 22:06:33 +00:00
Brian Gaeke
088dd3e121 Add initial implementation of basic-block tracing instrumentation pass.
llvm-svn: 13335
2004-05-03 22:06:32 +00:00
Chris Lattner
6e6baf6157 Initialize member out of paranoia
llvm-svn: 13319
2004-05-02 16:06:40 +00:00
Chris Lattner
6942946132 Fix a problem with double freeing memory. For some reason, CallGraph is not
acting like a normal pass.  :(

llvm-svn: 13318
2004-05-02 16:06:18 +00:00
Chris Lattner
929291aabb Plug a minor memory leak
llvm-svn: 13317
2004-05-02 07:31:34 +00:00
Chris Lattner
be6f06818c Do not clone arbitrary condition instructions.
llvm-svn: 13316
2004-05-02 05:19:36 +00:00
Chris Lattner
51a6dbcb65 Do not infinitely "unroll" single BB loops.
llvm-svn: 13315
2004-05-02 05:02:03 +00:00
Chris Lattner
2ad4878d8e Add some stuff to the release notes.
llvm-svn: 13314
2004-05-02 04:19:15 +00:00
Brian Gaeke
19202cd08b Chris told me to take these assertions out a few days ago, but I forgot to
check this in.

llvm-svn: 13313
2004-05-02 01:04:52 +00:00
Chris Lattner
1e94ed606e Dont' merge terminators that are needed to select PHI node values.
llvm-svn: 13312
2004-05-02 01:00:44 +00:00
Chris Lattner
2e93c4275e Implement SimplifyCFG/branch-cond-merge.ll
Turning "if (A < B && B < C)" into "if (A < B & B < C)"

llvm-svn: 13311
2004-05-01 23:35:43 +00:00
Chris Lattner
c9b34e5648 New testcase:
Turn "if (A < B && B < C)" into "if (A < B & B < C)"

llvm-svn: 13310
2004-05-01 23:35:21 +00:00
Chris Lattner
63d75af920 Make sure to reprocess instructions used by deleted instructions to avoid
missing opportunities for combination.

llvm-svn: 13309
2004-05-01 23:27:23 +00:00
Chris Lattner
b643a9e675 Make sure the instruction combiner doesn't lose track of instructions
when replacing them, missing the opportunity to do simplifications

llvm-svn: 13308
2004-05-01 23:19:52 +00:00
Chris Lattner
4cbd160b45 Fix my missing parens
llvm-svn: 13307
2004-05-01 22:41:51 +00:00
Chris Lattner
88da6f7b52 Implement SimplifyCFG/branch-cond-prop.ll
llvm-svn: 13306
2004-05-01 22:36:37 +00:00
Chris Lattner
380affdc88 New testcase for case that simplifycfg should catch
llvm-svn: 13305
2004-05-01 22:36:24 +00:00
Chris Lattner
7b0a2046d4 Remove unused #include
llvm-svn: 13304
2004-05-01 21:29:16 +00:00
Chris Lattner
acbf0c84de Iterate over the Machine CFG that Brian added instead of the LLVM CFG.
Look at all of the pretty minuses. :)

llvm-svn: 13303
2004-05-01 21:27:53 +00:00
Chris Lattner
8c0bc68910 Operate on the Machine CFG instead of on the LLVM CFG
llvm-svn: 13302
2004-05-01 21:24:39 +00:00
Chris Lattner
c49a9a5d76 Stop LiveVariables from using BasicBlocks as part of the mapping, instead
use MachineBasicBlocks.  To do this, we traverse the Machine CFG instead of
the LLVM CFG, which is also *MUCH* more efficient by having fewer levels of
indirections and mappings.

llvm-svn: 13301
2004-05-01 21:24:24 +00:00
Chris Lattner
5e65763532 Stop LiveVariables from using BasicBlocks as part of the mapping, instead
use MachineBasicBlocks.

llvm-svn: 13300
2004-05-01 21:23:35 +00:00
Chris Lattner
c89208483f Move the GraphTraits for MachineBasicBlocks to the MachineBasicBlock file.
llvm-svn: 13299
2004-05-01 21:05:34 +00:00
Chris Lattner
15a041ca88 Add comment about optimizations
llvm-svn: 13298
2004-05-01 11:40:07 +00:00
Chris Lattner
490e804a4e Add a constructor that got lost
llvm-svn: 13297
2004-05-01 11:17:13 +00:00
Brian Gaeke
2d7efbbb93 Generalize the strlen size_t hack, for the benefit of the other external
functions with wrappers that either take or return size_ts.

llvm-svn: 13296
2004-05-01 06:42:15 +00:00
Chris Lattner
77a51733e7 Fix broken link, again.
llvm-svn: 13295
2004-04-30 22:17:12 +00:00
Tanya Lattner
f0fda31479 Sorry, now friend class name should be right!!
llvm-svn: 13294
2004-04-30 20:48:37 +00:00
Tanya Lattner
34f7cfe4d0 Fixed friend class name for ModuloScheduling.
llvm-svn: 13293
2004-04-30 20:47:59 +00:00
Tanya Lattner
717f2a51fd Fixed friend class name for ModuloSched
llvm-svn: 13292
2004-04-30 20:46:40 +00:00
Tanya Lattner
6ebf67f8b6 Removing MachineResource class.
llvm-svn: 13291
2004-04-30 20:40:38 +00:00
Chris Lattner
e8b56f27b8 Fix a broken link
llvm-svn: 13290
2004-04-30 14:13:16 +00:00
Chris Lattner
652064e3b8 Fix a major pessimization in the instcombiner. If an allocation instruction
is only used by a cast, and the casted type is the same size as the original
allocation, it would eliminate the cast by folding it into the allocation.

Unfortunately, it was placing the new allocation instruction right before
the cast, which could pull (for example) alloca instructions into the body
of a function.  This turns statically allocatable allocas into expensive
dynamically allocated allocas, which is bad bad bad.

This fixes the problem by placing the new allocation instruction at the same
place the old one was, duh. :)

llvm-svn: 13289
2004-04-30 04:37:52 +00:00
Brian Gaeke
63c3b3c8d7 Add machine-CFG graph traits specializations.
llvm-svn: 13288
2004-04-29 17:43:55 +00:00
Misha Brukman
372d5bc9ab Wrapped code and comments at 80 cols; doxygenified some comments.
llvm-svn: 13264
2004-04-29 04:05:30 +00:00
Misha Brukman
a70ae90722 Reorder #includes as per style guide.
llvm-svn: 13263
2004-04-29 04:04:47 +00:00
Misha Brukman
40b4f6eca8 Added `zeroinitializer' keyword.
llvm-svn: 13253
2004-04-28 19:36:08 +00:00
Misha Brukman
da546eac70 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
2dc1944f14 * Make contained ostream not public.
* Remove various print methods that called the Value* method, just have one that
  all subclasses of Value will use anyway.
* Remove template for printing constant references
* Add methods to print char* and strings
* setStream now sets the stream on the contained AssemblyWriter

llvm-svn: 13246
2004-04-28 19:22:58 +00:00
Misha Brukman
7e66438579 Send text and numbers directly to CachedWriter's contained ostream.
llvm-svn: 13243
2004-04-28 18:52:43 +00:00
Misha Brukman
1846321345 Squelch compile-time warning (profile build).
llvm-svn: 13228
2004-04-28 15:32:09 +00:00
Misha Brukman
4685e26bc7 * Add ability to print out type as symbolic
* Add Module accessor to AssemblyWriter

llvm-svn: 13227
2004-04-28 15:31:21 +00:00
Misha Brukman
d472aff18c * Add ability to get and set the output stream
* New feature: outputting a Type* as symbolic, controlled via the stream
  similarly to sending std::hex to change number format

llvm-svn: 13226
2004-04-28 15:30:33 +00:00
Brian Gaeke
4ba46506df Add pred./succ. list size methods.
llvm-svn: 13214
2004-04-28 04:46:35 +00:00
Brian Gaeke
4390e4a7fc Make RequiresFPRegKill() take a MachineBasicBlock arg.
In InsertFPRegKills(), just check the MachineBasicBlock for successors
instead of its corresponding BasicBlock.

llvm-svn: 13213
2004-04-28 04:45:55 +00:00
Brian Gaeke
33ff118407 In InsertFPRegKills(), use the machine-CFG itself rather than the
LLVM CFG when trying to find the successors of BB.

llvm-svn: 13212
2004-04-28 04:34:16 +00:00
Brian Gaeke
24ec85689b Update the machine-CFG edges whenever we see a branch.
llvm-svn: 13211
2004-04-28 04:19:37 +00:00
Brian Gaeke
153cb8d18a Move private methods to end of class decl at Chris's request
llvm-svn: 13210
2004-04-28 04:15:06 +00:00
Brian Gaeke
2d875451d2 Fix thinkos that Chris caught for me.
Make pred mutators private.

llvm-svn: 13209
2004-04-28 03:59:48 +00:00
Brian Gaeke
dc745e6dc1 Add machine-code CFG support: MachineBasicBlocks may now have their own
predecessors and successors

llvm-svn: 13208
2004-04-28 02:16:33 +00:00
Brian Gaeke
444a03b77a Integrate the rest of my random sparcv9 scribblings into this file
llvm-svn: 13204
2004-04-27 22:04:03 +00:00
Chris Lattner
f011b7dfe6 Fix warning building in optimized mode
llvm-svn: 13190
2004-04-27 18:24:38 +00:00
Chris Lattner
f1c9593a90 Fix warning
llvm-svn: 13189
2004-04-27 18:21:56 +00:00
Chris Lattner
2d3a7a6ff0 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
Brian Gaeke
8bcc86b6ae Because I like being able to instantiate the cfgprinter from external projects,
this header file is born.

llvm-svn: 13176
2004-04-26 16:27:53 +00:00
Brian Gaeke
104341f31e Add functions that return instances of these printer passes
llvm-svn: 13175
2004-04-26 16:27:08 +00:00
Brian Gaeke
1b07de4c2b Fix a typo in a comment.
llvm-svn: 13174
2004-04-26 16:26:21 +00:00
Chris Lattner
f374b3f304 If an object is not in the scalar map then it must be a global from another
graph.

llvm-svn: 13173
2004-04-26 14:44:08 +00:00
Chris Lattner
e20c334e65 Instcombine X/-1 --> 0-X
llvm-svn: 13172
2004-04-26 14:01:59 +00:00
Chris Lattner
e24003a261 Add a new testcase for X/-1, fix bug that prevented tests from running right
llvm-svn: 13171
2004-04-26 14:01:47 +00:00
Brian Gaeke
03cac379bd Fix file header comments and include guards -- many files have been moved or
renamed since they were last spiffed up, or they just never had proper comments
in the first place.

llvm-svn: 13148
2004-04-25 07:04:49 +00:00
Brian Gaeke
42d321ab66 Add a getRegisterInfo() accessor just like on the X86 target.
llvm-svn: 13147
2004-04-25 06:32:28 +00:00
Brian Gaeke
4ec08db77c Regularize file header comment and include guard.
Include SparcV9RegisterInfo.h.
Add a getRegisterInfo() accessor and SparcV9RegisterInfo instance, just like
on the X86 target.

llvm-svn: 13146
2004-04-25 06:32:16 +00:00
Brian Gaeke
f70544c583 Add MRegisterInfo subclass for the SparcV9 target (containing only stub
functions for now). This automatically turns on the printing of machine
registers using their own real names, instead of goofy things like %mreg(42),
and allows us to migrate code incrementally to the new interface as we see fit.

The register file description it uses is hand-written, so that the register
numbers will match the ones that the SparcV9 target already uses.
Perhaps someday we'll tablegen it.

llvm-svn: 13145
2004-04-25 06:32:05 +00:00
Misha Brukman
7426c893f0 Standardize header comments of top-level Makefiles.
llvm-svn: 13143
2004-04-24 00:10:56 +00:00
Misha Brukman
fc993c39e7 Aggregating function arguments is now an option. Default is `no', as before.
llvm-svn: 13142
2004-04-23 23:54:34 +00:00
Misha Brukman
3596f0a180 * Allow aggregating extracted function arguments (controlled by flag)
* Commandline option (for now) controls that flag that is passed in

llvm-svn: 13141
2004-04-23 23:54:17 +00:00
Brian Gaeke
ced65e8792 Fix a typo.
llvm-svn: 13136
2004-04-23 21:45:02 +00:00
Chris Lattner
83cd87efcd Move the scev expansion code into this pass, where it belongs. There is
still room for cleanup, but at least the code modification is out of the
analysis now.

llvm-svn: 13135
2004-04-23 21:29:48 +00:00
Chris Lattner
05ef97f994 Eliminate all of the SCEV Expansion code which is really part of the
IndVars pass, not part of SCEV *analysis*.

llvm-svn: 13134
2004-04-23 21:29:03 +00:00
Chris Lattner
0eab307e3c Remove the SCEV::expandCodeFor method, add a new SCEVVisitor class.
llvm-svn: 13133
2004-04-23 21:28:25 +00:00
Chris Lattner
02cea4afd3 Teach bugpoint to be a little bit smarter and avoid repeating work
llvm-svn: 13132
2004-04-23 20:36:51 +00:00
Brian Gaeke
99e3e94012 Merged this file into the SparcV9 target.
llvm-svn: 13128
2004-04-23 18:17:03 +00:00
Brian Gaeke
0b65f8f582 Merge TargetRegInfo.h into SparcV9RegInfo.h, which is its only subclass.
This prepares us to be able to de-virtualize and de-abstract it, and
take the register allocator bits out and move them into the register allocator
proper...

llvm-svn: 13127
2004-04-23 18:15:48 +00:00
Brian Gaeke
71509a98c5 Include SparcV9RegInfo.h instead of TargetRegInfo.h.
llvm-svn: 13126
2004-04-23 18:15:47 +00:00
Brian Gaeke
a411e07db0 Include SparcV9RegInfo.h instead of TargetRegInfo.h. This serves as a bit of
documentation that this module needs to be made independent of the
register file description of the current target.

llvm-svn: 13125
2004-04-23 18:15:46 +00:00
Brian Gaeke
fbd43e43a7 Get rid of the old byte-at-a-time emission code used when the Sparc JIT was
being tested on X86, as per Chris's request.

llvm-svn: 13124
2004-04-23 18:10:38 +00:00
Brian Gaeke
ad373c8576 Go back to the interpreter main loop after performing intrinsic lowering,
because 1) the first instruction might not be a call site, and
2) CS and SF.Caller were not getting set to point to the new call site
anyway (resulting in a crash on e.g. call %llvm.memset).

llvm-svn: 13122
2004-04-23 18:05:28 +00:00
Brian Gaeke
11550c1deb mmap of a zero length file returns null on some platforms, so hack around it.
llvm-svn: 13121
2004-04-23 17:38:17 +00:00
Brian Gaeke
6e102a7edd Use emitWordAt() to emit forward-branch fixups.
llvm-svn: 13120
2004-04-23 17:11:16 +00:00
Brian Gaeke
fe277c2809 Emit SPARC machine code a word at a time instead of a byte at a time.
Use emitWordAt() to emit forward-branch fixups.

llvm-svn: 13119
2004-04-23 17:11:15 +00:00
Brian Gaeke
0c4fb283f3 Implement emitWordAt() for the JIT emitter.
llvm-svn: 13118
2004-04-23 17:11:14 +00:00
Brian Gaeke
4aaa9c603a Implement emitWordAt() for the debug emitter and the file printer emitter. (I
am not so sure about the file printer emitter, but the debug emitter change
should be harmless.)

llvm-svn: 13117
2004-04-23 17:11:13 +00:00
Brian Gaeke
1ed0cdbd04 Add emitWordAt() - a quick and dirty interface that the machine-dependent
emitters can use to emit "relocations".

llvm-svn: 13116
2004-04-23 17:11:12 +00:00
Misha Brukman
2ccac826e4 Add command-line option to select whether to isolate or delete function from
module. Default is `isolate' as before.

llvm-svn: 13113
2004-04-22 23:07:39 +00:00
Misha Brukman
98aa516a9c Clarify the logic: the flag is renamed to `deleteFn' to signify it will delete
the function instead of isolating it. This also means the condition is reversed.

llvm-svn: 13112
2004-04-22 23:00:51 +00:00
Misha Brukman
e0682426f0 Add a flag to choose between isolating a function or deleting the function from
the Module. The default behavior keeps functionality as before: the chosen
function is the one that remains.

llvm-svn: 13111
2004-04-22 22:52:22 +00:00
Misha Brukman
2de9ce4f51 Add a boolean flag to delete this function from module, leaving the rest behind.
Useful in manual debugging when bugpoint isn't quite up to snuff.

llvm-svn: 13110
2004-04-22 22:51:37 +00:00
Misha Brukman
324e9e06d8 Add a space before result for readability on the command line.
llvm-svn: 13109
2004-04-22 20:02:09 +00:00
Chris Lattner
c27302c79f Disable a previous patch that was causing indvars to loop infinitely :(
llvm-svn: 13108
2004-04-22 15:12:36 +00:00
Chris Lattner
8f02e9c5f7 Add an ugly cast
llvm-svn: 13107
2004-04-22 15:00:36 +00:00
Chris Lattner
c1a682dda0 Fix an extremely serious thinko I made in revision 1.60 of this file.
llvm-svn: 13106
2004-04-22 14:59:40 +00:00
Chris Lattner
334bee87f4 Add a method
llvm-svn: 13105
2004-04-22 14:56:51 +00:00
Chris Lattner
af532f27e7 Implement a todo, rewriting all possible scev expressions inside of the
loop.  This eliminates the extra add from the previous case, but it's
not clear that this will be a performance win overall.  Tommorows test
results will tell. :)

llvm-svn: 13103
2004-04-21 23:36:08 +00:00
Chris Lattner
fb9a299f68 This code really wants to iterate over the OPERANDS of an instruction, not
over its USES.  If it's dead it doesn't have any uses!  :)

Thanks to the fabulous and mysterious Bill Wendling for pointing this out.  :)

llvm-svn: 13102
2004-04-21 22:29:37 +00:00
Chris Lattner
dc7cc35088 Implement a fixme. The helps loops that have induction variables of different
types in them.  Instead of creating an induction variable for all types, it
creates a single induction variable and casts to the other sizes.  This generates
this code:

no_exit:                ; preds = %entry, %no_exit
        %indvar = phi uint [ %indvar.next, %no_exit ], [ 0, %entry ]            ; <uint> [#uses=4]
***     %j.0.0 = cast uint %indvar to short             ; <short> [#uses=1]
        %indvar = cast uint %indvar to int              ; <int> [#uses=1]
        %tmp.7 = getelementptr short* %P, uint %indvar          ; <short*> [#uses=1]
        store short %j.0.0, short* %tmp.7
        %inc.0 = add int %indvar, 1             ; <int> [#uses=2]
        %tmp.2 = setlt int %inc.0, %N           ; <bool> [#uses=1]
        %indvar.next = add uint %indvar, 1              ; <uint> [#uses=1]
        br bool %tmp.2, label %no_exit, label %loopexit

instead of:

no_exit:                ; preds = %entry, %no_exit
        %indvar = phi ushort [ %indvar.next, %no_exit ], [ 0, %entry ]          ; <ushort> [#uses=2]
***     %indvar = phi uint [ %indvar.next, %no_exit ], [ 0, %entry ]            ; <uint> [#uses=3]
        %indvar = cast uint %indvar to int              ; <int> [#uses=1]
        %indvar = cast ushort %indvar to short          ; <short> [#uses=1]
        %tmp.7 = getelementptr short* %P, uint %indvar          ; <short*> [#uses=1]
        store short %indvar, short* %tmp.7
        %inc.0 = add int %indvar, 1             ; <int> [#uses=2]
        %tmp.2 = setlt int %inc.0, %N           ; <bool> [#uses=1]
        %indvar.next = add uint %indvar, 1
***     %indvar.next = add ushort %indvar, 1
        br bool %tmp.2, label %no_exit, label %loopexit

This is an improvement in register pressure, but probably doesn't happen that
often.

The more important fix will be to get rid of the redundant add.

llvm-svn: 13101
2004-04-21 22:22:01 +00:00
Chris Lattner
be8bb804c5 Fix an incredibly nasty iterator invalidation problem. I am too spoiled by ilists :)
Eventually it would be nice if CallGraph maintained an ilist of CallGraphNode's instead
of a vector of pointers to them, but today is not that day.

llvm-svn: 13100
2004-04-21 20:44:33 +00:00
Chris Lattner
15572abd14 bug fixed
llvm-svn: 13099
2004-04-21 18:52:06 +00:00
Chris Lattner
ee80c45d46 new testcase for PR326
llvm-svn: 13098
2004-04-21 18:49:35 +00:00
Misha Brukman
0784a601c2 Add doxygenified comments to functions.
llvm-svn: 13097
2004-04-21 18:36:43 +00:00
Misha Brukman
3bcead7201 I'm allergic to the word `stuff'.
llvm-svn: 13096
2004-04-21 18:27:56 +00:00
Brian Gaeke
376ac1bed5 Make SparcV9RegInfo::getRegType() return the right answer for registers
of IntCC, FloatCC, and Special types.

Make SparcV9RegInfo::getRegClassIDOfRegType() return the right answer
if you ask for the class corresponding to SpecialRegType.

llvm-svn: 13095
2004-04-21 17:53:58 +00:00
Alkis Evlogimenos
f68f40ea42 Include cerrno (gcc-3.4 fix)
llvm-svn: 13091
2004-04-21 16:11:40 +00:00
Alkis Evlogimenos
07f7574ba3 Declare iterator as public since it is defined as such (gcc-3.4 fix)
llvm-svn: 13090
2004-04-21 16:10:40 +00:00
Chris Lattner
a9691fe70d Fix typeo
llvm-svn: 13089
2004-04-21 14:23:18 +00:00
Chris Lattner
c87784f1fc REALLY fix PR324: don't delete linkonce functions until after the SCC traversal
is done, which avoids invalidating iterators in the SCC traversal routines

llvm-svn: 13088
2004-04-20 22:06:53 +00:00
Chris Lattner
99504890b7 Pass the callgraph not the module
llvm-svn: 13087
2004-04-20 21:52:26 +00:00
Chris Lattner
a45086a45e Allow getting the module from a call graph
llvm-svn: 13086
2004-04-20 21:52:12 +00:00
Chris Lattner
0a985ac82c Change it to take a callgraph, from which we can get a module
llvm-svn: 13085
2004-04-20 21:52:07 +00:00
Chris Lattner
8d0838130c Add the ability for SCC passes to initialize and finalize themselves
llvm-svn: 13084
2004-04-20 21:30:06 +00:00
Chris Lattner
c1aa21f5a7 Fix PR325
llvm-svn: 13081
2004-04-20 20:26:03 +00:00
Chris Lattner
514934051a Fix PR324 and testcase: Inline/2004-04-20-InlineLinkOnce.llx
llvm-svn: 13080
2004-04-20 20:20:59 +00:00
Chris Lattner
40123bff5b New testcase, distilled from PR324
llvm-svn: 13079
2004-04-20 20:15:01 +00:00
Brian Gaeke
a2f66db6c4 Make it legal to ask for the type of a specialreg
llvm-svn: 13078
2004-04-20 20:12:57 +00:00
Brian Gaeke
86a6c75a7e Add some PRs which were fixed, but not previously mentioned in the rel. notes.
llvm-svn: 13077
2004-04-20 18:18:46 +00:00
Chris Lattner
2b2d7a99be Add support for the select instruction
llvm-svn: 13076
2004-04-20 16:43:21 +00:00
Brian Gaeke
6c272a93bb Make it legal to request a load or store of %fsr.
llvm-svn: 13073
2004-04-19 19:12:12 +00:00
Brian Gaeke
627abf14bb Fix typo.
llvm-svn: 13072
2004-04-19 19:09:24 +00:00
Brian Gaeke
755651df27 Regularize include guards and remove some excess whitespace.
llvm-svn: 13071
2004-04-19 18:53:44 +00:00
Brian Gaeke
2fd2536ea8 Tighten up SparcV9FloatCCRegClass::getRegName()'s assertion - if you ask it for
the name of %fsr (as the comment in SparcV9RegClassInfo.h used to suggest)
you would walk off the end of the FloatCCRegName array.

llvm-svn: 13070
2004-04-19 18:53:43 +00:00
Brian Gaeke
85cb77737c Regularize include guards, remove some excess whitespace and fix some comments.
Remove the extra %fsr register from SparcV9FloatCCRegClass.

llvm-svn: 13069
2004-04-19 18:53:42 +00:00
Chris Lattner
f48f777d4c Initial checkin of a simple loop unswitching pass. It still needs work,
but it's a start, and seems to do it's basic job.

llvm-svn: 13068
2004-04-19 18:07:02 +00:00
Chris Lattner
ceea37590f New testcase
llvm-svn: 13067
2004-04-19 18:06:34 +00:00
Chris Lattner
1c9fb0007e Add accessor for a Loop Unswitching pass
llvm-svn: 13066
2004-04-19 06:28:37 +00:00
Chris Lattner
46f888dd80 Eliminate a poorly conceived method
llvm-svn: 13065
2004-04-19 06:26:46 +00:00
Chris Lattner
663ebc3ec6 It's not just a printer, it's actually an analysis too
llvm-svn: 13064
2004-04-19 03:42:32 +00:00
Misha Brukman
ce89b392c6 As per Chris, greatly simplify handling of external functions by using the
wrapper idea uniformly: we can use Value::replaceAllUsesWith() instead of
special-casing by class of user.

llvm-svn: 13063
2004-04-19 03:36:47 +00:00
Misha Brukman
d2493e1565 * Remove note about "UNSUPPORTED: " feature that just became supported
* Fix usage of <p> tag and some grammar

llvm-svn: 13062
2004-04-19 03:28:39 +00:00
Misha Brukman
8a32c6d91b * Reorder #includes
* Wrap a long line

llvm-svn: 13061
2004-04-19 03:12:35 +00:00
Misha Brukman
4825e215c0 Display sample bugpoint output with the `code' stylesheet class.
llvm-svn: 13060
2004-04-19 03:07:29 +00:00
Chris Lattner
5414021060 * Improve file header comment
* Remove #include
* Add some methods to update loop/loopinfo
* Stop explicitly holding the loop depth in the Loop class.  Instead, just
  dynamically calculate it.  This makes it easier to update LoopInfo as a
  result of transformations.

llvm-svn: 13059
2004-04-19 03:03:19 +00:00
Chris Lattner
32447c55fe Remove code to update loop depths
llvm-svn: 13058
2004-04-19 03:02:09 +00:00
Chris Lattner
bc02177fdc Add #include
llvm-svn: 13057
2004-04-19 03:01:23 +00:00
Misha Brukman
e70502328e Add notes about PRs 38 and 290 being fixed.
llvm-svn: 13056
2004-04-19 03:01:01 +00:00
Misha Brukman
017f2f3405 Wrap (some) lines to 80 cols.
llvm-svn: 13055
2004-04-19 02:56:49 +00:00
Misha Brukman
8301864215 Finally implement rewriting global initializers which use external functions
by creating an internal wrapper function with same signature as the external
function, and use it instead of the "real" function.

The wrapper then calls the external function using the same JIT function
resolution API that has been used before for rewriting instructions, since the
wrapper has an explicit call instruction which we can rewrite.

llvm-svn: 13054
2004-04-19 01:12:01 +00:00
Chris Lattner
732b5d5bba Provide an interface that is more convenient for iterating over the blocks
in a loop.

llvm-svn: 13052
2004-04-18 23:37:03 +00:00
Chris Lattner
fc44a25bcb Move isLoopInvariant to the Loop class
llvm-svn: 13051
2004-04-18 22:46:08 +00:00
Chris Lattner
26ba2f5fe8 Add new method
llvm-svn: 13050
2004-04-18 22:45:27 +00:00
Chris Lattner
d4d66c86c0 Add new method.
llvm-svn: 13049
2004-04-18 22:45:16 +00:00
Chris Lattner
827826320d Correct rewriting of exit blocks after my last patch
llvm-svn: 13048
2004-04-18 22:27:10 +00:00
Chris Lattner
d6ce359d3b Fix computation of exit blocks
llvm-svn: 13047
2004-04-18 22:21:41 +00:00
Chris Lattner
35eaa55cfc Loop exit sets are no longer explicitly held, they are dynamically computed on demand.
llvm-svn: 13046
2004-04-18 22:15:13 +00:00
Chris Lattner
d72c3eb54e Change the ExitBlocks list from being explicitly contained in the Loop
structure to being dynamically computed on demand.  This makes updating
loop information MUCH easier.

llvm-svn: 13045
2004-04-18 22:14:10 +00:00
Chris Lattner
bf3c8763c0 Spiff is no longer in our tree
llvm-svn: 13041
2004-04-18 18:26:38 +00:00
Chris Lattner
d15250240c Reduce the unrolling limit
llvm-svn: 13040
2004-04-18 18:06:14 +00:00
Chris Lattner
30ae18155d If the preheader of the loop was the entry block of the function, make sure
that the exit block of the loop becomes the new entry block of the function.

This was causing a verifier assertion on 252.eon.

llvm-svn: 13039
2004-04-18 17:38:42 +00:00
Chris Lattner
230bcb6b35 Be much more careful about how we update instructions outside of the loop
using instructions inside of the loop.  This should fix the MishaTest failure
from last night.

llvm-svn: 13038
2004-04-18 17:32:39 +00:00
Chris Lattner
3796974563 Another testcase
llvm-svn: 13037
2004-04-18 06:55:57 +00:00
Chris Lattner
e375a4fdc2 Implement method
llvm-svn: 13036
2004-04-18 06:54:48 +00:00
Chris Lattner
5f46b7044c Add a new method
llvm-svn: 13035
2004-04-18 06:54:34 +00:00
Chris Lattner
4d52e1e401 After unrolling our single basic block loop, fold it into the preheader and exit
block.  The primary motivation for doing this is that we can now unroll nested loops.

This makes a pretty big difference in some cases.  For example, in 183.equake,
we are now beating the native compiler with the CBE, and we are a lot closer
with LLC.

I'm now going to play around a bit with the unroll factor and see what effect
it really has.

llvm-svn: 13034
2004-04-18 06:27:43 +00:00
Chris Lattner
f2cc841619 Fix a bug: this does not preserve the CFG!
While we're at it, add support for updating loop information correctly.

llvm-svn: 13033
2004-04-18 05:38:37 +00:00
Chris Lattner
1472c63fb9 Add a new method, add a check missing that caused a segfault if a loop didn't
have a canonical indvar

llvm-svn: 13032
2004-04-18 05:38:05 +00:00
Chris Lattner
c9de38d316 Allow clients to delete loops, add a new method
llvm-svn: 13031
2004-04-18 05:37:42 +00:00
Chris Lattner
bf9ba24155 Move loop optimization passes up, add loop unroller
llvm-svn: 13030
2004-04-18 05:21:01 +00:00
Chris Lattner
e4ce5dbd1d Add prototype
llvm-svn: 13029
2004-04-18 05:20:32 +00:00
Chris Lattner
946b255977 Initial checkin of a simple loop unroller. This pass is extremely basic and
limited.  Even in it's extremely simple state (it can only *fully* unroll single
basic block loops that execute a constant number of times), it already helps improve
performance a LOT on some benchmarks, particularly with the native code generators.

llvm-svn: 13028
2004-04-18 05:20:17 +00:00
Chris Lattner
c14da9600b Make the tail duplication threshold accessible from the command line instead of hardcoded
llvm-svn: 13025
2004-04-18 00:52:43 +00:00
Chris Lattner
ca96cee67b Fix a memory leak. We leaked the vector holding the entries in switch tables.
llvm-svn: 13023
2004-04-17 23:49:15 +00:00
Chris Lattner
bc4118f316 New testcase
llvm-svn: 13020
2004-04-17 23:00:51 +00:00
Chris Lattner
dd73047673 Add the ability to compute exit values for complex loop using unanalyzable
operations.  This allows us to compile this testcase:

int main() {
        int h = 1;
         do h = 3 * h + 1; while (h <= 256);
        printf("%d\n", h);
        return 0;
}

into this:

int %main() {
entry:
        call void %__main( )
        %tmp.6 = call int (sbyte*, ...)* %printf( sbyte* getelementptr ([4 x sbyte]*  %.str_1, long 0, long 0), int 364 )        ; <int> [#uses=0]
        ret int 0
}

This testcase was taken directly from 256.bzip2, believe it or not.

This code is not as general as I would like.  Next up is to refactor it
a bit to handle more cases.

llvm-svn: 13019
2004-04-17 22:58:41 +00:00
Chris Lattner
a814080025 If the loop executes a constant number of times, try a bit harder to replace
exit values.

llvm-svn: 13018
2004-04-17 18:44:09 +00:00
Chris Lattner
4021d1af5a Add the ability to compute trip counts that are only controlled by constants
even if the loop is using expressions that we can't compute as a closed-form.
This allows us to calculate that this function always returns 55:

int test() {
  double X;
  int Count = 0;
  for (X = 100; X > 1; X = sqrt(X), ++Count)
    /*empty*/;
  return Count;
}

And allows us to compute trip counts for loops like:

        int h = 1;
         do h = 3 * h + 1; while (h <= 256);

(which occurs in bzip2), and for this function, which occurs after inlining
and other optimizations:

int popcount()
{
   int x = 666;
  int result = 0;
  while (x != 0) {
    result = result + (x & 0x1);
    x = x >> 1;
  }
  return result;
}

We still cannot compute the exit values of result or h in the two loops above,
which means we cannot delete the loop, but we are getting closer.  Being able to
compute a constant trip count for these two loops will allow us to unroll them
completely though.

llvm-svn: 13017
2004-04-17 18:36:24 +00:00
Chris Lattner
1e9ac1a45e Fix a HUGE pessimization on X86. The indvars pass was taking this
(familiar) function:

int _strlen(const char *str) {
    int len = 0;
    while (*str++) len++;
    return len;
}

And transforming it to use a ulong induction variable, because the type of
the pointer index was left as a constant long.  This is obviously very bad.

The fix is to shrink long constants in getelementptr instructions to intptr_t,
making the indvars pass insert a uint induction variable, which is much more
efficient.

Here's the before code for this function:

int %_strlen(sbyte* %str) {
entry:
        %tmp.13 = load sbyte* %str              ; <sbyte> [#uses=1]
        %tmp.24 = seteq sbyte %tmp.13, 0                ; <bool> [#uses=1]
        br bool %tmp.24, label %loopexit, label %no_exit

no_exit:                ; preds = %entry, %no_exit
***     %indvar = phi uint [ %indvar.next, %no_exit ], [ 0, %entry ]            ; <uint> [#uses=2]
***     %indvar = phi ulong [ %indvar.next, %no_exit ], [ 0, %entry ]           ; <ulong> [#uses=2]
        %indvar1 = cast ulong %indvar to uint           ; <uint> [#uses=1]
        %inc.02.sum = add uint %indvar1, 1              ; <uint> [#uses=1]
        %inc.0.0 = getelementptr sbyte* %str, uint %inc.02.sum          ; <sbyte*> [#uses=1]
        %tmp.1 = load sbyte* %inc.0.0           ; <sbyte> [#uses=1]
        %tmp.2 = seteq sbyte %tmp.1, 0          ; <bool> [#uses=1]
        %indvar.next = add ulong %indvar, 1             ; <ulong> [#uses=1]
        %indvar.next = add uint %indvar, 1              ; <uint> [#uses=1]
        br bool %tmp.2, label %loopexit.loopexit, label %no_exit

loopexit.loopexit:              ; preds = %no_exit
        %indvar = cast uint %indvar to int              ; <int> [#uses=1]
        %inc.1 = add int %indvar, 1             ; <int> [#uses=1]
        ret int %inc.1

loopexit:               ; preds = %entry
        ret int 0
}


Here's the after code:

int %_strlen(sbyte* %str) {
entry:
        %inc.02 = getelementptr sbyte* %str, uint 1             ; <sbyte*> [#uses=1]
        %tmp.13 = load sbyte* %str              ; <sbyte> [#uses=1]
        %tmp.24 = seteq sbyte %tmp.13, 0                ; <bool> [#uses=1]
        br bool %tmp.24, label %loopexit, label %no_exit

no_exit:                ; preds = %entry, %no_exit
***     %indvar = phi uint [ %indvar.next, %no_exit ], [ 0, %entry ]            ; <uint> [#uses=3]
        %indvar = cast uint %indvar to int              ; <int> [#uses=1]
        %inc.0.0 = getelementptr sbyte* %inc.02, uint %indvar           ; <sbyte*> [#uses=1]
        %inc.1 = add int %indvar, 1             ; <int> [#uses=1]
        %tmp.1 = load sbyte* %inc.0.0           ; <sbyte> [#uses=1]
        %tmp.2 = seteq sbyte %tmp.1, 0          ; <bool> [#uses=1]
        %indvar.next = add uint %indvar, 1              ; <uint> [#uses=1]
        br bool %tmp.2, label %loopexit, label %no_exit

loopexit:               ; preds = %entry, %no_exit
        %len.0.1 = phi int [ 0, %entry ], [ %inc.1, %no_exit ]          ; <int> [#uses=1]
        ret int %len.0.1
}

llvm-svn: 13016
2004-04-17 18:16:10 +00:00
Chris Lattner
885a6eb74d Even if there are not any induction variables in the loop, if we can compute
the trip count for the loop, insert one so that we can canonicalize the exit
condition.

llvm-svn: 13015
2004-04-17 18:08:33 +00:00
Chris Lattner
a43312d30b Add support for evaluation of exp/log/log10/pow
llvm-svn: 13011
2004-04-16 22:35:33 +00:00
Chris Lattner
284d3b0311 Fix some really nasty dominance bugs that were exposed by my patch to
make the verifier more strict.  This fixes building zlib

llvm-svn: 13002
2004-04-16 18:08:07 +00:00
Misha Brukman
ede10c9185 Fix retriving parent Function.
llvm-svn: 13001
2004-04-16 17:37:12 +00:00
Misha Brukman
66532f5e8a Fit comment into 80 cols.
llvm-svn: 12996
2004-04-16 17:13:52 +00:00
Brian Gaeke
efe9105979 Regenerated using autoconf-2.57.
llvm-svn: 12995
2004-04-16 17:13:44 +00:00
Brian Gaeke
fe766057a9 Refactor external benchmark checking stuff into one hairy
macro-to-bind-them-all, called EXTERNAL_BENCHMARK().

llvm-svn: 12994
2004-04-16 17:13:33 +00:00
Misha Brukman
c08a573515 Add idea about a disassembler.
llvm-svn: 12993
2004-04-16 16:55:30 +00:00
Brian Gaeke
ec240edcc8 Switch to including <iostream> for compatibility with gcc-3.0.x (Debian).
llvm-svn: 12990
2004-04-16 16:28:33 +00:00
Misha Brukman
0c88a74044 * Fix capitalization of PICk
* Wrap long lines to 80 cols

llvm-svn: 12988
2004-04-16 16:20:07 +00:00
Brian Gaeke
174633b078 Include <cmath> for compatibility with gcc 3.0.x (the system compiler on
Debian.)

llvm-svn: 12986
2004-04-16 15:57:32 +00:00
Brian Gaeke
8bd536a311 Include <string> for compatibility with gcc 3.0.x (the system compiler on
Debian.)

llvm-svn: 12985
2004-04-16 15:57:14 +00:00
Brian Gaeke
7850dd6877 As a part of the bootstrapping process, the top-level tools-only target
should not build projects.

llvm-svn: 12984
2004-04-16 15:57:02 +00:00
Misha Brukman
0af4a9c12b Assert if deleting BasicBlock before removing it from Function.
llvm-svn: 12983
2004-04-16 15:47:21 +00:00
Misha Brukman
1a6b00cd57 Assert if Instruction is being deleted before being removed from BasicBlock.
llvm-svn: 12982
2004-04-16 15:46:43 +00:00
Chris Lattner
994e48ff09 Remove libraries that have no reason to be here, and keep breaking the nightly tester because their makefiles do not have the right dependencies!!
llvm-svn: 12981
2004-04-16 14:12:36 +00:00
Chris Lattner
9e9b2b7474 Fix some of the strange CBE-only failures that happened last night.
llvm-svn: 12980
2004-04-16 06:03:17 +00:00
Chris Lattner
0377e4384f 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
Chris Lattner
82876bdb2a Bugpoint was not correctly capturing stderr! This caused it to "find" bugs
that didn't exist, missing the ones that do :(

llvm-svn: 12978
2004-04-16 05:35:58 +00:00
Chris Lattner
0328d75c83 Fix Inline/2004-04-15-InlineDeletesCall.ll
Basically we were using SimplifyCFG as a huge sledgehammer for a simple
optimization.  Because simplifycfg does so many things, we can't use it
for this purpose.

llvm-svn: 12977
2004-04-16 05:17:59 +00:00
Misha Brukman
272322e591 Add note about easier way to debug tests in the llvm tree.
llvm-svn: 12972
2004-04-15 21:01:21 +00:00
Misha Brukman
c21921cec7 Add note about passing arguments to program being debugged.
llvm-svn: 12970
2004-04-15 20:49:32 +00:00
Chris Lattner
fbc88b6cbd New testcase that Brian provided which crashes the inliner
llvm-svn: 12969
2004-04-15 20:45:45 +00:00
Chris Lattner
d7a559e353 Fix a bug in the previous checkin: if the exit block is not the same as
the back-edge block, we must check the preincremented value.

llvm-svn: 12968
2004-04-15 20:26:22 +00:00
Brian Gaeke
5bee0f3068 Give SparcV9CodeEmitter a head-of-file comment and a PassName.
llvm-svn: 12967
2004-04-15 20:23:13 +00:00
Misha Brukman
cf2b18791a If we're going to use tabs, use them consistently. Maybe doxygen will find the
@parameter line documentation that way, too.

llvm-svn: 12966
2004-04-15 15:38:48 +00:00
Misha Brukman
a34f067bac Removed obsolete doxygen options (they were blank anyway).
llvm-svn: 12965
2004-04-15 15:33:49 +00:00
Misha Brukman
b4f20ea496 The "best" of both worlds: readable C++ comments and valid HTML For doxygen.
llvm-svn: 12964
2004-04-15 15:30:15 +00:00
Misha Brukman
cd19073a70 Don't use invalid HTML in doxygen comments.
llvm-svn: 12963
2004-04-15 15:24:55 +00:00
Misha Brukman
d061d81571 Don't use invalid HTML in a doxygen comment.
llvm-svn: 12962
2004-04-15 15:23:45 +00:00
Chris Lattner
0cec5cb92c Change the canonical induction variable that we insert.
Instead of producing code like this:

Loop:
  X = phi 0, X2
  ...

  X2 = X + 1
  if (X != N-1) goto Loop

We now generate code that looks like this:

Loop:
  X = phi 0, X2
  ...

  X2 = X + 1
  if (X2 != N) goto Loop

This has two big advantages:
  1. The trip count of the loop is now explicit in the code, allowing
     the direct implementation of Loop::getTripCount()
  2. This reduces register pressure in the loop, and allows X and X2 to be
     put into the same register.

As a consequence of the second point, the code we generate for loops went
from:

.LBB2:  # no_exit.1
	...
        mov %EDI, %ESI
        inc %EDI
        cmp %ESI, 2
        mov %ESI, %EDI
        jne .LBB2 # PC rel: no_exit.1

To:

.LBB2:  # no_exit.1
	...
        inc %ESI
        cmp %ESI, 3
        jne .LBB2 # PC rel: no_exit.1

... which has two fewer moves, and uses one less register.

llvm-svn: 12961
2004-04-15 15:21:43 +00:00
Chris Lattner
d9dc425376 add some helpful methods. Rearrange #includes to proper order
llvm-svn: 12960
2004-04-15 15:16:02 +00:00
Chris Lattner
6580bbda3d Add some helpful methods
llvm-svn: 12959
2004-04-15 15:15:40 +00:00
Chris Lattner
b4f681b42b Factor a bunch of classes out into a public header
llvm-svn: 12958
2004-04-15 15:07:24 +00:00
Chris Lattner
3598d13b1c Publically export all of these classes from the ScalarEvolutions.cpp file
llvm-svn: 12957
2004-04-15 15:06:59 +00:00
Chris Lattner
a4e4a63856 Unbreak the build
llvm-svn: 12956
2004-04-15 14:17:43 +00:00
Chris Lattner
d420fe63ea Implement a FIXME: if we're going to insert a cast, we might as well only
insert it once!

llvm-svn: 12955
2004-04-14 22:01:22 +00:00
John Criswell
e3e2c91997 Remove code to adjust the iterator for llvm.readio and llvm.writeio.
The iterator is pointing at the next instruction which should not disappear
when doing the load/store replacement.

llvm-svn: 12954
2004-04-14 21:27:56 +00:00
Brian Gaeke
0174347d9a Fix typo.
llvm-svn: 12953
2004-04-14 21:21:56 +00:00
Chris Lattner
8a9fd94cfe This is a trivial tweak to the addrec insertion code: insert the increment
at the bottom of the loop instead of the top.  This reduces the number of
overlapping live ranges a lot, for example, eliminating a spill in an important
loop in 183.equake with linear scan.

I still need to make the exit comparison of the loop use the post-incremented
version of this variable, but this is an easy first step.

llvm-svn: 12952
2004-04-14 21:11:25 +00:00
Brian Gaeke
aec2bcd63b Add a TargetData to the PassManager regardless of the TargetMachine.
This should unbreak the Sparc JIT again.

llvm-svn: 12949
2004-04-14 17:45:52 +00:00
Brian Gaeke
9a2e37bccd Add a copy constructor for TargetData.
llvm-svn: 12948
2004-04-14 17:45:48 +00:00
Chris Lattner
cea7f660bc We are now on LLVM 1.3
Make autoconf default to checking to look to see if our funny directory exists

llvm-svn: 12947
2004-04-14 16:32:34 +00:00
Chris Lattner
6d06918ef0 Regenerated
llvm-svn: 12946
2004-04-14 16:32:09 +00:00
John Criswell
c4e72c9a0a 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
0c654c6a4e 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
917b641609 Test for memory mapped I/O intrinsics.
llvm-svn: 12943
2004-04-14 13:52:56 +00:00
John Criswell
23c48d63d6 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
6679e46b59 ADd a trivial instcombine: load null -> null
llvm-svn: 12940
2004-04-14 03:28:36 +00:00
Chris Lattner
0dc099c2b5 This is the real fix for Codegen/X86/2004-04-13-FPCMOV-Crash.llx which works
even when the "optimization" I added before is turned off.  It generates this
extremely pointless code:

test:
        fld QWORD PTR [%ESP + 4]
        mov %AL, 0
        test %AL, %AL
        fcmove %ST(0), %ST(0)
        ret

Good thing the optimizer will have removed this before code generation
anyway.  :)

llvm-svn: 12939
2004-04-14 02:42:32 +00:00
Chris Lattner
52acdaacc7 Temporarily hack in the intrinsics that John added. I expect him to finish up their addition, but in the meantime, the build should not be broken.
llvm-svn: 12938
2004-04-14 02:22:54 +00:00
John Criswell
beded72a08 Added support for the llvm.readio and llvm.writeio intrinsics.
On x86, memory operations occur in-order, so these are just lowered into
volatile loads and stores.

llvm-svn: 12936
2004-04-13 22:13:14 +00:00
Chris Lattner
9042e381d8 Implement a small optimization, which papers over the problem in
X86/2004-04-13-FPCMOV-Crash.llx

A more robust fix is to follow.

llvm-svn: 12935
2004-04-13 21:56:09 +00:00
Chris Lattner
ed94fef7e3 Fix bug, add support for +/-
llvm-svn: 12934
2004-04-13 21:48:43 +00:00
Chris Lattner
8662beeecd new testcase that crashes the fp stackifier
llvm-svn: 12932
2004-04-13 21:44:54 +00:00
Chris Lattner
ed7a7d20c9 We actually don't have spiff anymore
llvm-svn: 12929
2004-04-13 20:59:47 +00:00
Chris Lattner
9a3ac1a956 Out with spiff, in with fpcmp
llvm-svn: 12928
2004-04-13 20:59:24 +00:00
Chris Lattner
e542c1c422 Remove spiff. Though it looked good, it was not really as spiffy as it seemed
llvm-svn: 12927
2004-04-13 20:58:42 +00:00
Chris Lattner
5613bcc258 Okay, spiff is completely incapable of handling files of nontrivial size.
Here is a simple minimal program that does what we want.  Instead of taking
minutes to compare mesa's output, and crashing on binary files (like spiff
does), this take < .02s in the common case and doesn't crash.

llvm-svn: 12926
2004-04-13 20:55:49 +00:00
Chris Lattner
cb5e795f1f Add a note
llvm-svn: 12922
2004-04-13 19:48:55 +00:00
Chris Lattner
ff9362a8da Add SCCP support for constant folding calls, implementing:
test/Regression/Transforms/SCCP/calltest.ll

llvm-svn: 12921
2004-04-13 19:43:54 +00:00
Chris Lattner
9d42084081 New testcase
llvm-svn: 12920
2004-04-13 19:43:33 +00:00
Chris Lattner
ca52d0468e Add a simple call constant propagation interface.
llvm-svn: 12919
2004-04-13 19:28:52 +00:00
Chris Lattner
7dacdb6f13 Add new interfaces
llvm-svn: 12918
2004-04-13 19:28:32 +00:00
Chris Lattner
d0dc6d5295 Constant propagation should remove the dead instructions
llvm-svn: 12917
2004-04-13 19:28:20 +00:00
Chris Lattner
e3debac3cd New testcase
llvm-svn: 12916
2004-04-13 19:28:09 +00:00
Brian Gaeke
9a79ed7b89 Regenerated using autoconf-2.57.
llvm-svn: 12915
2004-04-13 19:03:49 +00:00
Brian Gaeke
fca4720590 Rewrite POV-Ray check as per PR301
llvm-svn: 12914
2004-04-13 19:02:51 +00:00
Chris Lattner
becf6365d6 Increase buffer size again. *sigh*
llvm-svn: 12912
2004-04-13 18:43:18 +00:00
Chris Lattner
f37bd007e4 Don't index spiff. It should not count as lines of LLVM code
llvm-svn: 12911
2004-04-13 18:37:51 +00:00
Chris Lattner
763596e28d Fixed sized limits are bad... duh.
llvm-svn: 12908
2004-04-13 18:34:16 +00:00
Chris Lattner
7b9733dac2 Really spiff, don't chatter :)
llvm-svn: 12907
2004-04-13 18:33:21 +00:00
Brian Gaeke
6f6e4b9f59 I don't think we have to have 4 extra allocated (but unused) bytes on the stack.
llvm-svn: 12905
2004-04-13 18:28:37 +00:00
Brian Gaeke
969795b4ea I started working on casts, but I don't have anything compilable yet.
llvm-svn: 12903
2004-04-13 18:27:46 +00:00
Brian Gaeke
bacab88d42 Don't underline diffs
llvm-svn: 12902
2004-04-13 18:24:01 +00:00
Chris Lattner
c71b096672 Emit the immediate form of in/out when possible.
Fix several bugs in the intrinsics:
  1. Make sure to copy the input registers before the instructions that use them
  2. Make sure to copy the value returned by 'in' out of EAX into the register
     it is supposed to be in.

This fixes assertions when using in/out and linear scan.

llvm-svn: 12896
2004-04-13 17:20:37 +00:00
Chris Lattner
a340febe52 Add immediate forms of in/out. Use let to shorten lines
llvm-svn: 12895
2004-04-13 17:19:31 +00:00
Chris Lattner
eaa28a29ae Add support for new instruction type
llvm-svn: 12894
2004-04-13 17:18:51 +00:00
Chris Lattner
27b2e2cdc0 Add support for the printImplicitDefsBefore flag
llvm-svn: 12893
2004-04-13 17:18:39 +00:00
Chris Lattner
e342a8ef49 Make the testcase more challenging
llvm-svn: 12892
2004-04-13 17:18:07 +00:00
Chris Lattner
34fba8eb00 Reenable library now that the loopsimplify bug is fixed
llvm-svn: 12891
2004-04-13 16:24:53 +00:00
Chris Lattner
89e959bb1f Fix LoopSimplify/2004-04-13-LoopSimplifyUpdateDomFrontier.ll
LoopSimplify was not updating dominator frontiers correctly in some cases.

llvm-svn: 12890
2004-04-13 16:23:25 +00:00
Chris Lattner
a7aeb506dd New testcase where loop simplify is not updating domfrontiers correctly
llvm-svn: 12889
2004-04-13 16:22:04 +00:00
Chris Lattner
a6e22814ab Refactor code a bit to make it simpler and eliminate the goto
llvm-svn: 12888
2004-04-13 15:21:18 +00:00
Chris Lattner
54dcea809f Add notes about some of the code quality improvements that have gone in
llvm-svn: 12887
2004-04-13 14:43:35 +00:00
Chris Lattner
277f7e6ebc Temporary hack to get the nightly tester running
llvm-svn: 12886
2004-04-13 13:57:29 +00:00
John Criswell
ed868e14ff Added Spiff.
llvm-svn: 12885
2004-04-13 13:42:38 +00:00
Chris Lattner
8417052938 This patch addresses PR35: Loop simplify should reconstruct nested loops.
This is fairly straight-forward, but was a real nightmare to get just
perfect.  aarg.  :)

llvm-svn: 12884
2004-04-13 05:05:33 +00:00
Brian Gaeke
ff27406cf9 Clean up the Spiff code so that it emits fewer warnings. This
consists mostly of changing sloppy K&R C code to slightly more
disciplined K&R C code, and doing the usual things to shut gcc up.

llvm-svn: 12877
2004-04-13 03:24:45 +00:00
Brian Gaeke
2ec7dfc278 Build Spiff directory
llvm-svn: 12876
2004-04-12 22:53:51 +00:00
Brian Gaeke
4ae2642fd4 Add the Spiff fp-aware diff utility from Bellcore
llvm-svn: 12875
2004-04-12 22:53:24 +00:00
Brian Gaeke
bb0f2db881 We don't need to insert TargetData into the PassManager here.
llvm-svn: 12874
2004-04-12 21:46:31 +00:00
Chris Lattner
176b4c2439 new testcase
llvm-svn: 12873
2004-04-12 20:59:07 +00:00
Alkis Evlogimenos
8f2df3aa3c Fix bug introduced in previous commit.
llvm-svn: 12872
2004-04-12 20:26:39 +00:00
Chris Lattner
55b7ef5a81 Add some methods that are useful for updating loop information.
llvm-svn: 12871
2004-04-12 20:26:17 +00:00
Alkis Evlogimenos
7ab640fdcb Update testcase to illustrate the coalescing problem. The previous one did not work because of a fix in the x86 instruction selector.
llvm-svn: 12870
2004-04-12 19:04:22 +00:00
Alkis Evlogimenos
0ede7ec4f8 Correctly compute spill weights
llvm-svn: 12869
2004-04-12 17:39:20 +00:00
John Criswell
b7147b33a0 Added testcase for the llvm.readport and llvm.writeport intrinsics.
llvm-svn: 12868
2004-04-12 16:42:43 +00:00
John Criswell
7a57647f97 Corrected the descriptions of the llvm.writeport and llvm.writeio
intrinsics.

Modified llvm.readio and llvm.writeio to use pointers to memory instead
of integers.  This should take care of problems such as different pointer
sizes, casting integers to pointers, weird architectural pointer types, etc.

Re-worded the description of llvm.readio and llvm.writeio so that it should
be more clear as to why they should be used over regular loads/stores for
I/O.

llvm-svn: 12867
2004-04-12 16:33:19 +00:00
Alkis Evlogimenos
b753c8c9c5 Print def lists a bit more compactly
llvm-svn: 12866
2004-04-12 15:57:58 +00:00
Alkis Evlogimenos
70bbce62b1 Add same value coalescing testcase
llvm-svn: 12865
2004-04-12 15:40:25 +00:00
John Criswell
a450122ebf Added initial design for the llvm.readio and llvm.writeio intrinsics.
llvm-svn: 12864
2004-04-12 15:02:16 +00:00
Chris Lattner
a2b279e89c Add a couple more IPO's
llvm-svn: 12863
2004-04-12 05:38:15 +00:00
Chris Lattner
0a7526470b finegrainify namespacification
llvm-svn: 12862
2004-04-12 05:38:01 +00:00
Chris Lattner
be43544429 Actually update the call graph as the inliner changes it. This allows us to
execute other CallGraphSCCPasses after the inliner without crashing.

llvm-svn: 12861
2004-04-12 05:37:29 +00:00
Chris Lattner
8b6db18ac3 Change the call graph class to have TWO external nodes, making call graph
SCC passes much more useful.  In particular, this should fix the incredibly
stupid missed inlining opportunities that the inliner suffered from.

llvm-svn: 12860
2004-04-12 05:36:32 +00:00
Chris Lattner
c9e37d7cc9 Hrm, operator new and new[] do not belong here. We should not CSE them! :)
llvm-svn: 12859
2004-04-12 05:16:42 +00:00
Chris Lattner
494a685449 Add support for removing invoke instructions
llvm-svn: 12858
2004-04-12 05:15:13 +00:00
Chris Lattner
08f201bee5 Stop printing Function*
llvm-svn: 12857
2004-04-12 04:06:56 +00:00
Chris Lattner
d041dcd92f Simplify code a bit, and be sure to mark the external node as potentially throwing
llvm-svn: 12856
2004-04-12 04:06:38 +00:00
Chris Lattner
a24f986333 Fix issues that the local allocator has dealing with instructions that implicitly use ST(0)
llvm-svn: 12855
2004-04-12 03:02:48 +00:00
Chris Lattner
2e2b0ceab9 No really, fix printing for LLC. I gotta get a way for CVS to whine at me if
I have unsaved emacs buffers, geeze...

llvm-svn: 12854
2004-04-12 01:52:04 +00:00
Chris Lattner
ba1038e0f3 Correct printing for LLC and the encoding for the JIT
llvm-svn: 12853
2004-04-12 01:50:04 +00:00
Chris Lattner
e407dbe9ff Use the fucomi[p] instructions to perform floating point comparisons instead
of the fucom[p][p] instructions.  This allows us to code generate this function

bool %test(double %X, double %Y) {
        %C = setlt double %Y, %X
        ret bool %C
}

... into:

test:
        fld QWORD PTR [%ESP + 4]
        fld QWORD PTR [%ESP + 12]
        fucomip %ST(1)
        fstp %ST(0)
        setb %AL
        movsx %EAX, %AL
        ret

where before we generated:

test:
        fld QWORD PTR [%ESP + 4]
        fld QWORD PTR [%ESP + 12]
        fucompp
**      fnstsw
**      sahf
        setb %AL
        movsx %EAX, %AL
        ret

The two marked instructions (which are the ones eliminated) are very bad,
because they serialize execution of the processor.  These instructions are
available on the PPRO and later, but since we already use cmov's we aren't
losing any portability.

I retained the old code for the day when we decide we want to support back
to the 386.

llvm-svn: 12852
2004-04-12 01:43:36 +00:00
Chris Lattner
d1c7545322 Add support for the FUCOMIr instruction
llvm-svn: 12851
2004-04-12 01:39:15 +00:00
Chris Lattner
6c84d4ca44 Add two new instructions
llvm-svn: 12850
2004-04-12 01:38:55 +00:00
Chris Lattner
0fe57da8fa Fix a bug in my load/cast folding patch.
llvm-svn: 12849
2004-04-12 00:23:04 +00:00
Chris Lattner
dc0105467a Adjust some comments, fix a bug in my previous patch
llvm-svn: 12848
2004-04-12 00:12:04 +00:00
Chris Lattner
dfbb1d1cfe Disambiguate symbols after loop extraction so that we can diagnose a code
generator bug if multiple loops are extracted from a function.

llvm-svn: 12847
2004-04-11 23:52:35 +00:00
Chris Lattner
07c1c11511 On X86, casting an integer to floating point requires going through memory.
If the source of the cast is a load, we can just use the source memory location,
without having to create a temporary stack slot entry.

Before we code generated this:

double %int(int* %P) {
        %V = load int* %P
        %V2 = cast int %V to double
        ret double %V2
}

into:

int:
        sub %ESP, 4
        mov %EAX, DWORD PTR [%ESP + 8]
        mov %EAX, DWORD PTR [%EAX]
        mov DWORD PTR [%ESP], %EAX
        fild DWORD PTR [%ESP]
        add %ESP, 4
        ret

Now we produce this:

int:
        mov %EAX, DWORD PTR [%ESP + 4]
        fild DWORD PTR [%EAX]
        ret

... which is nicer.

llvm-svn: 12846
2004-04-11 23:21:26 +00:00
Chris Lattner
14243fb3b8 New testcase
llvm-svn: 12845
2004-04-11 23:18:30 +00:00
Chris Lattner
d4af820aad Implement folding of loads into floating point operations. This implements:
test/Regression/CodeGen/X86/fp_load_fold.llx

llvm-svn: 12844
2004-04-11 22:05:45 +00:00
Chris Lattner
fe94f0bf93 New testcase
llvm-svn: 12843
2004-04-11 22:05:16 +00:00
Chris Lattner
dcb750f015 Unify all of the code for floating point +,-,*,/ into one function
llvm-svn: 12842
2004-04-11 21:23:56 +00:00
Chris Lattner
80ba401602 This implements folding of constant operands into floating point operations
for mul and div.

Instead of generating this:

test_divr:
        fld QWORD PTR [%ESP + 4]
        fld QWORD PTR [.CPItest_divr_0]
        fdivrp %ST(1)
        ret

We now generate this:

test_divr:
        fld QWORD PTR [%ESP + 4]
        fdivr QWORD PTR [.CPItest_divr_0]
        ret

This code desperately needs refactoring, which will come in the next
patch.

llvm-svn: 12841
2004-04-11 21:09:14 +00:00
Chris Lattner
e1efbc7c6c Restructure the mul/div/rem handling code to follow the pattern the other
instructions use.  This doesn't change any functionality except that long
constant expressions of these operations will now magically start working.

llvm-svn: 12840
2004-04-11 20:56:28 +00:00
Chris Lattner
f7ed7df539 Codegen FP adds and subtracts with a constant more efficiently, generating:
fld QWORD PTR [%ESP + 4]
        fadd QWORD PTR [.CPItest_add_0]

instead of:

        fld QWORD PTR [%ESP + 4]
        fld QWORD PTR [.CPItest_add_0]
        faddp %ST(1)

I also intend to do this for mul & div, but it appears that I have to
refactor a bit of code before I can do so.

This is tested by: test/Regression/CodeGen/X86/fp_constant_op.llx

llvm-svn: 12839
2004-04-11 20:26:20 +00:00
Chris Lattner
b6e0b58fbc Add some new instructions
llvm-svn: 12838
2004-04-11 20:24:15 +00:00
Chris Lattner
9affe3e7df New testcase
llvm-svn: 12837
2004-04-11 20:24:01 +00:00
Chris Lattner
5b44472200 Relax assertion to make this function work with a broader class of instructions
llvm-svn: 12836
2004-04-11 20:21:06 +00:00
Chris Lattner
3f912a6f43 Two changes:
1. If an incoming argument is dead, don't load it from the stack
  2. Do not code gen noop copies at all (ie, cast int -> uint), not even to
     a move.  This should reduce register pressure for allocators that are
     unable to coallesce away these copies in some cases.

llvm-svn: 12835
2004-04-11 19:21:59 +00:00
Chris Lattner
5ec93a8678 Add another variant of the testcase
llvm-svn: 12834
2004-04-11 19:01:35 +00:00
Chris Lattner
403abb824f operator new & operator new[] do not kill any legal memory locations.
llvm-svn: 12833
2004-04-11 18:16:34 +00:00
Chris Lattner
74e5c31746 new testcase
llvm-svn: 12832
2004-04-11 16:47:15 +00:00
Chris Lattner
c5fad355f8 Allow clients to be more efficient.
llvm-svn: 12831
2004-04-11 16:43:07 +00:00
Chris Lattner
9120ff3488 Make comments above APIs reflect what they should do.
llvm-svn: 12830
2004-04-11 16:42:50 +00:00
Chris Lattner
a55bf865ea New method to allow more efficient clients
llvm-svn: 12829
2004-04-11 16:35:30 +00:00
Chris Lattner
24cf0200c7 Fix a bug in my select transformation
llvm-svn: 12826
2004-04-11 01:39:19 +00:00
Chris Lattner
192e326cd3 Add a missing break, which caused a crash in an obscure situation
llvm-svn: 12825
2004-04-11 01:29:30 +00:00
Chris Lattner
f16fe7206c Update the value numbering interface.
llvm-svn: 12824
2004-04-10 22:33:34 +00:00
Chris Lattner
ffdfe64ced Note to self: SAVE FILES!
llvm-svn: 12823
2004-04-10 22:32:47 +00:00
Chris Lattner
8e096ddeaf Add an interface to update value numbering
llvm-svn: 12822
2004-04-10 22:32:09 +00:00
Chris Lattner
623fba1107 Implement InstCombine/select.ll:test13*
llvm-svn: 12821
2004-04-10 22:21:27 +00:00
Chris Lattner
1f99df6d27 New testcases
llvm-svn: 12820
2004-04-10 22:21:14 +00:00
Chris Lattner
cf4a996cba Implement InstCombine/add.ll:test20
Canonicalize add of sign bit constant into a xor

llvm-svn: 12819
2004-04-10 22:01:55 +00:00
Chris Lattner
825a00195d New testcase
llvm-svn: 12818
2004-04-10 22:01:27 +00:00
Chris Lattner
69c4900512 Rewrite the GCSE pass to be *substantially* simpler, a bit more efficient,
and a bit more powerful

llvm-svn: 12817
2004-04-10 21:11:11 +00:00
Chris Lattner
f9d9665138 Fix spurious warning in release mode
llvm-svn: 12816
2004-04-10 19:15:56 +00:00
Chris Lattner
d450df05ba Silence a spurious warning
llvm-svn: 12815
2004-04-10 18:32:01 +00:00
Chris Lattner
d95ef7eff0 Simplify code a bit, and fix a bug that was breaking perlbmk
llvm-svn: 12814
2004-04-10 18:06:21 +00:00
Chris Lattner
7ebfe61dc1 Fix a bug in my checkin last night that was breaking programs using invoke.
llvm-svn: 12813
2004-04-10 16:53:29 +00:00
Chris Lattner
5093213c40 Fix previous patch
llvm-svn: 12811
2004-04-10 07:27:48 +00:00
Chris Lattner
6149ac8991 Correctly update counters
llvm-svn: 12810
2004-04-10 07:02:02 +00:00
Chris Lattner
027ccc1200 Add note
llvm-svn: 12809
2004-04-10 06:56:53 +00:00
Chris Lattner
4a1b03c773 Add a couple of more functions that cannot access memory (the intrinsics) and
don't write to memory

llvm-svn: 12808
2004-04-10 06:55:27 +00:00
Chris Lattner
cfa1adcdb8 Simplify code a bit, and use alias analysis to allow us to delete unused
call and invoke instructions that are known to not write to memory.

llvm-svn: 12807
2004-04-10 06:53:09 +00:00
Chris Lattner
56471868e2 New testcases
llvm-svn: 12806
2004-04-10 06:52:20 +00:00
Chris Lattner
f72a30b31c Clarify interface
llvm-svn: 12805
2004-04-10 06:11:29 +00:00
Chris Lattner
5393e11318 Create the output directory if it's not already there
llvm-svn: 12804
2004-04-10 06:03:22 +00:00
Chris Lattner
d777677665 Simplify cfg now eliminates all of the branches in this testcase
llvm-svn: 12803
2004-04-09 23:50:29 +00:00
Chris Lattner
e4ad3e599b Another testcase
llvm-svn: 12802
2004-04-09 23:47:52 +00:00
Chris Lattner
24cd6b9371 Testcase to make sure we can apply the shift to the operands of the select,
eliminating the shifts

llvm-svn: 12801
2004-04-09 23:47:24 +00:00
Chris Lattner
56e4d3d8ad Implement select.ll:test12*
This transforms code like this:

   %C = or %A, %B
   %D = select %cond, %C, %A
into:
   %C = select %cond, %B, 0
   %D = or %A, %C

Since B is often a constant, the select can often be eliminated.  In any case,
this reduces the usage count of A, allowing subsequent optimizations to happen.

This xform applies when the operator is any of:
  add, sub, mul, or, xor, and, shl, shr

llvm-svn: 12800
2004-04-09 23:46:01 +00:00
Chris Lattner
be68fd036b Add testcases for harder combining cases.
llvm-svn: 12799
2004-04-09 23:43:48 +00:00
Chris Lattner
0aa565647c Fold code like:
if (C)
    V1 |= V2;

into:
  Vx = V1 | V2;
  V1 = select C, V1, Vx

when the expression can be evaluated unconditionally and is *cheap* to
execute.  This limited form of if conversion is quite handy in lots of cases.
For example, it turns this testcase into straight-line code:

int in0 ; int in1 ; int in2 ; int in3 ;
int in4 ; int in5 ; int in6 ; int in7 ;
int in8 ; int in9 ; int in10; int in11;
int in12; int in13; int in14; int in15;
long output;

void mux(void) {
  output =
      (in0   ?  0x00000001 : 0) | (in1   ?  0x00000002 : 0) |
      (in2   ?  0x00000004 : 0) | (in3   ?  0x00000008 : 0) |
      (in4   ?  0x00000010 : 0) | (in5   ?  0x00000020 : 0) |
      (in6   ?  0x00000040 : 0) | (in7   ?  0x00000080 : 0) |
      (in8   ?  0x00000100 : 0) | (in9   ?  0x00000200 : 0) |
      (in10  ?  0x00000400 : 0) | (in11  ?  0x00000800 : 0) |
      (in12  ?  0x00001000 : 0) | (in13  ?  0x00002000 : 0) |
      (in14  ?  0x00004000 : 0) | (in15  ?  0x00008000 : 0) ;
}

llvm-svn: 12798
2004-04-09 22:50:22 +00:00
Chris Lattner
5bcb4eb13c Fix an obvious bug in the refactoring I did a few days ago
llvm-svn: 12797
2004-04-09 22:28:33 +00:00
Chris Lattner
8ffe3e0b72 Expand on adding an intrinsic. Move section to before adding an instruction
llvm-svn: 12796
2004-04-09 19:24:20 +00:00
John Criswell
2b4c96e758 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
Chris Lattner
183b336a54 Fold binary operators with a constant operand into select instructions
that have a constant operand.  This implements
add.ll:test19, shift.ll:test15*, and others that are not tested

llvm-svn: 12794
2004-04-09 19:05:30 +00:00
Chris Lattner
cf7baf3519 Implement select.ll:test11
llvm-svn: 12793
2004-04-09 18:19:44 +00:00
Chris Lattner
755cab25ae new testcase
llvm-svn: 12792
2004-04-09 18:19:29 +00:00
Alkis Evlogimenos
237f203ca9 Add definition list to each live interval.
llvm-svn: 12791
2004-04-09 18:07:57 +00:00
John Criswell
417228d00a Fixed some spelling.
llvm-svn: 12790
2004-04-09 16:48:45 +00:00
John Criswell
aa1c3c1f23 Modified the prototypes of the llvm.readport and llvm.writeport intrinsics
so that they do not specify specific integer sizes (as those are
constrained by the code generator, not the intrinsic itself).

Also put these intrinsics into their own "Operating System" section.

llvm-svn: 12789
2004-04-09 16:43:20 +00:00
John Criswell
508b93c569 Added the llvm.readport and llvm.writeport intrinsics.
llvm-svn: 12788
2004-04-09 15:23:37 +00:00
John Criswell
2fc9983852 Changed assertions to error messages.
llvm-svn: 12787
2004-04-09 15:10:15 +00:00
John Criswell
c28c3b625f Changes recommended by Chris:
InstSelectSimple.cpp:
  Change the checks for proper I/O port address size into an exit() instead
  of an assertion.  Assertions aren't used in Release builds, and handling
  this error should be graceful (not that this counts as graceful, but it's
  more graceful).

  Modified the generation of the IN/OUT instructions to have 0 arguments.
X86InstrInfo.td:
  Added the OpSize attribute to the 16 bit IN and OUT instructions.

llvm-svn: 12786
2004-04-08 22:39:13 +00:00
Chris Lattner
e228ee5870 Implement InstCombine/cast-propagate.ll
llvm-svn: 12784
2004-04-08 20:39:49 +00:00
Chris Lattner
22b2166b36 New testcase
llvm-svn: 12783
2004-04-08 20:39:40 +00:00
John Criswell
10db062d41 Added the llvm.readport and llvm.writeport intrinsics for x86. These do
I/O port instructions on x86.  The specific code sequence is tailored to
the parameters and return value of the intrinsic call.
Added the ability for implicit defintions to be printed in the Instruction
Printer.
Added the ability for RawFrm instruction to print implict uses and
defintions with correct comma output.  This required adjustment to some
methods so that a leading comma would or would not be printed.

llvm-svn: 12782
2004-04-08 20:31:47 +00:00
John Criswell
5201004ef9 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
John Criswell
6d42651933 Added the llvm.readport and llvm.writeport intrinsics.
llvm-svn: 12780
2004-04-08 20:26:21 +00:00
Chris Lattner
3b3861d305 Implement ScalarRepl/select_promote.ll
llvm-svn: 12779
2004-04-08 19:59:34 +00:00
Chris Lattner
3b613818f6 New testcase, corresponding to phi_promote.ll
llvm-svn: 12778
2004-04-08 19:59:22 +00:00
Brian Gaeke
a8d593e947 This file does not appear to be included anywhere.
llvm-svn: 12777
2004-04-08 19:36:26 +00:00
Chris Lattner
d61b13c6e2 Disable strict alias analysis in the backend c compiler, as the code we
generate is not TBAA safe.

llvm-svn: 12774
2004-04-08 15:18:59 +00:00
Chris Lattner
a182f5bf48 Revert previous patch, I'm a moron :)
llvm-svn: 12773
2004-04-08 15:18:03 +00:00
Chris Lattner
177fe8d82f Right, we break strict aliasing requirements. Make sure to disable strict
aliasing in the C compiler.

llvm-svn: 12772
2004-04-08 15:14:43 +00:00
Chris Lattner
4d25c86b52 Remove the "really gross hacks" that are there to deal with recursive functions.
Now we collect all of the call sites we are interested in inlining, then inline
them.  This entirely avoids issues with trying to inline a call site we got by
inlining another call site.  This also eliminates iterator invalidation issues.

llvm-svn: 12770
2004-04-08 06:34:31 +00:00
Chris Lattner
1c631e813d Implement InstCombine/select.ll:test[7-10]
llvm-svn: 12769
2004-04-08 04:43:23 +00:00
Chris Lattner
ac42fd5912 Add some more cases we should combine
llvm-svn: 12768
2004-04-08 04:43:04 +00:00
Brian Gaeke
8a56f16700 This file is no longer used.
llvm-svn: 12767
2004-04-07 21:01:22 +00:00
Brian Gaeke
69ee7e1353 Don't include InstrSelectionSupport.h.
llvm-svn: 12766
2004-04-07 20:55:32 +00:00
Brian Gaeke
c125664927 Move ChooseRegOrImmed() prototype here, from InstrSelectionSupport.h.
llvm-svn: 12765
2004-04-07 20:38:57 +00:00
Brian Gaeke
5c80118367 Don't include InstrSelectionSupport.h.
llvm-svn: 12764
2004-04-07 20:38:56 +00:00
Chris Lattner
2b2412d0c8 Implement test/Regression/Transforms/InstCombine/getelementptr_index.ll
llvm-svn: 12762
2004-04-07 18:38:20 +00:00
Chris Lattner
dadf78d933 New testcase
llvm-svn: 12761
2004-04-07 18:38:01 +00:00
Brian Gaeke
8931345fe5 Fix insertion of SelectInsts.
llvm-svn: 12760
2004-04-07 18:31:47 +00:00
Brian Gaeke
85521d70dd Don't print [%reg + 0], just print [%reg]
llvm-svn: 12759
2004-04-07 17:33:56 +00:00
Brian Gaeke
6d62df5422 First version of code to handle loads. Stub function for handling stores.
llvm-svn: 12758
2004-04-07 17:29:37 +00:00
Brian Gaeke
989c04ab58 Support loading arguments from %I0...%I5 into virtual registers in
function prologues, and fix an off-by-one in visitCallInst that was
putting call args into the wrong registers.

llvm-svn: 12757
2004-04-07 17:04:09 +00:00
Brian Gaeke
7985e56cf9 It's setting up the call args right now, but on the callee side, it's
trying to get incoming args off the stack, instead of the %i0...%i6 regs,
which is wrong.

llvm-svn: 12756
2004-04-07 16:41:22 +00:00
Chris Lattner
13de334a4e New testcase that crashed scalarevolution on sparc
llvm-svn: 12755
2004-04-07 16:17:45 +00:00
Chris Lattner
74498e1066 Fix a bug Brian found.
llvm-svn: 12754
2004-04-07 16:16:11 +00:00
Brian Gaeke
52ad5f94e2 We have a global reg. allocator now -- thanks to Alkis.
Fix a typo.
Add a project I've always thought would be cool.

llvm-svn: 12747
2004-04-07 15:31:23 +00:00
Chris Lattner
d93de7a754 New file that can be useful for hand inspection of assembly required for certain
kinds of instructions.

llvm-svn: 12746
2004-04-07 05:06:39 +00:00
Chris Lattner
bd58b3fbe9 This is a start on handling setcc instructions. As the comment notes, we
have no good way of handling this until the code generator is improved.
We should probably just emit V9 instructions in the meantime.

llvm-svn: 12745
2004-04-07 05:04:51 +00:00
Chris Lattner
bb22d5a564 andd subcc instructions which is used to create the 'cmp' pseudo instruction
llvm-svn: 12744
2004-04-07 05:04:01 +00:00
Chris Lattner
f6245bc8e9 Avoid emitting an extra copy on each 32-bit operation
llvm-svn: 12743
2004-04-07 04:36:53 +00:00
Brian Gaeke
4aac81435f Make generation of stack-slot loads and copies less ugly.
llvm-svn: 12742
2004-04-07 04:29:14 +00:00
Brian Gaeke
3675c30873 Fix bug in printing loads.
llvm-svn: 12741
2004-04-07 04:29:03 +00:00
Chris Lattner
42ffd2e32c Add support for shift instructions, wrap some long lines
llvm-svn: 12740
2004-04-07 04:27:16 +00:00
Chris Lattner
8406cf3046 Fix encoding of existing shift instructions, add rr shifts
llvm-svn: 12739
2004-04-07 04:26:57 +00:00
Chris Lattner
a67801f0d4 New testcase
llvm-svn: 12738
2004-04-07 04:08:21 +00:00
Chris Lattner
fcdf82a19f Add a bunch more instructions
llvm-svn: 12737
2004-04-07 04:06:46 +00:00
Chris Lattner
fd8212ef54 Merge my changes with brians
llvm-svn: 12736
2004-04-07 04:05:49 +00:00
Brian Gaeke
37f92b534f Add in some things I forgot, which Chris helpfully reminded me of...
llvm-svn: 12735
2004-04-07 04:05:12 +00:00
Brian Gaeke
322423181b Add support for the "Y" register, used by MUL & DIV.
llvm-svn: 12734
2004-04-07 04:01:11 +00:00
Brian Gaeke
5524d54c02 Add UDIV, SDIV, and a few variants of WR.
llvm-svn: 12733
2004-04-07 04:01:00 +00:00
Brian Gaeke
cfbfb8ac57 Preliminary support for getting 64-bit integer constants into registers.
Preliminary support for division. It's gross because you have to initialize
the "Y" register, which is the top 32 bits of the thing you're dividing.

llvm-svn: 12732
2004-04-07 04:00:49 +00:00
Brian Gaeke
589bf05bf4 Prune unnecessary #includes
llvm-svn: 12731
2004-04-06 23:25:07 +00:00
Brian Gaeke
b3deed9fae Simple delay slot filler pass.
llvm-svn: 12730
2004-04-06 23:21:45 +00:00
Brian Gaeke
610c685eb6 Add references to delay slot filler pass.
Fill in addPassesToJITCompile method.

llvm-svn: 12729
2004-04-06 23:21:24 +00:00
Brian Gaeke
4bd246aee9 First attempt at handling frame index elimination.
llvm-svn: 12728
2004-04-06 22:10:22 +00:00
Brian Gaeke
3915ad7c02 First attempt at special-casing printing of [%reg + offset] for
ld/st instructions - doesn't seem to work yet, but I think it's
just a typo or something somewhere.

llvm-svn: 12727
2004-04-06 22:10:11 +00:00
Brian Gaeke
5e624b822b Delete reference to "the Mach-O Runtime ABI".
llvm-svn: 12726
2004-04-06 22:09:59 +00:00
Brian Gaeke
2e91a3d650 Deal with call return values.
Don't put NOPs in delay slots at all. We'll have a fix-up pass later.

llvm-svn: 12725
2004-04-06 22:09:23 +00:00
John Criswell
5ecbed21be Adding kimwitu++ license.
llvm-svn: 12719
2004-04-06 20:23:45 +00:00
Chris Lattner
4e34492569 Bugs fixed new features implemented
llvm-svn: 12716
2004-04-06 19:48:42 +00:00
Jakub Staszak
b8955205ce file based off InstSelectSimple.cpp, slowly being replaced by generated code from the really simple X86 instruction selector tablegen backend
llvm-svn: 12715
2004-04-06 19:35:17 +00:00
Jakub Staszak
de647007d3 Tablgen files for really simple instruction selector
llvm-svn: 12714
2004-04-06 19:34:00 +00:00
Jakub Staszak
68a9025f50 Tablegen backend for really simple instruction selector
llvm-svn: 12713
2004-04-06 19:31:31 +00:00
Jakub Staszak
f9bfc7f927 add tablgen backend for really simple instruction selector
llvm-svn: 12712
2004-04-06 19:30:56 +00:00
Chris Lattner
4b9361254a Fix PR313: [x86] JIT miscompiles unsigned short to floating point
llvm-svn: 12711
2004-04-06 19:29:36 +00:00
Chris Lattner
ba33ae5831 Fix incorrect encoding of some ADC and SBB instuctions
llvm-svn: 12710
2004-04-06 19:20:32 +00:00
John Criswell
4db8b67a68 Added licensing information for treecc.
llvm-svn: 12703
2004-04-06 17:51:10 +00:00
Chris Lattner
19c8b13ec5 Fix a minor bug in previous checking
Enable folding of long seteq/setne comparisons into branches and select instructions
Implement unfolded long relational comparisons against a constants a bit more efficiently

Folding comparisons changes code that looks like this:
        mov %EAX, DWORD PTR [%ESP + 4]
        mov %EDX, DWORD PTR [%ESP + 8]
        mov %ECX, %EAX
        or %ECX, %EDX
        sete %CL
        test %CL, %CL
        je .LBB2 # PC rel: F

into code that looks like this:
        mov %EAX, DWORD PTR [%ESP + 4]
        mov %EDX, DWORD PTR [%ESP + 8]
        mov %ECX, %EAX
        or %ECX, %EDX
        jne .LBB2 # PC rel: F

This speeds up 186.crafty by 6% with llc-ls.

llvm-svn: 12702
2004-04-06 17:34:50 +00:00
Misha Brukman
827c985aae Wrap at 80 cols.
llvm-svn: 12701
2004-04-06 17:04:30 +00:00
Chris Lattner
e216fc01b7 Minor cleanups
llvm-svn: 12700
2004-04-06 16:54:04 +00:00
Chris Lattner
7f601ade01 Document new option
llvm-svn: 12699
2004-04-06 16:46:12 +00:00
Chris Lattner
ad733e733e Add a new gccld -native-cbe option which causes gccld to generate native code
for the application with the C backend instead of the native LLVM code generator

llvm-svn: 12698
2004-04-06 16:43:13 +00:00
Chris Lattner
f2ee88eb5a Improve codegen of long == and != comparisons against constants. Before,
comparing a long against zero got us this:

        sub %ESP, 8
        mov DWORD PTR [%ESP + 4], %ESI
        mov DWORD PTR [%ESP], %EDI
        mov %EAX, DWORD PTR [%ESP + 12]
        mov %EDX, DWORD PTR [%ESP + 16]
        mov %ECX, 0
        mov %ESI, 0
        mov %EDI, %EAX
        xor %EDI, %ECX
        mov %ECX, %EDX
        xor %ECX, %ESI
        or %EDI, %ECX
        sete %CL
        test %CL, %CL
        je .LBB2 # PC rel: F

Now it gets us this:

        mov %EAX, DWORD PTR [%ESP + 4]
        mov %EDX, DWORD PTR [%ESP + 8]
        mov %ECX, %EAX
        or %ECX, %EDX
        sete %CL
        test %CL, %CL
        je .LBB2 # PC rel: F

llvm-svn: 12696
2004-04-06 16:02:27 +00:00
Chris Lattner
3ef249c05e Update docs a bit
llvm-svn: 12695
2004-04-06 15:22:35 +00:00
Chris Lattner
80e594fa80 Remove some options that don't really have anything to do with bugpoint
llvm-svn: 12694
2004-04-06 15:14:10 +00:00
Chris Lattner
6c3bf13fce Handle various other important cases of multiplying a long constant immediate. For
example, multiplying X*(1 + (1LL << 32)) now produces:

test:
        mov %ECX, DWORD PTR [%ESP + 4]
        mov %EDX, DWORD PTR [%ESP + 8]
        mov %EAX, %ECX
        add %EDX, %ECX
        ret

[[[Note to Alkis: why isn't linear scan generating this code??  This might be a
 problem with your intervals being too conservative:

test:
        mov %EAX, DWORD PTR [%ESP + 4]
        mov %EDX, DWORD PTR [%ESP + 8]
        add %EDX, %EAX
        ret

end note]]]

Whereas GCC produces this:

T:
        sub     %esp, 12
        mov     %edx, DWORD PTR [%esp+16]
        mov     DWORD PTR [%esp+8], %edi
        mov     %ecx, DWORD PTR [%esp+20]
        xor     %edi, %edi
        mov     DWORD PTR [%esp], %ebx
        mov     %ebx, %edi
        mov     %eax, %edx
        mov     DWORD PTR [%esp+4], %esi
        add     %ebx, %edx
        mov     %edi, DWORD PTR [%esp+8]
        lea     %edx, [%ecx+%ebx]
        mov     %esi, DWORD PTR [%esp+4]
        mov     %ebx, DWORD PTR [%esp]
        add     %esp, 12
        ret

I'm not sure example what GCC is smoking here, but it looks like it has just
confused itself with a bunch of stack slots or something.  The intel compiler
is better, but still not good:

T:
        movl      4(%esp), %edx                                 #2.11
        movl      8(%esp), %eax                                 #2.11
        lea       (%eax,%edx), %ecx                             #3.12
        movl      $1, %eax                                      #3.12
        mull      %edx                                          #3.12
        addl      %ecx, %edx                                    #3.12
        ret                                                     #3.12

llvm-svn: 12693
2004-04-06 04:55:43 +00:00
Chris Lattner
1f6024cbbe Efficiently handle a long multiplication by a constant. For this testcase:
long %test(long %X) {
        %Y = mul long %X, 123
        ret long %Y
}

we used to generate:

test:
        sub %ESP, 12
        mov DWORD PTR [%ESP + 8], %ESI
        mov DWORD PTR [%ESP + 4], %EDI
        mov DWORD PTR [%ESP], %EBX
        mov %ECX, DWORD PTR [%ESP + 16]
        mov %ESI, DWORD PTR [%ESP + 20]
        mov %EDI, 123
        mov %EBX, 0
        mov %EAX, %ECX
        mul %EDI
        imul %ESI, %EDI
        add %ESI, %EDX
        imul %ECX, %EBX
        add %ESI, %ECX
        mov %EDX, %ESI
        mov %EBX, DWORD PTR [%ESP]
        mov %EDI, DWORD PTR [%ESP + 4]
        mov %ESI, DWORD PTR [%ESP + 8]
        add %ESP, 12
        ret

Now we emit:
test:
        mov %EAX, DWORD PTR [%ESP + 4]
        mov %ECX, DWORD PTR [%ESP + 8]
        mov %EDX, 123
        mul %EDX
        imul %ECX, %ECX, 123
        add %ECX, %EDX
        mov %EDX, %ECX
        ret

Which, incidently, is substantially nicer than what GCC manages:
T:
        sub     %esp, 8
        mov     %eax, 123
        mov     DWORD PTR [%esp], %ebx
        mov     %ebx, DWORD PTR [%esp+16]
        mov     DWORD PTR [%esp+4], %esi
        mov     %esi, DWORD PTR [%esp+12]
        imul    %ecx, %ebx, 123
        mov     %ebx, DWORD PTR [%esp]
        mul     %esi
        mov     %esi, DWORD PTR [%esp+4]
        add     %esp, 8
        lea     %edx, [%ecx+%edx]
        ret

llvm-svn: 12692
2004-04-06 04:29:36 +00:00
Misha Brukman
ad3e28cbc6 * Added link to newly written ExtendingLLVM.html document
* Eliminated extraneous space in the HTML

llvm-svn: 12691
2004-04-06 04:22:43 +00:00
Misha Brukman
c069ca5d05 Incorporated Chris' comments.
llvm-svn: 12690
2004-04-06 04:17:51 +00:00
Misha Brukman
2282a6eb31 Added notes on extending LLVM with new instructions, intrinsics, types, etc.
llvm-svn: 12689
2004-04-06 03:53:49 +00:00
Chris Lattner
2448baea2a Improve code generation of long shifts by 32.
On this testcase:

long %test(long %X) {
        %Y = shr long %X, ubyte 32
        ret long %Y
}

instead of:
t:
        mov %EAX, DWORD PTR [%ESP + 4]
        mov %EAX, DWORD PTR [%ESP + 8]
        sar %EAX, 0
        mov %EDX, 0
        ret


we now emit:
test:
        mov %EAX, DWORD PTR [%ESP + 4]
        mov %EAX, DWORD PTR [%ESP + 8]
        mov %EDX, 0
        ret

llvm-svn: 12688
2004-04-06 03:42:38 +00:00
Chris Lattner
7332d4c5fd Bugfixes: inc/dec don't set the carry flag!
llvm-svn: 12687
2004-04-06 03:36:57 +00:00
Chris Lattner
decce5bc26 Improve code for passing constant longs as arguments to function calls.
For example, on this instruction:

        call void %test(long 1234)

Instead of this:
        mov %EAX, 1234
        mov %ECX, 0
        mov DWORD PTR [%ESP], %EAX
        mov DWORD PTR [%ESP + 4], %ECX
        call test

We now emit this:
        mov DWORD PTR [%ESP], 1234
        mov DWORD PTR [%ESP + 4], 0
        call test

llvm-svn: 12686
2004-04-06 03:23:00 +00:00
Chris Lattner
5fc6f77b60 Emit more efficient 64-bit operations when the RHS is a constant, and one
of the words of the constant is zeros.  For example:
  Y = and long X, 1234

now generates:
  Yl = and Xl, 1234
  Yh = 0

instead of:
  Yl = and Xl, 1234
  Yh = and Xh, 0

llvm-svn: 12685
2004-04-06 03:15:53 +00:00
Chris Lattner
b49608afad Fix typeo
llvm-svn: 12684
2004-04-06 02:13:25 +00:00
Chris Lattner
996e667ad4 Add support for simple immediate handling to long instruction selection.
This allows us to handle code like 'add long %X, 123456789012' more efficiently.

llvm-svn: 12683
2004-04-06 02:11:49 +00:00
Chris Lattner
9366f0347d The sbb instructions really ARE sbb's, not adc's
llvm-svn: 12682
2004-04-06 02:02:11 +00:00
Chris Lattner
37ba31f740 Implement negation of longs efficiently. For this testcase:
long %test(long %X) {
        %Y = sub long 0, %X
        ret long %Y
}

We used to generate:

test:
        sub %ESP, 4
        mov DWORD PTR [%ESP], %ESI
        mov %ECX, DWORD PTR [%ESP + 8]
        mov %ESI, DWORD PTR [%ESP + 12]
        mov %EAX, 0
        mov %EDX, 0
        sub %EAX, %ECX
        sbb %EDX, %ESI
        mov %ESI, DWORD PTR [%ESP]
        add %ESP, 4
        ret

Now we generate:

test:
        mov %EAX, DWORD PTR [%ESP + 4]
        mov %EDX, DWORD PTR [%ESP + 8]
        neg %EAX
        adc %EDX, 0
        neg %EDX
        ret

llvm-svn: 12681
2004-04-06 01:48:06 +00:00
Chris Lattner
bfe74f58d9 Minor tweak to avoid an extra reg-reg copy that the register allocator has to eliminate
llvm-svn: 12680
2004-04-06 01:25:33 +00:00
Chris Lattner
464e2ea567 Two changes:
* In promote32, if we can just promote a constant value, do so instead of
    promoting a constant dynamically.
  * In visitReturn inst, actually USE the promote32 argument that takes a
    Value*

The end result of this is that we now generate this:

test:
        mov %EAX, 0
        ret

instead of...

test:
        mov %AX, 0
        movzx %EAX, %AX
        ret

for:

ushort %test() {
        ret ushort 0
}

llvm-svn: 12679
2004-04-06 01:21:00 +00:00
Chris Lattner
bf791614ed Merge the code generator miscompilation code into the optimizer miscompilation
code.  This "instantly" gives us loop-extractor power to assist with the
debugment of our nasty codegen issues.  :)

llvm-svn: 12678
2004-04-05 22:58:16 +00:00
Chris Lattner
95053a9f28 Make a method public
llvm-svn: 12677
2004-04-05 22:01:48 +00:00
Chris Lattner
9af52d12d9 Minor cleanups, remove some old debug code
llvm-svn: 12676
2004-04-05 21:37:55 +00:00
Chris Lattner
0434ba3ed0 Refactor and genericize code
llvm-svn: 12675
2004-04-05 21:37:38 +00:00
Chris Lattner
b0d1e9d02e lli no longer takes the -quiet option!
llvm-svn: 12674
2004-04-05 20:28:41 +00:00
Chris Lattner
c97b7b2285 Do not mangle intrinsics in any way!
llvm-svn: 12673
2004-04-05 20:17:53 +00:00
Chris Lattner
0f1df36bdd Make full use of the Mangler interface to simplify code
llvm-svn: 12671
2004-04-05 19:31:02 +00:00
Chris Lattner
d4f78f270b Sparc don't got not "sqrtl", bum bum bum
llvm-svn: 12670
2004-04-05 19:05:15 +00:00
Misha Brukman
5ebc25c818 Kill warnings during an optimized compile where assert() disappears.
llvm-svn: 12669
2004-04-05 19:00:46 +00:00
Chris Lattner
29153fc2e5 Fix PR312 and IndVarsSimplify/2004-04-05-InvokeCastCrash.llx
llvm-svn: 12668
2004-04-05 18:46:55 +00:00
Chris Lattner
6f4fea937b New testcase for PR312
llvm-svn: 12667
2004-04-05 18:46:33 +00:00
Chris Lattner
4d1fcf1dcd Fix a bug in yesterdays checkins which broke siod. siod is a great testcase! :)
llvm-svn: 12659
2004-04-05 16:02:41 +00:00
Chris Lattner
8953b90aaa Fix InstCombine/2004-04-04-InstCombineReplaceAllUsesWith.ll
llvm-svn: 12658
2004-04-05 02:10:19 +00:00
Chris Lattner
e79fd5c766 New testcase that crashes the instcombine pass. Dominance properties have
no meaning if the code is not reachable.

llvm-svn: 12657
2004-04-05 02:01:32 +00:00
Chris Lattner
677202b49e PR82 is finally fixed!
llvm-svn: 12656
2004-04-05 01:43:08 +00:00
Chris Lattner
6087034f3a Minor change
llvm-svn: 12655
2004-04-05 01:31:50 +00:00
Chris Lattner
33fd702590 Update getelementptr instruction description
llvm-svn: 12654
2004-04-05 01:30:49 +00:00
Chris Lattner
69193f93b6 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
fd9fbe187d 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.

Auto-upgrade .ll files that use ubytes to index into structures to use uint's.

llvm-svn: 12652
2004-04-05 01:30:04 +00:00
Chris Lattner
15701e84d1 Implement support for a new LLVM 1.3 bytecode format, which uses uint's
to index into structure types and allows arbitrary 32- and 64-bit integer
types to index into sequential types.

llvm-svn: 12651
2004-04-05 01:27:26 +00:00
Chris Lattner
60cf133a8e Be more restrictive with the index types we allow for sequential types
llvm-svn: 12650
2004-04-05 01:25:21 +00:00
Chris Lattner
e916f16dbb PR305 is now fixed
llvm-svn: 12649
2004-04-05 00:40:55 +00:00
Chris Lattner
dd28474610 Add ConstantExpr::get(Sign|Zero)Extend methods
llvm-svn: 12648
2004-04-04 23:20:30 +00:00
Chris Lattner
dfcf8e34cf In the perhaps not-to-distant future, we might support gep instructions that
have non-long indices for sequential types.  In order to avoid trying to figure
out how the v9 backend works, we'll just hack it in the preselection pass.

llvm-svn: 12647
2004-04-04 20:44:05 +00:00
Chris Lattner
ca76d11a81 Adjust to new interface
llvm-svn: 12646
2004-04-04 19:47:06 +00:00
Chris Lattner
5453b2f376 Support iteration over constant instructions
llvm-svn: 12645
2004-04-04 19:46:54 +00:00
Chris Lattner
092d260fc1 Adjust to new gep_type_iterator prototypes.
llvm-svn: 12644
2004-04-04 17:30:06 +00:00
Chris Lattner
bc8ba73cf1 Remove a bunch of cruft that was used to be backwards compatible with the last
prerelease format for LLVM bytecode files.  Now we only are compatible with
LLVM 1.0+.

llvm-svn: 12643
2004-04-03 23:43:42 +00:00
Chris Lattner
476f71e30b Allow for use of arbitrary iterator types...
llvm-svn: 12642
2004-04-03 23:29:11 +00:00
Chris Lattner
8ed3c8aa13 Implement test/Regression/Transforms/GCSE/undefined_load.ll
llvm-svn: 12641
2004-04-03 00:45:16 +00:00
Chris Lattner
db033fa425 New testcase
llvm-svn: 12640
2004-04-03 00:44:56 +00:00
Chris Lattner
0defaa1cbc Add a break in the default case
llvm-svn: 12639
2004-04-03 00:43:03 +00:00
Brian Gaeke
5ade501501 Add autoconf support for isStandardOutAConsole ().
llvm-svn: 12638
2004-04-02 21:26:04 +00:00
Brian Gaeke
0d372ee696 Regenerated using autoheader-2.57.
llvm-svn: 12637
2004-04-02 21:26:03 +00:00
Brian Gaeke
8bdbb3d7eb Regenerated using autoconf-2.57.
llvm-svn: 12636
2004-04-02 21:26:02 +00:00
Brian Gaeke
c6dba95bbc check for isatty function
llvm-svn: 12635
2004-04-02 21:06:44 +00:00
Chris Lattner
9dcd639e5c Remove obsolete analyses
llvm-svn: 12634
2004-04-02 20:56:33 +00:00
Chris Lattner
6748cca268 Remove obsolete files
llvm-svn: 12633
2004-04-02 20:56:24 +00:00
Brian Gaeke
d0bdad38f3 Add support for many of the MRegisterInfo callbacks.
Eliminating call-frame pseudo instrs and frame indices are still stubs.
Flesh out the emitPrologue method based on better ABI knowledge.

llvm-svn: 12632
2004-04-02 20:53:37 +00:00
Brian Gaeke
d4869e4107 Add load, store, and NOP instructions.
Fix up comments.

llvm-svn: 12631
2004-04-02 20:53:37 +00:00
Brian Gaeke
b65254a34d Add support for printing pc-relative displacements of functions (as used in
the CALL instruction).

llvm-svn: 12630
2004-04-02 20:53:35 +00:00
Brian Gaeke
2fd46b6e43 Add support for call instructions (0-ary only for now).
llvm-svn: 12629
2004-04-02 20:53:33 +00:00
Chris Lattner
6f29c89597 cleanup some long-dead code
llvm-svn: 12628
2004-04-02 20:46:26 +00:00
Chris Lattner
d4f122044a Ignore configure produced files
llvm-svn: 12627
2004-04-02 20:34:30 +00:00
Chris Lattner
64cdd1ef55 Tweak libraries for scev changes
llvm-svn: 12625
2004-04-02 20:32:46 +00:00
Chris Lattner
d8d803adb9 new testcase
llvm-svn: 12624
2004-04-02 20:27:47 +00:00
Chris Lattner
0916921332 Comment out debugging printouts
llvm-svn: 12623
2004-04-02 20:26:46 +00:00
Chris Lattner
76378746c5 New testcases for the indvars pass
llvm-svn: 12622
2004-04-02 20:26:04 +00:00
Chris Lattner
2c416ae11f Tweak testcase to work with new indvars pass
llvm-svn: 12621
2004-04-02 20:25:26 +00:00
Chris Lattner
e61b67d7d5 Rewrite the indvars pass to use the ScalarEvolution analysis.
This also implements some new features for the indvars pass, including
linear function test replacement, exit value substitution, and it works with
a much more general class of induction variables and loops.

llvm-svn: 12620
2004-04-02 20:24:31 +00:00
Chris Lattner
d934c70cf8 Add a new analysis
llvm-svn: 12619
2004-04-02 20:23:17 +00:00
Chris Lattner
eed034bcd3 Fix the obvious bug in my previous checkin
llvm-svn: 12618
2004-04-02 18:15:10 +00:00
Chris Lattner
9f0db32625 Implement Transforms/SimplifyCFG/return-merge.ll
This actually causes us to turn code like:

  return C ? A : B;

into a select instruction.

llvm-svn: 12617
2004-04-02 18:13:43 +00:00
Chris Lattner
99c9b9c02f New testcase
llvm-svn: 12616
2004-04-02 18:12:49 +00:00
Alkis Evlogimenos
d64e904e27 Clean up code a bit.
llvm-svn: 12615
2004-04-02 18:11:32 +00:00
Brian Gaeke
2845936a34 Only strip symbols if emitting bytecode to the assembly file.
Move lowerselect pass to come after preselection.  Move machine
code construction and stack slots pass to come right before instruction
selection. This is to help fix perlbmk.

Update comments.

Make the sequence of passes in addPassesToJITCompile look more like
the sequence of passes in addPassesToEmitAssembly, including support
for -print-machineinstrs.

llvm-svn: 12614
2004-04-02 17:52:40 +00:00
Brian Gaeke
cc24411c0a Add support for constant select expressions. Clarify the assertion failure msg.
llvm-svn: 12613
2004-04-02 17:52:29 +00:00
Chris Lattner
3838243d04 Minor speedup
llvm-svn: 12612
2004-04-02 16:28:32 +00:00
Alkis Evlogimenos
fe66caa9a0 Fix type in comments
llvm-svn: 12611
2004-04-02 16:02:50 +00:00
Alkis Evlogimenos
5fc4772d5e Fix type in instruction builder instantiation
llvm-svn: 12610
2004-04-02 15:51:03 +00:00
Chris Lattner
a45a216ff6 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
b753dd1cb4 Make the verifier API more complete and useful
llvm-svn: 12608
2004-04-02 15:44:33 +00:00
Alkis Evlogimenos
d186ed02e4 Add more ADC and SBB variants
llvm-svn: 12607
2004-04-02 07:11:10 +00:00
Chris Lattner
bcf2623cab minor formatting change
llvm-svn: 12606
2004-04-02 06:32:45 +00:00
Chris Lattner
a413b08580 Fix two pretty serious bugs:
1. Each time the loop extractor extracted a loop, we would leak a module.
  2. When we extracted a loop, we didn't add the new function to the list of
     miscompiled functions.  Thus if the bug was in a loop nest and we
     extracted it, we could actually *LOSE THE BUG*, which is very bad.

With these patches, bugpoint has successfully found a bug for me in a function
with several nested loops, and cut it down to just one of them. :) :)

llvm-svn: 12605
2004-04-02 06:32:17 +00:00
Chris Lattner
af67dac7f4 Fix a fairly nasty bug that prevented bugpoint from working quite right when
hacking on programs with two functions that have the same name.

llvm-svn: 12604
2004-04-02 06:30:33 +00:00
Chris Lattner
73c141ac71 If the program returns a non-zero exit value, don't leave files laying
around

llvm-svn: 12603
2004-04-02 05:33:06 +00:00
Chris Lattner
46e18c7f87 Fix wonky header
Address PR305: LLVM tools will happily spew bytecode onto your terminal

llvm-svn: 12602
2004-04-02 05:06:57 +00:00
Chris Lattner
3af1fffd3c Add new function
llvm-svn: 12601
2004-04-02 05:04:12 +00:00
Chris Lattner
454e18317d Add new function, autoconf support required tho
llvm-svn: 12600
2004-04-02 05:04:03 +00:00
Chris Lattner
fd8f46b1cd Bug fixed
llvm-svn: 12598
2004-04-01 20:31:29 +00:00
Chris Lattner
c24019c825 Fix PR310 and TailDup/2004-04-01-DemoteRegToStack.llx
llvm-svn: 12597
2004-04-01 20:28:45 +00:00
Chris Lattner
914a7d0d90 New testcase for PR310
llvm-svn: 12596
2004-04-01 20:28:35 +00:00
Chris Lattner
59fdf74968 Remove some assertions that are now bogus with the last patch I put in
llvm-svn: 12595
2004-04-01 19:21:46 +00:00
Chris Lattner
ff03fe3b13 Bug fixed
llvm-svn: 12593
2004-04-01 19:09:49 +00:00
Chris Lattner
146d0df5e4 Fix PR306: Loop simplify incorrectly updates dominator information
Testcase: LoopSimplify/2004-04-01-IncorrectDomUpdate.ll

llvm-svn: 12592
2004-04-01 19:06:07 +00:00
Chris Lattner
f475a12626 New testcase for PR306
llvm-svn: 12591
2004-04-01 19:05:54 +00:00
Misha Brukman
b78259a57d Fix grammar.
llvm-svn: 12590
2004-04-01 17:15:42 +00:00
Chris Lattner
b28dd11e33 Add support for select constant expressions to the CBE, fixing SIOD
llvm-svn: 12589
2004-04-01 05:28:26 +00:00
Chris Lattner
bc7e35b3b1 Simplify code by using the more powerful BuildMI forms.
Implement a small optimization.  In test/Regression/CodeGen/X86/select.ll,
we now generate this for foldSel3:

foldSel3:
        mov %AL, BYTE PTR [%ESP + 4]
        fld DWORD PTR [%ESP + 8]
        fld DWORD PTR [%ESP + 12]
        mov %EAX, DWORD PTR [%ESP + 16]
        mov %ECX, DWORD PTR [%ESP + 20]
        cmp %EAX, %ECX
        fxch %ST(1)
        fcmovae %ST(0), %ST(1)
***     fstp %ST(1)
        ret

Instead of:

foldSel3:
        mov %AL, BYTE PTR [%ESP + 4]
        fld DWORD PTR [%ESP + 8]
        fld DWORD PTR [%ESP + 12]
        mov %EAX, DWORD PTR [%ESP + 16]
        mov %ECX, DWORD PTR [%ESP + 20]
        cmp %EAX, %ECX
        fxch %ST(1)
        fcmovae %ST(0), %ST(1)
***     fxch %ST(1)
***     fstp %ST(0)
        ret

In practice, this only effects code size: performance should be basically
unaffected.

llvm-svn: 12588
2004-04-01 04:06:09 +00:00
Chris Lattner
3c8561442c Wrap at 80 cols
llvm-svn: 12587
2004-04-01 04:03:27 +00:00
Chris Lattner
fb893edbe3 Allow converting a builder to an iterator
llvm-svn: 12586
2004-04-01 04:03:10 +00:00
Chris Lattner
cfbc023153 Tests for fp cmov's that I forgot to check in earlier
llvm-svn: 12585
2004-04-01 03:47:56 +00:00
Chris Lattner
1a7e43c5cf Clear out all of the changes. Reset version numbers to 1.3
add note about select

llvm-svn: 12584
2004-04-01 00:41:31 +00:00
Brian Gaeke
8f177d9171 Add clear() forwarding method.
llvm-svn: 12580
2004-03-31 22:43:12 +00:00
Chris Lattner
d55509c281 Generate slightly smaller code, "test R, R" instead of "cmp R, 0"
llvm-svn: 12579
2004-03-31 22:22:36 +00:00
Chris Lattner
a4b15f04c6 The X86 backend no longer needs the select lowering pass.
llvm-svn: 12578
2004-03-31 22:03:46 +00:00
Chris Lattner
37a7f09d80 Codegen FP select instructions into X86 conditional moves. Annoyingly enough
the X86 does not support a full set of fp cmove instructions, so we can't always
fold the condition into the select.  :(  Yuck.

llvm-svn: 12577
2004-03-31 22:03:35 +00:00
Chris Lattner
c07c95816a Add support for floating point conditional move instructions
llvm-svn: 12576
2004-03-31 22:02:36 +00:00
Chris Lattner
cbb4ed9ef2 Add support for FP cmoves
llvm-svn: 12575
2004-03-31 22:02:21 +00:00
Chris Lattner
9fe1646804 Add FP conditional move instructions, which annoyingly have special properties
that require the asmwriter to be extended (printing implicit uses before the
explicit operands)

llvm-svn: 12574
2004-03-31 22:02:13 +00:00
Chris Lattner
61fab1409d Add warning
llvm-svn: 12573
2004-03-31 22:00:30 +00:00
Chris Lattner
afbafb55ea MBB::remove should not modify the iterator passed in
llvm-svn: 12572
2004-03-31 21:59:59 +00:00
Chris Lattner
acccf32aa3 MachineBasicBlock::remove should not modify the iterator passed in
llvm-svn: 12571
2004-03-31 21:59:29 +00:00
Chris Lattner
7c92c296ba Improve description, add warning
llvm-svn: 12570
2004-03-31 21:59:07 +00:00
Chris Lattner
49ed8ad580 MachineBasicBlock::remove should not change the iterator passed into it
llvm-svn: 12569
2004-03-31 21:58:50 +00:00
Brian Gaeke
623710bf2f Factor out getStaticStackSize from InsertPrologCode(), so that I can more
easily steal it for a separate use in the reoptimizer.

llvm-svn: 12568
2004-03-31 20:58:37 +00:00
Brian Gaeke
77e78a4531 Use the true, decoded name of the archive member in getObjectType.
In ReadArchiveBuffer, make sure that MemberName is set in the case where
getObjectType would want to return SVR4LongFilename.

llvm-svn: 12567
2004-03-31 19:51:00 +00:00
Chris Lattner
c0ba90e35c Avoid TRUE and FALSE which apparently conflict with some macros on OSX
llvm-svn: 12566
2004-03-31 03:49:47 +00:00
Chris Lattner
709f03e2dd Fix linking of constant expr casts due to type resolution changes. With
this and the other patches 253.perlbmk links again.

llvm-svn: 12565
2004-03-31 02:58:28 +00:00
Chris Lattner
467cb2bc5d Add support for constant expr casts
llvm-svn: 12564
2004-03-31 02:56:11 +00:00
Chris Lattner
974efc72be Add support for reading constantexpr select instructions
llvm-svn: 12563
2004-03-31 02:53:59 +00:00
Chris Lattner
b7897ce431 Fix a latent bug in select constantexpr handling that was broke 253.perlbmk
llvm-svn: 12562
2004-03-30 22:51:03 +00:00
Alkis Evlogimenos
a333b1382f Correctly update LiveVariables when an instruction changes
llvm-svn: 12561
2004-03-30 22:44:39 +00:00
Chris Lattner
32817f5985 Fold comparisons into select instructions, making much better code and
using our broad selection of movcc instructions.  :)

llvm-svn: 12560
2004-03-30 22:39:09 +00:00
Chris Lattner
2dfdad631f Test folding comparisons into select instructions
llvm-svn: 12559
2004-03-30 22:37:04 +00:00
Chris Lattner
f78f843adf New testcase. This now codegens to:
max:
        mov %EAX, DWORD PTR [%ESP + 4]
        mov %ECX, DWORD PTR [%ESP + 8]
        cmp %EAX, %ECX
        cmovle %EAX, %ECX
        ret

Someone should really implement passing arguments through registers for
known-internal functions.  :)

llvm-svn: 12558
2004-03-30 22:36:52 +00:00
Chris Lattner
358c97e7ae Implement spill code folding for all of the conditional move instructions
llvm-svn: 12554
2004-03-30 21:29:47 +00:00
Chris Lattner
53b58cb854 Add direct support for integer select instructions, though we still don't support
folding compares into the select yet.

llvm-svn: 12553
2004-03-30 21:22:00 +00:00
Chris Lattner
b5d47a9420 New testcase for select instructions
llvm-svn: 12552
2004-03-30 21:21:14 +00:00
Chris Lattner
deab5e212d Fix bug: Assembler/2004-03-30-UnclosedFunctionCrash.llx
llvm-svn: 12551
2004-03-30 20:58:25 +00:00
Chris Lattner
090516fe93 New testcase that crashes the assembler
llvm-svn: 12550
2004-03-30 20:58:00 +00:00
Chris Lattner
1563983d81 Fix some serious bugs in the cmov descriptions, which didn't cause a problem because
we never generated them

Make indentation a bit more consistent

llvm-svn: 12549
2004-03-30 20:18:02 +00:00
Brian Gaeke
ef327be6ed Start cleaning up this pass so that I can debug it.
llvm-svn: 12548
2004-03-30 19:53:46 +00:00
Chris Lattner
f17d2d33fb Oops, actually USE the previously computed value
llvm-svn: 12547
2004-03-30 19:45:39 +00:00
Chris Lattner
fdf3202d69 Test general value/value selection which we can do now that we use the
select instruction

llvm-svn: 12546
2004-03-30 19:45:11 +00:00
Chris Lattner
81bdcb90ce Now that all the code generators support the select instruction, and the instcombine
pass can eliminate many nasty cases of them, start generating them in the optimizers

llvm-svn: 12545
2004-03-30 19:44:05 +00:00
Chris Lattner
533bc49775 Implement select.ll:test[3-6]
llvm-svn: 12544
2004-03-30 19:37:13 +00:00
Chris Lattner
b785d280ec Add some testcases for select simplification
llvm-svn: 12543
2004-03-30 19:36:54 +00:00
Chris Lattner
0048e574fb Fix a fairly major performance problem. If a PHI node had a constant as
an incoming value from a block, the selector would evaluate the constant
at the TOP of the block instead of at the end of the block.  This made the
live range for the constant span the entire block, increasing register
pressure needlessly.

llvm-svn: 12542
2004-03-30 19:10:12 +00:00
Chris Lattner
1a0e9ac2f5 Add the select lowering pass to get initial support for select instructions
llvm-svn: 12541
2004-03-30 18:41:59 +00:00
Chris Lattner
059f390257 Add a simple select instruction lowering pass
llvm-svn: 12540
2004-03-30 18:41:10 +00:00
Chris Lattner
55481f78d3 Add some new methods
llvm-svn: 12539
2004-03-30 00:20:08 +00:00
Brian Gaeke
fd02378d3e Don't warn about a null live range if the Value is a ConstantIntegral.
Otherwise, if you're in debugging mode, you get warnings for (apparently)
every immediate constant in the function during reg. allocation.

llvm-svn: 12538
2004-03-29 21:58:41 +00:00
Brian Gaeke
2fe0ac9ade Change how the beginnings and ends of MachineFunctions are printed. Get
rid of the funny cast.

llvm-svn: 12537
2004-03-29 21:58:31 +00:00
Chris Lattner
5152b9ed34 Adjust to new itf
llvm-svn: 12534
2004-03-29 20:42:49 +00:00
Chris Lattner
8582975b62 Relax the interface a bit
llvm-svn: 12533
2004-03-29 20:42:38 +00:00
John Criswell
fa2f3686a3 Merged in RELEASE_12.
llvm-svn: 12532
2004-03-29 20:23:11 +00:00
John Criswell
d2ff5cf7e8 Merged in RELEASE_12.
This fixes the zlib linking problems.

llvm-svn: 12531
2004-03-29 20:22:30 +00:00
Chris Lattner
3cdc27c868 Handle -0.0 correctly
llvm-svn: 12530
2004-03-29 19:51:24 +00:00
Chris Lattner
87d6b404b5 Add a faq entry
llvm-svn: 12529
2004-03-29 19:14:35 +00:00
Chris Lattner
817175f883 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
5f126b74d3 Add another check
llvm-svn: 12525
2004-03-29 00:29:36 +00:00
Chris Lattner
587a9f1416 Fix an assertion
Contributed by Reid Spencer

llvm-svn: 12524
2004-03-29 00:17:20 +00:00
Chris Lattner
dd7ce6c31a Make error message a bit nicer.
Contributed by Reid Spencer

llvm-svn: 12523
2004-03-29 00:16:01 +00:00
Chris Lattner
04d6d9d606 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
3aa7b9d08c Make sure to get the headers from zlib correctly
llvm-svn: 12521
2004-03-26 17:04:53 +00:00
Chris Lattner
56b5051428 X % -1 == X % 1 == 0
llvm-svn: 12520
2004-03-26 16:11:24 +00:00
Chris Lattner
57c67b06e9 Two changes:
#1 is to unconditionally strip constantpointerrefs out of
instruction operands where they are absolutely pointless and inhibit
optimization.  GRRR!

#2 is to implement InstCombine/getelementptr_const.ll

llvm-svn: 12519
2004-03-25 22:59:29 +00:00
Chris Lattner
3932cab427 New testcase
llvm-svn: 12518
2004-03-25 22:59:06 +00:00
Chris Lattner
82d34eb470 Minor efficiency improvement, finegrainify namespacification
llvm-svn: 12517
2004-03-25 22:56:03 +00:00
Chris Lattner
998c0674be Add note about setting up linux systems to directly execute LLVM bytecode files
Fixes PR303

llvm-svn: 12516
2004-03-25 20:38:40 +00:00
Chris Lattner
3922d607a5 Hrm, we were leaking ~1M of garbage that valgrind never told us about because
it was "reachable".  Cute.

llvm-svn: 12515
2004-03-19 23:34:33 +00:00
Chris Lattner
9e0b81c3e0 Add a dose of reality into the release notes
llvm-svn: 12510
2004-03-19 19:22:28 +00:00
Chris Lattner
abb77c9959 Teach the optimizer to delete zero sized alloca's (but not mallocs!)
llvm-svn: 12507
2004-03-19 06:08:10 +00:00
Chris Lattner
597f1da506 New testcase, the optimizer can delete zero sized allocas
llvm-svn: 12506
2004-03-19 06:07:43 +00:00
Chris Lattner
91f297d4fe Perhaps the last bugfix before the release? HOPEFULLY! :)
llvm-svn: 12505
2004-03-19 04:26:04 +00:00
Chris Lattner
ba6641d598 Fix PR299: [Sparc] Code generator asserts on alloc of zero size type
llvm-svn: 12504
2004-03-19 04:21:43 +00:00
Chris Lattner
6ca9b89abb Malloc doesn't kill a load. This patch need not go into 1.2 though.
llvm-svn: 12500
2004-03-18 17:01:26 +00:00
Chris Lattner
0b41ebe65c Fix a minor wording bug in the manual
llvm-svn: 12496
2004-03-18 14:58:55 +00:00
Chris Lattner
211ae0bf05 This is the last remaining bug that I know of in the loop extractor. The loop
extractor has extracted hundreds of loops from the SPEC benchmarks without crashing
and without misoptimizing the programs.

This testcase could be reduced substantially more by hand, but I don't have time
to work on it right now.

llvm-svn: 12495
2004-03-18 06:41:59 +00:00
Chris Lattner
dc47e27188 Fix a really nasty bug that was breaking ijpeg in LLC mode. We were incorrectly
folding load instructions into other instructions across free instruction
boundaries.  Perhaps this will also fix the other strange failures?

llvm-svn: 12494
2004-03-18 06:29:54 +00:00
Chris Lattner
232155dc1b Fix bug: CodeExtractor/2004-03-17-MissedLiveIns.ll
With this fix we now successfully extract all 149 loops from 256.bzip2 without
crashing or miscompiling the program!

llvm-svn: 12493
2004-03-18 05:56:32 +00:00
Chris Lattner
2bcfcc90c8 New testcase, reduced from 256.bzip2
llvm-svn: 12492
2004-03-18 05:55:29 +00:00
Chris Lattner
e83693560a Add statistics to the loop extractor. The loop extractor has successfully
extracted all 63 loops for Olden/bh without crashing and without
miscompiling the program!!!

llvm-svn: 12491
2004-03-18 05:46:10 +00:00
Chris Lattner
5bce0c807d Fix problem with PHI nodes having multiple predecessors from different
exit nodes

llvm-svn: 12490
2004-03-18 05:43:18 +00:00
Chris Lattner
acd75986ee Fix CodeExtractor/2004-03-17-UpdatePHIsOutsideRegion.ll
llvm-svn: 12489
2004-03-18 05:38:31 +00:00
Chris Lattner
4c7fcbf77b New testcase
llvm-svn: 12488
2004-03-18 05:33:39 +00:00
Chris Lattner
320d59f4cd Seriously simplify and correct the PHI node handling code.
llvm-svn: 12487
2004-03-18 05:28:49 +00:00
Chris Lattner
d8017a340d Fix CodeExtractor/2004-03-17-OutputMismatch.ll
llvm-svn: 12486
2004-03-18 04:12:05 +00:00
Chris Lattner
b7b099d569 New testcase that crashes the code extractor
llvm-svn: 12485
2004-03-18 04:10:02 +00:00
Chris Lattner
37de257ef0 Fix several bugs in the extractor:
1. Names were not put on the new arguments created (ok, this just helps sanity :)
2. Fix outgoing pointer values
3. Do not insert stores for values that had not been computed
4. Fix some wierd problems with the outset calculation

This fixes CodeExtractor/2004-03-14-DominanceProblem.ll, making the extractor
work on at least one simple case!

llvm-svn: 12484
2004-03-18 03:49:40 +00:00
Chris Lattner
e9235d2dde The code extractor needs dominator info. Provide it
llvm-svn: 12483
2004-03-18 03:48:06 +00:00
Chris Lattner
835a759686 The code extractor needs dominator information, so we provide it.
llvm-svn: 12482
2004-03-18 03:47:46 +00:00
Chris Lattner
cee3404d0a Prune #includes, moving the module interface to the front. Note that this
exposed the fact that the header was not self-contained.  There is a reason
we do things :)

llvm-svn: 12481
2004-03-18 03:15:29 +00:00
Chris Lattner
5b460d2ad7 Make this header file self-contained
llvm-svn: 12480
2004-03-18 03:14:56 +00:00
Chris Lattner
3022b1bc2c Fix a HORRIBLY NASTY bug that caused siod to stop working last night.
llvm-svn: 12479
2004-03-17 23:22:04 +00:00
Chris Lattner
baf3f62819 Fix a tag-o
llvm-svn: 12477
2004-03-17 21:33:32 +00:00
Chris Lattner
8e8716518e Rewrite the second on AnalysisUsage usage. This documents the new
addRequiredTransitive member that Misha added, and explains the whole
concept a lot better.  Also, the document used incorrect "subsubsection"
tags instead of "doc_subsubsection" which this fixes.

llvm-svn: 12474
2004-03-17 21:09:55 +00:00
Chris Lattner
b38cc9c026 When loop extraction succeeds, make sure to map the function pointers over
to avoid dangling references.

llvm-svn: 12470
2004-03-17 17:42:09 +00:00
Chris Lattner
7e51a502bc Fix an inverted condition that causes us to think that loop extraction
accomplished something when it really did not.  This does not fix the bigger problem tho.

llvm-svn: 12469
2004-03-17 17:37:18 +00:00
Chris Lattner
425726d9c2 Fix an iterator invalidation problem in a "buggy" pass
llvm-svn: 12468
2004-03-17 17:29:08 +00:00
Chris Lattner
2820235689 update release notes for 1.2
llvm-svn: 12467
2004-03-17 03:54:41 +00:00
John Criswell
d064f2124e Modify test to use the %t substition (temporary name). This is available
in the QMTest Testrunner tests.
Please note that putting output files in the Output directory no longer
works, as QMTest does not build Output directories anymore (nor does the
test run in a separate subdirectory, anyway).

llvm-svn: 12466
2004-03-17 02:31:29 +00:00
Chris Lattner
a078f47b39 Fix compilation of mesa, which I broke earlier today
llvm-svn: 12465
2004-03-17 02:02:47 +00:00
Chris Lattner
684fa5ac64 Be more accurate
llvm-svn: 12464
2004-03-17 01:59:27 +00:00
Chris Lattner
10a8d735c8 cleanup comment
llvm-svn: 12463
2004-03-17 01:29:36 +00:00
Alkis Evlogimenos
02a5354d9b Make the set of fixed (preallocated) intervals be a fixed superset of
unhandled + handled. So unhandled is now including all fixed intervals
and fixed intervals never changes when processing a function.

llvm-svn: 12462
2004-03-17 00:48:59 +00:00
Chris Lattner
a3783a577e Fix bug in previous checkin
llvm-svn: 12458
2004-03-16 23:36:49 +00:00
Chris Lattner
95057f6ad1 Okay, so there is no reasonable way for tail duplication to update SSA form,
as it is making effectively arbitrary modifications to the CFG and we don't
have a domset/domfrontier implementations that can handle the dynamic updates.
Instead of having a bunch of code that doesn't actually work in practice,
just demote any potentially tricky values to the stack (causing the problem
to go away entirely).  Later invocations of mem2reg will rebuild SSA for us.

This fixes all of the major performance regressions with tail duplication
from LLVM 1.1.  For example, this loop:

---
int popcount(int x) {
  int result = 0;
  while (x != 0) {
    result = result + (x & 0x1);
    x = x >> 1;
  }
  return result;
}
---
Used to be compiled into:

int %popcount(int %X) {
entry:
	br label %loopentry

loopentry:		; preds = %entry, %no_exit
	%x.0 = phi int [ %X, %entry ], [ %tmp.9, %no_exit ]		; <int> [#uses=3]
	%result.1.0 = phi int [ 0, %entry ], [ %tmp.6, %no_exit ]		; <int> [#uses=2]
	%tmp.1 = seteq int %x.0, 0		; <bool> [#uses=1]
	br bool %tmp.1, label %loopexit, label %no_exit

no_exit:		; preds = %loopentry
	%tmp.4 = and int %x.0, 1		; <int> [#uses=1]
	%tmp.6 = add int %tmp.4, %result.1.0		; <int> [#uses=1]
	%tmp.9 = shr int %x.0, ubyte 1		; <int> [#uses=1]
	br label %loopentry

loopexit:		; preds = %loopentry
	ret int %result.1.0
}

And is now compiled into:

int %popcount(int %X) {
entry:
        br label %no_exit

no_exit:                ; preds = %entry, %no_exit
        %x.0.0 = phi int [ %X, %entry ], [ %tmp.9, %no_exit ]          ; <int> [#uses=2]
        %result.1.0.0 = phi int [ 0, %entry ], [ %tmp.6, %no_exit ]             ; <int> [#uses=1]
        %tmp.4 = and int %x.0.0, 1              ; <int> [#uses=1]
        %tmp.6 = add int %tmp.4, %result.1.0.0          ; <int> [#uses=2]
        %tmp.9 = shr int %x.0.0, ubyte 1                ; <int> [#uses=2]
        %tmp.1 = seteq int %tmp.9, 0            ; <bool> [#uses=1]
        br bool %tmp.1, label %loopexit, label %no_exit

loopexit:               ; preds = %no_exit
        ret int %tmp.6
}

llvm-svn: 12457
2004-03-16 23:29:09 +00:00
Chris Lattner
bb1a2cc7ab This code was both incredibly complex and incredibly broken. Fix it.
llvm-svn: 12456
2004-03-16 23:23:11 +00:00
Chris Lattner
0e64dda7ca Another simple testcase
llvm-svn: 12455
2004-03-16 23:07:52 +00:00
Brian Gaeke
d962dd5528 The .type directive on Solaris uses the # character instead of @.
llvm-svn: 12454
2004-03-16 22:52:04 +00:00
Brian Gaeke
3fb0e203cd Fix bug in zero-extending of shorts.
llvm-svn: 12453
2004-03-16 22:45:42 +00:00
Brian Gaeke
ae22ce5370 Add UMULrr and SMULrr instructions.
llvm-svn: 12452
2004-03-16 22:37:13 +00:00
Brian Gaeke
ae0ca8baa6 Use ! for comment char; it works in both Solaris as and GAS.
llvm-svn: 12451
2004-03-16 22:37:12 +00:00
Brian Gaeke
67fcefbfef Make getClass more robust by adding cLong.
Add handling for Mul instruction.

llvm-svn: 12450
2004-03-16 22:37:11 +00:00
Chris Lattner
64f2517c07 Bug fixed
llvm-svn: 12449
2004-03-16 21:55:23 +00:00
Chris Lattner
bd10066d97 New testcase for PR297
llvm-svn: 12448
2004-03-16 21:52:24 +00:00
Brian Gaeke
33e83b64b4 Add a better head-of-file comment.
llvm-svn: 12447
2004-03-16 21:47:20 +00:00
Chris Lattner
1ab58dd802 Bug not fixed after all
llvm-svn: 12446
2004-03-16 21:39:04 +00:00
Chris Lattner
618c3990c7 Fix test
llvm-svn: 12445
2004-03-16 21:10:15 +00:00
Chris Lattner
a0fb904d18 Fix testcase
llvm-svn: 12444
2004-03-16 20:04:55 +00:00
Chris Lattner
fa48edfb7d Punt if we see gigantic PHI nodes. This improves a huge interpreter loop
testcase from 32.5s in -raise to take .3s

llvm-svn: 12443
2004-03-16 19:52:53 +00:00
Chris Lattner
7a7b114871 Do not try to optimize PHI nodes with incredibly high degree. This reduces SCCP
time from 615s to 1.49s on a large testcase that has a gigantic switch statement
that all of the blocks in the function go to (an intepreter).

llvm-svn: 12442
2004-03-16 19:49:59 +00:00
Chris Lattner
a64923ad26 Do not copy gigantic switch instructions
llvm-svn: 12441
2004-03-16 19:45:22 +00:00
Chris Lattner
0ea6017b87 Fix bug in bug name. It must be the painkillers that I haven't been taking
llvm-svn: 12440
2004-03-16 09:01:10 +00:00
Chris Lattner
d3dc850c6c Implement a new feature in the CFE, moving a GCC extension from the unsupported
to the supported list

llvm-svn: 12439
2004-03-16 08:54:07 +00:00
Chris Lattner
91d855f150 New testcase
llvm-svn: 12437
2004-03-16 08:49:48 +00:00
Chris Lattner
e1f5161c18 boog fixed
llvm-svn: 12436
2004-03-16 08:40:35 +00:00
Chris Lattner
5def7a57c1 Fix PR296: [execution engines] Unhandled cast constant expression
llvm-svn: 12435
2004-03-16 08:38:56 +00:00
Chris Lattner
db5b8f4d6b Fix a regression from this patch:
http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20040308/013095.html

Basically, this patch only updated the immediate dominatees of the header node
to tell them that the preheader also dominated them.  In practice, ALL
dominatees of the header node are also dominated by the preheader.

This fixes: LoopSimplify/2004-03-15-IncorrectDomUpdate.
and PR293

llvm-svn: 12434
2004-03-16 06:00:15 +00:00
Chris Lattner
767858af43 New testcase for PR293
llvm-svn: 12433
2004-03-16 05:44:02 +00:00
Chris Lattner
0128c9a6de Bug fixed
llvm-svn: 12432
2004-03-16 05:28:35 +00:00
Chris Lattner
6f67017bf4 foo Bug 291, bar PR291
llvm-svn: 12431
2004-03-16 05:18:24 +00:00
Chris Lattner
6b736d8b32 foo bug291 bar PR 291
llvm-svn: 12430
2004-03-16 05:17:07 +00:00
Chris Lattner
29db00a4e0 PR291
Bug 291!

llvm-svn: 12429
2004-03-16 05:16:05 +00:00
Chris Lattner
cf2608c0e9 // Testcase from Bug 291
llvm-svn: 12428
2004-03-16 05:14:47 +00:00
Chris Lattner
8ad948ddbd Add some missing functions. Make sure to handle calls together in case the
client has another VN implementation that can VN calls.

llvm-svn: 12427
2004-03-16 03:41:35 +00:00
Chris Lattner
8726ebd326 Fix thinko, and PR292
llvm-svn: 12426
2004-03-16 01:51:54 +00:00
Chris Lattner
e0b49952f6 Fix PR294
llvm-svn: 12425
2004-03-16 01:45:55 +00:00
Alkis Evlogimenos
804dc659b6 Add LAHF instruction
llvm-svn: 12424
2004-03-15 17:20:14 +00:00
Chris Lattner
95ce36da0d Restore old inlining heuristic. As the comment indicates, this is a nasty
horrible hack.

llvm-svn: 12423
2004-03-15 06:38:14 +00:00
Chris Lattner
7f04ebc858 Ok, the assertion was bogus. Calls that do not read/write memory should not
have an alias set, just like adds and subtracts don't.

llvm-svn: 12422
2004-03-15 06:28:07 +00:00
Chris Lattner
f5c8f4cea6 This assertion is bogus now that calls do not necessarily read/write memory
llvm-svn: 12421
2004-03-15 06:24:15 +00:00
Chris Lattner
cd83282df1 Add counters for the number of calls elimianted
llvm-svn: 12420
2004-03-15 05:46:59 +00:00
Chris Lattner
53a3587997 Implement CSE of call instructions in the most trivial case. This implements
GCSE/call_cse.ll

llvm-svn: 12419
2004-03-15 05:44:59 +00:00
Chris Lattner
2c8efdb348 New testcase for CSE of call instructions
llvm-svn: 12418
2004-03-15 05:44:29 +00:00
Chris Lattner
ea42c857d6 Fix a minor bug, implementing GCSE/call_pure_function.ll
Also, add some stuff I missed before.

llvm-svn: 12417
2004-03-15 04:18:28 +00:00
Chris Lattner
ecdbee5542 Make sure that pure calls don't kill loads
llvm-svn: 12416
2004-03-15 04:17:53 +00:00
Chris Lattner
20cda2645e Implement LICM of calls in simple cases. This is sufficient to move around
sin/cos/strlen calls and stuff.  This implements:
  LICM/call_sink_pure_function.ll
  LICM/call_sink_const_function.ll

llvm-svn: 12415
2004-03-15 04:11:30 +00:00
Chris Lattner
fb5d561193 New testcases to test LICM of call instructions
llvm-svn: 12414
2004-03-15 04:10:08 +00:00
Chris Lattner
21c60f1549 Don't be COMPLETELY pessimistic in the face of function calls
llvm-svn: 12413
2004-03-15 04:08:36 +00:00
Chris Lattner
2f87d5872f Tweak argument
llvm-svn: 12412
2004-03-15 04:08:18 +00:00
Chris Lattner
f4c9028b06 Deinline a couple of methods. Improve comment.
llvm-svn: 12411
2004-03-15 04:07:59 +00:00
Chris Lattner
a67dbd02cf Deinline some virtual methods, provide better mod/ref answers through the
use of the boolean queries

llvm-svn: 12410
2004-03-15 04:07:29 +00:00
Chris Lattner
d441444234 Pass through the boolean queries
llvm-svn: 12409
2004-03-15 04:06:46 +00:00
Chris Lattner
d82256a7a1 Teach basicaa about some stdc functions.
llvm-svn: 12408
2004-03-15 03:36:49 +00:00
Chris Lattner
41ab361ae2 Add two new methods which can be used to enable a bunch of transformations
in common cases.

llvm-svn: 12407
2004-03-15 01:58:54 +00:00
Chris Lattner
fb87cdecd8 Mostly cosmetic improvements. Do fix the bug where a global value was considered an input.
llvm-svn: 12406
2004-03-15 01:26:44 +00:00
Chris Lattner
73ab1fa7c8 Assert that input blocks meet the invariants we expect
Simplify the input/output finder.  All elements of a basic block are
instructions.  Any used arguments are also inputs.  An instruction can only
be used by another instruction.

llvm-svn: 12405
2004-03-15 01:18:23 +00:00
Chris Lattner
fec74e7ce2 New testcase that causes the code extractor to generate bogus code.
llvm-svn: 12404
2004-03-15 00:08:49 +00:00
Chris Lattner
2f155d8734 Fix several bugs in the loop extractor. In particular, subloops were never
extracted, and a function that contained a single top-level loop never had
the loop extracted, regardless of how much non-loop code there was.

llvm-svn: 12403
2004-03-15 00:02:02 +00:00
Chris Lattner
5b2072ecd3 No correctness fixes here, just minor qoi fixes:
* Don't insert a branch to the switch instruction after the call, just
  make it a single block.
* Insert the new alloca instructions in the entry block of the original
  function instead of having them execute dynamically
* Don't make the default edge of the switch instruction go back to the switch.
  The loop extractor shouldn't create new loops!
* Give meaningful names to the alloca slots and the reload instructions
* Some minor code simplifications

llvm-svn: 12402
2004-03-14 23:43:24 +00:00
Chris Lattner
b4d8bf365c Simplify code a bit, and fix bug CodeExtractor/2004-03-14-NoSwitchSupport.ll
This also implements a two minor improvements:
  * Don't insert live-out stores IN the region, insert them on the code path
    that exits the region
  * If the region is exited to the same block from multiple paths, share the
    switch statement entry, live-out store code, and the basic block.

llvm-svn: 12401
2004-03-14 23:05:49 +00:00
Chris Lattner
9c431f6c44 Simplify the code a bit by making the collection of basic blocks to extract
a member of the class.  While we're at it, turn the collection into a set
instead of a vector to improve efficiency and make queries simpler.

llvm-svn: 12400
2004-03-14 22:34:55 +00:00
Chris Lattner
99e9b17641 New testcase that crashes the loop extractor
llvm-svn: 12399
2004-03-14 22:16:52 +00:00
Chris Lattner
bcec7875fb After reducing a miscompiled program down to the functions which are being
miscompiled, try to use the loop extractor to reduce the program down to a
loop nest that is being miscompiled.  In practice, the loop extractor appears
to have too many bugs for this to be useful, but hopefully they will be fixed
soon...

llvm-svn: 12398
2004-03-14 22:08:00 +00:00
Chris Lattner
0e6549b8c7 Fix a minor bug in runPassesOn
llvm-svn: 12397
2004-03-14 21:37:41 +00:00
Chris Lattner
37117a0f6a Add a new "AutoDebugCrashes" option
llvm-svn: 12396
2004-03-14 21:21:57 +00:00
Chris Lattner
6ce2d03352 Refactor to use a new method
llvm-svn: 12395
2004-03-14 21:17:22 +00:00
Chris Lattner
1a5c540c27 Add new method
llvm-svn: 12394
2004-03-14 21:17:03 +00:00
Chris Lattner
fd72bed301 Refactor and clean up a bunch more code. No major functionality changes.
* Make several methods of bugdriver global functions (ParseInputFile, PrintFunctionList)
 * Make PrintFunctionList truncate the output after 10 entries, like the crash debugger
   did.  This allows code sharing.
 * Add a couple of methods to BugDriver that allows us to eliminate some friends
 * Improve comments in ExtractFunction.cpp
 * Make classes that used to be friends up bugdriver now live in anon namespaces
 * Rip a bunch of functionality in the miscompilation tester into a new
   TestMergedProgram function for future code sharing.
 * Fix a bug in the miscompilation tester induced in my last checkin

llvm-svn: 12393
2004-03-14 20:50:42 +00:00
Alkis Evlogimenos
4837f6c0d9 Another API change to MRegisterInfo::foldMemoryOperand. Instead of a
MachineBasicBlock::iterator take a MachineInstr*.

llvm-svn: 12392
2004-03-14 20:14:27 +00:00
Chris Lattner
3fe96bc9fd Add a method to extract a loop
llvm-svn: 12391
2004-03-14 20:02:07 +00:00
Chris Lattner
a1672c1bd8 Split into two passes. Now there is the general loop extractor, usable on
the command line, and the single loop extractor, usable by bugpoint

llvm-svn: 12390
2004-03-14 20:01:36 +00:00
Chris Lattner
f624c99379 Rename createLoopExtractorPass to createSingleLoopExtractorPass
Doxygenify

llvm-svn: 12389
2004-03-14 20:00:37 +00:00
Chris Lattner
5a5e414bc0 add a fixme
llvm-svn: 12388
2004-03-14 19:31:00 +00:00
Chris Lattner
567543f09e Refactor all of the "splitting a module into two pieces" code to avoid
code duplication.  Also, don't use ReduceMiscompilingFunctions::TestFuncs
to print out the final message.

llvm-svn: 12387
2004-03-14 19:27:19 +00:00
Alkis Evlogimenos
48da2f8a6d Change MRegisterInfo::foldMemoryOperand to return the folded
instruction to make the API more flexible.

llvm-svn: 12386
2004-03-14 07:19:51 +00:00
Chris Lattner
0137de5ecb Passes don't print stuff!
llvm-svn: 12385
2004-03-14 04:17:53 +00:00
Chris Lattner
b68659552a Do not create empty basic blocks when the lowerswitch pass expects blocks to
be non-empty!  This fixes LowerSwitch/2004-03-13-SwitchIsDefaultCrash.ll

llvm-svn: 12384
2004-03-14 04:14:31 +00:00
Chris Lattner
e7ae4a8cb4 New testcase that crashes the -lowerswitch pass
llvm-svn: 12383
2004-03-14 04:13:57 +00:00
Chris Lattner
4fca71eb44 Minor random cleanups
llvm-svn: 12382
2004-03-14 04:01:47 +00:00
Chris Lattner
6c3e8c78cf FunctionPass's should not define their own 'run' method.
Require 'simplified' loops, not just raw natural loops.  This fixes
CodeExtractor/2004-03-13-LoopExtractorCrash.ll

llvm-svn: 12381
2004-03-14 04:01:06 +00:00
Chris Lattner
d078812f96 If a block is dead, dominators will not be calculated for it. Because of this
loop information won't see it, and we could have unreachable blocks pointing to
the non-header node of blocks in a natural loop.  This isn't tidy, so have the
loopsimplify pass clean it up.

llvm-svn: 12380
2004-03-14 03:59:22 +00:00
Chris Lattner
9ece94b02b 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
3684469326 Verify functions as they are produced if -debug is specified. Reduce
curly braceage

llvm-svn: 12378
2004-03-14 03:17:22 +00:00
Chris Lattner
b870ca7766 verifyFunction has been broken for a long time now. Fix it.
llvm-svn: 12377
2004-03-14 03:16:15 +00:00
Chris Lattner
d828ad5089 New testcase that crashes the loop extractor
llvm-svn: 12376
2004-03-14 03:03:59 +00:00
Chris Lattner
78a996aec4 Move prototype to IPO.h instead of Scalar.h
Make sure that the file interface header (IPO.h) is included first
remove dead #incldue

llvm-svn: 12375
2004-03-14 02:37:16 +00:00
Chris Lattner
6d24a7ce8a Move loop extractor to the IPO header
llvm-svn: 12374
2004-03-14 02:36:34 +00:00
Chris Lattner
692a47aeb9 Indent anon namespace properly, add copyright block
llvm-svn: 12373
2004-03-14 02:34:07 +00:00
Chris Lattner
41ec709e00 Move to the IPO library. Utils shouldn't contain passes.
llvm-svn: 12372
2004-03-14 02:32:27 +00:00
Chris Lattner
96a7fbd503 Remove dead file
llvm-svn: 12371
2004-03-14 02:13:57 +00:00
Chris Lattner
8eebc49884 DemoteRegToStack got moved from DemoteRegToStack.h to Local.h
llvm-svn: 12368
2004-03-14 02:13:38 +00:00
Chris Lattner
3b18771d9f Move DemoteRegToStack prototype out of DemoteRegToStack.h to this file.
llvm-svn: 12367
2004-03-14 02:13:07 +00:00
Chris Lattner
b911de4c39 Document stuff that is known to be broken
llvm-svn: 12366
2004-03-14 02:03:02 +00:00
Chris Lattner
7d2a539735 Add some debugging output
Fix InstCombine/2004-03-13-InstCombineInfLoop.ll which caused an infinite
loop compiling (I think) povray.

llvm-svn: 12365
2004-03-13 23:54:27 +00:00
Chris Lattner
e561cb51de New testcase, distilled from povray I think.
llvm-svn: 12364
2004-03-13 23:53:04 +00:00
Chris Lattner
2dc85b27e4 This change makes two big adjustments.
* Be a lot more accurate about what the effects will be when inlining a call
   to a function when an argument is an alloca.
 * Dramatically reduce the penalty for inlining a call in a large function.
   This heuristic made it almost impossible to inline a function into a large
   function, no matter how small the callee is.

llvm-svn: 12363
2004-03-13 23:15:45 +00:00
Chris Lattner
797cb2f6c1 This little patch speeds up the loop used to update the dominator set analysis.
On the testcase from GCC PR12440, which has a LOT of loops (1392 of which require
preheaders to be inserted), this speeds up the loopsimplify pass from 1.931s to
0.1875s.  The loop in question goes from 1.65s -> 0.0097s, which isn't bad. All of
these times are a debug build.

This adds a dependency on DominatorTree analysis that was not there before, but
we always had dominatortree available anyway, because LICM requires both loop
simplify and DT, so this doesn't add any extra analysis in practice.

llvm-svn: 12362
2004-03-13 22:01:26 +00:00
Chris Lattner
024385ba5f Turn on argument promotion in gccas. This can give us substantially better
code in cases where the file has lots of static functions or anon namespaces.

llvm-svn: 12361
2004-03-13 21:38:35 +00:00
Chris Lattner
84d0f63804 Option no more
llvm-svn: 12360
2004-03-13 19:36:30 +00:00
Chris Lattner
0ee372cfe3 Fix the "infinite looping unless you disable adce" bug
Also remove an option to disable adce :)

llvm-svn: 12359
2004-03-13 19:35:54 +00:00
Chris Lattner
652eb53dad Fix a tiny bug that caused an incorrect assertion failure poolallocating
boxed-sim.

llvm-svn: 12358
2004-03-13 01:14:23 +00:00
Chris Lattner
699aa70f0c It helps if I save the file. :)
llvm-svn: 12357
2004-03-13 00:24:52 +00:00
Chris Lattner
071a5e5649 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
022167f13b Implement sub.ll:test14
llvm-svn: 12355
2004-03-13 00:11:49 +00:00
Chris Lattner
d689a5eb9c Oh right, casts can interfere. Test this too
llvm-svn: 12354
2004-03-13 00:11:38 +00:00
Chris Lattner
92295c5031 Implement InstCombine/sub.ll:test12 & test13
llvm-svn: 12353
2004-03-12 23:53:13 +00:00
Chris Lattner
b4e933ba14 new testcases
llvm-svn: 12352
2004-03-12 23:52:51 +00:00
Chris Lattner
f9e69b4553 Fix a couple of minor problems. Because PHI nodes can use themselves, this
could cause infinite loops.  Also, getUnderlyingObject can return null

llvm-svn: 12351
2004-03-12 23:12:55 +00:00
John Criswell
13875932b2 Performed some updates on the new options to these command line tools.
llvm-svn: 12350
2004-03-12 22:45:35 +00:00
Chris Lattner
a036253872 Implement mod/ref analysis for a trivial case where locals don't escape.
This comes up when you have a local array on the stack and you never pass
the address of elements around.

llvm-svn: 12349
2004-03-12 22:39:00 +00:00
Chris Lattner
1f91c54600 new testcase
llvm-svn: 12348
2004-03-12 22:38:31 +00:00
Brian Gaeke
afb74be0ce Revise comment and error message for the Bug 38 situation. Also, make it
print out the name of the function being used.

llvm-svn: 12347
2004-03-12 21:37:46 +00:00
John Criswell
5d6345a01b Fixed grammar typo.
llvm-svn: 12345
2004-03-12 21:29:42 +00:00
Brian Gaeke
1694dafece Make -print-machineinstrs show us the code both before and after reg. alloc.
llvm-svn: 12344
2004-03-12 21:19:08 +00:00
John Criswell
eb55b52a58 Fixed grammar typo.
llvm-svn: 12343
2004-03-12 21:19:06 +00:00
John Criswell
faba462a9a Added minor information on C++.
llvm-svn: 12341
2004-03-12 20:42:16 +00:00
John Criswell
64f13ab753 Updated to LLVM 1.2.
Added information on getting the LLVM GCC front end from CVS.
Added new configure script options.
Made other minor corrections and modifications.

llvm-svn: 12340
2004-03-12 20:31:37 +00:00
Chris Lattner
6e8d083a8b Fix PR266: Make Module Not Inherit From Annotable
llvm-svn: 12339
2004-03-12 19:51:16 +00:00
John Criswell
d89dbd0236 Point to the new license (includes year 2004).
Changed crtend.o to libcrtend.a.

llvm-svn: 12338
2004-03-12 18:20:15 +00:00
John Criswell
50f289ace1 Added a header indicating that the Linux and MacOS configure procedures are
the same.

Added LLVM copyright and warranty disclaimer information.

llvm-svn: 12337
2004-03-12 18:02:17 +00:00
Alkis Evlogimenos
9884bda541 Add support for a wider range of CMOV instructions.
llvm-svn: 12336
2004-03-12 17:59:56 +00:00
John Criswell
18d7b688cf Updated copyright to year 2004.
llvm-svn: 12335
2004-03-12 17:29:20 +00:00
Misha Brukman
4483c9b864 Simplify code to process CallSites (thanks to Chris).
llvm-svn: 12334
2004-03-12 16:20:49 +00:00
Misha Brukman
8340686112 Test the mod/ref analysis in DSA.
llvm-svn: 12333
2004-03-12 06:17:22 +00:00
Misha Brukman
a447feac33 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
Misha Brukman
bf28cf6b7d Evaluate ModRef information in addition to regular ol' pointer analysis.
llvm-svn: 12331
2004-03-12 06:15:08 +00:00
Misha Brukman
362841dccc Implement getModRefInfo() for DSA to calculate whether a function modifies or
references a pointer.

llvm-svn: 12330
2004-03-12 06:14:22 +00:00
Misha Brukman
386ef6dec8 Add AnalysisUsage::addRequiredTransitive() to keep analysis info alive for
future queries by clients.

llvm-svn: 12329
2004-03-12 06:13:15 +00:00
Chris Lattner
fd747f8db8 test instruction combiner opts for select instruction
llvm-svn: 12328
2004-03-12 06:01:00 +00:00
Chris Lattner
8988f92470 Teach vim about the select instruction. Allow it to forget about the long-dead
not instruction.

llvm-svn: 12327
2004-03-12 05:55:07 +00:00
Chris Lattner
be3c688488 Teach emacs about the select instruction
llvm-svn: 12326
2004-03-12 05:54:48 +00:00
Chris Lattner
75648e7ae4 Add support for checking the select instruction
llvm-svn: 12325
2004-03-12 05:54:31 +00:00
Chris Lattner
8337d4462f Know the opcode name of the select instruction
llvm-svn: 12324
2004-03-12 05:54:20 +00:00
Chris Lattner
6e415c06c2 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
16375e30b0 Add new function
llvm-svn: 12322
2004-03-12 05:53:41 +00:00
Chris Lattner
6ea4b52903 Teach the constant folder how to do select instructions
llvm-svn: 12321
2004-03-12 05:53:32 +00:00
Chris Lattner
52bd5cb967 Print select instructions correctly
llvm-svn: 12320
2004-03-12 05:53:14 +00:00
Chris Lattner
cb015ee6c0 Add constant folding wrapper support for select instructions.
llvm-svn: 12319
2004-03-12 05:53:03 +00:00
Chris Lattner
59db22dcd4 Add sccp support for select instructions
llvm-svn: 12318
2004-03-12 05:52:44 +00:00
Chris Lattner
b909e8b0d4 Add trivial optimizations for select instructions
llvm-svn: 12317
2004-03-12 05:52:32 +00:00
Chris Lattner
65a64e1e7a ADd support for select instructions
llvm-svn: 12316
2004-03-12 05:52:14 +00:00
Chris Lattner
e7c9f6f7ae Write select instructions to bytecode
llvm-svn: 12315
2004-03-12 05:52:01 +00:00
Chris Lattner
92412466b6 Read select instrs from bytecode
llvm-svn: 12314
2004-03-12 05:51:49 +00:00
Chris Lattner
6536f0c35f Allow parsing select instruction and constant expr
llvm-svn: 12313
2004-03-12 05:51:36 +00:00
Chris Lattner
26cca63a7e Add the visitSelectInst visitor method
llvm-svn: 12312
2004-03-12 05:51:22 +00:00
Chris Lattner
5dec674075 Add the SelectInst class
llvm-svn: 12311
2004-03-12 05:51:05 +00:00
Chris Lattner
439b128ce7 Add the Instruction::Select enum
llvm-svn: 12310
2004-03-12 05:50:53 +00:00
Chris Lattner
e75c0c0eac Add support for select constant exprs
llvm-svn: 12309
2004-03-12 05:50:39 +00:00
Chris Lattner
ec98a76eb6 This is no longer an open project
llvm-svn: 12308
2004-03-12 05:50:24 +00:00
Chris Lattner
b53c28d6ca Cleanup the cast section, add the select instruction
llvm-svn: 12307
2004-03-12 05:50:16 +00:00
Chris Lattner
b24b5165dc New testcase
llvm-svn: 12306
2004-03-12 05:50:02 +00:00
Misha Brukman
96d3b0a6de Make code more readable.
llvm-svn: 12305
2004-03-12 00:58:41 +00:00
Misha Brukman
1df51ed4e5 Fix indentation.
llvm-svn: 12298
2004-03-11 23:53:51 +00:00
Misha Brukman
505a0838f6 Move implementations of functions here, which avoids #including <cstdlib> in the
header file and all those who #include it.

llvm-svn: 12297
2004-03-11 23:52:43 +00:00
Misha Brukman
5c24fb6b48 Move function implementations to a .cpp file, avoid #including <cstdlib> here.
llvm-svn: 12296
2004-03-11 23:52:03 +00:00
Misha Brukman
d8abb840f2 Forward-declare templates for fix compilation when Argument.h is included first.
llvm-svn: 12295
2004-03-11 23:42:24 +00:00
Misha Brukman
94eeb90cd4 Doxygenified and cleand up comments.
llvm-svn: 12294
2004-03-11 23:08:20 +00:00
Misha Brukman
fff0ac8c3d Miscellaneous additions are a separate section.
llvm-svn: 12293
2004-03-11 21:26:29 +00:00
Brian Gaeke
24d24e3e5b Make sure libcrtend.a gets installed when you make install-bytecode.
llvm-svn: 12292
2004-03-11 20:55:23 +00:00
Brian Gaeke
14e98b9d96 Get rid of the abort in PhyRegAlloc::finishSavingState().
Make an explicit call to it from runOnFunction() if we know we're supposed to
write into the global. This is lame (esp. the const_cast), but it solves
the problem.

llvm-svn: 12291
2004-03-11 19:46:30 +00:00
Brian Gaeke
c028910d25 Give pass a name
llvm-svn: 12290
2004-03-11 19:23:15 +00:00
Misha Brukman
d313bdfa43 Fix compilation on Sparc: assert(0) => abort()
llvm-svn: 12289
2004-03-11 19:08:24 +00:00
Misha Brukman
aed39f9d1e SparcV8 removed until it grows up becomes a mature backend.
llvm-svn: 12288
2004-03-11 18:16:33 +00:00
Alkis Evlogimenos
4b98c4412f Fix spelling.
llvm-svn: 12287
2004-03-11 10:14:21 +00:00
Brian Gaeke
5935e0a002 In PhyRegAlloc::saveState(), dump Arguments' saved-state, and try to
make the output more compact.

Divorce state-saving from the doFinalization method; for some reason it's not
getting called when I want it to, at Reoptimizer time. Put the guts in
PhyRegAlloc::finishSavingState(). Put an abort() in it so that I can be really
really sure that it's getting called.

Update comments.

llvm-svn: 12286
2004-03-11 06:45:52 +00:00
Brian Gaeke
44a540e869 Remove ghostly directory from the build
llvm-svn: 12285
2004-03-11 04:42:41 +00:00
Alkis Evlogimenos
9d08818de9 Embed a floating frame of the bugzilla query in the page. This way
people looking for open projects cannot miss the link :-)

llvm-svn: 12284
2004-03-11 02:50:35 +00:00
Chris Lattner
d2d7ccdb4b Minor additions and cleanups
llvm-svn: 12279
2004-03-11 00:50:54 +00:00
Brian Gaeke
0e09916d60 Move all the SaveState options and stuff inton one spot at the top of the file.
De-constify SaveStateToModule; we have to set both it and SaveRegAllocState
explicitly in the reoptimizer.
Make SaveRegAllocState an 'external location' option.

llvm-svn: 12278
2004-03-10 22:21:03 +00:00
Brian Gaeke
f819263cc1 Only call verifySavedState if SaveRegAllocState is set AND debugging flag is on.
llvm-svn: 12277
2004-03-10 22:01:59 +00:00
Chris Lattner
d68b5893a6 Bugz fixed
llvm-svn: 12276
2004-03-10 21:43:47 +00:00
Chris Lattner
61f57617d7 Fix PR284: [indvars] Induction variable analysis violates LLVM invariants
llvm-svn: 12275
2004-03-10 21:42:19 +00:00
Chris Lattner
6fdbd60ed6 New testcase for PR284: [indvars] Induction variable analysis violates LLVM invariants
llvm-svn: 12274
2004-03-10 21:41:47 +00:00
Alkis Evlogimenos
1ccca74a65 Add link to bugzilla query of unassigned enhancements. Specific open
projects like 'port glibc to llvm' or 'improve nightly tester', should
have an unassigned enhancement bug opened for them so that they can be
tracked more easily. Open projects should only list generic projects
like 'compile programs with the LLVM compiler' or 'write a new backend
for target'.

llvm-svn: 12273
2004-03-10 19:38:33 +00:00
Misha Brukman
12f1eddc90 We need a logo.
llvm-svn: 12272
2004-03-10 19:22:29 +00:00
Brian Gaeke
53d2513820 Add brainstorm for a random test vector generator
llvm-svn: 12271
2004-03-10 19:15:50 +00:00
Brian Gaeke
73121d9395 Recommend using install-bytecode target
llvm-svn: 12270
2004-03-10 19:08:52 +00:00
Brian Gaeke
1eec234f91 My fix for PR274 broke the build on Darwin/PPC. As I'm fairly certain this
bug only affects Linux systems that use GLIBC, I'm going to put ifdefs around
the array.

llvm-svn: 12269
2004-03-10 17:38:28 +00:00
Brian Gaeke
0f31060c5a Add support for 'install-bytecode' target, used for ONLY installing
bytecode-libs.

llvm-svn: 12268
2004-03-10 17:38:01 +00:00
Brian Gaeke
8f1977ac07 Fix up a seriously outdated comment.
llvm-svn: 12267
2004-03-10 17:37:50 +00:00
Chris Lattner
6f61db7f8a New testcase for PR275
llvm-svn: 12266
2004-03-10 03:07:45 +00:00
Chris Lattner
30f984671a New testcase for PR276: llvm-g++ does not mangle method names that match stdlib function names
llvm-svn: 12265
2004-03-09 22:51:03 +00:00
Chris Lattner
b26b6fe9a7 implement new method
llvm-svn: 12264
2004-03-09 19:37:06 +00:00
Chris Lattner
f53977cd42 new method
llvm-svn: 12263
2004-03-09 19:36:59 +00:00
Alkis Evlogimenos
6623cd78f9 Spill explicit physical register defs as well.
llvm-svn: 12260
2004-03-09 08:35:13 +00:00
Brian Gaeke
0766126e2e Now that I read it again, this part in particular strikes me as kind of
pushy and contentious...

llvm-svn: 12259
2004-03-09 07:20:26 +00:00
Alkis Evlogimenos
f234284986 Check if printing of implicit uses is required for all types of shift
instructions.

llvm-svn: 12258
2004-03-09 06:10:15 +00:00
Brian Gaeke
75a2efdd6c b00g fixed
llvm-svn: 12257
2004-03-09 05:43:59 +00:00
Brian Gaeke
96e450b3b2 Address PR274 - '[JIT] Programs cannot resolve the fstat function'
by trying to get the compiler to generate an undefined reference for it
and related functions which live in libc_nonshared.a on Linux.

Linkers... sigh.

llvm-svn: 12256
2004-03-09 05:22:10 +00:00
Brian Gaeke
3a27bd889b Hmm, who left this sitting around in my tree
llvm-svn: 12255
2004-03-09 04:49:13 +00:00
Alkis Evlogimenos
8a3f2f3600 Differentiate between extended precision floats (80-bit) and double precision floats (64-bit)
llvm-svn: 12254
2004-03-09 03:37:54 +00:00
Alkis Evlogimenos
8ac958bf43 Use newly added API to emit bytes for instructions that gas misassembles
llvm-svn: 12253
2004-03-09 03:35:34 +00:00
Alkis Evlogimenos
508b459d12 Add emitInstruction() API so that we can get the bytes of a simple instruction
llvm-svn: 12252
2004-03-09 03:34:53 +00:00
Alkis Evlogimenos
a7c2da3af5 Constify things a bit
llvm-svn: 12251
2004-03-09 03:30:12 +00:00
Chris Lattner
c567f402e5 Bug fixed
llvm-svn: 12250
2004-03-09 00:59:15 +00:00
Chris Lattner
349910567e Checkin testcase for PR261
llvm-svn: 12249
2004-03-09 00:55:58 +00:00
Chris Lattner
0536f8df6e John fixed this bug
llvm-svn: 12248
2004-03-09 00:40:49 +00:00
Brian Gaeke
d734587436 Change PhyRegAlloc::saveStateForValue()'s arg type to deal with
AllocInfo.Instruction becoming an int.

llvm-svn: 12247
2004-03-08 23:22:03 +00:00
Brian Gaeke
f0a73a3f42 Save argument list alloc state by recording it as the operands of Instruction
#-1. Other minor changes to deal with AllocInfo.Instruction becoming an int.

llvm-svn: 12246
2004-03-08 23:22:02 +00:00
Brian Gaeke
0be7ea7289 Make AllocInfo's Instruction an int, so that we can overload it for arguments.
(Instruction #-1's operands = argument list).

llvm-svn: 12245
2004-03-08 23:22:01 +00:00
Misha Brukman
b22926616e Fix some spelling and grammar.
llvm-svn: 12244
2004-03-08 23:06:46 +00:00
Chris Lattner
d6e1b28837 Update the profiling section
llvm-svn: 12243
2004-03-08 22:29:35 +00:00
Chris Lattner
9bde783c5c Switch to using edge profiling information as the basic source of profile info
from using basic block counts.

llvm-svn: 12242
2004-03-08 22:04:08 +00:00
Chris Lattner
d6eda1a9ef Switch over to using edge profile information as the basic profiling representation,
from basic block counts.

llvm-svn: 12241
2004-03-08 22:03:45 +00:00
Chris Lattner
bd481d588a Refactor implementations
llvm-svn: 12240
2004-03-08 21:30:35 +00:00
Chris Lattner
755ffeb292 We don't want to make this a pure interface, as it makes all implementors
bear the burden of implementing what will be all exactly the same methods.
They just want to provide the information in differing ways.

llvm-svn: 12239
2004-03-08 21:30:18 +00:00
Chris Lattner
b08e4653cb Rearrange some methods, implement the dominates method
llvm-svn: 12237
2004-03-08 21:07:12 +00:00
Chris Lattner
63b49d0574 Import the trace class from the reoptimizer
llvm-svn: 12236
2004-03-08 20:57:27 +00:00
Chris Lattner
9c222ed4b5 Default to using edge counts
llvm-svn: 12234
2004-03-08 20:04:46 +00:00
Chris Lattner
c71ea6e3d4 Annotate functions with edge counts as well, if they are available.
llvm-svn: 12233
2004-03-08 20:04:32 +00:00
Chris Lattner
5302943ff7 If we have edge counts, we can produce block counts. I've verified that
using an edge profile to produce block counts gives the exact same numbers
as using a block count directly.

llvm-svn: 12232
2004-03-08 20:03:52 +00:00
Chris Lattner
96cdd27b65 Adjust to new interface
llvm-svn: 12231
2004-03-08 18:51:45 +00:00
Chris Lattner
03745f3e80 Add the ability to put an annotation at the end of a basic block as well.
llvm-svn: 12230
2004-03-08 18:51:05 +00:00
Chris Lattner
8b8a0641a1 Add initial support for reading edge counts. This will be improved to enable
translation of edge counts into block/function counts when possible.

llvm-svn: 12229
2004-03-08 18:20:18 +00:00
Chris Lattner
178608ee2b Add support for representing edge counts
llvm-svn: 12228
2004-03-08 18:19:37 +00:00
Chris Lattner
29ba1be907 Add edge profiling support to the runtime library
llvm-svn: 12227
2004-03-08 18:04:31 +00:00
Misha Brukman
3702b9d79b Fix link to license: point to current version in CVS.
llvm-svn: 12226
2004-03-08 17:59:31 +00:00
Chris Lattner
721264aecc Initial support for edge profiling
llvm-svn: 12225
2004-03-08 17:54:34 +00:00
Chris Lattner
dae48f93b0 Split utility functions out of BlockProfiling.cpp
llvm-svn: 12224
2004-03-08 17:06:13 +00:00
Chris Lattner
b16526108c Remove the comment "Constants must always have an initial value.", which
is incorrect.  Fix some formatting nastiness.

llvm-svn: 12223
2004-03-08 16:49:10 +00:00
Chris Lattner
d91e676700 finegrainify namespacification
llvm-svn: 12221
2004-03-08 16:45:53 +00:00
Chris Lattner
e2b27080e7 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
ea0789ca7b Implement test/Regression/Assembler/2004-03-07-FunctionAddressAlignment.llx
llvm-svn: 12218
2004-03-08 06:17:35 +00:00
Chris Lattner
be3a169d18 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
c3ecaae16c 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
8301a593a9 Remove Module::mutateConstantPointerRef, which is now thankfully dead!
llvm-svn: 12215
2004-03-08 06:15:33 +00:00
Chris Lattner
9f4918ab93 Eliminate nightmarish API
llvm-svn: 12214
2004-03-08 06:11:10 +00:00
Chris Lattner
16e27f3af3 remove *THANKFULLY* dead method
llvm-svn: 12213
2004-03-08 06:10:32 +00:00
Chris Lattner
75998c0885 Eliminate a REALLY HORRIBLE API: mutateReferences, which is gross gross gross.
llvm-svn: 12212
2004-03-08 06:09:57 +00:00
Chris Lattner
7e201ecc31 New testcase for PR269
llvm-svn: 12211
2004-03-08 05:35:12 +00:00
Chris Lattner
f0cbbabea7 Bug fixed
llvm-svn: 12210
2004-03-08 04:55:45 +00:00
Chris Lattner
451e10e46a Testcase that crashes the C front-end.
llvm-svn: 12209
2004-03-08 04:41:32 +00:00
Chris Lattner
84c697d520 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
98502aae76 Avoid allocating special registers a bit more robustly
llvm-svn: 12207
2004-03-08 03:48:07 +00:00
Chris Lattner
0653e1167d New code-quality testcase.
llvm-svn: 12205
2004-03-08 02:12:36 +00:00
Chris Lattner
653e662a93 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
1dd6afe6a2 Rearrange and refactor some code. No functionality changes.
llvm-svn: 12203
2004-03-08 01:18:36 +00:00
Chris Lattner
fe6f2e3e80 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
1f7f22c42c New testcase
llvm-svn: 12201
2004-03-08 00:58:19 +00:00
Chris Lattner
cc544e57f3 Implement: ArgumentPromotion/chained.ll
llvm-svn: 12200
2004-03-07 22:52:53 +00:00
Chris Lattner
332a8bdf31 New testcase for missed case
llvm-svn: 12199
2004-03-07 22:52:41 +00:00
Chris Lattner
64b8d697ad Fix another minor bug, exposed by perlbmk
llvm-svn: 12198
2004-03-07 22:43:27 +00:00
Chris Lattner
538fee7aa2 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
ac2e2d3bdd 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
6770842b67 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
1f607f2f2e Add prototype
llvm-svn: 12194
2004-03-07 21:30:08 +00:00
Chris Lattner
483ae01c9c 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
f2b8692b73 New testcase
llvm-svn: 12192
2004-03-07 21:28:54 +00:00
Alkis Evlogimenos
d6f62ba55b Add memory operand version of conditional move.
llvm-svn: 12190
2004-03-07 03:19:11 +00:00
Alkis Evlogimenos
cb98644e9b As I wrote in the docs, simple is the default spiller :-)
llvm-svn: 12189
2004-03-06 23:08:44 +00:00
Alkis Evlogimenos
79850121ad Add simple spiller.
llvm-svn: 12188
2004-03-06 22:38:29 +00:00
Alkis Evlogimenos
36fd868f08 The default register allocator is local not simple.
llvm-svn: 12187
2004-03-06 22:27:41 +00:00
Brian Gaeke
4e0669cef0 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
c65b97d4f6 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
84b4c9208d 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
901cfa9e2e Make prolog align stack properly. Make epilog not touch any registers.
llvm-svn: 12183
2004-03-06 05:31:21 +00:00
Brian Gaeke
5a1c7a8be3 Emit register names in lowercase, as required by the assembler.
llvm-svn: 12182
2004-03-06 05:30:21 +00:00
Brian Gaeke
639b04aca3 Teach getRegClassForType where to find FP registers
llvm-svn: 12180
2004-03-06 03:54:13 +00:00
Chris Lattner
2cb2905c96 Fix a minor bug
llvm-svn: 12169
2004-03-05 22:04:07 +00:00
Misha Brukman
d2e88a21b7 Unbreak the build on Sparc.
llvm-svn: 12161
2004-03-05 20:04:40 +00:00
Brian Gaeke
0c76d1146f 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
6c271edcd7 Fix a bug in a previous checkin that broke 175.vpr
llvm-svn: 12128
2004-03-04 21:36:57 +00:00
Chris Lattner
bc3381f267 Add support for strto* and v*printf
llvm-svn: 12127
2004-03-04 21:03:54 +00:00
Chris Lattner
0ed8162c1a Add non-crappy support for varargs
llvm-svn: 12126
2004-03-04 20:33:47 +00:00
Chris Lattner
3562ea84ab 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
9c609df3c9 Support -print-machineinstrs
llvm-svn: 12124
2004-03-04 19:22:16 +00:00
Chris Lattner
30f94a72f4 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
8351d8c1a8 make -print-machineinstrs work for both SparcV9 and X86
llvm-svn: 12122
2004-03-04 19:16:23 +00:00
Alkis Evlogimenos
b9501c1f8c Add assertion for scale verification.
llvm-svn: 12120
2004-03-04 18:05:02 +00:00
Alkis Evlogimenos
8a4159708b Fix bug introduced by yesterday's changes.
llvm-svn: 12119
2004-03-04 18:02:07 +00:00
Alkis Evlogimenos
33cb4260a5 Hide variable from other functions.
llvm-svn: 12118
2004-03-04 17:50:44 +00:00
Chris Lattner
536b131c9c Fix BU datastructures with povray!
The problem was that we were merging a field of a node with a value that was
deleted.  Thanks to bugpoint for reducing povray to a nice small 3 function
example.  :)

llvm-svn: 12116
2004-03-04 17:06:53 +00:00
Chris Lattner
8db52980b7 Minor changes, remove some debugging code that got checked in somehow.
Make sure to scope the NodeMap passed into cloneInto so that it doesn't point
to nodes that are deleted.  Add some FIXME's for future performance enhancements.

llvm-svn: 12115
2004-03-04 17:05:28 +00:00
Brian Gaeke
82ec4a561b Asm printer support, based on x86 - only prints mnemonics for now
llvm-svn: 12113
2004-03-04 06:00:41 +00:00
Brian Gaeke
8ace44fe0d Double-FP pseudo-registers.
llvm-svn: 12112
2004-03-04 05:15:03 +00:00
Brian Gaeke
92c95f812d Subtract instructions; minor cleanups
llvm-svn: 12111
2004-03-04 04:37:45 +00:00
Brian Gaeke
d2e89190d9 Floating point regs
llvm-svn: 12110
2004-03-04 04:37:22 +00:00
Chris Lattner
f48eb7519a Only clone nodes that are needed in the caller, don't clone ALL aux calls. This improves
povray from having ~600K nodes and 300K call nodes to 65K nodes and 25K call nodes.

llvm-svn: 12109
2004-03-04 03:57:53 +00:00
Brian Gaeke
956fb06a4a Simple copyConstantToReg support, SETHIi and ORri
llvm-svn: 12107
2004-03-04 00:56:25 +00:00
Brian Gaeke
165ff998e0 Support add - note, still missing important copyConstantToRegister stuff
llvm-svn: 12106
2004-03-03 23:03:14 +00:00
Chris Lattner
559487301f Fix a minor bug handling incomplete programs
llvm-svn: 12105
2004-03-03 23:00:19 +00:00
Chris Lattner
d9da2678fc Fix a DSA bug that caused DSA to generate incredibly huge graphs and take forever to
do it on povray.  The problem is that we were not copying globals from callees to
callers unless the existed in both graphs.  We should have copied them in the case
where the global pointed to a node that was copied as well.

llvm-svn: 12104
2004-03-03 22:01:09 +00:00
Chris Lattner
91be5332b2 Rename method, add new method
llvm-svn: 12103
2004-03-03 22:00:20 +00:00
Chris Lattner
5fc189157c Deinline methods, add fast exit
llvm-svn: 12102
2004-03-03 20:55:27 +00:00
Chris Lattner
06bd20676d De-inline methods
llvm-svn: 12101
2004-03-03 20:55:15 +00:00
Brian Gaeke
015972103d Make MachineOperand's value named 'contents'. Make really, really sure
it is always completely initialized and copied.
Also, fix up many comments and asserts.

llvm-svn: 12100
2004-03-03 19:07:27 +00:00
Brian Gaeke
3001c6e264 Squash /usr/dcs path; use a 'require <version>' instead.
llvm-svn: 12099
2004-03-03 17:38:51 +00:00
Brian Gaeke
c0c260dd37 Add my regression finding by binary searching cvs script.
llvm-svn: 12095
2004-03-03 08:14:25 +00:00
Chris Lattner
140b2cbd28 Fix a node mapping problem that was causing the pool allocator to locally allocate
nodes that were globally live, thus breaking programs.

llvm-svn: 12094
2004-03-03 05:34:31 +00:00
Chris Lattner
93e9878c2c 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
Chris Lattner
87ed2a4096 Add a new constructor
llvm-svn: 12087
2004-03-03 02:12:47 +00:00
Chris Lattner
7abcc387de Don't emit things like malloc(16*1). Allocation instructions are fixed arity now.
llvm-svn: 12086
2004-03-03 01:40:53 +00:00
Chris Lattner
2e92b469c8 FINALLY be able to get symbolic type names in the globals graph!
llvm-svn: 12082
2004-03-02 21:39:43 +00:00
Chris Lattner
9e100fc3f7 Really, only if reopen
llvm-svn: 12080
2004-03-02 20:46:18 +00:00
John Criswell
626f47f946 Added EH support.
llvm-svn: 12075
2004-03-02 15:54:25 +00:00
Alkis Evlogimenos
cb8937197e Make <di> into <dt> (definition list term).
llvm-svn: 12072
2004-03-02 03:36:10 +00:00
Misha Brukman
c566ca36a1 Doxygenify comments.
llvm-svn: 12071
2004-03-02 00:22:19 +00:00
Misha Brukman
f44acae31e Implement ExtractCodeRegion()
llvm-svn: 12070
2004-03-02 00:20:57 +00:00
Misha Brukman
1998b73492 Add prototype for ExtractCodeRegion()
llvm-svn: 12069
2004-03-02 00:20:32 +00:00
Misha Brukman
f272f9b3d5 Make a note that this is usually used via bugpoint.
llvm-svn: 12068
2004-03-02 00:19:09 +00:00
Misha Brukman
a6025e6480 Doxygenify some comments.
llvm-svn: 12064
2004-03-01 23:53:11 +00:00
Alkis Evlogimenos
45da18d2a4 Fix <p> missing <p> tag
llvm-svn: 12063
2004-03-01 23:25:38 +00:00
Alkis Evlogimenos
31953c7a10 Add a spiller option to llc. A simple spiller will come soon. When we get CFG in the machine code represenation a global spiller will also be possible. Also document the linear scan register allocator but mark it as experimental for now.
llvm-svn: 12062
2004-03-01 23:18:15 +00:00
Alkis Evlogimenos
b76d234ee9 Add the long awaited memory operand folding support for linear scan
llvm-svn: 12058
2004-03-01 20:05:10 +00:00
Misha Brukman
b22d09cc5e * 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
d86982547f Add new method
llvm-svn: 12056
2004-03-01 19:36:50 +00:00
Chris Lattner
c8d23b19fb Correctly add an array marker on a node when appropriate!
llvm-svn: 12055
2004-03-01 19:02:54 +00:00
Misha Brukman
88cc178e3b Fix grammar and doxygenify comments.
llvm-svn: 12054
2004-03-01 18:31:19 +00:00
Misha Brukman
5af2be7d09 * Add implementation of ExtractBasicBlock()
* Add comments to ExtractLoop()

llvm-svn: 12053
2004-03-01 18:28:34 +00:00
Misha Brukman
f68f121dd3 Add ability to extract a single basic block into a new function.
llvm-svn: 12052
2004-03-01 18:27:13 +00:00
Misha Brukman
773d6f66db * HTML 4.01 Strict compliance
* Removed unnecessary tabs in the entire file

llvm-svn: 12051
2004-03-01 18:21:04 +00:00
Misha Brukman
c501f5530b HTML 4.01 Strict compliance.
llvm-svn: 12050
2004-03-01 17:47:27 +00:00
Chris Lattner
f96405a1ce Add this back, as its absence introduces assertions, and it seems to work now
that Instructions are annotable again

llvm-svn: 12045
2004-03-01 15:28:27 +00:00
Tanya Lattner
e63e8ea884 fix bug in previous checkin
llvm-svn: 12044
2004-03-01 15:05:17 +00:00
Brian Gaeke
427cec1395 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
Tanya Lattner
48a503be04 Adding new Modulo Scheduling graph files.
llvm-svn: 12031
2004-03-01 02:50:57 +00:00
Tanya Lattner
dd10fbe775 Removing old graph files with new graph files that I wrote. Updated ModuloScheduling pass, but still in progress.
llvm-svn: 12030
2004-03-01 02:50:01 +00:00
Chris Lattner
6f6e0f29ad Expand on my note-to-self
llvm-svn: 12029
2004-03-01 02:44:44 +00:00
Chris Lattner
1f4642c47c Handle passing constant integers to functions much more efficiently. Instead
of generating this code:

        mov %EAX, 4
        mov DWORD PTR [%ESP], %EAX
        mov %AX, 123
        movsx %EAX, %AX
        mov DWORD PTR [%ESP + 4], %EAX
        call Y

we now generate:
        mov DWORD PTR [%ESP], 4
        mov DWORD PTR [%ESP + 4], 123
        call Y

Which hurts the eyes less.  :)

Considering that register pressure around call sites is already high (with all
of the callee clobber registers n stuff), this may help a lot.

llvm-svn: 12028
2004-03-01 02:42:43 +00:00
Brian Gaeke
b19dcc6651 Don't look in the .libs directories that libtool makes
llvm-svn: 12027
2004-03-01 02:41:22 +00:00
Chris Lattner
5c7d3cda78 Fix a minor code-quality issue. When passing 8 and 16-bit integer constants
to function calls, we would emit dead code, like this:

int Y(int, short, double);
int X() {
  Y(4, 123, 4);
}

--- Old
X:
        sub %ESP, 20
        mov %EAX, 4
        mov DWORD PTR [%ESP], %EAX
***     mov %AX, 123
        mov %AX, 123
        movsx %EAX, %AX
        mov DWORD PTR [%ESP + 4], %EAX
        fld QWORD PTR [.CPIX_0]
        fstp QWORD PTR [%ESP + 8]
        call Y
        mov %EAX, 0
        # IMPLICIT_USE %EAX %ESP
        add %ESP, 20
        ret

Now we emit:
X:
        sub %ESP, 20
        mov %EAX, 4
        mov DWORD PTR [%ESP], %EAX
        mov %AX, 123
        movsx %EAX, %AX
        mov DWORD PTR [%ESP + 4], %EAX
        fld QWORD PTR [.CPIX_0]
        fstp QWORD PTR [%ESP + 8]
        call Y
        mov %EAX, 0
        # IMPLICIT_USE %EAX %ESP
        add %ESP, 20
        ret

Next up, eliminate the mov AX and movsx entirely!

llvm-svn: 12026
2004-03-01 02:34:08 +00:00
Chris Lattner
482cf01a1e Fix the "partial pool allocator" on em3d and others. The problem is that
DSNodes, unlike other GraphTraits nodes, can have null outgoing edges, and
df_iterator doesn't take this into consideration.  As a workaround, the
successor iterator now handles null nodes and 'indicates' that null has
no successors.

llvm-svn: 12025
2004-03-01 01:42:26 +00:00
Chris Lattner
b4c203ce67 Make Module annotable. Reid has a bunch of code that depends on this, and
we really don't win that much by eliminating this (not many Modules are
allocated), so it's not worth it.  When we can, we should revisit this in
the future.

llvm-svn: 12023
2004-03-01 01:25:37 +00:00
Chris Lattner
5cf39339d1 Disable tail duplication in a case that breaks on Olden/tsp
llvm-svn: 12021
2004-03-01 01:12:13 +00:00
Misha Brukman
2a4c5b050e Doxygenify comments.
llvm-svn: 12015
2004-02-29 23:55:11 +00:00
Misha Brukman
c91e1ff50d * Remove function to find "main" in a Module, there's a method for that
* Removing extraneous empty space and empty comment lines

llvm-svn: 12014
2004-02-29 23:09:10 +00:00
Chris Lattner
43640d7138 Fix -debug-pass=Executions, which relied on Function, Module, and BasicBlock
being annotable

llvm-svn: 12013
2004-02-29 22:37:04 +00:00
Chris Lattner
2de229f31b Fix bug: test/Regression/Transforms/LowerInvoke/2004-02-29-PHICrash.llx
... which tickled the lowerinvoke pass because it used the BCE routines.

llvm-svn: 12012
2004-02-29 22:24:41 +00:00
Chris Lattner
9c9a4c4abd Testcase for a bug that caused a whole bunch of testcases to die in the nightly
tester last night.

llvm-svn: 12011
2004-02-29 22:15:51 +00:00
Chris Lattner
604cc83933 Add an assert
llvm-svn: 12010
2004-02-29 22:01:51 +00:00
Chris Lattner
e0c3c18802 Add back #include I messed up
llvm-svn: 12009
2004-02-29 21:40:53 +00:00
Chris Lattner
90ecb92838 Urg, forgot to check this in.
llvm-svn: 12007
2004-02-29 21:03:08 +00:00
Chris Lattner
f2bb31c5fd Module does not need to be annotatable aka annotable
llvm-svn: 12005
2004-02-29 19:27:55 +00:00
Chris Lattner
fcb4f9d00b Remove public header. It's been moved to lib/Target/SparcV9
llvm-svn: 12004
2004-02-29 19:13:20 +00:00
Chris Lattner
3859031b9b Move the private MachineInstrAnnot.h into a private directory.
llvm-svn: 12003
2004-02-29 19:12:51 +00:00
Chris Lattner
d5a49c477d Remove use of an ugly header
llvm-svn: 12002
2004-02-29 19:04:31 +00:00
Chris Lattner
6194ee84ba Move methods out of .h file
llvm-svn: 12001
2004-02-29 19:02:39 +00:00
Chris Lattner
23840c7db5 Do not use explicit casts that hide the dependence on Instruction being
annotable

llvm-svn: 12000
2004-02-29 19:02:26 +00:00
Chris Lattner
79b8d467da Ugh, the old sparc backend attaches MachineCodeForInstruction annotations on
LLVM instructions.  Because it contains an explicit cast, we didn't catch it.
I guess instruction's will be annotable for the duration of the sparcv9's
existence.

llvm-svn: 11999
2004-02-29 18:54:23 +00:00
Alkis Evlogimenos
9a4653edfa Add instruction name description.
llvm-svn: 11998
2004-02-29 18:44:03 +00:00
Alkis Evlogimenos
0824ffc697 Use correct template for SHLD and SHRD instructions so that the memory
operand size is correctly specified.

llvm-svn: 11997
2004-02-29 09:19:40 +00:00
Alkis Evlogimenos
c7fd0770a0 Improve allocation order:
1) For 8-bit registers try to use first the ones that are parts of the
   same register (AL then AH). This way we only alias 2 16/32-bit
   registers after allocating 4 8-bit variables.

2) Move EBX as the last register to allocate. This will cause less
   spills to happen since we will have 8-bit registers available up to
   register excaustion (assuming we use the allocation order). It
   would be nice if we could push all of the 8-bit aliased registers
   towards the end but we much prefer to keep callee saved register to
   the end to avoid saving them on entry and exit of the function.

For example this gives a slight reduction of spills with linear scan
on 164.gzip.

Before:

11221 asm-printer           - Number of machine instrs printed
  975 spiller               - Number of loads added
  675 spiller               - Number of stores added
  398 spiller               - Number of register spills

After:

11182 asm-printer           - Number of machine instrs printed
  952 spiller               - Number of loads added
  652 spiller               - Number of stores added
  386 spiller               - Number of register spills

llvm-svn: 11996
2004-02-29 09:17:01 +00:00
Alkis Evlogimenos
ea81b79a97 A big X86 instruction rename. The instructions are renamed to make
their names more decriptive. A name consists of the base name, a
default operand size followed by a character per operand with an
optional special size. For example:

ADD8rr -> add, 8-bit register, 8-bit register

IMUL16rmi -> imul, 16-bit register, 16-bit memory, 16-bit immediate

IMUL16rmi8 -> imul, 16-bit register, 16-bit memory, 8-bit immediate

MOVSX32rm16 -> movsx, 32-bit register, 16-bit memory

llvm-svn: 11995
2004-02-29 08:50:03 +00:00
Brian Gaeke
2f80d586b8 Remove dead member variables of SparcV9SchedInfo and TargetSchedInfo
llvm-svn: 11994
2004-02-29 08:40:03 +00:00
Chris Lattner
1e36fb030c Eliminate the X86-specific BMI functions, using BuildMI instead.
Replace uses of addZImm with addImm.

llvm-svn: 11992
2004-02-29 07:22:16 +00:00
Chris Lattner
9a97573267 Fix a miscompilation of 197.parser that occurs when you have single basic
block loops.

llvm-svn: 11990
2004-02-29 07:10:16 +00:00
Chris Lattner
bf2963ef91 Fix PR255: [tailduplication] Single basic block loops are very rare
Note that this is a band-aid put over a band-aid.  This just undisables
tail duplication in on very specific case that it seems to work in.

llvm-svn: 11989
2004-02-29 06:41:20 +00:00
Brian Gaeke
d470a0f042 Update comment at head of file. Also fix C 'typedef struct' nonsense I
inadvertently left in here.

llvm-svn: 11988
2004-02-29 06:33:28 +00:00
Chris Lattner
ed01da8f0b Adjust to change in TII ctor arguments
llvm-svn: 11987
2004-02-29 06:31:44 +00:00
Chris Lattner
f20abac9bc Eliminate the distinction between "real" and "unreal" instructions
llvm-svn: 11986
2004-02-29 06:31:16 +00:00
Brian Gaeke
e65125dcdf Add more architectures, and ELF64 stuff.
llvm-svn: 11985
2004-02-29 06:30:25 +00:00
Chris Lattner
ca89812db7 These two virtual methods are never called.
llvm-svn: 11984
2004-02-29 05:59:33 +00:00
Chris Lattner
71a899dea6 Remove a TON of flags that noone cares about
llvm-svn: 11983
2004-02-29 05:58:30 +00:00
Chris Lattner
59d9e9126d Noone calls these virtual methods
llvm-svn: 11982
2004-02-29 05:58:16 +00:00
Chris Lattner
79d9a93a71 This is the only file in the system that uses this enum. eliminate it.
llvm-svn: 11981
2004-02-29 05:57:59 +00:00
Chris Lattner
f611ca055c Scrap a huge layer of cruft out of this interface.
llvm-svn: 11980
2004-02-29 05:57:21 +00:00
Chris Lattner
e5f08917ae Implement initial prolog/epilog code insertion methods.
llvm-svn: 11979
2004-02-29 05:18:30 +00:00
Chris Lattner
5e7b3180e5 Remove unneeded #include
llvm-svn: 11978
2004-02-29 05:15:56 +00:00
Chris Lattner
44b1b22a2d int64_t -> int
llvm-svn: 11977
2004-02-29 05:07:02 +00:00
Chris Lattner
a33f2b3731 Continue Alkis's int64_t cleanup. This makes all of the immediate related
methods take an int or unsigned value instead of int64_t.

Also, add an 'addImm' method to the MachineInstrBuilder class, because the
fact that the hardware sign or zero extends it does not/should not matter
to the code generator.  Once the old sparc backend is removed the difference
can be eliminated.

llvm-svn: 11976
2004-02-29 05:06:49 +00:00
Chris Lattner
349b8c928d Add BuildMI variants that take a MBB::iterator
llvm-svn: 11975
2004-02-29 04:55:28 +00:00
Alkis Evlogimenos
876f6f96d0 Use correct template for ADC instruction with memory operands.
llvm-svn: 11974
2004-02-29 02:18:17 +00:00
Chris Lattner
b1862e4d3b Add an instruction selector capable of selecting 'ret void'
llvm-svn: 11973
2004-02-29 00:27:00 +00:00
Alkis Evlogimenos
fa63580517 SHLD and SHRD take 32-bit operands but an 8-bit immediate. Rename them
to denote this fact.

llvm-svn: 11972
2004-02-28 23:46:44 +00:00
Alkis Evlogimenos
4953ae085a Floating point loads/stores act on memory operands. Rename them to
denote this fact.

llvm-svn: 11971
2004-02-28 23:42:35 +00:00
Alkis Evlogimenos
c6948fa762 Rename instruction templates to be easier to the human eye to
parse. The name is now I (operand size)*. For example:

Im32 -> instruction with 32-bit memory operands.

Im16i8 -> instruction with 16-bit memory operands and 8 bit immediate
          operands.

llvm-svn: 11970
2004-02-28 23:09:03 +00:00
Alkis Evlogimenos
5b5dee4afb Uncomment instructions that take both an immediate and a memory
operand but their sizes differ.

llvm-svn: 11969
2004-02-28 22:06:59 +00:00
Brian Gaeke
c0f3741a16 Fix my sloppiness
llvm-svn: 11968
2004-02-28 22:06:03 +00:00
Alkis Evlogimenos
194939086d Each instruction now has both an ImmType and a MemType. This describes
the size of the immediate and the memory operand on instructions that
use them. This resolves problems with instructions that take both a
memory and an immediate operand but their sizes differ (i.e. ADDmi32b).

llvm-svn: 11967
2004-02-28 22:02:05 +00:00
Brian Gaeke
465a5cc291 Fix typo in comment
llvm-svn: 11966
2004-02-28 21:55:18 +00:00
Chris Lattner
c116ede471 Add a testcase for switch instruction induction
llvm-svn: 11965
2004-02-28 21:30:39 +00:00
Chris Lattner
d3e6ae263c Implement switch->br and br->switch folding by ripping out the switch->switch
and br->br code and generalizing it.  This allows us to compile code like this:

int test(Instruction *I) {
  if (isa<CastInst>(I))
    return foo(7);
  else if (isa<BranchInst>(I))
    return foo(123);
  else if (isa<UnwindInst>(I))
    return foo(1241);
  else if (isa<SetCondInst>(I))
    return foo(1);
  else if (isa<VAArgInst>(I))
    return foo(42);
  return foo(-1);
}

into:

int %_Z4testPN4llvm11InstructionE("struct.llvm::Instruction"* %I) {
entry:
        %tmp.1.i.i.i.i.i.i.i = getelementptr "struct.llvm::Instruction"* %I, long 0, ubyte 4            ; <uint*> [#uses=1]
        %tmp.2.i.i.i.i.i.i.i = load uint* %tmp.1.i.i.i.i.i.i.i          ; <uint> [#uses=2]
        %tmp.2.i.i.i.i.i.i = seteq uint %tmp.2.i.i.i.i.i.i.i, 27                ; <bool> [#uses=0]
        switch uint %tmp.2.i.i.i.i.i.i.i, label %endif.0 [
                 uint 27, label %then.0
                 uint 2, label %then.1
                 uint 5, label %then.2
                 uint 14, label %then.3
                 uint 15, label %then.3
                 uint 16, label %then.3
                 uint 17, label %then.3
                 uint 18, label %then.3
                 uint 19, label %then.3
                 uint 32, label %then.4
        ]
...

As well as handling the cases in 176.gcc and many other programs more effectively.

llvm-svn: 11964
2004-02-28 21:28:10 +00:00
Chris Lattner
72bb8fcb15 Change this so that LLC actually tries to run the code generator, though it will
immediately abort due to lack of an instruction selector. :)

llvm-svn: 11963
2004-02-28 20:21:45 +00:00
Chris Lattner
72170c4a2e Add a hook to run with the V8 target, though it doesn't currently work. Also
mark the PPC backend as experimental

llvm-svn: 11962
2004-02-28 19:55:16 +00:00
Chris Lattner
fc5232ba3a Add hook for V8 target
llvm-svn: 11961
2004-02-28 19:54:16 +00:00
Chris Lattner
990c279f5c SparcV8 now builds.
llvm-svn: 11960
2004-02-28 19:54:00 +00:00
Chris Lattner
daeeaa72cd fine grainify namespacification
llvm-svn: 11959
2004-02-28 19:53:18 +00:00
Chris Lattner
1a3ee3e961 Finegrainify namespacification
llvm-svn: 11958
2004-02-28 19:52:49 +00:00
Chris Lattner
e40fd90b0b Tab completion is our friend.
llvm-svn: 11957
2004-02-28 19:45:39 +00:00
Chris Lattner
0179fb5881 Clean up rules
llvm-svn: 11956
2004-02-28 19:43:40 +00:00
Chris Lattner
74598091a1 Bring this directory into "it actually compiles" land
llvm-svn: 11955
2004-02-28 19:37:18 +00:00
Chris Lattner
3290952f8b Fix multiple inclusion problem
llvm-svn: 11954
2004-02-28 19:31:32 +00:00
Chris Lattner
772eafa332 if there is already a prototype for malloc/free, use it, even if it's incorrect.
Do not just inject a new prototype.

llvm-svn: 11951
2004-02-28 18:51:45 +00:00
Chris Lattner
36326de312 Do not remove an active template argument even if the superclass had one of the
same name

llvm-svn: 11950
2004-02-28 17:41:48 +00:00
Chris Lattner
178f0f1405 fix a bug in the testcase
llvm-svn: 11949
2004-02-28 17:33:21 +00:00
Chris Lattner
994f2d1406 Ignore X = X assignments that was causing Alkis's rewrite of X86.td to crash
tblgen.

llvm-svn: 11948
2004-02-28 17:31:28 +00:00
Chris Lattner
1ddddf536a new testcase for a tblgen bug that alkis ran into
llvm-svn: 11947
2004-02-28 16:43:44 +00:00
Chris Lattner
d959ab9208 Assert instead of going into an infinite loop!
llvm-svn: 11946
2004-02-28 16:31:53 +00:00
Brian Gaeke
18577345aa ELF constants and data structures.
llvm-svn: 11945
2004-02-28 06:26:20 +00:00
Alkis Evlogimenos
2debead504 Do not generate instructions with mismatched memory/immediate sized
operands. The X86 backend doesn't handle them properly right now.

llvm-svn: 11944
2004-02-28 06:01:43 +00:00
Chris Lattner
eff5f51807 new testcase for intrinsic folding
llvm-svn: 11943
2004-02-28 05:28:42 +00:00
Chris Lattner
b66f42427a The instruction combining pass removes dead instructions, there is no need
to run the die pass after it.

llvm-svn: 11942
2004-02-28 05:26:06 +00:00
Chris Lattner
51ea127bf3 Rename AddUsesToWorkList -> AddUsersToWorkList, as that is what it does.
Create a new AddUsesToWorkList method
optimize memmove/set/cpy of zero bytes to a noop.

llvm-svn: 11941
2004-02-28 05:22:00 +00:00
Chris Lattner
f3a366062c Turn 'free null' into nothing
llvm-svn: 11940
2004-02-28 04:57:37 +00:00
Misha Brukman
8a2c28fdda Right, it's really Extractor, not Extraction.
llvm-svn: 11939
2004-02-28 03:37:58 +00:00
Misha Brukman
370c58a44a New Function-level transformation utils.
llvm-svn: 11938
2004-02-28 03:33:30 +00:00
Misha Brukman
3151628a0d Add the prototype for the LoopExtractor Pass.
llvm-svn: 11937
2004-02-28 03:33:17 +00:00
Misha Brukman
03a11340ff A pass that uses the generic CodeExtractor to rip out *every* loop in every
function, as long as the loop isn't the only one in that function. This should
help debugging passes easier with BugPoint.

llvm-svn: 11936
2004-02-28 03:33:01 +00:00
Misha Brukman
caa1a5abeb A generic code extractor: given a list of BasicBlocks, it will rip them out into
a new function, taking care of inputs and outputs.

llvm-svn: 11935
2004-02-28 03:26:20 +00:00
Misha Brukman
be74d5f73a Two testcases for loops: one with outputs, one without.
llvm-svn: 11934
2004-02-28 03:20:41 +00:00
Alkis Evlogimenos
24b3d0bdae Further comment updates.
llvm-svn: 11933
2004-02-28 03:20:31 +00:00
Alkis Evlogimenos
f87966b8c4 Update comments.
llvm-svn: 11932
2004-02-28 03:12:31 +00:00
Alkis Evlogimenos
2dbc79df84 My previous commit broke the jit. The shift instructions always take
an 8-bit immediate. So mark the shifts that take immediates as taking
an 8-bit argument. The rest with the implicit use of CL are marked
appropriately.

A bug still exists:

def SHLDmri32  : I2A8 <"shld", 0xA4, MRMDestMem>, TB;           // [mem32] <<= [mem32],R32 imm8

The immediate in the above instruction is 8-bit but the memory
reference is 32-bit. The printer prints this as an 8-bit reference
which confuses the assembler. Same with SHRDmri32.

llvm-svn: 11931
2004-02-28 02:56:26 +00:00
Brian Gaeke
ffeef64177 Turn off the SparcV9MachineCodeDestructionPass for now, because it's buggy
llvm-svn: 11930
2004-02-27 21:15:40 +00:00
Brian Gaeke
50d19bf1de Correct DestroyMachineFunction's getPassName
llvm-svn: 11929
2004-02-27 21:01:14 +00:00
Chris Lattner
06a573f63d Only clone global nodes between graphs if both graphs have the global.
llvm-svn: 11928
2004-02-27 20:05:15 +00:00
Chris Lattner
98f8ca4017 ADD MORE FUNCTIONS!
llvm-svn: 11927
2004-02-27 20:04:48 +00:00
Alkis Evlogimenos
b10b04c5ec Fix argument size for SHL, SHR, SAR, SHLD and SHRD families of
instructions.

llvm-svn: 11923
2004-02-27 19:46:30 +00:00
Alkis Evlogimenos
75ed0f67bf Fix encoding of ADD and SUB family of instructions. Also rearrange
them so that they are consistent with AND, XOR, etc...

llvm-svn: 11922
2004-02-27 18:57:00 +00:00
Alkis Evlogimenos
58270fcf1f Rename MRMS[0-7]{r,m} to MRM[0-7]{r,m}.
llvm-svn: 11921
2004-02-27 18:55:12 +00:00
Chris Lattner
e82c217b2f setcond instructions don't have aliasing implications.
llvm-svn: 11919
2004-02-27 18:09:25 +00:00
John Criswell
a3b47cae4c Added d and hbd MultiSource applications.
llvm-svn: 11915
2004-02-27 18:02:06 +00:00
Chris Lattner
3705370df1 Fix Regression/Assembler/2004-02-27-SelfUseAssertError.ll
llvm-svn: 11913
2004-02-27 17:28:25 +00:00
Chris Lattner
65d7e5f308 Fix a verifier bug that was preventing us from ripping povray+libpng to pieces.
llvm-svn: 11912
2004-02-27 17:26:08 +00:00
Chris Lattner
e8ad1347ab Build zlib and libpng
llvm-svn: 11911
2004-02-27 17:00:29 +00:00
Chris Lattner
2b96fee7a6 Updates from Reid
llvm-svn: 11908
2004-02-27 16:17:20 +00:00
Alkis Evlogimenos
9476b7cbe5 Add memory operand folding support for the SETcc family of
instructions.

llvm-svn: 11907
2004-02-27 16:13:37 +00:00
Alkis Evlogimenos
a0bae43032 Make MachineOperand's immediate value an int and save 4 bytes out of
each MachineOperand. We don't really need an int64_t immediate :-).

llvm-svn: 11906
2004-02-27 15:05:28 +00:00
Alkis Evlogimenos
8d99063b38 Add memory operand folding support for SHLD and SHRD instructions.
llvm-svn: 11905
2004-02-27 15:03:18 +00:00
Alkis Evlogimenos
3537404299 Add memory operand folding support for SHL, SHR and SAR, SHLD instructions.
llvm-svn: 11903
2004-02-27 09:28:43 +00:00
Alkis Evlogimenos
f020dfb43c Rename SHL, SHR, SAR, SHLD and SHLR instructions to make them
consistent with the rest and also pepare for the addition of their
memory operand variants.

llvm-svn: 11902
2004-02-27 06:57:05 +00:00
Chris Lattner
524ee2beee Initial checkin of document, contributed by Reid Spencer.
llvm-svn: 11901
2004-02-27 06:28:34 +00:00
Chris Lattner
4f7accab96 Implement test/Regression/Transforms/InstCombine/canonicalize_branch.ll
This is a really minor thing, but might help out the 'switch statement induction'
code in simplifycfg.

llvm-svn: 11900
2004-02-27 06:27:46 +00:00
Chris Lattner
d58a88b28d The instcombiner should canonicalize comparisons.
llvm-svn: 11899
2004-02-27 06:27:07 +00:00
Alkis Evlogimenos
e669caafe0 Rename member function to be consistent with the rest.
llvm-svn: 11898
2004-02-27 06:11:15 +00:00
Alkis Evlogimenos
6cf4373394 Add improvements to the code generator.
llvm-svn: 11896
2004-02-27 05:26:23 +00:00
Alkis Evlogimenos
941f9310bb Make spiller push stores right after the definition of a register so
that they are as far away from the loads as possible.

llvm-svn: 11895
2004-02-27 04:51:35 +00:00
Alkis Evlogimenos
519e1e8c92 Fix crash caused by passing register 0 to
MRegisterInfo::isPhysicalRegister().

llvm-svn: 11894
2004-02-27 01:52:34 +00:00
Alkis Evlogimenos
5a3bab9402 Clear maps right after basic block is processed.
llvm-svn: 11892
2004-02-26 23:22:23 +00:00
Misha Brukman
61107d315b Doxygenify comments.
llvm-svn: 11891
2004-02-26 23:20:29 +00:00
Misha Brukman
c49e64347c Doxygenify and tersify comments.
llvm-svn: 11890
2004-02-26 23:20:08 +00:00
John Criswell
bbde7d667f Added PR258 and 259.
llvm-svn: 11889
2004-02-26 23:13:34 +00:00
John Criswell
9ed08ab1f7 Added support for C++ compilation.
Made removing the object files a separate sh command so that it can easily
be commented out.

llvm-svn: 11888
2004-02-26 23:02:25 +00:00
John Criswell
c7ef3c61fd C++ version of llvm-native-gcc.
llvm-svn: 11887
2004-02-26 23:01:21 +00:00
John Criswell
6192eeb0c5 Fixed test case to actually check for the static declaration.
Oops.

llvm-svn: 11886
2004-02-26 22:56:13 +00:00
John Criswell
6fd2e36fd5 Regression tests for PR258 and PR259.
2004-02-26-FPNotPrintableConstants.llx ensures that constants used in an
LLVM program are declared static if they are assigned to global variables.
2004-02-26-LinkOnceFunctions.llx ensures that linkonce functions get the
weak attribute.

llvm-svn: 11885
2004-02-26 22:55:11 +00:00
John Criswell
feb7c49ce4 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
5ef1638da2 Be a good little compiler and handle direct calls efficiently, even if there
are beastly ConstantPointerRefs in the way...

llvm-svn: 11883
2004-02-26 22:07:22 +00:00
Alkis Evlogimenos
61719d48d2 Uncomment assertions that register# != 0 on calls to
MRegisterInfo::is{Physical,Virtual}Register. Apply appropriate fixes
to relevant files.

llvm-svn: 11882
2004-02-26 22:00:20 +00:00
John Criswell
44cf9fadcb Modified the default pathname for Povray.
llvm-svn: 11881
2004-02-26 20:22:59 +00:00
Chris Lattner
79636d7cd5 Since LLVM uses structure type equivalence, it isn't useful to keep around
multiple type names for the same structural type.  Make DTE eliminate all
but one of the type names

llvm-svn: 11879
2004-02-26 20:02:23 +00:00
Chris Lattner
a990863851 Annotations are evil. This makes Value not derive from Annotable, which makes
all dynamically allocated LLVM values 4 bytes smaller, eliminate some vtables, and
make Value's destructor faster.

This makes Function derive from Annotation now because it is the only core LLVM
class that still has an annotation stuck onto it: MachineFunction.
MachineFunction is obviously horrible and gross (like most other annotations), but
will be the subject of refactorings later in the future.  Besides many fewer
Function objects are dynamically allocated that instructions blocks, constants,
types, etc... :)

llvm-svn: 11878
2004-02-26 08:08:38 +00:00
Chris Lattner
19cfc40ce0 add note
llvm-svn: 11876
2004-02-26 08:02:57 +00:00
Chris Lattner
7140e4696a Use a map instead of annotations
llvm-svn: 11875
2004-02-26 08:02:17 +00:00
Chris Lattner
e495e774b7 Make TargetData no longer use annotations!
llvm-svn: 11874
2004-02-26 08:01:57 +00:00
Chris Lattner
526a80ec25 Eliminate copy-and-paste comments
llvm-svn: 11873
2004-02-26 08:01:30 +00:00
Chris Lattner
234a2d4f19 remove obsolete comment
llvm-svn: 11872
2004-02-26 07:59:22 +00:00
Chris Lattner
120035898b 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
21e941fbfd turn things like:
if (X == 0 || X == 2)

...where the comparisons and branches are in different blocks... into a switch
instruction.  This comes up a lot in various programs, and works well with
the switch/switch merging code I checked earlier.  For example, this testcase:

int switchtest(int C) {
  return C == 0 ? f(123) :
         C == 1 ? f(3123) :
         C == 4 ? f(312) :
         C == 5 ? f(1234): f(444);
}

is converted into this:
        switch int %C, label %cond_false.3 [
                 int 0, label %cond_true.0
                 int 1, label %cond_true.1
                 int 4, label %cond_true.2
                 int 5, label %cond_true.3
        ]

instead of a whole bunch of conditional branches.

Admittedly the code is ugly, and incomplete.  To be complete, we need to add
br -> switch merging and switch -> br merging.  For example, this testcase:

struct foo { int Q, R, Z; };
#define A (X->Q+X->R * 123)
int test(struct foo *X) {
  return A  == 123 ? X1() :
        A == 12321 ? X2():
        (A == 111 || A == 222) ? X3() :
        A == 875 ? X4() : X5();
}

Gets compiled to this:
        switch int %tmp.7, label %cond_false.2 [
                 int 123, label %cond_true.0
                 int 12321, label %cond_true.1
                 int 111, label %cond_true.2
                 int 222, label %cond_true.2
        ]
...
cond_false.2:           ; preds = %entry
        %tmp.52 = seteq int %tmp.7, 875         ; <bool> [#uses=1]
        br bool %tmp.52, label %cond_true.3, label %cond_false.3

where the branch could be folded into the switch.

This kind of thing occurs *ALL OF THE TIME*, especially in programs like
176.gcc, which is a horrible mess of code.  It contains stuff like *shudder*:

#define SWITCH_TAKES_ARG(CHAR) \
  (   (CHAR) == 'D' \
   || (CHAR) == 'U' \
   || (CHAR) == 'o' \
   || (CHAR) == 'e' \
   || (CHAR) == 'u' \
   || (CHAR) == 'I' \
   || (CHAR) == 'm' \
   || (CHAR) == 'L' \
   || (CHAR) == 'A' \
   || (CHAR) == 'h' \
   || (CHAR) == 'z')

and

#define CONST_OK_FOR_LETTER_P(VALUE, C)                 \
  ((C) == 'I' ? SMALL_INTVAL (VALUE)                    \
   : (C) == 'J' ? SMALL_INTVAL (-(VALUE))               \
   : (C) == 'K' ? (unsigned)(VALUE) < 32                \
   : (C) == 'L' ? ((VALUE) & 0xffff) == 0               \
   : (C) == 'M' ? integer_ok_for_set (VALUE)            \
   : (C) == 'N' ? (VALUE) < 0                           \
   : (C) == 'O' ? (VALUE) == 0                          \
   : (C) == 'P' ? (VALUE) >= 0                          \
   : 0)

and

#define LEGITIMIZE_ADDRESS(X,OLDX,MODE,WIN)                     \
{                                                               \
  if (GET_CODE (X) == PLUS && CONSTANT_ADDRESS_P (XEXP (X, 1))) \
    (X) = gen_rtx (PLUS, SImode, XEXP (X, 0),                   \
                   copy_to_mode_reg (SImode, XEXP (X, 1)));     \
  if (GET_CODE (X) == PLUS && CONSTANT_ADDRESS_P (XEXP (X, 0))) \
    (X) = gen_rtx (PLUS, SImode, XEXP (X, 1),                   \
                   copy_to_mode_reg (SImode, XEXP (X, 0)));     \
  if (GET_CODE (X) == PLUS && GET_CODE (XEXP (X, 0)) == MULT)   \
    (X) = gen_rtx (PLUS, SImode, XEXP (X, 1),                   \
                   force_operand (XEXP (X, 0), 0));             \
  if (GET_CODE (X) == PLUS && GET_CODE (XEXP (X, 1)) == MULT)   \
    (X) = gen_rtx (PLUS, SImode, XEXP (X, 0),                   \
                   force_operand (XEXP (X, 1), 0));             \
  if (GET_CODE (X) == PLUS && GET_CODE (XEXP (X, 0)) == PLUS)   \
    (X) = gen_rtx (PLUS, Pmode, force_operand (XEXP (X, 0), NULL_RTX),\
                   XEXP (X, 1));                                \
  if (GET_CODE (X) == PLUS && GET_CODE (XEXP (X, 1)) == PLUS)   \
    (X) = gen_rtx (PLUS, Pmode, XEXP (X, 0),                    \
                   force_operand (XEXP (X, 1), NULL_RTX));      \
  if (GET_CODE (X) == SYMBOL_REF || GET_CODE (X) == CONST       \
           || GET_CODE (X) == LABEL_REF)                        \
    (X) = legitimize_address (flag_pic, X, 0, 0);               \
  if (memory_address_p (MODE, X))                               \
    goto WIN; }

and others.  These macros get used multiple times of course.  These are such
lovely candidates for macros, aren't they?  :)

This code also nicely handles LLVM constructs that look like this:

  if (isa<CastInst>(I))
   ...
  else if (isa<BranchInst>(I))
   ...
  else if (isa<SetCondInst>(I))
   ...
  else if (isa<UnwindInst>(I))
   ...
  else if (isa<VAArgInst>(I))
   ...

where the isa can obviously be a dyn_cast as well.  Switch instructions are a
good thing.

llvm-svn: 11870
2004-02-26 07:13:46 +00:00
Chris Lattner
28a0885929 No need to clear the map here, it will always be empty
llvm-svn: 11868
2004-02-26 05:21:21 +00:00
Chris Lattner
5e39cf9fbd Fix a bug in the densemap that was killing the local allocator, and probably
other clients.  The problem is that the nullVal member was left to the default
constructor to initialize, which for int's does nothing (ie, leaves it unspecified).

To get a zero value, we must use T().  It's C++ wonderful? :)

llvm-svn: 11867
2004-02-26 05:00:15 +00:00
Alkis Evlogimenos
e008a4b28f Remove .micro references as those files no longer exist and add some more recent Makefile additions to the list
llvm-svn: 11866
2004-02-26 04:14:10 +00:00
Chris Lattner
973556b724 Fix typeo. grow() cannot shrink storage. clear() should really nuke storage
llvm-svn: 11865
2004-02-26 04:07:12 +00:00
Chris Lattner
36ab728fe5 Fix typo
llvm-svn: 11864
2004-02-26 03:45:03 +00:00
Chris Lattner
128e84197b The node doesn't have to be _no_ node flags, it just has to be complete and
not have any globals.

llvm-svn: 11863
2004-02-26 03:43:43 +00:00
Chris Lattner
c8167b0e7e Add _more_ functions
llvm-svn: 11862
2004-02-26 03:43:08 +00:00
Chris Lattner
73687be9d7 We have this snazzy link-time optimizer. How about we start using it? This
removes some cruft from 255.vortex, cleaning up after DAE and IPCP, which
do horrible, beautiful, things to vortex.

llvm-svn: 11861
2004-02-26 03:34:30 +00:00
Chris Lattner
9192bbdad9 Fix some warnings, some of which were spurious, and some of which were real
bugs.  Thanks Brian!

llvm-svn: 11859
2004-02-26 01:20:02 +00:00
Misha Brukman
1743c4090d Instructions to call and return from functions.
llvm-svn: 11858
2004-02-26 00:37:12 +00:00
Brian Gaeke
11331e5d59 One B00g fixed.
llvm-svn: 11857
2004-02-26 00:08:25 +00:00
Alkis Evlogimenos
802cf52b91 Temporarily comment out asserts as they break things. I will uncomment
them when all the problem areas are fixed.

llvm-svn: 11855
2004-02-25 23:56:36 +00:00
Alkis Evlogimenos
19aaae3f3b Fix typo. I wonder how this actually worked.
llvm-svn: 11854
2004-02-25 23:47:17 +00:00
Alkis Evlogimenos
2cf83d3401 Complete the SPEC_ROOT and USE_SPEC to SPEC2000_ROOT and USE_SPEC200 rename.
llvm-svn: 11853
2004-02-25 23:41:32 +00:00
Chris Lattner
71626b8f36 Two changes:
1. Functions do not make things incomplete, only variables
 2. Constant global variables no longer need to be marked incomplete, because
    we are guaranteed that the initializer for the global will be in the
    graph we are hacking on now.  This makes resolution of indirect calls happen
    a lot more in the bu pass, supports things like vtables and the C counterparts
    (giant constant arrays of function pointers), etc...

Testcase here: test/Regression/Analysis/DSGraph/constant_globals.ll

llvm-svn: 11852
2004-02-25 23:36:08 +00:00
Chris Lattner
fc0912d02a New testcase
llvm-svn: 11851
2004-02-25 23:34:04 +00:00
Chris Lattner
fab2872b6c When building local graphs, clone the initializer for constant globals into each
local graph that uses the global.

llvm-svn: 11850
2004-02-25 23:31:02 +00:00
Alkis Evlogimenos
e62ddd405d Fix bugs found with recent addition of assertions in
MRegisterInfo::is{Physical,Virtual}Register.

llvm-svn: 11849
2004-02-25 23:21:52 +00:00
Chris Lattner
6ce59b4a03 Simplify the dead node elimination stuff
Make the incompleteness marker faster by looping directly over the globals
instead of over the scalars to find the globals

Fix a bug where we didn't mark a global incomplete if it didn't have any
outgoing edges.  This wouldn't break any current clients but is still wrong.

llvm-svn: 11848
2004-02-25 23:08:00 +00:00
Chris Lattner
5e5e060618 Add a bunch more functions
llvm-svn: 11847
2004-02-25 23:06:40 +00:00
Chris Lattner
17bce88100 Try harder to get symbol info
llvm-svn: 11846
2004-02-25 23:06:30 +00:00
Brian Gaeke
7b4be13f94 Represent va_list in interpreter as a (ec-stack-depth . var-arg-index)
pair, and look up varargs in the execution stack every time, instead of
just pushing iterators (which can be invalidated during callFunction())
around.  (union GenericValue now has a "pair of uints" member, to support
this mechanism.) Fixes Bug 234.

llvm-svn: 11845
2004-02-25 23:01:48 +00:00
Brian Gaeke
84b76c9be0 Great sparc renaming fallout IV: Sparc --> SparcV9.
llvm-svn: 11844
2004-02-25 22:09:36 +00:00
Alkis Evlogimenos
ae54cfc19f Duh, forgot to close the parenthesis.
llvm-svn: 11843
2004-02-25 22:07:14 +00:00
Alkis Evlogimenos
cb69f50cb5 Add assert to isPhysicalRegister and isVirtualRegister to fail when
passed the special 'register' 0.

llvm-svn: 11842
2004-02-25 22:04:28 +00:00
Alkis Evlogimenos
a9f03fba9d Remove asssert since it is breaking cases that it shouldn't.
llvm-svn: 11841
2004-02-25 22:01:06 +00:00
Alkis Evlogimenos
d8bace7f60 Add DenseMap template and actually use it for for mapping virtual regs
to objects.

llvm-svn: 11840
2004-02-25 21:55:45 +00:00
Chris Lattner
b66a35ef9c Add a new pass, run internalize first
llvm-svn: 11839
2004-02-25 21:35:13 +00:00
Chris Lattner
0f39359dd2 Add a new pass
llvm-svn: 11838
2004-02-25 21:35:02 +00:00
Chris Lattner
14da4ead95 Add prototype
llvm-svn: 11837
2004-02-25 21:34:51 +00:00
Chris Lattner
8d1da1abee My faith in programmers has been found to be totally misplaced. One would
assume that if they don't intend to write to a global variable, that they
would mark it as constant.  However, there are people that don't understand
that the compiler can do nice things for them if they give it the information
it needs.

This pass looks for blatently obvious globals that are only ever read from.
Though it uses a trivially simple "alias analysis" of sorts, it is still able
to do amazing things to important benchmarks.  253.perlbmk, for example,
contains several ***GIANT*** function pointer tables that are not marked
constant and should be.  Marking them constant allows the optimizer to turn
a whole bunch of indirect calls into direct calls.  Note that only a link-time
optimizer can do this transformation, but perlbmk does have several strings
and other minor globals that can be marked constant by this pass when run
from GCCAS.

176.gcc has a ton of strings and large tables that are marked constant, both
at compile time (38 of them) and at link time (48 more).  Other benchmarks
give similar results, though it seems like big ones have disproportionally
more than small ones.

This pass is extremely quick and does good things.  I'm going to enable it
in gccas & gccld.  Not bad for 50 SLOC.

llvm-svn: 11836
2004-02-25 21:34:36 +00:00
Misha Brukman
564654d654 SparcV8 regs are really 32-bit, not 64! Thanks, Chris.
llvm-svn: 11835
2004-02-25 21:03:02 +00:00
Misha Brukman
f8dcdcc83b Clean up the tablegen descriptions for SparcV8.
llvm-svn: 11834
2004-02-25 21:02:21 +00:00
Misha Brukman
2122b969f9 Fix the SparcV8 register definitions that were imported from PPC template.
llvm-svn: 11833
2004-02-25 21:00:05 +00:00
Misha Brukman
0e3a7ca53e SparcV8 has different types of instructions, but F1 is only used for CALL.
llvm-svn: 11832
2004-02-25 20:52:20 +00:00
Brian Gaeke
232483aecc Note that this test is currently expected to fail.
llvm-svn: 11831
2004-02-25 20:34:02 +00:00
Chris Lattner
f5a393a133 Add an assertion
llvm-svn: 11830
2004-02-25 19:37:44 +00:00
Chris Lattner
64c9b223bd Fix failures in 099.go due to the cfgsimplify pass creating switch instructions
where there did not used to be any before

llvm-svn: 11829
2004-02-25 19:30:19 +00:00
Brian Gaeke
9a5bd7fca7 SparcV8 skeleton
llvm-svn: 11828
2004-02-25 19:28:19 +00:00
Brian Gaeke
068b4596d4 Great renaming part II: Sparc --> SparcV9 (also includes command-line options and Makefiles)
llvm-svn: 11827
2004-02-25 19:08:12 +00:00
Brian Gaeke
94e95d2b3e Great renaming: Sparc --> SparcV9
llvm-svn: 11826
2004-02-25 18:44:15 +00:00
Chris Lattner
864c901444 Add a bunch more functions used by perlbmk
llvm-svn: 11824
2004-02-25 17:43:20 +00:00
John Criswell
9f547bcea9 Updated to use llc to generate CBE code.
llvm-svn: 11823
2004-02-25 17:15:02 +00:00
Chris Lattner
8ebf253827 Substantial improvements and cleanups for the release notes. We were missing
a bunch of stuff!  :)

llvm-svn: 11822
2004-02-25 16:36:51 +00:00
Chris Lattner
9c6833c5ca Fix incorrect debug code
llvm-svn: 11821
2004-02-25 15:15:04 +00:00
Chris Lattner
309327a4b5 Teach the instruction selector how to transform 'array' GEP computations into X86
scaled indexes.  This allows us to compile GEP's like this:

int* %test([10 x { int, { int } }]* %X, int %Idx) {
        %Idx = cast int %Idx to long
        %X = getelementptr [10 x { int, { int } }]* %X, long 0, long %Idx, ubyte 1, ubyte 0
        ret int* %X
}

Into a single address computation:

test:
        mov %EAX, DWORD PTR [%ESP + 4]
        mov %ECX, DWORD PTR [%ESP + 8]
        lea %EAX, DWORD PTR [%EAX + 8*%ECX + 4]
        ret

Before it generated:
test:
        mov %EAX, DWORD PTR [%ESP + 4]
        mov %ECX, DWORD PTR [%ESP + 8]
        shl %ECX, 3
        add %EAX, %ECX
        lea %EAX, DWORD PTR [%EAX + 4]
        ret

This is useful for things like int/float/double arrays, as the indexing can be folded into
the loads&stores, reducing register pressure and decreasing the pressure on the decode unit.
With these changes, I expect our performance on 256.bzip2 and gzip to improve a lot.  On
bzip2 for example, we go from this:

10665 asm-printer           - Number of machine instrs printed
   40 ra-local              - Number of loads/stores folded into instructions
 1708 ra-local              - Number of loads added
 1532 ra-local              - Number of stores added
 1354 twoaddressinstruction - Number of instructions added
 1354 twoaddressinstruction - Number of two-address instructions
 2794 x86-peephole          - Number of peephole optimization performed

to this:
9873 asm-printer           - Number of machine instrs printed
  41 ra-local              - Number of loads/stores folded into instructions
1710 ra-local              - Number of loads added
1521 ra-local              - Number of stores added
 789 twoaddressinstruction - Number of instructions added
 789 twoaddressinstruction - Number of two-address instructions
2142 x86-peephole          - Number of peephole optimization performed

... and these types of instructions are often in tight loops.

Linear scan is also helped, but not as much.  It goes from:

8787 asm-printer           - Number of machine instrs printed
2389 liveintervals         - Number of identity moves eliminated after coalescing
2288 liveintervals         - Number of interval joins performed
3522 liveintervals         - Number of intervals after coalescing
5810 liveintervals         - Number of original intervals
 700 spiller               - Number of loads added
 487 spiller               - Number of stores added
 303 spiller               - Number of register spills
1354 twoaddressinstruction - Number of instructions added
1354 twoaddressinstruction - Number of two-address instructions
 363 x86-peephole          - Number of peephole optimization performed

to:

7982 asm-printer           - Number of machine instrs printed
1759 liveintervals         - Number of identity moves eliminated after coalescing
1658 liveintervals         - Number of interval joins performed
3282 liveintervals         - Number of intervals after coalescing
4940 liveintervals         - Number of original intervals
 635 spiller               - Number of loads added
 452 spiller               - Number of stores added
 288 spiller               - Number of register spills
 789 twoaddressinstruction - Number of instructions added
 789 twoaddressinstruction - Number of two-address instructions
 258 x86-peephole          - Number of peephole optimization performed

Though I'm not complaining about the drop in the number of intervals.  :)

llvm-svn: 11820
2004-02-25 07:00:55 +00:00
Chris Lattner
d1ee55d439 * Make the previous patch more efficient by not allocating a temporary MachineInstr
to do analysis.

*** FOLD getelementptr instructions into loads and stores when possible,
    making use of some of the crazy X86 addressing modes.

For example, the following C++ program fragment:

struct complex {
    double re, im;
    complex(double r, double i) : re(r), im(i) {}
};
inline complex operator+(const complex& a, const complex& b) {
    return complex(a.re+b.re, a.im+b.im);
}
complex addone(const complex& arg) {
    return arg + complex(1,0);
}

Used to be compiled to:
_Z6addoneRK7complex:
        mov %EAX, DWORD PTR [%ESP + 4]
        mov %ECX, DWORD PTR [%ESP + 8]
***     mov %EDX, %ECX
        fld QWORD PTR [%EDX]
        fld1
        faddp %ST(1)
***     add %ECX, 8
        fld QWORD PTR [%ECX]
        fldz
        faddp %ST(1)
***     mov %ECX, %EAX
        fxch %ST(1)
        fstp QWORD PTR [%ECX]
***     add %EAX, 8
        fstp QWORD PTR [%EAX]
        ret

Now it is compiled to:
_Z6addoneRK7complex:
        mov %EAX, DWORD PTR [%ESP + 4]
        mov %ECX, DWORD PTR [%ESP + 8]
        fld QWORD PTR [%ECX]
        fld1
        faddp %ST(1)
        fld QWORD PTR [%ECX + 8]
        fldz
        faddp %ST(1)
        fxch %ST(1)
        fstp QWORD PTR [%EAX]
        fstp QWORD PTR [%EAX + 8]
        ret

Other programs should see similar improvements, across the board.  Note that
in addition to reducing instruction count, this also reduces register pressure
a lot, always a good thing on X86.  :)

llvm-svn: 11819
2004-02-25 06:13:04 +00:00
Chris Lattner
4b3514c173 Add a helper to create an addressing mode given all of the pieces.
llvm-svn: 11818
2004-02-25 06:01:07 +00:00
Chris Lattner
d825d30f42 add an inefficient way of folding structure and constant array indexes together
into a single LEA instruction.  This should improve the code generated for
things like X->A.B.C[12].D.

The bigger benefit is still coming though.  Note that this uses an LEA instruction
instead of an add, giving the register allocator more freedom.  We should probably
never generate ADDri32's.

llvm-svn: 11817
2004-02-25 03:45:50 +00:00
Chris Lattner
f85e33cd79 Implement special case for storing an immediate into memory so that we don't need
an intermediate register.

llvm-svn: 11816
2004-02-25 02:56:58 +00:00
Brian Gaeke
04cff21c2f Cygwin defines log2 as a macro. Undef it here IFF it has already been defined,
so that we always get the inline function instead. Remember, kids, like it says
in the GCC manual, "An Inline Function is As Fast As a Macro."

llvm-svn: 11815
2004-02-25 01:53:45 +00:00
Brian Gaeke
01d9231855 small portability fix.
llvm-svn: 11814
2004-02-24 22:58:31 +00:00
Chris Lattner
9ccb1af08f Add support for 'rename'
llvm-svn: 11813
2004-02-24 22:17:00 +00:00
Chris Lattner
d996e543eb Make the verifier a little more explicit about this problem.
llvm-svn: 11811
2004-02-24 22:06:07 +00:00
Chris Lattner
396cdaf067 Add support for remove, fwrite, and fread
Also fix problem where we didn't check to see if a node pointer was null.
Though fclose(null) doesn't make a lot of sense, 300.twolf does it.

llvm-svn: 11810
2004-02-24 22:02:48 +00:00
John Criswell
47c5459cec Added the VTune tests.
llvm-svn: 11809
2004-02-24 21:43:38 +00:00
Brian Gaeke
10a32da382 FunctionLiveVarInfo.h moved: include/llvm/CodeGen -> lib/Target/Sparc/LiveVar
llvm-svn: 11804
2004-02-24 19:46:00 +00:00
Chris Lattner
b471f0188f 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
8ee0593f0d Fix a faulty optimization on FP values
llvm-svn: 11801
2004-02-24 18:10:14 +00:00
John Criswell
a92e58610d Fixed minor typos.
llvm-svn: 11800
2004-02-24 16:13:56 +00:00
Chris Lattner
90ea78edba If a block is made dead, make sure to promptly remove it.
llvm-svn: 11799
2004-02-24 16:09:21 +00:00
Alkis Evlogimenos
1dd872ce94 Move machine code rewriter and spiller outside the register
allocator.

The implementation is completely rewritten and now employs several
optimizations not exercised before. For example for 164.gzip we have
997 loads and 699 stores vs the 1221 loads and 880 stores we have
before.

llvm-svn: 11798
2004-02-24 08:58:30 +00:00
Chris Lattner
a2ab489135 Implement SimplifyCFG/switch_switch_fold.ll
This case occurs many times in various benchmarks, especially when combined
with the previous patch.  This allows it to get stuff like:
  if (X == 4 || X == 3)
    if (X == 5 || X == 8)

and

switch (X) {
case 4: case 5: case 6:
  if (X == 4 || X == 5)

llvm-svn: 11797
2004-02-24 07:23:58 +00:00
Chris Lattner
fe7a92fe7c New testcase. Switch instructions that go to switch instructions should be
merged.

llvm-svn: 11796
2004-02-24 07:21:09 +00:00
Alkis Evlogimenos
63aea0b6a5 Add predicates for checking if a virtual register has a physical
register mapping or a stack slot mapping.

llvm-svn: 11795
2004-02-24 06:30:36 +00:00
Chris Lattner
c7f8ba9f4f Add some helpful methods for dealing with switch instructions
llvm-svn: 11794
2004-02-24 06:26:00 +00:00
Chris Lattner
3cd98f054a Rearrange code a bit
llvm-svn: 11793
2004-02-24 05:54:22 +00:00
Chris Lattner
6f4b45acf5 Implement: test/Regression/Transforms/SimplifyCFG/switch_create.ll
This turns code like this:
  if (X == 4 | X == 7)
and
  if (X != 4 & X != 7)
into switch instructions.

llvm-svn: 11792
2004-02-24 05:38:11 +00:00
Chris Lattner
ae509325d6 The simplifycfg pass should be able to turn stuff like:
if (X == 4 || X == 7)
and
  if (X != 4 && X != 7)

into switch instructions.

llvm-svn: 11791
2004-02-24 05:34:44 +00:00
Chris Lattner
cf96c6caa5 Wow, the description of the 'switch' instruction was out of date.
llvm-svn: 11790
2004-02-24 04:54:45 +00:00
Chris Lattner
9f8bf00ac3 we no longer include boost
llvm-svn: 11789
2004-02-24 04:02:20 +00:00
Chris Lattner
291ebdbfcc Hrm, my find must have been faulty. It didn't remove these as well.
llvm-svn: 11788
2004-02-24 03:54:22 +00:00
Chris Lattner
0da4862a80 Boost is now unneeded, thanks to the fix for PR253, contributed by Reid Spencer!
llvm-svn: 11787
2004-02-24 03:53:00 +00:00
Chris Lattner
7479e1ebd7 Now that's a new feature!
llvm-svn: 11786
2004-02-24 03:50:24 +00:00
Chris Lattner
101e704b0b Use the new LLVM is_class template instead of the boost one, allowing us to
remove our dependency on boost!  Thanks to Reid Spencer for making this possible!

llvm-svn: 11785
2004-02-24 03:50:05 +00:00
Chris Lattner
78eed17a29 Check in a new type_traits header which provides the mysterious is_class
template.  Thanks go out to Reid Spencer for skillfully extracting this
from boost!

llvm-svn: 11784
2004-02-24 03:49:29 +00:00
Chris Lattner
1302e3ac95 Noone cares about similarity to boost
llvm-svn: 11783
2004-02-24 03:47:25 +00:00
Alkis Evlogimenos
8b571a64ac Make enum private as it is an implementation detail.
llvm-svn: 11782
2004-02-23 23:49:40 +00:00
Alkis Evlogimenos
ab77b05d8c Remove '4Virt' from member function names as it is obvious.
llvm-svn: 11781
2004-02-23 23:47:10 +00:00
Alkis Evlogimenos
c794a9060f Refactor VirtRegMap out of RegAllocLinearScan as the first part of bug
251 (providing a generic machine code rewriter/spiller).

llvm-svn: 11780
2004-02-23 23:08:11 +00:00
Alkis Evlogimenos
d140e3d4ff Include Config/config.h for SHLIBEXT.
llvm-svn: 11779
2004-02-23 22:42:51 +00:00
Brian Gaeke
686efc0b56 DataTypes.h is now output from configure, and shortened
llvm-svn: 11778
2004-02-23 22:07:26 +00:00
Brian Gaeke
090ed13063 Add SUBSTing checks for sys/types.h and inttypes.h; add DataTypes.h to AC_OUTPUT.
llvm-svn: 11777
2004-02-23 22:07:01 +00:00
Brian Gaeke
4eea32f37a Regenerated with autoconf-2.57.
llvm-svn: 11776
2004-02-23 22:07:00 +00:00
Chris Lattner
ae739aefd7 Generate much more efficient code in programs like pifft
llvm-svn: 11775
2004-02-23 21:46:58 +00:00
Chris Lattner
c40b9d7d51 Fix a small typeo in my checkin last night that broke vortex and other programs :(
llvm-svn: 11774
2004-02-23 21:46:42 +00:00
Brian Gaeke
1bc5aaefc6 Regenerated with autoheader-2.57.
llvm-svn: 11773
2004-02-23 21:30:39 +00:00
Brian Gaeke
d3de6c0d30 Regenerated with autoconf-2.57.
llvm-svn: 11772
2004-02-23 21:30:37 +00:00
Brian Gaeke
01cc3d876f Change test for pthreads to use AC_SUBST; add ThreadSupport.h as an AC_OUTPUT.
llvm-svn: 11771
2004-02-23 21:30:36 +00:00
Brian Gaeke
c685388125 ThreadSupport.h is now output from configure.
llvm-svn: 11770
2004-02-23 21:30:29 +00:00
Brian Gaeke
d97a1201c2 Remove check for slist
llvm-svn: 11769
2004-02-23 21:12:58 +00:00
Chris Lattner
f5ce254692 Fix InstCombine/2004-02-23-ShiftShiftOverflow.ll
Also, turn 'shr int %X, 1234' into 'shr int %X, 31'

llvm-svn: 11768
2004-02-23 20:30:06 +00:00
Chris Lattner
7eaa535d4d Test for the other way also
llvm-svn: 11767
2004-02-23 20:24:16 +00:00
Chris Lattner
1cc1217121 New testcase
llvm-svn: 11766
2004-02-23 20:19:51 +00:00
Brian Gaeke
cc7644407c Renamed to hash_set.in; move to using autoconf substitution tags.
llvm-svn: 11765
2004-02-23 18:56:36 +00:00
Brian Gaeke
17d7a29d76 Renamed to hash_map.in; move to using autoconf substitution tags.
llvm-svn: 11764
2004-02-23 18:56:35 +00:00
Brian Gaeke
cc2b8b78bf Add include/Support/hash_map and include/Support/hash_set as AC_OUTPUT files.
llvm-svn: 11763
2004-02-23 18:56:05 +00:00
Brian Gaeke
ceb6842293 Regenerated using autoheader-2.57.
llvm-svn: 11762
2004-02-23 18:56:04 +00:00
Brian Gaeke
37205b099b Move HASH_* checks to using AC_SUBST instead of AC_DEFINE. Tighten up some whitespace and comments.
llvm-svn: 11761
2004-02-23 18:56:03 +00:00
Brian Gaeke
8588355552 Regenerated using autoconf-2.57.
llvm-svn: 11760
2004-02-23 18:56:02 +00:00
Alkis Evlogimenos
52de9e214c Add number of spilled registers statistic.
llvm-svn: 11759
2004-02-23 18:45:32 +00:00
Chris Lattner
91a7dc0a6e Fix bugs in finegrainification
llvm-svn: 11758
2004-02-23 18:40:08 +00:00
Chris Lattner
43df6c268b Finegrainify namespacification
llvm-svn: 11757
2004-02-23 18:38:20 +00:00
Alkis Evlogimenos
b525d54045 Use MachineBasicBlock::getParent().
llvm-svn: 11756
2004-02-23 18:36:38 +00:00
Alkis Evlogimenos
d780ce6462 Remove implementation of default constructor as it is useless now.
llvm-svn: 11755
2004-02-23 18:28:35 +00:00
Brian Gaeke
0fa55f7909 Renamed from include/Support/iterator. Doxygenify comments; add autoconf substitution tags.
llvm-svn: 11754
2004-02-23 18:16:10 +00:00
Brian Gaeke
bd02d1806f Replaced by include/Support/iterator.in.
llvm-svn: 11753
2004-02-23 18:16:10 +00:00
Brian Gaeke
e27fc812ca Regenerated with autoheader-2.57.
llvm-svn: 11752
2004-02-23 18:16:09 +00:00
Brian Gaeke
29bb0e93af Add include/Support/iterator as an AC_OUTPUT file.
llvm-svn: 11751
2004-02-23 18:16:08 +00:00
Brian Gaeke
d4754adbcf Make all iterator checks use AC_SUBST instead of AC_DEFINE.
llvm-svn: 11750
2004-02-23 18:16:07 +00:00
Brian Gaeke
10e9315126 Regenerated with autoconf-2.57.
llvm-svn: 11749
2004-02-23 18:16:06 +00:00
Alkis Evlogimenos
af2de4848e Refactor rewinding code for finding the first terminator of a basic
block into MachineBasicBlock::getFirstTerminator().

This also fixes a bug in the implementation of the above in both
RegAllocLocal and InstrSched, where instructions where added after the
terminator if the basic block's only instruction was a terminator (it
shouldn't matter for RegAllocLocal since this case never occurs in
practice).

llvm-svn: 11748
2004-02-23 18:14:48 +00:00
Chris Lattner
cb185a34bb Simplify code a bit, don't go off the end of the block, now that the current
block we are in might be empty

llvm-svn: 11744
2004-02-23 07:42:19 +00:00
Chris Lattner
4ffd4443ce We were forgetting to add FP_REG_KILL instructions to basic blocks which will
eventually get an assignment due to elimination of PHIs.

llvm-svn: 11743
2004-02-23 07:29:45 +00:00
Chris Lattner
2b55ea38bc Implement cast.ll::test14/15
llvm-svn: 11742
2004-02-23 07:16:20 +00:00
Chris Lattner
be9082a63d Add tests for casts that should be eliminated
llvm-svn: 11741
2004-02-23 07:16:03 +00:00
Chris Lattner
e79e854c5c Refactor some code. In the mul - setcc folding case, we really care about
whether this is the sign bit or not, so check unsigned comparisons as well.

llvm-svn: 11740
2004-02-23 06:38:22 +00:00
Chris Lattner
6ddaa24dd9 Handle the unsigned form as well
llvm-svn: 11739
2004-02-23 06:37:33 +00:00
Alkis Evlogimenos
f83cb74b57 Improved PhysRegTracker interface. RegAlloc lazily allocates the register tracker using a std::auto_ptr
llvm-svn: 11738
2004-02-23 06:10:13 +00:00
Chris Lattner
c8a10c4b6a Implement mul.ll:test11
llvm-svn: 11737
2004-02-23 06:00:11 +00:00
Chris Lattner
fb302df02c Add a slight variant of test10
llvm-svn: 11736
2004-02-23 05:59:52 +00:00
Chris Lattner
59611149ee Implement "strength reduction" of X <= C and X >= C
llvm-svn: 11735
2004-02-23 05:47:48 +00:00
Chris Lattner
2635b52d4e Implement InstCombine/mul.ll:test10, which is a case that occurs when dealing
with "predication"

llvm-svn: 11734
2004-02-23 05:39:21 +00:00
Chris Lattner
d0ffbe1cbe This multiply can be eliminated
llvm-svn: 11733
2004-02-23 05:38:47 +00:00
Alkis Evlogimenos
c31ff795d5 Simplify iterator usage now that we have next(). Also don't pass iterators by reference now that MachineInstr* are in an ilist
llvm-svn: 11732
2004-02-23 04:12:30 +00:00
Chris Lattner
e0f79a6a55 Update the 'new features' section
llvm-svn: 11731
2004-02-23 03:51:34 +00:00
Chris Lattner
c6acc1076e Bug fixed
llvm-svn: 11730
2004-02-23 03:36:36 +00:00
Chris Lattner
abb9162999 Work around a gas bug. Print '-9223372036854775808' as unsigned.
llvm-svn: 11729
2004-02-23 03:27:05 +00:00
Chris Lattner
7e90628a8a Implement cast fp -> bool
llvm-svn: 11728
2004-02-23 03:21:41 +00:00
Chris Lattner
d31caa438a Add testcase for the casts that are missing in PR249
llvm-svn: 11727
2004-02-23 03:21:09 +00:00
Chris Lattner
6590c29971 Stop passing iterators around by reference now that we have ilists!
Implement cast Type::ULongTy -> double

llvm-svn: 11726
2004-02-23 03:10:10 +00:00
Alkis Evlogimenos
887b941fbb Some code cleanups from Chris
llvm-svn: 11724
2004-02-23 01:57:39 +00:00
Alkis Evlogimenos
d42c2f24ec Fix comments in PhysRegTracker and rename isPhysRegAvail to isRegAvail to be consistent with the other two
llvm-svn: 11723
2004-02-23 01:25:05 +00:00
Chris Lattner
378157c3d7 Add a new cmove instruction
llvm-svn: 11722
2004-02-23 01:16:05 +00:00
Alkis Evlogimenos
4d7ad6713d Move LiveIntervals.h up to be the first included header
llvm-svn: 11721
2004-02-23 01:01:21 +00:00
Alkis Evlogimenos
1410859484 Pull PhysRegTracker out of RegAllocLinearScan as it can be used by other allocators as well
llvm-svn: 11720
2004-02-23 00:53:31 +00:00
Alkis Evlogimenos
486b12b71a Move LiveIntervals.h to lib/CodeGen since it shouldn't be exposed to other parts of the compiler
llvm-svn: 11719
2004-02-23 00:50:15 +00:00
Chris Lattner
cdd56634b0 Only insert FP_REG_KILL instructions in MachineBasicBlocks that actually
use FP instructions.  This reduces the number of instructions inserted in
176.gcc (for example) from 58074 to 101 (it doesn't use much FP, which
is typical).  This reduction speeds up the entire code generator.  In the
case of 176.gcc, llc went from taking 31.38s to 24.78s.  The passes that
sped up the most are the register allocator and the 2 live variable analysis
passes, which sped up 2.3, 1.3, and 1.5s respectively.  The asmprinter
pass also sped up because it doesn't print the instructions in comments :)

Note that this patch is likely to expose latent bugs in machine code passes,
because now basicblock can be empty, where they were never empty before.  I
cleaned out regalloclocal, but who knows about linscan :)

llvm-svn: 11717
2004-02-22 19:47:26 +00:00
Chris Lattner
19aef9e757 Another bug fix for empty MBB's
llvm-svn: 11716
2004-02-22 19:37:31 +00:00
Alkis Evlogimenos
8358cc573d Move MOTy::UseType enum into MachineOperand. This eliminates the
switch statements in the constructors and simplifies the
implementation of the getUseType() member function. You will have to
specify defs using MachineOperand::Def instead of MOTy::Def though
(similarly for Use and UseAndDef).

llvm-svn: 11715
2004-02-22 19:23:26 +00:00
Chris Lattner
84b406650e Fix a bug where we were implicitly assuming that there would be at least
one terminator instruction in each basic block.

llvm-svn: 11714
2004-02-22 19:08:15 +00:00
Chris Lattner
fae7564027 Reduce the number of pointless copies inserted due to constant pointer refs.
Also, make an assertion actually fireable!

llvm-svn: 11713
2004-02-22 17:35:42 +00:00
Chris Lattner
fa3ebd6ad5 Fix bug in previous checkout: leave the iterator at the first instruction
AFTER the GEP that was emitted.  :(

llvm-svn: 11712
2004-02-22 17:05:38 +00:00
Alkis Evlogimenos
cb243ab173 Fix silly bug in implementation of getUseType(). Thanks Misha.
llvm-svn: 11711
2004-02-22 07:24:19 +00:00
Chris Lattner
6536519f6e Completely rewrite how getelementptr instructions are expanded. This has two
(minor) benefits right now:

1. An extra dummy MOVrr32 is gone.  This move would often be coallesced by
   both allocators anyway.
2. The code now uses the gep_type_iterator to walk the gep, which should future
   proof it a bit.  It still assumes that array indexes are Longs though.

These don't really justify rewriting the code.  The big benefit will come later
though.

llvm-svn: 11710
2004-02-22 07:04:00 +00:00
Alkis Evlogimenos
de51c65299 When folding memory operands in machine instructions be careful to
leave register operands with the same use/def flags as the original
instruction.

llvm-svn: 11709
2004-02-22 06:54:26 +00:00
Chris Lattner
d25dfe43b9 Significantly simplify gep_type_iterator, and make its interface more general/powerful
llvm-svn: 11708
2004-02-22 06:27:03 +00:00
Chris Lattner
494d510769 Fix a soon-to-be-missing #include
llvm-svn: 11707
2004-02-22 06:26:17 +00:00
Chris Lattner
a9eddae213 Get all instruction definitions
llvm-svn: 11706
2004-02-22 06:25:38 +00:00
Chris Lattner
5fc6ae2baf Wow this is out of date. When we have _real_ code generator documentation,
this should be folded into it.

llvm-svn: 11705
2004-02-22 05:53:54 +00:00
Alkis Evlogimenos
cb352300c9 Print basic block boundaries in machine instruction debug output.
llvm-svn: 11704
2004-02-22 05:46:04 +00:00
Chris Lattner
132f6bb60f Link to most recent "LLVM document"
llvm-svn: 11703
2004-02-22 05:45:02 +00:00
Chris Lattner
8d0bacbb9e Implement Transforms/InstCombine/cast.ll:test13, a case which occurs in a
hot 164.gzip loop.

llvm-svn: 11702
2004-02-22 05:25:17 +00:00
Chris Lattner
9c08d09de6 Test that the instruction combiner can fold away a cast in a GEP instruction.
This occurs in 164.gzip, as a result of it declaring arrays extern.

llvm-svn: 11701
2004-02-22 05:24:09 +00:00
Chris Lattner
87d72eb23f The two address pass cannot handle two addr instructions where one incoming
value is a physreg and one is a virtreg.  For this reason, disable copy folding
entirely for physregs.  Also, use the new isMoveInstr target hook which gives us
folding of FP moves as well.

llvm-svn: 11700
2004-02-22 04:44:58 +00:00
Alkis Evlogimenos
d890f59f19 Abstract merging of ranges away from number of slots per instruction.
Also make it less aggressive as the current implementation breaks in
some cases.

llvm-svn: 11696
2004-02-22 04:05:13 +00:00
Chris Lattner
a376aae246 Use isNull instead of getNode() to test for existence of a node, this is cheaper.
FIX MAJOR BUG, whereby we didn't merge null edges correctly. Correcting this
fixes poolallocation on 175.vpr, and possibly others.

llvm-svn: 11695
2004-02-22 00:53:54 +00:00
Chris Lattner
f3e2a6360c Fix an iterator invalidation problem which was causing some nodes to not be
correctly merged over!

llvm-svn: 11693
2004-02-21 22:28:26 +00:00
Chris Lattner
eeb69197bf Use handy method
llvm-svn: 11692
2004-02-21 22:27:31 +00:00
Chris Lattner
6983f46792 Update comments and add warning
llvm-svn: 11691
2004-02-21 22:27:20 +00:00
Misha Brukman
0025f1b044 `cat' is usually in /bin, not /usr/bin, at least on our systems.
llvm-svn: 11690
2004-02-21 21:51:41 +00:00
Chris Lattner
375e3a1d4a When printing a stack trace, demangle it if possible. Since we are potentially
in a signal handler, allocating memory or doing other unsafe things is bad,
which means we should do it in a different process.

llvm-svn: 11689
2004-02-21 21:06:19 +00:00
Alkis Evlogimenos
334114bdf1 Make 'fold' statistic's description the same in both allocators.
llvm-svn: 11687
2004-02-21 18:07:33 +00:00
Chris Lattner
ab66f3d143 Instead of cloning the globals for main into the globals graph at the end of
BU propagation, clone the globals into the GG of EACH FUNCTION that finishes
processing!  The GlobalsGraph *must* include all globals and effects from
all functions in the program.  Fixing this makes pool allocation work better
on 175.vpr, but it still ultimately crashes.

llvm-svn: 11686
2004-02-21 00:30:28 +00:00
Chris Lattner
6a4e39677e There is no need to merge the globals graph into the function graphs at the
end of the BU and CBU passes.  The globals will be marked incomplete, so it
doesn't matter if they are missing some info, and merging isn't guaranteed
to bring everything in anyway!

llvm-svn: 11684
2004-02-20 23:52:15 +00:00
Chris Lattner
7b0368ee16 Add two missing returns, which caused us to be very pessimistic about the
printf and scanf families!

llvm-svn: 11683
2004-02-20 23:27:09 +00:00
Chris Lattner
418b3a0f20 new testcase
llvm-svn: 11682
2004-02-20 23:05:43 +00:00
John Criswell
4a5b21523e Added the POVRAY_ROOT to locate Povray.
llvm-svn: 11681
2004-02-20 22:30:46 +00:00
John Criswell
acbd6572fd Added an option for configuring Povray. By default, it should find my local
installation of Povray (and not do anything for people who don't have it).

llvm-svn: 11680
2004-02-20 22:30:22 +00:00
John Criswell
81c8f2c42a Build an archive for use with Povray.
llvm-svn: 11678
2004-02-20 21:26:46 +00:00
Alkis Evlogimenos
6ad63f8da2 Some more statistics improvements.
llvm-svn: 11676
2004-02-20 20:53:26 +00:00
Alkis Evlogimenos
71751de25c Disambiguate statistic descriptions.
llvm-svn: 11675
2004-02-20 20:46:49 +00:00
Alkis Evlogimenos
f3e77fb7a7 Rename statistic and add another one.
llvm-svn: 11674
2004-02-20 20:43:08 +00:00
Chris Lattner
a061c3b25b Add support for some string functions, the scanf family, and sprintf
llvm-svn: 11673
2004-02-20 20:27:11 +00:00
Chris Lattner
33f9071aae Add a simple implementation of strncpy
llvm-svn: 11672
2004-02-20 20:15:47 +00:00
Chris Lattner
bc7a60ffe5 New testcase, do not emit a call to __builtin_sqrt, emit a call to sqrt instead!
llvm-svn: 11668
2004-02-20 19:08:12 +00:00
Chris Lattner
bd086418ed Bug fixed
llvm-svn: 11662
2004-02-20 17:41:35 +00:00
Chris Lattner
40a22000e4 PR244: [llvm-gcc] miscompilation when a function is re-declared as static
llvm-svn: 11661
2004-02-20 17:32:24 +00:00
Brian Gaeke
efe8a37506 Add checks for <execinfo.h> and backtrace().
llvm-svn: 11660
2004-02-20 06:41:59 +00:00
Alkis Evlogimenos
22de21ea80 Fix crash in debug output.
llvm-svn: 11659
2004-02-20 06:41:12 +00:00
Brian Gaeke
99983d569e Use backtrace() and include execinfo.h, if they were detected by autoconf.
llvm-svn: 11658
2004-02-20 06:40:59 +00:00
Brian Gaeke
3056626e7b Regenerated using autoheader-2.57.
llvm-svn: 11657
2004-02-20 06:40:58 +00:00
Brian Gaeke
6afc698fe9 Regenerated using autoconf-2.57.
llvm-svn: 11656
2004-02-20 06:40:57 +00:00
Alkis Evlogimenos
bcc99a83ee Fix instruction numbering in debug output.
llvm-svn: 11655
2004-02-20 06:29:51 +00:00
Alkis Evlogimenos
76eca062ea Too many changes in one commit:
1. LiveIntervals now implement a 4 slot per instruction model. Load,
   Use, Def and a Store slot. This is required in order to correctly
   represent caller saved register clobbering on function calls,
   register reuse in the same instruction (def resues last use) and
   also spill code added later by the allocator. The previous
   representation (2 slots per instruction) was insufficient and as a
   result was causing subtle bugs.

2. Fixes in spill code generation. This was the major cause of
   failures in the test suite.

3. Linear scan now has core support for folding memory operands. This
   is untested and not enabled (the live interval update function does
   not attempt to fold loads/stores in instructions).

4. Lots of improvements in the debugging output of both live intervals
   and linear scan. Give it a try... it is beautiful :-)

In summary the above fixes all the issues with the recent reserved
register elimination changes and get the allocator very close to the
next big step: folding memory operands.

llvm-svn: 11654
2004-02-20 06:15:40 +00:00
Chris Lattner
3aee2f04d9 If bugpoint can't match the reference output, at LEAST provide the output
we can get.

llvm-svn: 11653
2004-02-20 06:12:58 +00:00
Chris Lattner
f44220efcf Wild and passionate uncontrolled goose chases are amusing to watch, but not
very helpful.  Let bugpoint favor being helpful instead of determined.

llvm-svn: 11652
2004-02-20 05:58:58 +00:00
Chris Lattner
f98cc27056 Format a bit more nicely
llvm-svn: 11651
2004-02-20 05:56:48 +00:00
Chris Lattner
73ffc88a8b 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
74b387dea1 Add strndup
llvm-svn: 11638
2004-02-19 21:44:41 +00:00
Chris Lattner
a7350c53d2 Add a method useful for updating DSA
llvm-svn: 11636
2004-02-19 21:27:50 +00:00
Chris Lattner
79b88a7590 Disable the stack trace thing until we can get an autoconf test for it. This
call breaks on sparcs

llvm-svn: 11635
2004-02-19 21:21:23 +00:00
Chris Lattner
56bfdecbdf Make sure to print a stack trace whenever an error signal is delivered
to the tool.

llvm-svn: 11634
2004-02-19 20:33:00 +00:00
Chris Lattner
69e896bdcf Make sure to print a stack trace whenever an error signal is delivered to
the tool.

llvm-svn: 11633
2004-02-19 20:32:39 +00:00
Chris Lattner
12439ffbac Make sure to print a stack trace whenever an error signal is delivered to the
tool.

llvm-svn: 11632
2004-02-19 20:32:12 +00:00
Chris Lattner
b0bedfa4b2 Implement new function
llvm-svn: 11631
2004-02-19 20:03:14 +00:00
Chris Lattner
c62ce162ff Add a new function
llvm-svn: 11630
2004-02-19 20:03:08 +00:00
Alkis Evlogimenos
3cf546037e Fix RA::verifyAssignment()
llvm-svn: 11629
2004-02-19 19:24:17 +00:00
Chris Lattner
f5c5e1f458 Fix problem fusing spill code into instructions: we didn't update the live
variable information to take into account the change of instruction
address.

llvm-svn: 11628
2004-02-19 18:34:02 +00:00
Chris Lattner
4c988391e1 Fix an iterator invalidation problem. :(
llvm-svn: 11627
2004-02-19 18:32:29 +00:00
Chris Lattner
bef87a990a ADd a method for when an instruction moves
llvm-svn: 11626
2004-02-19 18:28:22 +00:00
Chris Lattner
afa9d7eb85 Add method to update livevar when an instruction moves
llvm-svn: 11625
2004-02-19 18:28:02 +00:00
Chris Lattner
5e9868a77b Be a bit more robust. Explicitly check for a code generator crash.
llvm-svn: 11624
2004-02-19 17:03:49 +00:00
Chris Lattner
63f41abfe6 Fix a __LONG__ term annoyance of mine: symbolic registers weren't being printed
by operator<< on MachineInstr's, and looking up what register "24" is all of the
time was greatly annoying.

llvm-svn: 11623
2004-02-19 16:17:08 +00:00
Chris Lattner
d23a882f2f Add a MachineBasicBlock::getParent() method
llvm-svn: 11622
2004-02-19 16:13:54 +00:00
Alkis Evlogimenos
3562c2dd9f Make ToolExecutionError inherit std::exception and implement its
interface: getMessage() is gone, use what() instead.

llvm-svn: 11621
2004-02-19 07:39:26 +00:00
Alkis Evlogimenos
c94edd6cde Print stacktrace in STDERR before dying on a fatal signal. Currently
the symbols are not demangled.

llvm-svn: 11620
2004-02-19 07:36:35 +00:00
Alkis Evlogimenos
d0a60b71fc Rename reloads/spills to loads/stores.
llvm-svn: 11619
2004-02-19 06:19:09 +00:00
Alkis Evlogimenos
28b0468785 This is needed by assignment verification in linear-scan.
llvm-svn: 11618
2004-02-19 01:10:55 +00:00
Chris Lattner
94b2bfb447 Fix the "horribly N^2'd" problem when deleting individual instructions.
llvm-svn: 11617
2004-02-18 23:59:11 +00:00
Chris Lattner
5f015c709c Document the code generator debugger.
llvm-svn: 11616
2004-02-18 23:30:21 +00:00
Chris Lattner
4d885d9dcc document the -march=c option
llvm-svn: 11615
2004-02-18 23:30:02 +00:00
Chris Lattner
8bda4c4901 * Predicate the optimizer crash debugger on a function.
* Implement a new code generator crash debugger which uses this predicate

llvm-svn: 11614
2004-02-18 23:26:28 +00:00
Chris Lattner
96d41dd438 Add a new method for use by the code generator crash debugger.
llvm-svn: 11613
2004-02-18 23:25:22 +00:00
Chris Lattner
36d48a3728 Don't crash if there are no passes in the PassesToRun list
llvm-svn: 11612
2004-02-18 23:24:56 +00:00
Chris Lattner
8d05ebc2f9 Add support for just running the code generator
llvm-svn: 11611
2004-02-18 23:24:41 +00:00
Chris Lattner
5e76384093 Add support for just compiling a program
llvm-svn: 11610
2004-02-18 23:24:29 +00:00
Alkis Evlogimenos
b490a12501 Implement assignment correctness verification.
llvm-svn: 11609
2004-02-18 23:15:23 +00:00
Alkis Evlogimenos
671f1c87df Move unused typedefs in private section. Add method to return interval
given a register.

llvm-svn: 11608
2004-02-18 23:14:52 +00:00
Chris Lattner
1f80a927d4 Make the executeProgram method exception safe, not leaving around bytecode
files.

llvm-svn: 11607
2004-02-18 22:01:21 +00:00
Chris Lattner
b943b6b019 Make more stuff public. Make the instruction argument to
deleteInstructionFromProgram be const

llvm-svn: 11606
2004-02-18 21:50:26 +00:00
Chris Lattner
2fd76cfb69 make a bunch of methods public
llvm-svn: 11605
2004-02-18 21:35:28 +00:00
Chris Lattner
1942f98d80 A couple of minor cleanups: don't forward declare private classes, put private
classes in an anon namespace

llvm-svn: 11604
2004-02-18 21:29:46 +00:00
Chris Lattner
327019b495 Cleanup and simplify manipulation of the program, eliminate the need for so
many 'friends' of bugdriver.

llvm-svn: 11603
2004-02-18 21:24:48 +00:00
Chris Lattner
ead1dff00b Add a stub for debugging code generator crashes
llvm-svn: 11602
2004-02-18 21:02:04 +00:00
Chris Lattner
03d993b265 indent correctly
llvm-svn: 11601
2004-02-18 20:58:00 +00:00
Chris Lattner
abcd97dcd8 Don't yell. BUGPOINT should yell, not the tool runner :)
llvm-svn: 11600
2004-02-18 20:57:38 +00:00
Chris Lattner
898de4a158 Update comments, if we are running with the CBE, make sure the Interpreter
variable and the CBE variable are pointer equal.

llvm-svn: 11599
2004-02-18 20:52:02 +00:00
Chris Lattner
3c10196aab Byebye method
llvm-svn: 11598
2004-02-18 20:38:12 +00:00
Chris Lattner
3163a98492 If there is an error running a tool, include the error message (e.g. assertion failure) in the exception
llvm-svn: 11597
2004-02-18 20:38:00 +00:00
Chris Lattner
d8f6fbb690 Add a label for the bump when we started counting llvm/projects
llvm-svn: 11596
2004-02-18 20:27:06 +00:00
Chris Lattner
61dc9419e0 ctor arguments changed order
llvm-svn: 11595
2004-02-18 20:22:25 +00:00
Chris Lattner
947143df0e Catch exception and print message as appropriate
llvm-svn: 11594
2004-02-18 20:22:11 +00:00
Chris Lattner
08180ecfcf When an error occurs executing a tool, we now throw an exception instead
of calling exit(1).

llvm-svn: 11593
2004-02-18 20:21:57 +00:00
Chris Lattner
cc09204840 Change the order of the arguments to the ctor, allowing us to make the boolean default to true
llvm-svn: 11592
2004-02-18 20:20:52 +00:00
John Criswell
d504600b5f Pre-emptive commit of cfrac license information.
llvm-svn: 11588
2004-02-18 20:00:05 +00:00
Chris Lattner
eb89dbada8 Bugpoint will be throwing exceptions soon, perpare for the worst.
llvm-svn: 11584
2004-02-18 17:32:54 +00:00
Chris Lattner
d69c7bdc74 This class got moved to FileUtilities.h
llvm-svn: 11583
2004-02-18 17:17:10 +00:00
Chris Lattner
2bcf9410de Move a helper class out of bugpoint to here.
llvm-svn: 11582
2004-02-18 17:16:17 +00:00
Chris Lattner
7f059ebd78 Extract has new options
llvm-svn: 11581
2004-02-18 16:55:29 +00:00
Chris Lattner
3b203f56bc Give extract -o and -f options, just like every other tool!
llvm-svn: 11580
2004-02-18 16:53:59 +00:00
Chris Lattner
ab920f2dc7 eliminate a pair of really inefficient methods now that noone uses them
llvm-svn: 11579
2004-02-18 16:45:22 +00:00
Chris Lattner
83398e5574 Eliminate operator[] is deprecated warnings
llvm-svn: 11578
2004-02-18 16:43:51 +00:00
Chris Lattner
e99a833c20 Fix deprecated operator[] warnings
llvm-svn: 11577
2004-02-18 16:38:18 +00:00
Alkis Evlogimenos
6401b22fc2 Fix argument size for MOVSX and MOVZX instructions.
llvm-svn: 11576
2004-02-18 16:20:40 +00:00
Alkis Evlogimenos
7bef0eafc0 Be more agressive when joining ranges.
llvm-svn: 11575
2004-02-18 04:38:37 +00:00
Alkis Evlogimenos
739e5e33d7 Fix overly conservative spill interval computation.
llvm-svn: 11574
2004-02-18 03:35:38 +00:00
Alkis Evlogimenos
26583db8b6 Beautify debug output.
llvm-svn: 11573
2004-02-18 00:35:06 +00:00
John Criswell
30f7be686e Added the Malloc perl benchmark license information.
Corrected the GhostScript license information.

llvm-svn: 11571
2004-02-17 22:58:41 +00:00
Chris Lattner
be1c300a0f Bug fixed
llvm-svn: 11567
2004-02-17 22:00:39 +00:00
Chris Lattner
c8cc3d510a New testcase for PR245
llvm-svn: 11566
2004-02-17 21:58:29 +00:00
Chris Lattner
693e393fee Fix PR245: Linking weak and strong global variables is dependent on link order
llvm-svn: 11565
2004-02-17 21:56:04 +00:00
Chris Lattner
2a6802ff41 When we complete the bottom-up pass, make sure to merge the globals in 'main' into
the globals graph.

llvm-svn: 11562
2004-02-17 19:06:47 +00:00
Chris Lattner
2b6d3c87a8 Since tail duplication is currently neutered, we have to help the optimizer to remove the overhead of __main
llvm-svn: 11561
2004-02-17 18:45:06 +00:00
Chris Lattner
30e73e3442 Add support for GlobalAddress's for alkis
llvm-svn: 11560
2004-02-17 18:23:55 +00:00
Alkis Evlogimenos
47ea17a852 These store to memory too.
llvm-svn: 11558
2004-02-17 17:53:48 +00:00
Chris Lattner
3d894dd3ab Remove the -disable-kill option. The register allocator is buggy with it,
and it was only for debugging in the first place.

llvm-svn: 11557
2004-02-17 17:49:10 +00:00
Chris Lattner
49794be442 These store to memory, not read from it.
llvm-svn: 11556
2004-02-17 17:46:50 +00:00
John Criswell
3839e8e9df Added espresso.
llvm-svn: 11555
2004-02-17 17:07:52 +00:00
Alkis Evlogimenos
cf7b9392ea Instructiosn with 1 memory operand have 4 operands in our
representation.. duh!

llvm-svn: 11554
2004-02-17 15:58:13 +00:00
Alkis Evlogimenos
f90da5f346 Align case statements.
llvm-svn: 11552
2004-02-17 15:50:41 +00:00
Alkis Evlogimenos
546513ccfd Add TEST and XCHG memory operand support.
llvm-svn: 11550
2004-02-17 15:48:42 +00:00
Alkis Evlogimenos
f08064b714 Add OR and XOR memory operand support.
llvm-svn: 11549
2004-02-17 15:33:14 +00:00
Alkis Evlogimenos
65a5ee86ba Peephole optimize SUBmi{16,32} into SUBmi{16,32}b when immediate is 8
bits wide.

llvm-svn: 11548
2004-02-17 15:14:29 +00:00
Alkis Evlogimenos
e9583082a6 ADDmi{16,32} should be in the next case statement.
llvm-svn: 11547
2004-02-17 15:10:11 +00:00
Alkis Evlogimenos
e5585328d8 Add memory operand folding support for MUL, DIV, IDIV, NEG, NOT,
MOVSX, and MOVZX.

llvm-svn: 11546
2004-02-17 09:14:23 +00:00
Alkis Evlogimenos
93398df103 Add memory operand folding for CMP{rm,mr,mi}{8,16,32}, INCm{8,16,32}
and DECm{8,16,32} instructions.

llvm-svn: 11545
2004-02-17 08:49:20 +00:00
Alkis Evlogimenos
574c7c9ce9 Add CMP{rm,mr,mi}{8,16,32}, INCm{8,16,32} and DECm{8,16,32} instructions.
llvm-svn: 11544
2004-02-17 08:49:00 +00:00
Alkis Evlogimenos
d5ce14ddd1 Add SUB{rm,mr,mi}{8,16,32} instructions.
llvm-svn: 11543
2004-02-17 08:17:40 +00:00
Chris Lattner
4e21b2352c Add support to the local allocator for fusing spill code into the instructions
that need them.  This is very useful on CISCy targets like the X86 because it
reduces the total spill pressure, and makes better use of it's (large)
instruction set.  Though the X86 backend doesn't know how to rewrite many
instructions yet, this already makes a substantial difference on 176.gcc for
example:

Before:
Time:
   8.0099 ( 31.2%)   0.0100 ( 12.5%)   8.0199 ( 31.2%)   7.7186 ( 30.0%)  Local Register Allocator

Code quality:
734559 asm-printer           - Number of machine instrs printed
111395 ra-local              - Number of registers reloaded
 79902 ra-local              - Number of registers spilled
231554 x86-peephole          - Number of peephole optimization performed

After:
Time:
   7.8700 ( 30.6%)   0.0099 ( 19.9%)   7.8800 ( 30.6%)   7.7892 ( 30.2%)  Local Register Allocator
Code quality:
733083 asm-printer           - Number of machine instrs printed
  2379 ra-local              - Number of reloads fused into instructions
109046 ra-local              - Number of registers reloaded
 79881 ra-local              - Number of registers spilled
230658 x86-peephole          - Number of peephole optimization performed

So by fusing 2300 instructions, we reduced the  static number of instructions
by 1500, and reduces the number of peepholes (and thus the work) by about 900.
This also clearly reduces the number of reload/spill instructions that are
emitted.

llvm-svn: 11542
2004-02-17 08:09:40 +00:00
Alkis Evlogimenos
7f615d7e9a Add support for folding memory operands for ADC, SBB and SUB instructions.
llvm-svn: 11541
2004-02-17 08:08:51 +00:00
Alkis Evlogimenos
b591e5de31 Add support for ADC{rm.mr}32 and SBB{rm,mr}32.
llvm-svn: 11540
2004-02-17 08:06:31 +00:00
Chris Lattner
7ef6d2fd0e Add a (hidden) option to print instructions that fail to fuse. It's looking
like compares and test's would be the next huge win...

llvm-svn: 11539
2004-02-17 08:03:47 +00:00
Alkis Evlogimenos
6974f4758a Add support for folding memory operands in MOVri{8,16,32} instructions.
llvm-svn: 11538
2004-02-17 07:47:20 +00:00
Chris Lattner
c07eeaef6b Expand the repertoire of the forms we can print and encode.
llvm-svn: 11537
2004-02-17 07:40:44 +00:00
Chris Lattner
a9363fda17 Disable this peephole for now. We can't keep track of the fact that the immediate is 8 bits,
but the memory reference is full sized.

llvm-svn: 11536
2004-02-17 07:36:32 +00:00
Chris Lattner
d1289d0fcd Fix a bug in my previous refactoring change... arg!
llvm-svn: 11535
2004-02-17 07:02:17 +00:00
Chris Lattner
6e540af8f7 The CBE is now in llc, not llvm-dis
llvm-svn: 11534
2004-02-17 06:40:51 +00:00
Chris Lattner
70d42f6765 The C backend is no longer in llvm-dis, it's in llc
llvm-svn: 11533
2004-02-17 06:40:06 +00:00
Chris Lattner
9093e9b2a1 The CBE is no longer in llvm-dis
llvm-svn: 11532
2004-02-17 06:39:48 +00:00
Chris Lattner
ca8f1c2716 Add an option to disable spill fusing in the X86 backend
llvm-svn: 11531
2004-02-17 06:30:34 +00:00
Chris Lattner
3abcdf3b90 Fix the mneumonics for the mov instructions to have the source and destination
order in the correct sense!! Arg!

llvm-svn: 11530
2004-02-17 06:28:19 +00:00
Chris Lattner
ebd90733b0 Fix the last crimes against nature that used the 'ir' ordering to use the
'ri' ordering instead... no it's not possible to store a register into an
immediate!

llvm-svn: 11529
2004-02-17 06:24:02 +00:00
Chris Lattner
9990476875 GRRR. Move instructions have swapped the order of the r/m operands.
llvm-svn: 11528
2004-02-17 06:20:20 +00:00
Chris Lattner
288e043e1b Rename MOVi[mr] instructions to MOV[rm]i
llvm-svn: 11527
2004-02-17 06:16:44 +00:00
Chris Lattner
4c241855e6 Whoops, got my cases swapped.
llvm-svn: 11526
2004-02-17 06:02:15 +00:00
Chris Lattner
01dded2e69 Change to match the newer, simpler, interface
llvm-svn: 11525
2004-02-17 05:54:57 +00:00
Chris Lattner
1e70deff78 Simplify and document the new interface
llvm-svn: 11524
2004-02-17 05:54:26 +00:00
Chris Lattner
ba30c776a6 Add support for folding memory operands into AND and IMUL's
llvm-svn: 11523
2004-02-17 05:46:06 +00:00
Chris Lattner
8d6eebf0d7 Scrunchify code, by adding helpers. No functionality changes.
llvm-svn: 11522
2004-02-17 05:35:13 +00:00
Chris Lattner
c9586411cf Add mem forms of AND instructions
llvm-svn: 11521
2004-02-17 05:25:50 +00:00
Alkis Evlogimenos
4d5f42f58f Add LiveIntervals::Interval::empty() member function.
llvm-svn: 11520
2004-02-17 05:14:37 +00:00
Alkis Evlogimenos
cde4ade314 Add API to check and fold memory operands into instructions.
llvm-svn: 11519
2004-02-17 04:33:18 +00:00
Chris Lattner
818bcec247 Rename the IMULri* instructions to IMULrri, as they are actually three address
instructions.  Add forms of these instructions that read from memory

llvm-svn: 11518
2004-02-17 04:26:43 +00:00
Chris Lattner
ba9e3e2fb1 Once we have a way to fold spill code reloads into instructions, we have a way to use it. :)
llvm-svn: 11517
2004-02-17 04:08:37 +00:00
Alkis Evlogimenos
4f7c2d9e5e Fix spilled interval update. It was too conservative.
llvm-svn: 11516
2004-02-17 04:04:20 +00:00
Chris Lattner
ddedac59fe Refactor code a bit. No functionality changes, though the comment hints at things to come.
llvm-svn: 11515
2004-02-17 03:57:19 +00:00
Chris Lattner
ecc7d6e27a Adjust to recent changes
llvm-svn: 11514
2004-02-17 03:03:47 +00:00
Chris Lattner
946e46596f Add two missing pieces from last checkin
llvm-svn: 11513
2004-02-17 03:03:36 +00:00
Chris Lattner
c14686440f Rearrange code to eliminate warnings
llvm-svn: 11512
2004-02-17 02:58:36 +00:00
Alkis Evlogimenos
a5ef4a5da7 Add peephole optimizations for ADD [MEM], IMM8 instructions.
llvm-svn: 11511
2004-02-16 23:50:18 +00:00
Alkis Evlogimenos
f6ce2e313a Add two more variants of add. Update comments.
llvm-svn: 11510
2004-02-16 23:48:42 +00:00
John Criswell
6d66a493e6 Preemptive additions for the MallocBench tests.
llvm-svn: 11507
2004-02-16 23:32:26 +00:00
Chris Lattner
0cb8855a1c Only spit out warning for functions that take pointers, not for sin and the like
Add more special case handling for stdio functions.  I feel dirty, how about you?

llvm-svn: 11506
2004-02-16 22:57:19 +00:00
Chris Lattner
04b60fe5ad 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
Misha Brukman
4dd7a7245f PreSelection isn't optional and so there's no way to turn it off.
llvm-svn: 11504
2004-02-16 19:45:26 +00:00
Chris Lattner
cedfcf5bca memset and bcopy and now unified by the llvm.memset intrinsic
llvm-svn: 11503
2004-02-16 18:37:40 +00:00
Chris Lattner
544c9781db Add some ADD instructions that take memory operands for Alkis
llvm-svn: 11502
2004-02-16 18:19:31 +00:00
John Criswell
62c832c68c Adjusted the default pathname to the SPEC95 benchmarks. The new directory
has source code corrections and some input files pre-filtered for use
with the LLVM test suite.

llvm-svn: 11498
2004-02-16 14:55:18 +00:00
Alkis Evlogimenos
14f3fe81c6 Add LeakDetection to MachineInstr.
Move out of line member functions of MachineBasicBlock to
MachineBasicBlock.cpp.

llvm-svn: 11497
2004-02-16 07:17:43 +00:00
Chris Lattner
e42732e75f Implement test/Regression/Transforms/SimplifyCFG/UncondBranchToReturn.ll,
see the testcase for the reasoning.

llvm-svn: 11496
2004-02-16 06:35:48 +00:00
Chris Lattner
58d4db3f27 New testcase, details in the comments
llvm-svn: 11495
2004-02-16 06:35:19 +00:00
Chris Lattner
4db2d22bea Fold PHI nodes of constants which are only used by a single cast. This implements
phi.ll:test4

llvm-svn: 11494
2004-02-16 05:07:08 +00:00
Chris Lattner
e9613be389 A new testcase for a situation that occurs in 181.mcf
llvm-svn: 11493
2004-02-16 05:06:36 +00:00
Chris Lattner
b36d908f7b Teach LLVM to unravel the "swap idiom". This implements:
Regression/Transforms/InstCombine/xor.ll:test20

llvm-svn: 11492
2004-02-16 03:54:20 +00:00
Chris Lattner
98c26a7842 Add a test for the "swap idiom", which LLVM should be able to unravel.
llvm-svn: 11491
2004-02-16 03:53:44 +00:00
Chris Lattner
c207635fd5 Implement Transforms/InstCombine/xor.ll:test19
llvm-svn: 11490
2004-02-16 01:20:27 +00:00
Chris Lattner
5c063c9348 Test for xor chains
llvm-svn: 11489
2004-02-16 01:19:52 +00:00
Chris Lattner
5f25fb0dd7 Fix a bug in the recent rewrite of the leakdetector that caused all of the
nightly tests to be really messed up.  The problem was that the new leakdetector
was depending on undefined behavior: the order of destruction of static objects.

llvm-svn: 11488
2004-02-15 23:33:48 +00:00
Chris Lattner
aebc66a1ef Document bug 240
llvm-svn: 11487
2004-02-15 23:09:07 +00:00
Chris Lattner
83a0044077 Moving CBE tests to test/Regression/CodeGen/CBackend
llvm-svn: 11486
2004-02-15 22:56:30 +00:00
Chris Lattner
5df6d8de9b When the user runs 'llc foo.bc -march=c', write the output to "foo.cbe.c", not
to "foo.s".

llvm-svn: 11485
2004-02-15 22:54:19 +00:00
Chris Lattner
a95bd44282 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
303ca1e509 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
d85e061575 Instead of producing calls to setjmp/longjmp, produce uses of the
llvm.setjmp/llvm.longjmp intrinsics.

llvm-svn: 11482
2004-02-15 22:24:27 +00:00
Chris Lattner
25530a12a1 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
5c49d123ad New testcase
llvm-svn: 11480
2004-02-15 22:14:46 +00:00
Alkis Evlogimenos
e27f33f00e This pass should not require phi elimination or live variable
analysis. It should only preserve them and update LiveVariables if it
already ran.

llvm-svn: 11479
2004-02-15 21:50:32 +00:00
Chris Lattner
a8d97e4e74 Finegrainify namespacification
Remove one of the operands of a two operand instruction

llvm-svn: 11478
2004-02-15 21:38:28 +00:00
Alkis Evlogimenos
bbf53937a4 Make dense maps keyed on physical registers smallerusing
MRegisterInfo::getNumRegs() instead of
MRegisterInfo::FirstVirtualRegister.

Also use MRegisterInfo::is{Physical,Virtual}Register where
appropriate.

llvm-svn: 11477
2004-02-15 21:37:17 +00:00
Alkis Evlogimenos
2c5ddd20ba Eliminate the use of spill (reserved) registers.
llvm-svn: 11476
2004-02-15 10:24:21 +00:00
Chris Lattner
8579a6fafc QOI bug fixed
llvm-svn: 11475
2004-02-15 06:00:04 +00:00
Chris Lattner
76b2ff4ded Adjustments to support the new ConstantAggregateZero class
llvm-svn: 11474
2004-02-15 05:55:15 +00:00
Chris Lattner
7bea8084e0 Add support for the new ConstantAggregateZero class
llvm-svn: 11473
2004-02-15 05:54:27 +00:00
Chris Lattner
834b1272f3 Make the JIT zero out globals with memset instead of an element at a time. This
should speed it up a bit on a lot of programs

llvm-svn: 11472
2004-02-15 05:54:06 +00:00
Chris Lattner
218eb798a2 No need to scan zero initializers. This should make DSA a bit faster.
llvm-svn: 11471
2004-02-15 05:53:42 +00:00
Chris Lattner
9fba3da879 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
2d6fca9717 finegrainify namespacification
llvm-svn: 11469
2004-02-15 05:52:36 +00:00
Chris Lattner
e9fbbc25a1 Bug fixed
llvm-svn: 11468
2004-02-15 05:47:37 +00:00
Chris Lattner
015e821279 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
37a716fa80 Remove dependence on return type of ConstantStruct::get
llvm-svn: 11466
2004-02-15 04:07:32 +00:00
Chris Lattner
c75bf528c1 Remove dependence on the return type of ConstantArray::get
llvm-svn: 11463
2004-02-15 04:05:58 +00:00
Chris Lattner
5d56c478ba 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
0836c10052 Testcase for PR205: [llvmgcc] C front-end does not emit 'zeroinitializer' when possible
llvm-svn: 11461
2004-02-15 02:19:08 +00:00
Chris Lattner
3e86e1b0f7 Test for actual support, not just for lack of crashage
llvm-svn: 11460
2004-02-15 01:21:39 +00:00
Chris Lattner
a9084948ff Implement llvm.(frame|return)address(0) correctly. They are used by the LLVM JIT, among other
applications

llvm-svn: 11459
2004-02-15 01:04:03 +00:00
Alkis Evlogimenos
636e19d4b1 Fix problem in DEBUG code. I could be pointing past the end and
dereferencing it causes an assertion error.

llvm-svn: 11458
2004-02-15 00:46:41 +00:00
Chris Lattner
d5eec5ebcf New code quality fix
llvm-svn: 11457
2004-02-15 00:23:15 +00:00
Chris Lattner
f070437543 New testcase for PR237: [x86] wierd stack/frame pointer manipulation
llvm-svn: 11456
2004-02-15 00:21:04 +00:00
Chris Lattner
43e82e1152 Fix the 'have a framepointer' case, so that the frame pointer always points
to the old saved EBP.

llvm-svn: 11455
2004-02-15 00:15:37 +00:00
Chris Lattner
1dfa97034d Allow for fixed objects to reside in the local area, and if they don't to not
clobber them by allocating other objects in the same space!

llvm-svn: 11454
2004-02-15 00:14:20 +00:00
Alkis Evlogimenos
6a35516dcc Add back machine code deleter pass until we get a MachineCode pass
that will be responsible for the creation of MachineFunctions and will
be required by all MachineFunctionPass passes.

llvm-svn: 11453
2004-02-15 00:03:15 +00:00
Alkis Evlogimenos
fccb75d91e Modularize implementation of LeakDetector into a typed template
implementation class. This makes the code simpler and allows for more
types to be added easily. It also implements caching for generic
objects (it was only available for llvm objects).

llvm-svn: 11452
2004-02-14 23:33:39 +00:00
Chris Lattner
2e4acc0a73 Add support for the 'pop' instruction
llvm-svn: 11451
2004-02-14 21:06:02 +00:00
Chris Lattner
f54cd1524d There is no reason to align the stack pointer if there are no callees of this
function!

llvm-svn: 11450
2004-02-14 20:11:07 +00:00
Chris Lattner
612ce0c47c There is no reason to align the stack pointer if there are no callees of this function!
llvm-svn: 11449
2004-02-14 20:10:59 +00:00
Chris Lattner
7dceed5ff9 The prologue/epilogue related method calls have no reason to return a value,
make them return void.

This allows us to avoid some costly MBB.size() calls

llvm-svn: 11448
2004-02-14 19:49:54 +00:00
Chris Lattner
72862f132c The prologue/epilogue related method calls have no reason to return a value,
make them return void.

llvm-svn: 11447
2004-02-14 19:49:05 +00:00
Chris Lattner
34c47d967e fix typeo
llvm-svn: 11446
2004-02-14 19:27:26 +00:00
Chris Lattner
9f75a55329 finegrainify namespacification, fix 80col prob
llvm-svn: 11445
2004-02-14 06:00:36 +00:00
Chris Lattner
0c48a03374 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
d6a39eaa70 Urg, right. These need an input value...
llvm-svn: 11443
2004-02-14 04:47:23 +00:00
Chris Lattner
2f49d5bb35 Codegen llvm.memset into rep stos[bwd]. Simplify code for llvm.memcpy
llvm-svn: 11442
2004-02-14 04:46:05 +00:00
Chris Lattner
8bed37595d add 'rep stos[bwd]' instructions
llvm-svn: 11441
2004-02-14 04:45:37 +00:00
Chris Lattner
2c0d1265dc new testcase for llvm.memset generation
llvm-svn: 11440
2004-02-14 04:26:15 +00:00
Chris Lattner
141ebb625d These should be mentioned
llvm-svn: 11439
2004-02-14 04:12:41 +00:00
Chris Lattner
3649c3aaf7 Document new intrinsics
llvm-svn: 11438
2004-02-14 04:08:35 +00:00
Chris Lattner
3646dadc6c builtin_return/frame_address now work
llvm-svn: 11437
2004-02-14 04:08:29 +00:00
Chris Lattner
451f1bca6f Testcase for builtin frame/return address
llvm-svn: 11436
2004-02-14 04:06:48 +00:00
Chris Lattner
cd947e4b8b Test that the CFE compiles memset and bzero to llvm.memset
llvm-svn: 11435
2004-02-14 03:46:37 +00:00
Chris Lattner
cf81fc70a4 Add a testcase for the frameaddress and returnaddress intrinsics.
llvm-svn: 11434
2004-02-14 02:55:47 +00:00
Chris Lattner
f7c1088a36 Add support for the returnaddress and frameaddress intrinsics
llvm-svn: 11433
2004-02-14 02:55:36 +00:00
Chris Lattner
3c4bc03c8a Test that the code generator supports these intrinsics
llvm-svn: 11432
2004-02-14 02:51:40 +00:00
Chris Lattner
dc632111bf Add llvm.memset/frameaddress/returnaddress intrinsics.
llvm-svn: 11431
2004-02-14 02:47:17 +00:00
Alkis Evlogimenos
5a92240270 Use newly added next() and prior() utility functions.
llvm-svn: 11430
2004-02-14 01:18:34 +00:00
Alkis Evlogimenos
7c6e4d5ae6 Add next() and prior() iterator utility functions. Unlike std::advance
they do not modify the passed iterator but return a copy.

next(myIt) returns copy of myIt incremented once
next(myIt, n) returns copy of myIt incremented n times
prior(myIt) returns copy of myIt decremented once
prior(myIt, n) returns copy of myIt decremented n times

While at it remove obsolete implementation of mapped_iterator.

llvm-svn: 11429
2004-02-14 01:17:28 +00:00
Chris Lattner
a9c61b33c6 Updates for the C backend's movement
llvm-svn: 11428
2004-02-14 01:07:17 +00:00
Alkis Evlogimenos
ddcb4ad53e Use std::numeric_limits<float>::infinity() instead of
std::numeric_limits<float>::max() for weighting preallocated
intervals.

llvm-svn: 11427
2004-02-14 00:44:07 +00:00
Chris Lattner
0997f207c2 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
7934640709 Add method
llvm-svn: 11425
2004-02-14 00:30:31 +00:00
Chris Lattner
77687a9746 Fix the logic in the name mangler. If there are two symbols named 'X', and one
is external, make sure to mangle the *internal* one, not external one

llvm-svn: 11424
2004-02-14 00:30:23 +00:00
Misha Brukman
7c437d3226 Break a line that's over 80cols into two.
llvm-svn: 11423
2004-02-13 23:46:47 +00:00
Chris Lattner
7b5f374a18 There is no need to emit a shift if the size is constant, which is common
llvm-svn: 11420
2004-02-13 23:36:47 +00:00
Chris Lattner
23472a5a2a Make sure to provide a prototype for the cbackend
llvm-svn: 11419
2004-02-13 23:36:03 +00:00
Chris Lattner
7b65a0008d Update tests
llvm-svn: 11418
2004-02-13 23:33:17 +00:00
Chris Lattner
768fa7d206 Moved directory, update makefile
llvm-svn: 11417
2004-02-13 23:31:12 +00:00
Chris Lattner
b24eb91e2c CBackend is no longer here
llvm-svn: 11416
2004-02-13 23:29:37 +00:00
Chris Lattner
1f9c6eb358 CBackend now lives here
llvm-svn: 11415
2004-02-13 23:29:20 +00:00
Chris Lattner
c5a4641c21 Do not advertise our -c option anymore
llvm-svn: 11413
2004-02-13 23:24:46 +00:00
Chris Lattner
92849b7dc9 Mercilessly rip the cbackend out of llvm-dis. Leave a helpful error message
for those who have not heard the news.

llvm-svn: 11412
2004-02-13 23:22:40 +00:00
Chris Lattner
c7dd48567f The cbackend has never had anything to do with llvm assembly writing
llvm-svn: 11411
2004-02-13 23:19:51 +00:00
Chris Lattner
3fba9dc096 Add support for -march=c
llvm-svn: 11410
2004-02-13 23:19:09 +00:00
Chris Lattner
0591bb5bc8 Convert the C backend into a target, for use with LLC. This allows us to use
the lowerallocations pass to eliminate malloc/free warnings and hackish code

llvm-svn: 11409
2004-02-13 23:18:48 +00:00
Chris Lattner
9fae109121 Change how we create the cwriter, and add a buttload of libraries that it now
needs.  This will be fixed shortly

llvm-svn: 11407
2004-02-13 23:01:14 +00:00
Chris Lattner
b09176a1e2 Change access to the cwriter
llvm-svn: 11406
2004-02-13 23:00:45 +00:00
Chris Lattner
d2b6e183e9 Make the cwriter use the lowerinvoke pass so that it can either use "disabled exceptions" or
"expensive exceptions" controlled by an option.  Also refactor and eliminate a bunch of cruft.
This is a temporary solution and causes millions of warnings to pour out of programs that use
exceptions, but it should fix the problem with sparc and the 'write' declaration (PR190).
Subsequent changes will make this stink much less

llvm-svn: 11405
2004-02-13 23:00:29 +00:00
Chris Lattner
067b6bb9b2 New testcase. The CFE should not generate illegal LLVM intrinsics, even if
the input program is horribly broken (like 126.gcc).

llvm-svn: 11401
2004-02-13 22:04:41 +00:00
John Criswell
3b4195f344 Added check for target machine endian-ness and put the result into
Makefile.config (ENDIAN variable is set to big or little).

llvm-svn: 11398
2004-02-13 21:57:29 +00:00
Chris Lattner
d17e15eddd Add support for a bunch more functions
llvm-svn: 11395
2004-02-13 21:21:48 +00:00
Alkis Evlogimenos
8cdd0215bf Remove getAllocatedRegNum(). Use getReg() instead.
llvm-svn: 11393
2004-02-13 21:01:20 +00:00
Alkis Evlogimenos
ef9d025ebe Mark MachineBasicBlock::operator[] deprecated.
llvm-svn: 11392
2004-02-13 20:05:56 +00:00
Alkis Evlogimenos
1aa50dfae5 Define DEPRECATED so that it can be used in function and variable
declarations.

llvm-svn: 11391
2004-02-13 20:05:44 +00:00
Chris Lattner
e00227248e Add support for fopen/fclose. Specifically with fopen, we were marking all of the
operands as incomplete, though fopen is known to only read them.  This just adds
fclose for symmetry, though it doesn't gain anything.  This makes the dsgraphs for
181.mcf much more precise.

llvm-svn: 11390
2004-02-13 20:05:32 +00:00
Alkis Evlogimenos
de6a381691 Use getNumVirtualRegs().
Whitespace cleanups.

llvm-svn: 11389
2004-02-13 18:20:47 +00:00
Alkis Evlogimenos
0e98a0638e Add getNumVirtualRegs().
Whitespace cleanups.

llvm-svn: 11388
2004-02-13 18:07:06 +00:00
Chris Lattner
963f273734 Bug fixed
llvm-svn: 11385
2004-02-13 17:03:01 +00:00
Chris Lattner
283ffdfac5 Fix compilation of 126.gcc: intrinsic functions cannot throw, so they are not
allowed in invoke instructions.  Thus, if we are inlining a call to an intrinsic
function into an invoke site, we don't need to turn the call into an invoke!

llvm-svn: 11384
2004-02-13 16:47:35 +00:00
Chris Lattner
7db49ce5b4 Intrinsic functions cannot throw
llvm-svn: 11383
2004-02-13 16:46:46 +00:00
John Criswell
d6687b9b82 Updated to list all code/directories that have additional or alternate
licensing information.

Also added note to indicate that warrany disclaimer and the no-endorsement
clause applies to everything.

llvm-svn: 11382
2004-02-13 16:46:05 +00:00
Chris Lattner
c68c6a6e62 Bug fix
llvm-svn: 11381
2004-02-13 16:40:24 +00:00
Chris Lattner
564251ed5e exit(1) instead of abort()'ing on error
llvm-svn: 11380
2004-02-13 16:37:43 +00:00
Chris Lattner
a80e9f0a19 Fix buggy error message problem
llvm-svn: 11379
2004-02-13 16:33:56 +00:00
Misha Brukman
29cb68f761 Fix spelling of `tendency'.
llvm-svn: 11378
2004-02-13 16:23:14 +00:00
Chris Lattner
6342e18571 Expose a pass ID for lower-invoke
llvm-svn: 11377
2004-02-13 16:16:35 +00:00
Chris Lattner
7cbb22abe6 Expose a pass ID that can be 'required'
llvm-svn: 11376
2004-02-13 16:16:16 +00:00
Chris Lattner
cbf0667743 Squish warning
llvm-svn: 11375
2004-02-13 16:14:50 +00:00
Chris Lattner
9761271f0f Restructure code to handle memcpy/memmove
llvm-svn: 11374
2004-02-13 16:09:54 +00:00
Chris Lattner
7eec19cf38 Right, memcpy READS memory too :)
llvm-svn: 11373
2004-02-13 16:09:37 +00:00
Chris Lattner
0a49bcb009 New testcase for support for memcpy/memmove
llvm-svn: 11372
2004-02-13 16:04:51 +00:00
Brian Gaeke
242ebf2523 Fix off-by-one in Interpreter::getFirstVarArg(), which was punishing
any attempts by LLI to use varargs (possibly left over from the introduction
of IntrinsicLowering??)

llvm-svn: 11370
2004-02-13 06:18:39 +00:00
Chris Lattner
337df9b905 Fine grainify namespacification, prune #includes
llvm-svn: 11369
2004-02-13 06:18:21 +00:00
Brian Gaeke
51f100753c The Interpreter was failing the AtExit UnitTest. This fixes it.
llvm-svn: 11367
2004-02-13 05:48:00 +00:00
Brian Gaeke
5feee4b251 Update the example here in the header file.
I don't know about you guys, but I rarely read the .html manuals :-)

llvm-svn: 11366
2004-02-13 04:49:04 +00:00
Brian Gaeke
bad2936826 Include <iosfwd>.
Add prototypes for MachineBasicBlock's dump() and print() methods.

llvm-svn: 11365
2004-02-13 04:40:15 +00:00
Brian Gaeke
52440fd481 Refactor MachineFunction::print() into MachineBasicBlock::print().
Add MachineBasicBlock::dump().

llvm-svn: 11364
2004-02-13 04:39:55 +00:00
Brian Gaeke
e8f7c2f863 Add head-of-file comments and Doxygen comments. Tighten up a lot of whitespace.
Rename SetMachineOperandConst's formal parameters to match other methods here.
Mark some methods as being used only by the SPARC back-end.
Fix a missing-paren bug in OutputValue().

llvm-svn: 11363
2004-02-13 04:39:32 +00:00
Chris Lattner
bb68a2209b Add support for memcpy and memmove intrinsics. Why isn't the cwriter using
the intrinsiclowering code?? :(

llvm-svn: 11362
2004-02-12 23:13:33 +00:00
Chris Lattner
0145092b3e New features
llvm-svn: 11361
2004-02-12 21:21:17 +00:00
Chris Lattner
4c67c48c42 Be a bit more specific about what the alignment value means and the restrictions on it
llvm-svn: 11360
2004-02-12 21:18:15 +00:00
Chris Lattner
a200310b32 New testcase for PR233: [llvmgcc] Structure copies result in a LOT of code
llvm-svn: 11359
2004-02-12 21:06:52 +00:00
Alkis Evlogimenos
96871385e8 Move ilist_trairs<MachineInstr> in MachineBasicBlock.
llvm-svn: 11358
2004-02-12 19:12:03 +00:00
Alkis Evlogimenos
de8ac749fe Add parent pointer to MachineInstr that points to owning
MachineBasicBlock. Also change opcode to a short and numImplicitRefs
to an unsigned char so that overall MachineInstr's size stays the
same.

llvm-svn: 11357
2004-02-12 18:49:07 +00:00
John Criswell
407f6d46d9 Fixed minor typos.
llvm-svn: 11356
2004-02-12 18:11:53 +00:00
Chris Lattner
5ed171e317 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
f30152e480 Add support for the llvm.memmove intrinsic.
Patch graciously contributed by Reid Spencer!

llvm-svn: 11354
2004-02-12 18:10:10 +00:00
Chris Lattner
e0ea5cff8a Urg, check in header I forgot. :(
llvm-svn: 11353
2004-02-12 17:57:11 +00:00
Chris Lattner
71957a90b3 Test that we get rep movs when calling memcpy
llvm-svn: 11352
2004-02-12 17:53:43 +00:00
Chris Lattner
8dc99feeaf Add support for the rep movs[bwd] instructions, and emit them when code
generating the llvm.memcpy intrinsic.

llvm-svn: 11351
2004-02-12 17:53:22 +00:00
Chris Lattner
fee11469bb Document the llvm.memcpy intrinsic. Clean up some of the formatting of other
sections

llvm-svn: 11350
2004-02-12 17:01:32 +00:00
Chris Lattner
17d028d52b Implement the llvm.memcpy intrinsic
llvm-svn: 11349
2004-02-12 17:01:09 +00:00
Chris Lattner
6a597d6057 Rename the opCode instance variable to Opcode
llvm-svn: 11348
2004-02-12 16:09:53 +00:00
Chris Lattner
a6a8372a3c Remove a dead field from MachineInstr!
llvm-svn: 11347
2004-02-12 16:05:03 +00:00
Chris Lattner
6108d9d5ee This field is never read
llvm-svn: 11346
2004-02-12 16:04:49 +00:00
Alkis Evlogimenos
537805f315 Change interface so that we can add to the end of a basic block
without getting an assertion from ilist that we are dereferencing
ilist<T>::end().

llvm-svn: 11345
2004-02-12 08:11:04 +00:00
Brian Gaeke
f0eef8ef38 Add one more doxygen comment.
llvm-svn: 11344
2004-02-12 04:26:49 +00:00
Brian Gaeke
974a21e6fb Express one of MachineOperand's many constructors in terms of another, by means of default arguments.
llvm-svn: 11343
2004-02-12 04:15:00 +00:00
Brian Gaeke
c07b64f3cb Remove this MachineOpCodeFlags assertion - its test can never be false.
llvm-svn: 11342
2004-02-12 04:01:07 +00:00
Brian Gaeke
84262c112c Remove these MachineOpCodeFlags and their accessor - they are never set.
llvm-svn: 11341
2004-02-12 04:00:55 +00:00
Alkis Evlogimenos
80da865f77 Change MachineBasicBlock's vector of MachineInstr pointers into an
ilist of MachineInstr objects. This allows constant time removal and
insertion of MachineInstr instances from anywhere in each
MachineBasicBlock. It also allows for constant time splicing of
MachineInstrs into or out of MachineBasicBlocks.

llvm-svn: 11340
2004-02-12 02:27:10 +00:00
Brian Gaeke
0c3de446f6 getOpCode() --> getOpcode().
llvm-svn: 11339
2004-02-12 01:34:05 +00:00
Brian Gaeke
84b1008c13 Remove getOpCode(). Help doxygenify some comments.
llvm-svn: 11338
2004-02-12 01:34:03 +00:00
Misha Brukman
e10e2b12dd Ooops, top-level C++-comments aren't recognized by flex.
llvm-svn: 11337
2004-02-12 00:03:08 +00:00
Misha Brukman
a01b30bbaa * Convert C comments to C++ style (why are some one way, some another?!)
* Delete extra space, extra blank comment lines
* Convert function comments to doxygen

llvm-svn: 11336
2004-02-12 00:00:46 +00:00
Brian Gaeke
b22186adf0 MachineInstr::getOpCode() --> getOpcode() in SPARC back-end.
llvm-svn: 11335
2004-02-11 20:47:34 +00:00
Chris Lattner
0302beeb09 If a node has more than 64 outgoing edges, make the edges go from the 'truncated' block,
instead of dropping them entirely.

llvm-svn: 11334
2004-02-11 20:44:17 +00:00
Brian Gaeke
3ee3e4beea Fix typos in comments.
llvm-svn: 11333
2004-02-11 19:47:43 +00:00
Chris Lattner
0d10bf8d72 s/getOpCode/getOpcode
llvm-svn: 11332
2004-02-11 19:26:28 +00:00
Chris Lattner
4b095b937e Cosmetic improvements to this option.
llvm-svn: 11331
2004-02-11 19:14:04 +00:00
Brian Gaeke
512bd8de00 Fix bug in initial check - when recompiling everything with llvm-native-gcc,
you have to erase the program and re-run the linker, too, before running the
checker.

llvm-svn: 11328
2004-02-11 18:52:05 +00:00
Brian Gaeke
bc67d59ac8 add advice bullet about -check-exit-code
llvm-svn: 11327
2004-02-11 18:44:55 +00:00
Brian Gaeke
228a29b711 add description of -check-exit-code
llvm-svn: 11326
2004-02-11 18:40:04 +00:00
Brian Gaeke
35145beb61 Add check-exit-code option, defaulting to true.
Add ProgramExitedNonzero argument to executeProgram(), and make it
tell its caller whether the program exited nonzero.

Move executeProgramWithCBE() out of line, to ExecutionDriver.cpp, and remove
its extra arguments which are always defaulted.  Make it turn off
check-exit-code if the program exits nonzero while generating a reference
output.

Make diffProgram() assume that any nonzero exit code is a failure, if
check-exit-code is turned on.

llvm-svn: 11325
2004-02-11 18:37:32 +00:00
Chris Lattner
f10f6b10f9 Actually load profiling information now! Block layout can use real, live,
actual profile info, and works!  :)

llvm-svn: 11324
2004-02-11 18:21:05 +00:00
Chris Lattner
fa9a8f83a5 Fix a typeo
llvm-svn: 11323
2004-02-11 18:20:41 +00:00
Alkis Evlogimenos
8f4142616d Increase constness.
llvm-svn: 11322
2004-02-11 17:55:09 +00:00
Chris Lattner
3cf970e27f Add an important prototype
llvm-svn: 11320
2004-02-11 06:11:06 +00:00
Chris Lattner
b8263bb809 Fix copy-and-pastos
llvm-svn: 11319
2004-02-11 06:10:18 +00:00
Chris Lattner
f7a5d9874c Add skeleton profileinfoloader pass. This will be enhanced to actually LOAD
a profile tommorow.  :)

llvm-svn: 11318
2004-02-11 06:10:05 +00:00
Alkis Evlogimenos
2f21547208 Remove assert as the only integer registers on the sparc are physical.
llvm-svn: 11317
2004-02-11 06:04:51 +00:00
Chris Lattner
1dec4a1eda Factor profile information loading OUT of llvm-prof into libanalysis
llvm-svn: 11316
2004-02-11 05:56:07 +00:00
Alkis Evlogimenos
fcb99fe370 Fix previous broken commit. A MachineOperand may have opType ==
MO_VirtualRegister but if the register number is one of a physical
register is it considered as a physical register.

llvm-svn: 11315
2004-02-11 05:55:00 +00:00
Chris Lattner
ddfc5506a7 Factor this code out of llvm-prof
llvm-svn: 11314
2004-02-11 05:54:25 +00:00
Chris Lattner
d4b36cf9bc Remove obsolete comment. Unreachable blocks will automatically be left at the
end of the function.

llvm-svn: 11313
2004-02-11 05:20:50 +00:00
Chris Lattner
d5bab7e727 Basic functionality testing.
llvm-svn: 11312
2004-02-11 05:00:27 +00:00
Chris Lattner
5add05129e Add an _embarassingly simple_ implementation of basic block layout. This is
more of a testcase for profiling information than anything that should reasonably
be used, but it's a starting point.  When I have more time I will whip this into
better shape.

llvm-svn: 11311
2004-02-11 04:53:20 +00:00
Alkis Evlogimenos
adcc14d96a Remove assert as it is meaningless. MachineOperands can be tagged as
MO_VirtualRegister but actually be representing a physical register.

llvm-svn: 11310
2004-02-11 04:52:30 +00:00
Chris Lattner
0c26f0048f Make sure to register the 'no profile' implementation as the default for ProfileInfo
llvm-svn: 11309
2004-02-11 04:47:54 +00:00
Chris Lattner
6e445dc299 Simplify implementation, and probably speed things up too.
llvm-svn: 11308
2004-02-11 03:57:16 +00:00
Chris Lattner
18d1f19fba Implement SimplifyCFG/PhiEliminate.ll
Having a proper 'select' instruction would allow the elimination of a lot
of the special case cruft in this patch, but we don't have one yet.

llvm-svn: 11307
2004-02-11 03:36:04 +00:00
Chris Lattner
4379c6b0b7 New feature testcase for simplifycfg.
llvm-svn: 11306
2004-02-11 03:35:04 +00:00
Chris Lattner
f3e6e63d71 Initialize the count instance variable.
llvm-svn: 11305
2004-02-11 03:29:16 +00:00
Chris Lattner
391e943817 Expose the "Other" value type to tablegen targets
llvm-svn: 11304
2004-02-11 03:08:45 +00:00
Chris Lattner
6926059d37 Remove long obsolete method. switch instructions are first class entities in the CFG, and have been for a LOOOONG time.
llvm-svn: 11303
2004-02-11 01:17:58 +00:00
Chris Lattner
2be4744c5e Remove obsolete method
llvm-svn: 11302
2004-02-11 01:17:33 +00:00
Chris Lattner
838b845781 The hasConstantReferences predicate always returns false.
llvm-svn: 11301
2004-02-11 01:17:07 +00:00
John Criswell
0606da9572 Updated to handle the new SPEC95 configuration options.
llvm-svn: 11298
2004-02-10 22:36:35 +00:00
John Criswell
43fc5c18f6 Added support for configuring SPEC95.
llvm-svn: 11295
2004-02-10 22:29:06 +00:00
Chris Lattner
1f4f70425d An initial implementation of an LLVM ProfileInfo class which is designed to
eventually allow Passes to use profiling information to direct them.

llvm-svn: 11294
2004-02-10 22:11:42 +00:00
Misha Brukman
5786148df5 Sprinkle liberally with comments, saute with doxygen until readable.
llvm-svn: 11293
2004-02-10 21:49:59 +00:00
Misha Brukman
303cf58800 Doxygenify comment.
llvm-svn: 11292
2004-02-10 21:48:12 +00:00
Chris Lattner
62da05d3f0 Urg, the X86 backend DOES use virtual register operands. :(
llvm-svn: 11288
2004-02-10 21:43:11 +00:00
Chris Lattner
3d33d64f46 Remove and simplify some of the bewildering collection of isFOORegister
methods which have strangely different semantics in different backends,
and noone knew what any did.

Getting rid of these ALSO allows the dependence of MachineInstr.h on
MRegisterInfo.h to be removed, which makes me much happier, and probably
alkis too.  :)

llvm-svn: 11287
2004-02-10 21:21:17 +00:00
Chris Lattner
91b2fb2cec Remove some unneeded stuff
llvm-svn: 11286
2004-02-10 21:19:49 +00:00
Chris Lattner
b21ec54e61 Add #include
llvm-svn: 11285
2004-02-10 21:18:55 +00:00
Chris Lattner
5dd5be3ec3 Do not use MachineOperand::isVirtualRegister either!
llvm-svn: 11283
2004-02-10 21:12:22 +00:00
Chris Lattner
1cb6d2697d Stop using this method
llvm-svn: 11282
2004-02-10 21:12:06 +00:00
Chris Lattner
8d0dc12c3e Remove uses of MachineOperand::isVirtualRegister
llvm-svn: 11281
2004-02-10 20:55:47 +00:00
Chris Lattner
2d5feb5e04 Remvoe use of MO.isVirtualRegister(), turn an assertion into an assert()
llvm-svn: 11280
2004-02-10 20:47:24 +00:00
Chris Lattner
0e615e6c20 Eliminate MachineOperand::isPhysicalRegister. The X86 backend should use
MRegisterInfo::isPhysicalRegister(MO.getReg()) and the Sparc backend should
use isMachineRegister()

llvm-svn: 11279
2004-02-10 20:42:11 +00:00
Chris Lattner
373fba5c1d Eliminate users of MachineOperand::isPhysicalRegister
llvm-svn: 11278
2004-02-10 20:41:10 +00:00
Chris Lattner
2aea68ccfd Remove use of isPhysicalRegister
llvm-svn: 11277
2004-02-10 20:35:42 +00:00
Chris Lattner
92252f42c3 Don't use MachineOperator::is(Phys|Virt)Register
llvm-svn: 11276
2004-02-10 20:31:28 +00:00
Chris Lattner
13d2f3bbc0 Simplify condition, this does not change the predicate at all though
llvm-svn: 11275
2004-02-10 20:30:40 +00:00
Chris Lattner
259e98ed27 Tighten up checks
llvm-svn: 11274
2004-02-10 20:25:13 +00:00
Chris Lattner
2711c12f48 Right, define the LPROF variable
llvm-svn: 11273
2004-02-10 19:46:14 +00:00
Chris Lattner
881d01f30c Make sure to copy the null terminator at the end of the argv list. Some
programs use it instead of argc.

llvm-svn: 11270
2004-02-10 19:14:44 +00:00
Misha Brukman
9a4b8f8263 * Added class comments
* Doxygenified existing comments
* Compactified code to be more consistent

llvm-svn: 11268
2004-02-10 18:44:16 +00:00
Chris Lattner
cad1501db8 Fix documentation bugs
llvm-svn: 11267
2004-02-10 18:04:24 +00:00
Chris Lattner
7069bb2cd6 Make block profiling the default
add a new -function argument
Add a new -o argument to specify where to put llvmprof.out data

llvm-svn: 11265
2004-02-10 18:01:50 +00:00
Chris Lattner
6dc79e5d31 Allow the program to take a '-llvmprof-output filename' option to specify
where to output the profiling data, if llvmprof.out is not good enough.

llvm-svn: 11264
2004-02-10 18:01:00 +00:00
Chris Lattner
3232bbb9d8 initialization calls now return argc. If the program uses the argc value
passed into main, make sure they use the return value of the init call
instead of the one passed in.

llvm-svn: 11262
2004-02-10 17:41:01 +00:00
Chris Lattner
b94ff3c67c Make the initialization calls return argc.
llvm-svn: 11261
2004-02-10 17:36:25 +00:00
Misha Brukman
78292b3e66 Doxygen-ify comments, make function prototypes more consistent in format.
llvm-svn: 11259
2004-02-10 16:39:05 +00:00
Brian Gaeke
efae456cf5 Mention install, RPM, autoconf improvements
llvm-svn: 11257
2004-02-10 05:22:23 +00:00
Chris Lattner
6b3dea2cc0 Bug fixed
llvm-svn: 11256
2004-02-10 05:19:54 +00:00
Chris Lattner
ff04d76c57 Fix PR228: [sparc] Boolean constants are emitted as true and false
I will observe that the concept of using WriteAsOperand is completely broken,
but then we all knew that, didn't we?

llvm-svn: 11255
2004-02-10 05:16:44 +00:00
Brian Gaeke
4766d0c680 RPM spec file for LLVM tools and libraries.
llvm-svn: 11254
2004-02-10 03:57:51 +00:00
Brian Gaeke
c6d8be1137 Should fix pr220 - "make install" doesn't install header files when
BUILD_SRC_ROOT != BUILD_OBJ_ROOT

llvm-svn: 11253
2004-02-10 01:10:01 +00:00
Misha Brukman
7f7a842bd6 Doxygenify comments.
llvm-svn: 11252
2004-02-09 23:18:42 +00:00
Chris Lattner
a52b206d91 Move this testcase out of /home/vadve/lattner/cvs/llvm/test/Programs/LLVMSource,
as it fails.

llvm-svn: 11250
2004-02-09 22:52:25 +00:00
Chris Lattner
37d46f4815 Only add the global variable with the abort message if an unwind actually
occurs in the program.

llvm-svn: 11249
2004-02-09 22:48:47 +00:00
Alkis Evlogimenos
56258ab1a2 Add global methods that prevent us from using ilist::iterators as
random access iterators.

llvm-svn: 11248
2004-02-09 22:40:50 +00:00
John Criswell
4dc5478fbc Fix PR#226: When emitting padding, always emit it as bytes. Bytes can be
placed into any alignment situation.

llvm-svn: 11247
2004-02-09 22:15:33 +00:00
Chris Lattner
24fa566960 Many things have been fixed, so move them out of the "known problems" section
Also, PR137 is a code quality PR, not a bug

llvm-svn: 11246
2004-02-09 21:22:51 +00:00
Chris Lattner
805e5e7e52 QOI bug fixed
llvm-svn: 11245
2004-02-09 21:16:16 +00:00
Chris Lattner
7289e62874 It turns out that the two dimensional vectors were causing big slowdowns
in this for programs with lots of types (like the testcase in PR224).
The problem was that the type ID that the outer vector was using was not
very dense (as many types are getting resolved), so the vector is large
and gets reallocated a lot.

Since there are a lot of values in the program (the .ll file is 10M),
each reallocation has to copy the subvectors, which is also quite slow
(this wouldn't be a problem if C++ supported move semantics, but it
doesn't, at least not yet :(

Changing the outer data structure to a map speeds a release build of
llvm-as up from 11.21s to 5.13s on the testcase in PR224.

llvm-svn: 11244
2004-02-09 21:03:38 +00:00
Chris Lattner
54b582f11d Remove the statistics
llvm-svn: 11243
2004-02-09 21:01:23 +00:00
Chris Lattner
478fac37e4 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
edd4500cf0 When resolving upreferences, if multiple uprefs will be resolved to the same
type at the same time, resolve the upreferences to each other before resolving
it to the outer type.  This shaves off some time from the testcase in PR224, from
25.41s -> 21.72s.

llvm-svn: 11241
2004-02-09 18:53:54 +00:00
Brian Gaeke
0df4298547 SchedGraph doesn't need to be friends with SchedGraphNodeCommon anymore.
llvm-svn: 11240
2004-02-09 18:43:06 +00:00
Brian Gaeke
2e1cbb735d Move InstrSchedule's iterator begin/end methods inline.
llvm-svn: 11239
2004-02-09 18:42:46 +00:00
Brian Gaeke
312e3a28d2 Make SchedGraph::dump() use SchedGraphNodeCommon's const_iterator
instead of randomly groping about inside its outEdges array.
Make SchedGraph::addDummyEdges() use getNumOutEdges() instead of
outEdges.size().
Get rid of ifdefed-out code in SchedGraph::buildGraph().

llvm-svn: 11238
2004-02-09 18:42:05 +00:00
Chris Lattner
aedce9d6b1 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
Brian Gaeke
12705d56ef Fix bug in installation process: MKDIR must respect DESTDIR.
llvm-svn: 11236
2004-02-09 17:38:52 +00:00
Chris Lattner
e33ddf57f6 This debugging hook is no longer needed.
llvm-svn: 11233
2004-02-09 17:20:52 +00:00
Chris Lattner
eecaba0c33 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
cbd34b2ae6 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
e3af6f73ce Don't depend on auto data conversion
llvm-svn: 11229
2004-02-09 05:16:30 +00:00
Chris Lattner
ac6db755c3 Adjust to the changed StructType interface. In particular, getElementTypes() is gone.
llvm-svn: 11228
2004-02-09 04:37:31 +00:00
Chris Lattner
4da68e2d7b Increase encapsulation of the StructType class, eliminating the getElementTypes() member
llvm-svn: 11227
2004-02-09 04:36:50 +00:00
Chris Lattner
66aef96171 Method is gone
llvm-svn: 11226
2004-02-09 04:14:46 +00:00
Chris Lattner
fa829be4d3 Start using the new and improve interface to FunctionType arguments
llvm-svn: 11224
2004-02-09 04:14:01 +00:00
Chris Lattner
f5a4e33e49 Improve encapsulation in the FunctionType class, by adding param_(iterator/begin/end)
members, and eliminating the getParamTypes() method, and the associated typedef.

llvm-svn: 11223
2004-02-09 04:12:57 +00:00
Chris Lattner
a9634a0ee3 This #include is not needed, it should have been removed with the last patch
llvm-svn: 11222
2004-02-09 03:22:32 +00:00
Chris Lattner
3cb4167b26 Instead of searching the entire type graph for a type to determine if it
contains the type we are looking for, just search the immediately used types.
We can only do this because we keep the "current" type in the nesting level
as we decrement upreferences.

This change speeds up the testcase in PR224 from 50.4s to 22.08s, not
too shabby.

llvm-svn: 11221
2004-02-09 03:19:29 +00:00
Chris Lattner
a263b85fe6 Upreferences are always OpaqueTypes, meaning that it is impossible for a non-abstract
type from containing one.  This speeds up the asmparser on the testcase in PR224 from
61->50s.

llvm-svn: 11220
2004-02-09 03:03:10 +00:00
Chris Lattner
80cbed4f61 Another nice speedup for the register allocator. This time, we replace
the Virt2PhysRegMap std::map with an std::vector.  This speeds up the
register allocator another (almost) 40%, from .72->.45s in a release build
of LLC on 253.perlbmk.

llvm-svn: 11219
2004-02-09 02:12:04 +00:00
Chris Lattner
56f9b190e1 Add a new (hidden) option that is useful for profiling.
llvm-svn: 11218
2004-02-09 01:47:10 +00:00
Chris Lattner
bbd9a43d20 Ugh, perform an optimization that GCC should be able to do itself. This
speeds up livevar from .48/.32s -> .45/.31s in LLC on perlbmk

llvm-svn: 11217
2004-02-09 01:43:23 +00:00
Chris Lattner
26407384ec Only do stuff for the REAL number of physical registers we have, not 1024.
This speeds up live variables a lot, from .60/.39s -> .47/.26s in LLC, for
the first/second pass respectively.

llvm-svn: 11216
2004-02-09 01:35:21 +00:00
Chris Lattner
490627a404 Change the PhysRegsUsed map into a dense array. Seeing that this is a mapping
from physical registers, and they are always dense, it makes sense to not have
a ton of RBtree overhead.  This change speeds up regalloclocal about ~30% on
253.perlbmk, from .35s -> .27s in the JIT (in LLC, it goes from .74 -> .55).

Now live variable analysis is the slowest codegen pass.  Of course it doesn't
help that we have to run it twice, because regalloclocal doesn't update it,
but even if it did it would be the slowest pass (now it's just the 2x slowest
pass :(

llvm-svn: 11215
2004-02-09 01:26:13 +00:00
Chris Lattner
2eaf58775e 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
Chris Lattner
57ea2e3294 The ConstantExpr::getCast call can cause a CPR to be generated. If so,
strip it off.

llvm-svn: 11213
2004-02-09 00:20:55 +00:00
Chris Lattner
5b6892e37c Fix PR215: [bcwriter] Problem compactifying ConstantPointerRefs
Have I ever mentioned how much I _hate_ constantpointerrefs?

llvm-svn: 11212
2004-02-09 00:15:41 +00:00
Misha Brukman
3480e935d0 Fix grammar-o.
llvm-svn: 11210
2004-02-08 22:27:33 +00:00
Chris Lattner
c5b7b24949 All of spec, including 253.perlbmk should now work. There is still the 254.gap
regression, but that will definitely be fixed by 1.2

llvm-svn: 11209
2004-02-08 22:23:33 +00:00
Chris Lattner
3b7f6b2217 Improve compatibility with programs that already have a prototype for 'write',
even if it is wierd in some way.

llvm-svn: 11207
2004-02-08 22:14:44 +00:00
Chris Lattner
85195147e1 vi failed me again. :)
llvm-svn: 11206
2004-02-08 21:52:30 +00:00
Chris Lattner
144f0efd4c Rename the invoke 'except' destination to the 'unwind' destination
llvm-svn: 11205
2004-02-08 21:52:04 +00:00
Chris Lattner
17235712fb Change the 'exception' destination to the 'unwind' destination. We will always
allow 'except' instead of 'unwind' here though.

llvm-svn: 11203
2004-02-08 21:48:25 +00:00
Chris Lattner
fae8ab3088 rename the "exceptional" destination of an invoke instruction to the 'unwind' dest
llvm-svn: 11202
2004-02-08 21:44:31 +00:00
Chris Lattner
35630adf54 Add new bug, add note about llvm-db
llvm-svn: 11201
2004-02-08 21:20:42 +00:00
Chris Lattner
56997dd283 Fix PR225: [pruneeh] -pruneeh pass removes invoke instructions it shouldn't
llvm-svn: 11200
2004-02-08 21:15:59 +00:00
Chris Lattner
071bc60450 splitBasicBlock "does the right thing" now, no reason to reposition it.
llvm-svn: 11199
2004-02-08 20:49:07 +00:00
Chris Lattner
50ceee1ead Bug fixed
llvm-svn: 11198
2004-02-08 19:59:05 +00:00
Chris Lattner
108cadc274 Implement proper invoke/unwind lowering.
This fixed PR16 "[lowerinvoke] The -lowerinvoke pass does not insert calls to setjmp/longjmp"

llvm-svn: 11195
2004-02-08 19:53:56 +00:00
Chris Lattner
8a9da302a8 New testcase, code generators should support invoke/unwind
llvm-svn: 11192
2004-02-08 19:40:58 +00:00
Chris Lattner
dc631735e6 Print out all globals as they are emitted, not just those emitted from
emitGlobals

llvm-svn: 11191
2004-02-08 19:33:23 +00:00
Chris Lattner
6604615a16 There is no reason to #define fd
llvm-svn: 11190
2004-02-08 19:33:07 +00:00
Brian Gaeke
d7b895a0c5 add pr105
llvm-svn: 11189
2004-02-08 18:49:13 +00:00
Brian Gaeke
3e666c1897 Fix unterminated-quote typo in echo command
llvm-svn: 11188
2004-02-08 08:01:00 +00:00
Brian Gaeke
8613f13cc3 Document automake as a build dependency because we use aclocal
llvm-svn: 11187
2004-02-08 07:49:04 +00:00
Brian Gaeke
b921039ee9 Move rules for regenerating autoconf files into this shell script.
llvm-svn: 11186
2004-02-08 07:44:48 +00:00
Brian Gaeke
4f99c4f75f Remove rules for autoconf'ing files from top-level Makefile
llvm-svn: 11185
2004-02-08 07:44:30 +00:00
Chris Lattner
476488e669 Add a call to 'write' right before the call to abort() in the unwind path.
This causes the JIT, or LLC'd program to print out a nice message, explaining
WHY the program aborted.

llvm-svn: 11184
2004-02-08 07:30:29 +00:00
Brian Gaeke
d97d8faa17 Fix indentation of selectiondag.
I don't know why its indentation has been bugging me, but it has.

llvm-svn: 11180
2004-02-08 05:49:29 +00:00
Chris Lattner
fa616e14fc Add one that I missed
llvm-svn: 11179
2004-02-08 01:53:10 +00:00
Chris Lattner
9ab85275ef Instead of callign removeTriviallyDeadNodes on the global graph every time
removeDeadNodes is called, only call it at the end of the pass being run.
This saves 1.3 seconds running DSA on 177.mesa (5.3->4.0s), which is
pretty big.  This is only possible because of the automatic garbage
collection done on forwarding nodes.

llvm-svn: 11178
2004-02-08 01:51:48 +00:00
Chris Lattner
e1531f3eb1 Remove another unneeded call.
llvm-svn: 11177
2004-02-08 01:40:40 +00:00
Chris Lattner
985282c78e This call is no longer needed now that merging does not produce garbage
llvm-svn: 11176
2004-02-08 01:38:34 +00:00
Chris Lattner
b0f32183e4 Substantially improve the DSA code by removing 'forwarding' nodes from
DSGraphs while they are forwarding.  When the last reference to the forwarding
node is dropped, the forwarding node is autodeleted.  This should simplify
removeTriviallyDead nodes, and is only (efficiently) possible because we are
using an ilist of dsnodes now.

llvm-svn: 11175
2004-02-08 01:27:18 +00:00
Chris Lattner
5592af7927 Bugfix for ilist conversion. The ilist wants to make an 'end' node which has
G == 0

llvm-svn: 11174
2004-02-08 01:05:37 +00:00
Chris Lattner
f3861ce4f6 Switch the Nodes list from being an std::vector<DSNode*> to an ilist<DSNode>
llvm-svn: 11173
2004-02-08 00:53:26 +00:00
Chris Lattner
74a99554d1 One of the 'annoying' things about ilists is that the iterators don't behave
quite the same as for non-intrusive lists of pointers to nodes.  To support
transitioning code bases, add a new 'compatibility' iterator.

llvm-svn: 11172
2004-02-08 00:51:31 +00:00
Chris Lattner
bd16efb88f Change to use node_iterators instead of direct access to Nodes
llvm-svn: 11171
2004-02-08 00:23:16 +00:00
Chris Lattner
d9a063c9a2 Change to use iterators instead of direct access
llvm-svn: 11170
2004-02-08 00:22:41 +00:00
Chris Lattner
8c146638b6 Minor change to breakpoint (lack of) support
llvm-svn: 11169
2004-02-08 00:06:20 +00:00
Chris Lattner
ce74c2f50b getNodes() is gone, use node_begin/end instead
Rename stats from dsnode -> dsa
Add a new stat

llvm-svn: 11167
2004-02-07 23:58:05 +00:00
Chris Lattner
06834e6d7b getNodes() is gone
llvm-svn: 11166
2004-02-07 23:57:26 +00:00
Chris Lattner
7b3d404e28 Abstract out the Nodes collection. Instead of providing a getNodes() method,
provide node_begin/end iterators, which are only guaranteed to be
bidirectional, not random access.

llvm-svn: 11165
2004-02-07 23:57:09 +00:00
Chris Lattner
6e69a5aa5d Actually USE isForwarding method
llvm-svn: 11160
2004-02-07 23:02:32 +00:00
Chris Lattner
e37a472ef0 As Alkis pointed out to me, I forgot to commit this... :(
llvm-svn: 11159
2004-02-07 22:54:19 +00:00
Chris Lattner
40862c7578 There is no need to clone over nodes that are going to be dead anyway
llvm-svn: 11157
2004-02-07 22:00:03 +00:00
Brian Gaeke
92affee3e7 Use autoconf answers from config.h (FIXME, should autoconf this file
directly instead).

Fix LockHolder/MutexLocker typo.

llvm-svn: 11156
2004-02-06 22:33:17 +00:00
Chris Lattner
a1d7fcb15f Add a missing link
llvm-svn: 11154
2004-02-06 20:27:41 +00:00
Misha Brukman
b596679737 Fix grammar.
llvm-svn: 11153
2004-02-06 18:40:35 +00:00
Alkis Evlogimenos
e82a70766e Increase code clarity.
llvm-svn: 11151
2004-02-06 18:08:18 +00:00
John Criswell
977412ca35 Initial checking of the libpng library.
llvm-svn: 11149
2004-02-06 16:37:53 +00:00
John Criswell
07720fe4fe Initial checking of the zlib library.
llvm-svn: 11148
2004-02-06 16:36:42 +00:00
Chris Lattner
55927236e8 Add information about the piece I forgot to write: parameterized tablegen classes
llvm-svn: 11147
2004-02-06 06:37:00 +00:00
Chris Lattner
1215e32eb7 Syntax hilight examples and add note about emacs/vim mode files
llvm-svn: 11146
2004-02-06 06:04:25 +00:00
Chris Lattner
149a2498d0 Add a new document describing TableGen
llvm-svn: 11145
2004-02-06 05:42:53 +00:00
Chris Lattner
e6540165b3 Print the record NAME not the record ADDRESS
llvm-svn: 11144
2004-02-06 03:19:17 +00:00
Alkis Evlogimenos
cd2e7ffcc6 Eliminate uneeded lookups by passing a Virt2PhysMap::iterator instead
of the virtual register to certain functions.

llvm-svn: 11143
2004-02-06 03:15:40 +00:00
Chris Lattner
2dd1c8d8ce Fix another dominator update bug. These bugs keep getting exposed because GCSE
keeps finding more code motion opportunities now that the dominators are correct!

llvm-svn: 11142
2004-02-05 23:20:59 +00:00
Alkis Evlogimenos
a97abeb342 Change live interval representation. Machine instructions now have two
slots each. As a concequence they get numbered as 0, 2, 4 and so
on. The first slot is used for operand uses and the second for
defs. Here's an example:

0: A = ...
2: B = ...
4: C = A + B ;; last use of A

The live intervals should look like:

A = [1, 5)
B = [3, x)
C = [5, y)

llvm-svn: 11141
2004-02-05 22:55:25 +00:00
Chris Lattner
c0c953f0bc Fix bug updating dominators
llvm-svn: 11140
2004-02-05 22:33:26 +00:00
Chris Lattner
f978c421e5 Add debug output
llvm-svn: 11139
2004-02-05 22:33:19 +00:00
Chris Lattner
aaaaec43e7 Bug fixed
llvm-svn: 11138
2004-02-05 21:16:42 +00:00
Chris Lattner
14ab84a483 Fix PR223: Loopsimplify incorrectly updates dominator information
The problem is that the dominator update code didn't "realize" that it's
possible for the newly inserted basic block to dominate anything.  Because
it IS possible, stuff was getting updated wrong.

llvm-svn: 11137
2004-02-05 21:12:24 +00:00
Chris Lattner
eba3c36f99 New testcase for PR223: Loopsimplify incorrectly updates dominator information
llvm-svn: 11136
2004-02-05 21:11:38 +00:00
Alkis Evlogimenos
1165c1081e We don't need to scan the blocks that we are live-in on every
access. Rather we only have to do it on the creation of the interval.

llvm-svn: 11135
2004-02-05 20:45:40 +00:00
Chris Lattner
66c16d144e s/gcse/scalarrepl
llvm-svn: 11133
2004-02-05 17:31:37 +00:00
Chris Lattner
e3f247bcac In a "seeing the forest through the trees" kinda situation, I realized that a
complete rewrite of load-vn will make it a bit faster.  This changes speeds up
the gcse pass (which uses load-vn) from 25.45s to 0.42s on the testcase in
PR209.

I've also verified that this gives the exact same results as the old one.

llvm-svn: 11132
2004-02-05 17:20:00 +00:00
Chris Lattner
d3e4d81ad7 This is a big diff with no functionality change. We just reorder some code,
which causes big reindentation.  While I'm at it, I fix the fixme by removing
some dead code.

llvm-svn: 11131
2004-02-05 05:56:23 +00:00
Chris Lattner
90b9043ea5 finegrainify namespacification
llvm-svn: 11130
2004-02-05 05:51:40 +00:00
Tanya Lattner
dd0c255d14 Added missing include.
llvm-svn: 11129
2004-02-05 05:04:39 +00:00
Tanya Lattner
cb435541c4 Fixed Chris' typo.
llvm-svn: 11128
2004-02-05 04:45:21 +00:00
Chris Lattner
f127d9cf33 qoi bug fixed
llvm-svn: 11127
2004-02-05 00:48:41 +00:00
Chris Lattner
5bab6301ac Implement optimizations for handling large basic blocks.
llvm-svn: 11126
2004-02-05 00:36:43 +00:00
Alkis Evlogimenos
327426411e Modify the two address instruction pass to remove the duplicate
operand of the instruction and thus simplify the register allocation.

llvm-svn: 11124
2004-02-04 22:17:40 +00:00
Chris Lattner
39ad6f2772 Minor speedup, don't query ValueMap each time through the loop
llvm-svn: 11123
2004-02-04 21:44:26 +00:00
Brian Gaeke
fe66239860 Always replace instead of appending when creating archive files. It may be
slightly slower, but I think we can handle it, especially if it means
BytecodeLibs are correctly regenerated.

llvm-svn: 11122
2004-02-04 21:41:23 +00:00
Brian Gaeke
9ce98a7e9f Include <iosfwd> and <string> instead of <iostream>.
Take away the default iostream argument of createMachineFunctionPrinterPass(),
at Chris's request.

llvm-svn: 11121
2004-02-04 21:41:10 +00:00
Brian Gaeke
94b5c3cb91 Take away the default iostream argument of createMachineFunctionPrinterPass(),
at Chris's request.

llvm-svn: 11120
2004-02-04 21:41:01 +00:00
Brian Gaeke
5e442bb3f1 Clean out DESTLIBBYTECODE when making clean in runtime.
llvm-svn: 11119
2004-02-04 21:40:49 +00:00
Chris Lattner
6f8865bf9f Two changes:
1. Don't scan to the end of alloca instructions in the caller function to
     insert inlined allocas, just insert at the top.  This saves a lot of
     time inlining into functions with a lot of allocas.
  2. Use splice to move the alloca instructions over, instead of remove/insert.
     This allows us to transfer a block at a time, and eliminates a bunch of
     silly symbol table manipulations.

This speeds up the inliner on the testcase in PR209 from 1.73s -> 1.04s (67%)

llvm-svn: 11118
2004-02-04 21:33:42 +00:00
Alkis Evlogimenos
dbf4b42fde IMULri* instructions do not require their first two registers operands
to be the same (IOW they are not two address instructions).

llvm-svn: 11117
2004-02-04 17:21:04 +00:00
Chris Lattner
0fa8c7c321 Optimize the case where we are inlining a function that contains only one basic block,
and that basic block ends with a return instruction.  In this case, we can just splice
the cloned "body" of the function directly into the source basic block, avoiding a lot
of rearrangement and splitBasicBlock's linear scan over the split block.  This speeds up
the inliner on the testcase in PR209 from 2.3s to 1.7s, a 35% reduction.

llvm-svn: 11116
2004-02-04 04:17:06 +00:00
Chris Lattner
4babe055d3 Check in header file I forgot before.
llvm-svn: 11115
2004-02-04 03:59:08 +00:00
Chris Lattner
8d414ad035 Adjust to the new BasicBlock ctor, which requires a function parameter
llvm-svn: 11114
2004-02-04 03:58:28 +00:00
Chris Lattner
bb5f0db8d6 Adjust to the new BB ctor
llvm-svn: 11113
2004-02-04 03:57:50 +00:00
Chris Lattner
040ad3afa8 Delete the BasicBlock ctor that only takes a BasicBlock to insert before. This
fails when the basic block points to the function->end.  Instead, require that
the client pass in the function AND the basicblock to insert into.

llvm-svn: 11112
2004-02-04 03:57:34 +00:00
Chris Lattner
0ff9da5fed Remove unneeded code now that splitBasicBlock does the "right thing"
llvm-svn: 11111
2004-02-04 03:21:51 +00:00
Chris Lattner
9cda4bf8e5 When splitting a basic block, insert the new half immediately after the first
half.

llvm-svn: 11110
2004-02-04 03:21:31 +00:00
Chris Lattner
18ef3fda57 More refactoring. Move alloca instructions and handle invoke instructions
before we delete the original call site, allowing slight simplifications of
code, but nothing exciting.

llvm-svn: 11109
2004-02-04 02:51:48 +00:00
Chris Lattner
9fc977eac4 Move the cloning of the function body much earlier in the inlinefunction
process.  The only optimization we did so far is to avoid creating a
PHI node, then immediately destroying it in the common case where the
callee has one return statement.  Instead, we just don't create the return
value.  This has no noticable performance impact, but paves the way for
future improvements.

llvm-svn: 11108
2004-02-04 01:41:09 +00:00
Chris Lattner
a6578ef318 Give CloneBasicBlock an optional function argument to specify which function
to add the cloned block to.  This allows the block to be added to the function
immediately, and all of the instructions to be immediately added to the function
symbol table, which speeds up the inliner from 3.7 -> 3.38s on the PR209.

llvm-svn: 11107
2004-02-04 01:19:43 +00:00
Chris Lattner
d8a232b716 If changing a parent, don't add then remove the object from the leak detector
llvm-svn: 11106
2004-02-04 01:06:38 +00:00
Chris Lattner
c4c7ea5288 In BasicBlock::splitBasicBlock, just use islist::splice to move the instructions,
instead of a loop that is really inefficient with large basic blocks.

This speeds up the inliner pass on the testcase in PR209 from 13.8s to 2.24s
which still isn't exactly speedy, but is a lot better.  :)

llvm-svn: 11105
2004-02-03 23:11:21 +00:00
Chris Lattner
135dcc024b Revised version of a patch for PR222 that works with my version of gmake.
llvm-svn: 11104
2004-02-03 23:05:24 +00:00
Chris Lattner
3d96eb6fa6 Bug fixed
llvm-svn: 11103
2004-02-03 22:59:56 +00:00
Chris Lattner
6bd75a6223 Apply Michael Kahl's patch to fix the 'make tools-only' target when OBJDIR != SRCDIR.
See PR222.

llvm-svn: 11102
2004-02-03 22:56:40 +00:00
Chris Lattner
ae51cae111 Bunch up all locally used allocas by the block they are allocated in, and
process them all as a group.  This speeds up SRoA/mem2reg from 28.46s to
0.62s on the testcase from PR209.

llvm-svn: 11100
2004-02-03 22:34:12 +00:00
Chris Lattner
3784188620 Handle extremely trivial cases extremely efficiently. This speeds up
SRoA/mem2reg from 41.2s to 27.5s on the testcase in PR209.

llvm-svn: 11099
2004-02-03 22:00:33 +00:00
Chris Lattner
d1b1992495 Generate ftst instructions for comparison against zero
llvm-svn: 11098
2004-02-03 18:54:04 +00:00
Chris Lattner
8a63001939 bug fixed
llvm-svn: 11097
2004-02-03 08:03:41 +00:00
Chris Lattner
3c8c72c54f Add the ftst instruction
llvm-svn: 11095
2004-02-03 07:27:50 +00:00
Chris Lattner
8161306139 Add support for one argument OneArgFP instructions
llvm-svn: 11094
2004-02-03 07:27:34 +00:00
Alkis Evlogimenos
3d100ef0ca When an instruction like: A += B had both A and B virtual registers
spilled, A was loaded from its stack location twice. This fixes the bug.

llvm-svn: 11093
2004-02-03 01:13:07 +00:00
Alkis Evlogimenos
74b26f77a3 Revert changes. Will implement this using a different set of primitives
llvm-svn: 11091
2004-02-02 23:08:58 +00:00
Alkis Evlogimenos
6e34205653 Fix debugging output.
llvm-svn: 11088
2004-02-02 22:00:32 +00:00
Alkis Evlogimenos
6471e66fbb Correctly update def/use information for modified machine operands.
llvm-svn: 11087
2004-02-02 21:56:40 +00:00
Alkis Evlogimenos
5f03f684ed Add MachineOperand::setDef() and MachineOperand::setUse() so that the
TwoAddressInstructionPass can correctly update use/def information.

llvm-svn: 11086
2004-02-02 21:55:18 +00:00
Alkis Evlogimenos
86ff30deab Should be more careful. The previously applied change made all counts
outside of loops = 0.

llvm-svn: 11085
2004-02-02 20:29:57 +00:00
Chris Lattner
bcade4b8e6 Floating point negates are -0.0 - X, not 0.0 - X
llvm-svn: 11084
2004-02-02 20:21:29 +00:00
Chris Lattner
c2f0aa58df Disable (x - (y - z)) => (x + (z - y)) optimization for floating point.
llvm-svn: 11083
2004-02-02 20:09:56 +00:00
Chris Lattner
cacd30b957 Update comment
llvm-svn: 11082
2004-02-02 20:09:22 +00:00
Chris Lattner
63b61e8739 No need to declare implicit uses/defs of ST0
llvm-svn: 11081
2004-02-02 19:57:45 +00:00
Chris Lattner
d932cbf613 Bug fixed
llvm-svn: 11080
2004-02-02 19:40:06 +00:00
Brian Gaeke
6204e75c4a Make deadarghaX0r warning louder.
(I just love typing haX0r.   haX0r haX0r haX0r.)

llvm-svn: 11079
2004-02-02 19:32:27 +00:00
Chris Lattner
30d26ac561 Generate the fchs instruction to negate a floating point number
llvm-svn: 11078
2004-02-02 19:31:38 +00:00
Chris Lattner
7af8ad6444 Add support for OneArgFPRW instructions, fix a couple of typeos
llvm-svn: 11077
2004-02-02 19:23:15 +00:00
Brian Gaeke
ac2ced8554 Include PowerPC.h. Flesh out the stub versions of addPassesToEmitAssembly()
and addPassesToJITCompile() slightly.

llvm-svn: 11076
2004-02-02 19:06:36 +00:00
Brian Gaeke
57b8ef2693 Add a -march=powerpc option. Automatically select it if this looks like a
big-endian, 32-bit module, or if __ppc__, __POWERPC__, or __APPLE__ are
defined.

llvm-svn: 11075
2004-02-02 19:06:12 +00:00
Brian Gaeke
53f4c48393 Link in the PowerPC back-end.
llvm-svn: 11074
2004-02-02 19:05:52 +00:00
Brian Gaeke
2458bd6507 Add comments describing how you would add prototypes for factory methods for
PowerPC-specific passes here.

llvm-svn: 11073
2004-02-02 19:05:28 +00:00
Brian Gaeke
fea8eb8938 Add prototype for llvm::allocatePowerPCTargetMachine().
llvm-svn: 11072
2004-02-02 19:05:08 +00:00
Chris Lattner
298fdd7eb1 Codegen -0.0 correctly. Do not use fldz! This is another -0.0 == +0.0 problem, arg.
llvm-svn: 11070
2004-02-02 18:56:30 +00:00
Chris Lattner
6fe75845f9 Correct the method I just added to actually return false sometimes
llvm-svn: 11069
2004-02-02 18:53:04 +00:00
Chris Lattner
29734bccc5 Add a new method to ConstantFP
llvm-svn: 11068
2004-02-02 18:40:29 +00:00
Chris Lattner
7bae4ce64f Bug fixed
llvm-svn: 11067
2004-02-02 17:48:56 +00:00
Alkis Evlogimenos
2cecace9b2 Create an object for tracking physical register usage. This will look
much better when I get rid of the reserved registers.

llvm-svn: 11066
2004-02-02 07:30:36 +00:00
Chris Lattner
e2d6189513 Bug fixed
llvm-svn: 11065
2004-02-01 22:52:12 +00:00
Chris Lattner
ac80ea4970 Second half of a fix for PR218 & test/Regression/Assembler/2004-02-01-NegativeZero.llx.
Basically we store floating point values as their integral components, instead of relying
on the semantics of floating point < to differentiate between values.  This is likely to
make the map search be faster anyway.

llvm-svn: 11064
2004-02-01 22:49:04 +00:00
Chris Lattner
5e2feb4a0f The first half of a fix for PR218 & test/Regression/Assembler/2004-02-01-NegativeZero.llx
llvm-svn: 11063
2004-02-01 22:48:09 +00:00
Chris Lattner
e55e30917a Add another test
llvm-svn: 11062
2004-02-01 22:47:16 +00:00
Alkis Evlogimenos
9b9c0485fd Change weight array into a vector and make it as big as the number of
registers (not as the max number of registers).

Change toSpill from a std::set into a std::vector<bool>.

Use the reverse iterator adapter to do a reverse scan of allocatable
registers.

llvm-svn: 11061
2004-02-01 20:13:26 +00:00
Alkis Evlogimenos
5e05a59bf8 Use std::map::count() instead of std::map::find() != std::map::end()
where appropriate.

llvm-svn: 11060
2004-02-01 18:39:53 +00:00
Chris Lattner
e1146140fc New testcase for PR218
llvm-svn: 11059
2004-02-01 18:16:06 +00:00
Alkis Evlogimenos
0df32f636e Add MRegisterInfo::getNumRegs().
llvm-svn: 11058
2004-02-01 17:14:20 +00:00
Alkis Evlogimenos
a3a56fa041 Change string for joined intervals.
llvm-svn: 11057
2004-02-01 16:13:05 +00:00
Alkis Evlogimenos
aeb8a80c71 FpMOV is also a move instruction.
llvm-svn: 11055
2004-02-01 08:22:16 +00:00
Alkis Evlogimenos
84a84c38b7 Change xor to ^.
llvm-svn: 11054
2004-02-01 08:19:25 +00:00
Chris Lattner
eddfe437c7 Now that tailduplication does not bork SSA form, run mem2reg earlier in gccas.
This tremendously improves the code generated by the LLVM optimizer, primarily
by making the inliner more aggressive.  For example, it improves the stepanov
benchmark from 55.56 mega-additions/sec to 98.04 Ma/s.  It also improves the
oopack/iterator benchmark from 338.3MFLOPS/s to 1103.4MFLOPS/s.  Less noteworthy,
it improves oopack/matrix from 573 -> 641 MFLOPS/s.

llvm-svn: 11053
2004-02-01 07:24:53 +00:00
Chris Lattner
ed9b12c31a Disable tail duplication in any "hard" cases, where it might break SSA form.
llvm-svn: 11052
2004-02-01 06:32:28 +00:00
Chris Lattner
cae054f59f Fix a bug in a recent checkin
llvm-svn: 11050
2004-02-01 05:25:07 +00:00
Chris Lattner
7c91a6176c Fix the count of the number of instructions removed
llvm-svn: 11049
2004-02-01 05:15:07 +00:00
Alkis Evlogimenos
8d4f06ed84 Missed one silly assert :-)
llvm-svn: 11048
2004-02-01 02:21:31 +00:00
Alkis Evlogimenos
69deb4d236 Simplify joinIntervals() code.
llvm-svn: 11047
2004-02-01 02:18:31 +00:00
Chris Lattner
8c285b20b7 Remove all of the annoying statistics now that I'm finished (for the near
term) working on bytecode size stuff.

llvm-svn: 11046
2004-02-01 01:50:31 +00:00
Alkis Evlogimenos
91dcc03c39 Use MRegisterInfo::isPhysicalRegister and
MRegisterInfo::isVirtualRegister.

llvm-svn: 11045
2004-02-01 01:27:01 +00:00
Chris Lattner
125ed54fdc Fix a crasher bug in my constant folding rewrite
llvm-svn: 11044
2004-02-01 01:23:19 +00:00
Chris Lattner
93f7c40879 Print an error message if we can't materialize the bytecode file
llvm-svn: 11043
2004-02-01 01:07:25 +00:00
Chris Lattner
87d16ffdb0 Add comments
llvm-svn: 11042
2004-02-01 00:32:48 +00:00
Chris Lattner
8225d83e7b Print an error message if there is an error materialize the bc file.
llvm-svn: 11041
2004-02-01 00:32:35 +00:00
Alkis Evlogimenos
662bb3f495 Apply final part of Chris' patch.
llvm-svn: 11040
2004-01-31 23:48:47 +00:00
Alkis Evlogimenos
459a67c309 Be a little smarter on the way we handle physical register defs.
llvm-svn: 11038
2004-01-31 23:13:30 +00:00
Chris Lattner
c330b98c1c Finegrainify namespacification, use new MRegisterInfo::isVirtualRegister
method

llvm-svn: 11037
2004-01-31 21:27:19 +00:00
Chris Lattner
a2ef296994 Fix, correctly this time, the computation of the return value
Fix a spello
Tighten up the assertion checking

No functionality changes.

llvm-svn: 11036
2004-01-31 21:21:43 +00:00
Chris Lattner
626f431165 * Fix incorrect computation of the runOnMachineFunction return value
* Turn a bunch of instance variables into automatic variables

llvm-svn: 11035
2004-01-31 21:14:04 +00:00
Chris Lattner
d835aa6711 Remove unneeded #includes
Move Passes.h (which defines the interface to this file) to the top.
Move statistics to the top of the file.
Add a comment

llvm-svn: 11034
2004-01-31 21:07:15 +00:00
Chris Lattner
2f58ffc571 Avoid referencing deleted DSgraphs when merging an SCC into a larger SCC. This
fixes the crash in 176.gcc.

llvm-svn: 11033
2004-01-31 21:02:18 +00:00
Alkis Evlogimenos
50d97e33b7 Merge safe parts from last night's buggy commit. These do not break
any test cases :-)

llvm-svn: 11032
2004-01-31 19:59:32 +00:00
Chris Lattner
f5e7107425 Add two static methods to avoid having client code explicitly compare against
FirstVirtualRegister

llvm-svn: 11031
2004-01-31 19:57:11 +00:00
Alkis Evlogimenos
cdf48ab294 Optimize liveAt() and overlaps(). We now use a binary search instead
of a linear search to find the first range for comparisons. This cuts
down the linear scan register allocator running time by a factor of 3
in 254.perlbmk and by a factor of 2.2 in 176.gcc.

llvm-svn: 11030
2004-01-31 16:54:54 +00:00
Alkis Evlogimenos
26665e2636 Revert last night's changes as they broke some tests. Will remerge parts of the patch.
llvm-svn: 11029
2004-01-31 14:37:41 +00:00
Alkis Evlogimenos
f2fb0fb486 Several performance enhancements and cleanups from Chris.
Simplification of LiveIntervals::Interval::overlaps() and addition of
examples to overlaps() and liveAt() to make them clearer.

llvm-svn: 11028
2004-01-31 04:56:07 +00:00
Chris Lattner
729ea9e1d9 Fix thinko
llvm-svn: 11027
2004-01-30 22:48:02 +00:00
Chris Lattner
112902772a Add some comments sketching out how this is to work eventually.
llvm-svn: 11026
2004-01-30 22:25:18 +00:00
Chris Lattner
201c487ad2 Add a new flag, which is only used for symmetry.
llvm-svn: 11025
2004-01-30 22:24:18 +00:00
Chris Lattner
4ab96324af Forward method request to chained aa implementation
llvm-svn: 11024
2004-01-30 22:20:55 +00:00
Chris Lattner
a96066186e New testcase for better mod/ref information that basicaa can provide
llvm-svn: 11023
2004-01-30 22:18:47 +00:00
Chris Lattner
f0eac5d0d3 Implement the pointsToConstantMemory() method.
llvm-svn: 11022
2004-01-30 22:17:24 +00:00
Chris Lattner
9605576a21 Improve mod/ref information based on the pointsToConstantMemory method.
llvm-svn: 11021
2004-01-30 22:16:42 +00:00
Chris Lattner
6866e18e48 Add a new pointsToConstantMemory method to the AliasAnalysis interface
which can be implemented to improve the quality of mod-ref information.

llvm-svn: 11020
2004-01-30 22:15:41 +00:00
Chris Lattner
4710add9dd Add (currently disabled) support to the instruction selector to only insert
FP_REG_KILL instructions at the end of blocks involved with critical edges.

Fix a bug where FP_REG_KILL instructions weren't inserted in fall through
unconditional branches.  Perhaps this will fix some linscan problems?

llvm-svn: 11019
2004-01-30 22:13:44 +00:00
Chris Lattner
0770862334 Finegrainify namespacification
Implement LiveVariables::getIndexMachineBasicBlock

llvm-svn: 11018
2004-01-30 22:08:53 +00:00
Chris Lattner
bc699a10d1 Add a new lazily constructed mapping from Idx's the MBB they represent
llvm-svn: 11017
2004-01-30 22:08:09 +00:00
Brian Gaeke
845c0dd196 Give clients of MachineFunctionPrinter the ability to specify a banner and
choose an ostream.

llvm-svn: 11016
2004-01-30 21:53:46 +00:00
Misha Brukman
81804b4cb1 Order #includes alphabetically, per style guide.
llvm-svn: 11015
2004-01-30 17:26:24 +00:00
Misha Brukman
78fd5d7f95 Doxygenify comments.
llvm-svn: 11014
2004-01-30 17:22:50 +00:00
Chris Lattner
6c9861be68 Fix a bug aflicting 265.gap
llvm-svn: 11006
2004-01-29 08:36:22 +00:00
Chris Lattner
c0f1e25c01 Minor bugfixes
llvm-svn: 11005
2004-01-29 03:32:15 +00:00
Brian Gaeke
0119fba189 I think this is a more robust fix for the Solaris wchar problems (PR206).
llvm-svn: 11004
2004-01-28 20:54:41 +00:00
Misha Brukman
bf43787f33 Hyphenate `target-dependent'
llvm-svn: 11003
2004-01-28 20:43:01 +00:00
Brian Gaeke
f429a0e6dd Add a new (static inline) std::ostream& << AllocInfo& method. Use it.
llvm-svn: 11002
2004-01-28 19:05:43 +00:00
Chris Lattner
9412b70a4c Rename DSGraph::ScalarMapTy -> DSScalarMap
llvm-svn: 11001
2004-01-28 09:15:42 +00:00
Chris Lattner
f30ae61683 Fix a bug
llvm-svn: 11000
2004-01-28 03:31:34 +00:00
Chris Lattner
68e4bb2b13 Eliminate the call to removeTriviallyDeadNodes from updateFromGlobals graph,
moving it to the start of removeDeadNodes.  This speeds up DSA by 2s on perlbmk
from 41s

llvm-svn: 10999
2004-01-28 03:24:41 +00:00
Chris Lattner
5e14d69d6b In the TD pass, iterate over globals directly instead of through the whole scalar
map.  This saves 5s in the TD pass, from 22->17s on perlbmk

llvm-svn: 10998
2004-01-28 03:12:48 +00:00
Chris Lattner
461310139a In the TD pass, don't iterate over the scalar map to find the globals, iterate over
the globals directly.  This doesn't save any substantial time, however, because the
globals graph only contains globals!

llvm-svn: 10997
2004-01-28 03:07:30 +00:00
Chris Lattner
63c649a9fa In updateFromGlobalsGraph, instead of iterating over all of the scalars in the
function to find the globals, iterate over all of the globals directly.  This
speeds the function up from 14s to 6.3s on perlbmk, reducing DSA time from
53->46s.

llvm-svn: 10996
2004-01-28 03:03:06 +00:00
Chris Lattner
0c0e0d8d6c Keep track of all of the globals inserted into the scalar map
llvm-svn: 10995
2004-01-28 03:01:22 +00:00
Chris Lattner
779ed4f1de Pull the ScalarMap out into something that is more structured than what we had
before.  This allows us to have a place to implement optimizations in a
structured way.

llvm-svn: 10994
2004-01-28 02:42:12 +00:00
Chris Lattner
06a40fc140 Minor tweaks, eliminate useless integer pruning optimziation, turn on
timers by default

llvm-svn: 10993
2004-01-28 02:41:32 +00:00
Chris Lattner
9f0f7ca74e Further reduce the number of nodes cloned with getClonedNH, using merge instead.
This reduces the number of nodes allocated, then immediately merged and DNE'd
from 2193852 to 1298049.  unfortunately this only speeds DSA up by ~1.5s (of
53s), because it's spending most of its time waddling through the scalar map :(

llvm-svn: 10992
2004-01-28 02:11:49 +00:00
Chris Lattner
6ee2b154d4 Add a timer, fix a minor bug.
Also, use RC::merge when possible, reducing the number of nodes allocated, then immediately merged away from 2985444 to 2193852 on perlbmk.

llvm-svn: 10991
2004-01-28 02:05:05 +00:00
Chris Lattner
f6f97f9f90 Another bugfix, disable "spurious" output.
You gotta love spurious

llvm-svn: 10990
2004-01-28 01:19:52 +00:00
Chris Lattner
26acc890f9 fix bug in previous checkin
llvm-svn: 10989
2004-01-27 22:54:56 +00:00
Chris Lattner
54a52e53f0 * Add a new commandline argument to control the "global roots hack". Default
it to be off.  If it looks like it's completely unnecessary after testing, I
  will remove it completely (which is the hope).
* Callers of the DSNode "copy ctor" can not choose to not copy links.
* Make node collapsing not create a garbage node in some cases, avoiding a
  memory allocation, and a subsequent DNE.
* When merging types, allow two functions of different types to be merged
  without collapsing.
* Use DSNodeHandle::isNull more often instead of DSNodeHandle::getNode() == 0,
  as it is much more efficient.
*** Implement the new, more efficient reachability cloner class
    In addition to only cloning nodes that are reachable from interesting
    roots, this also fixes the huge inefficiency we had where we cloned lots
    of nodes, only to merge them away immediately after they were cloned.
    Now we only actually allocate a node if there isn't one to merge it into.
* Eliminate the now-obsolete cloneReachable* and clonePartiallyInto methods
* Rewrite updateFromGlobalsGraph to use the reachability cloner
* Rewrite mergeInGraph to use the reachability cloner
* Disable the scalar map scanning code in removeTriviallyDeadNodes.  In large
  SCC's, this is extremely expensive.  We need a better data structure for the
  scalar map, because we really want to scan the unique node handles, not ALL
  of the scalars.
* Remove the incorrect SANER_CODE_FOR_CHECKING_IF_ALL_REFERRERS_ARE_FROM_SCALARMAP code.
* Move the code for eliminating integer nodes from the trivially dead
  eliminator to the dead node eliminator.
* removeDeadNodes no longer uses removeTriviallyDeadNodes, as it contains a
  superset of the node removal power.
* Only futz around with the globals graph in removeDeadNodes if it is modified

llvm-svn: 10987
2004-01-27 22:03:40 +00:00
Chris Lattner
070afeb77b Rewrite to use the reachability cloner interface. Also, make this much more
efficient in the case where a function calls into the same graph multiple times
(ie, it either contains multiple calls to the same function, or multiple calls
to functions in the same SCC graph)

llvm-svn: 10986
2004-01-27 21:53:14 +00:00
Chris Lattner
0e43b44c31 minor cleanups
llvm-svn: 10985
2004-01-27 21:51:19 +00:00
Chris Lattner
b529730af0 Get clone flags right, so we don't build InlinedGlobals only to clear them
llvm-svn: 10984
2004-01-27 21:50:41 +00:00
Chris Lattner
91c33446ca Minor tweaks
llvm-svn: 10983
2004-01-27 21:49:42 +00:00
Chris Lattner
e11e9b9e15 Add comments, allow DSNode "copy ctor" to ignore outgoing links, add more
structured access to the globals list, add a couple helper methods.

llvm-svn: 10982
2004-01-27 21:49:25 +00:00
Chris Lattner
748b56f76b * cloneReachable* and clonePartiallyInto are not obsolete
* Make AssertNodeInGraph not be HORRIBLY time consuming
* Eliminate the dead mergeInGlobalsGraph method
*** Add the definition for the new ReachabilityCloner class

llvm-svn: 10981
2004-01-27 21:48:35 +00:00
Chris Lattner
7cd8061230 Start counting projects
llvm-svn: 10980
2004-01-27 21:46:23 +00:00
John Criswell
36eebb51f2 Fixed PR#197. The libcrtend library is removed from the library linking list
when creating native executables.

llvm-svn: 10979
2004-01-26 23:51:10 +00:00
John Criswell
2edea847fc Clarified the extension to shared library objects.
llvm-svn: 10978
2004-01-26 21:26:54 +00:00
John Criswell
47b48bf951 Updating release notes for PR214.
llvm-svn: 10977
2004-01-26 21:03:54 +00:00
John Criswell
e6a41815f3 Fixes for PR214. Use the SHLIBEXT variable instead of hardcoding .so into
every file.

llvm-svn: 10976
2004-01-26 20:59:41 +00:00
Brian Gaeke
666aaf715f Fix a couple of places I noticed where "X86" was hard-coded.
llvm-svn: 10974
2004-01-24 09:23:46 +00:00
Alkis Evlogimenos
59e3325c26 Fix failing test cases with joined live intervals. It turns out that
when joining we need to check if we overlap with the second interval
or any of its aliases.

Also make joining intervals the default.

llvm-svn: 10973
2004-01-23 13:37:51 +00:00
Brian Gaeke
f0cc848602 Add the JITInfo object, accessor & initializer.
llvm-svn: 10972
2004-01-23 06:39:30 +00:00
Brian Gaeke
4880432af8 Add CodeEmitter and JITInfo stubs. Dump the old
PowerPCTargetMachine::addPassesToJITCompile() method, in favor of the
TargetJITInfo interface.

llvm-svn: 10971
2004-01-23 06:35:43 +00:00
Chris Lattner
78c36d2112 Initial support for implementing clonePartiallyInto in terms of cloneReachableSubgraph, though this support is currently disabled.
llvm-svn: 10970
2004-01-23 01:44:53 +00:00
Chris Lattner
7fd9f4ecdc Add new flag, other minor modifications
llvm-svn: 10969
2004-01-23 01:42:32 +00:00
Chris Lattner
f0406a9739 Fix grammar
llvm-svn: 10968
2004-01-23 01:42:16 +00:00
Chris Lattner
241ed4c500 Fix a problem brian ran into with the bytecode reader asserting. It turns
out that the problem was actually the writer writing out a 'null' value
because it didn't normalize it.  This fixes:
test/Regression/Assembler/2004-01-22-FloatNormalization.ll

llvm-svn: 10967
2004-01-23 00:55:21 +00:00
Chris Lattner
6fd5e2bdaf New testcase for problem brian ran into
llvm-svn: 10966
2004-01-23 00:54:26 +00:00
Alkis Evlogimenos
73df113676 Add option to join live intervals. Two intervals are joined if there
is a move between two registers, at least one of the registers is
virtual and the two live intervals do not overlap.

This results in about 40% reduction in intervals, 30% decrease in the
register allocators running time and a 20% increase in peephole
optimizations (mainly move eliminations).

The option can be enabled by passing -join-liveintervals where
appropriate.

llvm-svn: 10965
2004-01-22 23:08:45 +00:00
Brian Gaeke
ecc92bfe6e Move bytecode_libdir def'n to Makefile.config.in from Makefile.rules, so it
lives near the other installation dirs (like libdir, bindir, etc.).

Move the rule for making bytecode_libdir out of the ifdef LIBRARYNAME...endif.

llvm-svn: 10964
2004-01-22 22:53:48 +00:00
Brian Gaeke
3f58a875f1 Add autoconf check for the version of etags we have detected, and select
appropriate "force C++" command-line option.

llvm-svn: 10963
2004-01-22 21:55:15 +00:00
Brian Gaeke
740515afa2 Regenerated using autoconf-2.57.
llvm-svn: 10962
2004-01-22 21:55:02 +00:00
Brian Gaeke
14197679b4 Get autoconf'd ETAGSFLAGS value from configure.
llvm-svn: 10961
2004-01-22 21:55:01 +00:00
Brian Gaeke
83d485cfed Move support for building tags database from Makefile.rules to Makefile, because
it's only used in the top-level directory.

llvm-svn: 10960
2004-01-22 21:54:51 +00:00
Alkis Evlogimenos
e1c24c06f9 Remove unneeded check. An interval in active, by definition overlaps
with the current one.

llvm-svn: 10959
2004-01-22 20:07:18 +00:00
Alkis Evlogimenos
4716d76d22 Improve debugging output. Remove unneeded virtReg->0 mapping when
virtReg lives on the stack. Now a virtual register has an entry in the
virtual->physical map or the virtual->stack slot map but never in
both.

llvm-svn: 10958
2004-01-22 19:24:43 +00:00
Alkis Evlogimenos
19638ab2bd Revert previous change. The code was correct...
llvm-svn: 10957
2004-01-22 19:17:52 +00:00
Alkis Evlogimenos
0aa9d0278d Fix incorrect negatives in LiveIntervals::Interval::liveAt().
llvm-svn: 10956
2004-01-22 18:33:50 +00:00
Chris Lattner
80f89ea522 Eliminated the CompletedNodes argument to the cloneReachable* methods. This
map was only used to implement a marginal GlobalsGraph optimization, and it
actually slows the analysis down (due to the overhead of keeping it), so just
eliminate it entirely.

llvm-svn: 10955
2004-01-22 16:56:13 +00:00
Chris Lattner
5750d46ccd Ok, I'm tired of pulling out all my timers to check stuff in, just do it.
llvm-svn: 10954
2004-01-22 16:36:28 +00:00
Chris Lattner
2a0bc1224d Bug fix: X.mergeWith(Y) was not updating Y if Y was a null node handle!
llvm-svn: 10953
2004-01-22 16:31:08 +00:00
Chris Lattner
94f4b2a78b It doesn't make sense for one side to be const, but not the other.
llvm-svn: 10952
2004-01-22 16:08:51 +00:00
Chris Lattner
e75ae61b47 Start implementing DSGraph::clonePartiallyInto and implement mergeInGraph
in terms of it.

Though clonePartiallyInto is not cloning partial graphs yet, this change
dramatically speeds up inlining of graphs with many scalars.  For example,
this change speeds up the BU pass on 253.perlbmk from 69s to 36s, because
it avoids iteration over the scalar map, which can get pretty large.

llvm-svn: 10951
2004-01-22 15:30:58 +00:00
Chris Lattner
c47cf33346 Remove const qualifier (all Value*'s are nonconst in DSA, so it's not clear
why this one was)

Add new method proto

llvm-svn: 10950
2004-01-22 15:26:52 +00:00
Chris Lattner
11d773f8f8 Specialize std::swap correctly
llvm-svn: 10949
2004-01-22 15:26:15 +00:00
Chris Lattner
45fd9d59c0 Allow disabling of ALL printing overhead when performing timings
llvm-svn: 10948
2004-01-22 13:42:43 +00:00
Brian Gaeke
4f4cf4b01c Add DESTDIR support for installing. Use (and depend on) $(bytecode_libdir).
llvm-svn: 10947
2004-01-21 23:57:46 +00:00
Brian Gaeke
96deb7dd86 Give the ".../llvm-gcc/bytecode-libs" directory a variable of its own,
called bytecode_libdir.  Make install-bytecode-library depend on
the existence of that directory, and add a rule for creating it if
it does not exist by calling mkinstalldirs.

llvm-svn: 10946
2004-01-21 23:57:21 +00:00
Brian Gaeke
adfa73d0cf Part 2 of DESTDIR support
llvm-svn: 10945
2004-01-21 23:28:03 +00:00
Misha Brukman
ba3c670292 Implement ModuleProvider::materializeModule() by only materializing functions
that are still left in the lazy reader map.

llvm-svn: 10944
2004-01-21 22:55:34 +00:00
Misha Brukman
2cbec5de52 Let subclasses implement ModuleProvider::materializeModule() which is based on
their implementation of book-keeping for which functions need to be materialized
and which don't.

llvm-svn: 10943
2004-01-21 22:54:50 +00:00
Misha Brukman
2b5dc166a1 To materialize a module, you need to know what functions NEED to be read and
which ones don't, which is state that the parent class doesn't know without
knowing the implementation. Let the children classes implement
materializeModule().

llvm-svn: 10942
2004-01-21 22:54:10 +00:00
Misha Brukman
6e2c6054c1 If you call abort(), #include <cstdlib>
llvm-svn: 10941
2004-01-21 22:50:12 +00:00
Brian Gaeke
ec2a01f5fd Add DESTDIR support for installation, to support RPM etc.
llvm-svn: 10940
2004-01-21 21:20:44 +00:00
Brian Gaeke
6cbf285b37 Maybe Misha isn't so buggy after all. He caught the rest of my huge thinko
w.r.t. SHLIBEXT starting with a dot.

:-)

llvm-svn: 10939
2004-01-21 21:17:37 +00:00
Brian Gaeke
c38abbd571 Build the PowerPC directory, so it is less likely to bit-rot (again)
llvm-svn: 10938
2004-01-21 21:16:10 +00:00
Brian Gaeke
b14a3f73cd Import of skeletal PowerPC backend I have had laying around for months...
llvm-svn: 10937
2004-01-21 21:13:19 +00:00
Brian Gaeke
e00d637c15 Remember, SHLIBEXT begins with a period.
llvm-svn: 10936
2004-01-21 19:59:19 +00:00
Brian Gaeke
8625f68ca5 Modified version of patch from mkahl@apple.com to stop hardcoding ".so".
llvm-svn: 10935
2004-01-21 19:53:11 +00:00
Brian Gaeke
a2404521d5 Regenerated using autoconf-2.57 and autoheader-2.57.
llvm-svn: 10934
2004-01-21 19:39:29 +00:00
Brian Gaeke
20196070c8 Get SHLIBEXT variable from configure script.
llvm-svn: 10933
2004-01-21 19:39:07 +00:00
Brian Gaeke
cc3676b0b2 Get the shlib suffix from Libtool, and define it both in config.h and Makefile.config as SHLIBEXT.
llvm-svn: 10932
2004-01-21 19:38:56 +00:00
Chris Lattner
c70b3f63cc SlotCalculator.h moved
llvm-svn: 10931
2004-01-20 19:50:34 +00:00
Chris Lattner
ef6883bdcf Move SlotCalculator.h from include/llvm to include/llvm/Analysis
llvm-svn: 10930
2004-01-20 19:50:12 +00:00
Chris Lattner
1d19937343 bug fixed
llvm-svn: 10929
2004-01-20 19:16:50 +00:00
Chris Lattner
467d977868 Fix PR212 - Bytecode reader misreads 'long -9223372036854775808'!
Fix testcase test/Regression/Assembler/2004-01-20-MaxLongLong.llx

llvm-svn: 10928
2004-01-20 19:13:07 +00:00
Chris Lattner
32afecc336 New testcase for incorrect bytecode reading of MAXLONG. The reader is getting
it as zero.

llvm-svn: 10927
2004-01-20 19:00:12 +00:00
Tanya Lattner
7117b9751d Moved iterators around.
llvm-svn: 10926
2004-01-20 17:51:13 +00:00
Tanya Lattner
72494e04be Moved iterators to common file.
llvm-svn: 10925
2004-01-20 17:49:42 +00:00
Chris Lattner
6cc66d93f1 Fix bogus warning and simplify code
llvm-svn: 10924
2004-01-20 17:06:29 +00:00
Chris Lattner
083c99e347 Major changes. Now we only compactify individual type planes if it is in
fact "profitable" to do so.  This makes compactification "free" for small
programs (ie, it is completely disabled) and even helps large programs by
not having to encode pointless compactification planes.

On 176.gcc, this saves 50K from the bytecode file, which is, alas only
a couple percent.

This concludes my head bashing against the bytecode format, at least for
now.

llvm-svn: 10922
2004-01-20 00:57:32 +00:00
Chris Lattner
da550c1efb add a method proto, make a method not inline
llvm-svn: 10921
2004-01-20 00:54:47 +00:00
Chris Lattner
a395324383 Bugfixes for dealing with partially compactified functions
llvm-svn: 10920
2004-01-20 00:54:06 +00:00
Misha Brukman
d3de5c6182 Now with HTML 4.01 comliance flavor.
llvm-svn: 10919
2004-01-20 00:20:17 +00:00
Chris Lattner
5a66bb7507 Save another 30K from 176.gcc by encoding the compaction table a bit more
intelligently.

llvm-svn: 10918
2004-01-18 22:35:34 +00:00
Chris Lattner
979ca2fccd Remove -debug output
llvm-svn: 10917
2004-01-18 22:26:53 +00:00
Chris Lattner
e6f99bd3a9 Add enum for compaction table.
llvm-svn: 10916
2004-01-18 21:09:23 +00:00
Chris Lattner
bc02f4ce97 Add support for writing bytecode files with compactiontables for bytecode files.
This shrinks the bytecode file for 176.gcc by about 200K (10%), and 254.gap by
about 167K, a 25% reduction.  There is still a lot of room for improvement in
the encoding of the compaction table.

llvm-svn: 10915
2004-01-18 21:08:52 +00:00
Chris Lattner
e104d88f83 Add support for reading bytecode files with compactiontables for bytecode files.
This shrinks the bytecode file for 176.gcc by about 200K (10%), and 254.gap by
about 167K, a 25% reduction.  There is still a lot of room for improvement in
the encoding of the compaction table.

llvm-svn: 10914
2004-01-18 21:08:15 +00:00
Chris Lattner
ca1f8afe85 Add support for building the compactiontable for bytecode files. This shrinks
the bytecode file for 176.gcc by about 200K (10%), and 254.gap by about 167K,
a 25% reduction.  There is still a lot of room for improvement in the encoding
of the compaction table.

llvm-svn: 10913
2004-01-18 21:07:07 +00:00
Chris Lattner
23e583b5dc Add support for representing the "compaction table"
Change protected members to private.  Nothing should subclass SlotCalculator

llvm-svn: 10912
2004-01-18 21:03:49 +00:00
Chris Lattner
f78819d9ad Eliminate special case handling for CPR's
Fix some problem cases where I was building the slot calculator in bytecode
writer mode instead of asmwriter mode.

llvm-svn: 10911
2004-01-18 21:03:06 +00:00
Chris Lattner
e18faa4805 Clarify situation w.r.t the -lowerinvoke pass.
llvm-svn: 10909
2004-01-18 20:13:43 +00:00
Chris Lattner
677af4a1cb Bytecode format for LLVM 1.2 no longer explicitly encodes zeros in primitive
type planes.  This saves about 5k on 176.gcc, and is needed for a subsequent
patch of mine I'm working on.

llvm-svn: 10908
2004-01-17 23:25:43 +00:00
Chris Lattner
4533ba592b fix copy-and-pasto
llvm-svn: 10907
2004-01-17 22:48:06 +00:00
Chris Lattner
a75f858ac4 Revision of Brian's threading support library to be a bit more generic and
platform independent.  This code is completely untested (but never used),
and needs autoconf support for detecting pthreads, but it's a start, and
deletes two emails from my inbox.  :)

llvm-svn: 10906
2004-01-17 19:54:29 +00:00
Chris Lattner
14004da36c This file goes away
llvm-svn: 10905
2004-01-17 19:35:57 +00:00
Brian Gaeke
8b05e4fcd9 Add a fixed bug
llvm-svn: 10904
2004-01-16 21:55:04 +00:00
John Criswell
7a32336316 Remove the use of LLVMGCCARCH. Instead, query the compiler for the
location of libgcc.a; that will tell us the name of the directory to find
the libraries that we're looking for.

llvm-svn: 10903
2004-01-16 21:53:23 +00:00
Brian Gaeke
f3aa892409 Remove some whitespace and fix up some comments.
Take settings of LCC and LCC1XX from configure.

llvm-svn: 10902
2004-01-16 21:31:34 +00:00
Brian Gaeke
423cecaded Get paths to cc1 and cc1plus by asking llvm-gcc, and AC_SUBST them.
llvm-svn: 10901
2004-01-16 21:31:22 +00:00
Brian Gaeke
6073c44a7f Regenerated using autoconf-2.57.
llvm-svn: 10900
2004-01-16 21:31:21 +00:00
Brian Gaeke
eac97bf984 Take settings of LCC and LCC1XX from configure.
llvm-svn: 10899
2004-01-16 21:31:20 +00:00
Brian Gaeke
9d7984408c Clarify comment.
llvm-svn: 10898
2004-01-16 21:13:10 +00:00
Brian Gaeke
6fb3da0c1b I'm fairly certain this was just a typo.
llvm-svn: 10897
2004-01-16 21:12:34 +00:00
Alkis Evlogimenos
d844972574 Handle printing of intervals that are not assign to any physical
register yet (2nd try).

llvm-svn: 10896
2004-01-16 20:33:13 +00:00
Alkis Evlogimenos
8672af1cc8 Handle printing of intervals that are not assign to any physical
register yet.

llvm-svn: 10895
2004-01-16 20:29:42 +00:00
Alkis Evlogimenos
d86933d21d Fold open interval ends handling into
LiveIntervals::Interval::expiredAt() and simplify regalloc code.

llvm-svn: 10894
2004-01-16 20:17:05 +00:00
Alkis Evlogimenos
e9c6ba891e Add asserts to previous change.
llvm-svn: 10893
2004-01-16 16:23:23 +00:00
Alkis Evlogimenos
3010b3e38e Use a list instead of a vector to store intervals. This will be needed
when we join intervals and one of the two will need to be removed.

llvm-svn: 10892
2004-01-16 16:06:59 +00:00
Misha Brukman
929d1d1ca1 Use the LLVM standard name mangling infrastructure instead of reinventing the
wheel.

llvm-svn: 10891
2004-01-15 22:44:19 +00:00
Brian Gaeke
f39fa9e2e5 This is my script for narrowing down miscompilations to a single file.
llvm-svn: 10890
2004-01-15 22:35:43 +00:00
Chris Lattner
4c57267ece If these blocks are empty, there is no reason to even emit the bytecode blocks.
This saves about 15K in 176.gcc, coupled with another patch that I'm working on.

llvm-svn: 10889
2004-01-15 21:06:57 +00:00
Chris Lattner
2d0e6f6326 Cleanups & efficiency improvements
llvm-svn: 10888
2004-01-15 20:24:09 +00:00
Misha Brukman
c6ef5598ef Put stylesheet after the title.
llvm-svn: 10887
2004-01-15 19:04:12 +00:00
Misha Brukman
67db86a0cc * HTML 4.01 Strict DTD compliance
* Added icons to check document easily

llvm-svn: 10886
2004-01-15 19:03:47 +00:00
Chris Lattner
21699e8f55 The bcwriter does not want ConstantPointerRef's to be indexed, and the asmwriter never did!
llvm-svn: 10885
2004-01-15 18:47:15 +00:00
Chris Lattner
f4572852dc ConstantPointerRef's are no longer emitted. This saves 20028 bytes in the
bytecode files when compiling 176.gcc, but more importantly will make it
easier to eliminate CPR's in the future (no new .bc revision will be
required to support them)

llvm-svn: 10884
2004-01-15 18:46:56 +00:00
Chris Lattner
e2f6317436 Allow bytecode files to refer directly to global values as constants, instead
of forcing them to go through ConstantPointerRef's.  This allows bytecode
files to mirror .ll files, allows more efficient encoding, and makes it easier
to eventually eliminate CPR's.

llvm-svn: 10883
2004-01-15 18:45:25 +00:00
Chris Lattner
980ff78e3c Fix more breakage with string change.
llvm-svn: 10882
2004-01-15 18:39:06 +00:00
Misha Brukman
f5edf1e931 * HTML 4.01 Strict DTD compliance
* Use stylesheets instead of adhoc formatting
* Fix broken links in doxygen due to llvm namespace

llvm-svn: 10881
2004-01-15 18:34:11 +00:00
Brian Gaeke
16d4009a1b Include TargetRegInfo.h and declare SparcTargetMachine forward, to make this
header more easily includable.

llvm-svn: 10880
2004-01-15 18:17:07 +00:00
Brian Gaeke
361c004b88 Make this assertion more self-explanatory.
llvm-svn: 10879
2004-01-15 18:15:58 +00:00
Chris Lattner
a38ebcc476 Hrm, thanks to misha for paying attention to my foolishness!
llvm-svn: 10878
2004-01-15 17:59:29 +00:00
Chris Lattner
6ea3d24663 PR73 is finally fixed
llvm-svn: 10877
2004-01-15 17:55:21 +00:00
Chris Lattner
394fc96f39 Fix PR73: bytecode format inconsistent
llvm-svn: 10876
2004-01-15 17:55:09 +00:00
Chris Lattner
7c73b19bb8 Fix PR73
llvm-svn: 10875
2004-01-15 17:55:01 +00:00
Chris Lattner
f63a4ecc0b Fix brokenness in my last checking
llvm-svn: 10874
2004-01-15 16:56:15 +00:00
Brian Gaeke
456f9a502b Remove configure support for endianness checking, the need for which
Chris has helpfully expunged.

llvm-svn: 10873
2004-01-15 06:22:37 +00:00
Chris Lattner
b3d765f5dd Remove ENDIAN_* support. LLVM does not need it anymore.
llvm-svn: 10872
2004-01-15 06:13:58 +00:00
Chris Lattner
faaf32db19 Change all of the bytecode reader primitives to throw exceptions instead of
returning error codes.  Because they don't return an error code, they can
return the value read, which simplifies the code and makes the reader more
efficient (yaay!).

Also eliminate the special case code for little endian machines.

llvm-svn: 10871
2004-01-15 06:13:09 +00:00
Chris Lattner
1af644d9d6 Remove the optimization that depends on ENDIAN_LITTLE: it's not worth it.
llvm-svn: 10870
2004-01-15 06:11:30 +00:00
Chris Lattner
604d5f36fe Remove broken doxygen comments
llvm-svn: 10869
2004-01-15 04:37:10 +00:00
Misha Brukman
7f67e378be * Conform to HTML 4.01 strict DTD
* Use stylesheets instead of hard-coding formatting

llvm-svn: 10868
2004-01-15 00:14:41 +00:00
Misha Brukman
0bb8e9c3de Make the stylesheet conform to CSS standard.
llvm-svn: 10867
2004-01-15 00:13:59 +00:00
Chris Lattner
b05f02336c Improve comments, add support for remembering the constants strings that
are to be emitted.

llvm-svn: 10866
2004-01-14 23:37:43 +00:00
Chris Lattner
d8087822be add support for -- for symmetry
llvm-svn: 10865
2004-01-14 23:37:22 +00:00
Chris Lattner
6229fbf328 The new bytecode format supports emitting strings a special case. This is
intended to save size (and does on small programs), but on big programs it
actually increases the size of the program slightly.  The deal is that many
functions end up using the characters that the string contained, and the
characters are no longer in the global constant table, so they have to be
emitted in function specific constant pools.

This pessimization will be fixed in subsequent patches.

llvm-svn: 10864
2004-01-14 23:36:54 +00:00
Chris Lattner
394afe0f90 Version 1.2 now supports encoding strings as a special case, to avoid having
to emit all of those sbyte constants.

llvm-svn: 10863
2004-01-14 23:35:21 +00:00
Chris Lattner
de36304453 When emitting bytecode, handle strings specially. Do not add the characters
that make up the strings to the slotcalculator.

llvm-svn: 10862
2004-01-14 23:34:39 +00:00
Chris Lattner
c6098c06d5 Like output_data, it's obvious that input_data was only used with 1 character
data.

llvm-svn: 10861
2004-01-14 23:03:22 +00:00
Chris Lattner
369dbe2a09 "fix" a nasty race condition
llvm-svn: 10860
2004-01-14 21:18:03 +00:00
Chris Lattner
55ca34ab8a Fix some exception safety problems
llvm-svn: 10859
2004-01-14 20:58:17 +00:00
Chris Lattner
2d6902b4b6 Hrm, apparently I missed lowering this intrinsic. :(
llvm-svn: 10858
2004-01-14 20:41:29 +00:00
Chris Lattner
eeb4ffd8ea It is obvious that this has never been used for outputing more than a single
byte, it's totally endian incorrect!

llvm-svn: 10857
2004-01-14 18:50:28 +00:00
Chris Lattner
29f9590e82 Be const correct
llvm-svn: 10856
2004-01-14 18:41:38 +00:00
Chris Lattner
e8701f690f Fix bug in previous checkin: Demorgan would be ashamed of me, I need to
lay off the crack.

llvm-svn: 10855
2004-01-14 17:51:53 +00:00
Chris Lattner
93cd755c05 Eliminate the isStringCompatible function, using ConstantArray::isString.
It's not clear why the code was looking for signed chars < 0, but it can't
matter to the assembler anyway, so the check goes away.  This also fixes
compatibility with arrays of [us]byte that have constantexprs in them.

Also slightly restructure some code to be cleaner.

llvm-svn: 10854
2004-01-14 17:15:17 +00:00
Chris Lattner
ac2b198ec5 Eliminate the isStringCompatible function, using ConstantArray::isString.
It's not clear why the code was looking for signed chars < 0, but it can't
matter to the assembler anyway, so the check goes away.

llvm-svn: 10853
2004-01-14 17:14:42 +00:00
Chris Lattner
3dc08ebb5f Use new method
llvm-svn: 10852
2004-01-14 17:07:46 +00:00
Chris Lattner
e8dfccaabd Implement ConstantArray::isString
llvm-svn: 10851
2004-01-14 17:06:38 +00:00
Chris Lattner
87ce7dcb3e Add new ConstantArray::isString(), as the conditions for using getString()
are complex enough to check that it should be a seperate method.

While I'm here, improve ConstantArray::getNullValue a bit, though the
FIXME is still quite valid.

llvm-svn: 10850
2004-01-14 17:06:21 +00:00
Chris Lattner
9a38c78fe6 Ok, I can't handle it. This is a temporary checkin of a ton of statistics that
i'm using in my work to reduce the bytecode file sizes.  These will eventually
be removed.

llvm-svn: 10849
2004-01-14 16:54:21 +00:00
Chris Lattner
893b184db0 Remove support for the pre-1.0 bytecode version #1. This will become
the bytecode revision generated by LLVM 1.2.

llvm-svn: 10848
2004-01-14 16:44:44 +00:00
Alkis Evlogimenos
0680572553 Properly update #intervals statistic.
llvm-svn: 10847
2004-01-14 10:44:29 +00:00
Chris Lattner
1f7942fe7d Fix InstCombine/2004-01-13-InstCombineInvokePHI.ll, which also fixes lots
of C++ programs in Shootout-C++, including lists1 and moments, etc

llvm-svn: 10845
2004-01-14 06:06:08 +00:00
Brian Gaeke
1c0133ffd9 Don't pass anything to the IntrinsicLowering class that is not_intrinsic,
because that makes it abort. Also, fix a typo in a comment.

This checkin brought to you by the "It only takes about 30 seconds to run
ENABLE_LLI tests on Shootout on zion, even if they all dump core" fund.

llvm-svn: 10844
2004-01-14 06:02:53 +00:00
Chris Lattner
062f3ddaf5 new testcase
llvm-svn: 10843
2004-01-14 05:53:11 +00:00
Chris Lattner
02062823f7 Fix check. PHI nodes must be handled specially, of course.
llvm-svn: 10842
2004-01-14 05:42:52 +00:00
Chris Lattner
ec5089a223 Tighten up verifier checks. The result of an invoke instruction only
dominates the normal destination, not the exceptional dest (ie, the result
of a call is undefined on an exception)

llvm-svn: 10841
2004-01-14 04:25:59 +00:00
Chris Lattner
298d2f090f Make sure to verify the result before writing out the bytecode file. Not doing
so can cause obscure errors downstream.

llvm-svn: 10840
2004-01-14 03:39:46 +00:00
Chris Lattner
2f1aa118a4 finegrainify namespacification
llvm-svn: 10839
2004-01-14 03:38:37 +00:00
Chris Lattner
1f018c2d01 Toggle sense of flag
llvm-svn: 10838
2004-01-14 02:50:16 +00:00
Chris Lattner
6089bb1f19 The only clients of the slot calculator are now the asmwriter and bcwriter.
Since this really only makes sense for these two, change hte instance variable
to reflect whether we are writing a bytecode file or not.  This makes it
reasonable to add bcwriter specific stuff to it as necessary.

llvm-svn: 10837
2004-01-14 02:49:34 +00:00
Alkis Evlogimenos
2615c98042 Fix bug in LiveIntervals::Interval::overlaps and
LiveIntervals::Interval::liveAt. Both were considering the live ranges
closed in the end, when they are actually open.

llvm-svn: 10835
2004-01-14 00:20:09 +00:00
Alkis Evlogimenos
a0865cec3f Improve debugging output.
llvm-svn: 10834
2004-01-14 00:09:36 +00:00
Alkis Evlogimenos
0431621429 Fix miscomputation of live intervals. The catch is that registers can
be dead at the defining instruction but can only be killed in
subsequent ones.

llvm-svn: 10833
2004-01-13 22:26:14 +00:00
Brian Gaeke
edf6c9d5a4 You know you like Makefiles with fewer variables. Next up on the victim list
is TOOLS, which is how you say LLVMTOOLCURRENT in Oldspeak.

llvm-svn: 10832
2004-01-13 22:22:19 +00:00
Alkis Evlogimenos
1a01c80f1b Remove allocatable registers vector. It is already provided by
LiveVariables.

llvm-svn: 10830
2004-01-13 22:10:43 +00:00
Brian Gaeke
c0e7e5341e Get rid of dead defns of LCC, LCXX, LAS, as per FIXME.
llvm-svn: 10829
2004-01-13 22:10:06 +00:00
Brian Gaeke
b96e5772f0 Fix overzealous fixme fixing
llvm-svn: 10827
2004-01-13 21:59:51 +00:00
Brian Gaeke
493c4c7f12 Remove dead definitions of NATGCC and CP, and dead .tll, .tbc rules.
Make should continue even if compilation cmds fail, for the sake of
the nightly tester, so use minuses on them.

Use LLVMAS, LLVMGCC, LLVMGXX instead of LAS, LCC, LCXX (as per FIXME).

llvm-svn: 10825
2004-01-13 21:56:30 +00:00
Alkis Evlogimenos
13e8623a3f Cleanup debugging output.
llvm-svn: 10824
2004-01-13 21:53:20 +00:00
Chris Lattner
66f33ff6c2 Finegrainify namespacification
Using the SlotCalculator is total overkill for this file, a simple map
will suffice.  Why doesn't this use the NameMangler interface?

llvm-svn: 10823
2004-01-13 21:27:59 +00:00
Alkis Evlogimenos
33f9cb1da7 Fix output of live intervals to show correctly its closed, open
ranges, i.e. [a,b)

llvm-svn: 10822
2004-01-13 21:17:47 +00:00
Alkis Evlogimenos
9d0c3d21c8 Remove unneeded check (with the recent change in live variables a use
of a physical register is always dominated by a def).

llvm-svn: 10821
2004-01-13 21:16:25 +00:00
Alkis Evlogimenos
65bc990bda Indentation and whitespace cleanups.
llvm-svn: 10820
2004-01-13 20:42:08 +00:00
Alkis Evlogimenos
6b1ec75da9 Fix bug introduced by previous commit: check if fixed intervals
overlap before adding their spill weight.

llvm-svn: 10819
2004-01-13 20:37:01 +00:00
Brian Gaeke
dbd9c33e5e Remove dump-input option.
Make addPassesToEmitAssembly() look slightly more like addPassesToJITCompile().

llvm-svn: 10818
2004-01-13 19:26:21 +00:00
Brian Gaeke
f26dad5432 Regenerated using autoheader-2.57.
llvm-svn: 10817
2004-01-13 07:09:57 +00:00
Brian Gaeke
663a05917e Simplify configure rules. (I don't know if anyone else cares...)
llvm-svn: 10816
2004-01-13 07:09:56 +00:00
Brian Gaeke
07e46214d0 Whoopsie. I should remember to use aclocal next time.
llvm-svn: 10815
2004-01-13 06:52:10 +00:00
Brian Gaeke
2abe7ae3b6 Remove and/or shorten many comments in configure.ac.
Remove checks for many common Unix programs. Our build process currently
assumes they are there and makes no provisions for any other world-views.
(We can add some of these checks back at some later time if it should prove
useful, but right now, we do not need to check to see whether "rm" exists.)

Remove checks for many common standard C headers and functions. We assume
ISO/ANSI C++, and we always use the <cfoo> versions of ANSI C's <foo.h>
headers, so these checks will not help anything.

Edit configure's warning messages for clarity and content.

Change checks for "optional" programs to default to using "true" instead of
"false", so that a failure to find, e.g., etags, will be less likely to result
in make failing.

No longer shall we check for --enable-purify or --with-purify options.
No longer shall we propagate these to the Makefiles.

configure regenerated using autoconf-2.57.

Please feel free to send me any questions or comments you have. :-)

llvm-svn: 10814
2004-01-13 06:43:16 +00:00
Alkis Evlogimenos
ebbd66c042 Correctly compute live variable information for physical registers
when an implicitely defined register is later used by an alias. For example:

         call foo
         %reg1024 = mov %AL

The call implicitely defines EAX but only AL is used. Before this fix
no information was available on AL. Now EAX and all its aliases except
AL get defined and die at the call instruction whereas AL lives to be
killed by the assignment.

llvm-svn: 10813
2004-01-13 06:24:30 +00:00
Chris Lattner
061da2f059 Implement a bunch of symbolic constant folding opportunities. This implements
testcase test/Regression/Assembler/ConstantExprFold.llx

Note that these kinds of things only rarely show up in source code, but are
exceedingly common in the intermediate stages of algorithms like SCCP.  By
folding things (especially relational operators) that use symbolic constants,
we are able to speculatively fold more conditional branches, which can
lead to some big simplifications.

It would be easy to add a lot more special cases here, so if you notice
SCCP missing anything "obvious", you know what to make smarter.  :)

llvm-svn: 10812
2004-01-13 05:51:55 +00:00
Chris Lattner
29d0a24201 New testcase for symbolic constant folding opportunities that LLVM should get.
llvm-svn: 10811
2004-01-13 05:32:27 +00:00
Chris Lattner
dab8b6bb50 Implement new Instruction::isRelational method
llvm-svn: 10810
2004-01-12 23:18:25 +00:00
Chris Lattner
bf007407c5 Add new method
llvm-svn: 10809
2004-01-12 23:18:06 +00:00
Chris Lattner
1dd054c41b Rearrange and comment code better. No functionality changes
llvm-svn: 10808
2004-01-12 22:07:24 +00:00
Chris Lattner
5a945e3616 Rename ConstantHandling.* -> ConstantFolding.*
Move a bunch of (now) private stuff from ConstantFolding.h into
ConstantFolding.cpp.

This _finally_ gets us to a place where we have a sane constant folder.  The
rules are:

1. LLVM clients now use ConstantExpr::get* methods to fold constants.  If they
   cannot be folded, a constantexpr is created, so these methods always return
   valid Constant*'s.
2. The implementation of ConstantExpr::get* uses the functions exposed by
   ConstantFolding.h to try to fold constants.  If they cannot be folded,
   they should return a null pointer.
3. The implementation of ConstantFolding can do whatever it wants, and only
   has one client (Constants.cpp)

This cuts down on the wierd dependencies, and eliminates the two interfaces.
The old constanthandling interface was especially bad for clients to use
because almost none of them took the failure condition into consideration,
thus leading to obscure problems.

llvm-svn: 10807
2004-01-12 21:13:12 +00:00
Chris Lattner
6ff6ceaf75 Remove a whole bunch more ugliness. This is actually getting to the point of
this whole refactoring: allow constant folding methods to return something
other than predefined classes, allow them to return generic Constant*'s.

llvm-svn: 10806
2004-01-12 21:02:29 +00:00
Chris Lattner
2361bd02a1 Move ConstantHandling.h into lib/VMCore and out of include/llvm
llvm-svn: 10805
2004-01-12 20:48:11 +00:00
Chris Lattner
e4867d75dd Move this file to lib/VMCore
llvm-svn: 10804
2004-01-12 20:47:29 +00:00
Chris Lattner
7998ce01d4 Eliminate a lot of out-of-date comments, and all of the wierd overloaded
operator constant folding stuff.

llvm-svn: 10803
2004-01-12 20:43:44 +00:00
Chris Lattner
f8348c3549 Eliminate usage of the wierd overloaded operator constant folders
llvm-svn: 10802
2004-01-12 20:41:05 +00:00
Chris Lattner
0bba771f49 Eliminate ConstantFoldShiftInstruction reference
llvm-svn: 10801
2004-01-12 20:40:42 +00:00
Chris Lattner
b1505c8594 Remove use of ConstantHandling itf
llvm-svn: 10800
2004-01-12 20:13:04 +00:00
Chris Lattner
6b052f2154 Clean up #includes
llvm-svn: 10799
2004-01-12 19:56:36 +00:00
Chris Lattner
fcf21a75b0 Fix bug in previous checkin
llvm-svn: 10798
2004-01-12 19:47:05 +00:00
Chris Lattner
abc7519fc8 The getShift method is no obsolete
llvm-svn: 10797
2004-01-12 19:37:26 +00:00
Chris Lattner
c1e7cc0fbe Eliminate use of ConstantHandling and ConstantExpr::getShift interfaces
llvm-svn: 10796
2004-01-12 19:35:11 +00:00
Chris Lattner
d7ccc9e5a5 Add header file I accidentally removed in teh shuffle
llvm-svn: 10795
2004-01-12 19:15:20 +00:00
Chris Lattner
9eb2b527ad Fix out of date comment, remove use of ConstantExpr::getShift
llvm-svn: 10794
2004-01-12 19:12:58 +00:00
Chris Lattner
c9fb4a3b89 Remove use of the ConstantHandling interfaces
llvm-svn: 10793
2004-01-12 19:12:50 +00:00
Chris Lattner
429963742e Remove use of ConstantExpr::getShift
llvm-svn: 10792
2004-01-12 19:10:58 +00:00
Chris Lattner
1b7d4d7b63 Don't use ConstantExpr::getShift anymore
llvm-svn: 10791
2004-01-12 19:08:43 +00:00
Chris Lattner
5645e8a82d Make ConstantExpr::get work for shifts as well
llvm-svn: 10790
2004-01-12 19:04:55 +00:00
Chris Lattner
2853a7ed22 Remove use of ConstantHandling
llvm-svn: 10789
2004-01-12 18:35:03 +00:00
Chris Lattner
118a76cb2f Remove unneeded #include
llvm-svn: 10788
2004-01-12 18:33:54 +00:00
Chris Lattner
c04cf98fb6 llvm::ConstantFoldInstruction
llvm-svn: 10787
2004-01-12 18:25:56 +00:00
Chris Lattner
aecd3e8a10 Move prototype of llvm::ConstantFoldInstruction
llvm-svn: 10786
2004-01-12 18:25:44 +00:00
Chris Lattner
fc6c859a0c Move llvm::ConstantFoldInstruction from VMCore to here, next to ConstantFoldTerminator
llvm-svn: 10785
2004-01-12 18:25:22 +00:00
Chris Lattner
0df14b3f2b Move llvm::ConstantFoldInstruction from here to Transforms/Utils
llvm-svn: 10784
2004-01-12 18:25:03 +00:00
Chris Lattner
81d8822396 Remove uses of ConstantHandling itf
llvm-svn: 10783
2004-01-12 18:12:44 +00:00
Chris Lattner
fe2aafe08a Eliminate use of ConstantHandling itf
llvm-svn: 10782
2004-01-12 18:08:18 +00:00
Chris Lattner
85f325b544 Remove use of ConstantHandling itf
llvm-svn: 10781
2004-01-12 18:02:15 +00:00
Chris Lattner
c99dd898af Eliminate use of ConstantHandling itf
llvm-svn: 10780
2004-01-12 17:57:32 +00:00
Chris Lattner
0fe5b32c01 Use constantexprs for casts. Eliminate use of the ConstantHandling interfaces
llvm-svn: 10779
2004-01-12 17:43:40 +00:00
Chris Lattner
fe992d4332 Fix fairly severe bug in my last checking where we treated all unfoldable
constants as being "true" when evaluating branches.  This was introduced
because we now create constantexprs for the constants instead of failing the
fold.

llvm-svn: 10778
2004-01-12 17:40:36 +00:00
Chris Lattner
4bb9bc3a65 Eliminate annoying warnings from the tester, hopefully for real this time.
llvm-svn: 10777
2004-01-12 16:55:30 +00:00
John Criswell
42967349be Modified the configure script so that it defines BISON as the bison
binary and YACC as bison -y.

llvm-svn: 10776
2004-01-12 16:18:21 +00:00
John Criswell
cd08e2815f The configure script now defines BISON as the name of the bison program and
YACC as bison -y.  In this way, we ensure that bison is being used, but
the Makefiles have macros for using bison itself and for getting bison to
act like it is traditional yacc.

llvm-svn: 10774
2004-01-12 16:14:54 +00:00
Alkis Evlogimenos
975c8bde79 Output mov %REG = 0 instead of xor %REG, %REG, %REG to clear a
register so that LiveVariable analysis is not confused.

llvm-svn: 10773
2004-01-12 07:22:45 +00:00
Chris Lattner
69fba00b85 Bug fixed
llvm-svn: 10770
2004-01-12 05:15:04 +00:00
Chris Lattner
e0536857aa Testcase for PR204
llvm-svn: 10769
2004-01-12 05:01:48 +00:00
Chris Lattner
950b713d22 Add support for %llvmgcc
llvm-svn: 10768
2004-01-12 05:01:13 +00:00
Chris Lattner
49f74522ec * Implement minor performance optimization for the getelementptr case
* Implement SCCP of load instructions, implementing Transforms/SCCP/loadtest.ll
  This allows us to fold expressions like "foo"[2], even if the pointer is only
  a conditional constant.

llvm-svn: 10767
2004-01-12 04:29:41 +00:00
Chris Lattner
2ca9b10b6a Test to make sure we can SCCP load instructions
llvm-svn: 10766
2004-01-12 04:28:32 +00:00
Chris Lattner
7e8af38637 Do not hack on volatile loads. I'm not sure what the point of a volatile load
from constant memory is, but lets not take chances.

llvm-svn: 10765
2004-01-12 04:13:56 +00:00
Chris Lattner
05fe6847a8 Implement SCCP/phitest.ll
llvm-svn: 10763
2004-01-12 03:57:30 +00:00
Chris Lattner
4d1bb94c3e New testcase, allow folding of binary operators that use PHI nodes, as long
as the result of the binary operator is always constant.  This does not require
the PHI itself to be constant though.

llvm-svn: 10762
2004-01-12 03:57:00 +00:00
Chris Lattner
fafa2ff2d6 Implement Transforms/ScalarRepl/phinodepromote.ll, which is an important
case that the C/C++ front-end generates.

llvm-svn: 10761
2004-01-12 01:18:32 +00:00
Chris Lattner
22c7a36cdc New testcase
llvm-svn: 10760
2004-01-12 01:17:42 +00:00
Chris Lattner
aacf2a5833 Implement: Assembler/2004-01-11-getelementptrfolding.llx
llvm-svn: 10759
2004-01-11 23:56:33 +00:00
Chris Lattner
fcd7ccd425 This isn't really an assembler test. This tests to make sure the
ConstantExpr::getGetElementPtr method folds two getelementptr instructions
when possible.

llvm-svn: 10758
2004-01-11 23:56:03 +00:00
Chris Lattner
d248950a8f Urg, remove testing code.
llvm-svn: 10757
2004-01-11 23:30:03 +00:00
Chris Lattner
0180590bea Fix a regression that I introduced yesterday. :(
llvm-svn: 10756
2004-01-11 23:29:26 +00:00
Alkis Evlogimenos
52a714b45b Make LiveVariables::HandlePhysRegUse and
LiveVariables::HandlePhysRegDef private they use information that is
not in memory when LiveVariables finishes the analysis.

Also update the TwoAddressInstructionPass to not use this interface.

llvm-svn: 10755
2004-01-11 09:18:45 +00:00
Chris Lattner
65f901e23b Check in two changes:
The first change (which is disabled) compactifies all of the function constant
pools into the global constant pool, in an attempt to reduce the amount of
duplication and overhead.  Unfortunately, as the comment indicates, this is
not yet a win, so it is disabled.

The second change sorts the typeid's so that those types that can be used
by instructions in the program appear earlier in the table than those that
cannot (such as structures and arrays).  This causes the instructions to
be able to use the dense encoding more often, saving about 5K on 254.gap.
This is only a .65% savings though, unfortunately. :(

llvm-svn: 10754
2004-01-10 23:46:13 +00:00
Chris Lattner
570c69ce01 Hrm, another minor cleanup, which I missed before
llvm-svn: 10753
2004-01-10 21:42:24 +00:00
Chris Lattner
03c71fa8c5 Minor cleanup
llvm-svn: 10752
2004-01-10 21:40:29 +00:00
Chris Lattner
3bcecb92f3 Update obsolete comments
Fix iterator invalidation problems which was causing -mstrip to miss some
entries, and read free'd memory.  This shrinks the symbol table of 254.gap
from 333 to 284 bytes!  :)

llvm-svn: 10751
2004-01-10 21:36:49 +00:00
Chris Lattner
a2bfab849f Do not bother to emit a BytecodeBlock for an empty symbol table. This commonly
occurs when the symbol table for a module has been stripped, making all of the
function local symbols go away.

This saves 6728 bytes in the stripped bytecode file of 254.gap (which obviously
has 841 functions), which isn't a ton, but helps and was easy.

llvm-svn: 10750
2004-01-10 19:56:59 +00:00
Chris Lattner
8043f8c294 Remove use of llvm/CodeGen/InstrSelection.h
llvm-svn: 10749
2004-01-10 19:16:26 +00:00
Chris Lattner
03cbd1ab79 Remove standard C header wrappers
llvm-svn: 10748
2004-01-10 19:15:38 +00:00
Chris Lattner
d832807311 Remove config wrapper around <cerrno>
llvm-svn: 10747
2004-01-10 19:15:14 +00:00
Chris Lattner
7c4b08e99f Remove standard C file wrapper
llvm-svn: 10746
2004-01-10 19:15:00 +00:00
Chris Lattner
ab0f0f3191 Remove wrapper for standard C file, use <cstdlib> instead
llvm-svn: 10745
2004-01-10 19:12:44 +00:00
Chris Lattner
56ca6b810a Remove wrappers around std c files
llvm-svn: 10744
2004-01-10 19:12:09 +00:00
Chris Lattner
6c8d212c3b Dead file, use <cstring> instead of this.
llvm-svn: 10743
2004-01-10 19:10:22 +00:00
Chris Lattner
0c53031c5e Err, we don't need Config/*.h files for things that are standard C++
llvm-svn: 10742
2004-01-10 19:10:01 +00:00
Chris Lattner
b0a5964356 minor comment tweaks
llvm-svn: 10741
2004-01-10 19:07:06 +00:00
Chris Lattner
94300bde9b remove obsolete file
llvm-svn: 10740
2004-01-10 19:00:26 +00:00
Chris Lattner
4282cbb93a * finegrainify namespacification of ArchiveReader.cpp
* Refactor reader stuff out of include/llvm/Bytecode/Primitives.h.  This is
  internal implementation details for the reader, not public interfaces!

llvm-svn: 10739
2004-01-10 19:00:15 +00:00
Chris Lattner
82167909a8 Refactor writer stuff out of include/llvm/Bytecode/Primitives.h. This is
internal implementation details for the writer, not public interfaces!

llvm-svn: 10738
2004-01-10 18:56:59 +00:00
Chris Lattner
dfe0346e96 Finegrainify namespacification
llvm-svn: 10737
2004-01-10 18:49:43 +00:00
Chris Lattner
68fbab0ee8 Fix annoying warnings. W doesn't have a revision number
llvm-svn: 10736
2004-01-09 18:39:04 +00:00
Chris Lattner
97390c21d3 Live var is now in lib/Target/Sparc
llvm-svn: 10735
2004-01-09 18:16:20 +00:00
Chris Lattner
ae36879303 Move sparc-specific code into lib/Target/Sparc
llvm-svn: 10734
2004-01-09 18:15:56 +00:00
Chris Lattner
4ee36320f4 Move sparc-specific livevar code into lib/Target/Sparc
llvm-svn: 10733
2004-01-09 18:15:24 +00:00
Chris Lattner
bb6fa4b327 Fix more incestuous #includage.
llvm-svn: 10732
2004-01-09 16:17:09 +00:00
Chris Lattner
a4ee66f3ea Finegrainify namespacification.
This should get hunked over to the Sparc backend, along with
MachineCodeForInstruction and a bunch of files in include/llvm/Codegen,
but those battles will have to wait for a later time.

llvm-svn: 10731
2004-01-09 06:30:18 +00:00
Chris Lattner
83e84166a3 Move InstrSelection into lib/Target/Sparc, as it's sparc specific
llvm-svn: 10730
2004-01-09 06:24:06 +00:00
Chris Lattner
3d874aebc2 Move InstrSelection into lib/Target/Sparc, as it's sparc specific. This
makes the incestuous #include'ing of sparc internal headers much less
disturbing.  :)

llvm-svn: 10729
2004-01-09 06:22:34 +00:00
Chris Lattner
b9c7999881 Move lib/Codegen/RegAlloc into lib/Target/Sparc, as it is sparc specific
llvm-svn: 10728
2004-01-09 06:17:12 +00:00
Chris Lattner
df3c342a4c Finegrainify namespacification
llvm-svn: 10727
2004-01-09 06:12:26 +00:00
Chris Lattner
fdf788eebd Remove dependence on structure index type. s/MT/FT
llvm-svn: 10726
2004-01-09 06:02:51 +00:00
Chris Lattner
49525f8cf4 Finegrainify namespacification
llvm-svn: 10725
2004-01-09 06:02:20 +00:00
Chris Lattner
ff66958154 Finegrainify namespacification
add flags for PR82

llvm-svn: 10724
2004-01-09 05:53:38 +00:00
Chris Lattner
84dae1b8a8 Remove an obsolete method, including its _long_ out of date comment.
This is an incremental step towards fixing PR82

llvm-svn: 10723
2004-01-09 05:45:58 +00:00
Chris Lattner
9cc1a0e40d Inching towards fixing PR82
llvm-svn: 10722
2004-01-09 05:44:50 +00:00
Chris Lattner
bc39a1a8c4 Inching our way towards fixing PR82
llvm-svn: 10721
2004-01-09 05:42:34 +00:00
Chris Lattner
e7d471ad3a Remove yet another obsolete comment :)
llvm-svn: 10720
2004-01-08 22:28:45 +00:00
Brian Gaeke
4ace9279aa Fix typos. Rewrite head-of-file comment.
llvm-svn: 10719
2004-01-08 22:21:59 +00:00
Brian Gaeke
6b991afd26 Fix typos. Regularize include guard.
llvm-svn: 10718
2004-01-08 22:21:58 +00:00
Chris Lattner
7433916b5f New bugs fixed
llvm-svn: 10716
2004-01-08 17:20:50 +00:00
Chris Lattner
277276ae37 Testcase for PR202
llvm-svn: 10715
2004-01-08 17:15:09 +00:00
Chris Lattner
59d2d7fc33 Improve encapsulation in the Loop and LoopInfo classes by eliminating the
getSubLoops/getTopLevelLoops methods, replacing them with iterator-based
accessors.

llvm-svn: 10714
2004-01-08 00:09:44 +00:00
Chris Lattner
4480f1ab19 explain the jump for llvm-db
llvm-svn: 10713
2004-01-07 18:33:14 +00:00
Alkis Evlogimenos
ae5b3d4f74 Add a separate list of fixed intervals. This improves the running time
of the register allocator as follows:

       before   after
mesa   2.3790  1.5994
vpr    2.6008  1.2078
gcc    1.9840  0.5273
mcf    0.2569  0.0470
eon    1.8468  1.4359
twolf  0.9475  0.2004
burg   1.6807  1.3300
lambda 1.2191  0.3764

Speedups range anyware from 30% to over 400% :-)

llvm-svn: 10712
2004-01-07 09:20:58 +00:00
Alkis Evlogimenos
a64d71203e Minor cleanups.
llvm-svn: 10711
2004-01-07 05:31:12 +00:00
Alkis Evlogimenos
9f62b96206 Remove declared but undefined method.
llvm-svn: 10710
2004-01-07 02:29:33 +00:00
Alkis Evlogimenos
8b9d36e30c Change perl interpreter path to the standard /usr/bin/perl.
llvm-svn: 10708
2004-01-07 01:48:26 +00:00
Alkis Evlogimenos
1e01557c4e Change implementation of LiveIntervals::overlap(). This results in a
30-50% decrease in running time of the linear scan register allocator.

llvm-svn: 10707
2004-01-07 01:45:58 +00:00
Chris Lattner
bd2977be1a Ugh, fix some copy and pasted code that somehow never got compiled or something
:(

llvm-svn: 10706
2004-01-06 23:46:17 +00:00
Alkis Evlogimenos
96e9a91f55 Pass std::string to constructor as const reference to avoid multiple
copies.

llvm-svn: 10705
2004-01-06 09:16:02 +00:00
Chris Lattner
985a535e4f restore comments to this file
llvm-svn: 10704
2004-01-06 05:37:45 +00:00
Chris Lattner
fa13e8ab3e * Implement set/show args
* Implement support for arguments to the 'run' command
* Minor cleanups and fixes

llvm-svn: 10703
2004-01-06 05:37:16 +00:00
Chris Lattner
5a62886928 implement the "null command" which repeats the last command
llvm-svn: 10702
2004-01-06 05:36:30 +00:00
Chris Lattner
59f1ef40b0 Add support for new intrinsic
llvm-svn: 10701
2004-01-06 05:33:02 +00:00
Chris Lattner
1bb32df2dd add new intrinsic
llvm-svn: 10700
2004-01-06 05:32:17 +00:00
Chris Lattner
3eaba359b0 add new method
llvm-svn: 10699
2004-01-06 05:31:57 +00:00
Chris Lattner
941515cf67 Add links to SLD from the LangRef.html doc
Clean up the SLD document a LOT
Fill in a lot of details in the SLD document
update the formats for the object descriptors

llvm-svn: 10698
2004-01-06 05:31:32 +00:00
Brian Gaeke
2007cec727 Fix some typos and copy-and-paste-os in comments, and doxygenify.
Add <csignal> so that this file compiles on Solaris.

llvm-svn: 10697
2004-01-05 17:22:52 +00:00
Alkis Evlogimenos
2fa1aef707 Remove simple coalescing.
llvm-svn: 10695
2004-01-05 08:24:57 +00:00
Chris Lattner
dc24ced2ee /me slaps head
llvm-svn: 10694
2004-01-05 05:47:19 +00:00
Chris Lattner
a090d388a2 /me slaps forehead
llvm-svn: 10693
2004-01-05 05:45:25 +00:00
Chris Lattner
fc3d0598df fix warning
llvm-svn: 10692
2004-01-05 05:42:17 +00:00
Chris Lattner
3d903f0c0b Add VMCore and code generator support for debugging intrinsics. By default
code generators completely ignore them.

llvm-svn: 10691
2004-01-05 05:36:30 +00:00
Chris Lattner
53d7dcbee7 Add some intrinsics
llvm-svn: 10690
2004-01-05 05:35:34 +00:00
Chris Lattner
3c01d683e3 An example testcase for use in the debugger. Currently you can do stuff like
stepping, next'ing, finish'ing, stacktraces, source listings, etc.  You can't
print program variables yet though.

Oh, and I lost my nice commented version of funccall.ll  :(

Test with:
llvm-as funccall.ll
llvm-db funccall.bc
<arguments>

This is not automatically testable yet, and the C front-end doesn't support
debug information yet.  That said, it's a start.

llvm-svn: 10689
2004-01-05 05:32:40 +00:00
Chris Lattner
144992ea30 Add new directory
llvm-svn: 10688
2004-01-05 05:28:15 +00:00
Chris Lattner
0a903c38d7 Initial checkin of the LLVM Source-Level Debugger. This is incomplete, but
a good start.  The status is documented in docs/SourceLevelDebugging.html

llvm-svn: 10687
2004-01-05 05:27:31 +00:00
Chris Lattner
45784e4303 Add new dir
llvm-svn: 10686
2004-01-05 05:25:59 +00:00
Chris Lattner
3bb92c65fd Initial checkin of the LLVM source-level debugger. This is still not finished,
by any stretch of the imagination, but it is pretty cool and works :)

llvm-svn: 10685
2004-01-05 05:25:10 +00:00
Chris Lattner
67822803d0 Initial implementation of some source-level debugging stuff
llvm-svn: 10684
2004-01-05 05:23:38 +00:00
Chris Lattner
1811fca71c First version of this document. It is still missing some pretty big pieces, and
the debugging information formats will likely change, but it's a start, and I
have to move on to other things in the short-term, so it might be a while before
I get back to working on this.

llvm-svn: 10683
2004-01-05 05:06:33 +00:00
Alkis Evlogimenos
08c5311729 Currently we cannot handle two-address instructions of the form:
A = B op C where A == C, but this cannot really occur in practice
because of SSA form. Add an assert to check that just to be safe.

llvm-svn: 10682
2004-01-05 02:25:45 +00:00
Alkis Evlogimenos
5e0e67173d Update description.
llvm-svn: 10681
2004-01-04 23:09:24 +00:00
John Criswell
2c501eca03 Regression test for initializers with members of unknown size.
llvm-svn: 10678
2004-01-01 23:58:07 +00:00
John Criswell
5782ca06fc Not all platforms supports sighandler_t, so I changed it to use the older
return value from signal() (which should be the same type; it's just not
typedef'd).
This fixes the build on Solaris.

llvm-svn: 10675
2004-01-01 15:14:28 +00:00
Chris Lattner
748e857996 Add new ExecutionEngine::getGlobalValueAtAddress method, which can efficiently
turn a memory address back into the LLVM global object that starts at that
address.  Note that this won't cause any additional datastructures to be built
for clients of the EE that don't need this information.

Also modified some code to not access the GlobalAddress map directly.

llvm-svn: 10674
2003-12-31 20:21:04 +00:00
Chris Lattner
e18c9ba06a Add new ExecutionEngine::getGlobalValueAtAddress method, which can efficiently
turn a memory address back into the LLVM global object that starts at that
address.  Note that this won't cause any additional datastructures to be built
for clients of the EE that don't need this information.

llvm-svn: 10673
2003-12-31 20:19:31 +00:00
Chris Lattner
78f1f51c66 * Add a new helper progress method
* Make sure that the user sees the 100% mark
* Don't bother printing out X.0%, just print out X%

llvm-svn: 10672
2003-12-31 10:20:38 +00:00
Chris Lattner
09bd1a06c1 Add some comments, add new getGlobalVariable method
llvm-svn: 10671
2003-12-31 08:43:01 +00:00
Chris Lattner
e501af83b4 Add some comments, add a new getGlobalVariable method
llvm-svn: 10670
2003-12-31 08:42:27 +00:00
Chris Lattner
73546536b2 Add missing #include
llvm-svn: 10669
2003-12-31 07:31:10 +00:00
Chris Lattner
be3596c8ca * Make Module::getTypeName const
* Add new Module::getTypeByName method
* Group methods in Module.cpp better

llvm-svn: 10668
2003-12-31 07:09:33 +00:00
Chris Lattner
efeb39e3c0 Make the lookup method const.
llvm-svn: 10667
2003-12-31 07:08:19 +00:00
Chris Lattner
e7f42f72d3 Add a bunch of fine tunings that Reid contributed. Thanks Reid!
llvm-svn: 10666
2003-12-31 06:47:28 +00:00
Chris Lattner
e87006eb7e add new function
llvm-svn: 10665
2003-12-31 06:16:02 +00:00
Chris Lattner
e866d1183b Add new function
llvm-svn: 10664
2003-12-31 06:15:37 +00:00
Chris Lattner
ef927f0ef2 clarify comments
llvm-svn: 10663
2003-12-31 05:45:16 +00:00
Chris Lattner
1c007c0ff0 New class, useful for command-line interactive programs.
llvm-svn: 10662
2003-12-31 05:40:02 +00:00
Chris Lattner
5220296f77 doxygenify
llvm-svn: 10661
2003-12-31 04:42:00 +00:00
Chris Lattner
a0c8fe6794 testcase for PR198
llvm-svn: 10660
2003-12-31 03:24:14 +00:00
Chris Lattner
eb537b2401 Fix PR198
llvm-svn: 10659
2003-12-31 03:19:37 +00:00
Chris Lattner
af3f8f3b42 Add comments
llvm-svn: 10658
2003-12-31 02:50:02 +00:00
Chris Lattner
fd2a514199 Minor code cleanups. The only bugfix is to the UR_DEBUG stuff which didn't
compile when enabled.

llvm-svn: 10657
2003-12-31 02:18:11 +00:00
John Criswell
ceea5ad8c8 Updated from files in llvm/autoconf. This was done immediently following
the renaming of aclocal.m4 to acinclude.m4.

llvm-svn: 10656
2003-12-30 17:55:05 +00:00
John Criswell
7775323801 Moved aclocal.m4 to acinclude.m4. To re-generate the configure script,
do the following:
% cd llvm/autoconf
% aclocal
% autoconf -o ../configure

This changes facilitaties the following:
1) It should be easier to incorporate new autoconf macros.
2) It allows for conversion to Automake (should we ever desire it).

llvm-svn: 10655
2003-12-30 17:50:54 +00:00
Chris Lattner
328e067246 remove some useless #includes
llvm-svn: 10654
2003-12-30 07:55:21 +00:00
Chris Lattner
238298acaf Remove some pointless #includes
llvm-svn: 10653
2003-12-30 07:50:31 +00:00
Chris Lattner
c8cbec2cbb Use getFileSize() instead of sys/stat.h directly
llvm-svn: 10652
2003-12-30 07:48:17 +00:00
Chris Lattner
ce8781cd67 Use new getFileSize function. Eliminate some using directives. Reorder #includes a bit
llvm-svn: 10651
2003-12-30 07:45:46 +00:00
Chris Lattner
9b75157c04 Use new getFileSize function instead of sys/stat.h directly.
llvm-svn: 10650
2003-12-30 07:40:35 +00:00
Chris Lattner
4a1c74dcf8 Add new method
llvm-svn: 10649
2003-12-30 07:36:14 +00:00
Chris Lattner
419b70539b Add new function
llvm-svn: 10648
2003-12-30 07:35:47 +00:00
Chris Lattner
cf1755a6f3 Add a -disable-opt flag to gccas, so that we can use -Wa,-disable-opt just
like -Wl,-disable-opt

llvm-svn: 10647
2003-12-30 03:24:27 +00:00
Chris Lattner
6b668f228f Further revisions of the FDHandle idea. In this version we use ownership
semantics that are the same as those used by std::auto_ptr.  This allows
copying of FDHandle's, but copying transfers ownership.

llvm-svn: 10646
2003-12-30 02:45:16 +00:00
Chris Lattner
b9299236a8 Add a new class useful for providing fully materialized modules to ExecutionEngine's
llvm-svn: 10645
2003-12-30 02:44:04 +00:00
John Criswell
1b921c486e Allow C++ programs to end in .cc. This allows C++ test programs in the
test suite to compile.

llvm-svn: 10644
2003-12-29 22:02:12 +00:00
Chris Lattner
0120e92b2b Add trivial exception specs to produce better code since the methods cannot
be inlined.

llvm-svn: 10643
2003-12-29 21:43:58 +00:00
Chris Lattner
a462161f9c Factor FDHandle out of the bytecode reader into the FileUtilities.h support
routines.

llvm-svn: 10642
2003-12-29 21:35:05 +00:00
Chris Lattner
dca358f6ae implement new getToken function
llvm-svn: 10639
2003-12-29 05:07:02 +00:00
Chris Lattner
19857d2c05 add new function
llvm-svn: 10638
2003-12-29 05:06:38 +00:00
Chris Lattner
9fbff9f66e What do you know, we actually do accomplish some things around here :)
llvm-svn: 10637
2003-12-28 23:04:17 +00:00
Chris Lattner
5d236005b0 Clean up a lot of the code I added yesterday by exposing the IntrinsicLowering
implementation from the TargetMachine directly.

llvm-svn: 10636
2003-12-28 21:23:38 +00:00
Alkis Evlogimenos
a158dc8104 Reserve ECX and EDI instead of EBX and EDI. Since EBX is a callee
saved register it has a longer free range than ECX (which is defined
every time there is a fnuction call) which makes ECX a better register
to reserve.

llvm-svn: 10635
2003-12-28 18:03:52 +00:00
Alkis Evlogimenos
43b587d94d Add coalescing to register allocator. A hint is added to each interval
which denotes the register we would like to be assigned to (virtual or
physical). In register allocation, if this hint exists and we can map
it to a physical register (it is either a physical register or it is a
virtual register that already got assigned to a physical one) we use
that register if it is available instead of a random one in the free
pool.

llvm-svn: 10634
2003-12-28 17:58:18 +00:00
Alkis Evlogimenos
52564b2071 Add TargetInstrInfo::isMoveInstr() to support coalescing in register
allocation.

llvm-svn: 10633
2003-12-28 17:35:08 +00:00
Chris Lattner
10cac58d23 Whoops, don't try to lower non intrinsic calls
llvm-svn: 10632
2003-12-28 09:53:23 +00:00
Chris Lattner
dabec3ba96 Pass extra arguments around n stuph
llvm-svn: 10631
2003-12-28 09:51:04 +00:00
Chris Lattner
36cb530e22 We may now pass IntrinsicLowering implementations into these methods
llvm-svn: 10630
2003-12-28 09:48:17 +00:00
Chris Lattner
c45a033b42 implement support for the intrinsic lowering functionality
llvm-svn: 10629
2003-12-28 09:47:19 +00:00
Chris Lattner
dfc5631bfd Eliminate some code that is not needed now that we have the intrinsic lowering pass
llvm-svn: 10628
2003-12-28 09:46:33 +00:00
Chris Lattner
c8c6c03dda Pass around IntrinsicLowering instances as appropriate.
Reimplement the Interpreters implementation of va_* to be more direct.

llvm-svn: 10627
2003-12-28 09:44:37 +00:00
Chris Lattner
4b75e04a60 Use the intrinsic lowering functionality
llvm-svn: 10626
2003-12-28 09:43:35 +00:00
Chris Lattner
1ae8dde6c4 add argument
llvm-svn: 10625
2003-12-28 09:42:49 +00:00
Chris Lattner
bfa9c87bad ABC's must have virtual dtors! Shame on me!
llvm-svn: 10624
2003-12-28 08:55:50 +00:00
Chris Lattner
24650d2b5e Move into the VMCore library
llvm-svn: 10623
2003-12-28 08:30:20 +00:00
Chris Lattner
6e7d2fa79c Move header into top-level llvm dir
llvm-svn: 10622
2003-12-28 08:30:07 +00:00
Chris Lattner
08c196dd4b Implement the default implementation of the intrinsic lowering class
llvm-svn: 10621
2003-12-28 08:19:41 +00:00
Chris Lattner
b697370e97 Add new interface that allows removal of some code from the code generators,
provides for future extensibility, might help the LLVA project avoid having to
hack their own LLI, and provides support required for the experimental Venus
project.

llvm-svn: 10620
2003-12-28 08:19:13 +00:00
Chris Lattner
27dd64242b finegrainify namespacification
minor cleanups

llvm-svn: 10619
2003-12-28 07:59:53 +00:00
Chris Lattner
56db5e98c8 Merging constants can cause further room for improvement. Iterate until
we converge

llvm-svn: 10618
2003-12-28 07:19:08 +00:00
Chris Lattner
5f4c6f55b6 Add a note
llvm-svn: 10617
2003-12-28 04:03:49 +00:00
Chris Lattner
5a0d48290f Factor code out of LLI
llvm-svn: 10616
2003-12-26 06:50:30 +00:00
Chris Lattner
af7cc74126 New method
llvm-svn: 10615
2003-12-26 06:50:15 +00:00
Chris Lattner
99958ce7bb Factor out code to ExecutionEngine
llvm-svn: 10614
2003-12-26 06:49:53 +00:00
Chris Lattner
e005b754f3 Simplify code
llvm-svn: 10613
2003-12-26 06:36:20 +00:00
Chris Lattner
4a2a8f5821 minor cleanups
llvm-svn: 10612
2003-12-26 06:16:00 +00:00
Chris Lattner
079f4d5e71 * eliminate the -f argument to lli, as it was silly and never useful anyway
* Inline callMain function
* Remove hack from the ExecutionEngines where the 'run' method would automatically
  run atExit functions.  Fixing this requires explicitly calling exit if main returns

llvm-svn: 10611
2003-12-26 06:14:47 +00:00
Chris Lattner
385a90aa6d No longer run atExit functions from run()
rename run to runFunction
Genericize the runFunction code a little bit, though it still stinks

llvm-svn: 10610
2003-12-26 06:13:47 +00:00
Chris Lattner
d94296c620 No longer run atExit functions from run()
rename run to runFunction

llvm-svn: 10609
2003-12-26 06:13:05 +00:00
Chris Lattner
ad024c3de5 Rename 'run' to 'runFunction' to emphasize that it is usable to run any
function in a module, not just main

llvm-svn: 10608
2003-12-26 06:12:25 +00:00
Chris Lattner
141ea3a052 update comment
llvm-svn: 10607
2003-12-26 05:07:35 +00:00
Alkis Evlogimenos
2e8c984c58 Improve debugging output when choosing a register to spill.
llvm-svn: 10604
2003-12-24 18:53:31 +00:00
Alkis Evlogimenos
eeea81483f Do a separate pass to compute spill weights because doing it inline
with live intervals was missing registers that were used before they
were defined (in the arbitrary order live intervals numbers
instructions).

llvm-svn: 10603
2003-12-24 15:44:53 +00:00
Chris Lattner
4688edb69d boog fixed
llvm-svn: 10602
2003-12-23 23:50:31 +00:00
Chris Lattner
547508d542 Hrm is a really nasty ommission. The lack of this destructor was causing abstract
types to never be deleted, manifesting itself as many OpaqueType objects being
leaked.  Whoops.

llvm-svn: 10601
2003-12-23 23:25:21 +00:00
John Criswell
5695ec9f95 Corrected typo.
llvm-svn: 10600
2003-12-23 22:22:10 +00:00
Chris Lattner
87c593b882 Right, fix the problem with invoke instructions, not just call instructions
llvm-svn: 10599
2003-12-23 22:18:36 +00:00
Chris Lattner
601415ed84 Do not delete the type holder until after the call instruction has been
constructed!

llvm-svn: 10598
2003-12-23 20:39:17 +00:00
John Criswell
80ce0e620e Modified the logic so that library objects with main() are only linked in
if the program currently has main undefined.

llvm-svn: 10597
2003-12-23 20:27:14 +00:00
Chris Lattner
e970301580 Minor cleanups, plug a minor memory leak
llvm-svn: 10596
2003-12-23 20:05:15 +00:00
Alkis Evlogimenos
7d7d7e89d4 Change the way free regusters are computed and perform better
allocation in the presence of preallocated intervals.

llvm-svn: 10595
2003-12-23 18:00:33 +00:00
John Criswell
b6d3cb9449 Modified the linker so that it always links in an object from an archive
that defines the symbol "main."  This is a hack that ensures that programs
that place their main function in a library and then link it in
(i.e. Apache 2.x) get their main function linked in.

There is probably a more correct way to do this, but this works for now.

llvm-svn: 10594
2003-12-23 17:37:06 +00:00
Chris Lattner
bd03ac8567 Rename method
llvm-svn: 10593
2003-12-23 09:41:45 +00:00
Chris Lattner
30513e0a3a rename ClassifyExpression -> ClassifyExpr
llvm-svn: 10592
2003-12-23 08:04:08 +00:00
Chris Lattner
f732b6b926 Rename ClassifyExpression -> ClassifyExpr
llvm-svn: 10591
2003-12-23 08:03:40 +00:00
Chris Lattner
7e755e443f More minor non-functional changes. This now computes the exit condition, though
it doesn't do anything with it.

llvm-svn: 10590
2003-12-23 07:47:09 +00:00
Chris Lattner
93bfb6c741 Remove extraneous #include
finegrainify namespacification

llvm-svn: 10589
2003-12-23 07:43:38 +00:00
Chris Lattner
1e74843e7c Finegrainify namespacification
llvm-svn: 10588
2003-12-23 06:44:41 +00:00
Chris Lattner
0b428c107d bug fixed
llvm-svn: 10587
2003-12-22 23:56:37 +00:00
Chris Lattner
c2ee05427e Fix memory corruption bug PR193
llvm-svn: 10586
2003-12-22 23:49:36 +00:00
John Criswell
bd10d09b07 Reverted back to revision 1.11. The previous fix doesn't really fix
anything; it just causes the bug to go dormant.

llvm-svn: 10585
2003-12-22 16:22:49 +00:00
Alkis Evlogimenos
3ec903474f Fix crash when compiling twolf.
llvm-svn: 10584
2003-12-22 13:54:29 +00:00
Chris Lattner
a02d5aa6ce Don't mind me, I'm just refactoring away. This patch makes room for LFTR, but
contains no functionality changes.

llvm-svn: 10583
2003-12-22 09:53:29 +00:00
Chris Lattner
a86c4a3a01 finegrainify namespacification
Implement indvar analysis of getelementptr and sub expressions

llvm-svn: 10582
2003-12-22 05:26:29 +00:00
Chris Lattner
f1277450ab new testcase for cananonicalization of subtracts
llvm-svn: 10581
2003-12-22 05:24:45 +00:00
Chris Lattner
6449dcefbc Implement IndVarsSimplify/pointer-indvars.ll, transforming pointer
arithmetic into "array subscripts"

llvm-svn: 10580
2003-12-22 05:02:01 +00:00
Chris Lattner
bb661c18c8 finegrainify namespacification
add new getIntPtrType() method

llvm-svn: 10579
2003-12-22 05:01:15 +00:00
Chris Lattner
db65d6f14c Doxygenize methods, add new getIntPtrType method
llvm-svn: 10578
2003-12-22 05:00:45 +00:00
Chris Lattner
a5e3418d98 New testcase to see if -indvars can promote pointer arithmetic to array accesses
llvm-svn: 10577
2003-12-22 05:00:13 +00:00
Chris Lattner
2d69eae755 fix grammao
llvm-svn: 10576
2003-12-22 04:08:12 +00:00
Chris Lattner
8e570babb0 Bug fixed
llvm-svn: 10575
2003-12-22 04:06:24 +00:00
Chris Lattner
5abdc6fd3d The GCC problem is not specific to suse
llvm-svn: 10574
2003-12-22 04:06:12 +00:00
Chris Lattner
d3678bc7c5 Fix PR194
llvm-svn: 10573
2003-12-22 03:58:44 +00:00
Misha Brukman
69aa1ccb07 Really release memory used by functions. Patch by Chris.
llvm-svn: 10572
2003-12-22 03:47:58 +00:00
Misha Brukman
8834af99d6 Fix the URL to check the referrer for CSS conformity.
llvm-svn: 10571
2003-12-21 22:53:21 +00:00
Alkis Evlogimenos
690e1b8de2 Remove verifyIntervals() since it doesn't actually work right now.
llvm-svn: 10570
2003-12-21 20:41:26 +00:00
Alkis Evlogimenos
2665d9c6f9 Change weight into a float so that we can take into account the
nesting level when computing it. Right now the allocator uses:

    w = sum_over_defs_uses( 10 ^ nesting level );

llvm-svn: 10569
2003-12-21 20:19:10 +00:00
Chris Lattner
7b432f77ac New testcase for PR194
llvm-svn: 10568
2003-12-21 19:06:15 +00:00
Alkis Evlogimenos
2103574b32 Move FP_REG_KILL closer to the return instruction.
llvm-svn: 10567
2003-12-21 16:47:43 +00:00
Alkis Evlogimenos
c09b77ea35 Add support for inactive intervals. This effectively reuses registers
for live ranges that fall into assigned registers' holes.

llvm-svn: 10566
2003-12-21 05:43:40 +00:00
John Criswell
d8c7a7fbaa Fix PR#193.
Modified ReadArchiveBuffer() so that it dynamically allocates the
std::string object used to hold the bytecode object file's name.  This is
necessary because it is passed by reference to the new Module that is
allocated to represent the bytecode object, and previously we were
using a std::string that disappeared on function exit.

llvm-svn: 10565
2003-12-20 22:37:29 +00:00
Alkis Evlogimenos
2406ca8d71 Fix help string for --enable-spec2000 option
llvm-svn: 10564
2003-12-20 21:35:15 +00:00
Alkis Evlogimenos
27437e3318 Move FP_REG_KILL closer to the actual branch instruction.
llvm-svn: 10563
2003-12-20 17:28:15 +00:00
Alkis Evlogimenos
68cff6bf4d Remove floating point killer pass. This is now implemented in the
instruction selector by adding a new pseudo-instruction
FP_REG_KILL. This instruction implicitly defines all x86 fp registers
and is a terminator so that passes which add machine code at the end
of basic blocks (like phi elimination) do not add instructions between
it and the branch or return instruction.

llvm-svn: 10562
2003-12-20 16:22:59 +00:00
Chris Lattner
6448f89cdc Another day, another bug
llvm-svn: 10561
2003-12-20 10:29:02 +00:00
Chris Lattner
4cbb97bfdd Add a new target-independent machine code freeing pass
llvm-svn: 10560
2003-12-20 10:20:58 +00:00
Chris Lattner
452597611f Finally, _actually delete the machine code_ for a function, after it has
been emitted.  Also, since the FPK pass is causing memory access violations,
disable it.

llvm-svn: 10559
2003-12-20 10:20:19 +00:00
Chris Lattner
b1bbd7c7f6 This should not be needed anymore
llvm-svn: 10558
2003-12-20 10:19:18 +00:00
Chris Lattner
5219159892 Rearrange code, indent for the namespace, add the createMachineFunctionPrinterPass
to passes.h, and add the machien destruction pass to Passes.h

llvm-svn: 10557
2003-12-20 10:18:58 +00:00
Chris Lattner
af4304f807 Fix memory leak in the stackifier, due to the machinebasicblocks not holding
instructions on an ilist

llvm-svn: 10556
2003-12-20 10:12:17 +00:00
Chris Lattner
d46cd68695 Finegrainify namespacification
Minor cleanups to killer pass

llvm-svn: 10555
2003-12-20 09:58:55 +00:00
Chris Lattner
9a4898939a Hoist some sparc specific code into the sparc target
llvm-svn: 10554
2003-12-20 09:17:40 +00:00
Chris Lattner
9a3478e022 * Finegrainify namespacification
* Move sparc specific code out of generic code
* Eliminate the getOffset() method which made INVALID_FRAME_OFFSET
  necessary, which made pulling in MAX_INT as a sentinal necessary.

llvm-svn: 10553
2003-12-20 09:17:07 +00:00
Chris Lattner
299517dcde Remove sparc specific passes from public headers
llvm-svn: 10552
2003-12-20 09:15:21 +00:00
Chris Lattner
6800f92507 Remove a horrible API
llvm-svn: 10551
2003-12-20 09:15:01 +00:00
Chris Lattner
4df78f0fad PR135 is now finally fixed
llvm-svn: 10550
2003-12-20 03:42:11 +00:00
Chris Lattner
fbcc0aa18d Implement PR135, lazy emission of global variables
llvm-svn: 10549
2003-12-20 03:36:47 +00:00
Chris Lattner
620ac15114 Cleanups to implement PR135
llvm-svn: 10548
2003-12-20 03:35:50 +00:00
Chris Lattner
6bbe3ecee5 Simple refactorings to prepare for lazy global emission
Also, add a stat for the number of globals emitted

llvm-svn: 10547
2003-12-20 02:45:37 +00:00
Chris Lattner
dc997d9470 Simple refactorings to prepare for lazy global emission
llvm-svn: 10546
2003-12-20 02:45:16 +00:00
Chris Lattner
ddec71c3b6 A minor cleanup for better encapsulation
llvm-svn: 10545
2003-12-20 02:03:14 +00:00
Chris Lattner
9bcae072d1 Cleanup the JIT as per PR176. This renames the VM class to JIT, and merges the
VM.cpp and JIT.cpp files into JIT.cpp.  This also splits some nasty code out
into TargetSelect.cpp so that people hopefully won't notice it.  :)

llvm-svn: 10544
2003-12-20 01:46:27 +00:00
Chris Lattner
32ccf7e196 Update for changes in the JIT
llvm-svn: 10543
2003-12-20 01:45:17 +00:00
Chris Lattner
833c3c2597 Rip JIT specific stuff out of TargetMachine, as per PR176
llvm-svn: 10542
2003-12-20 01:22:19 +00:00
Chris Lattner
80a4508614 Eliminate a spurious warning
llvm-svn: 10540
2003-12-19 19:48:43 +00:00
Chris Lattner
fc7bdac1b3 Fix ADCE/2003-12-19-MergeReturn.llx
llvm-svn: 10539
2003-12-19 09:08:34 +00:00
Chris Lattner
b141a2aca6 New testcase for missed optimization
llvm-svn: 10538
2003-12-19 09:08:15 +00:00
Chris Lattner
b8b9163a2f Expand on the AliasSetTracker a bit, so I can remember this next time I come back to it. :)
llvm-svn: 10537
2003-12-19 08:43:07 +00:00
Chris Lattner
918460190f Remove the wierd "Operands" loop, by traversing basicblocks in reverse order
llvm-svn: 10536
2003-12-19 08:18:16 +00:00
Chris Lattner
86dd6d835c Add support for people calling main recursively
llvm-svn: 10535
2003-12-19 07:51:46 +00:00
Chris Lattner
547192d688 Implement LICM/sink_multiple.ll, by sinking all possible instructions in the
loop before hoisting any.

llvm-svn: 10534
2003-12-19 07:22:45 +00:00
Chris Lattner
a2d66a5ada New testcase
llvm-svn: 10533
2003-12-19 06:54:37 +00:00
Chris Lattner
3d35e879dc Turn QOI section into CQ section (QUI can be added later if needed)
Add PR187

llvm-svn: 10532
2003-12-19 06:31:56 +00:00
Chris Lattner
031a3f8cc7 Generalize a special case to fix PR187
llvm-svn: 10531
2003-12-19 06:27:08 +00:00
Chris Lattner
91daeb5431 Factor code out into the Utils library
llvm-svn: 10530
2003-12-19 05:58:40 +00:00
Chris Lattner
04efa4b155 Add new function
llvm-svn: 10529
2003-12-19 05:56:28 +00:00
Chris Lattner
8f668f26a6 If -enable-linscan is specified, add ENABLE_LINEARSCAN=1 to the make commandline
llvm-svn: 10527
2003-12-19 03:47:31 +00:00
Chris Lattner
4953be9c73 Update template
llvm-svn: 10525
2003-12-19 03:34:46 +00:00
Alkis Evlogimenos
7139090fd2 Remove TwoAddressInstruction from the public headers and add an ID
instead, since this pass doesn't expose any state to its users.

llvm-svn: 10520
2003-12-18 22:40:24 +00:00
Brian Gaeke
bbe0f1d795 Add install target for libraries.
llvm-svn: 10519
2003-12-18 20:57:48 +00:00
Chris Lattner
8f88cdfa22 Prune some #includes
Add a statistic for # reloads

llvm-svn: 10518
2003-12-18 20:25:31 +00:00
John Criswell
b22e9b4b35 Reverted back to previous revision - this was previously merged
according to the CVS log messages.

llvm-svn: 10517
2003-12-18 17:19:19 +00:00
John Criswell
86a3a48697 Merged in RELEASE_11.
llvm-svn: 10516
2003-12-18 16:43:17 +00:00
Alkis Evlogimenos
e5e2bd6777 Modify linear scan register allocator to use the two-address
instruction pass. This also fixes all remaining bugs for this new
allocator to pass all tests under test/Programs.

llvm-svn: 10515
2003-12-18 13:15:02 +00:00
Alkis Evlogimenos
3bd69eaac5 Fix bug in reserved registers. DH actually aliases DX and EDX which
are not reserved registers.

llvm-svn: 10514
2003-12-18 13:12:18 +00:00
Alkis Evlogimenos
c17d57bd82 Modify local register allocator to use the two-address instruction pass.
llvm-svn: 10513
2003-12-18 13:08:52 +00:00
Alkis Evlogimenos
725021cb6c Add TwoAddressInstructionPass to handle instructions that have two or
more operands and the two first operands are constrained to be the
same. The pass takes an instruction of the form:

        a = b op c

and transforms it into:

        a = b
        a = a op c

and also preserves live variables.

llvm-svn: 10512
2003-12-18 13:06:04 +00:00
Alkis Evlogimenos
4d87219486 Rename LiveIntervals::expired() to LiveIntervals::expiredAt().
llvm-svn: 10511
2003-12-18 08:56:11 +00:00
Alkis Evlogimenos
15b8036b29 When a variable is killed and redifined in a basic block only one
killing instruction is tracked. This causes the LiveIntervals to
create bogus intervals. The workaound is to add a range to the
interval from the redefinition to the end of the basic block.

llvm-svn: 10510
2003-12-18 08:53:43 +00:00
Alkis Evlogimenos
40874c708f Handle multiple virtual register definitions gracefully.
Move some of the longer LiveIntervals::Interval method out of the
header and add debug information to them. Fix bug and simplify range
merging code.

llvm-svn: 10509
2003-12-18 08:48:48 +00:00
Chris Lattner
b3fdf83d17 add boog
llvm-svn: 10508
2003-12-18 08:16:25 +00:00
Chris Lattner
9e2b42a0c8 When we delete instructions from the loop, make sure to remove them from the
AliasSetTracker as well.

llvm-svn: 10507
2003-12-18 08:12:32 +00:00
Chris Lattner
44fea5416d Add a new AliassetTracker::remove method. Because we need to be able to remove
a pointer from an AliasSet, maintain the pointer values on a doubly linked
list instead of a singly linked list, to permit efficient removal from the
middle of the list.

llvm-svn: 10506
2003-12-18 08:11:56 +00:00
Chris Lattner
cb6dfffa63 Check in patch that Reid submitted
llvm-svn: 10505
2003-12-18 06:40:22 +00:00
Misha Brukman
3096ca319a Fix the links to match our 'llvm' namespace in doxygen-generated docs.
llvm-svn: 10504
2003-12-17 23:10:49 +00:00
Misha Brukman
ee158ca708 * Converted C-style comments to C++
* Doxygenified comments
* Reordered #includes

llvm-svn: 10503
2003-12-17 22:08:20 +00:00
Misha Brukman
0f42585924 Reordered #includes.
llvm-svn: 10502
2003-12-17 22:06:28 +00:00
Misha Brukman
426275b96d Doxygenified some comments, reduced extraneous space.
llvm-svn: 10501
2003-12-17 22:06:08 +00:00
Misha Brukman
b01a80aa94 Reorganized the Sparc backend to be more modular -- each different
implementation of a Target{RegInfo, InstrInfo, Machine, etc} now has a separate
header and a separate implementation file.

This means that instead of a massive SparcInternals.h that forces a
recompilation of the whole target whenever a minor detail is changed, you should
only recompile a few files.

Note that SparcInternals.h is still around; its contents should be minimized.

llvm-svn: 10500
2003-12-17 22:04:00 +00:00
Misha Brukman
423ad188da Since we are now in the 'llvm' namespace, the mangled C++ name of structs
and hence the links, all change.

llvm-svn: 10495
2003-12-17 18:46:49 +00:00
John Criswell
d4e013e885 Added Stacker to Reid Spencer's list of contributions.
llvm-svn: 10494
2003-12-17 18:15:04 +00:00
Brian Gaeke
0a9980582d Make getObjectType() smarter about ranlibbed Mac OS X archives.
llvm-svn: 10493
2003-12-17 00:18:18 +00:00
Misha Brukman
91ed92fe5f Disable __attribute__((weak)) on Mac OS X and other lame platforms.
llvm-svn: 10489
2003-12-16 22:57:30 +00:00
Chris Lattner
e7670a0bbb Add a faq entry for the demo page
llvm-svn: 10488
2003-12-16 22:33:55 +00:00
Brian Gaeke
b69acf9a87 Fix typo in comment.
llvm-svn: 10487
2003-12-16 21:55:45 +00:00
Chris Lattner
e5ac39d664 There is no reason to add -load support to LLC
llvm-svn: 10483
2003-12-15 23:10:25 +00:00
Misha Brukman
34cba91956 Added info about PR186: weak linkage on memory functions.
llvm-svn: 10479
2003-12-15 22:48:12 +00:00
Misha Brukman
97f451555d Make all memory functions have weak linkage so that they can be overridden with
custom memory-management implementations (e.g., bash).

llvm-svn: 10478
2003-12-15 22:32:50 +00:00
Chris Lattner
6c08bb8b8e Fix for PR185 & IndVarsSimplify/2003-12-15-Crash.llx
llvm-svn: 10473
2003-12-15 17:34:02 +00:00
Chris Lattner
98c265a382 New testcase, for PR185
llvm-svn: 10471
2003-12-15 17:33:41 +00:00
Chris Lattner
83025b214b This header is dead
llvm-svn: 10470
2003-12-15 06:39:18 +00:00
Alkis Evlogimenos
8870674da7 Change preserve all claim to just preserve live variables and phielimination.
llvm-svn: 10469
2003-12-15 04:55:38 +00:00
Chris Lattner
ab475b85f7 New testcase
llvm-svn: 10468
2003-12-15 00:03:53 +00:00
Chris Lattner
884e824534 Refactor code just a little bit, allowing us to implement TailCallElim/return_constant.ll
llvm-svn: 10467
2003-12-14 23:57:39 +00:00
Chris Lattner
0fcc74f1df new test
llvm-svn: 10466
2003-12-14 23:39:34 +00:00
Chris Lattner
1809966189 Finegrainify namespacification
llvm-svn: 10465
2003-12-14 23:25:48 +00:00
Chris Lattner
c9499b6a20 Finegrainify namespacification
llvm-svn: 10464
2003-12-14 21:35:53 +00:00
Chris Lattner
dd978ce8c5 Finegrainify namespacification
Make the Timer code give correct user/system/user+system times when -track-memory is enabled

llvm-svn: 10463
2003-12-14 21:27:33 +00:00
Alkis Evlogimenos
fc2234ff4b I wonder how this didn't cause any tests to fail...
llvm-svn: 10462
2003-12-14 13:30:19 +00:00
Alkis Evlogimenos
aaba4639f8 Change interface of MachineOperand as follows:
a) remove opIsUse(), opIsDefOnly(), opIsDefAndUse()
    b) add isUse(), isDef()
    c) rename opHiBits32() to isHiBits32(),
              opLoBits32() to isLoBits32(),
              opHiBits64() to isHiBits64(),
              opLoBits64() to isLoBits64().

This results to much more readable code, for example compare
"op.opIsDef() || op.opIsDefAndUse()" to "op.isDef()" a pattern used
very often in the code.

llvm-svn: 10461
2003-12-14 13:24:17 +00:00
Alkis Evlogimenos
fbeb3b02c3 Change preserve all claim to just preserve live variables and phielimination.
llvm-svn: 10460
2003-12-14 10:14:23 +00:00
Chris Lattner
5a8a7282dc Rev the release notes to 1.2
llvm-svn: 10459
2003-12-14 05:03:43 +00:00
Chris Lattner
d1c371c32c Do not promote volatile alias sets into registers
llvm-svn: 10458
2003-12-14 04:52:31 +00:00
Chris Lattner
0a14060ce2 Finegrainify namespacification
Add capability to represent volatile AliasSet's
Propagate this information from loads&stores into the aliassets

llvm-svn: 10457
2003-12-14 04:52:11 +00:00
Chris Lattner
310da97240 Add capability to represent volatile AliasSet's
llvm-svn: 10456
2003-12-14 04:51:34 +00:00
Chris Lattner
29da20f96c Testcase for PR179
llvm-svn: 10455
2003-12-14 04:46:07 +00:00
Alkis Evlogimenos
4f7f017ab5 When reserving a preallocated register spill the aliases of this
register too.

llvm-svn: 10450
2003-12-13 11:58:10 +00:00
Alkis Evlogimenos
7dbdf3839c Ignore non-allocatable physical registers in live interval analysis.
llvm-svn: 10449
2003-12-13 11:11:02 +00:00
Alkis Evlogimenos
ed53b35076 Expire any active intervals left when register allocation is done.
llvm-svn: 10448
2003-12-13 05:50:19 +00:00
Alkis Evlogimenos
e6dc614c3c Add instruction numbers to debugging output.
llvm-svn: 10447
2003-12-13 05:48:57 +00:00
Alkis Evlogimenos
904cd6d48c Add a floating point killer pass. This pass runs before register
allocaton on the X86 to add information to the machine code denoting
that our floating point stackifier cannot handle virtual point
register that are alive across basic blocks. This pass adds an
implicit def of all virtual floating point register at the end of each
basic block.

llvm-svn: 10446
2003-12-13 05:36:22 +00:00
Alkis Evlogimenos
06f379a278 Handle explicit physical register defs.
llvm-svn: 10445
2003-12-13 05:26:39 +00:00
Alkis Evlogimenos
9bced9455a Remove unecessary if statements when looping on ImplicitDefs.
llvm-svn: 10444
2003-12-13 01:20:58 +00:00
Chris Lattner
6f9e65ef7a Try rewording stuff talking about unwinding. Hopefully it will make llvm sound less bad, and still make John happy. :)
llvm-svn: 10439
2003-12-12 21:33:08 +00:00
Chris Lattner
b84f3323f7 Link to lists, incorporate feedback from Tanya
llvm-svn: 10438
2003-12-12 21:22:16 +00:00
John Criswell
8cc89ca6bc Updated configure script so that it does not configure llvm/project
directories that do not contain a configure script.

llvm-svn: 10437
2003-12-12 20:15:23 +00:00
John Criswell
6f73d28adf Don't configure directories that don't have a configure script (i.e Stacker).
llvm-svn: 10436
2003-12-12 20:09:33 +00:00
John Criswell
c6efb11f02 Modified cast so that it converts the int to a long before casting to
a pointer.  This evades a warning emitted by GCC when we cast from
unsigned int (32 bit) to void * (64 bit) on SparcV9.

llvm-svn: 10435
2003-12-12 19:57:48 +00:00
John Criswell
604cd3c85f Fixed some minor typos.
Moved the new gccld feature to be in the list of enhancements.
Re-worded information on SPEC 2000 and Sparc support to try to make them
more accurate and precise.

llvm-svn: 10434
2003-12-12 19:54:20 +00:00
Brian Gaeke
13a2e54e0c Dynamically get the right-sized member of a GenericValue to hold a size_t, and
use it to return the result of strlen.

llvm-svn: 10433
2003-12-12 15:38:06 +00:00
Chris Lattner
542d24f530 PR177 is no longer among the open
llvm-svn: 10432
2003-12-12 07:26:25 +00:00
Chris Lattner
89af2d5a36 Implement the ExecutionEngine::getPointerToFunctionOrStub by forwarding the
request on to the TargetMachine if it supports the getJITStubForFunction method

llvm-svn: 10431
2003-12-12 07:12:02 +00:00
Chris Lattner
2e7416cb04 Implement the TargetMachine::getJITStubForFunction method for X86, finegrainify
namespacification.

llvm-svn: 10430
2003-12-12 07:11:18 +00:00
Chris Lattner
538dffd9fa Add new getJITStubForFunction method, which may optionally be implemented by
targets for better performance.

llvm-svn: 10429
2003-12-12 07:10:32 +00:00
Chris Lattner
fa41ea3397 Doxygenify comments, remove extraneous #include
llvm-svn: 10428
2003-12-12 06:31:42 +00:00
Chris Lattner
4b34b35549 Note about bytecode format
llvm-svn: 10427
2003-12-12 05:52:39 +00:00
Brian Gaeke
8657acc07e Since we are using a gep_type_iterator, we apparently must get the type
index by using I.getOperand() here. This was failing an assertion on
basically every struct access.

llvm-svn: 10426
2003-12-12 05:13:05 +00:00
Brian Gaeke
e60a0289d4 Use uintptr_t for pointer values in the ExecutionEngine.
llvm-svn: 10425
2003-12-12 05:06:09 +00:00
Brian Gaeke
1fe9f83b52 Fix typo in comment
llvm-svn: 10424
2003-12-12 04:58:13 +00:00
Chris Lattner
eb8b184825 These aren't bugs, don't phrase them like they are.
llvm-svn: 10423
2003-12-12 04:56:02 +00:00
Chris Lattner
88e24cffe6 I'm a spaz
llvm-svn: 10422
2003-12-12 04:51:00 +00:00
Chris Lattner
d25f26fce8 Add note about Stacker, duh!
llvm-svn: 10421
2003-12-12 04:45:09 +00:00
Misha Brukman
8395d737f2 Break lines and add space after ':' to be consistent in layout.
llvm-svn: 10420
2003-12-12 04:37:31 +00:00
Chris Lattner
e76e9abeab More updates for the release
llvm-svn: 10419
2003-12-12 04:25:33 +00:00
Brian Gaeke
d24cfed317 Throw better error messages, by calling strerror(errno) when we
get an error inside the bytecode reader.

llvm-svn: 10415
2003-12-12 00:47:44 +00:00
Brian Gaeke
1f147379b7 Add an assertion to make sure we are at least getting argv[0] right.
Use a clearer error message when we fail to load a program.

llvm-svn: 10414
2003-12-12 00:47:19 +00:00
Chris Lattner
e4151eba68 Update release notes for PR86 and C++ support
llvm-svn: 10413
2003-12-11 23:31:21 +00:00
Chris Lattner
1eed55d6b9 Factor out some duplicated code, implement the rest of the cases in
BasicAA/2003-12-11-ConstExprGEP.ll

llvm-svn: 10412
2003-12-11 23:20:16 +00:00
Chris Lattner
ace41617c7 Rename variable to avoid confusing it with the global G
llvm-svn: 10411
2003-12-11 22:49:32 +00:00
Chris Lattner
6ea17f77f8 Fix PR86. This makes basicaa _SIGNIFICANLY_ more aggressive with getelementptr's
llvm-svn: 10410
2003-12-11 22:44:13 +00:00
Chris Lattner
34399dda2d Fix LICM/2003-12-11-SinkingToPHI.ll, and quite possibly all of the other known problems in the universe.
llvm-svn: 10409
2003-12-11 22:23:32 +00:00
Chris Lattner
99146bb2a7 New testcase that LICM is breaking crafty on
llvm-svn: 10408
2003-12-11 22:15:11 +00:00
Chris Lattner
62aff8412a Finegrainify namespacification
Add new -print-cfg-only pass

llvm-svn: 10407
2003-12-11 21:48:18 +00:00
Chris Lattner
027253b0d5 verifyFunction depends on dominator info, which levelraise does not declare
that it needs.  This is pretty scary code!  This fixes

Regression.Transforms.LevelRaise.2002-07-16-SourceAndDestCrash
Regression.Transforms.LevelRaise.2002-07-31-AssertionFailure

llvm-svn: 10406
2003-12-11 21:47:37 +00:00
Chris Lattner
15b2e377ae Fix test that was failing because we were optimizing the program better than expected :)
llvm-svn: 10404
2003-12-11 21:06:43 +00:00
Chris Lattner
659a500e57 New testcase for PR86
llvm-svn: 10403
2003-12-11 19:16:30 +00:00
Chris Lattner
ed9fc4baad Run tailcall elimination in a more logical place
llvm-svn: 10402
2003-12-11 17:50:32 +00:00
Chris Lattner
17790fbb5b Fix a glaring bug
llvm-svn: 10400
2003-12-11 06:06:28 +00:00
Chris Lattner
bc1197f292 Realize the gep P, <zeros> must aliases P.
This is a partial fix for PR 86

llvm-svn: 10399
2003-12-11 06:02:00 +00:00
Chris Lattner
abb3bea6ce With Brian's change to AA.h we can now clean out this uglyness
llvm-svn: 10398
2003-12-11 05:44:59 +00:00
Brian Gaeke
b453bc5957 IncludeFile hack to pull in BasicValueNumbering whenever ValueNumbering.h
is included.

llvm-svn: 10397
2003-12-11 05:05:56 +00:00
Brian Gaeke
b06e7b1766 IncludeFile hack to pull in BasicAliasAnalysis whenever AliasAnalysis.h
is included.

llvm-svn: 10396
2003-12-11 05:05:02 +00:00
Brian Gaeke
a03eeb0b7d Separate out target for cleaning up qmtest garbage.
llvm-svn: 10395
2003-12-11 04:48:38 +00:00
Brian Gaeke
4c563b8af1 Add more fixed bugs. Keep llvm core section sorted by pr#. (Is that ok?)
llvm-svn: 10394
2003-12-11 04:40:58 +00:00
Chris Lattner
95c13c92ff Stop laughing Misha
llvm-svn: 10393
2003-12-11 00:58:34 +00:00
Brian Gaeke
36fb4f19cd In getObjectType(), doxygenify comment, and take a pointer to the
beginning of the archive member data as an argument.

Get rid of ParseLongFilenameSection(), which is dead.

In ReadArchiveBuffer(), implement support for 4.4BSD/MacOSX long filenames.
This is kind of invasive, because they prepend the long filename to the archive
member data, and then lie about the size. So we have to keep track of the real
size.

llvm-svn: 10392
2003-12-11 00:38:04 +00:00
Brian Gaeke
e869e0cfa8 Turn off "attribute weak" to pacify Mac OS X's system compiler, which prints a
warning whenever it sees it.

llvm-svn: 10391
2003-12-11 00:24:36 +00:00
Brian Gaeke
2bba152fb8 Fix typo in comment. Add prototype for getConstantExprValue().
llvm-svn: 10390
2003-12-11 00:23:28 +00:00
Brian Gaeke
5a8ec7d5f6 Add support for --debug-only=interpreter, to print out instrs before
interpreting them.

Move support for getting the value of a ConstantExpr into
getConstantExprValue(), and add support for the rest of the different
kinds of ConstantExprs.  (I don't think I like ConstantExprs!)
This requires separate procedures executeShlInst() and executeShrInst().

Reduce the number of references to TheEE.

Get rid of an old comment mentioning annotations.

Fix exitCalled(), which was crashing the Interpreter. This was a
leftover from the return-value code refactoring.

llvm-svn: 10389
2003-12-11 00:22:59 +00:00
John Criswell
fb55ac24ec This appears to fix Bug 172 and does not break any other feature tests or
regression tests.

llvm-svn: 10388
2003-12-10 22:51:41 +00:00
Chris Lattner
6281fd3ead Fix bug: LICM/sink_multiple_exits.ll
Thanks for pointing this out John  :)

llvm-svn: 10387
2003-12-10 22:35:56 +00:00
Chris Lattner
55c2113b7b Don't allow dead instructions to stop sinking early.
llvm-svn: 10386
2003-12-10 20:43:29 +00:00
Chris Lattner
713907e2b8 Fix bug: IndVarsSimplify/2003-12-10-RemoveInstrCrash.llx
llvm-svn: 10385
2003-12-10 20:43:04 +00:00
Chris Lattner
a8953e38d2 A new testcase, reduced by bugpoint
llvm-svn: 10384
2003-12-10 20:39:53 +00:00
Chris Lattner
7e5bd59da2 Finegrainify namespacification
Fix bug: LowerInvoke/2003-12-10-Crash.llx

llvm-svn: 10382
2003-12-10 20:22:42 +00:00
Chris Lattner
02f7e71d35 new testcase
llvm-svn: 10381
2003-12-10 20:18:09 +00:00
John Criswell
3c721a8b15 Fixed a comma error.
Added the --disable-threads option to GCC configure (to avoid pthread errors
when building code with LLVM).

llvm-svn: 10380
2003-12-10 20:04:13 +00:00
Brian Gaeke
f2484742b7 Support 'make install' for LLVM include files.
llvm-svn: 10378
2003-12-10 18:41:20 +00:00
John Criswell
65b3acdd5b Upon Chris's suggestion, moved the #ifdef's to the generated C code.
This makes LLVM and the generated C code more portable.

llvm-svn: 10377
2003-12-10 18:17:57 +00:00
Chris Lattner
ccd9f3c1f8 Finegrainify namespacification
Reorder #includes
Implement: IndVarsSimplify/2003-12-10-IndVarDeadCode.ll

llvm-svn: 10376
2003-12-10 18:06:47 +00:00
John Criswell
83fb097ed0 Fixed the CBE on Solaris/Sparc. We need to define the return value of
the write() system call because it returns 64 bits on Solaris 64 bit,
and an implicit return value of int says it returns 32 bits.
Admittedly, this is a bit of a hack.

llvm-svn: 10375
2003-12-10 18:06:34 +00:00
Chris Lattner
ae974caa05 New testcase
llvm-svn: 10374
2003-12-10 17:57:38 +00:00
Chris Lattner
7710f2f49e Finegrainify namespacification
Fix bug: LoopSimplify/2003-12-10-ExitBlocksProblem.ll

llvm-svn: 10373
2003-12-10 17:20:35 +00:00
Chris Lattner
679b49d7f5 New testcase which caused a bunch of tests to break last night with more
aggressive LICM

llvm-svn: 10372
2003-12-10 17:09:35 +00:00
Chris Lattner
6364314a6e Simplify code
llvm-svn: 10371
2003-12-10 16:58:24 +00:00
Chris Lattner
48b4b852b4 Avoid performing two identical lookups when one will suffice
llvm-svn: 10370
2003-12-10 16:57:24 +00:00
Chris Lattner
edda1af35a Make LICM itself a bit more efficient, and make the generated code more efficient too: don't insert a store in every exit block, because a particular block may be exited to more than once by a loop
llvm-svn: 10369
2003-12-10 15:56:24 +00:00
John Criswell
cf657689bb Removed the pthread_once() function because it doesn't actually do
what it's supposed to do.
Just leave this library as a dummy library for now until we have time to
port a real pthread library (or get glibc working).

llvm-svn: 10368
2003-12-10 15:43:07 +00:00
Chris Lattner
bff5116da6 Finegrainify namespacification
llvm-svn: 10367
2003-12-10 15:34:03 +00:00
Chris Lattner
8dee84159f Finegrainify namespacification
Provide a context module to WriteAsOperand

llvm-svn: 10366
2003-12-10 15:33:59 +00:00
John Criswell
c619c3cd14 Added the --host= option to the Sparc configuration directions.
llvm-svn: 10364
2003-12-10 15:27:29 +00:00
John Criswell
eaf4835c65 Dummy implementation of the pthread library.
This is needed since libstdc++ uses pthread_once().

llvm-svn: 10360
2003-12-10 14:46:36 +00:00
Chris Lattner
98cd4bf06f Make 'opt -o -' work correctly instead of creating a file named './-'
llvm-svn: 10359
2003-12-10 14:41:33 +00:00
Chris Lattner
aaaea51090 Implement instruction sinking out of loops. This still can do a little bit
better job, but this is the majority of the work.  This implements
LICM/sink*.ll

llvm-svn: 10358
2003-12-10 06:41:05 +00:00
Chris Lattner
289df6b3de new testcase, checking to ensure we handle yet-another spiffy case correctly
llvm-svn: 10357
2003-12-10 05:42:23 +00:00
Brian Gaeke
e545345131 Don't assume that system headers define 'uint' or 'ulong' as types.
llvm-svn: 10356
2003-12-10 05:06:38 +00:00
Brian Gaeke
09db53be57 Fix apparent copy-and-paste-o.
Get rid of %debug - Mac OS X bison doesn't have it.  sigh.

llvm-svn: 10352
2003-12-10 04:33:07 +00:00
Brian Gaeke
0f148bcbc0 Add support for installing tool executables.
llvm-svn: 10351
2003-12-10 00:26:28 +00:00
Brian Gaeke
a3664d9d18 Add installation directories and commands, standardly provided by configure.
llvm-svn: 10350
2003-12-10 00:25:32 +00:00
Chris Lattner
9c450fc665 Yet another hard testcase
llvm-svn: 10349
2003-12-09 23:29:25 +00:00
Chris Lattner
6c237bcdf2 Do not insert one entry PHI nodes in split exit blocks!
llvm-svn: 10348
2003-12-09 23:12:55 +00:00
Brian Gaeke
ddc088a9e4 Check in the llvm-native-gcc script, which I use in the process of
debugging front-end miscompilations.

llvm-svn: 10347
2003-12-09 22:23:24 +00:00
Chris Lattner
720348331c Add a new testcase which breaks the sinker because the loop canonnicalization
pass does not do a canonnicalization that the sinker wants.

llvm-svn: 10346
2003-12-09 22:05:08 +00:00
Chris Lattner
b7924b166a Fix buggy test
llvm-svn: 10345
2003-12-09 21:45:23 +00:00
Chris Lattner
88ca84b809 New testcase for sinking operations from loops with multiple exits
llvm-svn: 10344
2003-12-09 21:40:36 +00:00
Chris Lattner
eea64fd916 Make the test a bit harder so that we test to ensure that _both_ instructions
are sunk

llvm-svn: 10343
2003-12-09 20:50:20 +00:00
Chris Lattner
65c1193d55 Refactor code a little bit, eliminating the gratuitous InstVisitor, which
should make subsequent changes simpler.  This also allows us to hoist vaarg
and vanext instructions

llvm-svn: 10342
2003-12-09 19:32:44 +00:00
Chris Lattner
c05176843e Fine grainify namespacification
Code cleanups
Make LICM::SafeToHoist marginally more efficient

llvm-svn: 10341
2003-12-09 17:18:00 +00:00
Chris Lattner
d719cd1e5b New testcases for LICM improvement: code sinking.
llvm-svn: 10339
2003-12-09 16:56:51 +00:00
Chris Lattner
9056881d76 Improve portability with Mac OS/X
llvm-svn: 10338
2003-12-09 16:49:12 +00:00
Chris Lattner
9c9240447b Improve testcase portability on OS/X
llvm-svn: 10337
2003-12-09 16:48:24 +00:00
Chris Lattner
db677331f2 New testcase that is not actually handled yet, but should be in the future.
This is here to remind me to get back to this after a while.

llvm-svn: 10336
2003-12-09 16:26:42 +00:00
John Criswell
7dd715180d Added the -h option for compatibility with other linkers.
llvm-svn: 10335
2003-12-09 15:39:11 +00:00
Chris Lattner
18b6f0f46d Whoops, forgot to check this in. :)
llvm-svn: 10334
2003-12-08 23:41:09 +00:00
Chris Lattner
50663a1a78 Implement: TailCallElim/accum_recursion_constant_arg.ll
Also make sure to clean up any PHI nodes that are inserted which are pointless.

llvm-svn: 10333
2003-12-08 23:37:35 +00:00
Chris Lattner
198e620752 Implement: test/Regression/Transforms/TailCallElim/accum_recursion.ll
We now insert accumulator variables as necessary to eliminate tail recursion
more aggressively.  This is still fairly limited, but allows us to transform
fib/factorial, and other functions into nice happy loops.  :)

llvm-svn: 10332
2003-12-08 23:19:26 +00:00
Chris Lattner
3c31f8c5c3 New testcase for automatic insertion of accumulator variables to eliminate
tail recursion

llvm-svn: 10331
2003-12-08 23:16:25 +00:00
Chris Lattner
b662b064f6 Add a missing semi colon, which breaks bison 1.5
llvm-svn: 10325
2003-12-08 20:15:33 +00:00
Chris Lattner
102779e12a Simplify makefiles by just explicitly listing directories
llvm-svn: 10324
2003-12-08 20:12:46 +00:00
John Criswell
ffc722a7f3 Updated build instructions for Sparc.
llvm-svn: 10323
2003-12-08 19:59:14 +00:00
John Criswell
beb0b29871 Fixed the dynamic generation of the list of subdirectories to compile.
llvm-svn: 10322
2003-12-08 17:52:32 +00:00
Chris Lattner
86ad4c05d0 implement method
llvm-svn: 10321
2003-12-08 08:23:04 +00:00
Chris Lattner
e6492f1057 Use the new method, though noone currently implements it any better than before
llvm-svn: 10320
2003-12-08 08:22:48 +00:00
Chris Lattner
d71a033370 add two new virtual functions:
The first returns a function pointer or a stub if it's not already generated
  The second exposes what was previously JIT specific state to general clients

llvm-svn: 10319
2003-12-08 08:22:01 +00:00
Chris Lattner
c0e1b071b9 Finegrainify namespacification
llvm-svn: 10318
2003-12-08 08:06:28 +00:00
Chris Lattner
bd7356a5d3 Makefile updates contributed by Reid
llvm-svn: 10317
2003-12-08 07:08:00 +00:00
Chris Lattner
d2a55f3041 New bug
llvm-svn: 10316
2003-12-08 06:33:19 +00:00
Misha Brukman
d899432617 effect' is the noun, affect' is the verb.
llvm-svn: 10315
2003-12-08 06:22:05 +00:00
Chris Lattner
b8d989e055 New testcase for PR165
llvm-svn: 10314
2003-12-08 06:18:37 +00:00
Chris Lattner
408916bc32 Add note about sucky suse compiler
llvm-svn: 10313
2003-12-08 05:43:19 +00:00
Chris Lattner
a7b6f3ab9c Cleanup and restructure the code to make it easier to read and maintain.
The only functionality change is that we now implement:
  Regression/Transforms/TailCallElim/intervening-inst.ll

Which is really kinda pointless, because it means that trivially dead code
does not interfere with -tce, but trivially dead code probably wouldn't be
around anytime when this pass is run anyway.

The point of including this change it to support other more aggressive
transformations when we have the analysis capabilities to do so.

llvm-svn: 10312
2003-12-08 05:34:54 +00:00
Chris Lattner
82ac26c8ba New testcase, this should be -tailcallelim'inated
llvm-svn: 10311
2003-12-08 05:32:48 +00:00
Chris Lattner
16f1a8f761 Since ssaification of the varargs builtings, the vaarg instruction no longer
can write to memory.

llvm-svn: 10310
2003-12-08 05:29:33 +00:00
Brian Gaeke
ed16349810 Regenerated using autoheader-2.57
llvm-svn: 10309
2003-12-08 00:57:01 +00:00
Chris Lattner
69d47e7314 Bugpoint had appalingly bad grammar. Fix some of it.
llvm-svn: 10308
2003-12-07 02:43:09 +00:00
Chris Lattner
233b069113 Do not leave a bunch of crud lying around
llvm-svn: 10307
2003-12-07 02:31:03 +00:00
Chris Lattner
b762ddbdf1 It is now after pldi. This issue has been fixed, so remove the hack
llvm-svn: 10306
2003-12-07 01:44:18 +00:00
Chris Lattner
771804b541 Implement RaiseAllocations/FreeCastConstantExpr.ll
llvm-svn: 10305
2003-12-07 01:42:08 +00:00
Chris Lattner
ffb2d08c4a New testcase that the raiseallocations pass should be able to handle.
llvm-svn: 10304
2003-12-07 01:25:36 +00:00
Chris Lattner
8427bffb9a * Finegrainify namespacification
* Transform: free <ty>* (cast <ty2>* X to <ty>*) into free <ty2>* X

llvm-svn: 10303
2003-12-07 01:24:23 +00:00
Chris Lattner
d1ea9cd345 The recalclulate method was a nasty hack that was once used by the -cee pass,
which never worked itself.  The cee pass still doesn't work, but it doesn't use
this method anymore anyway, so eliminate the method.

llvm-svn: 10302
2003-12-07 00:55:32 +00:00
Chris Lattner
00f5167693 Completely rewrite domset, idom, and domtree implementation. Now it is based
on the algorithm for directly computing immediate dominators presented in this
paper:

  A Fast Algorithm for Finding Dominators in a Flowgraph
  T. Lengauer & R. Tarjan, ACM TOPLAS July 1979, pgs 121-141.

This _substantially_ speeds up construction of all dominator related information.
Post-dominators to follow.

llvm-svn: 10301
2003-12-07 00:38:08 +00:00
Chris Lattner
31b77bbf7e Rewrite dominators implementation. Now domset is constructed from immdom,
instead of the other way around.

llvm-svn: 10300
2003-12-07 00:36:16 +00:00
Chris Lattner
f9f7c2d302 Finegrainify namespacification
Move method out of generic dominators construction code

llvm-svn: 10299
2003-12-07 00:35:42 +00:00
Chris Lattner
d48220fabe Move this method out of the generic dominators calculation code
llvm-svn: 10298
2003-12-07 00:35:19 +00:00
Tanya Lattner
c970a38824 New command line parsing. This isn't as perfect as I would have liked. The CommandLine Library needs to be extended, in order to parse the options and allow for optional dashes. In addition, the help option isn't correct since I do the parsing mostly myself. But this is in the ocorrect ar format.
llvm-svn: 10297
2003-12-06 23:01:25 +00:00
Chris Lattner
dca8b84bde Stop using the -fshort-enum compile option
llvm-svn: 10296
2003-12-06 20:59:45 +00:00
Chris Lattner
d98fecb76e Fix awkward wording
llvm-svn: 10295
2003-12-06 20:24:46 +00:00
Chris Lattner
ba7bd4720d Cleanup the release notes in preparation for the release.
llvm-svn: 10294
2003-12-06 20:22:41 +00:00
Brian Gaeke
7ee7b40af5 Add check for pthread_mutex_lock() in -lpthread (or otherwise).
Regenerated configure w/ autoconf-2.57.

llvm-svn: 10293
2003-12-05 19:29:01 +00:00
Alkis Evlogimenos
e59ad4b441 Make assertion stricter. Since the source operands are allocated at
this point, the second operand must be a physical register (it cannot
be a virtual one).

llvm-svn: 10292
2003-12-05 11:31:39 +00:00
Alkis Evlogimenos
f8fe176204 Fix bug in register spilling when a preallocated live range overlaps a
potential register assignment.

llvm-svn: 10291
2003-12-05 11:17:55 +00:00
Alkis Evlogimenos
2de099e54f Move operator<<(std::ostream&, const LiveInterval&) out of the header file.
llvm-svn: 10290
2003-12-05 10:38:28 +00:00
Alkis Evlogimenos
ed28ca93ef Sort live intervals by increasing start point.
llvm-svn: 10289
2003-12-05 10:32:01 +00:00
Alkis Evlogimenos
5fe0031c68 Improve debugging output and clean up some code.
llvm-svn: 10288
2003-12-04 03:57:28 +00:00
Chris Lattner
40d2aeb28f Finegrainify namespacification
Fix regressions ScalarRepl/basictest.ll & arraytest.ll

llvm-svn: 10287
2003-12-02 17:43:55 +00:00
Brian Gaeke
93823ed30c Lock abstraction, introduced with a view toward making the JIT thread-safe.
Eventually.

llvm-svn: 10284
2003-12-01 21:33:31 +00:00
Chris Lattner
e0da6ec8b6 Make stripped-bytecode a recursive target
llvm-svn: 10283
2003-12-01 07:28:25 +00:00
Chris Lattner
9b0eb852c7 Add new block number
llvm-svn: 10281
2003-12-01 07:08:06 +00:00
Chris Lattner
d9cf9b30eb Emit & read more compressed bytecode by not emitting a bytecodeblock for
each basic block in function.  Instead, just emit a stream of instructions,
chopping up basic blocks based on when we find terminator instructions.  This
saves a fairly substantial chunk of bytecode space.  In stripped, sample
cases, for example, we get this reduction in size:

197.parser: 163036 -> 137180:  18.8% reduction
254.gap   : 844936 -> 689392:  22.6%
255.vortex: 621724 -> 528444:  17.7%

...

Not bad for something this simple.  :)  Note that this doesn't require a new
bytecode version number at all, though version 1.1 should not need to support
the old format.

llvm-svn: 10280
2003-12-01 07:05:31 +00:00
Chris Lattner
7c290ed25a Remove unused enum value
llvm-svn: 10279
2003-12-01 05:40:37 +00:00
Brian Gaeke
fed9ed96a4 This may fix the "0 dirs" stuff we get in the nightly tests when they are
checking out over remote cvs connections.

llvm-svn: 10278
2003-12-01 05:31:12 +00:00
Chris Lattner
cc04614ee5 Add some "useful" methods
llvm-svn: 10277
2003-12-01 05:30:29 +00:00
Chris Lattner
6d760d7cb3 Add an option to enable the SSA based peephole optimizer.
Eventually this pass will provide substantially better code in the interim between when we
have a crappy isel and nice isel.  Unfortunately doing so requires fixing the backend to
actually SUPPORT all of the fancy addressing modes that we now generate, and writing a DCE
pass for machine code.  Each of these is a fairly substantial job, so this will remain disabled
for the immediate future.  :(

llvm-svn: 10276
2003-12-01 05:18:30 +00:00
Chris Lattner
a913723309 Add a new SSA-based peephole optimizer which includes copy propagation and
folding of instructions into addressing modes.  This creates lots of dead
instructions, which are currently not deleted.  It also creates a lot of
instructions that the X86 backend currently cannot handle.  :(

llvm-svn: 10275
2003-12-01 05:15:28 +00:00
Chris Lattner
128937bbe2 generalize the instruction types permitted a bit
llvm-svn: 10274
2003-12-01 05:13:56 +00:00
Chris Lattner
6cf03df531 fix broken link
llvm-svn: 10273
2003-12-01 05:12:09 +00:00
Alkis Evlogimenos
26f17e73eb Print instructions before register allocation is performed. Also fix
bug where spill instructions were added to the next basic block
instead of the end of the current one if the instruction that required
the spill was the last in the block.

llvm-svn: 10272
2003-11-30 23:40:39 +00:00
Chris Lattner
0fcba7f6b3 add missing dependency
llvm-svn: 10271
2003-11-30 09:22:42 +00:00
Chris Lattner
d8218923ae Finegrainify namespacification
llvm-svn: 10270
2003-11-30 06:13:25 +00:00
Chris Lattner
121d04d1ae A line was missing
llvm-svn: 10269
2003-11-30 05:46:14 +00:00
Alkis Evlogimenos
0aa40f8db0 Remove "numReloaded" statistic.
llvm-svn: 10268
2003-11-30 05:15:36 +00:00
Chris Lattner
98e72b4bb3 Emit constants to one contiguous block, but this time, respect alignment constraints.
If this doesn't work Misha, feel free to revert it.

llvm-svn: 10267
2003-11-30 04:23:21 +00:00
Misha Brukman
873cf93b6e Go back to allocating memory for each constant separately. Since SPARCs do not
allow unaligned loads, that is probably the problem I've been seeing in numerous
SPARC test cases failing. X86, on the other hand, just slows down unaligned
accesses, since it must make 2 aligned accesses for each unaligned one.

llvm-svn: 10266
2003-11-30 00:50:53 +00:00
Chris Lattner
58efc9e0fe be 3.4 happy
llvm-svn: 10265
2003-11-29 20:04:13 +00:00
Chris Lattner
839030b3a8 be GCC 3.4 clean
llvm-svn: 10264
2003-11-29 19:55:12 +00:00
Chris Lattner
594654f17d Hrm, how could this compile?
llvm-svn: 10263
2003-11-29 19:55:02 +00:00
Chris Lattner
982b285232 Fix compatibility with gcc 3.4
llvm-svn: 10262
2003-11-29 19:45:47 +00:00
Chris Lattner
3edb8478a4 Build _lib_crtend.a, not crtend.a
llvm-svn: 10260
2003-11-29 10:24:57 +00:00
Chris Lattner
d52319f54e Don't print out tons of crap
llvm-svn: 10259
2003-11-29 10:14:17 +00:00
Chris Lattner
910c8d834e Rewrite makefile logic to build an archive instead of a .o file. This is
intended to address PR142

llvm-svn: 10257
2003-11-29 10:05:30 +00:00
Chris Lattner
fe8f8b4947 Simplify some rules
Move LGCCLDPROG from test/Makefile.tests

llvm-svn: 10256
2003-11-29 09:50:15 +00:00
Chris Lattner
462444e1ea Move rule to top-level makefile
llvm-svn: 10255
2003-11-29 09:49:14 +00:00
Chris Lattner
46c6693781 Add readme and spiff up makefile header
llvm-svn: 10254
2003-11-29 09:22:53 +00:00
Chris Lattner
212e596ede Testcase for duplicated cleanup work (PR11). Note that this testcase is not actually
tested automatically, so it is practically useless.  However, it seemed silly to throw
away my testcase, so here it is.

llvm-svn: 10253
2003-11-29 09:10:50 +00:00
Chris Lattner
8384f97ee4 Fix test: Transforms/LevelRaise/2003-11-28-IllegalTypeConversion.ll
Some gep generalization changes

llvm-svn: 10252
2003-11-29 05:31:25 +00:00
Chris Lattner
6d94d10377 new testcase for problem causing 2003-10-12-GlobalVarInitializers failures
llvm-svn: 10251
2003-11-29 05:19:15 +00:00
Chris Lattner
8abd7dca76 The function resolving pass must be run, even if -disable-opt is specified
llvm-svn: 10250
2003-11-28 09:44:03 +00:00
Chris Lattner
fcaa6fbbd8 * The return value of LinkLibraries is ignored, so remove it.
* Finegrainify namespacification of Linker.cpp
* If linking a library in fails, do not STOP LINKING IN LIBRARIES AND
  CONTINUE ANYWAY!  Instead, just output the warning, and keep going. :)

llvm-svn: 10249
2003-11-28 07:44:09 +00:00
Chris Lattner
1fdd8a45c3 fix gcc 3.4 compatibility problem
llvm-svn: 10248
2003-11-28 01:46:06 +00:00
Chris Lattner
68ac670086 Testcase for PR160
llvm-svn: 10247
2003-11-28 01:32:03 +00:00
Chris Lattner
9201586a98 New testcase for PR158
llvm-svn: 10246
2003-11-27 21:25:07 +00:00
Chris Lattner
40487e450b Fix grammaro
llvm-svn: 10245
2003-11-27 21:17:48 +00:00
Chris Lattner
ff4aa6dbe2 testcase for PR159
llvm-svn: 10244
2003-11-27 20:47:16 +00:00
Chris Lattner
a24a54d2f4 PR11 is now fixed for 1.1!
llvm-svn: 10243
2003-11-27 09:52:03 +00:00
Chris Lattner
8139b78c03 PR11 is now fixed for 1.1
llvm-svn: 10242
2003-11-27 09:51:54 +00:00
Chris Lattner
2a7033255e * Squelch warning on Sun
* stdlib and friends are system headers
* 'long long' is the type that consistently turns into the LLVM 'long' type.

llvm-svn: 10241
2003-11-27 07:48:45 +00:00
John Criswell
f1387a59bf Makefiles are now copies over to the object root directory dynamically.
llvm-svn: 10240
2003-11-26 20:09:49 +00:00
John Criswell
96be650984 Renamed intermediate values that used the same type and name as previous
values.  All of these files should assemble now.

llvm-svn: 10239
2003-11-26 14:45:37 +00:00
Chris Lattner
0548bc2472 Bugz die!
llvm-svn: 10238
2003-11-26 08:20:34 +00:00
Chris Lattner
9192f90865 Testcase for PR157
llvm-svn: 10237
2003-11-26 07:35:52 +00:00
Chris Lattner
6789a0b1d4 To not barf when an error occurs.
llvm-svn: 10236
2003-11-26 07:24:58 +00:00
Chris Lattner
b27353c892 Boogs
llvm-svn: 10235
2003-11-26 02:48:00 +00:00
Chris Lattner
86d5c1ca2b More dead boogers
llvm-svn: 10233
2003-11-26 01:18:49 +00:00
Chris Lattner
eb64b6a922 output foo(void) as appropriate
llvm-svn: 10232
2003-11-26 00:09:17 +00:00
Chris Lattner
883b73f0a8 Fix bug in previous checkin
llvm-svn: 10231
2003-11-25 23:44:40 +00:00
John Criswell
a0d50d2ebc Fixed a small grammatical error.
Explained that function return types cannot be aggregate types.
Explained that functions with the same name but different type signatures
are considered to be different functions.

llvm-svn: 10230
2003-11-25 21:45:46 +00:00
Chris Lattner
f5569bb9a5 Fix const correctness
llvm-svn: 10229
2003-11-25 21:28:00 +00:00
Chris Lattner
ad70d4a15b Relax constrains on GEP type indexes
llvm-svn: 10228
2003-11-25 21:21:46 +00:00
Chris Lattner
1c45d5185f It is legal to index into sequential types with any integer
llvm-svn: 10227
2003-11-25 21:20:19 +00:00
Chris Lattner
52310702a1 Do not use index type to determine what it is indexing into!
llvm-svn: 10226
2003-11-25 21:09:18 +00:00
Chris Lattner
637ee39933 Do not depend on the gep index types to determine what flavor of index it is
llvm-svn: 10225
2003-11-25 20:49:55 +00:00
Chris Lattner
f078808a2b Do not depend on structure elements being of type UByteTy
llvm-svn: 10224
2003-11-25 20:44:56 +00:00
John Criswell
4d29d2d222 Adjusted the projects Makefile so that it picks up the name of projects
by scanning the source tree (not the object tree).

llvm-svn: 10223
2003-11-25 20:37:45 +00:00
John Criswell
297baed1ec Configure all project directories contained in llvm/projects.
The autoconf program will generate a warning about how we should use a
literal in AC_CONFIG_SUBDIRS.  This warning can be ignored.

llvm-svn: 10222
2003-11-25 20:36:46 +00:00
Chris Lattner
567444309a Do not depend on index type to determine whether it is a structure or sequential index
llvm-svn: 10221
2003-11-25 20:19:55 +00:00
Chris Lattner
be157c0303 Work with gepi's and constant exprs. Also, add versions of iterator ctors that take references
llvm-svn: 10220
2003-11-25 20:17:49 +00:00
Chris Lattner
a346e64218 Fix file header
llvm-svn: 10219
2003-11-25 20:11:47 +00:00
Chris Lattner
c3de7c4ec2 Remove dead variable
llvm-svn: 10218
2003-11-25 20:11:00 +00:00
Chris Lattner
388bc98954 Use gep_type_begin/end instead of looking for ubytes
llvm-svn: 10217
2003-11-25 20:10:07 +00:00
John Criswell
ec83537e24 Configure script for ModuleMaker.
llvm-svn: 10216
2003-11-25 20:02:07 +00:00
John Criswell
7cf9343ff2 Auto-confed ModuleMaker.
llvm-svn: 10215
2003-11-25 19:59:59 +00:00
John Criswell
f7f165d79b Auto-conf'ed the ModuleMaker code.
Moved Makefile.common to Makefile.common.in.

llvm-svn: 10214
2003-11-25 19:59:21 +00:00
Chris Lattner
fbcc1bf418 Rename class to be consistent with other iterator classes
llvm-svn: 10213
2003-11-25 19:58:35 +00:00
Chris Lattner
4fc8dc08b4 Initial checkin of gep_type_begin/end which will be used to address PR82
llvm-svn: 10212
2003-11-25 19:37:28 +00:00
John Criswell
6df35dd70d All directory targets now install the Makefile only if it is missing.
Directory targets no longer check for existance of the directory in the
object tree; if the Makefile doesn't exist, we will re-create the directory.
This seems to be a pretty good assumption and saves us from checking
directory existance each time.

llvm-svn: 10211
2003-11-25 19:32:22 +00:00
Chris Lattner
359974801e Finegrainify namespacification
llvm-svn: 10210
2003-11-25 18:33:40 +00:00
John Criswell
e8eab29899 Added a pseudo-hack: The Makefile now copies Makefiles from source tree to
object tree if it is missing.  This means that new Makefiles should get
picked up automagically, requiring less bothersome re-configuring after
updates.

llvm-svn: 10209
2003-11-25 17:49:22 +00:00
Chris Lattner
83f43a0469 boog
llvm-svn: 10207
2003-11-25 08:49:12 +00:00
Chris Lattner
1ffe97d37e testcase for PR 148
llvm-svn: 10206
2003-11-25 08:45:38 +00:00
Chris Lattner
4d9a30c0c4 Testcase for PR147
llvm-svn: 10205
2003-11-25 03:58:49 +00:00
Chris Lattner
2a18c640df Fix PR147
llvm-svn: 10204
2003-11-25 03:54:16 +00:00
Chris Lattner
7471686252 add link to the stacker dox
llvm-svn: 10203
2003-11-25 03:32:57 +00:00
Chris Lattner
866cf53102 Minor fixes
llvm-svn: 10202
2003-11-25 01:44:27 +00:00
Chris Lattner
89e5fc82bb Apply docs patch fro Reid
llvm-svn: 10201
2003-11-25 01:35:06 +00:00
Chris Lattner
48b383b015 checkin reid's docpatch
llvm-svn: 10200
2003-11-25 01:02:51 +00:00
John Criswell
b1367f4af7 Modified directory building rules so that using the cd program/alias is
not necessary.

llvm-svn: 10199
2003-11-24 18:31:01 +00:00
Brian Gaeke
31715d3a42 Apply doc patch from PR136.
llvm-svn: 10198
2003-11-24 17:03:38 +00:00
Misha Brukman
bb718f14e0 Fix copy-pasto.
llvm-svn: 10197
2003-11-24 05:36:38 +00:00
Misha Brukman
c10bf39a7d I'm gonna be picky and say we don't really need that trailing slash "lib/"
llvm-svn: 10196
2003-11-24 05:31:57 +00:00
Misha Brukman
44a562bba6 Make sure we ONLY add a `-load' switch to the JIT command line if the file is
verified as having an ELF header. This fixes PR151.

llvm-svn: 10195
2003-11-24 05:29:42 +00:00
Misha Brukman
f0c7647c11 Expose functionality to query if a file is an ELF shared object.
llvm-svn: 10194
2003-11-24 05:28:39 +00:00
Misha Brukman
7c9144b5f5 Add ability to query if a file is a legitimate ELF shared object.
llvm-svn: 10193
2003-11-24 05:28:12 +00:00
Brian Gaeke
49f7a39017 Apply patches from PR136
llvm-svn: 10192
2003-11-24 02:57:25 +00:00
Brian Gaeke
cd52465b70 Regenerated using autoconf-2.57
llvm-svn: 10191
2003-11-24 02:54:57 +00:00
Brian Gaeke
afa30637ec Add Stacker directories.
llvm-svn: 10190
2003-11-24 02:54:17 +00:00
Brian Gaeke
af20761f7e Add documentation for Stacker.
llvm-svn: 10189
2003-11-24 02:52:51 +00:00
Chris Lattner
d23b79e525 Add a script I missed
llvm-svn: 10188
2003-11-23 18:12:51 +00:00
Chris Lattner
6484bf7423 Checkin tests
llvm-svn: 10187
2003-11-23 18:12:22 +00:00
Chris Lattner
75759839b2 Disable test.
llvm-svn: 10186
2003-11-23 18:10:25 +00:00
Chris Lattner
210bccc1c2 Fix these assertions:
stkrc -e -f -o testing.bc testing.st
Global is external, but doesn't have external linkage!
[1024 x int]* %_stack_
Global is external, but doesn't have external linkage!
long* %_index_
Broken module found, compilation aborted!

llvm-svn: 10185
2003-11-23 18:06:37 +00:00
Chris Lattner
3425ec0764 Checkin the stacker compiler
llvm-svn: 10184
2003-11-23 18:01:26 +00:00
Chris Lattner
f2f20d2940 Fix file header
llvm-svn: 10183
2003-11-23 17:59:43 +00:00
Chris Lattner
67ac5055cf Initial checkin
llvm-svn: 10182
2003-11-23 17:58:46 +00:00
Chris Lattner
1a12f7c9ca Initial checkin of stacker samples
llvm-svn: 10181
2003-11-23 17:55:19 +00:00
Chris Lattner
ce06685210 Adjust file header
llvm-svn: 10180
2003-11-23 17:54:18 +00:00
Chris Lattner
3e6e58efc0 Initial checkin of stacker runtime
llvm-svn: 10179
2003-11-23 17:53:46 +00:00
Chris Lattner
42472ef3bc Initial stacker checkin
llvm-svn: 10178
2003-11-23 17:52:55 +00:00
Chris Lattner
cea87e289f Update file header
llvm-svn: 10177
2003-11-23 17:51:56 +00:00
Chris Lattner
4594ed9048 initial checkin of stacker makefile
llvm-svn: 10176
2003-11-23 17:51:37 +00:00
Chris Lattner
3f1ad878ac Do not DESTROY programs by default. No wonder bugpoint was not being useful all this time!
llvm-svn: 10175
2003-11-23 04:51:05 +00:00
Brian Gaeke
edb102c266 A better way to get std::pair into the compiler's little, walnut-sized brain.
llvm-svn: 10174
2003-11-23 03:50:31 +00:00
Brian Gaeke
124d7fd7f0 This is a hack to make this file compile under g++-3.0.x;
otherwise it can't decide what std::pair is. It seemed relatively
harmless.

llvm-svn: 10173
2003-11-23 00:55:27 +00:00
Chris Lattner
db8a179838 Revert the previous patch since it causes lots of miscompilations. :( :(
llvm-svn: 10172
2003-11-22 19:07:47 +00:00
Brian Gaeke
84c0efc946 Support constant casting constant pointers to ints/uints, and/or
the other way around, instead of failing a large, tumor-like assertion.

llvm-svn: 10171
2003-11-22 07:18:25 +00:00
Brian Gaeke
9ba9225b35 Constant shift expressions, meet InstSelectSimple. Yow!!
llvm-svn: 10170
2003-11-22 06:49:41 +00:00
Brian Gaeke
8581a625df Unbreak this test case - llvm-as no longer tolerates redefining names in any
given type plane.

llvm-svn: 10169
2003-11-22 06:18:35 +00:00
Brian Gaeke
e42b8fd298 Stub for constant shift expr support.
llvm-svn: 10168
2003-11-22 05:18:35 +00:00
Brian Gaeke
03f3611633 Fix PR149 - support constant shift expressions.
llvm-svn: 10167
2003-11-22 05:02:56 +00:00
Brian Gaeke
27a077209b Strengthen test case.
llvm-svn: 10166
2003-11-22 05:01:57 +00:00
Brian Gaeke
b4c1782c7a C Writer was dumping core on this test case.
llvm-svn: 10165
2003-11-22 04:58:25 +00:00
Chris Lattner
28ebb3e0a6 Delete dead line
llvm-svn: 10164
2003-11-22 02:26:17 +00:00
Chris Lattner
f40cdbe856 Fix bug: Transforms/PruneEH/2003-11-21-PHIUpdate.llx
llvm-svn: 10163
2003-11-22 02:20:36 +00:00
Chris Lattner
519900a36d New testcase that breaks the pruneeh pass
llvm-svn: 10162
2003-11-22 02:20:08 +00:00
Chris Lattner
4cc2cc5c58 Do not crash when deleing a region with a dead invoke instruction
llvm-svn: 10161
2003-11-22 02:13:08 +00:00
Chris Lattner
7b233af247 Do not crash when dealing with invoke and unwind instructions!
llvm-svn: 10160
2003-11-22 02:10:38 +00:00
Chris Lattner
1e6089c2d6 Use new interfaces
llvm-svn: 10159
2003-11-22 02:10:26 +00:00
Misha Brukman
74d4df83cd Switch to the standard footer. This page is not yet W3C-compliant.
llvm-svn: 10158
2003-11-22 01:30:01 +00:00
Chris Lattner
1ad805977d Finegrainify namespacification
The module stripping pass should not strip symbols on external globals

llvm-svn: 10157
2003-11-22 01:29:35 +00:00
Misha Brukman
e8e932a671 Align the W3C images on the right side, bottom of page.
llvm-svn: 10156
2003-11-22 01:26:21 +00:00
Misha Brukman
85ea4bb678 Styles for the page footer to align images properly.
llvm-svn: 10155
2003-11-22 01:23:53 +00:00
Misha Brukman
68aab3b3cf Put the W3C graphics on the right side of the page.
llvm-svn: 10154
2003-11-22 01:23:39 +00:00
Chris Lattner
3a9b2322e3 Add newly fixed pr
llvm-svn: 10153
2003-11-22 01:14:58 +00:00
Misha Brukman
58ec434f03 This page now uses valid HTML 4.01 Strict and valid CSS.
llvm-svn: 10152
2003-11-22 01:07:30 +00:00
Misha Brukman
7cb4e38e2e This document is now valid HTML 4.01 Strict and valid CSS.
We shall display images to that effect.

If you modify this file, check that you haven't broken anything by clicking on
those links, or I will hunt you down and force you to memorize the HTML and CSS
specs!!

llvm-svn: 10151
2003-11-22 01:00:11 +00:00
Misha Brukman
bff6032a34 * No borders on images used as links
* Drop font-size from doc_footer class

This is now valid CSS.

llvm-svn: 10150
2003-11-22 00:59:08 +00:00
Misha Brukman
80731b92ee * Use stylesheets
* Close <li>, <a>, and <p> tags

llvm-svn: 10149
2003-11-22 00:38:41 +00:00
Misha Brukman
d181666052 * Add code to flush the ICache, which any self-respecting SMC must do
* Restore registers *after* everything else to avoid any possible side effects

This fixes McCat-imp.

llvm-svn: 10147
2003-11-21 23:48:54 +00:00
Chris Lattner
3ae303cc8c Check return types of functions
llvm-svn: 10146
2003-11-21 22:32:23 +00:00
Misha Brukman
bc2d3308fe Made paragraph structure more consistent.
llvm-svn: 10145
2003-11-21 22:30:25 +00:00
Chris Lattner
0e10ae4d0b New testcase
llvm-svn: 10144
2003-11-21 22:28:49 +00:00
Misha Brukman
ffec0b7730 Added note about PR140: gccld generates script to run apps and load libraries.
llvm-svn: 10143
2003-11-21 22:11:12 +00:00
Chris Lattner
61b3f20bf1 Considering that CI is not even IN SCOPE here, I wooda thought the compiler
would have caught this.  *sigh*

llvm-svn: 10142
2003-11-21 21:57:29 +00:00
Chris Lattner
f52e03c79e Finegrainify namespacification
llvm-svn: 10138
2003-11-21 21:54:22 +00:00
Chris Lattner
456031eed7 Get rid of using decls, finegrainify namespacification
llvm-svn: 10137
2003-11-21 21:52:10 +00:00
Chris Lattner
51c28a5c1b * Finegrainify namespacification
* Make the cost metric for passing constants in as arguments to functions MUCH
  more accurate, by actually estimating the amount of code that will be constant
  propagated away.

llvm-svn: 10136
2003-11-21 21:46:09 +00:00
Chris Lattner
a82f131abb Finegrainify namespacification
Print out the costs for functions that AREN'T inlined as well

llvm-svn: 10135
2003-11-21 21:45:31 +00:00
Chris Lattner
52b4fb3fde Reorder passes a bit. In particular, it makes sense to run globaldce IMMEDIATELY after funcresolve. Also, run the mem2reg pass _early_ so that IPCP and DAE actually do stuff.
Run instcombine and simplify cfg after this to cleanup the intraprocedural messes we create.

llvm-svn: 10134
2003-11-21 21:44:35 +00:00
Chris Lattner
dcdc371522 Fix problem Reid was having with external globals and nonexternal linkage
llvm-svn: 10133
2003-11-21 20:33:27 +00:00
Chris Lattner
199bb859a9 Don't crash on bogus source value
llvm-svn: 10132
2003-11-21 20:27:35 +00:00
Chris Lattner
189d19fb04 Finegrainify namespacification
llvm-svn: 10131
2003-11-21 20:23:48 +00:00
John Criswell
745d0a5414 Fixed another minor grammatical error.
llvm-svn: 10130
2003-11-21 17:42:22 +00:00
Chris Lattner
7e5e456d96 Fix some problems with assertions printing
llvm-svn: 10129
2003-11-21 17:35:51 +00:00
Chris Lattner
9d72c2f229 improve error message
llvm-svn: 10128
2003-11-21 17:06:29 +00:00
Chris Lattner
a29600046d Minor cleanups and simplifications
llvm-svn: 10127
2003-11-21 16:52:05 +00:00
John Criswell
cc32e6e62a Minor grammatical and punctuation corrections.
llvm-svn: 10126
2003-11-21 16:09:42 +00:00
Brian Gaeke
71040f9251 Clean more qmtest files.
llvm-svn: 10125
2003-11-21 01:12:47 +00:00
Chris Lattner
3bf4fd9030 This function REALLY DOES return void
llvm-svn: 10124
2003-11-20 21:22:32 +00:00
Chris Lattner
8791e26de1 * Finegrainify namespacification
* Implement FuncResolve/2003-11-20-BogusResolveWarning.ll
   ... which eliminates a large number of annoying warnings.  I know misha
   will miss them though!

llvm-svn: 10123
2003-11-20 21:21:31 +00:00
Chris Lattner
4eb18ce26d Fix an all too common form of the 'Found global types that are not compatible' warning
llvm-svn: 10122
2003-11-20 21:04:35 +00:00
Chris Lattner
5eac2d6615 Bug
llvm-svn: 10121
2003-11-20 20:59:57 +00:00
Chris Lattner
72e6b0c252 New testcase for PR143
llvm-svn: 10120
2003-11-20 20:57:33 +00:00
Brian Gaeke
ce9a00cea6 Blow away compiled versions of qmtest classes on 'make clean'.
llvm-svn: 10119
2003-11-20 19:57:17 +00:00
Brian Gaeke
67ae512a4b Fix0r a test that mistakenly used %llvmg++ instead of %llvmgxx.
llvm-svn: 10118
2003-11-20 19:51:11 +00:00
Chris Lattner
16bbed20fa Bug
llvm-svn: 10117
2003-11-20 19:30:17 +00:00
Chris Lattner
e5c6861b70 New testcase for PR132
llvm-svn: 10116
2003-11-20 19:27:12 +00:00
Chris Lattner
65334f117c Bug fix
llvm-svn: 10115
2003-11-20 19:11:47 +00:00
Misha Brukman
1df12628a0 When writing out the runner script, add -load=<lib> lines to pull in all the
shared objects automagically, so it doesn't have to be done by hand.

llvm-svn: 10114
2003-11-20 19:08:42 +00:00
Misha Brukman
c0e6157f99 Add ability to search only for native shared object, and expose the
functionality to the rest of gccld.

llvm-svn: 10113
2003-11-20 19:08:06 +00:00
Chris Lattner
f636784489 New testcase for PR141
llvm-svn: 10112
2003-11-20 19:05:21 +00:00
Chris Lattner
2af517281d Start using the nicer terminator auto-insertion API
llvm-svn: 10111
2003-11-20 18:25:24 +00:00
Chris Lattner
63a0ccff44 Spew symbolic types!
llvm-svn: 10110
2003-11-20 18:23:14 +00:00
Chris Lattner
18e5d5228a When spewing out warnings during function resolution, do not vomit out pages
and pages of non-symbolic types.

llvm-svn: 10109
2003-11-20 18:19:35 +00:00
Chris Lattner
9ab47d1625 Somehow I forgot poor little UnwindInst
*sniff*

llvm-svn: 10108
2003-11-20 18:11:56 +00:00
Chris Lattner
0e03ab67c3 * Finegrainify namespacification
* Add new constructors to allow insertion of terminator instructions at the
  end of basic blocks.
* Move a ReturnInst method out-of-line, so that the vtable and type info don't
  need to be emitted to every translation unit that uses the class.

llvm-svn: 10107
2003-11-20 17:45:12 +00:00
Chris Lattner
1183b6f5b0 * Add new constructors to allow insertion of terminator instructions at the
end of basic blocks.
* Document some confusing constructor combinations
* Move a ReturnInst method out-of-line, so that the vtable and type info don't
  need to be emitted to every translation unit that uses the class.

llvm-svn: 10106
2003-11-20 17:44:37 +00:00
Misha Brukman
aa525937c7 For consistency, removed space between function name and left paren in function
call, i.e. [ addPass (...) ]  =>  [ addPass(...) ]

llvm-svn: 10105
2003-11-20 06:26:15 +00:00
Misha Brukman
d16a03727b * Doxygenified comments, simplifying them and shortening in the process
* Eliminated extra space

llvm-svn: 10104
2003-11-20 06:21:54 +00:00
Alkis Evlogimenos
0e9ded74c0 Merging the linear scan register allocator in trunk. It currently passes most tests under test/Programs/SingleSource/Benchmarks/Shootout so development will continue on trunk. The allocator is not enabled by default. You will need to pass -regallo=linearscan to lli or llc to use it.
llvm-svn: 10103
2003-11-20 03:32:25 +00:00
Chris Lattner
c4fe9729a2 One new bug fixed, one old bug fixed.
llvm-svn: 10102
2003-11-20 01:07:41 +00:00
Chris Lattner
5a3a2398f4 Testcase for PR113
llvm-svn: 10101
2003-11-20 00:32:57 +00:00
Chris Lattner
2447ef59c4 Don't crash if we are printing an orphaned basic block!
llvm-svn: 10100
2003-11-20 00:09:43 +00:00
Brian Gaeke
d2553359a8 Unbreak the "-" as filename hack.
llvm-svn: 10099
2003-11-19 22:15:00 +00:00
Chris Lattner
592db40359 bugz
llvm-svn: 10098
2003-11-19 22:05:38 +00:00
Brian Gaeke
618026afb2 Also print an error msg. for files we cannot currently deal with.
llvm-svn: 10097
2003-11-19 21:57:30 +00:00
Brian Gaeke
55447b4541 Fix PR134, by checking FileOpenable() on each input file before analyzing its
type.

llvm-svn: 10096
2003-11-19 21:52:09 +00:00
Chris Lattner
b1b4359294 New testcase for PR133
llvm-svn: 10095
2003-11-19 21:37:52 +00:00
John Criswell
f4720a1575 We now support different expectations for different OS's/architectures.
llvm-svn: 10094
2003-11-19 21:13:25 +00:00
Chris Lattner
29681dee09 Fine grainify namespaceification
llvm-svn: 10093
2003-11-19 21:08:57 +00:00
Chris Lattner
20816bc43e update test
llvm-svn: 10092
2003-11-19 19:47:36 +00:00
Chris Lattner
efdc952714 Genericize tests
llvm-svn: 10091
2003-11-19 19:44:28 +00:00
Chris Lattner
ff675bf580 Cleanup test
llvm-svn: 10090
2003-11-19 19:42:12 +00:00
Chris Lattner
45cfe54683 Really, there was a reason for me factoring that out
llvm-svn: 10089
2003-11-19 19:20:20 +00:00
Chris Lattner
1a02ca932c *** Significantly speed up type resultion
This change speeds up type resolution by checking to see if a type is
  recursive, and if it's not, using a more efficient algorithm.

  This dramatically reduces bytecode loading time of kc++, reducing time-to-jit
  kc++ --version to 17s from 33s

llvm-svn: 10088
2003-11-19 19:10:23 +00:00
Chris Lattner
c39fcfff0d Improve test portability
llvm-svn: 10087
2003-11-19 18:37:06 +00:00
Chris Lattner
d19da4ce5b Fix testcase. This should no longer be XFAIL'd
llvm-svn: 10086
2003-11-19 18:34:44 +00:00
Chris Lattner
9c68fa3ab1 * Finegrainify namespacification
* Strength reduce several data structures which were left over from the
  "bad old days"
* Minor efficiency improvements
* Major efficiency improvement: In BytecodeParser::insertValue, do not allocate
  a new ValueTab entry just because some value exists with a large type.  This
  dramatically reduces the number of allocations/deallocations performed by the
  bytecode reader, and speeds up parsing of Kimwitu++ from 34s to 17s.  This is
  to help address PR127

llvm-svn: 10085
2003-11-19 17:27:18 +00:00
Chris Lattner
8700c28ac9 Minor efficiency improvements, finegrainify namespacification
llvm-svn: 10084
2003-11-19 17:21:11 +00:00
Chris Lattner
bf346b526f In the future, these slabs can be null...
llvm-svn: 10083
2003-11-19 17:20:42 +00:00
Chris Lattner
11e8f1b595 Minor efficiency improvements all over. Finegrainify Namespacification
llvm-svn: 10082
2003-11-19 17:17:36 +00:00
Chris Lattner
e8de15976a Fine grainify namespacification, #include file that defines the interface!
llvm-svn: 10081
2003-11-19 16:06:55 +00:00
Chris Lattner
a11f78167b Finegrainify namespacification
llvm-svn: 10080
2003-11-19 06:14:38 +00:00
Chris Lattner
ffa9d511f9 Minor speedup to do less linear time searches of information we already have.
speeds up disassembly of kc++ by .6s

llvm-svn: 10079
2003-11-19 06:01:12 +00:00
Chris Lattner
2335331635 add new FAQ entry
llvm-svn: 10078
2003-11-19 05:53:12 +00:00
Chris Lattner
983c667a41 More bugz
llvm-svn: 10077
2003-11-19 01:08:24 +00:00
Chris Lattner
eedde31b7d New testcase for PR 130
llvm-svn: 10076
2003-11-19 01:03:16 +00:00
Chris Lattner
74c55dd4f9 Fix PR130, and testcase test/Regression/Linker/2003-11-18-TypeResolution.ll
llvm-svn: 10075
2003-11-19 01:02:52 +00:00
Chris Lattner
c4cc197549 Testcase for PR131
llvm-svn: 10074
2003-11-18 23:46:07 +00:00
Chris Lattner
cf40b3f394 Add a few new bugs
llvm-svn: 10073
2003-11-18 23:04:02 +00:00
Chris Lattner
ef8c3fed25 new testcase for PR126
llvm-svn: 10072
2003-11-18 21:05:55 +00:00
Chris Lattner
47487608a9 New testcase for PR125
llvm-svn: 10071
2003-11-18 20:30:00 +00:00
Chris Lattner
05906cf0f0 Testcase for PR128
llvm-svn: 10070
2003-11-18 20:24:46 +00:00
Chris Lattner
8c09ecf0c9 Fix PR123
llvm-svn: 10069
2003-11-18 17:47:05 +00:00
John Criswell
956cf45674 Added the new GCC front end section to the table of contents.
llvm-svn: 10068
2003-11-18 16:08:49 +00:00
John Criswell
5e0f07e0c2 Added information on the GCC front end.
llvm-svn: 10067
2003-11-18 16:05:23 +00:00
Brian Gaeke
921440c309 Only use -Wl,-R. if HAVE_LINK_R.
llvm-svn: 10066
2003-11-18 06:31:17 +00:00
Chris Lattner
37d449d870 Add new bug fixed in the CFE
llvm-svn: 10065
2003-11-18 06:25:05 +00:00
Brian Gaeke
d2ca66ee8c Regenerated using autoheader-2.57
llvm-svn: 10064
2003-11-18 06:21:24 +00:00
Brian Gaeke
3f6b856c7d Regenerated using autoconf-2.57
llvm-svn: 10063
2003-11-18 06:20:41 +00:00
Brian Gaeke
3ed17192d0 Fix breakage caused by typos. Use 3-arg form of AC_DEFINE.
llvm-svn: 10062
2003-11-18 06:19:27 +00:00
Brian Gaeke
e86d843420 Update to reflect the fact that llvm-nm can read archives now.
llvm-svn: 10061
2003-11-18 06:18:09 +00:00
Misha Brukman
be755279f3 Emit the MachineConstantPool constants in one contiguous memory `pool'.
llvm-svn: 10060
2003-11-17 20:40:07 +00:00
Misha Brukman
fc16bb1af5 * Order #includes as per style guide
* Delete blank comment lines
* Eliminate space between function name and open-paren ( to be consistent

llvm-svn: 10059
2003-11-17 20:37:02 +00:00
Chris Lattner
dc2e39191a Implement == and != correctly. Before they would incorrectly return !=
for some constant exprs when they could really be the same value

llvm-svn: 10058
2003-11-17 20:19:35 +00:00
Chris Lattner
e120a73166 The ConstantPointer class is now gone.
llvm-svn: 10057
2003-11-17 19:47:21 +00:00
John Criswell
6ee0ed5745 Added a check for the -R linker option.
llvm-svn: 10056
2003-11-17 19:46:02 +00:00
Misha Brukman
4f7ce560d5 This file was somehow missing a top-level comment line.
llvm-svn: 10055
2003-11-17 19:35:17 +00:00
Chris Lattner
77f20dc13f No REALLY, get rid of ConstantPointer references
llvm-svn: 10054
2003-11-17 19:21:04 +00:00
Chris Lattner
4b6addf98a Eliminate use of the ConstantPointer class
llvm-svn: 10053
2003-11-17 19:19:32 +00:00
Chris Lattner
9d9cbcf246 Constant folding shalt not be built on annotations
llvm-svn: 10052
2003-11-17 19:05:17 +00:00
Chris Lattner
ea25538936 Remove usage of ConstantPointer
llvm-svn: 10051
2003-11-17 17:28:29 +00:00
Chris Lattner
c96e96b26d Be a bit more tolerant of broken code
llvm-svn: 10050
2003-11-17 01:17:04 +00:00
Chris Lattner
a3bdbd0f82 Fix copy-and-pasteo
llvm-svn: 10049
2003-11-17 01:07:58 +00:00
Brian Gaeke
3589140eb7 Regenerated using autoconf-2.57.
llvm-svn: 10048
2003-11-17 00:31:43 +00:00
Brian Gaeke
7027ed8cd8 Edit some comments slightly.
Set OS (build OS) and ARCH (target arch) based on the proper elements (SYSTEM,
 and CPU, respectively) of the CPU-COMPANY-SYSTEM tuples.
Add OS and ARCH settings for PowerPC/Darwin (Mac OS X).

llvm-svn: 10047
2003-11-17 00:30:48 +00:00
Brian Gaeke
c5961314fa add PR117
llvm-svn: 10046
2003-11-16 23:49:26 +00:00
Brian Gaeke
9c917abe9f Document -disable-opt option that I added.
llvm-svn: 10045
2003-11-16 23:39:11 +00:00
Brian Gaeke
747777795f Include Support/FileUtilities.h.
Print module identifier in DumpSymbolNamesFromModule().
In DumpSymbolNamesFromFile(), check whether it is an archive or a bytecode
 file, and call the corresponding reader function (ParseBytecodeFile or
 ReadArchiveFile).
Unconditionally set MultipleFiles for archives.
Fixes PR117.

llvm-svn: 10044
2003-11-16 23:34:13 +00:00
Brian Gaeke
900cc96e08 Implement skeletal support for __.SYMDEF (ranlib) sections in archives.
Correctly parse the Long Filename section of the archive.
When reading in archive members, set their ModuleIDs to
 "ARCHIVENAME(MEMBERNAME)", as is traditional.

llvm-svn: 10043
2003-11-16 23:08:48 +00:00
Brian Gaeke
fda1f1835b When you hand WriteAsOperand a type, it now prints out its symbolic name.
llvm-svn: 10042
2003-11-16 23:08:27 +00:00
Brian Gaeke
9f47927b28 When failing a Verifier assertion, use WriteAsOperand to print out the
offending types and/or values.

llvm-svn: 10041
2003-11-16 23:07:42 +00:00
Brian Gaeke
eb3de8f39a Add a -verify option to verify the results of gccld passes.
Add a -disable-opt option to turn off gccld optimization passes.

llvm-svn: 10040
2003-11-16 23:07:28 +00:00
Brian Gaeke
7ff0d09adc When we find a module we want, in an archive, in verbose mode,
print out the module's identifier (which should now contain the name
 of both the archive and the module.)
Wrap some lines at 80 cols.

llvm-svn: 10039
2003-11-16 23:07:13 +00:00
Chris Lattner
00211f1d80 Don't print 'No predecessors!' on the entry block
llvm-svn: 10038
2003-11-16 22:59:57 +00:00
Chris Lattner
9dd6a82318 Bugz fixed
llvm-svn: 10037
2003-11-16 22:11:42 +00:00
Chris Lattner
5529caeba7 There is no need to rely on LLI working for this test
llvm-svn: 10036
2003-11-16 22:07:45 +00:00
Chris Lattner
9005b8000c ISO 9899 7.13.2.1 (3) says that "[...] the values of objects of automatic
storage duration that are local to the function containing the invocation of the
[...] setjmp macro that do not have volatile-qualified type and have been
changed between the setjmp invocation and longjmp call are indeterminate."

As such, we have to mark all variables in a function that uses 'invoke' as
volatile.

This fixes PR77

llvm-svn: 10035
2003-11-16 22:06:14 +00:00
Chris Lattner
eec1307f43 Testcase for PR116
llvm-svn: 10034
2003-11-16 21:47:01 +00:00
Chris Lattner
2f486b8bde add adce bug
llvm-svn: 10033
2003-11-16 21:42:48 +00:00
Chris Lattner
841dd53555 Fix PR116
llvm-svn: 10032
2003-11-16 21:39:27 +00:00
Chris Lattner
1765b4cfbd New testcase, for PR 115
llvm-svn: 10031
2003-11-16 20:47:05 +00:00
Chris Lattner
b2e4d6d847 Bugz
llvm-svn: 10030
2003-11-16 20:25:24 +00:00
Chris Lattner
82f87e63e8 Fixes for PR114: Thanks to Reid Spencer!
llvm-svn: 10029
2003-11-16 20:21:15 +00:00
Brian Gaeke
27b10bc781 Regenerated with autoconf-2.57.
llvm-svn: 10025
2003-11-16 18:38:14 +00:00
Brian Gaeke
dfbd3d466a Only default to the llvm-gcc in ~lattner if that directory exists.
Only warn if python version is not right; don't abort.
Add sanity checks for --with-llvmgccdir, with a big warning message at the end.

llvm-svn: 10024
2003-11-16 18:37:46 +00:00
Brian Gaeke
2b00004734 As per PR96, don't build subdirs if LLVMGCCDIR is not set to something
reasonable, instead, print out a "LOUD warning".

llvm-svn: 10023
2003-11-16 06:51:53 +00:00
Misha Brukman
c40257f1e5 Stylesheets: they do a website good!
llvm-svn: 10003
2003-11-14 17:34:38 +00:00
Chris Lattner
ab6895ea76 Implement a small optimization to handling of GEP's that are equivalent to casts.
This results in substantially reduced collapsing for some testcases

llvm-svn: 10002
2003-11-14 17:09:46 +00:00
Chris Lattner
93dea78f85 I can't believe the incompetence of the people I have to deal with around here.
These fools don't even wrap code at 80 columns.

Oh wait, _I_ wrote that.  That explains a lot!!

llvm-svn: 9999
2003-11-14 16:34:25 +00:00
Chris Lattner
7c04a29ea6 Bugz come in, bugs go out
llvm-svn: 9995
2003-11-14 06:42:01 +00:00
Chris Lattner
cd45bc4086 Fix PR 110: the constant folding code assumes that if something is not a
constant expression, but is of (for example) ubyte type, then it is a
ConstantUInt.  This was not true for placeholders.

llvm-svn: 9994
2003-11-14 06:38:46 +00:00
Chris Lattner
116c4f73ad This is obviously illegal C++ code, but was apparently accepted by 3.3
bork

llvm-svn: 9993
2003-11-14 06:03:05 +00:00
Misha Brukman
8b6d804cd3 Give props to Reid Spencer for the namespacification work.
llvm-svn: 9992
2003-11-14 05:37:10 +00:00
Misha Brukman
133b35ef95 Brian implemented the vaarg instruction in the interpreter.
llvm-svn: 9989
2003-11-14 03:30:43 +00:00
Chris Lattner
ef901291c6 Expose the verifier to opt
llvm-svn: 9984
2003-11-13 19:47:29 +00:00
Brian Gaeke
d8a4d2b08d Removed link from the docs index too.
llvm-svn: 9983
2003-11-13 19:32:14 +00:00
Chris Lattner
093cc6dc92 As the comments indicate, this is a temporary, repulsive, hack
llvm-svn: 9982
2003-11-13 19:26:54 +00:00
Chris Lattner
d76fe4ea7d Implement feature: InstCombine/2003-11-13-ConstExprCastCall.ll
llvm-svn: 9981
2003-11-13 19:17:02 +00:00
Chris Lattner
7ef8dfa9c3 Instcombine should promote this, and because it isn't, we are failing poolalloc tests
llvm-svn: 9980
2003-11-13 19:05:15 +00:00
Chris Lattner
a8150c3f8d Trying to get the dsgraph for an external function is bad for DSA's health
llvm-svn: 9979
2003-11-13 18:48:11 +00:00
Misha Brukman
1608115bfc Fixed word order.
llvm-svn: 9978
2003-11-13 18:03:11 +00:00
Chris Lattner
133ba7a2a6 NEW testcase for PR84 :(
llvm-svn: 9967
2003-11-13 06:19:56 +00:00
Brian Gaeke
d81ca471dd Change LLI's internal representation of va_list to a pointer to the next
argument to be returned by va_arg. This allows va_lists to be passed
between different LLVM procedures (though it is unlikely that an LLI
va_list would make sense to an external function, except by chance.)

llvm-svn: 9965
2003-11-13 06:06:01 +00:00
Chris Lattner
baef234ce3 Implement the CompleteBU pass
llvm-svn: 9964
2003-11-13 05:05:41 +00:00
Chris Lattner
6d27d46a08 Add methods for implementation
llvm-svn: 9963
2003-11-13 05:05:34 +00:00
Chris Lattner
71d3377010 Minor code cleanup
llvm-svn: 9962
2003-11-13 05:04:19 +00:00
Chris Lattner
9d7587238b Remove needless dependence on boost
llvm-svn: 9961
2003-11-13 04:11:30 +00:00
Chris Lattner
fb4c057c4c Disable integer tracking by default
llvm-svn: 9960
2003-11-13 03:10:49 +00:00
Chris Lattner
97cf7cf400 Add namespace qualifier
llvm-svn: 9959
2003-11-13 02:30:22 +00:00
Chris Lattner
537bb3cc53 Minor cleanups
llvm-svn: 9958
2003-11-13 02:01:41 +00:00
Chris Lattner
04946381b9 Add an initial version of the CompleteBUDataStructures class, which is currently
identical to the BU pass, but has an accurate call graph

llvm-svn: 9956
2003-11-13 01:43:00 +00:00
Chris Lattner
b5be72ff30 Add an initial version of the CompleteBUDataStructures pass
llvm-svn: 9955
2003-11-13 01:42:38 +00:00
Misha Brukman
0e2e1f121a Include the file before we close the llvm namespace.
llvm-svn: 9954
2003-11-13 00:23:05 +00:00
Misha Brukman
6675f982de Substantially re-organized this file:
* There is now only one pass to print out assembly instead of two
* It is a FunctionPass
* The Module-level printing of globals is now in doFinalization() method of the
  FunctionPass
* The code has been reformatted to follow LLVM coding standards
* Some comments, not all, were doxygenified
* Last but not least, the function to create an instance of this pass is also no
  longer a method in the UltraSparc class.

llvm-svn: 9953
2003-11-13 00:22:19 +00:00
Misha Brukman
2558e8c852 The function to create an instance of this pass is no longer a method of
the UltraSparc class.

llvm-svn: 9952
2003-11-13 00:19:02 +00:00
Misha Brukman
167026f8c8 The functions to create new instances of passes are no longer methods in the
UltraSparc class. Comments are also doxygen-compatible now.

llvm-svn: 9951
2003-11-13 00:17:20 +00:00
Misha Brukman
b26c6fa4eb * Put command-line switches in their own namespace
* Pass creation functions are no longer in the UltraSparc class

llvm-svn: 9950
2003-11-13 00:16:28 +00:00
Misha Brukman
893e793739 Force a dependency on the .inc file, which must be generated!
llvm-svn: 9949
2003-11-13 00:05:09 +00:00
Chris Lattner
9e876556fd Fine-grainify namespaces for this library
llvm-svn: 9948
2003-11-12 23:11:14 +00:00
Misha Brukman
ec4f37a19b You cannot debug namespacified LLVM with GDB 5.x anymore.
llvm-svn: 9946
2003-11-12 22:55:13 +00:00
Brian Gaeke
b8b238b12a Add another fixed bug.
llvm-svn: 9945
2003-11-12 22:48:52 +00:00
Chris Lattner
9580ce235b Fix faulty namespacification
llvm-svn: 9943
2003-11-12 22:45:14 +00:00
Misha Brukman
bca83f4a47 Regenerated `configure' for adding Makefiles and test.in to FreeBench
benchmarks.

llvm-svn: 9942
2003-11-12 22:16:51 +00:00
Misha Brukman
77a8be8016 OK, scratch my last post, this actually *does* work, those syntax errors were
imaginary.

llvm-svn: 9941
2003-11-12 22:16:23 +00:00
Chris Lattner
2203f2509e Add new testcase for PR112
llvm-svn: 9940
2003-11-12 22:15:55 +00:00
Misha Brukman
902cd7689c Apparently adding these entries and regenerating llvm/configure results in
syntax errors. Reverting the patch until I can figure out what's going on.

llvm-svn: 9939
2003-11-12 21:51:44 +00:00
Misha Brukman
3a9abb84c1 Some programs actually require an input to run. The nerve!
llvm-svn: 9938
2003-11-12 21:45:04 +00:00
Brian Gaeke
0afc434b71 Mention LLVM cast instructions.
llvm-svn: 9936
2003-11-12 21:39:31 +00:00
Brian Gaeke
e1fd80a246 Update section on GNU lightning fp.
llvm-svn: 9935
2003-11-12 21:38:50 +00:00
Brian Gaeke
c806b22110 I won't claim we're "better than and/or different from..." at Misha's behest.
llvm-svn: 9934
2003-11-12 21:36:29 +00:00
John Criswell
9537a75c23 Regress to not using the llvm namespace.
This keeps Pool Allocation stuff from compiling.
We can re-visit it later when we have time to do it right.

llvm-svn: 9932
2003-11-12 21:32:06 +00:00
Brian Gaeke
e6406a8cd2 Make the beginning of this page look like the beginnings of other pages.
llvm-svn: 9930
2003-11-12 20:47:30 +00:00
Brian Gaeke
56d3cc5793 index.html: Add link to llvm vs. the world
llvm.css: Add padding on top and bottom so that letters do not merge with
surrounding whitespace

llvm-svn: 9929
2003-11-12 20:31:18 +00:00
Chris Lattner
a146c31bde This color is making me want to puke :)
llvm-svn: 9928
2003-11-12 20:24:39 +00:00
Brian Gaeke
3bac762f0f Whoops, a div got closed in the wrong place.
llvm-svn: 9927
2003-11-12 20:20:55 +00:00
Brian Gaeke
63dbb1f591 First draft of LLVM-to-anything comparison document.
llvm-svn: 9926
2003-11-12 20:19:40 +00:00
Misha Brukman
dc6863ad64 Add FreeBench benchmarks to our test suite -- they weren't available by default
before when one didn't build in his source root.

llvm-svn: 9924
2003-11-12 19:39:10 +00:00
Chris Lattner
da03a8a792 Add new argument to disable checking
llvm-svn: 9922
2003-11-12 17:58:22 +00:00
Chris Lattner
e6383ab55e Add argument
llvm-svn: 9921
2003-11-12 17:58:09 +00:00
Chris Lattner
f88e8d9c12 The bytecode reader/writer is borking this testcase
llvm-svn: 9919
2003-11-12 16:40:08 +00:00
Chris Lattner
a360143bed This is not the instruction combiner's fault! No really!
llvm-svn: 9918
2003-11-12 16:38:32 +00:00
Chris Lattner
33f27de303 Reduced testcase for PR 110
llvm-svn: 9917
2003-11-12 16:24:30 +00:00
Chris Lattner
3b93c91836 Detect problems with PHI node operands!
llvm-svn: 9916
2003-11-12 07:13:37 +00:00
Chris Lattner
7cb5070672 Restore the -llvm option
llvm-svn: 9915
2003-11-12 04:59:59 +00:00
Chris Lattner
b740afb2b0 Print return nodes for graphs with multiple functions in them correctly
llvm-svn: 9914
2003-11-12 04:58:19 +00:00
Chris Lattner
12c71c00ef Don't crash if no gg
llvm-svn: 9913
2003-11-12 04:57:58 +00:00
Chris Lattner
a723537540 PR107 is now fixed
llvm-svn: 9912
2003-11-12 04:42:37 +00:00
Chris Lattner
ebcf5a5dba Fix bug PR107, patch contributed by Reid Spencer!
llvm-svn: 9911
2003-11-12 04:40:30 +00:00
Chris Lattner
b0aa83ee0a New testcase for PR107
llvm-svn: 9910
2003-11-12 04:40:11 +00:00
Brian Gaeke
81545ad1f5 I don't think this was supposed to have gotten into the namespaceify patch, but
it did. Oops!

llvm-svn: 9908
2003-11-12 01:11:54 +00:00
Chris Lattner
a9450bd4ac Cleanups
llvm-svn: 9907
2003-11-12 00:40:34 +00:00
Chris Lattner
74a2299748 reword a bit, be less aggressive with my link
llvm-svn: 9906
2003-11-11 23:46:35 +00:00
Chris Lattner
ed6d53f512 Add a link to the llvmdev posting
llvm-svn: 9905
2003-11-11 23:45:03 +00:00
Brian Gaeke
10ea82301f Mention that all LLVM C++ code has been moved into the 'llvm' C++ namespace.
llvm-svn: 9904
2003-11-11 22:45:41 +00:00
Brian Gaeke
960707c335 Put all LLVM code into the llvm namespace, as per bug 109.
llvm-svn: 9903
2003-11-11 22:41:34 +00:00
Brian Gaeke
da3f675edd Move IsArchive, IsBytecode to FileUtilities. Fix up some method comments.
llvm-svn: 9902
2003-11-11 21:54:01 +00:00
Brian Gaeke
251b979943 Move IsArchive and IsBytecode here from gccld. Refactor into CheckMagic.
llvm-svn: 9901
2003-11-11 21:53:50 +00:00
Brian Gaeke
c30c5db05f Add prototypes for CheckMagic, IsArchive, and IsBytecode.
llvm-svn: 9900
2003-11-11 21:53:29 +00:00
Brian Gaeke
7aeb2b7e42 Add another fixed bug.
llvm-svn: 9899
2003-11-11 21:52:34 +00:00
Chris Lattner
da05b05197 Compute node offsets correctly
llvm-svn: 9895
2003-11-11 20:12:32 +00:00
Misha Brukman
895b12faff 'Tis quite silly to check for a cached version of the entire executable. That
amounts to checking for a completely-native version. We'll cache on a
function-by-function basis instead (in the JIT's CodeEmitter).

llvm-svn: 9894
2003-11-11 18:38:56 +00:00
Brian Gaeke
ec21f8e9bf This version of Linker.cpp works a lot better, but it's a little messy. Sorry.
Use FileOpenable() instead of FileExists().
Create IsBytecode() predicate -- like IsArchive(), but for bytecode files.
Use IsBytecode() before trying to load any file as a bytecode file.

llvm-svn: 9893
2003-11-11 18:27:37 +00:00
Brian Gaeke
ca35fbf33d Add implementation of FileOpenable().
Refactor MakeFileExecutable() & MakeFileExecutable() into AddPermissionsBits().

llvm-svn: 9892
2003-11-11 18:27:21 +00:00
Brian Gaeke
1f41970f9c VS: ----------------------------------------------------------------------
Add prototype for FileOpenable().

llvm-svn: 9891
2003-11-11 18:27:11 +00:00
Misha Brukman
8bbd8c2689 The caching will not live in LLEE's execve() handler; that's suboptimal.
llvm-svn: 9890
2003-11-11 18:23:09 +00:00
Chris Lattner
fdc8d6547b Add new method for computing node mappings. This is used by the pool allocator
llvm-svn: 9880
2003-11-11 05:08:59 +00:00
Chris Lattner
a6ad46d9f4 Add new method
llvm-svn: 9879
2003-11-11 05:08:36 +00:00
Misha Brukman
10ff946838 Added link to ``CVS Branching and Tags Primer''.
llvm-svn: 9875
2003-11-11 00:14:41 +00:00
Misha Brukman
b617253a16 Shorten the "updating Makefile" status print-out.
llvm-svn: 9874
2003-11-11 00:05:29 +00:00
Brian Gaeke
8f53a89edf Fix problems linking against the reoptimizer; _llvm_regAllocState must have
externally-visible linkage, and SaveStateToModule must default to true for llc.
I don't remember why I made it const; perhaps it should be deconstified.

llvm-svn: 9858
2003-11-10 07:12:01 +00:00
Chris Lattner
1e6d3053f2 Reorganize code for locality, improve comments
llvm-svn: 9857
2003-11-10 04:42:42 +00:00
Chris Lattner
6d839e50c9 Include forms of SplitCriticalEdge which work correctly with pred/succ iterators
llvm-svn: 9856
2003-11-10 04:42:13 +00:00
Chris Lattner
47acfeda62 No really, I'm not on crack
llvm-svn: 9855
2003-11-10 04:23:52 +00:00
Chris Lattner
f8deeafd91 Helper method
llvm-svn: 9854
2003-11-10 04:16:50 +00:00
Chris Lattner
4474336166 Adjust to new critical edge interface
llvm-svn: 9853
2003-11-10 04:10:50 +00:00
Chris Lattner
f650861760 Move isCriticalEdge & SplitCritical into this file. While we're at it, change
the interface to SplitCriticalEdge so that it splits an edge if it is critical,
otherwise just returns false and noops if not.

llvm-svn: 9852
2003-11-10 04:10:27 +00:00
Chris Lattner
a5397c883a Move isCriticalEdge & SplitCritical edge out of this file, which is only
for passes.

llvm-svn: 9851
2003-11-10 04:09:44 +00:00
Brian Gaeke
59c321782f Regenerated.
llvm-svn: 9850
2003-11-10 03:06:28 +00:00
Brian Gaeke
b621857f01 Patch to fix PR102, contributed by Reid Spencer.
llvm-svn: 9849
2003-11-10 03:06:09 +00:00
Brian Gaeke
cac06a5c46 add Reid Spencer
llvm-svn: 9848
2003-11-10 03:05:36 +00:00
Brian Gaeke
c0c23c29aa Operand numbers are now ints. Save the register allocation of the value
each instruction produces as "operand" -1, and the other operands as 0
.. n, as before. PhyRegAlloc::saveState() is refactored into
PhyRegAlloc::saveStateForValue().

llvm-svn: 9842
2003-11-10 00:05:26 +00:00
Misha Brukman
b891ffbc7e If the source tree's Makefile is more up-to-date, copy it over into the build
tree.

llvm-svn: 9836
2003-11-09 21:36:19 +00:00
Chris Lattner
b2d575769b Give gccld more guts
llvm-svn: 9835
2003-11-09 19:55:09 +00:00
Chris Lattner
9a010038f1 More additions
llvm-svn: 9834
2003-11-09 19:54:30 +00:00
Chris Lattner
881cb48619 Bugz bugz bugz
llvm-svn: 9833
2003-11-09 19:44:07 +00:00
Chris Lattner
a570f7b681 Fix PR95. I'm checking this patch in for Reid Spencer, who figured it out
and wrote it up.  Thanks!!

llvm-svn: 9832
2003-11-09 19:39:48 +00:00
Chris Lattner
da8571b464 Add an assertion
llvm-svn: 9831
2003-11-09 15:51:07 +00:00
Brian Gaeke
75bc7cec4b Fix PR103
llvm-svn: 9830
2003-11-09 07:08:34 +00:00
Chris Lattner
b09ad87eb9 New testcase
llvm-svn: 9829
2003-11-09 07:05:02 +00:00
Chris Lattner
984e11792f Do NOT inline self recursive calls into other functions. This is causing the
pool allocator no end of trouble, and doesn't make a lot of sense anyway.  This
does not solve the problem with mutually recursive functions, but they are much less common.

llvm-svn: 9828
2003-11-09 05:05:36 +00:00
Chris Lattner
d61abe82d3 Untypo
llvm-svn: 9827
2003-11-09 05:04:25 +00:00
Chris Lattner
950c75f135 Add more functions
llvm-svn: 9826
2003-11-09 04:10:41 +00:00
Chris Lattner
5011b956a9 None of the __llvm_* functions call into the program. This makes the
callgraph MUCH simpler for eh using program.

llvm-svn: 9825
2003-11-09 04:00:59 +00:00
Chris Lattner
cff83a2f24 Add support for memmove
llvm-svn: 9824
2003-11-09 03:32:52 +00:00
Brian Gaeke
c3c242c3ac Remove #include of PassManager.h which was marked FIXME, and apparently is no
longer used.

llvm-svn: 9823
2003-11-09 03:15:40 +00:00
Chris Lattner
9a06c2bc25 Totally disable assert, in order to fix PR101
llvm-svn: 9818
2003-11-09 00:29:51 +00:00
Chris Lattner
3faf03a00f new testcase
llvm-svn: 9817
2003-11-09 00:23:05 +00:00
Chris Lattner
123ba49839 new testcase
llvm-svn: 9815
2003-11-08 23:00:49 +00:00
Chris Lattner
12dd38aa99 Handle bzero and memset in the local analysis, because we were missing the fact
that memset returns its argument!!

llvm-svn: 9811
2003-11-08 21:55:50 +00:00
Chris Lattner
c129e009eb Fix broken makefile dependency generation
llvm-svn: 9810
2003-11-08 21:23:06 +00:00
Chris Lattner
2cb1db763e This doesn't use DSCallSiteIterator
llvm-svn: 9809
2003-11-08 21:17:37 +00:00
Chris Lattner
5c94491743 * Add units to the yaxis of each chart
* Add charts to the nightly test report

llvm-svn: 9808
2003-11-08 20:48:39 +00:00
Chris Lattner
1388c6765f Since we are collecting all of this data, we might as well graph it!
llvm-svn: 9807
2003-11-08 20:33:04 +00:00
Brian Gaeke
f8cb2419ee Fix two typos I found in comments.
llvm-svn: 9806
2003-11-08 18:12:24 +00:00
Chris Lattner
14b5d5a98e Update the portability section
llvm-svn: 9803
2003-11-08 05:22:09 +00:00
Chris Lattner
699a58d77a sjlj bug
llvm-svn: 9802
2003-11-08 05:18:50 +00:00
Chris Lattner
78396549bc Fix wierd problems linking C programs which look for symbols in libstdc++.
This was due to the 'assert' macro expanding into a function call on some
platforms which could throw.  The C++ compiler then added checks for the
exception specifications in these functions, which pulled in the C++ runtime.
This was bad, and the assertions can never fire (the library is now debugged)
so just remove them.

llvm-svn: 9801
2003-11-08 05:13:40 +00:00
Chris Lattner
4491de6e97 Add news from brian
llvm-svn: 9800
2003-11-08 04:28:55 +00:00
Misha Brukman
7630785925 First pass at cleaning up LangRef.html: stylesheet-ification, consistent
formatting, more strict adherence to HTML 4.01, other misc. cleanups.

llvm-svn: 9799
2003-11-08 01:05:38 +00:00
Misha Brukman
a1eefa40dc For some reason, LICM and GCSE like to crash the FunctionPassManager when they
are being added as FunctionPasses... Sigh.

llvm-svn: 9798
2003-11-08 00:01:39 +00:00
Chris Lattner
59c3985777 Provide a specialization of _Alloc_traits, which allows the G++ runtime to avoid
storing an instance of the allocator in each data structure it uses.  Yaay.

llvm-svn: 9795
2003-11-07 23:20:56 +00:00
Brian Gaeke
9ef636c698 Implement vaarg instruction. This is not quite perfect: 2003-08-11-VaListArg
still causes a crash. But it's better than before.

llvm-svn: 9794
2003-11-07 21:20:47 +00:00
Misha Brukman
508cc3e7a9 Implement branching to a PC-relative constant (not a BasicBlock).
llvm-svn: 9793
2003-11-07 21:07:30 +00:00
Brian Gaeke
85baf8c65a popStackAndReturnValueToCaller() must advance instruction pointer to normal
destination, if returning from an invoke.

Implement 'unwind' instruction.

llvm-svn: 9792
2003-11-07 20:44:58 +00:00
Misha Brukman
3b2343eae9 PreSelection is not optional, it performs a necessary and vital transformation
for the Sparc backend: breaking up constant expressions. Thus, we cannot have it
guarded by a conditional, it should never be disabled.

Also, it's now available for the JIT since it is a FunctionPass.

llvm-svn: 9791
2003-11-07 20:33:25 +00:00
Misha Brukman
d7bcd99325 Remove the *BIG UGLY HACK* from the JIT: PreSelection is now a FunctionPass.
llvm-svn: 9790
2003-11-07 20:32:08 +00:00
Brian Gaeke
6d145eb65f Add stub version of unwind support
llvm-svn: 9789
2003-11-07 20:07:06 +00:00
Brian Gaeke
a6454d3532 visitCallInst --> visitCallSite.
Use visitCallSite to implement both CallInsts and InvokeInsts.

llvm-svn: 9788
2003-11-07 20:04:22 +00:00
Brian Gaeke
a6d48e4db2 Make the operation of visitCallInst() only depend on the CallSite.
llvm-svn: 9787
2003-11-07 19:59:08 +00:00
Misha Brukman
560e989585 Completely hacked apart the file and put it back together using stylesheets.
llvm-svn: 9786
2003-11-07 19:43:14 +00:00
Misha Brukman
403ff618bc Actually have a target "#introduction" if we're making a link to it.
llvm-svn: 9785
2003-11-07 19:42:44 +00:00
Brian Gaeke
18b59578c9 Use CallSites for call sites, instead of CallInsts. A revolutionary concept.
llvm-svn: 9784
2003-11-07 19:26:23 +00:00
Brian Gaeke
f578c05d57 Mention class CallSite
llvm-svn: 9783
2003-11-07 19:25:45 +00:00
Brian Gaeke
a730103518 Add a warning about not "new"ing or "delete"ing CallSites
llvm-svn: 9782
2003-11-07 19:25:22 +00:00
Misha Brukman
d3af61d883 Added ability to register FunctionPasses as optimizations, with
TargetMachine-accepting constructors (thanks to Chris).

llvm-svn: 9781
2003-11-07 18:56:32 +00:00
Misha Brukman
7120c837fb Make the page footer consistent with the rest of the site.
llvm-svn: 9779
2003-11-07 18:11:14 +00:00
Misha Brukman
2c3068026a Switch to emitting MachineConstantPool the way it was meant to be done.
llvm-svn: 9777
2003-11-07 18:06:26 +00:00
Misha Brukman
2133b0513d Switch to using the standard representation of the constant pool -- namely, the
MachineConstantPool. This involved refactoring the two classes involved in
printing out Sparc assembly. In fact, they should share all this code anyway.

llvm-svn: 9776
2003-11-07 17:45:28 +00:00
Misha Brukman
faa42d264f We accept TargetMachine as a const reference.
llvm-svn: 9775
2003-11-07 17:44:18 +00:00
Misha Brukman
bd4a8ed139 PreSelection and PeepholeOpts are now FunctionPasses.
llvm-svn: 9774
2003-11-07 17:43:43 +00:00
Misha Brukman
81c748c1e2 * Stop making a global for each constant that cannot live in an instruction;
it will be converted to a MachineConstantPool index during instruction
  selection
* This is now eligible to become a FunctionPass since it does not have any side
  effects outside of the function it is processing.

llvm-svn: 9773
2003-11-07 17:31:22 +00:00
Misha Brukman
bf9ed7ac1f * Use the MachineConstantPool for storing constants instead of a hash_set;
* Do not create new globals for constants!

Also, order #includes as per coding style guide

llvm-svn: 9772
2003-11-07 17:29:48 +00:00
Misha Brukman
c16149d7dd Use basename $< to get just the filename, not full path, for ease of reading.
llvm-svn: 9770
2003-11-07 17:26:27 +00:00
Misha Brukman
ad03afcb34 Declare FunctionPasses as such so that they can be used in FunctionPassManager.
llvm-svn: 9768
2003-11-07 17:20:18 +00:00
Misha Brukman
53b3d182d1 Declare FunctionPasses as such.
llvm-svn: 9767
2003-11-07 17:19:39 +00:00
Chris Lattner
fc42785a60 Add some ctors for this allocator
llvm-svn: 9766
2003-11-07 15:20:06 +00:00
Brian Gaeke
65cac90a92 Refactor the return-from-function code into popStackAndReturnValueToCaller().
Make external function calls slightly less special; now they get a stack frame.

llvm-svn: 9765
2003-11-07 05:22:49 +00:00
Chris Lattner
34596d7048 Add bugz
llvm-svn: 9764
2003-11-07 04:46:56 +00:00
Chris Lattner
cd4f3e601c Fix a really bad build problem for users who have .o in their build directory!
Thanks to Reid Spencer for figuring this out!  :)

llvm-svn: 9763
2003-11-07 04:39:53 +00:00
Chris Lattner
5285e9c9a0 Hopefully this will fix PR98
llvm-svn: 9762
2003-11-07 00:38:09 +00:00
Chris Lattner
395aef6bbe Hopefully fix the objdir != srcdir issue
llvm-svn: 9761
2003-11-07 00:34:33 +00:00
Misha Brukman
6c91a333ea * Added a "contents"-like list of questions at the beginning of the file
* Use stylsheets. Really, people, work with me here.
* Stop using those silly <dl> and <dt> and whatever else tags
* Close tags

llvm-svn: 9760
2003-11-06 21:55:44 +00:00
Chris Lattner
cd213197dc fix warnings on sparc
llvm-svn: 9759
2003-11-06 21:30:15 +00:00
Chris Lattner
72a4db8b92 Fix warnings building on sparc
llvm-svn: 9758
2003-11-06 21:30:05 +00:00
Brian Gaeke
18027874ef All 'llvmgcc' tests should specify %llvmgcc so that the path is passed
in by qmtest.

llvm-svn: 9757
2003-11-06 21:13:45 +00:00
Chris Lattner
2a09659109 No wonder noone can set up LLVMGCCDIR correctly!
llvm-svn: 9756
2003-11-06 20:51:45 +00:00
Chris Lattner
dc79f6c776 Add new commandline option
llvm-svn: 9755
2003-11-06 20:29:33 +00:00
Chris Lattner
7985d3664d Add new command line option
llvm-svn: 9754
2003-11-06 20:29:25 +00:00
Chris Lattner
38cd27e450 Various cleanups and efficiency improvements
llvm-svn: 9753
2003-11-06 19:46:29 +00:00
Chris Lattner
b0a4b49b23 Fix bug: PR93
llvm-svn: 9752
2003-11-06 19:18:49 +00:00
Misha Brukman
b4ad4c3d4c * Make the comment header 80 columns long
* Alphabetize #includes

llvm-svn: 9751
2003-11-06 18:06:13 +00:00
Misha Brukman
2b8724acc6 Let's not forget about our friends -- Constant Pool indices.
llvm-svn: 9750
2003-11-06 00:04:11 +00:00
Brian Gaeke
6f54518e08 Give this header file an Emacs mode-line.
llvm-svn: 9749
2003-11-05 22:13:10 +00:00
Brian Gaeke
1d9515b0a1 Do not assume the first file is a bytecode file. Instead, construct a dummy
Module and link things into that.

Also, fix a typo in an error message.

llvm-svn: 9748
2003-11-05 22:13:00 +00:00
Brian Gaeke
31af708ef6 Shorten and correct some function-header comments.
Make "verbose" output MUCH nicer. Now it tells you when you are linking a
bytecode file, or an archive, and whether it's because you called it by name,
or because you gave it a -l option, and it says "Trying" before it takes
action and prints a message in the past tense afterwards.

Make LinkFiles not skip the first file in Files.

Make LinkFiles warn you if it can't find a file and LLVM_LIB_SEARCH_PATH is
unset.

llvm-svn: 9747
2003-11-05 22:12:52 +00:00
Chris Lattner
83bc0a06b6 new testcase
llvm-svn: 9746
2003-11-05 22:06:03 +00:00
Chris Lattner
4e1b467594 Fix the problem with running cleanups in bugpoint: We were deleting arguments
of intrinsic functions, causing the verifier to fail.

llvm-svn: 9745
2003-11-05 21:53:41 +00:00
Chris Lattner
a616c55ba9 Bugpoint no longer has this option
llvm-svn: 9744
2003-11-05 21:46:13 +00:00
Chris Lattner
2920100e4d I hate it when bugpoint is all ready to give me a bytecode file, then crashes
in final cleanups.  Then you had to run the whole mess again with
-disable-final-cleanups.

This makes bugpoint run the cleanups in a protected environment so that if
they crash, bugpoint itself doesn't crash.  This makes things much happier,
implements a FIXME, and gets rid of YABPO (yet another bugpoint option).

llvm-svn: 9743
2003-11-05 21:45:35 +00:00
Chris Lattner
a2e48a82fe Split the DAE pass into DAE and DAH passes
llvm-svn: 9742
2003-11-05 21:43:42 +00:00
Chris Lattner
9e60aced2e Split behavior into two pieces
llvm-svn: 9741
2003-11-05 21:43:02 +00:00
Chris Lattner
debac38f5e Simplify the performFinalCleanups interface
llvm-svn: 9740
2003-11-05 21:15:19 +00:00
Chris Lattner
8055fb3afa Yet more fixes for constant expr shifts
llvm-svn: 9739
2003-11-05 20:43:58 +00:00
Chris Lattner
ba55bd37fe Further fixes for PR93
llvm-svn: 9738
2003-11-05 20:37:01 +00:00
Brian Gaeke
7f3327fc2c A few handy methods that seem to mesh well with what CallSite already provides.
llvm-svn: 9737
2003-11-05 20:25:33 +00:00
Chris Lattner
c3d6f21bbe no need for endl
llvm-svn: 9736
2003-11-05 19:53:32 +00:00
Chris Lattner
b36e8a1a2e Add support for constant expr shifts
llvm-svn: 9735
2003-11-05 19:53:03 +00:00
Misha Brukman
07b385da27 Since this function returns an int, let's actually return something.
llvm-svn: 9734
2003-11-05 19:48:05 +00:00
Chris Lattner
51b560602e New testcase
llvm-svn: 9733
2003-11-05 19:43:36 +00:00
Chris Lattner
e225507193 If we're not checking, don't check!
llvm-svn: 9732
2003-11-05 19:09:40 +00:00
Chris Lattner
7c94d1171a Fix flawed logic that was breaking several SPEC benchmarks, including gzip and crafty.
llvm-svn: 9731
2003-11-05 17:31:36 +00:00
Misha Brukman
e5b358c829 We know exactly what the value of $< is, so instead of using basename $< to
get just the filename and not the full path, just use the filename directly.

llvm-svn: 9730
2003-11-05 06:43:36 +00:00
Misha Brukman
8330f2be73 Output only the .y filename, not the full path to it for ease of reading.
llvm-svn: 9729
2003-11-05 06:41:14 +00:00
Chris Lattner
ab77bc588d Add three more bugs
llvm-svn: 9728
2003-11-05 06:30:04 +00:00
Chris Lattner
a9e7fe9ea2 Do not use a class before it is defined.
Be gcc 3.4 clean

llvm-svn: 9727
2003-11-05 06:25:06 +00:00
Chris Lattner
b5b9ba6ff6 Be friendly to gcc 3.4... good compiler. Nice compiler.
llvm-svn: 9726
2003-11-05 06:20:27 +00:00
Chris Lattner
813ec04735 Be gcc 3.4 clean
llvm-svn: 9725
2003-11-05 06:12:18 +00:00
Chris Lattner
c17fe1cdfe Make -r work, fixing PR 91
llvm-svn: 9724
2003-11-05 06:05:21 +00:00
Alkis Evlogimenos
43b0bbe12c Add std::pair tier. This is a much simplified version of boost::tie
that works only for std::pair.

llvm-svn: 9723
2003-11-05 05:58:26 +00:00
Chris Lattner
5f6463c041 Fix name collision
llvm-svn: 9722
2003-11-05 05:55:45 +00:00
Chris Lattner
21c7894ea0 Add a dtor to ensure that they are called the right number of times.
llvm-svn: 9721
2003-11-05 05:31:24 +00:00
Chris Lattner
b3a9b6626f NEw testcase
llvm-svn: 9720
2003-11-05 05:22:15 +00:00
Chris Lattner
41baa98478 Make code gcc 3.4 clean
llvm-svn: 9719
2003-11-05 05:15:42 +00:00
Chris Lattner
d4741c5ee9 New testcase
llvm-svn: 9718
2003-11-05 01:36:49 +00:00
Chris Lattner
2b553e69d8 This works with GCC 3.4 also
llvm-svn: 9717
2003-11-05 01:31:12 +00:00
Brian Gaeke
4e106f0649 Abort when the user program calls abort, instead of printing a funny message and calling exit(1).
llvm-svn: 9716
2003-11-05 01:18:49 +00:00
Chris Lattner
8f2f598024 Fix bug with previous implementation:
-      // ~(c-X) == X-(c-1) == X+(-c+1)
+      // ~(c-X) == X-c-1 == X+(-c-1)

Implement: C - ~X == X + (1+C)
llvm-svn: 9715
2003-11-05 01:06:05 +00:00
Chris Lattner
b6ca46e0f9 New testcase for the other side
llvm-svn: 9714
2003-11-05 01:05:22 +00:00
Brian Gaeke
221827ab07 Use regular old malloc to emulate malloc/alloca instructions.
llvm-svn: 9713
2003-11-05 01:02:14 +00:00
Brian Gaeke
175018317e Remove a comment which no longer applies.
llvm-svn: 9712
2003-11-05 00:59:28 +00:00
Chris Lattner
e580666532 Minor cleanup, plus implement InstCombine/xor.ll:test17
llvm-svn: 9711
2003-11-04 23:50:51 +00:00
Chris Lattner
f6368c803c Since we're in the neighborhood, test for the inverse
llvm-svn: 9710
2003-11-04 23:49:53 +00:00
Chris Lattner
d6a5d90ae2 Fix spello
Add negate overload

llvm-svn: 9709
2003-11-04 23:37:40 +00:00
Chris Lattner
0f68fa6569 Implement InstCombine/xor.ll:test(15|16)
llvm-svn: 9708
2003-11-04 23:37:10 +00:00
Chris Lattner
e3a932c6d0 Add a generalization of the previous case
llvm-svn: 9707
2003-11-04 23:36:50 +00:00
Chris Lattner
f622d7c31e New testcase for masking operation that frequently occurs in the pool allocator
for converting a number that is a power of two into a mask

llvm-svn: 9706
2003-11-04 23:21:22 +00:00
Alkis Evlogimenos
20d03bb166 Update documentation since it was misleading: make it clear that a
negative instruction count is returned if instructions are removed
from a basic block.

llvm-svn: 9705
2003-11-04 23:07:00 +00:00
Alkis Evlogimenos
9118a426d3 Change all machine basic block modifier functions in MRegisterInfo to
return the number of instructions added to/removed from the basic block
passed as their first argument.

Note: This is only needed because we use a std::vector instead of an
ilist to keep MachineBasicBlock instructions. Inserting an instruction
to a MachineBasicBlock invalidates all iterators to the basic
block. The return value can be used to update an index to the machine
basic block instruction vector and circumvent the iterator elimination
problem but this is really not needed if we move to a better
representation.

llvm-svn: 9704
2003-11-04 22:57:09 +00:00
Brian Gaeke
69c2841b2a Update verifySavedState()'s comment, so that it reflects its current
status.  In doFinalization(), skip over external functions, just like
Anand's mapping info does.

llvm-svn: 9703
2003-11-04 22:42:41 +00:00
Chris Lattner
ee0ba89dd1 New file, for use by the pool allocator project
llvm-svn: 9702
2003-11-04 22:38:28 +00:00
Chris Lattner
c679fbbab4 Substantial release notes updates
llvm-svn: 9700
2003-11-04 20:06:53 +00:00
Chris Lattner
12d304d4d8 New testcase for PR80
llvm-svn: 9699
2003-11-04 18:52:01 +00:00
Chris Lattner
ba4b1c47c1 New testcase
llvm-svn: 9698
2003-11-04 18:34:05 +00:00
Brian Gaeke
2a262ef095 Add comments.
llvm-svn: 9697
2003-11-04 18:25:56 +00:00
Chris Lattner
604ac9cfc0 While working on the pool allocator, I noticed that basicaa is failing a scary
number of simple cases.  Someday when I get a chance to work on it again, this
testcase should be corrected.

llvm-svn: 9695
2003-11-04 16:40:40 +00:00
Chris Lattner
47dfa641c3 Fix problems in previous changes. This fixes several regressions last night.
llvm-svn: 9694
2003-11-04 16:04:32 +00:00
John Criswell
81587e798a Checking in Chris's suggestions:
Added assert() to ensure symbol table is well formed.
Added code to remember the value that was found; resolving types can change
the symbol table and invalidate the value of the iterator.
Added comments to the ResolveTypes() function (mainly for my own benefit).
Please feel free to correct the comments if they are not accurate.

llvm-svn: 9693
2003-11-04 15:22:26 +00:00
Chris Lattner
72974ffdbf New testcase for PR84
llvm-svn: 9690
2003-11-03 21:37:08 +00:00
John Criswell
28f8fc669d Modified build rules so that a messages appears before and after linking.
This helps to disambiguate when linking begins and when the library/program
is linked and ready to be used.
This is sort of as preference thing, so feel free to modify/revert the change.

llvm-svn: 9687
2003-11-03 21:12:49 +00:00
Chris Lattner
b71c3f7430 Significantly simplify constant emission by unifying the stuff which used to build up
strings with the stuff that used to print to an ostream directly.  We now NEVER build
up big strings, only to print them once they are formed.

llvm-svn: 9686
2003-11-03 20:19:49 +00:00
Chris Lattner
ef114d52e8 updates to release notes
llvm-svn: 9685
2003-11-03 20:08:08 +00:00
Chris Lattner
469e404370 Incorporate printSingleConstantValue into its single caller
llvm-svn: 9684
2003-11-03 19:44:05 +00:00
Chris Lattner
72e516f0d1 * Reformat some code
* Emit bools as 1/0 instead of true/false, fixing compilation of eon and
  PR 83 & Jello/2003-11-03-GlobalBool.llx

llvm-svn: 9683
2003-11-03 19:33:45 +00:00
Chris Lattner
bf1b435d04 New testcase
llvm-svn: 9682
2003-11-03 19:27:17 +00:00
Chris Lattner
7c18b18c46 Fix InstCombine/2003-11-03-VarargsCallBug.ll
llvm-svn: 9681
2003-11-03 18:44:58 +00:00
Chris Lattner
05f448173e New testcase for a bug in instcombine
llvm-svn: 9680
2003-11-03 18:33:44 +00:00
Chris Lattner
39c0a19894 Work around a bug in GCC where it can't handle common variables marked weak.
llvm-svn: 9679
2003-11-03 17:35:00 +00:00
Chris Lattner
e4e2595f71 Fix bugs with attribute weak emission
llvm-svn: 9678
2003-11-03 17:32:38 +00:00
Chris Lattner
cbf2aeb684 If linking a library, do not link other libraries, like libc, into it!
This fixes lots of annoying warnings and error messages

llvm-svn: 9677
2003-11-03 17:27:17 +00:00
John Criswell
907720dfe1 Closed the h2 header for the LLVM Test Suite Organization section.
llvm-svn: 9676
2003-11-03 14:59:59 +00:00
Chris Lattner
d33bc06316 More testcases
llvm-svn: 9675
2003-11-03 05:42:50 +00:00
Chris Lattner
e600cec9ec Move a test from cast-set to a new bit-tracking.ll file. Update file comments
llvm-svn: 9674
2003-11-03 05:30:34 +00:00
Chris Lattner
6444c37488 Implement InstCombine/cast-set.ll:test6[a]. This improves code generated for
a hot function in em3d

llvm-svn: 9673
2003-11-03 05:17:03 +00:00
Chris Lattner
11bea4f7c7 Add another case, which an implementation of test6 must be sure to handle
correctly.

llvm-svn: 9672
2003-11-03 05:08:53 +00:00
Chris Lattner
7be3ab2fb7 This simplifies the CWriter code, makes the generated code easier to read,
and makes the output work with the intel compiler.  Overall, a win.

llvm-svn: 9671
2003-11-03 04:31:54 +00:00
Chris Lattner
1693079e92 Implement InstCombine/cast-set.ll: test1, test2, test7
llvm-svn: 9670
2003-11-03 04:25:02 +00:00
Chris Lattner
efde768bf5 Add the testcase from PR8
llvm-svn: 9669
2003-11-03 03:52:34 +00:00
Chris Lattner
c75cfac56d Add another case, which occurs in em3d
llvm-svn: 9668
2003-11-03 03:51:26 +00:00
Chris Lattner
af7893203b Fix bug with zero sized casts
llvm-svn: 9667
2003-11-03 01:29:41 +00:00
Chris Lattner
7af7d94df2 Eliminate the silly namedContext member of printType
llvm-svn: 9666
2003-11-03 01:01:59 +00:00
Chris Lattner
2e8d28d082 Allow CallSites to be used as the key of a map
llvm-svn: 9660
2003-11-02 23:04:33 +00:00
Chris Lattner
2b9926fc8e All DSGraphs keep a reference to the targetdata they are created with. This is
used to eliminate the hard coded, hacked in, sparc specific, global TargetData.
Changing the TargetData used to actually match the code fixes problems, and
eliminates a crash.

llvm-svn: 9659
2003-11-02 22:27:28 +00:00
Chris Lattner
53e8fab411 Fix bug: test/Regression/Analysis/DSGraph/2003-11-02-NodeCollapsing.ll
llvm-svn: 9658
2003-11-02 21:02:20 +00:00
Chris Lattner
175c0839ca New testcase for DSA which is improperly collapsed!
llvm-svn: 9657
2003-11-02 20:43:10 +00:00
Chris Lattner
d4d987dd4a Fix bug in previous checkin
llvm-svn: 9656
2003-11-02 06:54:48 +00:00
Chris Lattner
1f30e93306 The 'thefunc' function should not have weak linkage, it should have linkonce linkage.
llvm-svn: 9655
2003-11-02 06:30:39 +00:00
Chris Lattner
f4ad165e8b Implement transmogriphication of allocation instructions
llvm-svn: 9654
2003-11-02 05:57:39 +00:00
Chris Lattner
fd2183a9cc Add test for instcombine transmogrifying allocation instructions
llvm-svn: 9653
2003-11-02 05:56:58 +00:00
Chris Lattner
38e692da04 Add note about profile.sh
llvm-svn: 9652
2003-11-02 05:20:44 +00:00
Chris Lattner
5d8e552cf1 Add -help option
llvm-svn: 9651
2003-11-02 05:17:32 +00:00
Chris Lattner
dd024a09d9 Bugz fixed
llvm-svn: 9650
2003-11-02 02:15:11 +00:00
Chris Lattner
d57aa5e8a5 Checkin an initial version of the llvm-prof documentation
llvm-svn: 9649
2003-11-02 02:10:54 +00:00
Chris Lattner
7f7285bab7 Fix PR78
llvm-svn: 9648
2003-11-02 02:06:27 +00:00
Chris Lattner
4fa54568a3 The "correct" fix for CBackend/2003-10-23-UnusedType.ll is to not even try
to emit types which are not used.

llvm-svn: 9647
2003-11-02 01:29:27 +00:00
Chris Lattner
7949bf0d54 Including the symbol table in the FindUsedTypes analysis was the WRONG way
to fix test/Regression/CBackend/2003-10-23-UnusedType.ll.  This completely
neutered the deadtypeelim pass.

llvm-svn: 9646
2003-11-02 01:28:41 +00:00
Chris Lattner
91d79bb4be New testcase for PR79
llvm-svn: 9645
2003-11-02 00:57:56 +00:00
Chris Lattner
22c19cdf99 new testcase, for PR 81
llvm-svn: 9644
2003-11-02 00:22:27 +00:00
Chris Lattner
ecbf07b6cd Regression test for PR 80
llvm-svn: 9643
2003-11-01 23:42:08 +00:00
Chris Lattner
e9cdb46520 Escape "'s, which are frequent visitors to C++ types
llvm-svn: 9642
2003-10-31 22:16:41 +00:00
Chris Lattner
b45d9077cb Strip off CPR's manually, because if we don't, the inliner doesn't delete dead
functions.  GRR

llvm-svn: 9641
2003-10-31 21:05:58 +00:00
Chris Lattner
9c4a58b780 Make the call graph more precise despite the hated constantpointerrefs.
Do you detect the animosity I feel towards CPRs yet?

llvm-svn: 9640
2003-10-31 21:05:12 +00:00
Chris Lattner
9157ec025b Did I mention that I _HATE_ CPRs?
llvm-svn: 9639
2003-10-31 18:38:06 +00:00
Misha Brukman
ff91940879 Use stylesheets as much as we can. I admit, I still cannot make CSS do what I
can do with tables, which annoys me.

llvm-svn: 9638
2003-10-31 18:37:20 +00:00
Chris Lattner
0989953b31 Obsolete file goes byebye
llvm-svn: 9637
2003-10-31 18:06:32 +00:00
Misha Brukman
9dc2a3d05c Use some style(sheets).
llvm-svn: 9636
2003-10-31 18:01:30 +00:00
Chris Lattner
f6925da295 Constant pointer refs are causing these to fail unnecessarily, which is causing
a lot of code to be pessimized.  I hate CPRs.  :(

llvm-svn: 9635
2003-10-31 17:51:16 +00:00
Brian Gaeke
b8c28f3553 Well, to be honest, -array-checks and -trace are gone, too. :-)
llvm-svn: 9631
2003-10-31 05:12:04 +00:00
Alkis Evlogimenos
6029d4032c Use already existing classes for post order iterator.
llvm-svn: 9629
2003-10-31 03:02:34 +00:00
Misha Brukman
47e7fd2c0f * Not much point to indent the whole file
* Let CVS keep track of our last-modified timestamp

llvm-svn: 9628
2003-10-31 00:39:28 +00:00
Misha Brukman
c64b74554a The `-q' option has gone away.
llvm-svn: 9627
2003-10-31 00:34:52 +00:00
Chris Lattner
9061d70325 never print zero executions blocks
llvm-svn: 9626
2003-10-31 00:34:05 +00:00
Chris Lattner
a36f81a3ea Simplify code
llvm-svn: 9625
2003-10-31 00:20:09 +00:00
Chris Lattner
34e1549e1b Add percentage info
llvm-svn: 9624
2003-10-31 00:13:26 +00:00
Chris Lattner
0575f97e4b Hrm, some of my counters are wrapping around 32 bits
llvm-svn: 9623
2003-10-31 00:06:57 +00:00
Chris Lattner
babc99cf80 If only have function profile, don't print out "not executed" for all of the blocks :)
llvm-svn: 9622
2003-10-30 23:44:28 +00:00
Chris Lattner
2a5767e4f1 Add the ability to print out llvm code when the -annotated-llvm option is given
llvm-svn: 9621
2003-10-30 23:42:09 +00:00
Chris Lattner
eeabc3f846 Expose new print methods
llvm-svn: 9620
2003-10-30 23:41:19 +00:00
Chris Lattner
8339f7d379 Make use of the new AssemblyAnnotationWriter interface
llvm-svn: 9619
2003-10-30 23:41:03 +00:00
Chris Lattner
de171b3d18 New interface
llvm-svn: 9618
2003-10-30 23:39:52 +00:00
Brian Gaeke
8541bd9db9 Include llvm/CodeGen/MachineCodeForInstruction.h. Use it to start
implementing verifySavedState().

In saveState(), use the new AllocInfo::AllocStateTy enum, and increment
Insn each time through the loop.

llvm-svn: 9617
2003-10-30 21:21:33 +00:00
Brian Gaeke
727ec9bec5 Make AllocState an enum.
Move the stringifying method for that enum into class AllocInfo.

llvm-svn: 9616
2003-10-30 21:21:22 +00:00
Alkis Evlogimenos
5a320efd3b Output types in reverse postorder. This will allow the ByteCode/Reader
to create the minimum number of opaque types for each type with a
cycle in its type graph.

llvm-svn: 9615
2003-10-30 21:04:44 +00:00
Alkis Evlogimenos
404beb98ef Put DEBUG_OUTPUT at the top along with TRACE_LEVEL. Also fix the code
inside DEBUG_OUTPUT so that it compiles.

llvm-svn: 9614
2003-10-30 18:33:58 +00:00
Chris Lattner
b45e1f990c Bugz fixed
llvm-svn: 9613
2003-10-30 16:20:15 +00:00
Brian Gaeke
8d09fd1ea6 Apparently my Mac OS X fixes were not entirely compatible with SPARC...hmm.
llvm-svn: 9612
2003-10-30 15:03:49 +00:00
Chris Lattner
dd63f9e22b When someone includes CallGraph.h, make sure that they link in CallGraph.cpp
llvm-svn: 9611
2003-10-30 05:17:30 +00:00
Chris Lattner
30aad2a98e Fix typo
llvm-svn: 9610
2003-10-30 04:35:26 +00:00
Chris Lattner
a306dd2c05 New bug
llvm-svn: 9609
2003-10-30 01:43:33 +00:00
Chris Lattner
9e167cd6ab Tighten up what we consider to be first class types.
llvm-svn: 9608
2003-10-30 01:38:41 +00:00
Chris Lattner
0fc43a6048 Make sure that PHI node operands are first class types
llvm-svn: 9607
2003-10-30 01:38:18 +00:00
Chris Lattner
78293b7023 Clarify that all manipulatable values must be of first class type, and specifically
update the PHI node entry to mention this as well.

llvm-svn: 9606
2003-10-30 01:31:37 +00:00
Misha Brukman
d8c3ba3315 * Send people to the LLVMdev archive/subscription page rather than just state
the address
* Somewhat standardize the footer of the page

llvm-svn: 9605
2003-10-30 01:23:40 +00:00
Chris Lattner
a2bd4e07ee Another day, another bug
llvm-svn: 9604
2003-10-30 01:20:42 +00:00
Misha Brukman
da6f521ab0 Add a link to the C/C++ front-end building instructions.
llvm-svn: 9603
2003-10-30 01:19:16 +00:00
Misha Brukman
5b4dea338e The answer to this question is "Yes". Let's make that absolutely clear even to
those just skimming the FAQ.

llvm-svn: 9602
2003-10-30 01:16:18 +00:00
Misha Brukman
8a98cd1097 Call me picky, but it's not the state of Illinois' license, it's the
University's.

llvm-svn: 9601
2003-10-30 01:13:56 +00:00
Chris Lattner
686767f3f6 Fix bug: 2003-10-29-CallSiteResolve.ll & PR70
llvm-svn: 9600
2003-10-30 00:46:41 +00:00
Chris Lattner
3cffc56451 New testcase crashing the instruction combiner
llvm-svn: 9599
2003-10-30 00:39:25 +00:00
Chris Lattner
f14ead9210 Print the names of more opaque types
llvm-svn: 9598
2003-10-30 00:22:33 +00:00
Chris Lattner
92d60539c8 Make sure to print opaque types names if they are available.
llvm-svn: 9597
2003-10-30 00:12:51 +00:00
Chris Lattner
3538c9d2d3 Pass unrecognized options into llvmprof
llvm-svn: 9596
2003-10-29 21:51:00 +00:00
Chris Lattner
a79d2b54d2 Add the ability to synthesize function counts from block count information
llvm-svn: 9595
2003-10-29 21:47:44 +00:00
Chris Lattner
e4fb19033e Print the top 20 most frequently executed blocks. Fix sort predicate problem
llvm-svn: 9594
2003-10-29 21:41:17 +00:00
Chris Lattner
3420137e63 Refactor code, initial implementation of -insert-block-profiling pass
llvm-svn: 9593
2003-10-29 21:24:22 +00:00
Chris Lattner
ab8873dde3 More bugs fixed!
llvm-svn: 9592
2003-10-29 20:59:45 +00:00
Dinakar Dhurjati
043b4b0bc3 Fixed LinkO, LinkP error in TOOLLINKOPTSB
llvm-svn: 9591
2003-10-29 20:34:13 +00:00
Brian Gaeke
45eb2eeb74 Explicitly cast type, so we aren't passing output_vbr a size_t.
llvm-svn: 9590
2003-10-29 20:09:01 +00:00
Brian Gaeke
adc07972bc Tweak sed commands so that they filter out more # stuff and also
work on Mac OS X. Also turn ${...} into $(...); we do not speak BSD
Make.

llvm-svn: 9589
2003-10-29 20:07:35 +00:00
Brian Gaeke
7086bbb33c Add support for utostr(unsigned long)
llvm-svn: 9588
2003-10-29 20:06:19 +00:00
Chris Lattner
cbeda5ad9b New testcase
llvm-svn: 9587
2003-10-29 19:18:48 +00:00
Chris Lattner
5b83b56e17 Add two new bugs
llvm-svn: 9586
2003-10-29 18:49:14 +00:00
Chris Lattner
bcb0f4bf2e Fix PR66 & ScalarRepl/2003-10-29-ArrayProblem.ll
llvm-svn: 9585
2003-10-29 17:55:44 +00:00
Chris Lattner
9e761b40af New testcase distilled from:
UnitTests/2003-10-29-ScalarReplBug.c

llvm-svn: 9584
2003-10-29 16:24:10 +00:00
Dinakar Dhurjati
3ac83a9bb3 Added TOOLLINKOPTSB to pass options to the linker (e.g. adding search
path for external libraries).

llvm-svn: 9582
2003-10-29 14:28:35 +00:00
Chris Lattner
a1a090eff4 New bug fixed
llvm-svn: 9581
2003-10-29 07:17:13 +00:00
Chris Lattner
5f6286f1e4 Another bug fixed
llvm-svn: 9580
2003-10-29 06:05:55 +00:00
Chris Lattner
e5f15cdc5f Fix bug: ConstantMerge/2003-10-28-MergeExternalConstants.ll & PR64
llvm-svn: 9579
2003-10-29 06:01:26 +00:00
Chris Lattner
fa979bd78b New testcase
llvm-svn: 9578
2003-10-29 05:51:03 +00:00
Brian Gaeke
0a82d78d8c Pull in stdint.h here, if we have it. Some systems keep
the INT*_MAX macros there.

llvm-svn: 9577
2003-10-29 04:25:48 +00:00
Brian Gaeke
9d2020003b In VM::create(), comment out almost the whole function if NO_JITS_ENABLED,
because the Arch variable will likely be undefined.

llvm-svn: 9576
2003-10-29 04:24:09 +00:00
Alkis Evlogimenos
d478d3d19c Add more debugging info to help tracing the SlotCalculator.
llvm-svn: 9575
2003-10-29 03:12:12 +00:00
Chris Lattner
56df0a53af Yet another bugfix for 1.1
llvm-svn: 9574
2003-10-29 01:26:07 +00:00
Chris Lattner
c0a9905d1d New testcase
llvm-svn: 9573
2003-10-29 01:23:01 +00:00
Chris Lattner
3e5ff2568c Check in statistifying patch for Bill
llvm-svn: 9572
2003-10-28 23:14:59 +00:00
Chris Lattner
36213c7f97 Add fixed PR
llvm-svn: 9571
2003-10-28 23:13:03 +00:00
Chris Lattner
8d1464e2d6 Add new method
llvm-svn: 9570
2003-10-28 23:10:44 +00:00
Chris Lattner
54ac910a5c Fix PR62, and llvm/test/Regression/CBackend/2003-10-28-CastToPtrToStruct.ll
ConstantExpr's can use unrelated types, make sure to scan them.

llvm-svn: 9569
2003-10-28 23:09:45 +00:00
Brian Gaeke
329265fa87 New testcase, reduced from DOOM.
llvm-svn: 9568
2003-10-28 22:54:56 +00:00
Chris Lattner
c88f7bb317 Cleanup output a bit
llvm-svn: 9567
2003-10-28 22:53:49 +00:00
Chris Lattner
2c14d253c4 Add option for block profiling, pass in the "correct" argv[0] to the program
llvm-svn: 9566
2003-10-28 22:52:05 +00:00
Chris Lattner
5564406f6e Add the ability for users to specify a specific argv[0] to pass into the
program

llvm-svn: 9565
2003-10-28 22:51:44 +00:00
Chris Lattner
3e659233aa Actually save and pass in argument information
llvm-svn: 9564
2003-10-28 22:45:25 +00:00
Chris Lattner
183fa7ceb3 Pass in argc & argv
llvm-svn: 9563
2003-10-28 22:42:24 +00:00
Chris Lattner
2343a0eed2 Print out command lines used to run the programs
llvm-svn: 9562
2003-10-28 22:30:37 +00:00
Brian Gaeke
8fb7af1ee7 Fix extract to use the right TargetData, like Bugpoint does.
llvm-svn: 9561
2003-10-28 22:22:16 +00:00
Chris Lattner
10c91cccff Helper script for collecting profiling instrumentation. Simply run
$ profile.pl foo.bc <args>

... to instrument, run, then print a program profile!

llvm-svn: 9560
2003-10-28 22:11:31 +00:00
Chris Lattner
2091cc4310 Add support for reading block frequencies. Fix bug in attribution of counts
to functions

llvm-svn: 9559
2003-10-28 21:25:23 +00:00
Misha Brukman
b7c3b6dc4d * Put LLVM in title of page so readers know which CFE we're talking about
* Use <ol> instead of <ul> if we're gonna number the list items
* Close <li> tags
* Stylize the document footer to be consistent

llvm-svn: 9558
2003-10-28 21:09:29 +00:00
Chris Lattner
8b8a777e41 Provide an accessor for getting function count information. Print a simple
report

llvm-svn: 9557
2003-10-28 21:08:18 +00:00
Chris Lattner
fc8bd0622f Read in the bytecode and profile information, but don't do anything with
it yet.

llvm-svn: 9556
2003-10-28 20:13:07 +00:00
Chris Lattner
5b78ea3473 We need to output the number of records we have, so we know how many to read in! Doh.
llvm-svn: 9555
2003-10-28 19:35:56 +00:00
John Criswell
c3ee97dc76 Generated autoconf script for Chris.
llvm-svn: 9554
2003-10-28 19:21:11 +00:00
Chris Lattner
cccd090942 Add profiling runtime and llvm-prof tools. Would someone please regen the
configure script for me?  :)

llvm-svn: 9553
2003-10-28 19:17:11 +00:00
Chris Lattner
f6c89c91ae Build the llvm-prof directory
llvm-svn: 9552
2003-10-28 19:16:49 +00:00
Chris Lattner
14b392fdea Initial checkin of llvmprof stub
llvm-svn: 9551
2003-10-28 19:16:35 +00:00
Brian Gaeke
c4fdf65e5a Remove __STDC_LIMIT_MACROS from here.
llvm-svn: 9550
2003-10-28 19:11:29 +00:00
Brian Gaeke
be9e03f0e4 Add __STDC_LIMIT_MACROS here.
llvm-svn: 9549
2003-10-28 19:09:28 +00:00
Chris Lattner
3c0254e47e Reorder #includes, drop unneeded one
llvm-svn: 9548
2003-10-28 19:08:15 +00:00
Chris Lattner
c8ba0672ac Initial checkin of profiling instrumentation pass. So far, despite the
file name, we only support function profiling.  This will be fixed in the
near future.

llvm-svn: 9547
2003-10-28 18:59:04 +00:00
Chris Lattner
fa5846a33f Initial checkin of function and block profiling runtime library
llvm-svn: 9546
2003-10-28 18:56:51 +00:00
Misha Brukman
11d1f015af Publications do not get distributed with docs/; hence, their stylesheet need not
be distributed either.

llvm-svn: 9545
2003-10-28 18:55:27 +00:00
Chris Lattner
d09f339bed I'm tired of the nightly tester stopping, aren't you?
llvm-svn: 9544
2003-10-28 18:37:24 +00:00
Chris Lattner
233989316c Eliminate using declarations
llvm-svn: 9543
2003-10-27 21:44:09 +00:00
Chris Lattner
5e004e8ce0 Propagating constants to arguments can make other arguments constant. For now
do something dumb, and inefficient, but more complete.

llvm-svn: 9542
2003-10-27 21:09:00 +00:00
Chris Lattner
d2a7427caa Clarify what is a bug and what isn't
llvm-svn: 9539
2003-10-27 18:30:37 +00:00
John Criswell
f531f319d2 Merged in RELEASE_1.
llvm-svn: 9538
2003-10-27 18:18:16 +00:00
John Criswell
867d59abbc Merged in RELEASE_1.
llvm-svn: 9537
2003-10-27 18:02:06 +00:00
Chris Lattner
d16d975ac3 Add a new bugfix
llvm-svn: 9536
2003-10-27 17:58:57 +00:00
John Criswell
8f04bf6426 Merged in RELEASE_1.
llvm-svn: 9535
2003-10-27 17:56:26 +00:00
Chris Lattner
2a4349e1bd New testcase which crashes the C++ FE
llvm-svn: 9534
2003-10-27 17:51:31 +00:00
John Criswell
cdde075fa9 Merged RELEASE_1.
llvm-svn: 9533
2003-10-27 17:46:42 +00:00
John Criswell
9d977d58db Updated with Vikram's comments.
llvm-svn: 9532
2003-10-27 17:41:53 +00:00
Chris Lattner
639579c884 Update release notes for recent bug fixes
llvm-svn: 9531
2003-10-27 17:06:39 +00:00
Chris Lattner
b727fb2663 Fix test: Linker/2003-10-27-LinkOncePromote.ll
Fix PR58

llvm-svn: 9530
2003-10-27 16:39:39 +00:00
Chris Lattner
f38da836f0 Fix initializers to match
llvm-svn: 9529
2003-10-27 16:30:29 +00:00
Chris Lattner
eba4dbf28d New testcase
llvm-svn: 9528
2003-10-27 16:18:28 +00:00
Chris Lattner
25fd5c107f Update release notes
llvm-svn: 9527
2003-10-27 05:41:39 +00:00
Chris Lattner
d9f4ffdf5e Get the list of PHI node values before the basic block is split. Also, add
PHI node entries for unwind instructions just like for call instructions which
became invokes!  This fixes PR57, tested by
Inline/2003-10-26-InlineInvokeExceptionDestPhi.ll

llvm-svn: 9526
2003-10-27 05:33:09 +00:00
Chris Lattner
0fd9c24e56 New testcase.
llvm-svn: 9525
2003-10-27 05:13:47 +00:00
Chris Lattner
9b3c460a1e Make sure to syntax hilight the 'unwind' keyword!
llvm-svn: 9524
2003-10-27 05:09:15 +00:00
Chris Lattner
4f50ebda32 Do not print out lists with thousands of elements in them, that's kinda silly
llvm-svn: 9523
2003-10-27 04:44:59 +00:00
Chris Lattner
7c4bd1d30f Bump the release number, add a skeleton to be filled in as stuff changes.
llvm-svn: 9521
2003-10-27 01:31:14 +00:00
Chris Lattner
ffcc4ddd68 This file is obsolete
llvm-svn: 9520
2003-10-27 01:25:58 +00:00
Vikram S. Adve
227e6191fb Gotta use gmake, not make. make on Solaris is Sun's make which does not work.
llvm-svn: 9510
2003-10-26 13:41:18 +00:00
Chris Lattner
276db4acf7 Add a link to the bug tracker
llvm-svn: 9509
2003-10-25 18:41:16 +00:00
Vikram S. Adve
4da8cb0da7 Rephrase the OSI answer.
llvm-svn: 9508
2003-10-25 17:22:08 +00:00
Vikram S. Adve
a2274887e8 Dang...these different file locations make it a pain to get the URLs right.
llvm-svn: 9507
2003-10-25 17:20:38 +00:00
Vikram S. Adve
c021b23041 Fix license URL and typo.
llvm-svn: 9506
2003-10-25 17:19:21 +00:00
Vikram S. Adve
26c901ed88 Improve formatting of licensing section.
llvm-svn: 9505
2003-10-25 17:14:52 +00:00
Vikram S. Adve
71e433ef98 Add a section on licensing questions.
llvm-svn: 9504
2003-10-25 17:06:55 +00:00
Chris Lattner
4d5767c703 Attempt to provide support for those without RTLD_DEFAULT.
llvm-svn: 9503
2003-10-25 16:55:32 +00:00
Chris Lattner
37edb43831 Unbreak the build
llvm-svn: 9502
2003-10-25 16:18:03 +00:00
John Criswell
ebe140be16 Added answers to test suite questions.
llvm-svn: 9501
2003-10-24 22:48:20 +00:00
Brian Gaeke
eca381c7e8 Publicize the type of FnAllocState.
Prototype option to save state in a global instead of as a Constant in
 the Module. (Turned off, for now, with the on/off switch welded in the off
 position. You get the idea.)

llvm-svn: 9500
2003-10-24 21:21:58 +00:00
Chris Lattner
9ab7fbef60 standardize command line option names
llvm-svn: 9496
2003-10-24 20:05:58 +00:00
Brian Gaeke
055148bdc1 TraceMode, as you may have heard, is history.
ExecutionEngine::create no longer takes a TraceMode argument.

llvm-svn: 9495
2003-10-24 20:00:17 +00:00
Brian Gaeke
275811125d lli -q is history. Rebuild your gccld shell scripts, folks!
llvm-svn: 9494
2003-10-24 20:00:06 +00:00
Brian Gaeke
b77e589bd1 ExecutionEngine::create no longer takes a TraceMode argument.
CurFrame, TraceMode, and the CachedWriter are history.
The ExecutionAnnotations (SlotNumber, InstNumber, and FunctionInfo) are history.
ExecutionContext now keeps Values for each stack frame in a std::map.
printValue() and print() are history.
executeInstruction() is now part of run().

llvm-svn: 9493
2003-10-24 19:59:37 +00:00
Brian Gaeke
65c60e24cd ExecutionEngine::create no longer takes a TraceMode argument.
CurFrame, TraceMode, and the CachedWriter are history.

llvm-svn: 9492
2003-10-24 19:59:28 +00:00
Misha Brukman
c86e8b1261 * Use stylesheets and <div>s for layout instead of <ul>
* Close <a>, <li>, and <p> tags
* This isn't quite HTML 4.01 Strict-compliant, but it's almost there.

llvm-svn: 9491
2003-10-24 19:59:21 +00:00
Brian Gaeke
759ba76905 The ExecutionAnnotations (SlotNumber, InstNumber, and FunctionInfo) are history.
llvm-svn: 9490
2003-10-24 19:59:18 +00:00
Brian Gaeke
e278c22380 Reduce the number of #includes.
CurFrame, TraceMode, and the CachedWriter are history.
ArrayChecksEnabled and non-QuietMode are history.
The ExecutionAnnotations (SlotNumber, InstNumber, and FunctionInfo) are history.
ExecutionContext now keeps Values for each stack frame in a std::map.
Stop pre-initializing Values on the stack to 42.
Remove some dead variables, excess whitespace and commented-out code.
executeInstruction() is now part of run().
printValue() and print() are history.

llvm-svn: 9489
2003-10-24 19:59:01 +00:00
Brian Gaeke
65cd504822 ExecutionEngine::create no longer takes a TraceMode argument.
llvm-svn: 9488
2003-10-24 19:58:38 +00:00
Misha Brukman
f314a4b7aa Added a style for making test red, which is used in CommandLine.html
llvm-svn: 9487
2003-10-24 19:58:36 +00:00
Chris Lattner
b1e8187c31 Turn on the inliner by default at link-time
llvm-svn: 9477
2003-10-24 18:09:23 +00:00
Misha Brukman
084a3a0773 This is now valid HTML 4.01 Strict.
llvm-svn: 9475
2003-10-24 18:06:11 +00:00
Misha Brukman
f196dbb65c * Use HTML 4.01 Strict DTD
* Stop using UTF-8, the webserver sends out iso-8859-1 anyway
* Use style sheets and <div>s instead of <font> tags
* Stop using <ul> for layout

llvm-svn: 9474
2003-10-24 17:57:33 +00:00
Misha Brukman
2ca41fb2c2 Add a style for document footers.
llvm-svn: 9473
2003-10-24 17:56:09 +00:00
Misha Brukman
03d4b0f9af * Made into valid CSS that W3C accepts
* Added document subsubsection styles for usage in documentation

llvm-svn: 9472
2003-10-24 17:34:50 +00:00
Chris Lattner
d6f136c6b1 Add note about multilibs. THis should go into the 1.0 release if possible
llvm-svn: 9467
2003-10-24 16:02:34 +00:00
Chris Lattner
b28c3289df Update list of passes and buglist.
llvm-svn: 9460
2003-10-24 04:03:19 +00:00
Brian Gaeke
98b618270a Destroy MachineFunction for any Function that we are about to
recompile and relink. This keeps it from failing an assertion when
it goes and tries to construct a new MachineFunction for that Function.

llvm-svn: 9459
2003-10-24 03:55:37 +00:00
Vikram S. Adve
3326329b03 Organized in 4 parts. The last two are the same as before: LLVM Docs and
Mailing Lists.  The first two are ""Getting Started" and "Getting Help."

llvm-svn: 9457
2003-10-24 02:36:15 +00:00
Brian Gaeke
24fb8f07f3 Move the implementations of ==, != on AllocInfos here, from UnpackTraceFunction.
llvm-svn: 9452
2003-10-23 20:39:18 +00:00
Brian Gaeke
390d31cde4 Move AllocInfo structure to a private AllocInfo.h header file.
Make FnAllocState contain vectors of AllocInfo, instead of LLVM Constants.
Give doFinalization a method comment, and let it do the work of converting
 AllocInfos to LLVM Constants.

llvm-svn: 9451
2003-10-23 20:32:55 +00:00
Brian Gaeke
a6bfe8eb9e Make FnAllocState contain vectors of AllocInfo, instead of LLVM Constants.
llvm-svn: 9450
2003-10-23 20:32:02 +00:00
Brian Gaeke
8e766c7ab3 New file, containing AllocInfo structure.
llvm-svn: 9449
2003-10-23 20:31:51 +00:00
Chris Lattner
0e18c62fa5 Recommend using -z3
llvm-svn: 9445
2003-10-23 19:49:01 +00:00
Chris Lattner
4541bf7206 Remove explicit paths
llvm-svn: 9444
2003-10-23 19:48:11 +00:00
Chris Lattner
97b5b1fd58 Add assertions
llvm-svn: 9443
2003-10-23 19:33:49 +00:00
Chris Lattner
7eb71b4bd8 Fix bug in eon hopefully
llvm-svn: 9442
2003-10-23 19:33:44 +00:00
Chris Lattner
fb8e19b7ca Fix bug: CBackend/2003-10-23-UnusedType.ll and hopefully 252.eon
llvm-svn: 9441
2003-10-23 19:30:30 +00:00
Chris Lattner
70a3b9024e New testcase, which failes to compile. 252.eon hits this problem
llvm-svn: 9440
2003-10-23 19:25:53 +00:00
1706 changed files with 239987 additions and 54144 deletions

View File

@@ -12,6 +12,10 @@ E: vadve@cs.uiuc.edu
W: http://www.cs.uiuc.edu/~vadve/
D: The Sparc64 backend, provider of much wisdom, and motivator for LLVM
N: Nate Begeman
E: natebegeman@mac.com
D: Portions of the PowerPC backend
N: Tanya Brethour
E: tonic@nondot.org
W: http://nondot.org/~tonic/
@@ -20,7 +24,8 @@ D: The llvm-ar tool
N: Misha Brukman
E: brukman+llvm@uiuc.edu
W: http://misha.brukman.net
D: Portions of X86 and Sparc JIT compilers, incremental bytecode loader
D: Portions of X86 and Sparc JIT compilers, PowerPC backend
D: Incremental bytecode loader
N: Cameron Buschardt
E: buschard@uiuc.edu
@@ -37,14 +42,26 @@ D: Autoconf support, QMTest database, documentation improvements
N: Brian Gaeke
E: gaeke@uiuc.edu
W: http://www.students.uiuc.edu/~gaeke/
D: Portions of X86 static and JIT compilers, reoptimizer framework cleanups
D: Portions of X86 static and JIT compilers.
D: Dynamic trace optimizer
D: FreeBSD/X86 compatibility fixes, the llvm-nm tool
N: Louis Gerbarg
D: Portions of the PowerPC backend
N: Chris Lattner
E: sabre@nondot.org
W: http://nondot.org/~sabre/
D: Primary architect of LLVM
N: Vladimir Merzliakov
E: wanderer@rsu.ru
D: Test suite fixes for FreeBSD.
N: Vladimir Prus
E: ghost@cs.msu.su
D: Made inst_iterator behave like a proper iterator, LowerConstantExprs pass
N: Ruchira Sasanka
E: sasanka@uiuc.edu
D: Graph coloring register allocator for the Sparc64 backend
@@ -53,6 +70,12 @@ N: Anand Shukla
E: ashukla@cs.uiuc.edu
D: The `paths' pass
N: Reid Spencer
E: rspencer@x10sys.com
W: http://extprosys.sourceforge.net/
D: 'llvm' namespacification, Stacker FE, VMCore cleanup (SymbolTable,
D: Value != Type, CPR removal, bytecode improvements, llvmcs).
N: Bill Wendling
E: wendling@isanbard.org
D: The `Lower Setjmp/Longjmp' pass, improvements to the -lowerswitch pass.

View File

@@ -1,45 +1,11 @@
NOTICE:
=======
All distributions of LLVM prior to the 1.0 Release will be licensed to you
under the LLVM pre-release license. The 1.0 Release will be announced on the
LLVM Announcements Mailing List.
After the 1.0 Release of LLVM, the LLVM code will be licensed to you under the
LLVM Release License (aka the Illinois Open Source License).
The main point is that you cannot re-distribute LLVM until the 1.0 Release.
==============================================================================
LLVM pre-release license
==============================================================================
This is a pre-release distribution of the LLVM software and is provided for
evaluation only. This version of the LLVM software or modifications thereof
should not be distributed to third parties for any purpose. Any third parties
interested in it can request a copy directly by sending e-mail to
llvmdev@cs.uiuc.edu. As this is an evaluation release, we would appreciate any
and all feedback, ideas, and reports of bugs that you encounter. You may
discuss development of LLVM on llvmdev@cs.uiuc.edu, and bugs can be submitted
through the LLVM Bug Tracker at http://llvm.cs.uiuc.edu/bugzilla/ . We thank
you for your interest in LLVM and look forward to any comments or feedback you
may have.
THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE
SOFTWARE.
==============================================================================
LLVM Release License
==============================================================================
University of Illinois/NCSA
Open Source License
Copyright (c) 2003, University of Illinois at Urbana-Champaign. All rights
reserved.
Copyright (c) 2003, 2004 University of Illinois at Urbana-Champaign.
All rights reserved.
Developed by:
@@ -83,3 +49,53 @@ The LLVM software contains code written by third parties. Such software will
have its own individual LICENSE.TXT file in the directory in which it appears.
This file will describe the copyrights, license, and restrictions which apply
to that code.
The disclaimer of warranty in the University of Illinois Open Source License
applies to all code in the LLVM Distribution, and nothing in any of the
other licenses gives permission to use the names of the LLVM Team or the
University of Illinois to endorse or promote products derived from this
Software.
The following pieces of software have additional or alternate copyrights,
licenses, and/or restrictions:
Program Directory
------- ---------
PowerPC Backend llvm/lib/Target/PowerPC
Autoconf: llvm/autoconf
llvm/projects/ModuleMaker/autoconf
llvm/projects/sample/autoconf
Burg: llvm/utils/Burg
llvm/test/Programs/MultiSource/Applications/Burg
Aha: llvm/test/Programs/MultiSource/Applications/aha
SGEFA: llvm/test/Programs/MultiSource/Applications/sgefa
SIOD: llvm/test/Programs/MultiSource/Applications/siod
Spiff: llvm/test/Programs/MultiSource/Applications/spiff
D: llvm/test/Programs/MultiSource/Applications/d
Lambda: llvm/test/Programs/MultiSource/Applications/lambda-0.1.3
hbd: llvm/test/Programs/MultiSource/Applications/hbd
treecc: llvm/test/Programs/MultiSource/Applications/treecc
kimwitu++: llvm/test/Programs/MultiSource/Applications/kimwitu++
obsequi: llvm/test/Programs/MultiSource/Applications/obsequi
Fhourstones: llvm/test/Programs/MultiSource/Benchmarks/Fhourstones
McCat: llvm/test/Programs/MultiSource/Benchmarks/McCat
Olden: llvm/test/Programs/MultiSource/Benchmarks/Olden
OptimizerEval: llvm/test/Programs/MultiSource/Benchmarks/OptimizerEval
Ptrdist: llvm/test/Programs/MultiSource/Benchmarks/Ptrdist
LLUBenchmark: llvm/test/Programs/MultiSource/Benchmarks/llubenchmark
SIM: llvm/test/Programs/MultiSource/Benchmarks/sim
cfrac: llvm/test/Programs/MultiSource/Benchmarks/MallocBench/cfrac
espresso: llvm/test/Programs/MultiSource/Benchmarks/MallocBench/espresso
gs: llvm/test/Programs/MultiSource/Benchmarks/MallocBench/gs
p2c: llvm/test/Programs/MultiSource/Benchmarks/MallocBench/p2c
gawk: llvm/test/Programs/MultiSource/Benchmarks/MallocBench/gawk
make: llvm/test/Programs/MultiSource/Benchmarks/MallocBench/make
perl: llvm/test/Programs/MultiSource/Benchmarks/MallocBench/perl
Dhrystone: llvm/test/Programs/SingleSource/Benchmarks/Dhrystone
SingleSource Tests: llvm/test/Programs/SingleSource/Benchmarks/Misc
llvm/test/Programs/SingleSource/CustomChecked
llvm/test/Programs/SingleSource/Gizmos
GNU Libc: llvm/runtime/GCCLibraries/libc
Zlib Library: llvm/runtime/zlib
PNG Library: llvm/runtime/libpng

View File

@@ -1,14 +1,18 @@
##===- ./Makefile ------------------------------------------*- Makefile -*-===##
#===- ./Makefile -------------------------------------------*- Makefile -*--===#
#
# The LLVM Compiler Infrastructure
#
# This file was developed by the LLVM research group and is distributed under
# the University of Illinois Open Source License. See LICENSE.TXT for details.
#
##===----------------------------------------------------------------------===##
#===------------------------------------------------------------------------===#
LEVEL = .
DIRS = lib/Support utils lib tools runtime
DIRS = lib/Support utils lib tools
ifneq ($(MAKECMDGOALS),tools-only)
DIRS += runtime
OPTIONAL_DIRS = projects
endif
include $(LEVEL)/Makefile.common
@@ -22,15 +26,27 @@ distclean:: clean
$(LEVEL)/config.log \
$(LEVEL)/TAGS
tools-only:
@for dir in lib/Support utils lib tools; do $(MAKE) -C $$dir; done
tools-only: all
AUTOCONF = autoconf
AUTOHEADER = autoheader
# Install support for llvm include files:
.PHONY: install-includes
configure: autoconf/configure.ac autoconf/aclocal.m4
cd autoconf && $(AUTOCONF) -o ../configure configure.ac
install-includes:
$(MKDIR) $(DESTDIR)$(includedir)/llvm
cd include && find * -path '*/Internal' -prune -o '(' '!' '(' -name '*~' -o -name .cvsignore ')' -print ')' | grep -v CVS | pax -rwdvpe $(DESTDIR)$(includedir)/llvm
ifneq ($(BUILD_SRC_ROOT),$(BUILD_OBJ_ROOT))
cd $(BUILD_SRC_ROOT)/include && find * -path '*/Internal' -prune -o '(' '!' '(' -name '*~' -o -name .cvsignore ')' -print ')' | grep -v CVS | pax -rwdvpe $(DESTDIR)$(includedir)/llvm
endif
include/Config/config.h.in: autoconf/configure.ac autoconf/aclocal.m4
$(AUTOHEADER) -I autoconf autoconf/configure.ac
install:: install-includes
# Build tags database for Emacs/Xemacs:
.PHONY: tags
TAGS: tags
all::
tags:
find $(wildcard $(SourceDir)/include $(SourceDir)/lib $(SourceDir)/tools) -name '*.cpp' -o -name '*.h' | $(ETAGS) $(ETAGSFLAGS) -

View File

@@ -1,11 +1,11 @@
#===-- Makefile.common - Common make rules for LLVM -------*- makefile -*--====
#===-- Makefile.common - Common make rules for LLVM --------*- Makefile -*--===#
#
# The LLVM Compiler Infrastructure
#
# This file was developed by the LLVM research group and is distributed under
# the University of Illinois Open Source License. See LICENSE.TXT for details.
#
##===----------------------------------------------------------------------===##
#===------------------------------------------------------------------------===#
#
# This file is included by all of the LLVM makefiles. This file defines common
# rules to do things like compile a .cpp file or generate dependency info.

View File

@@ -1,103 +1,84 @@
#===-- Makefile.config - Local configuration for LLVM ------*- makefile -*--====
#===-- Makefile.config - Local configuration for LLVM ------*- Makefile -*--===#
#
# The LLVM Compiler Infrastructure
#
# This file was developed by the LLVM research group and is distributed under
# the University of Illinois Open Source License. See LICENSE.TXT for details.
#
#===------------------------------------------------------------------------===#
#
# This file is included by Makefile.common. It defines paths and other
# values specific to a particular installation of LLVM.
#===-----------------------------------------------------------------------====
#
#===------------------------------------------------------------------------===#
#
# Target operating system for which LLVM will be compiled.
#
OS=@OS@
#
# Target hardware architecture
#
ARCH=@ARCH@
# Endian-ness of the target
ENDIAN=@ENDIAN@
# Path to the C++ compiler to use. This is an optional setting, which defaults
# to whatever your gmake defaults to.
#
# Under Linux, for some reason the compiler driver wants to search the PATH to
# find the system assembler, which breaks if the LLVM assembler is in our path.
# Hack it to use the assembler in /usr/bin directly.
#
CXX = @CXX@
# We have the same problem with the CC binary, which use used by testcases for
# native builds.
#
# Path to the CC binary, which use used by testcases for native builds.
CC := @CC@
#
# Compilation flags for the C and C++ compilers.
#
# Path to the Python interpreter
PYTHON := @PYTHON@
#
# Removing the compiler flags for now. They interfere with the test suite
# (which has its own autoconf stuff), and we don't use -DHAVE_CONFIG_H anyway.
#
#CPPFLAGS+=@DEFS@
#CCFLAGS+=@DEFS@
# Linker flags.
LDFLAGS+=@LDFLAGS@
#
# Removed since it prevents the tests from working properly.
#
#LIBS+=@LIBS@
#
# Libraries needed by tools
#
TOOLLINKOPTS=@LIBS@
#
# Path to the archiver program.
#
# Path to the library archiver program.
AR_PATH = @AR@
#
# The pathnames of the Flex and Bison programs, respectively.
#
BISON = @YACC@
YACC = @YACC@
BISON = @BISON@
FLEX = @LEX@
#
# Paths to miscellaneous programs.
#
RPWD = @RPWD@
SED = @SED@
RM = @RM@
ECHO = @ECHO@
RPWD = pwd
SED = sed
RM = rm
ECHO = echo
MKDIR = @abs_top_srcdir@/autoconf/mkinstalldirs
DATE = @DATE@
MV = @MV@
DATE = date
MV = mv
INSTALL = @INSTALL@
DOT = @DOT@
ETAGS = @ETAGS@
ETAGSFLAGS = @ETAGSFLAGS@
#
# Determine the target for which LLVM should generate code.
#
LLVMGCCARCH := @target@/3.4-llvm
# Full pathnames of LLVM C/C++ front-end 'cc1' and 'cc1plus' binaries:
LCC1 = @LLVMCC1@
LCC1XX = @LLVMCC1PLUS@
# Path to directory where object files should be stored during a build.
# Set OBJ_ROOT to "." if you do not want to use a separate place for
# object files.
#
#OBJ_ROOT = .
OBJ_ROOT := .
# Path to location for LLVM front-end this should only be specified here if you
# want to override the value set in Makefile.$(uname)
#
# Path to location for LLVM C/C++ front-end. You can modify this if you
# want to override the value set by configure.
LLVMGCCDIR := @LLVMGCCDIR@
# When this setting is set to true, programs in the llvm/test/Programs hierarchy
# When this variable is set to 1, programs in the llvm/test/Programs hierarchy
# are not recompiled from source code. Instead, the bytecode for the file is
# pulled from the BYTECODE_REPOSITORY directory. This can be useful when disk
# space is limited or when you just don't want to spend time running the C
# frontend.
#
#USE_PRECOMPILED_BYTECODE := 1
@UPB@
@@ -105,71 +86,54 @@ LLVMGCCDIR := @LLVMGCCDIR@
# versions of the test/Programs/* programs. This is used as the bytecode source
# when USE_PRECOMPILED_BYTECODE is specified or when source code is not
# available for the program (such as SPEC).
#
BYTECODE_REPOSITORY := @BCR@
# Path to location for purify, this is only needed if you build with
# ENABLE_PURIFY=1
#
PURIFY = @PURIFY@
#
# SPEC benchmarks:
# Set the USE_SPEC variable to enable the use of the SPEC benchmarks.
# If these are set then run the SPEC benchmarks.
# You must provide the SPEC benchmarks on your own.
#
@USE_SPEC@
@USE_SPEC2000@
@USE_SPEC95@
#
# Path to the SPEC benchmarks. If you have the SPEC benchmarks, place the
# path here.
#
#SPEC_ROOT := /home/vadve/shared/benchmarks/speccpu2000/benchspec
SPEC_ROOT := @SPEC_ROOT@
# Path to the SPEC benchmarks.
SPEC2000_ROOT := @SPEC2000_ROOT@
SPEC95_ROOT := @SPEC95_ROOT@
# Path to the Povray source code.
@USE_POVRAY@
POVRAY_ROOT := @POVRAY_ROOT@
#
# Path to the PAPI code. This is used by the reoptimizer only.
#
#PAPIDIR := /home/vadve/shared/papi-2.3.4.1
PAPIDIR := @PAPIDIR@
# These are options that can either be enabled here, or can be enabled on the
# make command line (ie, make ENABLE_PROFILING=1)
#
# make command line (ie, make ENABLE_PROFILING=1):
# When ENABLE_OPTIMIZED is enabled, Release builds of all of the LLVM code are
# turned on, and Debug builds are turned off.
#
#ENABLE_OPTIMIZED = 1
@ENABLE_OPTIMIZED@
# When ENABLE_PROFILING is enabled, the llvm source base is built with profile
# information to allow gprof to be used to get execution frequencies.
#
#ENABLE_PROFILING = 1
#
# This option tells the Makefiles to produce verbose output.
# It essentially prints the commands that make is executing
#
#VERBOSE = 1
# When ENABLE_PURIFY is set to 1, the LLVM tools are linked with purify (which
# must be locally installed) to allow for some automated memory error debugging.
#
#ENABLE_PURIFY = 1
@ENABLE_PURIFY@
#
# Enable JIT for this platform
#
@JIT@
#
# Disable LLC diffs for testing.
#
@DISABLE_LLC_DIFFS@
# Shared library extension for this platform.
SHLIBEXT = @SHLIBEXT@
# Executable file extension for this platform.
EXEEXT = @EXEEXT@
###########################################################################
# Directory Configuration
# This section of the Makefile determines what is where. To be
@@ -186,37 +150,27 @@ PAPIDIR := @PAPIDIR@
#
###########################################################################
#
# Set the object build directory. By default, it is the current directory.
#
ifndef BUILD_OBJ_DIR
BUILD_OBJ_DIR := $(subst //,/,$(shell $(RPWD)))
endif
#
# Set the root of the object directory.
#
ifndef BUILD_OBJ_ROOT
BUILD_OBJ_ROOT := $(subst //,/,$(shell cd $(BUILD_OBJ_DIR)/$(LEVEL); $(RPWD)))
endif
#
# Set the source build directory. That is almost always the current directory.
#
ifndef BUILD_SRC_DIR
BUILD_SRC_DIR := $(subst //,/,@abs_top_srcdir@/$(patsubst $(BUILD_OBJ_ROOT)%,%,$(BUILD_OBJ_DIR)))
endif
#
# Set the source root directory.
#
ifndef BUILD_SRC_ROOT
BUILD_SRC_ROOT := $(subst //,/,@abs_top_srcdir@)
endif
#
# Set the LLVM object directory.
#
ifndef LLVM_OBJ_ROOT
ifdef LLVM_SRC_ROOT
LLVM_OBJ_ROOT := $(shell cd $(LLVM_SRC_ROOT); $(RPWD))
@@ -225,18 +179,34 @@ LLVM_OBJ_ROOT := $(BUILD_OBJ_ROOT)
endif
endif
#
# Set the LLVM source directory.
# It is typically the root directory of what we're compiling now.
#
ifndef LLVM_SRC_ROOT
LLVM_SRC_ROOT := $(BUILD_SRC_ROOT)
endif
#
# Set SourceDir for backwards compatbility.
#
ifndef SourceDir
SourceDir=$(BUILD_SRC_DIR)
endif
# Installation directories, as provided by the configure script.
exec_prefix = @exec_prefix@
prefix = @prefix@
program_transform_name = @program_transform_name@
bindir = @bindir@
sbindir = @sbindir@
libexecdir = @libexecdir@
datadir = @datadir@
sysconfdir = @sysconfdir@
sharedstatedir = @sharedstatedir@
localstatedir = @localstatedir@
libdir = @libdir@
bytecode_libdir = $(LLVMGCCDIR)/bytecode-libs
includedir = @includedir@
infodir = @infodir@
mandir = @mandir@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_DATA = @INSTALL_DATA@

View File

@@ -1,11 +1,11 @@
#===-- Makefile.rules - Common make rules for LLVM -------*- makefile -*--====
#===-- Makefile.rules - Common make rules for LLVM ---------*- Makefile -*--===#
#
# The LLVM Compiler Infrastructure
#
# This file was developed by the LLVM research group and is distributed under
# the University of Illinois Open Source License. See LICENSE.TXT for details.
#
##===----------------------------------------------------------------------===##
#===------------------------------------------------------------------------===#
#
# This file is included by all of the LLVM makefiles. This file defines common
# rules to do things like compile a .cpp file or generate dependency info.
@@ -71,12 +71,14 @@ all::$(LLVM_OBJ_ROOT)/config.status
ifdef SHARED_LIBRARY
# if SHARED_LIBRARY is specified, the default is to build the dynamic lib
all:: dynamic
install:: install-dynamic-library
endif
ifdef BYTECODE_LIBRARY
# if BYTECODE_LIBRARY is specified, the default is to build the bytecode lib
all:: bytecodelib
install:: bytecodelib-install
install:: install-bytecode-library
install-bytecode:: install-bytecode-library
endif
# Default Rule: Make sure it's also a :: rule
@@ -91,6 +93,9 @@ test::
# Default rule for building only bytecode.
bytecode::
# Default rule for installing only bytecode.
install-bytecode::
# Print out the directories used for building
prdirs::
@${ECHO} "Build Source Root: " $(BUILD_SRC_ROOT)
@@ -108,7 +113,7 @@ prdirs::
###########################################################################
.SUFFIXES:
.SUFFIXES: .c .cpp .h .hpp .y .l
.SUFFIXES: .lo .o .a .so .bc .td
.SUFFIXES: .lo .o .a $(SHLIBEXT) .bc .td
.SUFFIXES: .ps .dot .d
#
@@ -116,7 +121,7 @@ prdirs::
# slightly since GNU Make will not try to find implicit rules for targets
# which are marked as Phony.
#
.PHONY: all dynamic bytecodelib bytecodelib-install
.PHONY: all dynamic bytecodelib install-bytecode-library
.PHONY: clean distclean install test bytecode prdirs
###########################################################################
@@ -129,10 +134,6 @@ prdirs::
# Variables derived from configuration options...
#--------------------------------------------------------------------
#BinInstDir=/usr/local/bin
#LibInstDir=/usr/local/lib/xxx
#DocInstDir=/usr/doc/xxx
BURG_OPTS = -I
ifdef ENABLE_PROFILING
@@ -243,23 +244,36 @@ endif
#--------------------------------------------------------------------------
# Utilities used while building the LLVM tree, which live in the utils dir
#
BURG := $(LLVMTOOLCURRENT)/burg
BURG := $(LLVMTOOLCURRENT)/burg$(EXEEXT)
RunBurg := $(BURG) $(BURG_OPTS)
TBLGEN := $(LLVMTOOLCURRENT)/tblgen
TBLGEN := $(LLVMTOOLCURRENT)/tblgen$(EXEEXT)
LGCCLDPROG := $(LLVMTOOLCURRENT)/gccld$(EXEEXT)
#--------------------------------------------------------------------------
# The LLVM GCC front-end in C and C++ flavors
#
LLVMGCC := PATH=$(LLVMTOOLCURRENT):$(PATH) $(LLVMGCCDIR)/bin/gcc
LCC1 := $(LLVMGCCDIR)/libexec/gcc/$(LLVMGCCARCH)/cc1
LLVMGXX := PATH=$(LLVMTOOLCURRENT):$(PATH) $(LLVMGCCDIR)/bin/g++
LCC1XX := $(LLVMGCCDIR)/libexec/gcc/$(LLVMGCCARCH)/cc1plus
#--------------------------------------------------------------------------
# Some of the compiled LLVM tools which are used for compilation of runtime
# libraries.
# The compiled LLVM tools
#
LLVMAS := $(LLVMTOOLCURRENT)/llvm-as
LLVMAS := $(LLVMTOOLCURRENT)/llvm-as$(EXEEXT)
# Find the location of the platform specific LLVM GCC libraries
LLVMGCCLIBDIR=$(dir $(shell $(LLVMGCC) -print-file-name=libgcc.a))
# LLVM Tool Definitions (LLVMGCC, LLVMGXX, LLVMAS are provided by
# Makefile.rules)
LLI = $(LLVMTOOLCURRENT)/lli$(EXEEXT)
LLC = $(LLVMTOOLCURRENT)/llc$(EXEEXT)
LGCCAS = $(LLVMTOOLCURRENT)/gccas$(EXEEXT)
LGCCLD = $(LGCCLDPROG) -L$(LLVMGCCLIBDIR) -L$(LLVMGCCDIR)/lib
LDIS = $(LLVMTOOLCURRENT)/llvm-dis$(EXEEXT)
LOPT = $(LLVMTOOLCURRENT)/opt$(EXEEXT)
LLINK = $(LLVMTOOLCURRENT)/llvm-link$(EXEEXT)
LPROF = $(LLVMTOOLCURRENT)/llvm-prof$(EXEEXT)
LANALYZE = $(LLVMTOOLCURRENT)/analyze$(EXEEXT)
LBUGPOINT = $(LLVMTOOLCURRENT)/bugpoint$(EXEEXT)
###########################################################################
@@ -288,17 +302,21 @@ STRIP = $(PLATFORMSTRIPOPTS)
STRIP_WARN_MSG = "(without symbols)"
endif
# Allow gnu extensions...
# Allow GNU extensions:
CPPFLAGS += -D_GNU_SOURCE
# Pull in limit macros from stdint.h, even in C++:
CPPFLAGS += -D__STDC_LIMIT_MACROS
CompileWarnings := -Wall -W -Wwrite-strings -Wno-unused
CompileCommonOpts := $(CompileWarnings) -fshort-enums
### FIXME: this is GCC specific
CPPFLAGS += -DATTR_DEPRECATED='__attribute__ ((deprecated))'
CompileCommonOpts := -Wall -W -Wwrite-strings -Wno-unused
CompileOptimizeOpts := -O3 -DNDEBUG -finline-functions
#
# Compile commands with libtool.
#
Compile := $(LIBTOOL) --mode=compile $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(CompileCommonOpts)
Compile := $(LIBTOOL) --tag=CXX --mode=compile $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(CompileCommonOpts)
CompileC := $(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(CompileCommonOpts)
# Compile a cpp file, don't link...
@@ -319,15 +337,25 @@ CompileCP := $(CompileC) $(CompileOptimizeOpts) $(PROFILE)
# Link final executable
# (Note that we always link with the C++ compiler).
#
Link := $(LIBTOOL) --mode=link $(CXX)
Link := $(LIBTOOL) --tag=CXX --mode=link $(CXX)
# link both projlib and llvmlib libraries
LinkG := $(Link) -g -L$(PROJLIBDEBUGSOURCE) -L$(LLVMLIBDEBUGSOURCE) $(STRIP)
LinkO := $(Link) -O3 -L$(PROJLIBRELEASESOURCE) -L$(LLVMLIBRELEASESOURCE)
LinkP := $(Link) -O3 -L$(PROJLIBPROFILESOURCE) -L$(LLVMLIBPROFILESOURCE) $(PROFILE)
# TOOLLINKOPTSB to pass options to the linker like library search path etc
# Note that this is different from TOOLLINKOPTS, these options
# are passed to the linker *before* the USEDLIBS options are passed.
# e.g. usage TOOLLINKOPTSB = -L/home/xxx/lib
ifdef TOOLLINKOPTSB
LinkG := $(LinkG) $(TOOLLINKOPTSB)
LinkO := $(LinkO) $(TOOLLINKOPTSB)
LinkP := $(LinkP) $(TOOLLINKOPTSB)
endif
# Create one .o file from a bunch of .o files...
Relink := ${LIBTOOL} --mode=link $(CXX)
Relink := ${LIBTOOL} --tag=CXX --mode=link $(CXX)
#
# Configure where the item being compiled should go.
@@ -345,7 +373,7 @@ Depend := $(CXX) -MM -I$(LEVEL)/include $(CPPFLAGS)
DependC := $(CC) -MM -I$(LEVEL)/include $(CPPFLAGS)
# Archive a bunch of .o files into a .a file...
AR = ${AR_PATH} cq
AR = $(AR_PATH) cr
#----------------------------------------------------------
@@ -355,18 +383,18 @@ AR = ${AR_PATH} cq
#
ifndef Source
Source := $(notdir $(ExtraSource) $(wildcard $(SourceDir)/*.cpp \
$(SourceDir)/*.c $(SourceDir)/*.y $(SourceDir)/*.l))
$(SourceDir)/*.cc $(SourceDir)/*.c $(SourceDir)/*.y \
$(SourceDir)/*.l))
endif
#
# Libtool Objects
#
Srcs := $(sort $(basename $(Source)))
Objs := $(addsuffix .lo, $(Srcs))
ObjectsO := $(addprefix $(BUILD_OBJ_DIR)/Release/,$(Objs))
ObjectsP := $(addprefix $(BUILD_OBJ_DIR)/Profile/,$(Objs))
ObjectsG := $(addprefix $(BUILD_OBJ_DIR)/Debug/,$(Objs))
ObjectsBC := $(addprefix $(BUILD_OBJ_DIR)/BytecodeObj/,$(addsuffix .bc, $(Srcs)))
ObjectsO := $(Srcs:%=$(BUILD_OBJ_DIR)/Release/%.lo)
ObjectsP := $(Srcs:%=$(BUILD_OBJ_DIR)/Profile/%.lo)
ObjectsG := $(Srcs:%=$(BUILD_OBJ_DIR)/Debug/%.lo)
ObjectsBC := $(Srcs:%=$(BUILD_OBJ_DIR)/BytecodeObj/%.bc)
#
# The real objects underlying the libtool objects
@@ -381,9 +409,14 @@ RObjectsG := $(addprefix $(BUILD_OBJ_DIR)/Debug/,$(RObjs))
#---------------------------------------------------------
ifdef DIRS
all install clean test bytecode ::
all install clean test bytecode stripped-bytecode install-bytecode::
$(VERB) for dir in ${DIRS}; do \
(cd $$dir; $(MAKE) $@) || exit 1; \
if [ ! -f $$dir/Makefile ]; \
then \
$(MKDIR) $$dir; \
cp $(SourceDir)/$$dir/Makefile $$dir/Makefile; \
fi; \
($(MAKE) -C $$dir $@ $(MFLAGS)) || exit 1; \
done
endif
@@ -394,18 +427,30 @@ install :: $(addsuffix /.makeinstall , $(PARALLEL_DIRS))
clean :: $(addsuffix /.makeclean , $(PARALLEL_DIRS))
test :: $(addsuffix /.maketest , $(PARALLEL_DIRS))
bytecode :: $(addsuffix /.makebytecode, $(PARALLEL_DIRS))
stripped-bytecode :: $(addsuffix /.makestripped-bytecode, $(PARALLEL_DIRS))
install-bytecode :: $(addsuffix /.makeinstall-bytecode, $(PARALLEL_DIRS))
%/.makeall %/.makeinstall %/.makeclean %/.maketest %/.makebytecode:
$(VERB) cd $(@D); $(MAKE) $(subst $(@D)/.make,,$@)
%/.makeall %/.makeinstall %/.makeclean %/.maketest %/.makebytecode %/.makestripped-bytecode %/.makeinstall-bytecode:
$(VERB) if [ ! -f $(@D)/Makefile ]; \
then \
$(MKDIR) $(@D); \
cp $(SourceDir)/$(@D)/Makefile $(@D)/Makefile; \
fi; \
$(MAKE) -C $(@D) $(subst $(@D)/.make,,$@) $(MFLAGS)
endif
# Handle directories that may or may not exist
ifdef OPTIONAL_DIRS
all install clean test bytecode ::
all install clean test bytecode stripped-bytecode install-bytecode::
$(VERB) for dir in ${OPTIONAL_DIRS}; do \
if [ -d $$dir ]; \
if [ -d $(SourceDir)/$$dir ]; \
then\
(cd $$dir; $(MAKE) $@) || exit 1; \
if [ ! -f $$dir/Makefile ]; \
then \
$(MKDIR) $$dir; \
cp $(SourceDir)/$$dir/Makefile $$dir/Makefile; \
fi; \
($(MAKE) -C$$dir $@ $(MFLAGS)) || exit 1; \
fi \
done
endif
@@ -431,44 +476,55 @@ endif
# of it. For this reason, sometimes it's useful to use libraries as .a files.
###########################################################################
# Install rule for making bytecode library directory if it does not exist.
# Trigger this by making libraries that need to be installed here depend on it.
$(DESTDIR)$(bytecode_libdir):
$(MKDIR) $@
ifdef LIBRARYNAME
# Make sure there isn't any extranous whitespace on the LIBRARYNAME option
LIBRARYNAME := $(strip $(LIBRARYNAME))
LIBNAME_O := $(DESTLIBRELEASE)/lib$(LIBRARYNAME).so
LIBNAME_P := $(DESTLIBPROFILE)/lib$(LIBRARYNAME).so
LIBNAME_G := $(DESTLIBDEBUG)/lib$(LIBRARYNAME).so
LIBNAME_O := $(DESTLIBRELEASE)/lib$(LIBRARYNAME)$(SHLIBEXT)
LIBNAME_P := $(DESTLIBPROFILE)/lib$(LIBRARYNAME)$(SHLIBEXT)
LIBNAME_G := $(DESTLIBDEBUG)/lib$(LIBRARYNAME)$(SHLIBEXT)
LIBNAME_CUR := $(DESTLIBCURRENT)/lib$(LIBRARYNAME)$(SHLIBEXT)
LIBNAME_AO := $(DESTLIBRELEASE)/lib$(LIBRARYNAME).a
LIBNAME_AP := $(DESTLIBPROFILE)/lib$(LIBRARYNAME).a
LIBNAME_AG := $(DESTLIBDEBUG)/lib$(LIBRARYNAME).a
LIBNAME_ACUR := $(DESTLIBCURRENT)/lib$(LIBRARYNAME).a
LIBNAME_OBJO := $(DESTLIBRELEASE)/$(LIBRARYNAME).o
LIBNAME_OBJP := $(DESTLIBPROFILE)/$(LIBRARYNAME).o
LIBNAME_OBJG := $(DESTLIBDEBUG)/$(LIBRARYNAME).o
LIBNAME_OBJCUR := $(DESTLIBCURRENT)/$(LIBRARYNAME).o
LIBNAME_BC := $(DESTLIBBYTECODE)/lib$(LIBRARYNAME).bc
#--------------------------------------------------------------------
# Library Targets
# Modify the top level targets to build the desired libraries.
#--------------------------------------------------------------------
# dynamic target builds a shared object version of the library...
dynamic:: $(DESTLIBCURRENT)/lib$(LIBRARYNAME).so
dynamic:: $(LIBNAME_CUR)
bytecodelib:: $(LIBNAME_BC)
bytecodelib-install:: $(LLVMGCCDIR)/bytecode-libs/lib$(LIBRARYNAME).bc
install-bytecode-library:: $(DESTDIR)$(bytecode_libdir)/lib$(LIBRARYNAME).bc
$(LLVMGCCDIR)/bytecode-libs/lib$(LIBRARYNAME).bc: $(LIBNAME_BC)
$(DESTDIR)$(bytecode_libdir)/lib$(LIBRARYNAME).bc: $(LIBNAME_BC) $(DESTDIR)$(bytecode_libdir)
@${ECHO} ======= Installing $(LIBRARYNAME) bytecode library =======
cp $< $@
# Does the library want a .o version built?
ifndef DONT_BUILD_RELINKED
all:: $(DESTLIBCURRENT)/$(LIBRARYNAME).o
all:: $(LIBNAME_OBJCUR)
install:: install-single-object-library
endif
# Does the library want an archive version built?
ifdef BUILD_ARCHIVE
all:: $(DESTLIBCURRENT)/lib$(LIBRARYNAME).a
all:: $(LIBNAME_ACUR)
install:: install-archive-library
endif
#--------------------------------------------------------------------
@@ -489,44 +545,58 @@ endif
# Rule for building bytecode libraries.
$(LIBNAME_BC): $(ObjectsBC) $(LibSubDirs) $(DESTLIBBYTECODE)/.dir
@${ECHO} ======= Linking $(LIBRARYNAME) bytecode library =======
@${ECHO} Linking $(LIBRARYNAME) bytecode library
$(VERB) $(LinkBCLib) -o $@ $(ObjectsBC) $(LibSubDirs) $(LibLinkOpts)
@${ECHO} ======= Finished building $(LIBRARYNAME) bytecode library =======
#
# Rules for building dynamically linked libraries.
#
$(LIBNAME_O): $(ObjectsO) $(LibSubDirs) $(DESTLIBRELEASE)/.dir
@${ECHO} ======= Linking $(LIBRARYNAME) dynamic release library =======
@${ECHO} Linking $(LIBRARYNAME) dynamic release library
$(VERB) $(Link) -o $*.la $(ObjectsO) $(LibSubDirs) $(LibLinkOpts)
$(VERB) $(LIBTOOL) --mode=install $(INSTALL) $*.la $(DESTLIBCURRENT)
@${ECHO} ======= Finished building $(LIBRARYNAME) dynamic release library =======
$(LIBNAME_P): $(ObjectsP) $(LibSubDirs) $(DESTLIBPROFILE)/.dir
@${ECHO} ======= Linking $(LIBRARYNAME) dynamic profile library =======
@${ECHO} Linking $(LIBRARYNAME) dynamic profile library
$(VERB) $(Link) -o $*.la $(ObjectsP) $(LibSubDirs) $(LibLinkOpts)
$(VERB) $(LIBTOOL) --mode=install $(INSTALL) $*.la $(DESTLIBCURRENT)
@${ECHO} ======= Finished building $(LIBRARYNAME) dynamic profile library =======
$(LIBNAME_G): $(ObjectsG) $(LibSubDirs) $(DESTLIBDEBUG)/.dir
@${ECHO} ======= Linking $(LIBRARYNAME) dynamic debug library =======
@${ECHO} Linking $(LIBRARYNAME) dynamic debug library
$(VERB) $(Link) -o $*.la $(ObjectsG) $(LibSubDirs) $(LibLinkOpts)
$(VERB) $(LIBTOOL) --mode=install $(INSTALL) $*.la $(DESTLIBCURRENT)
@${ECHO} ======= Finished building $(LIBRARYNAME) dynamic debug library =======
install-dynamic-library: $(LIBNAME_CUR)
$(MKDIR) $(DESTDIR)$(libdir)
$(VERB) $(LIBTOOL) --mode=install $(INSTALL) $(LIBNAME_CUR) $(DESTDIR)$(libdir)/lib$(LIBRARYNAME)$(SHLIBEXT)
#
# Rules for building static archive libraries.
#
$(LIBNAME_AO): $(ObjectsO) $(LibSubDirs) $(DESTLIBRELEASE)/.dir
@${ECHO} ======= Linking $(LIBRARYNAME) archive release library =======
@${ECHO} Linking $(LIBRARYNAME) archive release library
@$(RM) -f $@
$(VERB) $(Link) -03 -o $@ $(ObjectsO) $(LibSubDirs) -static
@${ECHO} Finished building $(LIBRARYNAME) archive release library =======
$(LIBNAME_AP): $(ObjectsP) $(LibSubDirs) $(DESTLIBPROFILE)/.dir
@${ECHO} ======= Linking $(LIBRARYNAME) archive profile library =======
@${ECHO} Linking $(LIBRARYNAME) archive profile library
@$(RM) -f $@
$(VERB) $(Link) -03 $(PROFILE) -o $@ $(ObjectsP) $(LibSubDirs) -static
@${ECHO} ======= Finished building $(LIBRARYNAME) archive profile library =======
$(LIBNAME_AG): $(ObjectsG) $(LibSubDirs) $(DESTLIBDEBUG)/.dir
@${ECHO} ======= Linking $(LIBRARYNAME) archive debug library =======
@${ECHO} Linking $(LIBRARYNAME) archive debug library
@$(RM) -f $@
$(VERB) $(Link) -g $(STRIP) -o $@ $(ObjectsG) $(LibSubDirs) -static
@${ECHO} ======= Finished building $(LIBRARYNAME) archive debug library =======
install-archive-library: $(LIBNAME_ACUR)
$(MKDIR) $(DESTDIR)$(libdir)
$(VERB) $(LIBTOOL) --mode=install $(INSTALL) $(LIBNAME_ACUR) $(DESTDIR)$(libdir)/lib$(LIBRARYNAME).a
#
# Rules for building .o libraries.
@@ -554,23 +624,10 @@ $(LIBNAME_OBJG): $(ObjectsG) $(LibSubDirs) $(DESTLIBDEBUG)/.dir
@${ECHO} "Linking `basename $@`"
$(VERB) $(Relink) -o $@ $(RObjectsG) $(LibSubDirs)
endif
install-single-object-library: $(LIBNAME_OBJCUR)
$(MKDIR) $(DESTDIR)$(libdir)
$(VERB) $(LIBTOOL) --mode=install $(INSTALL) $(LIBNAME_OBJCUR) $(DESTDIR)$(libdir)/$(LIBRARYNAME).o
#------------------------------------------------------------------------
# Create a TAGS database for emacs
#------------------------------------------------------------------------
ifneq ($(ETAGS),false)
ifeq ($(LEVEL), .)
SRCDIRS := $(wildcard $(SourceDir)/include $(SourceDir)/lib $(SourceDir)/tools)
tags:
$(ETAGS) -l c++ `find $(SRCDIRS) -name '*.cpp' -o -name '*.h'`
all:: tags
endif
else
tags:
${ECHO} "Cannot build $@: The program etags is not installed"
endif
#------------------------------------------------------------------------
@@ -636,16 +693,23 @@ clean::
$(VERB) $(RM) -f $(TOOLEXENAMES)
$(TOOLEXENAME_G): $(ObjectsG) $(USED_LIB_PATHS_G) $(DESTTOOLDEBUG)/.dir
@${ECHO} ======= Linking $(TOOLNAME) debug executable $(STRIP_WARN_MSG) =======
@${ECHO} Linking $(TOOLNAME) debug executable $(STRIP_WARN_MSG)
$(VERB) $(LinkG) -o $@ $(ObjectsG) $(LIB_OPTS_G) $(LINK_OPTS) $(LIBS)
@${ECHO} ======= Finished building $(TOOLNAME) debug executable $(STRIP_WARN_MSG) =======
$(TOOLEXENAME_O): $(ObjectsO) $(USED_LIB_PATHS_O) $(DESTTOOLRELEASE)/.dir
@${ECHO} ======= Linking $(TOOLNAME) release executable =======
@${ECHO} Linking $(TOOLNAME) release executable
$(VERB) $(LinkO) -o $@ $(ObjectsO) $(LIB_OPTS_O) $(LINK_OPTS) $(LIBS)
@${ECHO} ======= Finished building $(TOOLNAME) release executable =======
$(TOOLEXENAME_P): $(ObjectsP) $(USED_LIB_PATHS_P) $(DESTTOOLPROFILE)/.dir
@${ECHO} ======= Linking $(TOOLNAME) profile executable =======
@${ECHO} Linking $(TOOLNAME) profile executable
$(VERB) $(LinkP) -o $@ $(ObjectsP) $(LIB_OPTS_P) $(LINK_OPTS) $(LIBS)
@${ECHO} ======= Finished building $(TOOLNAME) profile executable =======
install:: $(TOOLEXENAMES)
$(MKDIR) $(DESTDIR)$(bindir)
$(LIBTOOL) --mode=install $(INSTALL_PROGRAM) -c -m 0755 $(TOOLEXENAMES) $(DESTDIR)$(bindir)/$(TOOLNAME)
endif
@@ -654,6 +718,7 @@ endif
#---------------------------------------------------------
.PRECIOUS: $(BUILD_OBJ_DIR)/Depend/.dir $(BUILD_OBJ_DIR)/BytecodeObj/.dir
.PRECIOUS: $(BUILD_OBJ_DIR)/Debug/.dir $(BUILD_OBJ_DIR)/Release/.dir
.PRECIOUS: $(BUILD_OBJ_DIR)/Profile/.dir
# Create .lo files in the ObjectFiles directory from the .cpp and .c files...
$(BUILD_OBJ_DIR)/Release/%.lo: %.cpp $(BUILD_OBJ_DIR)/Release/.dir
@@ -682,11 +747,11 @@ $(BUILD_OBJ_DIR)/Debug/%.lo: %.c $(BUILD_OBJ_DIR)/Debug/.dir
$(BUILD_OBJ_DIR)/BytecodeObj/%.bc: %.cpp $(BUILD_OBJ_DIR)/BytecodeObj/.dir $(LCC1XX)
@${ECHO} "Compiling `basename $<` to bytecode"
$(VERB) $(LLVMGXX) $(CompileWarnings) $(CPPFLAGS) -c $< -o $@
$(VERB) $(LLVMGXX) $(CompileCommonOpts) $(CPPFLAGS) -c $< -o $@
$(BUILD_OBJ_DIR)/BytecodeObj/%.bc: %.c $(BUILD_OBJ_DIR)/BytecodeObj/.dir $(LCC1)
@${ECHO} "Compiling `basename $<` to bytecode"
$(VERB) $(LLVMGCC) $(CompileWarnings) $(CPPFLAGS) -c $< -o $@
$(VERB) $(LLVMGCC) $(CompileCommonOpts) $(CPPFLAGS) -c $< -o $@
$(BUILD_OBJ_DIR)/BytecodeObj/%.bc: %.ll $(BUILD_OBJ_DIR)/BytecodeObj/.dir $(LLVMAS)
@${ECHO} "Compiling `basename $<` to bytecode"
@@ -726,7 +791,7 @@ YACC_OUTPUT = $(addprefix $(YACC_FILES:%.y=%), .h .cpp .output)
%.c: %.y # Cancel built-in rules for yacc
%.h: %.y # Cancel built-in rules for yacc
%.cpp %.h : %.y
@${ECHO} Bisoning $<
@${ECHO} "Bisoning `basename $<`"
$(VERB) $(BISON) -v -d -p $(<F:%Parser.y=%) -o $*.tab.c $<
$(VERB) cmp -s $*.tab.c $*.cpp > /dev/null || ${MV} -f $*.tab.c $*.cpp
$(VERB) cmp -s $*.tab.h $*.h > /dev/null || ${MV} -f $*.tab.h $*.h
@@ -759,7 +824,10 @@ clean::
$(VERB) $(RM) -rf $(BUILD_OBJ_DIR)/Debug $(BUILD_OBJ_DIR)/Release
$(VERB) $(RM) -rf $(BUILD_OBJ_DIR)/Profile $(BUILD_OBJ_DIR)/Depend
$(VERB) $(RM) -rf $(BUILD_OBJ_DIR)/BytecodeObj
$(VERB) $(RM) -f core core.[0-9][0-9]* *.o *.d *.so *~ *.flc
$(VERB) $(RM) -f core core.[0-9][0-9]* *.o *.d *~ *.flc
ifneq ($(strip $(SHLIBEXT)),) # Extra paranoia - make real sure SHLIBEXT is set
$(VERB) $(RM) -f *$(SHLIBEXT)
endif
$(VERB) $(RM) -f $(LEX_OUTPUT) $(YACC_OUTPUT)
###########################################################################
@@ -778,11 +846,11 @@ SourceDepend := $(SourceBaseNames:%=$(BUILD_OBJ_DIR)/Depend/%.d)
# Create dependencies for the *.cpp files...
$(BUILD_OBJ_DIR)/Depend/%.d: %.cpp $(BUILD_OBJ_DIR)/Depend/.dir
$(VERB) $(Depend) $< | $(SED) 's|\.o|\.lo|' | $(SED) 's|$*\.lo *|$(BUILD_OBJ_DIR)/Release/& $(BUILD_OBJ_DIR)/Profile/& $(BUILD_OBJ_DIR)/Debug/& $(BUILD_OBJ_DIR)/Depend/$(@F)|g' > $@
$(VERB) $(Depend) $< | $(SED) 's|\.o:|\.lo:|' | $(SED) 's|$*\.lo *|$(BUILD_OBJ_DIR)/Release/& $(BUILD_OBJ_DIR)/Profile/& $(BUILD_OBJ_DIR)/Debug/& $(BUILD_OBJ_DIR)/Depend/$(@F)|g' > $@
# Create dependencies for the *.c files...
$(BUILD_OBJ_DIR)/Depend/%.d: %.c $(BUILD_OBJ_DIR)/Depend/.dir
$(VERB) $(DependC) -o $@ $< | $(SED) 's|\.o|\.lo|' | $(SED) 's|$*\.lo *|$(BUILD_OBJ_DIR)/Release/& $(BUILD_OBJ_DIR)/Profile/& $(BUILD_OBJ_DIR)/Debug/& $(BUILD_OBJ_DIR)/Depend/$(@F)|g' > $@
$(VERB) $(DependC) -o $@ $< | $(SED) 's|\.o:|\.lo:|' | $(SED) 's|$*\.lo *|$(BUILD_OBJ_DIR)/Release/& $(BUILD_OBJ_DIR)/Profile/& $(BUILD_OBJ_DIR)/Debug/& $(BUILD_OBJ_DIR)/Depend/$(@F)|g' > $@
#
# Autoconf Dependencies.
@@ -794,6 +862,13 @@ $(LLVM_OBJ_ROOT)/config.status:: $(LLVM_SRC_ROOT)/configure
@${ECHO} "****************************************************************"
$(VERB) exit 1
# If the Makefile in the source tree has been updated, copy it over into the
# build tree.
Makefile :: $(BUILD_SRC_DIR)/Makefile
@${ECHO} "===== Updating Makefile from source dir: `dirname $<` ====="
$(MKDIR) $(@D)
cp -f $< $@
#
# Include dependencies generated from C/C++ source files, but not if we
# are cleaning (this example taken from the GNU Make Manual).

View File

@@ -1,106 +1 @@
Welcome to LLVM!
This file provides the location of all important LLVM documentation. In
particular, you should read the license information and the installation
directions before you begin using LLVM.
After that, there are several technical references that will help you use LLVM.
Consult them as necessary.
Finally, you can find information on how to communicate with the LLVM
developers and LLVM community. This is of primary interest if you wish to
submit a bug, supply a patch, or just keep current with what's going on with
LLVM.
Introductory Literature:
LLVM Home Page:
http://llvm.cs.uiuc.edu
License Information:
llvm/LICENSE.txt
Release Notes:
llvm/docs/ReleaseNotes.html
LLVM Design:
The LLVM Instruction Set and Compilation Strategy:
http://llvm.cs.uiuc.edu/pubs/2002-08-09-LLVMCompilationStrategy.html
LLVM User Guides:
Download and Installation Instructions:
llvm/docs/GettingStarted.html
LLVM Command Guide:
llvm/docs/CommandGuide/CommandGuide.html
LLVM Assembly Language:
llvm/docs/LangRef.html
LLVM Test Suite Guide:
llvm/docs/TestingGuide.html
LLVM Programming Documentation:
LLVM Programmers Manual:
llvm/docs/ProgrammersManual.html
Writing an LLVM Pass:
llvm/docs/WritingAnLLVMPass.html
Alias Analysis in LLVM:
llvm/docs/AliasAnalysis.html
Command Line Library:
llvm/docs/CommandLine.html
Coding Standards:
llvm/docs/CodingStandards.html
LLVM Community:
Submitting a Bug:
http://llvm.cs.uiuc.edu/docs/HowToSubmitABug.html
Open Projects:
llvm/docs/OpenProjects.html
Creating a new LLVM Project:
llvm/docs/Projects.html
Mailing Lists:
There are several mailing lists providing LLVM users with
information:
o LLVM Announcements List:
http://mail.cs.uiuc.edu/mailman/listinfo/llvm-announce
This is a low volume list that provides
important announcements regarding LLVM. It is
primarily intended to announce new releases,
major updates to the software, etc. This list
is highly recommended for anyone that uses LLVM.
o LLVM Developers List:
http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev
This list is for people who want to be included
in technical discussions of LLVM. People post
to this list when they have questions about
writing code for or using the LLVM tools. It
is low volume.
o LLVM Commits List
http://mail.cs.uiuc.edu/mailman/listinfo/llvm-commits
This list contains all commit messages that are
made when LLVM developers commit code changes
to the CVS archive. It is useful for those who
want to stay on the bleeding edge of LLVM
development.
This list is very high volume.
This file is a placeholder; see docs/index.html for documentation.

21
llvm/autoconf/AutoRegen.sh Executable file
View File

@@ -0,0 +1,21 @@
#!/bin/sh
die () {
echo "$@" 1>&2
exit 1
}
test -d autoconf && test -f autoconf/configure.ac && cd autoconf
[ -f configure.ac ] || die "Can't find 'autoconf' dir; please cd into it first"
echo "Regenerating aclocal.m4 with aclocal"
aclocal || die "aclocal failed"
autoconf --version | egrep '2\.5[0-9]' > /dev/null
if test $? -ne 0
then
die "Your autoconf was not detected as being 2.5x"
fi
echo "Note: Warnings about 'AC_CONFIG_SUBDIRS: you should use literals' are ok"
echo "Regenerating configure with autoconf 2.5x"
autoconf -o ../configure configure.ac || die "autoconf failed"
cd ..
echo "Regenerating config.h.in with autoheader 2.5x"
autoheader -I autoconf autoconf/configure.ac || die "autoheader failed"
exit 0

6306
llvm/autoconf/acinclude.m4 Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,21 +1,5 @@
dnl Autoconf requirements
dnl AC_INIT(package, version, bug-report-address)
dnl information on the package
dnl checks for programs
dnl checks for libraries
dnl checks for header files
dnl checks for types
dnl checks for structures
dnl checks for compiler characteristics
dnl checks for library functions
dnl checks for system services
dnl AC_CONFIG_FILES([file...])
dnl AC_OUTPUT
dnl **************************************************************************
dnl * Initialize
dnl **************************************************************************
AC_INIT([[[LLVM]]],[[[1.0]]],[llvmbugs@cs.uiuc.edu])
dnl Initialize autoconf
AC_INIT([[LLVM]],[[1.3]],[llvmbugs@cs.uiuc.edu])
dnl Place all of the extra autoconf files into the config subdirectory
AC_CONFIG_AUX_DIR([autoconf])
@@ -30,81 +14,43 @@ then
fi
fi
if test -d ${srcdir}/projects/sample
then
AC_CONFIG_SUBDIRS(projects/sample)
fi
dnl Configure all of the projects present in our source tree.
for i in `ls ${srcdir}/projects`
do
if test ${i} != "CVS"
then
if test -f ${srcdir}/projects/${i}/configure
then
AC_CONFIG_SUBDIRS(projects/${i})
fi
fi
done
if test -d ${srcdir}/projects/reopt
then
AC_CONFIG_SUBDIRS(projects/reopt)
fi
if test -d ${srcdir}/projects/poolalloc
then
AC_CONFIG_SUBDIRS(projects/poolalloc)
fi
dnl Configure a header file
dnl Configure header files
AC_CONFIG_HEADERS(include/Config/config.h)
dnl Configure other output file
AC_CONFIG_FILES(Makefile.config
include/Support/DataTypes.h
include/Support/ThreadSupport.h
include/Support/hash_map
include/Support/hash_set
include/Support/iterator)
dnl Do special configuration of Makefiles
AC_CONFIG_MAKEFILE(Makefile)
AC_CONFIG_MAKEFILE(Makefile.common)
AC_CONFIG_MAKEFILE(Makefile.rules)
AC_CONFIG_MAKEFILE(lib/Makefile)
AC_CONFIG_MAKEFILE(lib/Analysis/Makefile)
AC_CONFIG_MAKEFILE(lib/Analysis/DataStructure/Makefile)
AC_CONFIG_MAKEFILE(lib/Analysis/IPA/Makefile)
AC_CONFIG_MAKEFILE(lib/Analysis/LiveVar/Makefile)
AC_CONFIG_MAKEFILE(lib/AsmParser/Makefile)
AC_CONFIG_MAKEFILE(lib/Bytecode/Makefile)
AC_CONFIG_MAKEFILE(lib/Bytecode/Reader/Makefile)
AC_CONFIG_MAKEFILE(lib/Bytecode/Writer/Makefile)
AC_CONFIG_MAKEFILE(lib/CWriter/Makefile)
AC_CONFIG_MAKEFILE(lib/CodeGen/Makefile)
AC_CONFIG_MAKEFILE(lib/CodeGen/InstrSched/Makefile)
AC_CONFIG_MAKEFILE(lib/CodeGen/InstrSelection/Makefile)
AC_CONFIG_MAKEFILE(lib/CodeGen/ModuloScheduling/Makefile)
AC_CONFIG_MAKEFILE(lib/CodeGen/RegAlloc/Makefile)
AC_CONFIG_MAKEFILE(lib/CodeGen/SelectionDAG/Makefile)
AC_CONFIG_MAKEFILE(lib/ExecutionEngine/Makefile)
AC_CONFIG_MAKEFILE(lib/ExecutionEngine/Interpreter/Makefile)
AC_CONFIG_MAKEFILE(lib/ExecutionEngine/JIT/Makefile)
AC_CONFIG_MAKEFILE(lib/Support/Makefile)
AC_CONFIG_MAKEFILE(lib/Target/Makefile)
AC_CONFIG_MAKEFILE(lib/Target/Sparc/Makefile)
AC_CONFIG_MAKEFILE(lib/Target/X86/Makefile)
AC_CONFIG_MAKEFILE(lib/Transforms/Makefile)
AC_CONFIG_MAKEFILE(lib/Transforms/Hello/Makefile)
AC_CONFIG_MAKEFILE(lib/Transforms/IPO/Makefile)
AC_CONFIG_MAKEFILE(lib/Transforms/Instrumentation/Makefile)
AC_CONFIG_MAKEFILE(lib/Transforms/Instrumentation/ProfilePaths/Makefile)
AC_CONFIG_MAKEFILE(lib/Transforms/Scalar/Makefile)
AC_CONFIG_MAKEFILE(lib/Transforms/Utils/Makefile)
AC_CONFIG_MAKEFILE(lib/VMCore/Makefile)
AC_CONFIG_MAKEFILE(runtime/Makefile)
AC_CONFIG_MAKEFILE(runtime/GCCLibraries/Makefile)
AC_CONFIG_MAKEFILE(runtime/GCCLibraries/crtend/Makefile)
AC_CONFIG_MAKEFILE(runtime/GCCLibraries/libc/Makefile)
AC_CONFIG_MAKEFILE(runtime/GCCLibraries/libcurses/Makefile)
AC_CONFIG_MAKEFILE(runtime/GCCLibraries/libg/Makefile)
AC_CONFIG_MAKEFILE(runtime/GCCLibraries/libgcc/Makefile)
AC_CONFIG_MAKEFILE(runtime/GCCLibraries/libm/Makefile)
AC_CONFIG_MAKEFILE(runtime/GCCLibraries/libmalloc/Makefile)
AC_CONFIG_MAKEFILE(runtime/GCCLibraries/libtermcap/Makefile)
AC_CONFIG_MAKEFILE(runtime/GCCLibraries/libucb/Makefile)
AC_CONFIG_MAKEFILE(runtime/GCCLibraries/libutempter/Makefile)
AC_CONFIG_MAKEFILE(runtime/GCCLibraries/libutil/Makefile)
AC_CONFIG_MAKEFILE(runtime/libdummy/Makefile)
AC_CONFIG_MAKEFILE(runtime/libtrace/Makefile)
AC_CONFIG_MAKEFILE(test/Makefile)
AC_CONFIG_MAKEFILE(test/Makefile.tests)
AC_CONFIG_MAKEFILE(test/QMTest/llvm.py)
AC_CONFIG_MAKEFILE(test/QMTest/llvmdb.py)
AC_CONFIG_MAKEFILE(test/Programs/Makefile)
AC_CONFIG_MAKEFILE(test/Programs/Makefile.programs)
AC_CONFIG_MAKEFILE(test/Programs/Makefile.tests)
AC_CONFIG_MAKEFILE(test/Programs/TEST.aa.Makefile)
AC_CONFIG_MAKEFILE(test/Programs/TEST.dsgraph.report)
AC_CONFIG_MAKEFILE(test/Programs/TEST.micro.report)
AC_CONFIG_MAKEFILE(test/Programs/TEST.aa.report)
AC_CONFIG_MAKEFILE(test/Programs/TEST.example.Makefile)
AC_CONFIG_MAKEFILE(test/Programs/TEST.nightly.Makefile)
@@ -115,162 +61,93 @@ AC_CONFIG_MAKEFILE(test/Programs/TEST.dsgraph.Makefile)
AC_CONFIG_MAKEFILE(test/Programs/TEST.jit.report)
AC_CONFIG_MAKEFILE(test/Programs/TEST.typesafe.Makefile)
AC_CONFIG_MAKEFILE(test/Programs/TEST.dsgraph.gnuplot)
AC_CONFIG_MAKEFILE(test/Programs/TEST.micro.Makefile)
AC_CONFIG_MAKEFILE(test/Programs/TEST.vtl.Makefile)
AC_CONFIG_MAKEFILE(test/Programs/External/Makefile)
AC_CONFIG_MAKEFILE(test/Programs/External/SPEC/Makefile)
AC_CONFIG_MAKEFILE(test/Programs/External/SPEC/Makefile.spec)
AC_CONFIG_MAKEFILE(test/Programs/External/SPEC/CFP2000/Makefile)
AC_CONFIG_MAKEFILE(test/Programs/External/SPEC/CFP2000/177.mesa/Makefile)
AC_CONFIG_MAKEFILE(test/Programs/External/SPEC/CFP2000/179.art/Makefile)
AC_CONFIG_MAKEFILE(test/Programs/External/SPEC/CFP2000/183.equake/Makefile)
AC_CONFIG_MAKEFILE(test/Programs/External/SPEC/CFP2000/188.ammp/Makefile)
AC_CONFIG_MAKEFILE(test/Programs/External/SPEC/CINT2000/Makefile)
AC_CONFIG_MAKEFILE(test/Programs/External/SPEC/CINT2000/164.gzip/Makefile)
AC_CONFIG_MAKEFILE(test/Programs/External/SPEC/CINT2000/175.vpr/Makefile)
AC_CONFIG_MAKEFILE(test/Programs/External/SPEC/CINT2000/176.gcc/Makefile)
AC_CONFIG_MAKEFILE(test/Programs/External/SPEC/CINT2000/181.mcf/Makefile)
AC_CONFIG_MAKEFILE(test/Programs/External/SPEC/CINT2000/186.crafty/Makefile)
AC_CONFIG_MAKEFILE(test/Programs/External/SPEC/CINT2000/197.parser/Makefile)
AC_CONFIG_MAKEFILE(test/Programs/External/SPEC/CINT2000/252.eon/Makefile)
AC_CONFIG_MAKEFILE(test/Programs/External/SPEC/CINT2000/253.perlbmk/Makefile)
AC_CONFIG_MAKEFILE(test/Programs/External/SPEC/CINT2000/254.gap/Makefile)
AC_CONFIG_MAKEFILE(test/Programs/External/SPEC/CINT2000/255.vortex/Makefile)
AC_CONFIG_MAKEFILE(test/Programs/External/SPEC/CINT2000/256.bzip2/Makefile)
AC_CONFIG_MAKEFILE(test/Programs/External/SPEC/CINT2000/300.twolf/Makefile)
AC_CONFIG_MAKEFILE(test/Programs/LLVMSource/Makefile)
AC_CONFIG_MAKEFILE(test/Programs/External/SPEC/Makefile.spec2000)
AC_CONFIG_MAKEFILE(test/Programs/External/SPEC/Makefile.spec95)
AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Makefile)
AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Makefile.multisrc)
AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Applications/Makefile)
AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Applications/Burg/Makefile)
AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Applications/aha/Makefile)
AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Applications/sgefa/Makefile)
AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/Makefile)
AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/Fhourstones/Makefile)
AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/McCat/Makefile)
AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/McCat/01-qbsort/Makefile)
AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/McCat/03-testtrie/Makefile)
AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/McCat/04-bisect/Makefile)
AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/McCat/05-eks/Makefile)
AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/McCat/08-main/Makefile)
AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/McCat/09-vor/Makefile)
AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/McCat/12-IOtest/Makefile)
AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/McCat/15-trie/Makefile)
AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/McCat/17-bintr/Makefile)
AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/McCat/18-imp/Makefile)
AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/Olden/Makefile)
AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/Olden/bh/Makefile)
AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/Olden/bisort/Makefile)
AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/Olden/em3d/Makefile)
AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/Olden/health/Makefile)
AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/Olden/mst/Makefile)
AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/Olden/perimeter/Makefile)
AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/Olden/power/Makefile)
AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/Olden/treeadd/Makefile)
AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/Olden/tsp/Makefile)
AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/Olden/voronoi/Makefile)
AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/OptimizerEval/Makefile)
AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/Ptrdist/Makefile)
AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/Ptrdist/anagram/Makefile)
AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/Ptrdist/bc/Makefile)
AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/Ptrdist/ft/Makefile)
AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/Ptrdist/ks/Makefile)
AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/Ptrdist/yacr2/Makefile)
AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/llubenchmark/Makefile)
AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/sim/Makefile)
AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/analyzer/test.in)
AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/distray/Makefile)
AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/distray/test.in)
AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/fourinarow/Makefile)
AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/fourinarow/test.in)
AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/mason/Makefile)
AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/mason/test.in)
AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/neural/Makefile)
AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/neural/test.in)
AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/pcompress2/Makefile)
AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/pcompress2/test.in)
AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/pifft/Makefile)
AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/pifft/test.in)
AC_CONFIG_MAKEFILE(test/Programs/SingleSource/Makefile)
AC_CONFIG_MAKEFILE(test/Programs/SingleSource/Makefile.singlesrc)
AC_CONFIG_MAKEFILE(test/Programs/SingleSource/Gizmos/Makefile)
AC_CONFIG_MAKEFILE(test/Programs/SingleSource/Benchmarks/Makefile)
AC_CONFIG_MAKEFILE(test/Programs/SingleSource/Benchmarks/Dhrystone/Makefile)
AC_CONFIG_MAKEFILE(test/Programs/SingleSource/Benchmarks/Shootout/Makefile)
AC_CONFIG_MAKEFILE(test/Programs/SingleSource/Benchmarks/Stanford/Makefile)
AC_CONFIG_MAKEFILE(test/Programs/SingleSource/Benchmarks/Misc/Makefile)
AC_CONFIG_MAKEFILE(test/Programs/SingleSource/CustomChecked/Makefile)
AC_CONFIG_MAKEFILE(test/Programs/SingleSource/UnitTests/Makefile)
AC_CONFIG_MAKEFILE(test/Programs/SingleSource/UnitTests/SetjmpLongjmp/Makefile)
AC_CONFIG_MAKEFILE(test/Programs/SingleSource/Regression/Makefile)
AC_CONFIG_MAKEFILE(test/Programs/SingleSource/Regression/C/Makefile)
AC_CONFIG_MAKEFILE(test/Programs/SingleSource/Regression/C++/Makefile)
AC_CONFIG_MAKEFILE(test/Programs/SingleSource/Regression/C++/EH/Makefile)
AC_CONFIG_MAKEFILE(tools/Makefile)
AC_CONFIG_MAKEFILE(tools/analyze/Makefile)
AC_CONFIG_MAKEFILE(tools/bugpoint/Makefile)
AC_CONFIG_MAKEFILE(tools/extract/Makefile)
AC_CONFIG_MAKEFILE(tools/gccas/Makefile)
AC_CONFIG_MAKEFILE(tools/gccld/Makefile)
AC_CONFIG_MAKEFILE(tools/llc/Makefile)
AC_CONFIG_MAKEFILE(tools/llee/Makefile)
AC_CONFIG_MAKEFILE(tools/lli/Makefile)
AC_CONFIG_MAKEFILE(tools/llvm-ar/Makefile)
AC_CONFIG_MAKEFILE(tools/llvm-as/Makefile)
AC_CONFIG_MAKEFILE(tools/llvm-dis/Makefile)
AC_CONFIG_MAKEFILE(tools/llvm-link/Makefile)
AC_CONFIG_MAKEFILE(tools/llvm-nm/Makefile)
AC_CONFIG_MAKEFILE(tools/opt/Makefile)
AC_CONFIG_MAKEFILE(utils/Makefile)
AC_CONFIG_MAKEFILE(utils/Burg/Makefile)
AC_CONFIG_MAKEFILE(utils/Burg/Doc/Makefile)
AC_CONFIG_MAKEFILE(utils/TableGen/Makefile)
AC_CONFIG_MAKEFILE(projects/Makefile)
AC_CONFIG_MAKEFILE(projects/ModuleMaker/Makefile)
AC_CONFIG_MAKEFILE(projects/ModuleMaker/Makefile.common)
AC_CONFIG_MAKEFILE(projects/ModuleMaker/tools/Makefile)
AC_CONFIG_MAKEFILE(projects/ModuleMaker/tools/ModuleMaker/Makefile)
dnl **************************************************************************
dnl * Determine which system we are building on
dnl **************************************************************************
dnl Check the install program (needs to be done before canonical stuff)
dnl Find the install program (needs to be done before canonical stuff)
AC_PROG_INSTALL
dnl Check which host for which we're compiling. This will tell us which LLVM
dnl compiler will be used for compiling SSA into object code.
AC_CANONICAL_TARGET
dnl
dnl Now, for some of our own magic:
dnl Set the "OS" Makefile variable based on the system we are building on.
dnl We will use the build machine information to set some variables.
dnl
case $build in
*i*86*) AC_SUBST(OS,[Linux])
*-*-linux*)
AC_SUBST(OS,[Linux])
if test -d /home/vadve/lattner/local/x86/llvm-gcc
then
AC_SUBST(LLVMGCCDIR,[/home/vadve/lattner/local/x86/llvm-gcc/])
fi
;;
*sparc*) AC_SUBST(OS,[SunOS])
*-*-solaris*)
AC_SUBST(OS,[SunOS])
if test -d /home/vadve/lattner/local/sparc/llvm-gcc
then
AC_SUBST(LLVMGCCDIR,[/home/vadve/lattner/local/sparc/llvm-gcc/])
fi
;;
*-*-cygwin*)
AC_SUBST(OS,[Cygwin])
;;
*-*-darwin*)
AC_SUBST(OS,[Darwin])
;;
*-*-aix*)
AC_SUBST(OS,[AIX])
;;
*) AC_SUBST(OS,[Unknown])
;;
esac
dnl
dnl If we are targetting a Sparc machine running Solaris, pretend that it is
dnl V9, since that is all that we support at the moment, and autoconf will only
dnl tell us we're a sparc.
dnl
case $target in
*sparc*solaris*) AC_SUBST(target,[[sparcv9-sun-solaris2.8]])
sparc*-*-solaris*) AC_SUBST(target,[[sparcv9-sun-solaris2.8]])
;;
esac
dnl
dnl Determine what our target architecture is and configure accordingly.
dnl This will allow Makefiles to make a distinction between the hardware and
dnl the OS.
dnl
case $target in
*i*86*) AC_SUBST(ARCH,[x86])
i*86-*) AC_SUBST(ARCH,[x86])
;;
*sparc*solaris*) AC_SUBST(ARCH,[Sparc])
sparc*-*) AC_SUBST(ARCH,[Sparc])
;;
powerpc*-*) AC_SUBST(ARCH,[PowerPC])
;;
*) AC_SUBST(ARCH,[Unknown])
;;
esac
dnl **************************************************************************
dnl * Check for programs.
dnl **************************************************************************
dnl Check for compilation tools
AC_PROG_CXX
AC_PROG_CC(gcc)
@@ -281,7 +158,6 @@ if test "$GCC" != "yes"
then
AC_MSG_ERROR([gcc required but not found])
fi
if test "$GXX" != "yes"
then
AC_MSG_ERROR([g++ required but not found])
@@ -291,86 +167,41 @@ dnl Verify that GCC is version 3.0 or higher
gccmajor=`$CC --version | head -n 1 | awk '{print $NF;}' | cut -d. -f1`
if test "$gccmajor" -lt "3"
then
AC_MSG_ERROR([gcc 3.x required])
AC_MSG_ERROR([gcc 3.x required, but you have a lower version])
fi
dnl Check for GNU Make. We use its extensions to, so don't build without it
dnl Check for GNU Make. We use its extensions too, so don't build without it
CHECK_GNU_MAKE
if test -z "$_cv_gnu_make_command"
then
AC_MSG_ERROR([GNU Make required but not found])
fi
dnl Check for compiler-compiler tools (reminds me of Little Caesar's Pizza)
dnl Checks for other tools
AC_PROG_FLEX
AC_PROG_BISON
dnl Check for libtool
AC_PROG_LIBTOOL
dnl Check for our special programs
AC_PATH_PROG(RPWD,[pwd],[false])
if test ${RPWD} = "false"
dnl Checks for tools we can get away with not having:
AC_PATH_PROG(DOT,[dot],[true dot])
AC_PATH_PROG(ETAGS,[etags],[true etags])
dnl Check if we know how to tell etags we are using C++:
etags_version=`$ETAGS --version 2>&1`
case "$etags_version" in
*[Ee]xuberant*) ETAGSFLAGS="--language-force=c++" ;;
*GNU\ Emacs*) ETAGSFLAGS="-l c++" ;;
*) ETAGSFLAGS="" ;;
esac
AC_SUBST(ETAGSFLAGS,$ETAGSFLAGS)
AC_PATH_PROG(PYTHON,[python],[true python])
if test "$PYTHON" = "false"
then
AC_MSG_ERROR([pwd required but not found])
AC_MSG_WARN([Python is required for the test suite, but it was not found])
fi
AC_PATH_PROG(AR,[ar],[false])
if test ${AR} = "false"
AC_PATH_PROG(QMTEST,[qmtest],[true qmtest])
if test "$QMTEST" = "false"
then
AC_MSG_ERROR([ar required but not found])
fi
AC_PATH_PROG(SED,[sed],[false])
if test ${SED} = "false"
then
AC_MSG_ERROR([sed required but not found])
fi
AC_PATH_PROG(RM,[rm],[false])
if test ${RM} = "false"
then
AC_MSG_ERROR([rm required but not found])
fi
AC_PATH_PROG(ECHO,[echo],[false])
if test ${ECHO} = "false"
then
AC_MSG_ERROR([echo required but not found])
fi
AC_PATH_PROG(MKDIR,[mkdir],[false])
if test ${MKDIR} = "false"
then
AC_MSG_ERROR([mkdir required but not found])
fi
AC_PATH_PROG(DATE,[date],[false])
if test ${DATE} = "false"
then
AC_MSG_ERROR([date required but not found])
fi
AC_PATH_PROG(MV,[mv],[false])
if test ${MV} = "false"
then
AC_MSG_ERROR([mv required but not found])
fi
AC_PATH_PROG(DOT,[dot],[false])
AC_PATH_PROG(ETAGS,[etags],[false])
AC_PATH_PROG(PYTHON,[python],[false])
if test ${PYTHON} = "false"
then
AC_MSG_WARN([python required but not found])
fi
AC_PATH_PROG(QMTEST,[qmtest],[false])
if test ${QMTEST} = "false"
then
AC_MSG_WARN([qmtest required but not found])
AC_MSG_WARN([QMTest is required for the test suite, but it was not found])
fi
dnl Verify that the version of python available is high enough for qmtest
@@ -384,20 +215,17 @@ then
then
if test "$pyminor" -lt "2"
then
AC_MSG_ERROR([Python 2.2 or greater required])
AC_MSG_WARN([QMTest requires Python 2.2 or later])
fi
fi
else
AC_MSG_ERROR([Python 2.2 or greater required])
AC_MSG_WARN([QMTest requires Python 2.2 or later])
fi
dnl Verify that the source directory is valid
AC_CONFIG_SRCDIR(["Makefile.config.in"])
dnl **************************************************************************
dnl * Check for libraries.
dnl **************************************************************************
dnl Checks for libraries:
dnl libelf is for sparc only; we can ignore it if we don't have it
AC_CHECK_LIB(elf, elf_begin)
@@ -407,44 +235,36 @@ AC_SEARCH_LIBS(dlopen,dl,AC_DEFINE([HAVE_DLOPEN],[1],[Define if dlopen() is avai
dnl mallinfo is optional; the code can compile (minus features) without it
AC_SEARCH_LIBS(mallinfo,malloc,AC_DEFINE([HAVE_MALLINFO],[1],[Define if mallinfo() is available on this platform.]))
dnl
dnl The math libraries are used by the test code, but not by the actual LLVM
dnl code.
dnl
dnl AC_CHECK_LIB(m, cos)
dnl pthread locking functions are optional - but llvm will not be thread-safe
dnl without locks.
AC_SEARCH_LIBS(pthread_mutex_lock,pthread,HAVE_PTHREAD_MUTEX_LOCK=1,HAVE_PTHREAD_MUTEX_LOCK=0)
AC_SUBST(HAVE_PTHREAD_MUTEX_LOCK)
dnl **************************************************************************
dnl * Checks for header files.
dnl * Chances are, if the standard C or POSIX type header files are missing,
dnl * then LLVM just isn't going to compile. However, it is possible that
dnl * the necessary functions/macros will be included from other
dnl * (non-standard and non-obvious) header files.
dnl *
dnl * So, we'll be gracious, give it a chance, and try to go on without
dnl * them.
dnl **************************************************************************
dnl Checks for header files.
dnl We don't check for ancient stuff or things that are guaranteed to be there
dnl by the C++ standard. We always use the <cfoo> versions of <foo.h> C headers.
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
dnl Check for ANSI C/POSIX header files
AC_CHECK_HEADERS(assert.h fcntl.h limits.h sys/time.h unistd.h errno.h signal.h math.h)
dnl Checks for POSIX and other various system-specific header files
AC_CHECK_HEADERS(fcntl.h limits.h sys/time.h unistd.h malloc.h sys/mman.h sys/resource.h dlfcn.h link.h execinfo.h windows.h)
dnl Check for system specific header files
AC_CHECK_HEADERS(malloc.h sys/mman.h sys/resource.h)
dnl Check for things that need to be included in public headers, and so
dnl for which we may not have access to a HAVE_* preprocessor #define.
dnl (primarily used in DataTypes.h)
AC_CHECK_HEADER([sys/types.h],
[INCLUDE_SYS_TYPES_H='#include <sys/types.h>'],
[INCLUDE_SYS_TYPES_H=''])
AC_SUBST(INCLUDE_SYS_TYPES_H)
AC_CHECK_HEADER([inttypes.h],
[INCLUDE_INTTYPES_H='#include <inttypes.h>'],
[INCLUDE_INTTYPES_H=''])
AC_SUBST(INCLUDE_INTTYPES_H)
AC_CHECK_HEADER([stdint.h],
[INCLUDE_STDINT_H='#include <stdint.h>'],
[INCLUDE_STDINT_H=''])
AC_SUBST(INCLUDE_STDINT_H)
dnl Check for header files associated with dlopen and friends
AC_CHECK_HEADERS(dlfcn.h link.h)
dnl **************************************************************************
dnl * Checks for typedefs, structures, and compiler characteristics.
dnl **************************************************************************
dnl Check for const and inline keywords
AC_C_CONST
AC_C_INLINE
dnl Check for machine endian-ness
AC_C_BIGENDIAN(AC_DEFINE([ENDIAN_BIG],[],[Define if the machine is Big-Endian]),AC_DEFINE([ENDIAN_LITTLE],[],[Define if the machine is Little-Endian]))
dnl Check for types
AC_TYPE_PID_T
@@ -457,59 +277,41 @@ AC_STRUCT_TM
dnl Check for various C features
AC_C_PRINTF_A
dnl Check for the endianness of the target
AC_C_BIGENDIAN(AC_SUBST([ENDIAN],[big]),AC_SUBST([ENDIAN],[little]))
dnl Check for C++ extensions
AC_CXX_HAVE_EXT_HASH_MAP
AC_CXX_HAVE_EXT_HASH_SET
AC_CXX_HAVE_EXT_SLIST
AC_CXX_HAVE_HASH_MAP
AC_CXX_HAVE_HASH_SET
AC_CXX_HAVE_STD_ITERATOR
AC_CXX_HAVE_BI_ITERATOR
AC_CXX_HAVE_FWD_ITERATOR
dnl **************************************************************************
dnl * Checks for library functions.
dnl **************************************************************************
AC_FUNC_ISNAN
AC_FUNC_ISINF
dnl Checks for library functions.
AC_FUNC_ALLOCA
AC_PROG_GCC_TRADITIONAL
AC_FUNC_MEMCMP
AC_FUNC_MMAP
AC_FUNC_MMAP_FILE
if test ${ac_cv_func_mmap_file} = "no"
if test "$ac_cv_func_mmap_fixed_mapped" = "no"
then
AC_MSG_ERROR([mmap() of files required but not found])
AC_MSG_WARN([mmap() required but not found])
fi
AC_FUNC_MMAP_FILE
if test "$ac_cv_func_mmap_file" = "no"
then
AC_MSG_WARN([mmap() of files required but not found])
fi
AC_HEADER_MMAP_ANONYMOUS
AC_TYPE_SIGNAL
AC_CHECK_FUNCS(getcwd gettimeofday strcspn strdup strerror strspn strstr strtod strtol strtoq strtoll)
dnl
dnl Need to check mmap for MAP_PRIVATE, MAP_ANONYMOUS, MAP_ANON, MAP_FIXED
dnl MAP_FIXED is only needed for Sparc
dnl MAP_ANON is used for Sparc and BSD
dnl Everyone should have MAP_PRIVATE
dnl
dnl Check for certain functions (even if we've already found them) so that we
dnl can quit with an error if they are unavailable.
dnl
dnl As the code is made more portable (i.e. less reliant on these functions,
dnl these checks should go away.
AC_CHECK_FUNC(mmap,,AC_MSG_ERROR([Function mmap() required but not found]))
AC_CHECK_FUNCS(getcwd gettimeofday strdup strtoq strtoll backtrace isatty mkstemp getrusage)
AC_CHECK_FUNC(mprotect,,AC_MSG_ERROR([Function mprotect() required but not found]))
dnl **************************************************************************
dnl * Enable various compile-time options
dnl **************************************************************************
dnl Determine if the linker supports the -R option.
AC_LINK_USE_R
dnl Purify Option
AC_ARG_ENABLE(purify,AC_HELP_STRING([--enable-purify],[Compile with purify (default is NO)]),,enableval="no")
if test ${enableval} = "no"
then
AC_SUBST(ENABLE_PURIFY,[[]])
else
AC_SUBST(ENABLE_PURIFY,[[ENABLE_PURIFY=1]])
fi
dnl Optimized Option
dnl --enable/--with command-line options:
dnl Check whether they want to do an optimized build:
AC_ARG_ENABLE(optimized,AC_HELP_STRING([--enable-optimized],[Compile with optimizations enabled (default is NO)]),,enableval=no)
if test ${enableval} = "no"
then
@@ -518,27 +320,50 @@ else
AC_SUBST(ENABLE_OPTIMIZED,[[ENABLE_OPTIMIZED=1]])
fi
dnl Spec Benchmarks
AC_ARG_ENABLE(spec2000,AC_HELP_STRING([--enable-spec],[Compile SPEC 2000 benchmarks (default is NO)]),,enableval=no)
if test ${enableval} = "no"
then
if test -d /home/vadve/shared/benchmarks/speccpu2000/benchspec
AC_DEFUN(EXTERNAL_BENCHMARK,
[m4_define([allcapsname],translit($1,a-z,A-Z))
AC_ARG_ENABLE($1,
AC_HELP_STRING([--enable-$1=ARG],
[Use $1 as a benchmark (srcs in DIR)]),
checkresult=$enableval,
checkresult=auto)
AC_MSG_CHECKING([for $1 benchmark sources])
case "$checkresult" in
auto|yes)
defaultdir=$2
if test -d "$defaultdir"
then
AC_SUBST(SPEC_ROOT,[/home/vadve/shared/benchmarks/speccpu2000/benchspec])
AC_SUBST(USE_SPEC,[[USE_SPEC=1]])
AC_SUBST(allcapsname()[_ROOT],[$defaultdir])
AC_SUBST([USE_]allcapsname(),[USE_]allcapsname()=1)
checkresult="yes, found in $defaultdir"
else
AC_SUBST(USE_SPEC,[[]])
AC_SUBST(SPEC_ROOT,[])
checkresult=no
fi
else
if test ${enableval} = ""
;;
no)
AC_SUBST(allcapsname()[_ROOT],[])
AC_SUBST([USE_]allcapsname(),[])
checkresult=no
;;
*) if test -d "$checkresult"
then
AC_SUBST(SPEC_ROOT,[/home/vadve/shared/benchmarks/speccpu2000/benchspec])
AC_SUBST(allcapsname()[_ROOT],"$checkresult")
AC_SUBST([USE_]allcapsname(),[USE_]allcapsname()=1)
checkresult="yes, in $checkresult"
else
AC_SUBST(SPEC_ROOT,[${enableval}])
AC_SUBST(allcapsname()[_ROOT],[])
AC_SUBST([USE_]allcapsname(),[])
checkresult="no, not found in $checkresult"
fi
AC_SUBST(USE_SPEC,[[USE_SPEC=1]])
fi
;;
esac
AC_MSG_RESULT($checkresult)
m4_undefine([allcapsname])
])
EXTERNAL_BENCHMARK(spec95,/home/vadve/shared/benchmarks/spec95/benchspec)
EXTERNAL_BENCHMARK(spec2000,/home/vadve/shared/benchmarks/speccpu2000/benchspec)
EXTERNAL_BENCHMARK(povray,/home/vadve/shared/benchmarks/povray31)
dnl Precompiled Bytecode Option
AC_ARG_ENABLE(precompiled_bytecode,AC_HELP_STRING([--enable-precompiled_bytecode],[Use pre-compiled bytecode (default is NO)]),,enableval=no)
@@ -549,7 +374,6 @@ else
AC_SUBST(UPB,[[USE_PRECOMPILED_BYTECODE=1]])
fi
dnl LLC Diff Option
AC_ARG_ENABLE(llc_diffs,AC_HELP_STRING([--enable-llc_diffs],[Enable LLC Diffs when testing (default is YES)]),,enableval=yes)
if test ${enableval} = "no"
@@ -561,7 +385,6 @@ fi
dnl JIT Option
AC_ARG_ENABLE(jit,AC_HELP_STRING([--enable-jit],[Enable Just In Time Compiling (default is YES)]),,enableval=default)
if test ${enableval} = "no"
then
AC_SUBST(JIT,[[]])
@@ -579,12 +402,44 @@ else
esac
fi
dnl **************************************************************************
dnl * Set the location of various third-party software packages
dnl **************************************************************************
dnl Location of the LLVM C front end
dnl Find the LLVM GCC-based C/C++ front end
AC_ARG_WITH(llvmgccdir,AC_HELP_STRING([--with-llvmgccdir],[Location of LLVM GCC front-end]),AC_SUBST(LLVMGCCDIR,[$withval]))
AC_MSG_CHECKING([for llvm-gcc])
LLVM_GCC_CHECK=no
if test -d "$LLVMGCCDIR"
then
if test -x "$LLVMGCCDIR/bin/gcc"
then
LLVM_GCC_CHECK="$LLVMGCCDIR/bin/gcc"
fi
fi
llvmgccwarn=no
AC_MSG_RESULT($LLVM_GCC_CHECK)
if test "$LLVM_GCC_CHECK" = "no"
then
llvmgccwarn=yes
fi
AC_MSG_CHECKING([whether llvm-gcc is sane])
LLVM_GCC_SANE=no
if test -x "$LLVM_GCC_CHECK"
then
cp /dev/null conftest.c
"$LLVM_GCC_CHECK" -S -o - conftest.c | grep implementation > /dev/null 2>&1
if test $? -eq 0
then
LLVM_GCC_SANE=yes
fi
rm conftest.c
llvmcc1path=`"$LLVM_GCC_CHECK" --print-prog-name=cc1`
AC_SUBST(LLVMCC1,$llvmcc1path)
llvmcc1pluspath=`"$LLVM_GCC_CHECK" --print-prog-name=cc1plus`
AC_SUBST(LLVMCC1PLUS,$llvmcc1pluspath)
fi
AC_MSG_RESULT($LLVM_GCC_SANE)
if test "$LLVM_GCC_SANE" = "no"
then
llvmgccwarn=yes
fi
dnl Location of the bytecode repository
AC_ARG_WITH(bcrepos,AC_HELP_STRING([--with-bcrepos],[Location of Bytecode Repository]),AC_SUBST(BCR,[$withval]),AC_SUBST(BCR,[/home/vadve/lattner/LLVMPrograms]))
@@ -592,14 +447,27 @@ AC_ARG_WITH(bcrepos,AC_HELP_STRING([--with-bcrepos],[Location of Bytecode Reposi
dnl Location of PAPI
AC_ARG_WITH(papi,AC_HELP_STRING([--with-papi],[Location of PAPI]),AC_SUBST(PAPIDIR,[$withval]),AC_SUBST(PAPIDIR,[/home/vadve/shared/Sparc/papi-2.3.4.1]))
dnl Location of the purify program
AC_ARG_WITH(purify,AC_HELP_STRING([--with-purify],[Location of purify program]),AC_SUBST(PURIFY,[$withval]))
dnl Get libtool's idea of what the shared library suffix is.
dnl (This is a hack; it relies on undocumented behavior.)
AC_MSG_CHECKING([for shared library suffix])
eval "SHLIBEXT=$shrext"
AC_MSG_RESULT($SHLIBEXT)
dnl Propagate it to the Makefiles and config.h (for gccld & bugpoint).
AC_SUBST(SHLIBEXT,$SHLIBEXT)
AC_DEFINE_UNQUOTED(SHLIBEXT,"$SHLIBEXT",
[Extension that shared libraries have, e.g., ".so".])
dnl **************************************************************************
dnl * Configure other software packages (via AC_CONFIG_SUBDIRS)
dnl **************************************************************************
dnl Create the output files
AC_OUTPUT()
dnl Warn loudly if llvm-gcc was not obviously working
if test $llvmgccwarn = yes
then
AC_MSG_WARN([***** llvm C/C++ front end was not found, or does not])
AC_MSG_WARN([***** appear to be working.])
AC_MSG_WARN([***** ])
AC_MSG_WARN([***** Please check configure's --with-llvmgccdir option.])
AC_MSG_WARN([***** Runtime libraries (in llvm/runtime) will not be built,])
AC_MSG_WARN([***** but you should be able to build the llvm tools.])
fi
dnl **************************************************************************
dnl * Create the output files
dnl **************************************************************************
AC_OUTPUT(Makefile.config)

5926
llvm/configure vendored

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -12,15 +12,15 @@
<h3>SYNOPSIS</h3>
<tt>bugpoint [options] [input LLVM ll/bc files] [LLVM passes] --args &lt;program arguments&gt;...</tt>
<img src="../Debugging.gif" width=444 height=314 align=right>
<img src="img/Debugging.gif" width=444 height=314 align=right>
<h3>DESCRIPTION</h3>
The <tt>bugpoint</tt> tool narrows down the source of
problems in LLVM tools and passes. It can be used to debug three types of
failures: optimizer crashes, miscompilations by optimizers, or invalid native
code generation. It aims to reduce large test cases to small, useful ones.
For example,
if <tt><a href="gccas.html">gccas</a></tt> crashes while optimizing a file, it
failures: optimizer crashes, miscompilations by optimizers, or bad native
code generation (including problems in the static and JIT compilers). It aims
to reduce large test cases to small, useful ones. For example,
if <tt><a href="CommandGuide/gccas.html">gccas</a></tt> crashes while optimizing a file, it
will identify the optimization (or combination of optimizations) that causes the
crash, and reduce the file down to a small example which triggers the crash.<p>
@@ -30,11 +30,13 @@ crash, and reduce the file down to a small example which triggers the crash.<p>
<tt>bugpoint</tt> is designed to be a useful tool without requiring any
hooks into the LLVM infrastructure at all. It works with any and all LLVM
passes and code generators, and does not need to "know" how they work. Because
of this, it may appear to do a lot of stupid things or miss obvious
of this, it may appear to do stupid things or miss obvious
simplifications. <tt>bugpoint</tt> is also designed to trade off programmer
time for computer time in the compiler-debugging process; consequently, it may
take a long period of (unattended) time to reduce a test case, but we feel it
is still worth it. :-) <p>
is still worth it. Note that <tt>bugpoint</tt> is generally very quick unless
debugging a miscompilation where each test of the program (which requires
executing it) takes a long time.<p>
<a name="automaticdebuggerselection">
<h4>Automatic Debugger Selection</h4>
@@ -43,67 +45,62 @@ is still worth it. :-) <p>
specified on the command line and links them together into a single module,
called the test program. If any LLVM passes are
specified on the command line, it runs these passes on the test program. If
any of the passes crash, or if they produce malformed output,
any of the passes crash, or if they produce malformed output (which causes the
verifier to abort),
<tt>bugpoint</tt> starts the <a href="#crashdebug">crash debugger</a>.<p>
Otherwise, if the <a href="#opt_output"><tt>-output</tt></a> option was not
specified, <tt>bugpoint</tt> runs the test program with the C backend (which
is assumed to generate good code) to generate a reference output. Once
specified, <tt>bugpoint</tt> runs the test program with the C backend (which is
assumed to generate good code) to generate a reference output. Once
<tt>bugpoint</tt> has a reference output for the test program, it tries
executing it
with the <a href="#opt_run-">selected</a> code generator. If
the resulting output differs from the reference output, it assumes the
difference resulted from a code generator failure, and starts the
<a href="#codegendebug">code generator debugger</a>.<p>
executing it with the <a href="#opt_run-">selected</a> code generator. If the
selected code generator crashes, <tt>bugpoint</tt> starts the <a
href="#crashdebug">crash debugger</a> on the code generator. Otherwise, if the
resulting output differs from the reference output, it assumes the difference
resulted from a code generator failure, and starts the <a
href="#codegendebug">code generator debugger</a>.<p>
Otherwise, <tt>bugpoint</tt> runs the test program after all of the LLVM passes
have been applied to it. If its output differs from the reference output,
it assumes the difference resulted from a failure in one of the LLVM passes,
and enters the
<a href="#miscompilationdebug">miscompilation debugger</a>. Otherwise,
there is no problem <tt>bugpoint</tt> can debug.<p>
Finally, if the output of the selected code generator matches the reference
output, <tt>bugpoint</tt> runs the test program after all of the LLVM passes
have been applied to it. If its output differs from the reference output, it
assumes the difference resulted from a failure in one of the LLVM passes, and
enters the <a href="#miscompilationdebug">miscompilation
debugger</a>. Otherwise, there is no problem <tt>bugpoint</tt> can debug.<p>
<a name="crashdebug">
<h4>Crash debugger</h4>
If an optimizer crashes, <tt>bugpoint</tt> will try as hard as it can to
reduce the list of passes and the size of the test program. First,
<tt>bugpoint</tt> figures out which combination of passes triggers the bug. This
is useful when debugging a problem exposed by <tt>gccas</tt>, for example,
because it runs over 25 optimizations.<p>
If an optimizer or code generator crashes, <tt>bugpoint</tt> will try as hard as
it can to reduce the list of passes (for optimizer crashes) and the size of the
test program. First, <tt>bugpoint</tt> figures out which combination of
optimizer passes triggers the bug. This is useful when debugging a problem
exposed by <tt>gccas</tt>, for example, because it runs over 38 passes.<p>
Next, <tt>bugpoint</tt> tries removing functions from the test program, to
reduce its
size. Usually it is able to reduce a test program
to a single function, when debugging intraprocedural optimizations. Once the
number of
reduce its size. Usually it is able to reduce a test program to a single
function, when debugging intraprocedural optimizations. Once the number of
functions has been reduced, it attempts to delete various edges in the control
flow graph, to reduce the size of the function as much as possible. Finally,
<tt>bugpoint</tt> deletes any individual LLVM instructions whose absence does
not eliminate the failure. At the end, <tt>bugpoint</tt> should tell you what
passes crash, give you a bytecode file, and give you instructions on how to
reproduce the failure with <tt><a href="opt.html">opt</a></tt> or
<tt><a href="analyze.html">analyze</a></tt>.<p>
reproduce the failure with <tt><a href="CommandGuide/opt.html">opt</a></tt>, <tt><a
href="CommandGuide/analyze.html">analyze</a></tt>, or <tt><a href="CommandGuide/llc.html">llc</a></tt>.<p>
<a name="codegendebug">
<h4>Code generator debugger</h4>
The code generator debugger attempts to narrow down the amount of code that is
being miscompiled by the <a href="#opt_run-">selected</a> code generator. To do
this, it takes the test program and partitions it into two pieces: one piece
<p>The code generator debugger attempts to narrow down the amount of code that
is being miscompiled by the <a href="#opt_run-">selected</a> code generator. To
do this, it takes the test program and partitions it into two pieces: one piece
which it compiles with the C backend (into a shared object), and one piece which
it runs with either the JIT or the static LLC compiler. It uses several
techniques to reduce the amount of code pushed through the LLVM code generator,
to reduce the potential scope of the problem. After it is finished, it emits
two bytecode files (called "test" [to be compiled with the code generator] and
"safe" [to be compiled with the C backend] respectively), and instructions for
reproducing the problem. The code generator debugger assumes that the C
backend produces good code.<p>
If you are using the code generator debugger and get an error message that
says "UNSUPPORTED: external function used as a global initializer!", try using
the <tt>-run-llc</tt> option instead of the <tt>-run-jit</tt> option. This is
due to an unimplemented feature in the code generator debugger.<p>
"safe" [to be compiled with the C backend], respectively), and instructions for
reproducing the problem. The code generator debugger assumes that the C backend
produces good code.</p>
<a name="miscompilationdebug">
<h4>Miscompilation debugger</h4>
@@ -126,7 +123,7 @@ non-obvious ways. Here are some hints and tips:<p>
<ol>
<li>In the code generator and miscompilation debuggers, <tt>bugpoint</tt> only
works with programs that have deterministic output. Thus, if the program
outputs the date, time, or any other "random" data, <tt>bugpoint</tt> may
outputs <tt>argv[0]</tt>, the date, time, or any other "random" data, <tt>bugpoint</tt> may
misinterpret differences in these data, when output, as the result of a
miscompilation. Programs should be temporarily modified to disable
outputs that are likely to vary from run to run.
@@ -148,18 +145,23 @@ non-obvious ways. Here are some hints and tips:<p>
<br>to get a copy of <tt>bugpoint</tt>'s output in the file
<tt>bugpoint.log</tt>, as well as on your terminal.
<li><tt>bugpoint</tt> cannot debug problems with the linker. If
<li><tt>bugpoint</tt> cannot debug problems with the LLVM linker. If
<tt>bugpoint</tt> crashes before you see its "All input ok" message,
you might try <tt>llvm-link -v</tt> on the same set of input files. If
that also crashes, you may be experiencing a linker bug.
<li>If your program is <b>supposed</b> to crash, <tt>bugpoint</tt> will be
confused. One way to deal with this is to cause bugpoint to ignore the exit
code from your program, by giving it the <tt>-check-exit-code=false</tt>
option.
</ol>
<h3>OPTIONS</h3>
<ul>
<li><tt>-additional-so &lt;library.so&gt;</tt><br>
Load <tt>&lt;library.so&gt;</tt> into the test program whenever it is run.
<li><tt>-additional-so &lt;library&gt;</tt><br>
Load <tt>&lt;library&gt;</tt> into the test program whenever it is run.
This is useful if you are debugging programs which depend on non-LLVM
libraries (such as the X or curses libraries) to run.<p>
@@ -175,7 +177,23 @@ non-obvious ways. Here are some hints and tips:<p>
part of the <tt>-args</tt> option, not as options to <tt>bugpoint</tt>
itself.<p>
<li><tt>-disable-{adce,dce,final-cleanup,simplifycfg}</tt><br>
<li><tt>-tool-args &lt;tool args&gt;</tt><br>
Pass all arguments specified after <tt>-tool-args</tt> to the
LLVM tool under test (llc, lli, etc.) whenever it runs.
You should use this option in the following way:
<p>
<tt>bugpoint &lt;bugpoint args&gt; -tool-args -- &lt;tool args&gt;</tt>
<p>
The "<tt>--</tt>" right after the <tt>-tool-args</tt> option tells
<tt>bugpoint</tt> to consider any options starting with <tt>-</tt> to be
part of the <tt>-tool-args</tt> option, not as options to
<tt>bugpoint</tt> itself. (See <tt>-args</tt>, above.)<p>
<li><tt>-check-exit-code={true,false}</tt><br>
Assume a non-zero exit code or core dump from the test program is
a failure. Defaults to true.<p>
<li><tt>-disable-{dce,simplifycfg}</tt><br>
Do not run the specified passes to clean up and reduce the size of the
test program. By default, <tt>bugpoint</tt> uses these passes internally
when attempting to reduce test programs. If you're trying to find
@@ -189,14 +207,14 @@ non-obvious ways. Here are some hints and tips:<p>
test program, whenever it runs, to come from that file.
<p>
<a name="opt_load"><li> <tt>-load &lt;plugin.so&gt;</tt><br>
Load the dynamic object <tt>&lt;plugin.so&gt;</tt> into <tt>bugpoint</tt>
<a name="opt_load"><li> <tt>-load &lt;plugin&gt;</tt><br>
Load the dynamic object <tt>&lt;plugin&gt;</tt> into <tt>bugpoint</tt>
itself. This object should register new
optimization passes. Once loaded, the object will add new command line
options to enable various optimizations. To see the new complete list
of optimizations, use the -help and -load options together:
<p>
<tt>bugpoint -load &lt;plugin.so&gt; -help</tt>
<tt>bugpoint -load &lt;plugin&gt; -help</tt>
<p>
<a name="opt_output"><li><tt>-output &lt;filename&gt;</tt><br>
@@ -206,6 +224,9 @@ non-obvious ways. Here are some hints and tips:<p>
<tt>bugpoint</tt> will attempt to generate a reference output by
compiling the program with the C backend and running it.<p>
<li><tt>-profile-info-file &lt;filename&gt;</tt><br>
Profile file loaded by -profile-loader.<p>
<a name="opt_run-"><li><tt>-run-{int,jit,llc,cbe}</tt><br>
Whenever the test program is compiled, <tt>bugpoint</tt> should generate
code for it using the specified code generator. These options allow
@@ -218,10 +239,6 @@ non-obvious ways. Here are some hints and tips:<p>
If <tt>bugpoint</tt> succeeds in finding a problem, it will exit with 0.
Otherwise, if an error occurs, it will exit with a non-zero value.
<h3>SEE ALSO</h3>
<a href="opt.html"><tt>opt</tt></a>,
<a href="analyze.html"><tt>analyze</tt></a>
<HR>
Maintained by the <a href="http://llvm.cs.uiuc.edu">LLVM Team</a>.
</body>

File diff suppressed because it is too large Load Diff

View File

@@ -1,25 +1,72 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" href="llvm.css" type="text/css" media="screen" />
<title>Bootstrapping the C/C++ Front-End</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="llvm.css" type="text/css" media="screen">
<title>Bootstrapping the LLVM C/C++ Front-End</title>
</head>
<body>
<div class="doc_title">
Bootstrapping the C/C++ Front-End
Bootstrapping the LLVM C/C++ Front-End
</div>
<p>This document is intended to explain the process of building the LLVM
C/C++ front-end, based on GCC 3.4, from source.</p>
<ol>
<li><a href="#cautionarynote">A Cautionary Note</a>
<ul>
<li><a href="#cygwin">Building under Cygwin</a></li>
</ul>
</li>
<li><a href="#instructions">Instructions</a></li>
<li><a href="#license">License Information</a></li>
</ol>
<div class="doc_author">
<p>Written by Brian R. Gaeke and
<a href="http://nondot.org/sabre">Chris Lattner</a></p>
</div>
<!-- *********************************************************************** -->
<div class="doc_section">
<a name="cautionarynote">A Cautionary Note</a>
</div>
<!-- *********************************************************************** -->
<div class="doc_text">
<p>This document is intended to explain the process of building the
LLVM C/C++ front-end, based on GCC 3.4, from its source code. You
would have to do this, for example, if you are porting LLVM to a new
architecture or operating system.</p>
<p><b>NOTE:</b> This is currently a somewhat fragile, error-prone
process, and you should only try to do it if (A) you really, really,
really can't use the binaries we distribute, and (B) you are a wicked
good GCC hacker.</p>
process, and you should <b>only</b> try to do it if:</p>
<ol>
<li>you really, really, really can't use the binaries we distribute</li>
<li>you need GCC to fix some of the header files on your system</li>
<li>you are an elite GCC hacker.</li>
</ol>
<p>We welcome patches to help make this process simpler.</p>
</div>
<!--=========================================================================-->
<div class="doc_subsection">
<a name="cygwin">Building under Cygwin</a>
</div>
<!--=========================================================================-->
<div class="doc_text">
<p>If you are building LLVM and the C front-end under Cygwin, please note that
the LLVM and GCC makefiles do not correctly handle spaces in paths. To deal
with this issue, make sure that your LLVM and GCC source and build trees are
located in a top-level directory (like <tt>/cygdrive/c/llvm</tt> and
<tt>/cygdrive/c/llvm-cfrontend</tt>), not in a directory that contains a space
(which includes your "home directory", because it lives under the "Documents
and Settings" directory). We welcome patches to fix this issue.
</p>
</div>
<!-- *********************************************************************** -->
<div class="doc_section">
@@ -34,12 +81,11 @@ good GCC hacker.</p>
<pre>
% cd llvm
% ./configure [options...]
% gmake tools-only
% gmake
</pre>
<p>The use of the non-default target "tools-only" means that the
LLVM tools and libraries will build, and the binaries will be
deposited in llvm/tools/Debug, but the runtime (bytecode)
libraries will not build.</p></li>
<p>This will build all of the LLVM tools and libraries, but you will see
warnings about missing the C front-end (certain runtime libraries can't
be built without it). Ignore these warnings for now.</p></li>
<li><p>Add the directory containing the tools to your PATH.</p>
<pre>
@@ -48,9 +94,6 @@ good GCC hacker.</p>
<li><p>Unpack the C/C++ front-end source into cfrontend/src.</p></li>
<li><p>Edit src/configure. Change the first line (starting w/ #!) to
contain the correct full pathname of sh.</p></li>
<li><p>Make "build" and "install" directories as siblings of the "src"
tree.</p>
<pre>
@@ -61,12 +104,50 @@ good GCC hacker.</p>
% set CFEINSTALL = `pwd`/install
</pre></li>
<li><p>Configure, build and install the C front-end:</p>
<li><p>Configure, build, and install the C front-end:</p>
<p>
<b>Linux/x86:</b><br>
<b>MacOS X/PowerPC</b> (requires dlcompat library):
</p>
<pre>
% cd build
% ../src/configure --prefix=$CFEINSTALL --disable-nls --disable-shared \
% ../src/configure --prefix=$CFEINSTALL --disable-threads --disable-nls --disable-shared \
--enable-languages=c,c++
% gmake all-gcc
% gmake
% setenv LLVM_LIB_SEARCH_PATH `pwd`/gcc
% gmake all; gmake install
</pre>
<p><b>Cygwin/x86:</b></p>
<pre>
% cd build
% ../src/configure --prefix=$CFEINSTALL --disable-threads --disable-nls --disable-shared \
--enable-languages=c,c++ --disable-c-mbchar
% gmake
% setenv LLVM_LIB_SEARCH_PATH `pwd`/gcc
% gmake all; gmake install
</pre>
<p><b>Solaris/SPARC:</b></p>
<p>
For Solaris/SPARC, LLVM only supports the SPARC V9. Therefore, the
configure command line should specify sparcv9, as shown below. Also,
note that Solaris has trouble with various wide (multibyte) character
functions from C as referenced from C++, so we typically configure with
--disable-c-mbchar (cf. <a href="http://llvm.cs.uiuc.edu/PR206">Bug 206</a>).
</p>
<pre>
% cd build
% ../src/configure --prefix=$CFEINSTALL --disable-threads --disable-nls \
--disable-shared --enable-languages=c,c++ --host=sparcv9-sun-solaris2.8 \
--disable-c-mbchar
% gmake
% setenv LLVM_LIB_SEARCH_PATH `pwd`/gcc
% gmake all; gmake install
</pre>
@@ -79,13 +160,13 @@ good GCC hacker.</p>
<li><p><b>Fix 1:</b> If you have system header files that include
inline assembly, you may have to modify them to remove the inline
assembly, and install the modified versions in
<code>$CFEINSTALL/<i>target-triplet</i>/sys-include</code>.</p></li>
<code>$CFEINSTALL/<i>target-triplet</i>/sys-include</code>.</li>
<li><b>Fix 2:</b> If you are building the C++ front-end on a CPU we
haven't tried yet, you will probably have to edit the appropriate
version of atomicity.h under
<code>src/libstdc++-v3/config/cpu/<i>name-of-cpu</i>/atomicity.h</code>
and apply a patch so that it does not use inline assembly.</p></li>
and apply a patch so that it does not use inline assembly.</li>
</ul>
<p><b>Porting to a new architecture:</b> If you are porting the new front-end
@@ -105,17 +186,20 @@ good GCC hacker.</p>
<li>No inline assembly for position independent code. At the LLVM level,
everything is position independent.</li>
<li>We handle <tt>.init</tt> and <tt>.fini</tt> differently.</li>
<li>You may have to disable multilib support in your target. Using multilib
support causes the GCC compiler driver to add a lot of "<tt>-L</tt>"
options to the link line, which do not relate to LLVM and confuse
<tt>gccld</tt>. To disable multilibs, delete any
<tt>MULTILIB_OPTIONS</tt> lines from your target files.</li>
<li>Did we mention that we don't support inline assembly? You'll probably
have to add some fixinclude hacks to disable it in the system
headers.</li>
</ul>
</li>
<li><p>Go back into the LLVM source tree proper. Edit Makefile.config
to redefine <code>LLVMGCCDIR</code> to the full pathname of the
<code>$CFEINSTALL</code> directory, which is the directory you just
installed the C front-end into. (The ./configure script is likely to
have set this to a directory which does not exist on your system.)</p></li>
<li><p>Go back into the LLVM source tree proper. Rerun configure, using
the <code>--with-llvmgccdir=$CFEINSTALL</code> option to specify the path
to the newly built C front-end.</p></li>
<li><p>If you edited header files during the C/C++ front-end build as
described in "Fix 1" above, you must now copy those header files from
@@ -125,11 +209,14 @@ described in "Fix 1" above, you must now copy those header files from
libgcc.a library, which you can find by running
<code>$CFEINSTALL/bin/gcc --print-libgcc-file-name</code>.)</p></li>
<li><p>Build and install the runtime (bytecode) libraries by running:</p>
<li><p>Rebuild your CVS tree. This shouldn't cause the whole thing to be
rebuilt, but it should build the runtime libraries. After the tree is
built, install the runtime libraries into your C front-end build tree.
These are the commands you need.</p>
<pre>
% gmake -C runtime
% gmake
% mkdir $CFEINSTALL/bytecode-libs
% gmake -C runtime install
% gmake -C runtime install-bytecode
% setenv LLVM_LIB_SEARCH_PATH $CFEINSTALL/bytecode-libs
</pre></li>
@@ -139,18 +226,84 @@ following means:</p>
<li> compiling and running a "hello, LLVM" program in C and C++.</li>
<li> running the tests under <tt>test/Programs</tt> using <code>gmake -C
test/Programs</code></li>
</ul>
</p>
</li>
</ul></li>
</ol>
</div>
<!-- *********************************************************************** -->
<div class="doc_section">
<a name="license">License Information</a>
</div>
<hr><font size="-1">
<address><a href="mailto:gaeke -at- uiuc.edu">Brian Gaeke</a></address>
Last modified: $Date$
</font>
<div class="doc_text">
<p>
The LLVM GCC frontend is licensed to you under the GNU General Public License
and the GNU Lesser General Public License. Please see the files COPYING and
COPYING.LIB for more details.
</p>
<p>
The software also has the following additional copyrights:
</p>
<pre>
Copyright (c) 2003, 2004 University of Illinois at Urbana-Champaign.
All rights reserved.
Developed by:
LLVM Team
University of Illinois at Urbana-Champaign
http://llvm.cs.uiuc.edu
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE
SOFTWARE.
Copyright (c) 1994
Hewlett-Packard Company
Permission to use, copy, modify, distribute and sell this software
and its documentation for any purpose is hereby granted without fee,
provided that the above copyright notice appear in all copies and
that both that copyright notice and this permission notice appear
in supporting documentation. Hewlett-Packard Company makes no
representations about the suitability of this software for any
purpose. It is provided "as is" without express or implied warranty.
Copyright (c) 1996, 1997, 1998, 1999
Silicon Graphics Computer Systems, Inc.
Permission to use, copy, modify, distribute and sell this software
and its documentation for any purpose is hereby granted without fee,
provided that the above copyright notice appear in all copies and
that both that copyright notice and this permission notice appear
in supporting documentation. Silicon Graphics makes no
representations about the suitability of this software for any
purpose. It is provided "as is" without express or implied warranty.
</pre>
</div>
<!-- *********************************************************************** -->
<hr>
<address>
<a href="http://jigsaw.w3.org/css-validator/check/referer"><img
src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a>
<a href="http://validator.w3.org/check/referer"><img
src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!"></a>
Brian Gaeke<br>
<a href="http://llvm.cs.uiuc.edu">LLVM Compiler Infrastructure</a><br>
Last modified: $Date$
</address>
</body>
</html>

View File

@@ -0,0 +1,644 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>The LLVM Target-Independent Code Generator</title>
<link rel="stylesheet" href="llvm.css" type="text/css">
</head>
<body>
<div class="doc_title">
The LLVM Target-Independent Code Generator
</div>
<ol>
<li><a href="#introduction">Introduction</a>
<ul>
<li><a href="#required">Required components in the code generator</a></li>
<li><a href="#high-level-design">The high-level design of the code generator</a></li>
<li><a href="#tablegen">Using TableGen for target description</a></li>
</ul>
</li>
<li><a href="#targetdesc">Target description classes</a>
<ul>
<li><a href="#targetmachine">The <tt>TargetMachine</tt> class</a></li>
<li><a href="#targetdata">The <tt>TargetData</tt> class</a></li>
<li><a href="#mregisterinfo">The <tt>MRegisterInfo</tt> class</a></li>
<li><a href="#targetinstrinfo">The <tt>TargetInstrInfo</tt> class</a></li>
<li><a href="#targetframeinfo">The <tt>TargetFrameInfo</tt> class</a></li>
<li><a href="#targetjitinfo">The <tt>TargetJITInfo</tt> class</a></li>
</ul>
</li>
<li><a href="#codegendesc">Machine code description classes</a>
<ul>
<li><a href="#machineinstr">The <tt>MachineInstr</tt> class</a></li>
</ul>
</li>
<li><a href="#codegenalgs">Target-independent code generation algorithms</a>
</li>
<li><a href="#targetimpls">Target description implementations</a>
<ul>
<li><a href="#x86">The X86 backend</a></li>
</ul>
</li>
</ol>
<div class="doc_author">
<p>Written by <a href="mailto:sabre@nondot.org">Chris Lattner</a></p>
</div>
<div class="doc_warning">
<p>Warning: This is a work in progress.</p>
</div>
<!-- *********************************************************************** -->
<div class="doc_section">
<a name="introduction">Introduction</a>
</div>
<!-- *********************************************************************** -->
<div class="doc_text">
<p>The LLVM target-independent code generator is a framework that provides a
suite of reusable components for translating the LLVM internal representation to
the machine code for a specified target -- either in assembly form (suitable for
a static compiler) or in binary machine code format (usable for a JIT compiler).
The LLVM target-independent code generator consists of five main components:</p>
<ol>
<li><a href="#targetdesc">Abstract target description</a> interfaces which
capture important properties about various aspects of the machine, independently
of how they will be used. These interfaces are defined in
<tt>include/llvm/Target/</tt>.</li>
<li>Classes used to represent the <a href="#codegendesc">machine code</a> being
generated for a target. These classes are intended to be abstract enough to
represent the machine code for <i>any</i> target machine. These classes are
defined in <tt>include/llvm/CodeGen/</tt>.</li>
<li><a href="#codegenalgs">Target-independent algorithms</a> used to implement
various phases of native code generation (register allocation, scheduling, stack
frame representation, etc). This code lives in <tt>lib/CodeGen/</tt>.</li>
<li><a href="#targetimpls">Implementations of the abstract target description
interfaces</a> for particular targets. These machine descriptions make use of
the components provided by LLVM, and can optionally provide custom
target-specific passes, to build complete code generators for a specific target.
Target descriptions live in <tt>lib/Target/</tt>.</li>
<li><a href="#jit">The target-independent JIT components</a>. The LLVM JIT is
completely target independent (it uses the <tt>TargetJITInfo</tt> structure to
interface for target-specific issues. The code for the target-independent
JIT lives in <tt>lib/ExecutionEngine/JIT</tt>.</li>
</ol>
<p>
Depending on which part of the code generator you are interested in working on,
different pieces of this will be useful to you. In any case, you should be
familiar with the <a href="#targetdesc">target description</a> and <a
href="#codegendesc">machine code representation</a> classes. If you want to add
a backend for a new target, you will need to <a href="#targetimpls">implement the
target description</a> classes for your new target and understand the <a
href="LangRef.html">LLVM code representation</a>. If you are interested in
implementing a new <a href="#codegenalgs">code generation algorithm</a>, it
should only depend on the target-description and machine code representation
classes, ensuring that it is portable.
</p>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection">
<a name="required">Required components in the code generator</a>
</div>
<div class="doc_text">
<p>The two pieces of the LLVM code generator are the high-level interface to the
code generator and the set of reusable components that can be used to build
target-specific backends. The two most important interfaces (<a
href="#targetmachine"><tt>TargetMachine</tt></a> and <a
href="#targetdata"><tt>TargetData</tt></a> classes) are the only ones that are
required to be defined for a backend to fit into the LLVM system, but the others
must be defined if the reusable code generator components are going to be
used.</p>
<p>This design has two important implications. The first is that LLVM can
support completely non-traditional code generation targets. For example, the C
backend does not require register allocation, instruction selection, or any of
the other standard components provided by the system. As such, it only
implements these two interfaces, and does its own thing. Another example of a
code generator like this is a (purely hypothetical) backend that converts LLVM
to the GCC RTL form and uses GCC to emit machine code for a target.</p>
<p>This design also implies that it is possible to design and
implement radically different code generators in the LLVM system that do not
make use of any of the built-in components. Doing so is not recommended at all,
but could be required for radically different targets that do not fit into the
LLVM machine description model: programmable FPGAs for example.</p>
<p><b>Important Note:</b> For historical reasons, the LLVM SparcV9 code
generator uses almost entirely different code paths than described in this
document. For this reason, there are some deprecated interfaces (such as
<tt>TargetRegInfo</tt> and <tt>TargetSchedInfo</tt>), which are only used by the
V9 backend and should not be used by any other targets. Also, all code in the
<tt>lib/Target/SparcV9</tt> directory and subdirectories should be considered
deprecated, and should not be used as the basis for future code generator work.
The SparcV9 backend is slowly being merged into the rest of the
target-independent code generators, but this is a low-priority process with no
predictable completion date.</p>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection">
<a name="high-level-design">The high-level design of the code generator</a>
</div>
<div class="doc_text">
<p>The LLVM target-indendent code generator is designed to support efficient and
quality code generation for standard register-based microprocessors. Code
generation in this model is divided into the following stages:</p>
<ol>
<li><b>Instruction Selection</b> - Determining an efficient implementation of the
input LLVM code in the target instruction set. This stage produces the initial
code for the program in the target instruction set, then makes use of virtual
registers in SSA form and physical registers that represent any required
register assignments due to target constraints or calling conventions.</li>
<li><b>SSA-based Machine Code Optimizations</b> - This (optional) stage consists
of a series of machine-code optimizations that operate on the SSA-form produced
by the instruction selector. Optimizations like modulo-scheduling, normal
scheduling, or peephole optimization work here.</li>
<li><b>Register Allocation</b> - The target code is transformed from an infinite
virtual register file in SSA form to the concrete register file used by the
target. This phase introduces spill code and eliminates all virtual register
references from the program.</li>
<li><b>Prolog/Epilog Code Insertion</b> - Once the machine code has been
generated for the function and the amount of stack space required is known (used
for LLVM alloca's and spill slots), the prolog and epilog code for the function
can be inserted and "abstract stack location references" can be eliminated.
This stage is responsible for implementing optimizations like frame-pointer
elimination and stack packing.</li>
<li><b>Late Machine Code Optimizations</b> - Optimizations that operate on
"final" machine code can go here, such as spill code scheduling and peephole
optimizations.</li>
<li><b>Code Emission</b> - The final stage actually outputs the code for
the current function, either in the target assembler format or in machine
code.</li>
</ol>
<p>
The code generator is based on the assumption that the instruction selector will
use an optimal pattern matching selector to create high-quality sequences of
native instructions. Alternative code generator designs based on pattern
expansion and
aggressive iterative peephole optimization are much slower. This design
permits efficient compilation (important for JIT environments) and
aggressive optimization (used when generating code offline) by allowing
components of varying levels of sophisication to be used for any step of
compilation.</p>
<p>
In addition to these stages, target implementations can insert arbitrary
target-specific passes into the flow. For example, the X86 target uses a
special pass to handle the 80x87 floating point stack architecture. Other
targets with unusual requirements can be supported with custom passes as needed.
</p>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection">
<a name="tablegen">Using TableGen for target description</a>
</div>
<div class="doc_text">
<p>The target description classes require a detailed description of the target
architecture. These target descriptions often have a large amount of common
information (e.g., an add instruction is almost identical to a sub instruction).
In order to allow the maximum amount of commonality to be factored out, the LLVM
code generator uses the <a href="TableGenFundamentals.html">TableGen</a> tool to
describe big chunks of the target machine, which allows the use of domain- and
target-specific abstractions to reduce the amount of repetition.
</p>
</div>
<!-- *********************************************************************** -->
<div class="doc_section">
<a name="targetdesc">Target description classes</a>
</div>
<!-- *********************************************************************** -->
<div class="doc_text">
<p>The LLVM target description classes (which are located in the
<tt>include/llvm/Target</tt> directory) provide an abstract description of the
target machine, independent of any particular client. These classes are
designed to capture the <i>abstract</i> properties of the target (such as what
instruction and registers it has), and do not incorporate any particular pieces
of code generation algorithms (these interfaces do not take interference graphs
as inputs or other algorithm-specific data structures).</p>
<p>All of the target description classes (except the <tt><a
href="#targetdata">TargetData</a></tt> class) are designed to be subclassed by
the concrete target implementation, and have virtual methods implemented. To
get to these implementations, the <tt><a
href="#targetmachine">TargetMachine</a></tt> class provides accessors that
should be implemented by the target.</p>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection">
<a name="targetmachine">The <tt>TargetMachine</tt> class</a>
</div>
<div class="doc_text">
<p>The <tt>TargetMachine</tt> class provides virtual methods that are used to
access the target-specific implementations of the various target description
classes (with the <tt>getInstrInfo</tt>, <tt>getRegisterInfo</tt>,
<tt>getFrameInfo</tt>, ... methods). This class is designed to be specialized by
a concrete target implementation (e.g., <tt>X86TargetMachine</tt>) which
implements the various virtual methods. The only required target description
class is the <a href="#targetdata"><tt>TargetData</tt></a> class, but if the
code generator components are to be used, the other interfaces should be
implemented as well.</p>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection">
<a name="targetdata">The <tt>TargetData</tt> class</a>
</div>
<div class="doc_text">
<p>The <tt>TargetData</tt> class is the only required target description class,
and it is the only class that is not extensible (it cannot be derived from). It
specifies information about how the target lays out memory for structures, the
alignment requirements for various data types, the size of pointers in the
target, and whether the target is little- or big-endian.</p>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection">
<a name="mregisterinfo">The <tt>MRegisterInfo</tt> class</a>
</div>
<div class="doc_text">
<p>The <tt>MRegisterInfo</tt> class (which will eventually be renamed to
<tt>TargetRegisterInfo</tt>) is used to describe the register file of the
target and any interactions between the registers.</p>
<p>Registers in the code generator are represented in the code generator by
unsigned numbers. Physical registers (those that actually exist in the target
description) are unique small numbers, and virtual registers are generally
large.</p>
<p>Each register in the processor description has an associated
<tt>MRegisterDesc</tt> entry, which provides a textual name for the register
(used for assembly output and debugging dumps), a set of aliases (used to
indicate that one register overlaps with another), and some flag bits.
</p>
<p>In addition to the per-register description, the <tt>MRegisterInfo</tt> class
exposes a set of processor specific register classes (instances of the
<tt>TargetRegisterClass</tt> class). Each register class contains sets of
registers that have the same properties (for example, they are all 32-bit
integer registers). Each SSA virtual register created by the instruction
selector has an associated register class. When the register allocator runs, it
replaces virtual registers with a physical register in the set.</p>
<p>
The target-specific implementations of these classes is auto-generated from a <a
href="TableGenFundamentals.html">TableGen</a> description of the register file.
</p>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection">
<a name="targetinstrinfo">The <tt>TargetInstrInfo</tt> class</a>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection">
<a name="targetframeinfo">The <tt>TargetFrameInfo</tt> class</a>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection">
<a name="targetjitinfo">The <tt>TargetJITInfo</tt> class</a>
</div>
<!-- *********************************************************************** -->
<div class="doc_section">
<a name="codegendesc">Machine code description classes</a>
</div>
<!-- *********************************************************************** -->
<div class="doc_text">
<p>
At the high-level, LLVM code is translated to a machine specific representation
formed out of MachineFunction, MachineBasicBlock, and <a
href="#machineinstr"><tt>MachineInstr</tt></a> instances
(defined in include/llvm/CodeGen). This representation is completely target
agnostic, representing instructions in their most abstract form: an opcode and a
series of operands. This representation is designed to support both SSA
representation for machine code, as well as a register allocated, non-SSA form.
</p>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection">
<a name="machineinstr">The <tt>MachineInstr</tt> class</a>
</div>
<div class="doc_text">
<p>Target machine instructions are represented as instances of the
<tt>MachineInstr</tt> class. This class is an extremely abstract way of
representing machine instructions. In particular, all it keeps track of is
an opcode number and some number of operands.</p>
<p>The opcode number is an simple unsigned number that only has meaning to a
specific backend. All of the instructions for a target should be defined in
the <tt>*InstrInfo.td</tt> file for the target, and the opcode enum values
are autogenerated from this description. The <tt>MachineInstr</tt> class does
not have any information about how to intepret the instruction (i.e., what the
semantics of the instruction are): for that you must refer to the
<tt><a href="#targetinstrinfo">TargetInstrInfo</a></tt> class.</p>
<p>The operands of a machine instruction can be of several different types:
they can be a register reference, constant integer, basic block reference, etc.
In addition, a machine operand should be marked as a def or a use of the value
(though only registers are allowed to be defs).</p>
<p>By convention, the LLVM code generator orders instruction operands so that
all register definitions come before the register uses, even on architectures
that are normally printed in other orders. For example, the sparc add
instruction: "<tt>add %i1, %i2, %i3</tt>" adds the "%i1", and "%i2" registers
and stores the result into the "%i3" register. In the LLVM code generator,
the operands should be stored as "<tt>%i3, %i1, %i2</tt>": with the destination
first.</p>
<p>Keeping destination operands at the beginning of the operand list has several
advantages. In particular, the debugging printer will print the instruction
like this:</p>
<pre>
%r3 = add %i1, %i2
</pre>
<p>If the first operand is a def, and it is also easier to <a
href="#buildmi">create instructions</a> whose only def is the first
operand.</p>
</div>
<!-- _______________________________________________________________________ -->
<div class="doc_subsubsection">
<a name="buildmi">Using the <tt>MachineInstrBuilder.h</tt> functions</a>
</div>
<div class="doc_text">
<p>Machine instructions are created by using the <tt>BuildMI</tt> functions,
located in the <tt>include/llvm/CodeGen/MachineInstrBuilder.h</tt> file. The
<tt>BuildMI</tt> functions make it easy to build arbitrary machine
instructions. Usage of the <tt>BuildMI</tt> functions look like this:
</p>
<pre>
// Create a 'DestReg = mov 42' (rendered in X86 assembly as 'mov DestReg, 42')
// instruction. The '1' specifies how many operands will be added.
MachineInstr *MI = BuildMI(X86::MOV32ri, 1, DestReg).addImm(42);
// Create the same instr, but insert it at the end of a basic block.
MachineBasicBlock &amp;MBB = ...
BuildMI(MBB, X86::MOV32ri, 1, DestReg).addImm(42);
// Create the same instr, but insert it before a specified iterator point.
MachineBasicBlock::iterator MBBI = ...
BuildMI(MBB, MBBI, X86::MOV32ri, 1, DestReg).addImm(42);
// Create a 'cmp Reg, 0' instruction, no destination reg.
MI = BuildMI(X86::CMP32ri, 2).addReg(Reg).addImm(0);
// Create an 'sahf' instruction which takes no operands and stores nothing.
MI = BuildMI(X86::SAHF, 0);
// Create a self looping branch instruction.
BuildMI(MBB, X86::JNE, 1).addMBB(&amp;MBB);
</pre>
<p>
The key thing to remember with the <tt>BuildMI</tt> functions is that you have
to specify the number of operands that the machine instruction will take
(allowing efficient memory allocation). Also, if operands default to be uses
of values, not definitions. If you need to add a definition operand (other
than the optional destination register), you must explicitly mark it as such.
</p>
</div>
<!-- _______________________________________________________________________ -->
<div class="doc_subsubsection">
<a name="fixedregs">Fixed (aka preassigned) registers</a>
</div>
<div class="doc_text">
<p>One important issue that the code generator needs to be aware of is the
presence of fixed registers. In particular, there are often places in the
instruction stream where the register allocator <em>must</em> arrange for a
particular value to be in a particular register. This can occur due to
limitations in the instruction set (e.g., the X86 can only do a 32-bit divide
with the <tt>EAX</tt>/<tt>EDX</tt> registers), or external factors like calling
conventions. In any case, the instruction selector should emit code that
copies a virtual register into or out of a physical register when needed.</p>
<p>For example, consider this simple LLVM example:</p>
<pre>
int %test(int %X, int %Y) {
%Z = div int %X, %Y
ret int %Z
}
</pre>
<p>The X86 instruction selector produces this machine code for the div
and ret (use
"<tt>llc X.bc -march=x86 -print-machineinstrs</tt>" to get this):</p>
<pre>
;; Start of div
%EAX = mov %reg1024 ;; Copy X (in reg1024) into EAX
%reg1027 = sar %reg1024, 31
%EDX = mov %reg1027 ;; Sign extend X into EDX
idiv %reg1025 ;; Divide by Y (in reg1025)
%reg1026 = mov %EAX ;; Read the result (Z) out of EAX
;; Start of ret
%EAX = mov %reg1026 ;; 32-bit return value goes in EAX
ret
</pre>
<p>By the end of code generation, the register allocator has coallesced
the registers and deleted the resultant identity moves, producing the
following code:</p>
<pre>
;; X is in EAX, Y is in ECX
mov %EAX, %EDX
sar %EDX, 31
idiv %ECX
ret
</pre>
<p>This approach is extremely general (if it can handle the X86 architecture,
it can handle anything!) and allows all of the target specific
knowledge about the instruction stream to be isolated in the instruction
selector. Note that physical registers should have a short lifetime for good
code generation, and all physical registers are assumed dead on entry and
exit of basic blocks (before register allocation). Thus if you need a value
to be live across basic block boundaries, it <em>must</em> live in a virtual
register.</p>
</div>
<!-- _______________________________________________________________________ -->
<div class="doc_subsubsection">
<a name="ssa">Machine code SSA form</a>
</div>
<div class="doc_text">
<p><tt>MachineInstr</tt>'s are initially instruction selected in SSA-form, and
are maintained in SSA-form until register allocation happens. For the most
part, this is trivially simple since LLVM is already in SSA form: LLVM PHI nodes
become machine code PHI nodes, and virtual registers are only allowed to have a
single definition.</p>
<p>After register allocation, machine code is no longer in SSA-form, as there
are no virtual registers left in the code.</p>
</div>
<!-- *********************************************************************** -->
<div class="doc_section">
<a name="targetimpls">Target description implementations</a>
</div>
<!-- *********************************************************************** -->
<div class="doc_text">
<p>This section of the document explains any features or design decisions that
are specific to the code generator for a particular target.</p>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection">
<a name="x86">The X86 backend</a>
</div>
<div class="doc_text">
<p>
The X86 code generator lives in the <tt>lib/Target/X86</tt> directory. This
code generator currently targets a generic P6-like processor. As such, it
produces a few P6-and-above instructions (like conditional moves), but it does
not make use of newer features like MMX or SSE. In the future, the X86 backend
will have subtarget support added for specific processor families and
implementations.</p>
</div>
<!-- _______________________________________________________________________ -->
<div class="doc_subsubsection">
<a name="x86_memory">Representing X86 addressing modes in MachineInstrs</a>
</div>
<div class="doc_text">
<p>
The x86 has a very, uhm, flexible, way of accessing memory. It is capable of
forming memory addresses of the following expression directly in integer
instructions (which use ModR/M addressing):</p>
<pre>
Base+[1,2,4,8]*IndexReg+Disp32
</pre>
<p>Wow, that's crazy. In order to represent this, LLVM tracks no less that 4
operands for each memory operand of this form. This means that the "load" form
of 'mov' has the following "Operands" in this order:</p>
<pre>
Index: 0 | 1 2 3 4
Meaning: DestReg, | BaseReg, Scale, IndexReg, Displacement
OperandTy: VirtReg, | VirtReg, UnsImm, VirtReg, SignExtImm
</pre>
<p>Stores and all other instructions treat the four memory operands in the same
way, in the same order.</p>
</div>
<!-- _______________________________________________________________________ -->
<div class="doc_subsubsection">
<a name="x86_names">Instruction naming</a>
</div>
<div class="doc_text">
<p>
An instruction name consists of the base name, a default operand size
followed by a character per operand with an optional special size. For
example:</p>
<p>
<tt>ADD8rr</tt> -&gt; add, 8-bit register, 8-bit register<br>
<tt>IMUL16rmi</tt> -&gt; imul, 16-bit register, 16-bit memory, 16-bit immediate<br>
<tt>IMUL16rmi8</tt> -&gt; imul, 16-bit register, 16-bit memory, 8-bit immediate<br>
<tt>MOVSX32rm16</tt> -&gt; movsx, 32-bit register, 16-bit memory
</p>
</div>
<!-- *********************************************************************** -->
<hr>
<address>
<a href="http://jigsaw.w3.org/css-validator/check/referer"><img
src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a>
<a href="http://validator.w3.org/check/referer"><img
src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /></a>
<a href="mailto:sabre@nondot.org">Chris Lattner</a><br>
<a href="http://llvm.cs.uiuc.edu">The LLVM Compiler Infrastructure</a><br>
Last modified: $Date$
</address>
</body>
</html>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,23 @@
POD = $(wildcard *.pod)
HTML = $(patsubst %.pod, html/%.html, $(POD))
MAN = $(patsubst %.pod, man/man1/%.1, $(POD))
PS = $(patsubst %.pod, ps/%.ps, $(POD))
all: $(HTML) $(MAN) $(PS)
.SUFFIXES:
.SUFFIXES: .html .pod .1 .ps
html/%.html: %.pod
pod2html --css=manpage.css --htmlroot=. \
--podpath=. --noindex --infile=$< --outfile=$@
man/man1/%.1: %.pod
pod2man --release=1.3 --center="LLVM Command Guide" $< $@
ps/%.ps: man/man1/%.1
groff -Tps -man $< > $@
clean:
rm -f pod2htm*.*~~ $(HTML) $(MAN) $(PS)

View File

@@ -1,81 +0,0 @@
<html>
<title>
LLVM: analyze tool
</title>
<body bgcolor=white>
<center><h1>LLVM: <tt>analyze</tt> tool</h1></center>
<HR>
<h3>NAME</h3>
<tt>analyze</tt>
<h3>SYNOPSIS</h3>
<tt>analyze [options] [filename]</tt>
<h3>DESCRIPTION</h3>
The <tt>analyze</tt> command performs various analysis of LLVM assembly code or
bytecode. It will usually print the results on standard output, but in a few
cases, it will print output to standard error or generate a file with the
analysis output (which is usually done when the output is meant for another
program).
<p>
If filename is omitted or is -, <tt>analyze</tt> reads its input from standard
input. It first attempts to interpret its input as LLVM bytecode. If it
encounters an error, it then attempts to parse the input as LLVM assembly
language.
<h3>OPTIONS</h3>
<ul>
<li> -help
<br>
Print a summary of command line options.
<p>
<li> -stats
<br>
Print statistics.
<p>
<li> -time-passes
<br>
Record the amount of time needed for each pass and print it to standard
error.
<p>
<li> -q
<br>
Quiet mode. With this option, analysis pass names are not printed.
<p>
<li> -load &lt;plugin.so&gt;
<br>
Load the specified dynamic object with name plugin.so. This file
should contain additional analysis passes that register themselves with
the <tt>analyze</tt> program after being loaded.
<p>
After being loaded, additional command line options are made available
for running the passes made available by plugin.so. Use
'<tt><tt>analyze</tt> -load &lt;plugin.so&gt; -help</tt>' to see the new
list of available analysis passes.
<p>
</ul>
<h3>EXIT STATUS</h3>
If <tt>analyze</tt> succeeds, it will exit with 0. Otherwise, if an error
occurs, it will exit with a non-zero value.
<h3>SEE ALSO</h3>
<a href="opt.html"><tt>opt</tt></a>
<HR>
Maintained by the <a href="http://llvm.cs.uiuc.edu">LLVM Team</a>.
</body>
</html>

View File

@@ -0,0 +1,75 @@
=pod
=head1 NAME
analyze - LLVM program analyzer
=head1 SYNOPSIS
B<analyze> [I<options>] [I<filename>]
=head1 DESCRIPTION
The B<analyze> command performs various analysis of LLVM assembly
code or bytecode. It will usually print the results on standard
output, but in a few cases, it will print output to standard error
or generate a file with the analysis output, which is usually done
when the output is meant for another program.
If filename is omitted or is I<->, B<analyze> reads its input from
standard input. It first attempts to interpret its input as LLVM
bytecode. If it encounters an error, it then attempts to parse the
input as LLVM assembly language.
=head1 OPTIONS
=over
=item B<-help>
Print a summary of command line options.
=item B<-q>
Quiet mode. With this option, analysis pass names are not printed.
=item B<-load> I<plugin>
Load the specified dynamic object with name I<plugin>. This file
should contain additional analysis passes that register themselves
with the B<analyze> program after being loaded.
After being loaded, additional command line options are made
available for running the passes made available by I<plugin>. Use
B<analyze -load> I<plugin> B<-help> to see the new list of available
analysis passes.
=item B<-profile-info-file> I<filename>
Specify the name of the file loaded by the -profile-loader option.
=item B<-stats>
Print statistics.
=item B<-time-passes>
Record the amount of time needed for each pass and print it to standard
error.
=back
=head1 EXIT STATUS
If B<analyze> succeeds, it will exit with 0. Otherwise, if an error
occurs, it will exit with a non-zero value.
=head1 SEE ALSO
L<opt|opt>
=head1 AUTHORS
Maintained by the LLVM Team (L<http://llvm.cs.uiuc.edu>).
=cut

View File

@@ -0,0 +1,249 @@
=pod
=head1 NAME
bugpoint - automatic test case reduction tool
=head1 SYNOPSIS
B<bugpoint> [I<options>] [I<input LLVM ll/bc files>] [I<LLVM passes>] B<--args>
I<program arguments>
=head1 DESCRIPTION
B<bugpoint> narrows down the source of problems in LLVM tools and passes. It
can be used to debug three types of failures: optimizer crashes, miscompilations
by optimizers, or bad native code generation (including problems in the static
and JIT compilers). It aims to reduce large test cases to small, useful ones.
For example, if B<gccas> crashes while optimizing a file, it will identify the
optimization (or combination of optimizations) that causes the crash, and reduce
the file down to a small example which triggers the crash.
=head2 Design Philosophy
B<bugpoint> is designed to be a useful tool without requiring any hooks into the
LLVM infrastructure at all. It works with any and all LLVM passes and code
generators, and does not need to "know" how they work. Because of this, it may
appear to do stupid things or miss obvious simplifications. B<bugpoint> is also
designed to trade off programmer time for computer time in the
compiler-debugging process; consequently, it may take a long period of
(unattended) time to reduce a test case, but we feel it is still worth it. Note
that B<bugpoint> is generally very quick unless debugging a miscompilation where
each test of the program (which requires executing it) takes a long time.
=head2 Automatic Debugger Selection
B<bugpoint> reads each F<.bc> or F<.ll> file specified on the command line and
links them together into a single module, called the test program. If any LLVM
passes are specified on the command line, it runs these passes on the test
program. If any of the passes crash, or if they produce malformed output (which
causes the verifier to abort), B<bugpoint> starts the crash debugger.
Otherwise, if the B<-output> option was not specified, B<bugpoint> runs the test
program with the C backend (which is assumed to generate good code) to generate
a reference output. Once B<bugpoint> has a reference output for the test
program, it tries executing it with the selected code generator. If the
selected code generator crashes, B<bugpoint> starts the L</Crash debugger> on
the code generator. Otherwise, if the resulting output differs from the
reference output, it assumes the difference resulted from a code generator
failure, and starts the L</Code generator debugger>.
Finally, if the output of the selected code generator matches the reference
output, B<bugpoint> runs the test program after all of the LLVM passes have been
applied to it. If its output differs from the reference output, it assumes the
difference resulted from a failure in one of the LLVM passes, and enters the
miscompilation debugger. Otherwise, there is no problem B<bugpoint> can debug.
=head2 Crash debugger
If an optimizer or code generator crashes, B<bugpoint> will try as hard as it
can to reduce the list of passes (for optimizer crashes) and the size of the
test program. First, B<bugpoint> figures out which combination of optimizer
passes triggers the bug. This is useful when debugging a problem exposed by
B<gccas>, for example, because it runs over 38 passes.
Next, B<bugpoint> tries removing functions from the test program, to reduce its
size. Usually it is able to reduce a test program to a single function, when
debugging intraprocedural optimizations. Once the number of functions has been
reduced, it attempts to delete various edges in the control flow graph, to
reduce the size of the function as much as possible. Finally, B<bugpoint>
deletes any individual LLVM instructions whose absence does not eliminate the
failure. At the end, B<bugpoint> should tell you what passes crash, give you a
bytecode file, and give you instructions on how to reproduce the failure with
B<opt>, B<analyze>, or B<llc>.
=head2 Code generator debugger
The code generator debugger attempts to narrow down the amount of code that is
being miscompiled by the selected code generator. To do this, it takes the test
program and partitions it into two pieces: one piece which it compiles with the
C backend (into a shared object), and one piece which it runs with either the
JIT or the static compiler (B<llc>). It uses several techniques to reduce the
amount of code pushed through the LLVM code generator, to reduce the potential
scope of the problem. After it is finished, it emits two bytecode files (called
"test" [to be compiled with the code generator] and "safe" [to be compiled with
the C backend], respectively), and instructions for reproducing the problem.
The code generator debugger assumes that the C backend produces good code.
=head2 Miscompilation debugger
The miscompilation debugger works similarly to the code generator debugger. It
works by splitting the test program into two pieces, running the optimizations
specified on one piece, linking the two pieces back together, and then executing
the result. It attempts to narrow down the list of passes to the one (or few)
which are causing the miscompilation, then reduce the portion of the test
program which is being miscompiled. The miscompilation debugger assumes that
the selected code generator is working properly.
=head2 Advice for using bugpoint
B<bugpoint> can be a remarkably useful tool, but it sometimes works in
non-obvious ways. Here are some hints and tips:
=over
=item *
In the code generator and miscompilation debuggers, B<bugpoint> only
works with programs that have deterministic output. Thus, if the program
outputs C<argv[0]>, the date, time, or any other "random" data, B<bugpoint> may
misinterpret differences in these data, when output, as the result of a
miscompilation. Programs should be temporarily modified to disable outputs that
are likely to vary from run to run.
=item *
In the code generator and miscompilation debuggers, debugging will go faster if
you manually modify the program or its inputs to reduce the runtime, but still
exhibit the problem.
=item *
B<bugpoint> is extremely useful when working on a new optimization: it helps
track down regressions quickly. To avoid having to relink B<bugpoint> every
time you change your optimization, make B<bugpoint> dynamically load
your optimization by using the B<-load> option.
=item *
B<bugpoint> can generate a lot of output and run for a long period of time. It
is often useful to capture the output of the program to file. For example, in
the C shell, you can type:
bugpoint ... |& tee bugpoint.log
to get a copy of B<bugpoint>'s output in the file F<bugpoint.log>, as well as on
your terminal.
=item *
B<bugpoint> cannot debug problems with the LLVM linker. If B<bugpoint> crashes
before you see its C<All input ok> message, you might try running C<llvm-link
-v> on the same set of input files. If that also crashes, you may be
experiencing a linker bug.
=item *
If your program is supposed to crash, B<bugpoint> will be confused. One way to
deal with this is to cause B<bugpoint> to ignore the exit code from your
program, by giving it the B<-check-exit-code=false> option.
=back
=head1 OPTIONS
=over
=item B<--additional-so> F<library>
Load the dynamic shared object F<library> into the test program whenever it is
run. This is useful if you are debugging programs which depend on non-LLVM
libraries (such as the X or curses libraries) to run.
=item B<--args> I<program args>
Pass all arguments specified after -args to the test program whenever it runs.
Note that if any of the I<program args> start with a '-', you should use:
bugpoint [bugpoint args] --args -- [program args]
The "--" right after the B<--args> option tells B<bugpoint> to consider any
options starting with C<-> to be part of the B<--args> option, not as options to
B<bugpoint> itself.
=item B<--tool-args> I<tool args>
Pass all arguments specified after --tool-args to the LLVM tool under test
(B<llc>, B<lli>, etc.) whenever it runs. You should use this option in the
following way:
bugpoint [bugpoint args] --tool-args -- [tool args]
The "--" right after the B<--tool-args> option tells B<bugpoint> to consider any
options starting with C<-> to be part of the B<--tool-args> option, not as
options to B<bugpoint> itself. (See B<--args>, above.)
=item B<--check-exit-code>=I<{true,false}>
Assume a non-zero exit code or core dump from the test program is a failure.
Defaults to true.
=item B<--disable-{dce,simplifycfg}>
Do not run the specified passes to clean up and reduce the size of the test
program. By default, B<bugpoint> uses these passes internally when attempting to
reduce test programs. If you're trying to find a bug in one of these passes,
B<bugpoint> may crash.
=item B<--help>
Print a summary of command line options.
=item B<--input> F<filename>
Open F<filename> and redirect the standard input of the test program, whenever
it runs, to come from that file.
=item B<--load> F<plugin>
Load the dynamic object F<plugin> into B<bugpoint> itself. This object should
register new optimization passes. Once loaded, the object will add new command
line options to enable various optimizations. To see the new complete list of
optimizations, use the B<--help> and B<--load> options together; for example:
bugpoint --load myNewPass.so --help
=item B<--output> F<filename>
Whenever the test program produces output on its standard output stream, it
should match the contents of F<filename> (the "reference output"). If you
do not use this option, B<bugpoint> will attempt to generate a reference output
by compiling the program with the C backend and running it.
=item B<--profile-info-file> F<filename>
Profile file loaded by B<--profile-loader>.
=item B<--run-{int,jit,llc,cbe}>
Whenever the test program is compiled, B<bugpoint> should generate code for it
using the specified code generator. These options allow you to choose the
interpreter, the JIT compiler, the static native code compiler, or the C
backend, respectively.
=back
=head1 EXIT STATUS
If B<bugpoint> succeeds in finding a problem, it will exit with 0. Otherwise,
if an error occurs, it will exit with a non-zero value.
=head1 SEE ALSO
L<opt|opt>, L<analyze|analyze>
=head1 AUTHOR
Maintained by the LLVM Team (L<http://llvm.cs.uiuc.edu>).
=cut

View File

@@ -1,70 +0,0 @@
<html>
<title>
LLVM: extract tool
</title>
<body bgcolor=white>
<center>
<h1>LLVM: <tt>extract</tt> tool</h1>
</center>
<HR>
<h3>NAME</h3>
<tt>extract</tt>
<h3>
SYNOPSIS
</h3>
<tt>extract [options] [filename]</tt>
<h3>
DESCRIPTION
</h3>
The <tt>extract</tt> command takes the name of a function and extracts it from
the specified LLVM bytecode file. It is primarily used as a debugging tool to
reduce test cases from larger programs that are triggering a bug.
<p>
In addition to extracting the bytecode of the specified function,
<tt>extract</tt> will also remove unreachable global variables, prototypes, and
unused types.
<p>
The <tt>extract</tt> command reads its input from standard input if filename is
omitted or if filename is -. The output is always written to standard output.
<h3>
OPTIONS
</h3>
<ul>
<li>-func &lt;function&gt;
<br>
Extract the specified function from the LLVM bytecode.
<p>
<li> -help
<br>
Print a summary of command line options.
<p>
</ul>
<h3>
EXIT STATUS
</h3>
If <tt>extract</tt> succeeds, it will exit with 0. Otherwise, if an error
occurs, it will exit with a non-zero value.
<h3>
SEE ALSO
</h3>
<a href="bugpoint.html"><tt>bugpoint</tt></a>
<HR>
Maintained by the <a href="http://llvm.cs.uiuc.edu">LLVM Team</a>.
</body>
</html>

View File

@@ -0,0 +1,72 @@
=pod
=head1 NAME
extract - extract a function from an LLVM module
=head1 SYNOPSIS
B<extract> [I<options>] B<--func> I<function-name> [I<filename>]
=head1 DESCRIPTION
The B<extract> command takes the name of a function and extracts it from
the specified LLVM bytecode file. It is primarily used as a debugging tool to
reduce test cases from larger programs that are triggering a bug.
In addition to extracting the bytecode of the specified function,
B<extract> will also remove unreachable global variables, prototypes, and
unused types.
The B<extract> command reads its input from standard input if filename is
omitted or if filename is -. The output is always written to standard output,
unless the B<-o> option is specified (see below).
=head1 OPTIONS
=over
=item B<-f>
Force overwrite. Normally, B<extract> will refuse to overwrite an
output file that already exists. With this option, B<extract>
will overwrite the output file and replace it with new bytecode.
=item B<--func> I<function-name>
Extract the function named I<function-name> from the LLVM bytecode.
=item B<--help>
Print a summary of command line options.
=item B<-o> I<filename>
Specify the output filename. If filename is "-" (the default), then
B<extract> sends its output to standard output.
=item B<--stats>
Print statistics.
=item B<--time-passes>
Record the amount of time needed for each pass and print it to standard
error.
=back
=head1 EXIT STATUS
If B<extract> succeeds, it will exit with 0. Otherwise, if an error
occurs, it will exit with a non-zero value.
=head1 SEE ALSO
L<bugpoint|bugpoint>
=head1 AUTHORS
Maintained by the LLVM Team (L<http://llvm.cs.uiuc.edu>).
=cut

View File

@@ -1,79 +0,0 @@
<html>
<title>LLVM: gccas tool</title>
<body bgcolor=white>
<center>
<h1>LLVM: <tt>gccas</tt> tool</h1>
</center>
<HR>
<h3>NAME</h3>
<tt>gccas</tt>
<h3>SYNOPSIS</h3>
<tt>gccas [options] &lt; filename&gt;</tt>
<h3>DESCRIPTION</h3>
The <tt>gccas</tt> utility takes an LLVM assembly file generated by the <a
href="llvmgcc.html">C</a> or <a href="llvmgxx.html">C++</a> frontends and
converts it into an LLVM bytecode file. It is primarily used by the GCC front
end, and as such, attempts to mimic the interface provided by the default system
assembler so that it can act as a "drop-in" replacement.<p>
<tt>gccas</tt> performs a number of optimizations on the input program.<p>
<h3>
OPTIONS
</h3>
<ul>
<li> -help
<br>
Print a summary of command line options.
<p>
<li> -o &lt;filename&gt;
<br>
Specify the output filename which will hold the assembled bytecode.
<p>
<li>-disable-inlining
<br>
Disable the inlining pass. By default, it is enabled.
<p>
<li> -stats
<br>
Print statistics.
<p>
<li> -time-passes
<br>
Record the amount of time needed for each pass and print it to standard
error.
<p>
<li> -verify
<br>
Verify each pass result.
<p>
</ul>
<h3>
EXIT STATUS
</h3>
If <tt>gccas</tt> succeeds, it will exit with 0. Otherwise, if an error occurs,
it will exit with a non-zero value.
<h3>SEE ALSO</h3>
<a href="llvm-as.html"><tt>llvm-as</tt></a>
<a href="gccld.html"><tt>gccld</tt></a>
<HR>
Maintained by the <a href="http://llvm.cs.uiuc.edu">LLVM Team</a>.
</body>
</html>

View File

@@ -0,0 +1,76 @@
=pod
=head1 NAME
gccas - optimizing LLVM assembler
=head1 SYNOPSIS
B<gccas> [I<options>] I<filename>
=head1 DESCRIPTION
The B<gccas> utility takes an LLVM assembly file generated by the
L<llvmgcc|llvmgcc> or L<llvmg++|llvmgxx> front-ends and converts
it into an LLVM bytecode file. It is primarily used by the GCC
front end, and as such, attempts to mimic the interface provided
by the default system assembler so that it can act as a "drop-in"
replacement.
B<gccas> performs a number of optimizations on the input program,
including but not limited to: promotion of stack values to SSA
registers; elimination of dead globals, function arguments, code,
and types; tail-call elimination; loop-invariant code motion; global
common-subexpression elimination; and sparse conditional constant
propagation.
=head1 OPTIONS
=over
=item B<--help>
Print a summary of command line options.
=item B<-o> F<filename>
Specify the name of the output file which will hold the assembled bytecode.
=item B<--disable-inlining>
Disable the inlining pass. By default, it is enabled.
=item B<--disable-opt>
Disable all assembler-time optimization passes.
=item B<--stats>
Print statistics.
=item B<--time-passes>
Record the amount of time needed for each pass and print it to standard
error.
=item B<--verify>
Verify each pass result.
=back
=head1 EXIT STATUS
If B<gccas> succeeds, it will exit with an exit status of 0.
Otherwise, if an error occurs, it will exit with a non-zero exit
status.
=head1 SEE ALSO
L<llvm-as|llvm-as>, L<gccld|gccld>
=head1 AUTHORS
Maintained by the LLVM Team (L<http://llvm.cs.uiuc.edu>).
=cut

View File

@@ -1,180 +0,0 @@
<html>
<title>LLVM: gccld tool</title>
<body bgcolor=white>
<center><h1>LLVM: <tt>gccld</tt> tool</h1></center>
<HR>
<h3>NAME</h3>
<tt>gccld</tt>
<h3>SYNOPSIS</h3>
<tt>gccld [options] &lt; filename&gt; [ filename ...]</tt>
<h3>DESCRIPTION</h3>
The <tt>gccld</tt> utility takes a set of LLVM bytecode files and links them
together into a single LLVM bytecode file. The output bytecode file can be
another bytecode library or an executable bytecode program. Using additional
options, <tt>gccld</tt> is able to produce native code executables.
<p>
The <tt>gccld</tt> utility is primarily used by the <a href="llvmgcc.html">C</a>
and <a href="llvmgxx.html">C++</a> front-ends, and as such, attempts to mimic
the interface provided by the default system linker so that it can act as a
"drop-in" replacement.
<p>
The <tt>gccld</tt> tool performs a small set of interprocedural, post-link,
optimizations on the program.
<h4>Search Order</h4>
When looking for objects specified on the command line, <tt>gccld</tt> will
search for the object first in the current directory and then in the directory
specified by the <tt>LLVM_LIB_SEARCH_PATH</tt> environment variable. If it
cannot find the object, it fails.
<p>
When looking for a library specified with the -l option, <tt>gccld</tt> first
attempts to load a file with that name from the current directory. If that
fails, it looks for lib&lt;library&gt;.bc, lib&lt;library&gt;.a, or
lib&lt;library&gt;.so, in that order, in each directory added to the library
search path with the -L option. These directories are searched in order they
were specified. If the library cannot be located, then <tt>gccld</tt> looks in
the directory specified by the <tt>LLVM_LIB_SEARCH_PATH</tt> environment
variable. If it does not find lib&lt;library&gt;.[bc | a | so] there, it fails.
The -L option is global. It does not matter where it is specified in the list
of command line arguments; the directory is simply added to the search path and
is applied to all libraries, preceding or succeeding, in the command line.
<h4>Link order</h4>
All object files are linked first in the order they were specified on the
command line. All library files are linked next. Some libraries may not be
linked into the object program; see below.
<h4>Library Linkage</h4>
Object files and static bytecode objects are always linked into the output
file. Library archives (.a files) load only the objects within the archive
that define symbols needed by the output file. Hence, libraries should be
listed after the object files and libraries which need them; otherwise, the
library may not be linked in, and the dependent library will not have its
undefined symbols defined.
<h4>Native code generation</h4>
The <tt>gccld</tt> program has limited support for native code generation, when
using the -native option.
<h3>OPTIONS</h3>
<ul>
<li> -help
<br>
Print a summary of command line options.
<p>
<li> -o &lt;filename&gt;
<br>
Specify the output filename which will hold the linked bytecode.
<p>
<li> -stats
<br>
Print statistics.
<p>
<li> -time-passes
<br>
Record the amount of time needed for each pass and print it to standard
error.
<p>
<li> -verify
<br>
Verify each pass result.
<p>
<li> -L=&lt;directory&gt;
<br>
Add directory to the list of directories to search when looking for
libraries.
<p>
<li> -disable-internalize
<br>
Do not mark all symbols as internal.
<p>
<li> -internalize-public-api-file &lt;filename&gt;
<br>
Preserve the list of symbol names in the file filename.
<p>
<li> -internalize-public-api-list &lt;list&gt;
<br>
Preserve the symbol names in list.
<p>
<li> -l=&lt;library&gt;
<br>
Specify libraries to include when linking the output file. When
linking, <tt>gccld</tt> will first attempt to load a file with the
pathname library. If that fails, it will then attempt to load
lib&lt;library&gt;.bc, lib&lt;library&gt;.a, and lib&lt;library&gt;.so,
in that order.
<p>
<li> -link-as-library
<br>
Link the .bc files together as a library, not an executable.
<p>
<li> -native
<br>
Generate a native, machine code executable.
<p>
When generating native executables, <tt>gccld</tt> first checks for a bytecode
version of the library and links it in, if necessary. If the library is
missing, <tt>gccld</tt> skips it. Then, <tt>gccld</tt> links in the same
libraries as native code.
<p>
In this way, <tt>gccld</tt> should be able to link in optimized bytecode
subsets of common libraries and then link in any part of the library that
hasn't been converted to bytecode.
<p>
<li> -s
<br>
Strip symbol information from the generated executable.
<p>
<li> -v
<br>
Print information about actions taken.
</ul>
<h3>EXIT STATUS</h3>
If <tt>gccld</tt> succeeds, it will exit with 0. Otherwise, if an error occurs,
it will exit with a non-zero value.
<h3>SEE ALSO</h3>
<a href="llvm-link.html"><tt>llvm-link</tt></a>
<a href="gccas.html"><tt>gccas</tt></a>
<h3>BUGS</h3>
The -L option cannot be used for find native code libraries when using the
-native option.
<HR>
Maintained by the <a href="http://llvm.cs.uiuc.edu">LLVM Team</a>.
</body>
</html>

View File

@@ -0,0 +1,175 @@
=pod
=head1 NAME
gccld - optimizing LLVM linker
=head1 SYNOPSIS
B<gccld> [I<options>] I<filename ...>
=head1 DESCRIPTION
The B<gccld> utility takes a set of LLVM bytecode files and links them
together into a single LLVM bytecode file. The output bytecode file can be
another bytecode library or an executable bytecode program. Using additional
options, B<gccld> is able to produce native code executables.
The B<gccld> utility is primarily used by the L<llvmgcc> and
L<llvmg++|llvmgxx> front-ends, and as such, attempts to mimic the interface
provided by the default system linker so that it can act as a ``drop-in''
replacement.
The B<gccld> tool performs a small set of interprocedural, post-link
optimizations on the program.
=head2 Search Order
When looking for objects specified on the command line, B<gccld> will search for
the object first in the current directory and then in the directory specified by
the B<LLVM_LIB_SEARCH_PATH> environment variable. If it cannot find the object,
it fails.
When looking for a library specified with the B<-l> option, B<gccld> first
attempts to load a file with that name from the current directory. If that
fails, it looks for libI<library>.bc, libI<library>.a, or libI<library>.I<shared
library extension>, in that order, in each directory added to the library search
path with the B<-L> option. These directories are searched in the order they
were specified. If the library cannot be located, then B<gccld> looks in the
directory specified by the B<LLVM_LIB_SEARCH_PATH> environment variable. If it
does not find a library there, it fails.
The shared library extension may be I<.so>, I<.dyld>, I<.dll>, or something
different, depending upon the system.
The B<-L> option is global. It does not matter where it is specified in the
list of command line arguments; the directory is simply added to the search path
and is applied to all libraries, preceding or succeeding, in the command line.
=head2 Link order
All object files are linked first in the order they were specified on the
command line. All library files are linked next. Some libraries may not be
linked into the object program; see below.
=head2 Library Linkage
Object files and static bytecode objects are always linked into the output
file. Library archives (.a files) load only the objects within the archive
that define symbols needed by the output file. Hence, libraries should be
listed after the object files and libraries which need them; otherwise, the
library may not be linked in, and the dependent library will not have its
undefined symbols defined.
=head2 Native code generation
The B<gccld> program has limited support for native code generation, when
using the B<-native> or B<-native-cbe> options.
=head1 OPTIONS
=over
=item B<-help>
Print a summary of command line options.
=item B<-o> I<filename>
Specify the output filename which will hold the linked bytecode.
=item B<-stats>
Print statistics.
=item B<-time-passes>
Record the amount of time needed for each pass and print it to standard
error.
=item B<-verify>
Verify each pass result.
=item B<-disable-opt>
Disable all link-time optimization passes.
=item B<-disable-inlining>
Do not run the inliner pass.
=item B<-L>I<directory>
Add directory to the list of directories to search when looking for
libraries.
=item B<-disable-internalize>
Do not mark all symbols as internal.
=item B<-internalize-public-api-file> I<filename>
Preserve the list of symbol names in the file filename.
=item B<-internalize-public-api-list &lt;list&gt;>
Preserve the symbol names in list.
=item B<-l>I<library>
Specify libraries to include when linking the output file. When linking,
B<gccld> will first attempt to load a file with the pathname B<library>. If
that fails, it will then attempt to load libI<library>.bc, libI<library>.a, and
libI<library>.I<shared library extension>, in that order.
=item B<-link-as-library>
Link the .bc files together as a library, not an executable.
=item B<-native>
Generate a native machine code executable.
When generating native executables, B<gccld> first checks for a bytecode
version of the library and links it in, if necessary. If the library is
missing, B<gccld> skips it. Then, B<gccld> links in the same
libraries as native code.
In this way, B<gccld> should be able to link in optimized bytecode
subsets of common libraries and then link in any part of the library that
hasn't been converted to bytecode.
=item B<-native-cbe>
Generate a native machine code executable with the LLVM C backend.
This option is identical to the B<-native> option, but uses the
C backend to generate code for the program instead of an LLVM native
code generator.
=item B<-s>
Strip symbol information from the generated executable.
=item B<-v>
Print information about actions taken.
=back
=head1 EXIT STATUS
If B<gccld> succeeds, it will exit with an exit status of 0.
Otherwise, if an error occurs, it will exit with a non-zero exit
status.
=head1 SEE ALSO
L<llvm-link|llvm-link>, L<gccas|gccas>
=head1 AUTHORS
Maintained by the LLVM Team (L<http://llvm.cs.uiuc.edu>).
=cut

View File

@@ -0,0 +1 @@
*html

View File

@@ -0,0 +1,256 @@
/* Based on http://www.perldoc.com/css/perldoc.css */
@import url("../llvm.css");
body { font-family: Arial,Helvetica; }
blockquote { margin: 10pt; }
h1, a { color: #336699; }
/*** Top menu style ****/
.mmenuon {
font-family: Arial,Helvetica; font-weight: bold; text-decoration: none;
color: #ff6600; font-size: 10pt;
}
.mmenuoff {
font-family: Arial,Helvetica; font-weight: bold; text-decoration: none;
color: #ffffff; font-size: 10pt;
}
.cpyright {
font-family: Arial,Helvetica; font-weight: bold; text-decoration: none;
color: #ffffff; font-size: xx-small;
}
.cpyrightText {
font-family: Arial,Helvetica; font-weight: bold; text-decoration: none;
color: #ffffff; font-size: xx-small;
}
.sections {
font-family: Arial,Helvetica; font-weight: bold; text-decoration: none;
color: #336699; font-size: 11pt;
}
.dsections {
font-family: Arial,Helvetica; font-weight: bold; text-decoration: none;
color: #336699; font-size: 12pt;
}
.slink {
font-family: Arial,Helvetica; font-weight: normal; text-decoration: none;
color: #000000; font-size: 9pt;
}
.slink2 { font-family: Arial,Helvetica; text-decoration: none; color: #336699; }
.maintitle {
font-family: Arial,Helvetica; font-weight: bold; text-decoration: none;
color: #336699; font-size: 18pt;
}
.dblArrow {
font-family: Arial,Helvetica; font-weight: bold; text-decoration: none;
color: #336699; font-size: small;
}
.menuSec {
font-family: Arial,Helvetica; font-weight: bold; text-decoration: none;
color: #336699; font-size: small;
}
.newstext {
font-family: Arial,Helvetica; font-size: small;
}
.linkmenu {
font-family: Arial,Helvetica; color: #000000; font-weight: bold;
text-decoration: none;
}
P {
font-family: Arial,Helvetica;
}
PRE {
font-size: 10pt;
}
.quote {
font-family: Times; text-decoration: none;
color: #000000; font-size: 9pt; font-style: italic;
}
.smstd { font-family: Arial,Helvetica; color: #000000; font-size: x-small; }
.std { font-family: Arial,Helvetica; color: #000000; }
.meerkatTitle {
font-family: sans-serif; font-size: x-small; color: black; }
.meerkatDescription { font-family: sans-serif; font-size: 10pt; color: black }
.meerkatCategory {
font-family: sans-serif; font-size: 9pt; font-weight: bold; font-style: italic;
color: brown; }
.meerkatChannel {
font-family: sans-serif; font-size: 9pt; font-style: italic; color: brown; }
.meerkatDate { font-family: sans-serif; font-size: xx-small; color: #336699; }
.tocTitle {
font-family: Arial,Helvetica; font-weight: bold; text-decoration: none;
color: #333333; font-size: 10pt;
}
.toc-item {
font-family: Arial,Helvetica; font-weight: bold;
color: #336699; font-size: 10pt; text-decoration: underline;
}
.perlVersion {
font-family: Arial,Helvetica; font-weight: bold;
color: #336699; font-size: 10pt; text-decoration: none;
}
.podTitle {
font-family: Arial,Helvetica; font-weight: bold; text-decoration: none;
color: #000000;
}
.docTitle {
font-family: Arial,Helvetica; font-weight: bold; text-decoration: none;
color: #000000; font-size: 10pt;
}
.dotDot {
font-family: Arial,Helvetica; font-weight: bold;
color: #000000; font-size: 9pt;
}
.docSec {
font-family: Arial,Helvetica; font-weight: normal;
color: #333333; font-size: 9pt;
}
.docVersion {
font-family: Arial,Helvetica; font-weight: bold; text-decoration: none;
color: #336699; font-size: 10pt;
}
.docSecs-on {
font-family: Arial,Helvetica; font-weight: normal; text-decoration: none;
color: #ff0000; font-size: 10pt;
}
.docSecs-off {
font-family: Arial,Helvetica; font-weight: normal; text-decoration: none;
color: #333333; font-size: 10pt;
}
h2 {
font-family: Arial,Helvetica; font-weight: bold; text-decoration: none;
color: #336699; font-size: medium;
}
h1 {
font-family: Verdana,Arial,Helvetica; font-weight: bold; text-decoration: none;
color: #336699; font-size: large;
}
DL {
font-family: Arial,Helvetica; font-weight: normal; text-decoration: none;
color: #333333; font-size: 10pt;
}
UL > LI > A {
font-family: Arial,Helvetica; font-weight: bold;
color: #336699; font-size: 10pt;
}
.moduleInfo {
font-family: Arial,Helvetica; font-weight: bold; text-decoration: none;
color: #333333; font-size: 11pt;
}
.moduleInfoSec {
font-family: Arial,Helvetica; font-weight: bold; text-decoration: none;
color: #336699; font-size: 10pt;
}
.moduleInfoVal {
font-family: Arial,Helvetica; font-weight: normal; text-decoration: underline;
color: #000000; font-size: 10pt;
}
.cpanNavTitle {
font-family: Arial,Helvetica; font-weight: bold;
color: #ffffff; font-size: 10pt;
}
.cpanNavLetter {
font-family: Arial,Helvetica; font-weight: bold; text-decoration: none;
color: #333333; font-size: 9pt;
}
.cpanCat {
font-family: Arial,Helvetica; font-weight: bold; text-decoration: none;
color: #336699; font-size: 9pt;
}
.bttndrkblue-bkgd-top {
background-color: #225688;
background-image: url(/global/mvc_objects/images/bttndrkblue_bgtop.gif);
}
.bttndrkblue-bkgd-left {
background-color: #225688;
background-image: url(/global/mvc_objects/images/bttndrkblue_bgleft.gif);
}
.bttndrkblue-bkgd {
padding-top: 0px;
padding-bottom: 0px;
margin-bottom: 0px;
margin-top: 0px;
background-repeat: no-repeat;
background-color: #225688;
background-image: url(/global/mvc_objects/images/bttndrkblue_bgmiddle.gif);
vertical-align: top;
}
.bttndrkblue-bkgd-right {
background-color: #225688;
background-image: url(/global/mvc_objects/images/bttndrkblue_bgright.gif);
}
.bttndrkblue-bkgd-bottom {
background-color: #225688;
background-image: url(/global/mvc_objects/images/bttndrkblue_bgbottom.gif);
}
.bttndrkblue-text a {
color: #ffffff;
text-decoration: none;
}
a.bttndrkblue-text:hover {
color: #ffDD3C;
text-decoration: none;
}
.bg-ltblue {
background-color: #f0f5fa;
}
.border-left-b {
background: #f0f5fa url(/i/corner-leftline.gif) repeat-y;
}
.border-right-b {
background: #f0f5fa url(/i/corner-rightline.gif) repeat-y;
}
.border-top-b {
background: #f0f5fa url(/i/corner-topline.gif) repeat-x;
}
.border-bottom-b {
background: #f0f5fa url(/i/corner-botline.gif) repeat-x;
}
.border-right-w {
background: #ffffff url(/i/corner-rightline.gif) repeat-y;
}
.border-top-w {
background: #ffffff url(/i/corner-topline.gif) repeat-x;
}
.border-bottom-w {
background: #ffffff url(/i/corner-botline.gif) repeat-x;
}
.bg-white {
background-color: #ffffff;
}
.border-left-w {
background: #ffffff url(/i/corner-leftline.gif) repeat-y;
}

View File

@@ -1,122 +1,135 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<head>
<title>LLVM Command Guide</title>
</head>
<link rel="stylesheet" href="../llvm.css" type="text/css">
</head>
<body>
<body bgcolor=white>
<div class="doc_title">
LLVM Command Guide
</div>
<center><h1>LLVM Command Guide<br></h1></center>
<div class="doc_text">
This document is the reference manual for the LLVM utilities. It will
show you how to use the LLVM commands and what all of their options
are.
<p>These documents are HTML versions of the <a href="man/man1/">man pages</a>
for all of the LLVM tools. These pages describe how to use the LLVM commands
and what their options are. Note that these pages do not describe all of the
options available for all tools. To get a complete listing, pass the
<tt>--help</tt> (general options) or <tt>--help-hidden</tt> (general+debugging
options) arguments to the tool you are interested in.</p>
</div>
<!-- *********************************************************************** -->
<div class="doc_section">
<a name="basic">Basic Commands</a>
</div>
<!-- *********************************************************************** -->
<div class="doc_text">
<ul>
<li><a href="html/llvm-as.html"><b>llvm-as</b></a> -
assemble a human-readable .ll file into bytecode</li>
<li><a href="html/llvm-dis.html"><b>llvm-dis</b></a> -
disassemble a bytecode file into a human-readable .ll file</li>
<li><a href="html/opt.html"><b>opt</b></a> -
run a series of LLVM-to-LLVM optimizations on a bytecode file</li>
<li><a href="html/llc.html"><b>llc</b></a> -
generate native machine code for a bytecode file</li>
<li><a href="html/lli.html"><b>lli</b></a> -
directly run a program compiled to bytecode using a JIT compiler or
interpreter</li>
<li><a href="html/llvm-link.html"><b>llvm-link</b></A>
link several bytecode files into one</li>
<li><a href="html/analyze.html"><b>analyze</b></a> -
run LLVM analyses on a bytecode file and print the results</li>
<li><a href="html/llvm-nm.html"><b>llvm-nm</b></a>
print out the names and types of symbols in a bytecode file</li>
<li><a href="html/llvm-prof.html"><b>llvm-prof</b></a> -
format raw `<tt>llvmprof.out</tt>' data into a human-readable report</li>
</ul>
</div>
<!-- *********************************************************************** -->
<div class="doc_section">
<a name="frontend">C, C++, and Stacker Front-end Commands</a>
</div>
<!-- *********************************************************************** -->
<div class="doc_text">
<ul>
<li><a href="html/llvmgcc.html"><b>llvmgcc</b></a> -
GCC-based C front-end for LLVM
<li><a href="html/llvmgxx.html"><b>llvmg++</b></a> -
GCC-based C++ front-end for LLVM</li>
<li><a href="html/gccas.html"><b>gccas</b></a> -
compile-time optimizer used by llvm-g++ and llvm-gcc</li>
<li><a href="html/gccld.html"><b>gccld</b></a> -
linker and link-time optimizer used by llvm-g++ and llvm-gcc</li>
<li><a href="html/stkrc.html"><b>stkrc</b></a> -
front-end compiler for the <a href="../Stacker.html">Stacker</a>
language</li>
</ul>
</div>
<!-- *********************************************************************** -->
<div class="doc_section">
<a name="debug">Debugging Tools</a>
</div>
<!-- *********************************************************************** -->
<div class="doc_text">
<table width=100% border=0>
<tr><td valign=top width=50%>
<ul>
<!--===============================================================-->
<center><h2><a name="llvmcmds">Basic Commands</a><hr></h2></center>
<!--===============================================================-->
<li><a href="html/bugpoint.html"><b>bugpoint</b></a> -
automatic test-case reducer</li>
<dl compact>
<dt><A href="llvm-as.html"><b>llvm-as</b></A>
<dd>
Assemble a human-readable LLVM program into LLVM bytecode.
<p>
<li><a href="html/extract.html"><b>extract</b></a> -
extract a function from an LLVM bytecode file</li>
<dt><A href="llvm-dis.html"><b>llvm-dis</b></A>
<dd>
Disassemble an LLVM bytecode file into human-readable form.
<p>
<li><a href="html/llvm-bcanalyzer.html"><b>llvm-bcanalyzer</b></a> -
bytecode analyzer (analyzes the binary encoding itself, not the program it
represents)</li>
<dt><A href="llvm-nm.html"><b>llvm-nm</b></A>
<dd>
Print out the names and types of symbols in an LLVM bytecode file.
<p>
</ul>
<dt><A href="analyze.html"><b>analyze</b></A>
<dd>
Analyze an LLVM bytecode file.
<p>
</div>
<dt><A href="opt.html"><b>opt</b></A>
<dd>
Optimize an LLVM bytecode file.
<p>
<!-- *********************************************************************** -->
<dt><A href="llvm-link.html"><b>llvm-link</b></A>
<dd>
Link several LLVM bytecode files together into one LLVM
bytecode file.
<p>
<hr>
<address>
<a href="http://jigsaw.w3.org/css-validator/check/referer"><img
src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a>
<a href="http://validator.w3.org/check/referer"><img
src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!"></a>
<dt><A href="llc.html"><b>llc</b></A>
<dd>
Compile an LLVM bytecode program into native machine code.
<a href="http://llvm.cs.uiuc.edu">LLVM Compiler Infrastructure</a><br>
Last modified: $Date$
</address>
<dt><A href="lli.html"><b>lli</b></A>
<dd>
Run an LLVM bytecode program using either an interpreter or a
JIT compiler.
<p>
</dl>
</td><td valign=top width=50%>
<!--===============================================================-->
<center><h2><a name="llvmcmds">C and C++ Front-end Commands</a><hr></h2></center>
<!--===============================================================-->
<dl compact>
<dt><A href="llvmgcc.html"><b>llvmgcc</b></A>
<dd>
GCC-based C front end for LLVM.
<p>
<dt><A href="llvmgxx.html"><b>llvmg++</b></A>
<dd>
GCC-based C++ front end for LLVM.
<p>
<dt><A href="gccas.html"><b>gccas</b></A>
<dd>
LLVM assembler used by GCC and other native compiler tools.
<p>
<dt><A href="gccld.html"><b>gccld</b></A>
<dd>
LLVM linker used by GCC and other native compiler tools.
</dl>
<!--===============================================================-->
<center><h2><a name="llvmcmds">Debugging Tools</a><hr></h2></center>
<!--===============================================================-->
<dl compact>
<dt><A href="bugpoint.html"><b>bugpoint</b></A>
<dd>
Trace an LLVM bytecode program and reduce its failure to a
simple testcase.
<p>
<dt><A href="extract.html"><b>extract</b></A>
<dd>
Extract a function from an LLVM bytecode file.
</dl>
</td></tr></table>
<hr><font size=-1>
Maintained by the
<a href="http://llvm.cs.uiuc.edu">LLVM Team</a>.<br>
<!-- Created: Wed Feb 26 10:40:50 CST 2003 -->
<!-- hhmts start -->
Last modified: Tue Oct 7 15:34:17 CDT 2003
<!-- hhmts end -->
</font>
</body>
</body>
</html>

View File

@@ -1,198 +0,0 @@
<html>
<title>LLVM: llc tool</title>
<body bgcolor=white>
<center><h1>LLVM: <tt>llc</tt> tool</h1></center>
<HR>
<h3>NAME</h3>
<tt>llc</tt>
<h3>SYNOPSIS</h3>
<tt>llc [options] [filename]</tt>
<h3>DESCRIPTION</h3>
The <tt>llc</tt> command compiles LLVM bytecode into assembly language for a
specified architecture. The assembly language output can then be passed through
a native assembler and linker to generate native code.
<p>
The choice of architecture for the output assembly code is determined as
follows:
<ul>
<li>
If the user has specified an architecture with the -m option, use that
architecture.
<p>
<li>
Examine the input LLVM bytecode file:
<ul>
<li>
If it specifies little endian and a pointer size of 32 bits, select the
x86 architecture.
<p>
<li>
If it specifies big endian and a pointer size of 64 bit pointers,
select the SparcV9 architecture.
</ul>
<p>
<li>
If <tt>llc</tt> was compiled on an architecture for which it can
generate code, select the architecture upon which <tt>llc</tt> was
compiled.
<p>
<li>
Print a message to the user asking him or her to specify the output
architecture explicitly.
</ul>
<p>
If filename is not specified, or if filename is -, <tt>llc</tt> reads its input
from standard input. Otherwise, it will read its input from filename.
<p>
If the -o option is left unspecified, then <tt>llc</tt> will send its output to standard
output if the input is from standard input. If the -o option specifies -, then
the output will also be sent to standard output.
<p>
If no -o option is specified and an input file other than - is specified, then
<tt>llc</tt> creates the output filename as follows:
<ul>
<li>
If the file ends in .bc, then the .bc suffix is removed, and the .s suffix
is appended.
<p>
<li>
Otherwise, the .s suffix is appended to the input filename.
</ul>
<h3>
OPTIONS
</h3>
<ul>
<li>-f
<br>
Overwrite output files
<p>
<li>-m&lt;arch&gt;
<br>
Specify the architecture for which to generate assembly. Valid
architectures are:
<dl compact>
<di> x86
<dd>IA-32 (Pentium and above)</dd>
<di> sparc
<dd>SPARC V9</dd>
</dl>
<p>
<li>-o &lt;filename&gt;
<br>
Specify the output filename.
<p>
<li> -help
<br>
Print a summary of command line options.
<p>
<li> -stats
<br>
Print statistics.
<p>
<li> -time-passes
<br>
Record the amount of time needed for each pass and print it to standard
error.
<p>
</ul>
<h4>X86 Specific Options</h4>
<ul>
<li>-disable-fp-elim
<br>
Disable frame pointer elimination optimization.
<p>
<li>-disable-pattern-isel
<br>
Use the 'simple' X86 instruction selector (the default).
<p>
<li>-print-machineinstrs
<br>
Print generated machine code.
<p>
<li>-regalloc=&lt;ra&gt;
<br>
Specify the register allocator to use. The default is <i>simple</i>.
Valid register allocators are:
<dl compact>
<di> simple
<dd>Very simple register allocator</dd>
<di> local
<dd>Local register allocator</dd>
</dl>
<p>
</ul>
<h4>Sparc Specific Options</h4>
<ul>
<li>-disable-peephole
<br>
Disable peephole optimization pass.
<p>
<li>-disable-preopt
<br>
Disable optimizations prior to instruction selection.
<p>
<li>-disable-sched
<br>
Disable local scheduling pass.
<p>
<li>-disable-strip
<br>
Do not strip the LLVM bytecode included in executable.
<p>
<li>-enable-maps
<br>
Emit LLVM-to-MachineCode mapping info to assembly.
<p>
</ul>
<h3>EXIT STATUS</h3>
If <tt>llc</tt> succeeds, it will exit with 0. Otherwise, if an error occurs,
it will exit with a non-zero value.
<h3>
SEE ALSO
</h3>
<a href="lli.html"><tt>lli</tt></a>
<HR>
Maintained by the <a href="http://llvm.cs.uiuc.edu">LLVM Team</a>.
</body>
</html>

View File

@@ -0,0 +1,206 @@
=pod
=head1 NAME
llc - LLVM static compiler
=head1 SYNOPSIS
B<llc> [I<options>] [I<filename>]
=head1 DESCRIPTION
The B<llc> command compiles LLVM bytecode into assembly language for a
specified architecture. The assembly language output can then be passed through
a native assembler and linker to generate native code.
The choice of architecture for the output assembly code is determined as
follows, by attempting to satisfy each of the following rules in turn (first
one wins):
=over
=item *
If the user has specified an architecture with the -m option, use that
architecture.
=item *
Examine the input LLVM bytecode file: if it is little endian and has a
pointer size of 32 bits, select the Intel IA-32 architecture. If it is big
endian and has a pointer size of 64 bits, select the SparcV9 architecture.
=item *
If B<llc> was compiled on an architecture for which it can generate code, select
the architecture upon which B<llc> was compiled.
=item *
Exit with an error message telling the user to specify the output
architecture explicitly.
=back
=head1 OPTIONS
If I<filename> is - or omitted, B<llc> reads LLVM bytecode from standard input.
Otherwise, it will read LLVM bytecode from I<filename>.
If the B<-o> option is omitted, then B<llc> will send its output to standard
output if the input is from standard input. If the B<-o> option specifies -,
then the output will also be sent to standard output.
If no B<-o> option is specified and an input file other than - is specified,
then B<llc> creates the output filename by taking the input filename,
removing any existing F<.bc> extension, and adding a F<.s> suffix.
Other B<llc> options are as follows:
=over
=item B<-f>
Overwrite output files. By default, B<llc> will refuse to overwrite
an output file which already exists.
=item B<-march>=I<arch>
Specify the architecture for which to generate assembly. Valid
architectures are:
=over
=item I<x86>
Intel IA-32 (Pentium and above)
=item I<sparcv9>
64-bit SPARC V9
=item I<c>
Emit C code, not assembly
=back
=item B<-enable-correct-eh-support>
Instruct the B<-lowerinvoke> pass to insert code for correct exception handling
support. This is expensive and is by default omitted for efficiency.
=item B<-help>
Print a summary of command line options.
=item B<-stats>
Print statistics recorded by code-generation passes.
=item B<-time-passes>
Record the amount of time needed for each pass and print a report to standard
error.
=back
=head2 Intel IA-32-specific Options
=over
=item B<--disable-fp-elim>
Disable frame pointer elimination optimization.
=item B<--disable-pattern-isel>
Use the 'simple' X86 instruction selector (the default).
=item B<--print-machineinstrs>
Print generated machine code.
=item B<--regalloc>=I<allocator>
Specify the register allocator to use. The default I<allocator> is I<local>.
Valid register allocators are:
=over
=item I<simple>
Very simple "always spill" register allocator
=item I<local>
Local register allocator
=item I<linearscan>
Linear scan global register allocator
=item I<iterativescan>
Iterative scan global register allocator
=back
=item B<--spiller>=I<spiller>
Specify the spiller to use for register allocators that support it. Currently
this option is used only by the linear scan register allocator. The default
I<spiller> is I<local>. Valid spillers are:
=over
=item I<simple>
Simple spiller
=item I<local>
Local spiller
=back
=back
=head2 SPARCV9-specific Options
=over
=item B<--disable-peephole>
Disable peephole optimization pass.
=item B<--disable-sched>
Disable local scheduling pass.
=item B<--disable-strip>
The Sparc backend embeds the LLVM bytecode into the assembly output. This
option requests that symbol names be retained; by default, they are stripped out.
=item B<--enable-maps>
Emit LLVM-to-machine code mapping information into the assembly output.
=back
=head1 EXIT STATUS
If B<llc> succeeds, it will exit with 0. Otherwise, if an error occurs,
it will exit with a non-zero value.
=head1 SEE ALSO
L<lli|lli>
=head1 AUTHORS
Maintained by the LLVM Team (L<http://llvm.cs.uiuc.edu>).
=cut

View File

@@ -1,127 +0,0 @@
<html>
<title>
LLVM: lli tool
</title>
<body bgcolor=white>
<center>
<h1>LLVM: <tt>lli</tt> tool</h1>
</center>
<HR>
<h3>
NAME
</h3>
<tt>lli</tt>
<h3>
SYNOPSIS
</h3>
<tt>lli [options] [filename] [args ...]</tt>
<h3>
DESCRIPTION
</h3>
<tt>lli</tt> directly executes programs in LLVM format.
It takes a program in LLVM
bytecode format and executes it using a just-in-time
compiler, if one is available for the current architecture, or an interpreter.
<tt>lli</tt> takes all of the same code generator options as the
<tt><a href="llc.html">llc</a></tt> tool, but they are only applicable when
the just-in-time compiler is being used.
<p>
If filename is not specified, then <tt>lli</tt> reads the LLVM bytecode for
the program from standard input.
<p>
The optional "args" specified on the command line are passed to the
program as arguments.
<p>
<h3>
OPTIONS
</h3>
<ul>
<li> <tt>-array-checks</tt>
<br>
Enable array bound checks. If an LLVM program attempts to access an
element of an array which is not within the size of that array,
<tt>lli</tt> will print an error message and call <tt>abort(3)</tt>.
This is presently only applicable to the interpreter.
<p>
<li> <tt>-help</tt>
<br>
Print a summary of command line options.
<p>
<li> <tt>-stats</tt>
<br>
Print statistics from the code-generation passes. This is only meaningful
for the just-in-time compiler, at present.
<p>
<li> <tt>-time-passes</tt>
<br>
Record the amount of time needed for each code-generation pass and print
it to standard error.
<p>
<li> <tt>-march=&lt;arch&gt;</tt>
<br>
Use the specified non-default architecture when selecting a code generator
for the just-in-time compiler. This may result in a crash if you pick an
architecture which is not compatible with the hardware you are running
<tt>lli</tt> on.
<p>
<li> <tt>-quiet, -q</tt>
<br>
Do not print any output about the return values of functions.
This is presently only applicable to the interpreter.
<p>
<li> <tt>-force-interpreter={false,true}</tt>
<br>
If set to true, use the interpreter even if a just-in-time compiler is
available for this architecture. Defaults to false.
<p>
<li> <tt>-trace</tt>
<br>
Print an LLVM-instruction-level dynamic execution trace. This is
presently only applicable to the interpreter.
<p>
<li> <tt>-f=&lt;name&gt;</tt>
<br>
Call the function named <tt>&lt;name&gt;</tt> to start the program.
Note: The function is assumed to have the C signature <tt>int
<tt>&lt;name&gt;</tt> (int, char **, char **)</tt>.
If you try to use this option to call a function of incompatible type,
undefined behavior may result. Defaults to "main".
<p>
</ul>
<h3>
EXIT STATUS
</h3>
If <tt>lli</tt> fails to load the program, it will exit with an exit code of 1.
Otherwise, it will return the exit code of the program it executes.
<h3>
SEE ALSO
</h3>
<a href="llc.html"><tt>llc</tt></a>
<HR>
Maintained by the <a href="http://llvm.cs.uiuc.edu">LLVM Team</a>.
</body>
</html>

View File

@@ -0,0 +1,76 @@
=pod
=head1 NAME
lli - directly execute programs from LLVM bytecode
=head1 SYNOPSIS
B<lli> [I<options>] [I<filename>] [I<program args>]
=head1 DESCRIPTION
B<lli> directly executes programs in LLVM bytecode format. It takes a program
in LLVM bytecode format and executes it using a just-in-time compiler, if one is
available for the current architecture, or an interpreter. B<lli> takes all of
the same code generator options as L<llc|llc>, but they are only effective when
B<lli> is using the just-in-time compiler.
If I<filename> is not specified, then B<lli> reads the LLVM bytecode for the
program from standard input.
The optional I<args> specified on the command line are passed to the program as
arguments.
=head1 OPTIONS
=over
=item B<-help>
Print a summary of command line options.
=item B<-stats>
Print statistics from the code-generation passes. This is only meaningful for
the just-in-time compiler, at present.
=item B<-time-passes>
Record the amount of time needed for each code-generation pass and print it to
standard error.
=item B<-march>=I<arch>
Use the specified non-default architecture arch when selecting a code generator
for the just-in-time compiler. This may result in a crash if you pick an
architecture which is not compatible with the hardware you are running B<lli> on.
=item B<-force-interpreter>=I<{false,true}>
If set to true, use the interpreter even if a just-in-time compiler is available
for this architecture. Defaults to false.
=item B<-f>=I<name>
Call the function named I<name> to start the program. Note: The
function is assumed to have the C signature C<int> I<name> C<(int,
char **, char **)>. If you try to use this option to call a function of
incompatible type, undefined behavior may result. Defaults to C<main>.
=back
=head1 EXIT STATUS
If B<lli> fails to load the program, it will exit with an exit code of 1.
Otherwise, it will return the exit code of the program it executes.
=head1 SEE ALSO
L<llc|llc>
=head1 AUTHOR
Maintained by the LLVM Team (L<http://llvm.cs.uiuc.edu>).
=cut

View File

@@ -1,97 +0,0 @@
<html>
<title>
LLVM: llvm-as tool
</title>
<body bgcolor=white>
<center><h1>LLVM: <tt>llvm-as</tt> tool</h1></center>
<HR>
<h3>NAME</h3>
<tt>llvm-as</tt>
<h3>SYNOPSIS</h3>
<tt>llvm-as [options] [filename]</tt>
<h3>DESCRIPTION</h3>
The <tt>llvm-as</tt> command is the LLVM assembler. It reads a file containing
human readable LLVM assembly language, translates it to LLVM bytecode, and
writes the result into a file or to standard output.
<p>
If filename is omitted or is -, then <tt>llvm-as</tt> reads its input from
standard input.
<p>
If an output file is not specified with the <tt>-o</tt> option, then
<tt>llvm-as</tt> sends its output to a file or standard output by the following
logic:
<ul>
<li>
If the input is standard input, then the output is standard output.
<p>
<li>
If the input is a file that ends with .ll, then the output file is of
the same name, except that the suffix is changed to .bc.
<p>
<li>
If the input is a file that does not end with the .ll suffix, then the
output file has the same name as the input file, except that the .bc
suffix is appended.
<p>
</ul>
<h3>OPTIONS</h3>
<ul>
<li> -f
<br>
Force overwrite. Normally, <tt>llvm-as</tt> will refuse to overwrite an
output file that already exists. With this option, <tt>llvm-as</tt>
will overwrite the output file and replace it with new bytecode.
<p>
<li> -help
<br>
Print a summary of command line options.
<p>
<li> -o &lt;filename&gt;
<br>
Specify the output filename. If filename is -, then <tt>llvm-as</tt>
sends its output to standard output.
<p>
<li> -stats
<br>
Print statistics.
<p>
<li> -time-passes
<br>
Record the amount of time needed for each pass and print it to standard
error.
<p>
</ul>
<h3>EXIT STATUS</h3>
If <tt>llvm-as</tt> succeeds, it will exit with 0. Otherwise, if an error
occurs, it will exit with a non-zero value.
<h3>SEE ALSO</h3>
<a href="llvm-dis.html"><tt>llvm-dis</tt></a>
<a href="gccas.html"><tt>gccas</tt></a>
<HR>
Maintained by the <a href="http://llvm.cs.uiuc.edu">LLVM Team</a>.
</body>
</html>

View File

@@ -0,0 +1,86 @@
=pod
=head1 NAME
llvm-as - LLVM assembler
=head1 SYNOPSIS
B<llvm-as> [I<options>] [I<filename>]
=head1 DESCRIPTION
The B<llvm-as> command invokes the LLVM assembler. It reads a file containing
human-readable LLVM assembly language, translates it to LLVM bytecode, and
writes the result into a file or to standard output.
If F<filename> is omitted or is C<->, then B<llvm-as> reads its input from
standard input.
If an output file is not specified with the B<-o> option, then
B<llvm-as> sends its output to a file or standard output by following
these rules:
=over
=item *
If the input is standard input, then the output is standard output.
=item *
If the input is a file that ends with C<.ll>, then the output file is of
the same name, except that the suffix is changed to C<.bc>.
=item *
If the input is a file that does not end with the C<.ll> suffix, then the
output file has the same name as the input file, except that the C<.bc>
suffix is appended.
=back
=head1 OPTIONS
=over
=item B<-f>
Force overwrite. Normally, B<llvm-as> will refuse to overwrite an
output file that already exists. With this option, B<llvm-as>
will overwrite the output file and replace it with new bytecode.
=item B<--help>
Print a summary of command line options.
=item B<-o> F<filename>
Specify the output file name. If F<filename> is C<->, then B<llvm-as>
sends its output to standard output.
=item B<--stats>
Print statistics.
=item B<--time-passes>
Record the amount of time needed for each pass and print it to standard
error.
=back
=head1 EXIT STATUS
If B<llvm-as> succeeds, it will exit with 0. Otherwise, if an error
occurs, it will exit with a non-zero value.
=head1 SEE ALSO
L<llvm-dis|llvm-dis>, L<gccas|gccas>
=head1 AUTHORS
Maintained by the LLVM Team (L<http://llvm.cs.uiuc.edu>).
=cut

View File

@@ -0,0 +1,66 @@
=pod
=head1 NAME
llvm-bcanalyzer - LLVM bytecode analyzer
=head1 SYNOPSIS
B<llvm-bcanalyzer> [I<options>] [I<filename>]
=head1 DESCRIPTION
The B<llvm-bcanalyzer> command is a small utility for analyzing bytecode files.
The tool reads a bytecode file (such as generated with the B<llvm-as> tool) and
produces a statistical report on the contents of the byteocde file. The tool
will also dump a low level but human readable version of the bytecode file.
This tool is probably not of much interest or utility except for those working
directly with the bytecode file format. Most LLVM users can just ignore
this tool.
If F<filename> is omitted or is C<->, then B<llvm-bcanalyzer> reads its input
from standard input. This is useful for combining the tool into a pipeline.
Output is written to the standard output.
=head1 OPTIONS
=over
=item B<-nodetails>
Causes B<llvm-bcanalyzer> to abbreviate its output by writing out only a module
level summary. The details for individual functions are not displayed.
=item B<-dump>
Causes B<llvm-bcanalyzer> to dump the bytecode in a human readable format. This
format is significantly different from LLVM assembly and provides details about
the encoding of the bytecode file.
=item B<-verify>
Causes B<llvm-bcanalyzer> to verify the module produced by by reading the
bytecode. This ensures that the statistics generated are based on a consistent
module.
=item B<--help>
Print a summary of command line options.
=back
=head1 EXIT STATUS
If B<llvm-bcanalyzer> succeeds, it will exit with 0. Otherwise, if an error
occurs, it will exit with a non-zero value, usually 1.
=head1 SEE ALSO
L<llvm-dis|llvm-dis>, L<http://llvm.cs.uiuc.edu/docs/BytecodeFormat.html>
=head1 AUTHORS
Maintained by the LLVM Team (L<http://llvm.cs.uiuc.edu>).
=cut

View File

@@ -0,0 +1,16 @@
=pod
=head1 NAME
llvm-db - LLVM debugger (alpha)
=head1 SYNOPSIS
Details coming soon. Please see
L<http://llvm.cs.uiuc.edu/docs/SourceLevelDebugging.html> in the meantime.
=head1 AUTHORS
Maintained by the LLVM Team (L<http://llvm.cs.uiuc.edu>).
=cut

View File

@@ -1,99 +0,0 @@
<html>
<title>
LLVM: llvm-dis tool
</title>
<body bgcolor=white>
<center><h1>LLVM: <tt>llvm-dis</tt> tool</h1></center>
<HR>
<h3>NAME</h3>
<tt>llvm-dis</tt>
<h3>SYNOPSIS</h3>
<tt>llvm-dis [options] [filename]</tt>
<h3>DESCRIPTION</h3>
The <tt>llvm-dis</tt> command is the LLVM disassembler. It takes an LLVM
bytecode file and converts it into LLVM assembly language or C source code with
equivalent functionality.
<p>
If filename is omitted, <tt>llvm-dis</tt> reads its input from standard input.
<p>
The default output file for <tt>llvm-dis</tt> is determined by the following logic:
<ul>
<li>
If the input is standard input or the file -, then the output is
standard output.
<p>
<li>
If the input filename ends in .bc, then the output filename will be
identical, except that the .bc suffix will be replaced by the .ll or .c
suffix (for LLVM assembly language and C code, respectively).
<p>
<li>
If the input filename does not end in .bc, then the output filename will
be identical to the input filename, except that the .ll or .c suffix
will be appended to the filename (for LLVM assembly language and C code,
respectively).
</ul>
<h3>OPTIONS</h3>
<ul>
<li> -llvm
<br>
Instruct <tt>llvm-dis</tt> to generate LLVM assembly code in human
readable format. This is the default behavior.
<p>
<li> -c
<br>
Instruct <tt>llvm-dis</tt> to generate C source code.
<p>
<li> -f
<br>
Force overwrite. Normally, <tt>llvm-dis</tt> will refuse to overwrite
an output file that already exists. With this option, <tt>llvm-dis</tt>
will overwrite the output file.
<p>
<li> -help
<br>
Print a summary of command line options.
<p>
<li> -o &lt;filename&gt;
<br>
Specify the output filename. If filename is -, then the output is sent
to standard output.
<p>
<li> -time-passes
<br>
Record the amount of time needed for each pass and print it to standard
error.
<p>
</ul>
<h3>EXIT STATUS</h3>
If <tt>llvm-dis</tt> succeeds, it will exit with 0. Otherwise, if an error
occurs, it will exit with a non-zero value.
<h3>SEE ALSO</h3>
<a href="llvm-as.html"><tt>llvm-as</tt></a>
<HR>
Maintained by the <a href="http://llvm.cs.uiuc.edu">LLVM Team</a>.
</body>
</html>

View File

@@ -0,0 +1,65 @@
=pod
=head1 NAME
llvm-dis - LLVM disassembler
=head1 SYNOPSIS
B<llvm-dis> [I<options>] [I<filename>]
=head1 DESCRIPTION
The B<llvm-dis> command is the LLVM disassembler. It takes an LLVM
bytecode file and converts it into human-readable LLVM assembly language.
If filename is omitted or specified as C<->, B<llvm-dis> reads its
input from standard input.
If the input is being read from standard input, then B<llvm-dis>
will send its output to standard output by default. Otherwise, the
output will be written to a file named after the input file, with
a C<.ll> suffix added (any existing C<.bc> suffix will first be
removed). You can override the choice of output file using the
B<-o> option.
=head1 OPTIONS
=over
=item B<-f>
Force overwrite. Normally, B<llvm-dis> will refuse to overwrite
an output file that already exists. With this option, B<llvm-dis>
will overwrite the output file.
=item B<--help>
Print a summary of command line options.
=item B<-o> F<filename>
Specify the output file name. If F<filename> is -, then the output is sent
to standard output.
=item B<-time-passes>
Record the amount of time needed for each pass and print it to standard
error.
=back
=head1 EXIT STATUS
If B<llvm-dis> succeeds, it will exit with 0. Otherwise, if an error
occurs, it will exit with a non-zero value.
=head1 SEE ALSO
L<llvm-as|llvm-as>
=head1 AUTHORS
Maintained by the LLVM Team (L<http://llvm.cs.uiuc.edu>).
=cut

View File

@@ -1,88 +0,0 @@
<html>
<title>
LLVM: llvm-link tool
</title>
<body bgcolor=white>
<center><h1>LLVM: <tt>llvm-link</tt> tool</h1></center>
<HR>
<h3>NAME</h3>
<tt>llvm-link</tt>
<h3>SYNOPSIS</h3>
<tt>llvm-link [options] &lt;filename&gt; [filename ...]</tt>
<h3>DESCRIPTION</h3>
The <tt>llvm-link</tt> command takes several LLVM bytecode files and links them
together into a single LLVM bytecode file. It writes the output file to
standard output, unless the -o option is used to specify a filename.
<p>
The <tt>llvm-link</tt> command attempts to load the input files from the current
directory. If that fails, it looks for each file in each of the
directories specified by the -L options on the command line. The library search
paths are global; each one is searched for every input file if necessary. The
directories are searched in the order they were specified on the command line.
<h3>
OPTIONS
</h3>
<ul>
<li>-L &lt;directory&gt;
<br>
Add the specified directory to the library search path. When looking
for libraries, <tt>llvm-link</tt> will look in pathname for libraries.
This option can be specified multiple times; <tt>llvm-link</tt> will
search inside these directories in the order in which they were
specified on the command line.
<p>
<li>-f
<br>
Overwrite output files. By default, <tt>llvm-link</tt> will not
overwrite an output file if it alreadys exists.
<p>
<li>-o &lt;filename&gt;
<br>
Output filename. If filename is -, then <tt>llvm-link</tt> will write
its output to standard output.
<p>
<li>-d
<br>
If specified, <tt>llvm-link</tt> prints a human-readable version of the
output bytecode file to standard error.
<p>
<li>-help
<br>
Print a summary of command line options.
<p>
<li>-v
<br>
Verbose mode. Print information about what <tt>llvm-link</tt> is doing.
This typically includes a message for each bytecode file linked in
and for each library found.
</ul>
<h3>
EXIT STATUS
</h3>
If <tt>llvm-link</tt> succeeds, it will exit with 0. Otherwise, if an error
occurs, it will exit with a non-zero value.
<h3>SEE ALSO</h3>
<a href="gccld.html"><tt>gccld</tt></a>
<HR>
Maintained by the <a href="http://llvm.cs.uiuc.edu">LLVM Team</a>.
</body>
</html>

View File

@@ -0,0 +1,75 @@
=pod
=head1 NAME
llvm-link - LLVM linker
=head1 SYNOPSIS
B<llvm-link> [I<options>] I<filename ...>
=head1 DESCRIPTION
The B<llvm-link> command takes several LLVM bytecode files and links them
together into a single LLVM bytecode file. It writes the output file to
standard output, unless the B<-o> option is used to specify a filename.
The B<llvm-link> command attempts to load the input files from the current
directory. If that fails, it looks for each file in each of the directories
specified by the B<-L> options on the command line. The library search paths
are global; each one is searched for every input file if necessary. The
directories are searched in the order they were specified on the command line.
=head1 OPTIONS
=over
=item B<-L> F<directory>
Add the specified F<directory> to the library search path. When looking for
libraries, B<llvm-link> will look in pathname for libraries. This option can be
specified multiple times; B<llvm-link> will search inside these directories in
the order in which they were specified on the command line.
=item B<-f>
Overwrite output files. By default, B<llvm-link> will not overwrite an output
file if it alreadys exists.
=item B<-o> F<filename>
Specify the output file name. If F<filename> is C<->, then B<llvm-link> will
write its output to standard output.
=item B<-d>
If specified, B<llvm-link> prints a human-readable version of the output
bytecode file to standard error.
=item B<--help>
Print a summary of command line options.
=item B<-v>
Verbose mode. Print information about what B<llvm-link> is doing. This
typically includes a message for each bytecode file linked in and for each
library found.
=back
=head1 EXIT STATUS
If B<llvm-link> succeeds, it will exit with 0. Otherwise, if an error
occurs, it will exit with a non-zero value.
=head1 SEE ALSO
L<gccld>
=head1 AUTHORS
Maintained by the LLVM Team (L<http://llvm.cs.uiuc.edu>).
=cut

View File

@@ -1,118 +0,0 @@
<html>
<title>
LLVM: llvm-nm tool
</title>
<body bgcolor=white>
<center><h1>LLVM: <tt>llvm-nm</tt> tool</h1></center>
<HR>
<h3>NAME</h3>
<tt>llvm-nm</tt>
<h3>SYNOPSIS</h3>
<tt>llvm-nm [options] [filenames...]</tt>
<h3>DESCRIPTION</h3>
<p>The <tt>llvm-nm</tt> utility lists the names of symbols from the
LLVM bytecode files named on the command line, along with some
ancillary information about each symbol. If no filename is specified,
or - is used as a filename, <tt>llvm-nm</tt> reads its input from standard
input.</p>
<p><tt>llvm-nm</tt>'s default output format is the traditional BSD
<tt>nm(1)</tt> output format. Each such output record consists of an
(optional) 8-digit hexadecimal address, followed by a type code
character, followed by a name, for each symbol. One record is printed
per line; fields are separated by spaces. When the address is omitted,
it is replaced by 8 spaces.</p>
<p>Type code characters currently supported, and their meanings, are
as follows:</p>
<table border>
<tr><td>U</td><td>Named object is referenced but undefined in this
bytecode file</td></tr>
<tr><td>C</td><td>Common (multiple defs link together into one
def)</td></tr>
<tr><td>W</td><td>Weak reference (multiple defs link together into zero or
one defs)</td></tr>
<tr><td>t</td><td>Local function (text) object</td></tr>
<tr><td>T</td><td>Global function (text) object</td></tr>
<tr><td>d</td><td>Local data object</td></tr>
<tr><td>D</td><td>Global data object</td></tr>
<tr><td>?</td><td>Something unrecognizable</td></tr>
</table>
<p>Because LLVM bytecode files typically contain objects that are not
considered to have addresses until they are linked into an executable
image or dynamically compiled "just-in-time", <tt>llvm-nm</tt> does
not print an address for any symbol, even symbols which are defined in
the bytecode file.</p>
<h3>OPTIONS</h3>
<ul>
<li> -P
<br>
Use POSIX.2 output format. Alias for --format=posix.
<p>
<li> -B (default)
<br>
Use BSD output format. Alias for --format=bsd.
<p>
<li> -help
<br>
Print a summary of command-line options and their meanings.
<p>
<li> -defined-only
<br>
Print only symbols defined in this bytecode file (as opposed
to symbols which may be referenced by objects in this file,
but not defined in this file.)
<p>
<li> -extern-only, -g
<br>
Print only symbols whose definitions are external; that is,
accessible from other bytecode files.
<p>
<li> -undefined-only, -u
<br>
Print only symbols referenced but not defined in this bytecode
file.
<p>
<li> -format=<i>fmt</i>, -f
<br>
Select an output format; <i>fmt</i> may be sysv, posix, or
bsd. The default is bsd.
<p>
</ul>
<h3>BUGS</h3>
<tt>llvm-nm</tt> cannot currently see inside <tt>ar(1)</tt> library
archive files, like <tt>nm(1)</tt> can. It cannot demangle C++ mangled
names, like GNU <tt>nm(1)</tt> can.
<h3>EXIT STATUS</h3>
<tt>llvm-nm</tt> exits with an exit code of zero.
<h3>SEE ALSO</h3>
<a href="llvm-dis.html"><tt>llvm-dis</tt></a>,
<tt>ar(1)</tt>,
<tt>nm(1)</tt>
<HR>
Maintained by the <a href="http://llvm.cs.uiuc.edu">LLVM Team</a>.
</body>
</html>

View File

@@ -0,0 +1,122 @@
=pod
=head1 NAME
llvm-nm - list LLVM bytecode file's symbol table
=head1 SYNOPSIS
B<llvm-nm> [I<options>] [I<filenames...>]
=head1 DESCRIPTION
The B<llvm-nm> utility lists the names of symbols from the LLVM bytecode files,
or B<ar> archives containing LLVM bytecode files, named on the command line.
Each symbol is listed along with some simple information about its provenance.
If no filename is specified, or I<-> is used as a filename, B<llvm-nm> will
process a bytecode file on its standard input stream.
B<llvm-nm>'s default output format is the traditional BSD B<nm> output format.
Each such output record consists of an (optional) 8-digit hexadecimal address,
followed by a type code character, followed by a name, for each symbol. One
record is printed per line; fields are separated by spaces. When the address is
omitted, it is replaced by 8 spaces.
Type code characters currently supported, and their meanings, are as follows:
=over
=item U
Named object is referenced but undefined in this bytecode file
=item C
Common (multiple defs link together into one def)
=item W
Weak reference (multiple defs link together into zero or one defs)
=item t
Local function (text) object
=item T
Global function (text) object
=item d
Local data object
=item D
Global data object
=item ?
Something unrecognizable
=back
Because LLVM bytecode files typically contain objects that are not considered to
have addresses until they are linked into an executable image or dynamically
compiled "just-in-time", B<llvm-nm> does not print an address for any symbol,
even symbols which are defined in the bytecode file.
=head1 OPTIONS
=over
=item B<-P>
Use POSIX.2 output format. Alias for B<--format=posix>.
=item B<-B> (default)
Use BSD output format. Alias for B<--format=bsd>.
=item B<--help>
Print a summary of command-line options and their meanings.
=item B<--defined-only>
Print only symbols defined in this bytecode file (as opposed to
symbols which may be referenced by objects in this file, but not
defined in this file.)
=item B<--extern-only>, B<-g>
Print only symbols whose definitions are external; that is, accessible
from other bytecode files.
=item B<--undefined-only>, B<-u>
Print only symbols referenced but not defined in this bytecode file.
=item B<--format=>I<fmt>, B<-f>
Select an output format; I<fmt> may be I<sysv>, I<posix>, or I<bsd>. The
default is I<bsd>.
=back
=head1 BUGS
B<llvm-nm> cannot demangle C++ mangled names, like GNU B<nm> can.
=head1 EXIT STATUS
B<llvm-nm> exits with an exit code of zero.
=head1 SEE ALSO
L<llvm-dis|llvm-dis>, L<ar(1)>, L<nm(1)>
=head1 AUTHOR
Maintained by the LLVM Team (L<http://llvm.cs.uiuc.edu>).
=cut

View File

@@ -0,0 +1,57 @@
=pod
=head1 NAME
llvm-prof - print execution profile of LLVM program
=head1 SYNOPSIS
B<llvm-prof> [I<options>] [I<bytecode file>] [I<llvmprof.out>]
=head1 DESCRIPTION
The B<llvm-prof> tool reads in an F<llvmprof.out> file (which can
optionally use a specific file with the third program argument), a bytecode file
for the program, and produces a human readable report, suitable for determining
where the program hotspots are.
This program is often used in conjunction with the F<utils/profile.pl>
script. This script automatically instruments a program, runs it with the JIT,
then runs B<llvm-prof> to format a report. To get more information about
F<utils/profile.pl>, execute it with the B<--help> option.
=head1 OPTIONS
=over
=item B<--annotated-llvm> or B<-A>
In addition to the normal report printed, print out the code for the
program, annotated with execution frequency information. This can be
particularly useful when trying to visualize how frequently basic blocks
are executed. This is most useful with basic block profiling
information or better.
=item B<--print-all-code>
Using this option enables the B<--annotated-llvm> option, but it
prints the entire module, instead of just the most commonly executed
functions.
=item B<--time-passes>
Record the amount of time needed for each pass and print it to standard
error.
=back
=head1 EXIT STATUS
B<llvm-prof|llvm-prof> returns 1 if it cannot load the bytecode file or the
profile information. Otherwise, it exits with zero.
=head1 AUTHOR
B<llvm-prof> is maintained by the LLVM Team (L<http://llvm.cs.uiuc.edu>).
=cut

View File

@@ -1,113 +0,0 @@
<html>
<title>
LLVM: llvmgcc tool
</title>
<body bgcolor=white>
<center>
<h1>LLVM: <tt>llvmgcc</tt> tool</h1>
</center>
<HR>
<h3>NAME</h3>
<tt>llvmgcc</tt>
<h3>
SYNOPSIS
</h3>
<tt>llvmgcc [options] filename</tt>
<h3>
DESCRIPTION
</h3>
The <tt>llvmgcc</tt> command is the LLVM C front end. It is a modified version
of the <a href="http://gcc.gnu.org">GNU Compiler Collection</a> (GCC) that takes
C programs and compiles them into LLVM bytecode or assembly language, depending
upon the options.
<p>
Unless the <tt>-S</tt> option is specified, <tt>llvmgcc</tt> will use the
<a href="gccas.html"><tt>gccas</tt></a> program to perform some optimizations
and create an LLVM bytecode file. Unless the <tt>-c</tt> option is specified,
<tt>llvmgcc</tt> will also use the <a href="gccld.html"><tt>gccld</tt></a>
program to perform further optimizations and link the resulting bytecode
file(s) with support libraries to create an executable program.
<p>
Being derived from GCC, llvmgcc has many of GCC's features and accepts most of
GCC's options. It handles a number of GCC's extensions to the C programming
language.
<p>
Below you will find several commonly used options:
<h3>
OPTIONS
</h3>
<ul>
<li> -S
<br>
Do not generate an LLVM bytecode file. Rather, compile the source file
into an LLVM assembly language file.
<p>
<li> -c
<br>
Do not generate a linked bytecode executable. Rather, compile the source
file into an LLVM bytecode file. This bytecode file can then be linked
with other bytecode files later to generate a full LLVM executable.
<p>
<li> -o <i>filename</i>
<br>
Specify the output file to be <i>filename</i>.
<p>
<li> -I <i>directory</i>
<br>
Add a directory to the header file search path. This option can be
repeated.
<p>
<li> -L <i>directory</i>
<br>
Add <i>directory</i> to the library search path. This option can be
repeated.
<p>
<li> -l<i>name</i>
<br>
Link in the library lib<i>name</i>.[bc | a | so]. This library should
be a bytecode library.
<p>
<li>-Wl,<i>option</i>
<br>
Pass <i>option</i> to the linker program, <a
href="gccld.html"><tt>gccld</tt></a>.
<p>
</ul>
<h3>
EXIT STATUS
</h3>
If <tt>llvmgcc</tt> succeeds, it will exit with 0. Otherwise, if an error
occurs, it will exit with a non-zero value.
<h3>
SEE ALSO
</h3>
<A HREF="llvmgxx.html"><tt>llvmg++</tt></A>,
<A HREF="gccas.html"><tt>gccas</tt></A>,
<A HREF="gccld.html"><tt>gccld</tt></A>,
and the Info documentation for <tt>gcc</tt>.
<HR>
Maintained by the <a href="http://llvm.cs.uiuc.edu">LLVM Team</a>.
</body>
</html>

View File

@@ -0,0 +1,87 @@
=pod
=head1 NAME
llvmgcc - LLVM C front-end
=head1 SYNOPSIS
B<llvmgcc> [I<options>] I<filename>
=head1 DESCRIPTION
The B<llvmgcc> command is the LLVM C front end. It is a modified
version of gcc that takes C programs and compiles them into LLVM
bytecode or assembly language, depending upon the options.
Unless the B<-S> option is specified, B<llvmgcc> will use the
L<gccas|gccas> program to perform some optimizations and create an
LLVM bytecode file. Unless the B<-c> option is specified, B<llvmgcc>
will also use the L<gccld|gccld> program to perform further
optimizations and link the resulting bytecode file(s) with support
libraries to create an executable program.
Being derived from the GNU Compiler Collection, B<llvmgcc> has many
of gcc's features and accepts most of gcc's options. It handles a
number of gcc's extensions to the C programming language.
=head1 OPTIONS
=over
=item B<--help>
Print a summary of command line options.
=item B<-S>
Do not generate an LLVM bytecode file. Rather, compile the source
file into an LLVM assembly language file.
=item B<-c>
Do not generate a linked executable. Rather, compile the source
file into an LLVM bytecode file. This bytecode file can then be
linked with other bytecode files later on to generate a full LLVM
executable.
=item B<-o> I<filename>
Specify the output file to be I<filename>.
=item B<-I> I<directory>
Add a directory to the header file search path. This option can be
repeated.
=item B<-L> I<directory>
Add I<directory> to the library search path. This option can be
repeated.
=item B<-l>I<name>
Link in the library libI<name>.[bc | a | so]. This library should
be a bytecode library.
=item B<-Wl,>I<option>
Pass I<option> to the linker (usually gccld).
=back
=head1 EXIT STATUS
If B<llvmgcc> succeeds, it will exit with 0. Otherwise, if an error
occurs, it will exit with a non-zero value.
=head1 SEE ALSO
L<llvmg++|llvmgxx>, L<gccas|gccas>, L<gccld|gccld>
=head1 AUTHORS
Maintained by the LLVM Team (L<http://llvm.cs.uiuc.edu>).
=cut

View File

@@ -1,107 +0,0 @@
<html>
<title>
LLVM: llvmg++ tool
</title>
<body bgcolor=white>
<center>
<h1>LLVM: <tt>llvmg++</tt> tool</h1>
</center>
<HR>
<h3>NAME</h3>
<tt>llvmg++</tt>
<h3>SYNOPSIS</h3>
<tt>llvmg++ [options] filename</tt>
<h3>DESCRIPTION</h3>
The <tt>llvmg++</tt> command is the LLVM C++ front end. It is a modified
version of g++ that takes C++ programs and compiles them into LLVM bytecode or
assembly language, depending upon the options.
<p>
Unless the <tt>-S</tt> option is specified, <tt>llvmg++</tt> will use the
<a href="gccas.html"><tt>gccas</tt></a> program to perform some optimizations
and create an LLVM bytecode file. Unless the <tt>-c</tt> option is specified,
<tt>llvmg++</tt> will also use the <a href="gccld.html"><tt>gccld</tt></a>
program to perform further optimizations and link the resulting bytecode
file(s) with support libraries to create an executable program.
<p>
Being derived from the <a href="http://gcc.gnu.org">GNU Compiler Collection</a>,
<tt>llvmg++</tt> has many of g++'s features and accepts most of g++'s options.
It handles a number of g++'s extensions to the C++ programming language.
<p>
Below you will find several commonly used options:
<h3>
OPTIONS
</h3>
<ul>
<li> -S
<br>
Do not generate an LLVM bytecode file. Rather, compile the source file
into an LLVM assembly language file.
<p>
<li> -c
<br>
Do not generate a linked executable. Rather, compile the source file
into an LLVM bytecode file. This bytecode file can then be linked with
other bytecode files later on to generate a full LLVM executable.
<p>
<li> -o <i>filename</i>
<br>
Specify the output file to be <i>filename</i>.
<p>
<li> -I <i>directory</i>
<br>
Add a directory to the header file search path. This option can be
repeated.
<p>
<li> -L <i>directory</i>
<br>
Add <i>directory</i> to the library search path. This option can be
repeated.
<p>
<li> -l<i>name</i>
<br>
Link in the library lib<i>name</i>.[bc | a | so]. This library should
be a bytecode library.
<p>
<li>-Wl,<i>option</i>
<br>
Pass <i>option</i> to the linker (usually gccld).
<p>
</ul>
<h3>
EXIT STATUS
</h3>
If <tt>llvmg++</tt> succeeds, it will exit with 0. Otherwise, if an error
occurs, it will exit with a non-zero value.
<h3>
SEE ALSO
</h3>
<A HREF="llvmgcc.html"><tt>llvmg++</tt></A>,
<A HREF="gccas.html"><tt>gccas</tt></A>,
<A HREF="gccld.html"><tt>gccld</tt></A>
<HR>
Maintained by the <a href="http://llvm.cs.uiuc.edu">LLVM Team</a>.
</body>
</html>

View File

@@ -0,0 +1,87 @@
=pod
=head1 NAME
llvmg++ - LLVM C++ front-end
=head1 SYNOPSIS
B<llvmg++> [I<options>] I<filename>
=head1 DESCRIPTION
The B<llvmg++> command is the LLVM C++ front end. It is a modified
version of g++ that takes C++ programs and compiles them into LLVM
bytecode or assembly language, depending upon the options.
Unless the B<-S> option is specified, B<llvmg++> will use the
L<gccas|gccas> program to perform some optimizations and create an
LLVM bytecode file. Unless the B<-c> option is specified, B<llvmg++>
will also use the L<gccld|gccld> program to perform further
optimizations and link the resulting bytecode file(s) with support
libraries to create an executable program.
Being derived from the GNU Compiler Collection, B<llvmg++> has many
of g++'s features and accepts most of g++'s options. It handles a
number of g++'s extensions to the C++ programming language.
=head1 OPTIONS
=over
=item B<--help>
Print a summary of command line options.
=item B<-S>
Do not generate an LLVM bytecode file. Rather, compile the source
file into an LLVM assembly language file.
=item B<-c>
Do not generate a linked executable. Rather, compile the source
file into an LLVM bytecode file. This bytecode file can then be
linked with other bytecode files later on to generate a full LLVM
executable.
=item B<-o> I<filename>
Specify the output file to be I<filename>.
=item B<-I> I<directory>
Add a directory to the header file search path. This option can be
repeated.
=item B<-L> I<directory>
Add I<directory> to the library search path. This option can be
repeated.
=item B<-l>I<name>
Link in the library libI<name>.[bc | a | so]. This library should
be a bytecode library.
=item B<-Wl,>I<option>
Pass I<option> to the linker (usually gccld).
=back
=head1 EXIT STATUS
If B<llvmg++> succeeds, it will exit with 0. Otherwise, if an error
occurs, it will exit with a non-zero value.
=head1 SEE ALSO
L<llvmgcc>, L<gccas>, L<gccld>
=head1 AUTHORS
Maintained by the LLVM Team (L<http://llvm.cs.uiuc.edu>).
=cut

View File

@@ -0,0 +1 @@
*.1

View File

@@ -0,0 +1,256 @@
/* Based on http://www.perldoc.com/css/perldoc.css */
@import url("../llvm.css");
body { font-family: Arial,Helvetica; }
blockquote { margin: 10pt; }
h1, a { color: #336699; }
/*** Top menu style ****/
.mmenuon {
font-family: Arial,Helvetica; font-weight: bold; text-decoration: none;
color: #ff6600; font-size: 10pt;
}
.mmenuoff {
font-family: Arial,Helvetica; font-weight: bold; text-decoration: none;
color: #ffffff; font-size: 10pt;
}
.cpyright {
font-family: Arial,Helvetica; font-weight: bold; text-decoration: none;
color: #ffffff; font-size: xx-small;
}
.cpyrightText {
font-family: Arial,Helvetica; font-weight: bold; text-decoration: none;
color: #ffffff; font-size: xx-small;
}
.sections {
font-family: Arial,Helvetica; font-weight: bold; text-decoration: none;
color: #336699; font-size: 11pt;
}
.dsections {
font-family: Arial,Helvetica; font-weight: bold; text-decoration: none;
color: #336699; font-size: 12pt;
}
.slink {
font-family: Arial,Helvetica; font-weight: normal; text-decoration: none;
color: #000000; font-size: 9pt;
}
.slink2 { font-family: Arial,Helvetica; text-decoration: none; color: #336699; }
.maintitle {
font-family: Arial,Helvetica; font-weight: bold; text-decoration: none;
color: #336699; font-size: 18pt;
}
.dblArrow {
font-family: Arial,Helvetica; font-weight: bold; text-decoration: none;
color: #336699; font-size: small;
}
.menuSec {
font-family: Arial,Helvetica; font-weight: bold; text-decoration: none;
color: #336699; font-size: small;
}
.newstext {
font-family: Arial,Helvetica; font-size: small;
}
.linkmenu {
font-family: Arial,Helvetica; color: #000000; font-weight: bold;
text-decoration: none;
}
P {
font-family: Arial,Helvetica;
}
PRE {
font-size: 10pt;
}
.quote {
font-family: Times; text-decoration: none;
color: #000000; font-size: 9pt; font-style: italic;
}
.smstd { font-family: Arial,Helvetica; color: #000000; font-size: x-small; }
.std { font-family: Arial,Helvetica; color: #000000; }
.meerkatTitle {
font-family: sans-serif; font-size: x-small; color: black; }
.meerkatDescription { font-family: sans-serif; font-size: 10pt; color: black }
.meerkatCategory {
font-family: sans-serif; font-size: 9pt; font-weight: bold; font-style: italic;
color: brown; }
.meerkatChannel {
font-family: sans-serif; font-size: 9pt; font-style: italic; color: brown; }
.meerkatDate { font-family: sans-serif; font-size: xx-small; color: #336699; }
.tocTitle {
font-family: Arial,Helvetica; font-weight: bold; text-decoration: none;
color: #333333; font-size: 10pt;
}
.toc-item {
font-family: Arial,Helvetica; font-weight: bold;
color: #336699; font-size: 10pt; text-decoration: underline;
}
.perlVersion {
font-family: Arial,Helvetica; font-weight: bold;
color: #336699; font-size: 10pt; text-decoration: none;
}
.podTitle {
font-family: Arial,Helvetica; font-weight: bold; text-decoration: none;
color: #000000;
}
.docTitle {
font-family: Arial,Helvetica; font-weight: bold; text-decoration: none;
color: #000000; font-size: 10pt;
}
.dotDot {
font-family: Arial,Helvetica; font-weight: bold;
color: #000000; font-size: 9pt;
}
.docSec {
font-family: Arial,Helvetica; font-weight: normal;
color: #333333; font-size: 9pt;
}
.docVersion {
font-family: Arial,Helvetica; font-weight: bold; text-decoration: none;
color: #336699; font-size: 10pt;
}
.docSecs-on {
font-family: Arial,Helvetica; font-weight: normal; text-decoration: none;
color: #ff0000; font-size: 10pt;
}
.docSecs-off {
font-family: Arial,Helvetica; font-weight: normal; text-decoration: none;
color: #333333; font-size: 10pt;
}
h2 {
font-family: Arial,Helvetica; font-weight: bold; text-decoration: none;
color: #336699; font-size: medium;
}
h1 {
font-family: Verdana,Arial,Helvetica; font-weight: bold; text-decoration: none;
color: #336699; font-size: large;
}
DL {
font-family: Arial,Helvetica; font-weight: normal; text-decoration: none;
color: #333333; font-size: 10pt;
}
UL > LI > A {
font-family: Arial,Helvetica; font-weight: bold;
color: #336699; font-size: 10pt;
}
.moduleInfo {
font-family: Arial,Helvetica; font-weight: bold; text-decoration: none;
color: #333333; font-size: 11pt;
}
.moduleInfoSec {
font-family: Arial,Helvetica; font-weight: bold; text-decoration: none;
color: #336699; font-size: 10pt;
}
.moduleInfoVal {
font-family: Arial,Helvetica; font-weight: normal; text-decoration: underline;
color: #000000; font-size: 10pt;
}
.cpanNavTitle {
font-family: Arial,Helvetica; font-weight: bold;
color: #ffffff; font-size: 10pt;
}
.cpanNavLetter {
font-family: Arial,Helvetica; font-weight: bold; text-decoration: none;
color: #333333; font-size: 9pt;
}
.cpanCat {
font-family: Arial,Helvetica; font-weight: bold; text-decoration: none;
color: #336699; font-size: 9pt;
}
.bttndrkblue-bkgd-top {
background-color: #225688;
background-image: url(/global/mvc_objects/images/bttndrkblue_bgtop.gif);
}
.bttndrkblue-bkgd-left {
background-color: #225688;
background-image: url(/global/mvc_objects/images/bttndrkblue_bgleft.gif);
}
.bttndrkblue-bkgd {
padding-top: 0px;
padding-bottom: 0px;
margin-bottom: 0px;
margin-top: 0px;
background-repeat: no-repeat;
background-color: #225688;
background-image: url(/global/mvc_objects/images/bttndrkblue_bgmiddle.gif);
vertical-align: top;
}
.bttndrkblue-bkgd-right {
background-color: #225688;
background-image: url(/global/mvc_objects/images/bttndrkblue_bgright.gif);
}
.bttndrkblue-bkgd-bottom {
background-color: #225688;
background-image: url(/global/mvc_objects/images/bttndrkblue_bgbottom.gif);
}
.bttndrkblue-text a {
color: #ffffff;
text-decoration: none;
}
a.bttndrkblue-text:hover {
color: #ffDD3C;
text-decoration: none;
}
.bg-ltblue {
background-color: #f0f5fa;
}
.border-left-b {
background: #f0f5fa url(/i/corner-leftline.gif) repeat-y;
}
.border-right-b {
background: #f0f5fa url(/i/corner-rightline.gif) repeat-y;
}
.border-top-b {
background: #f0f5fa url(/i/corner-topline.gif) repeat-x;
}
.border-bottom-b {
background: #f0f5fa url(/i/corner-botline.gif) repeat-x;
}
.border-right-w {
background: #ffffff url(/i/corner-rightline.gif) repeat-y;
}
.border-top-w {
background: #ffffff url(/i/corner-topline.gif) repeat-x;
}
.border-bottom-w {
background: #ffffff url(/i/corner-botline.gif) repeat-x;
}
.bg-white {
background-color: #ffffff;
}
.border-left-w {
background: #ffffff url(/i/corner-leftline.gif) repeat-y;
}

View File

@@ -1,120 +0,0 @@
<html>
<title>LLVM: opt tool</title>
<body bgcolor=white>
<center><h1>LLVM: <tt>opt</tt> tool</h1></center>
<HR>
<h3>NAME</h3>
<tt>opt</tt>
<h3>SYNOPSIS</h3>
<tt>opt [options] [filename]</tt>
<h3>DESCRIPTION</h3>
The <tt>opt</tt> command is the modular LLVM optimizer. It takes LLVM bytecode
as input, runs the specified optimizations on it, and then outputs the optimized
LLVM bytecode.
<p>
The optimizations available via <tt>opt</tt> depend upon what libraries were
linked into it as well as any additional libraries that have been loaded with
the <tt>-load</tt> option. Use the <tt>-help</tt> option to determine what
optimizations you can use.
<p>
If no filename is specified on the command line, <tt>opt</tt> reads its input
from standard input.
<p>
If an output filename is not specified with the <tt>-o</tt> option, <tt>opt</tt>
writes its output to the standard output.
<h3>OPTIONS</h3>
<ul>
<li> -f
<br>
Force overwrite. Normally, <tt>opt</tt> will refuse to overwrite an
output file that already exists. With this option, <tt>opt</tt> will
overwrite the output file and replace it with new bytecode.
<p>
<li> -help
<br>
Print a summary of command line options.
<p>
<li> -o &lt;filename&gt;
<br>
Specify the output filename.
<p>
<li> -stats
<br>
Print statistics.
<p>
<li> -time-passes
<br>
Record the amount of time needed for each pass and print it to standard
error.
<p>
<li> -debug
<br>
If this is a debug build, this option will enable debug printouts from
passes which use the <tt>DEBUG</tt> macro. See the <a
href="../ProgrammersManual.html#DEBUG">Programmer's Manual</a> for more
information.
<p>
<!--
<li> -internalize-public-api-file &lt;filename&gt;
<br>
Preserve the symbol names listed in the file filename.
<p>
<li> -internalize-public-api-list=&lt;list&gt;
<br>
Perserve the symbol names specified.
<p>
-->
<li> -q
<br>
Quiet mode. Do not print messages on whether the program was modified.
<p>
<li> -load &lt;plugin.so&gt;
<br>
Load the dynamic object &lt;plugin.so&gt;. This object should register new
optimization passes. Once loaded, the object will add new command line
options to enable various optimizations. To see the new complete list
of optimizations, use the -help and -load options together:
<p>
<tt>opt -load &lt;plugin.so&gt; -help</tt>
<p>
<li> -p
<br>
Print module after each transformation.
<p>
</ul>
<h3>EXIT STATUS</h3>
If <tt>opt</tt> succeeds, it will exit with 0. Otherwise, if an error occurs,
it will exit with a non-zero value.
<h3>SEE ALSO</h3>
<a href="analyze.html"><tt>analyze</tt></a>
<HR>
Maintained by the <a href="http://llvm.cs.uiuc.edu">LLVM Team</a>.
</body>
</html>

View File

@@ -0,0 +1,97 @@
=pod
=head1 NAME
opt - LLVM optimizer
=head1 SYNOPSIS
B<opt> [I<options>] [I<filename>]
=head1 DESCRIPTION
The B<opt> command is the modular LLVM optimizer. It takes LLVM
bytecode as input, runs the specified optimizations on it, and then
outputs the optimized LLVM bytecode.
The optimizations available via B<opt> depend upon what libraries
were linked into it as well as any additional libraries that have
been loaded with the B<-load> option. Use the B<-help> option to
determine what optimizations you can use.
If no filename is specified on the command line, B<opt> reads its
input from standard input.
If an output filename is not specified with the B<-o> option, B<opt>
writes its output to the standard output.
=head1 OPTIONS
=over
=item B<-f>
Force overwrite. Normally, B<opt> will refuse to overwrite an
output file that already exists. With this option, B<opt> will
overwrite the output file and replace it with new bytecode.
=item B<-help>
Print a summary of command line options.
=item B<-o> I<filename>
Specify the output filename.
=item B<-profile-info-file> I<filename>
Specify the name of the file loaded by the -profile-loader option.
=item B<-stats>
Print statistics.
=item B<-time-passes>
Record the amount of time needed for each pass and print it to standard
error.
=item B<-debug>
If this is a debug build, this option will enable debug printouts
from passes which use the I<DEBUG()> macro. See the B<LLVM Programmer's
Manual>, section I<#DEBUG> for more information.
=item B<-load>=I<plugin>
Load the dynamic object I<plugin>. This object should register new
optimization passes. Once loaded, the object will add new command line
options to enable various optimizations. To see the new complete list
of optimizations, use the B<-help> and B<-load> options together:
=over
B<opt -load>=I<plugin> B<-help>
=back
=item B<-p>
Print module after each transformation.
=back
=head1 EXIT STATUS
If B<opt> succeeds, it will exit with 0. Otherwise, if an error
occurs, it will exit with a non-zero value.
=head1 SEE ALSO
L<analyze|analyze>
=head1 AUTHORS
Maintained by the LLVM Team (L<http://llvm.cs.uiuc.edu>).
=cut

View File

@@ -0,0 +1 @@
*ps

View File

@@ -0,0 +1,96 @@
=pod
=head1 NAME
stkrc - Stacker Compiler
=head1 SYNOPSIS
B<stkrc> [I<options>] [I<filename>]
=head1 DESCRIPTION
The B<stkrc> command is the compiler for the Stacker language. Stacker is a
simple stack based, Forth-like language that was written as a demonstration
language for LLVM. For details on the language, please see
L<http://llvm.cs.uiuc.edu/docs/Stacker.html> . The B<stkrc> compiler is fairly
minimal. It compiles to bytecode only and doesn't perform any optimizations.
The output of stkrc (a bytecode file) can be piped through other LLVM tools
for optimization and linking.
If F<filename> is omitted or is C<->, then B<stkrc> reads its input
from standard input. This is useful for combining the tool into a pipeline.
If an output file is not specified with the B<-o> option, then
B<llvm-as> sends its output to a file or standard output by following
these rules:
=over
=item *
If the input is standard input, then the output is standard output.
=item *
If the input is a file that ends with C<.st>, then the output file is of
the same name, except that the suffix is changed to C<.bc>.
=item *
If the input is a file that does not end with the C<.st> suffix, then the
output file has the same name as the input file, except that the C<.bc>
suffix is appended.
=back
=head1 OPTIONS
=over
=item B<-o> F<filename>
Specify the output file name. If F<filename> is C<->, then B<llvm-as>
sends its output to standard output.
=item B<-stats>
Print statistics acquired during compilation.
=item B<-time-passes>
Record the amount of time needed for each pass and print it to standard
error.
=item B<-f>
Force the output to be written. Normally, B<stkrc> won't overwrite an existing
bytecode file. This option overrides that behavior.
=item B<-s> F<stacksize>
Specify the stack size for the program. The default stack size, 1024, should be
sufficient for most programs. For very large programs, especially those that
recurse a lot, you might want to provide a larger value. Each unit of this
value consumes 8 bytes of memory.
=item B<-help>
Print a summary of command line options.
=back
=head1 EXIT STATUS
If B<stkrc> succeeds, it will exit with 0. Otherwise, if an error
occurs, it will exit with a non-zero value, usually 1.
=head1 SEE ALSO
L<llvm-as>, L<http://llvm.cs.uiuc.edu/docs/Stacker.html>
=head1 AUTHORS
Maintained by the LLVM Team (L<http://llvm.cs.uiuc.edu>).
=cut

File diff suppressed because it is too large Load Diff

View File

@@ -1,883 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><title>Data Structure Graph Analysis Status Page</title></head>
<body><h1>Data Structure Graph Analysis Status Page</h1>
This page records information and the progress the data structure analysis
passes have been making. Times are in seconds, sizes are #bytes allocated for a
particular pass. Runs that are all '*'d out were not completed because they
were taking too long (time listed show how long I waited).<p>
Fields that appear in bold have changes from the last entry on the page.
Floating point entries are only highlighted if they change significantly from
their previous value.<p>
<hr>
<a name="20021113"><h2>Nov 14, 2002:</h2>
Some fine tuning happened here. The DSNode object was shrunk by a little bit,
lowering memory consumption. The type merging code now ignores access to
structure fields when checking compatibility, reducing node collapses and
increasing memory consumption in some cases. This table also includes data for
the number of indirect call sites, and the number of indirect call targets. The
final column is the average number of call targets per indirect call site.<p>
<pre>
Name: Anlyz: LocTm: BUTim: TDTim: TimeSum: BCTime: LocSize: BUSize: TDSize: BUTDSz: BCSize: NumFold NumNodes MaxSz GlobGr MaxSCC | Loads Store Calls Allca Mallc Sum | num/ind indcallee ratio
254.gap 0.6627 0.1810 0.6627 0.4697 1.3134 0.6080 | 2024800 2822584 2018424 4841008 16585864 | 2076 24032+3948 268 0+0 20 | 18420 3888 5805 87 3 28203 | 11 11 1
255.vortex 0.3589 0.1648 0.3589 0.6751 1.1988 0.4810 | 1381200 1259752 2001576 3261328 11694840 | 1038 7343+2842 166 0+0 38 | 13901 6136 6829 1420 2 28288 | 6 95 15.8333
300.twolf 0.0690 0.0663 0.0690 0.1151 0.2504 0.2424 | 466600 392384 400272 792656 7054760 | 95 4144+784 215 0+0 1 | 11246 2911 1865 114 3 16139 | 269 269 1
197.parser 0.0481 0.0305 0.0481 0.0479 0.1265 0.1291 | 281184 225008 212296 437304 4409632 | 338 2257+707 97 0+0 3 | 2611 908 1651 25 2 5197 | 2 4 2
burg.llvm 0.0265 0.0218 0.0265 0.0389 0.0872 0.1565 | 536960 477848 188472 666320 2997272 | 213 2309+575 98 0+0 2 | 2265 363 1128 44 4 3804 | 8 24 3
ptrdist-bc 0.0107 0.0079 0.0107 0.0116 0.0302 0.0354 | 198640 269032 91248 360280 1332992 | 62 680+199 42 0+0 1 | 764 411 425 21 25 1646 | 3 3 1
ptrdist-yacr2 0.0100 0.0073 0.0100 0.0078 0.0251 0.0212 | 176112 193048 72296 265344 982896 | * 1036+90 53 0+0 1 | 872 174 289 16 27 1378 | * * n/a
164.gzip.llvm 0.0062 0.0094 0.0062 0.0070 0.0226 0.1029 | 201568 129000 70880 199880 1873760 | 8 971+87 67 0+0 1 | 1014 622 351 19 3 2009 | 9 9 1
optimizer-eval.llvm 0.0060 0.0034 0.0060 0.0344 0.0438 0.0145 | 100008 78968 61784 140752 626688 | * 309+41 72 0+0 1 | 278 405 108 32 * 823 | 2 174 87
181.mcf 0.0050 0.0040 0.0050 0.0055 0.0145 0.0195 | 130984 120848 43208 164056 579064 | 46 376+52 83 0+0 1 | 362 225 81 8 2 678 | * * n/a
voronoi.llvm 0.0037 0.0028 0.0037 0.0054 0.0119 0.0098 | 63768 82584 48808 131392 413304 | 3 307+77 58 0+0 1 | 399 171 121 44 4 739 | * * n/a
256.bzip2 0.0030 0.0060 0.0030 0.0025 0.0115 0.0907 | 138536 83624 39760 123384 1363416 | * 563+37 59 0+0 1 | 698 307 287 18 10 1320 | 2 2 1
sgefa.llvm 0.0028 0.0019 0.0028 0.0029 0.0076 0.0080 | 85680 81992 67056 149048 372736 | * 130+24 36 0+0 1 | 159 65 77 5 5 311 | 1 1 1
sim.llvm 0.0022 0.0032 0.0022 0.0026 0.008 0.0193 | 54952 81152 21976 103128 737584 | * 261+36 60 0+0 1 | 687 305 75 2 21 1090 | * * n/a
bh.llvm 0.0021 0.0025 0.0021 0.0019 0.0065 0.0113 | 75656 51520 27768 79288 470680 | 38 194+35 23 0+0 1 | 266 189 151 36 3 645 | 2 2 1
ptrdist-ft 0.0019 0.0020 0.0019 0.0021 0.006 0.0115 | 46336 58552 15464 74016 502704 | * 192+42 19 0+0 1 | 147 80 96 1 5 329 | 6 6 1
ptrdist-ks 0.0017 0.0028 0.0017 0.0017 0.0062 0.0089 | 48792 44664 31304 75968 381528 | * 215+30 36 0+0 1 | 155 87 88 2 6 338 | * * n/a
ptrdist-anagram 0.0014 0.0017 0.0014 0.0012 0.0043 0.0079 | 43400 41992 14864 56856 409312 | 5 196+28 20 0+0 1 | 105 77 60 5 3 250 | 3 3 1
em3d.llvm 0.0013 0.0012 0.0013 0.0010 0.0035 0.0056 | 24256 43304 13024 56328 223952 | 1 178+28 21 0+0 1 | 114 41 71 * 12 238 | 3 8 2.66666
health.llvm 0.0012 0.0010 0.0012 0.0013 0.0035 0.0070 | 32064 31992 12720 44712 202312 | 3 97+31 13 0+0 1 | 85 72 47 5 3 212 | * * n/a
lists.llvm 0.0010 0.0008 0.0010 0.0015 0.0033 0.0033 | 24968 22808 6640 29448 139832 | * 67+26 28 0+0 1 | 40 31 53 * 3 127 | * * n/a
mst.llvm 0.0008 0.0008 0.0008 0.0007 0.0023 0.0044 | 18944 15584 16680 32264 183080 | 4 97+15 13 0+0 1 | 55 36 42 5 5 143 | 2 2 1
hash.llvm 0.0008 0.0006 0.0008 0.0008 0.0022 0.0035 | 17504 26464 8208 34672 150160 | * 117+17 19 0+0 1 | 35 25 25 1 4 90 | * * n/a
tsp.llvm 0.0007 0.0009 0.0007 0.0005 0.0021 0.0042 | 18416 15024 5408 20432 183312 | * 42+15 7 0+0 1 | 54 61 64 * 1 180 | * * n/a
power.llvm 0.0007 0.0008 0.0007 0.0007 0.0022 0.0050 | 19704 18880 18120 37000 212104 | * 81+18 11 0+0 1 | 141 86 46 11 4 288 | * * n/a
perimeter.llvm 0.0007 0.0006 0.0007 0.0004 0.0017 0.0035 | 14944 13072 3936 17008 155240 | * 35+15 7 0+0 1 | 30 25 49 * 1 105 | * * n/a
bisort.llvm 0.0005 0.0006 0.0005 0.0003 0.0014 0.0032 | 13480 11608 3704 15312 124416 | * 35+13 7 0+0 1 | 37 24 40 * 1 102 | * * n/a
objinst.llvm 0.0004 0.0004 0.0004 0.0005 0.0013 0.0028 | 11360 11008 12288 23296 86552 | 7 53+14 19 0+0 1 | 18 11 19 * 2 50 | * * n/a
methcall.llvm 0.0004 0.0004 0.0004 0.0006 0.0014 0.0026 | 10280 9816 9128 18944 86632 | 17 45+12 15 0+0 1 | 18 11 16 * 2 47 | 1 3 3
treeadd.llvm 0.0003 0.0003 0.0003 0.0002 0.0008 0.0019 | 8712 7568 2216 9784 70776 | * 25+7 7 0+0 1 | 15 6 18 * 1 40 | * * n/a
matrix.llvm 0.0003 0.0003 0.0003 0.0003 0.0009 0.0019 | 3840 15744 3064 18808 69184 | * 38+9 12 0+0 1 | 21 4 11 * 2 38 | * * n/a
llubenchmark.llvm 0.0003 0.0005 0.0003 0.0003 0.0011 0.0028 | 11016 9448 2616 12064 123384 | * 31+7 15 0+0 1 | 29 9 26 * 2 66 | * * n/a
ary3.llvm 0.0003 0.0003 0.0003 0.0002 0.0008 0.0018 | 8832 12584 3008 15592 71432 | 4 44+5 17 0+0 1 | 10 14 7 * 1 32 | * * n/a
sumarraymalloc.llvm 0.0002 0.0005 0.0002 0.0002 0.0009 0.0016 | 7032 2680 2064 4744 54544 | * 23+5 7 0+0 1 | 8 2 8 * 1 19 | * * n/a
sieve.llvm 0.0002 0.0002 0.0002 0.0006 0.001 0.0032 | 5704 1944 1616 3560 216328 | * 22+2 12 0+0 1 | 7 3 4 * * 14 | * * n/a
random.llvm 0.0002 0.0002 0.0002 0.0001 0.0005 0.0014 | 2056 7176 1312 8488 46680 | * 15+2 7 0+0 1 | 8 2 6 * * 16 | * * n/a
heapsort.llvm 0.0002 0.0003 0.0002 0.0001 0.0006 0.0016 | 2856 6976 1992 8968 63368 | * 26+3 7 0+0 1 | 14 7 6 * 1 28 | * * n/a
fib2.llvm 0.0002 0.0002 0.0002 0.0001 0.0005 0.0014 | 5744 6168 1632 7800 42448 | * 21+5 8 0+0 1 | 6 1 7 * * 14 | * * n/a
ackermann.llvm 0.0002 0.0002 0.0002 0.0001 0.0005 0.0013 | 1744 1536 1192 2728 47528 | * 13+2 7 0+0 1 | 6 1 6 * * 13 | * * n/a
sumarray.llvm 0.0001 0.0001 0.0001 0.0000 0.0002 0.0007 | 912 624 632 1256 15112 | * 6+1 4 0+0 1 | 1 3 2 * 1 7 | * * n/a
sumarray2d.llvm 0.0001 0.0001 0.0001 0.0001 0.0003 0.0009 | 1576 3656 848 4504 22544 | * 10+1 7 0+0 1 | 1 2 3 1 * 7 | * * n/a
printargs.llvm 0.0001 0.0001 0.0001 0.0001 0.0003 0.0007 | 3712 1048 704 1752 19104 | * 6+1 4 0+0 1 | 4 * 5 * * 9 | * * n/a
pi.llvm 0.0001 0.0002 0.0001 0.0001 0.0004 0.0011 | 2368 4720 4736 9456 35208 | * 17+2 13 0+0 1 | 7 3 7 2 * 19 | * * n/a
matrixTranspose.llvm 0.0001 0.0002 0.0001 0.0001 0.0004 0.0013 | 1392 4128 736 4864 69720 | * 8+1 5 0+0 1 | 6 5 4 * * 15 | * * n/a
indvars.llvm 0.0001 0.0002 0.0001 0.0001 0.0004 0.0010 | 4752 1072 1024 2096 31536 | * 13+1 8 0+0 1 | 2 6 3 1 * 12 | * * n/a
hello.llvm 0.0000 0.0001 0.0000 0.0000 0.0001 0.0006 | 752 472 472 944 14112 | * 2+0 2 0+0 1 | 3 * 4 * * 7 | * * n/a
</pre><p>
<hr>
<a name="20021113"><h2>Nov 13, 2002:</h2>
New numbers, same as last time, just some extra columns on the end:<p>
This data set also includes new data for the ptrdist benchmark.<p>
<pre>
Name: Anlyz: LocTime: BUTime: TDTime: TimeSum: BCTime: LocSize: BUSize: TDSize: BUTDSz: BCSize: NumFold NumNodes MaxSz GlobGr MaxSCC | Loads Store Calls Allca Mallc Sum
254.gap 4.39 0.1773 0.6581 0.4703 1.3057 0.6054 | 2024952 2823064 2018920 4841984 16585864 | 2080 24032+3948 268 0+0 20 | 18420 3888 5805 87 3 28203
255.vortex 4.03 0.1154 0.3172 0.6416 1.0742 0.4523 | 1381344 1261232 1997512 3258744 11694840 | 1043 7331+2844 166 0+0 38 | 13901 6136 6829 1420 2 28288
300.twolf 0.80 0.0557 0.0593 0.1062 0.2212 0.2191 | 466544 391432 394760 786192 7054760 | 115 4127+784 215 0+0 1 | 11246 2911 1865 114 3 16139
197.parser 0.44 0.0302 0.0403 0.0442 0.1147 0.1204 | 280960 224800 212168 436968 4409632 | 338 2255+706 97 0+0 3 | 2611 908 1651 25 2 5197
burg.llvm 0.33 0.0208 0.0268 0.0356 0.0832 0.1293 | 536552 478856 185880 664736 2997272 | 205 2273+576 98 0+0 2 | 2265 363 1128 44 4 3804
164.gzip.llvm 0.20 0.0093 0.0062 0.0073 0.0228 0.0999 | 201568 129000 70880 199880 1873760 | 8 971+87 67 0+0 1 | 1014 622 351 19 3 2009
ptrdist-bc 0.12 0.0080 0.0111 0.0132 0.0323 0.0304 | 198640 269032 91232 360264 1332992 | 62 680+199 42 0+0 1 | 764 411 425 21 25 1646
256.bzip2 0.11 0.0057 0.0028 0.0024 0.0109 0.0462 | 138536 83624 39760 123384 1363416 | * 563+37 59 0+0 1 | 698 307 287 18 10 1320
optimizer-eval.llvm 0.10 0.0033 0.0064 0.0304 0.0401 0.0133 | 100008 78968 61784 140752 626688 | * 309+41 72 0+0 1 | 278 405 108 32 * 823
ptrdist-yacr2 0.09 0.0075 0.0097 0.0084 0.0256 0.0211 | 176112 193048 72296 265344 982896 | * 1036+90 53 0+0 1 | 872 174 289 16 27 1378
181.mcf 0.09 0.0081 0.0051 0.0054 0.0186 0.0216 | 130816 121096 43648 164744 579064 | 44 388+51 83 0+0 1 | 362 225 81 8 2 678
sgefa.llvm 0.08 0.0019 0.0026 0.0029 0.0074 0.0081 | 85680 81992 67056 149048 372736 | * 130+24 36 0+0 1 | 159 65 77 5 5 311
voronoi.llvm 0.06 0.0028 0.0037 0.0053 0.0118 0.0097 | 63768 82416 51856 134272 413304 | 11 299+77 58 0+0 1 | 399 171 121 44 4 739
sim.llvm 0.06 0.0032 0.0022 0.0025 0.0079 0.0162 | 54952 81152 21976 103128 737584 | * 261+36 60 0+0 1 | 687 305 75 2 21 1090
bh.llvm 0.06 0.0025 0.0021 0.0023 0.0069 0.0116 | 75656 51520 27768 79288 470680 | 38 194+35 23 0+0 1 | 266 189 151 36 3 645
ptrdist-ft 0.05 0.0020 0.0019 0.0021 0.006 0.0113 | 46336 58552 15464 74016 502704 | * 192+42 19 0+0 1 | 147 80 96 1 5 329
em3d.llvm 0.05 0.0012 0.0012 0.0011 0.0035 0.0056 | 24256 43304 13024 56328 223952 | 1 178+28 21 0+0 1 | 114 41 71 * 12 238
ptrdist-ks 0.04 0.0023 0.0016 0.0017 0.0056 0.0081 | 48792 44664 31304 75968 381528 | * 215+30 36 0+0 1 | 155 87 88 2 6 338
ptrdist-anagram 0.04 0.0016 0.0014 0.0025 0.0055 0.0079 | 43400 41992 14864 56856 409312 | 5 196+28 20 0+0 1 | 105 77 60 5 3 250
mst.llvm 0.04 0.0008 0.0007 0.0007 0.0022 0.0044 | 18944 15584 16680 32264 183080 | 4 97+15 13 0+0 1 | 55 36 42 5 5 143
health.llvm 0.04 0.0010 0.0012 0.0017 0.0039 0.0070 | 32064 31992 12720 44712 202312 | 3 97+31 13 0+0 1 | 85 72 47 5 3 212
tsp.llvm 0.03 0.0009 0.0006 0.0005 0.002 0.0041 | 18416 14504 4872 19376 183312 | 9 42+15 7 0+0 1 | 54 61 64 * 1 180
treeadd.llvm 0.03 0.0003 0.0003 0.0002 0.0008 0.0019 | 8712 7568 2216 9784 70776 | * 25+7 7 0+0 1 | 15 6 18 * 1 40
sieve.llvm 0.03 0.0002 0.0002 0.0001 0.0005 0.0032 | 5704 1944 1616 3560 216328 | * 22+2 12 0+0 1 | 7 3 4 * * 14
power.llvm 0.03 0.0008 0.0007 0.0007 0.0022 0.0049 | 19704 18880 18120 37000 212104 | * 81+18 11 0+0 1 | 141 86 46 11 4 288
pi.llvm 0.03 0.0002 0.0001 0.0001 0.0004 0.0010 | 2368 4720 4736 9456 35208 | * 17+2 13 0+0 1 | 7 3 7 2 * 19
perimeter.llvm 0.03 0.0006 0.0007 0.0004 0.0017 0.0035 | 14944 13072 3936 17008 155240 | * 35+15 7 0+0 1 | 30 25 49 * 1 105
objinst.llvm 0.03 0.0005 0.0005 0.0006 0.0016 0.0025 | 11360 16328 4112 20440 86552 | 19 45+14 16 0+0 1 | 18 11 19 * 2 50
methcall.llvm 0.03 0.0004 0.0004 0.0006 0.0014 0.0026 | 10280 9752 9040 18792 86632 | 19 43+12 14 0+0 1 | 18 11 16 * 2 47
matrixTranspose.llvm 0.03 0.0002 0.0001 0.0002 0.0005 0.0013 | 1392 4128 736 4864 69720 | * 8+1 5 0+0 1 | 6 5 4 * * 15
matrix.llvm 0.03 0.0003 0.0003 0.0003 0.0009 0.0019 | 3840 15744 3064 18808 69184 | * 38+9 12 0+0 1 | 21 4 11 * 2 38
llubenchmark.llvm 0.03 0.0005 0.0003 0.0003 0.0011 0.0028 | 11016 9448 2616 12064 123384 | * 31+7 15 0+0 1 | 29 9 26 * 2 66
lists.llvm 0.03 0.0008 0.0010 0.0014 0.0032 0.0033 | 24968 22552 6128 28680 139832 | 15 67+26 28 0+0 1 | 40 31 53 * 3 127
hash.llvm 0.03 0.0006 0.0008 0.0008 0.0022 0.0035 | 17504 26464 8208 34672 150160 | * 117+17 19 0+0 1 | 35 25 25 1 4 90
bisort.llvm 0.03 0.0006 0.0005 0.0003 0.0014 0.0029 | 13480 11608 3704 15312 124416 | * 35+13 7 0+0 1 | 37 24 40 * 1 102
ary3.llvm 0.03 0.0003 0.0003 0.0002 0.0008 0.0018 | 8832 12584 3008 15592 71432 | 4 44+5 17 0+0 1 | 10 14 7 * 1 32
sumarraymalloc.llvm 0.02 0.0002 0.0002 0.0002 0.0006 0.0015 | 7032 2680 2064 4744 54544 | * 23+5 7 0+0 1 | 8 2 8 * 1 19
sumarray.llvm 0.02 0.0001 0.0001 0.0000 0.0002 0.0007 | 912 624 632 1256 15112 | * 6+1 4 0+0 1 | 1 3 2 * 1 7
sumarray2d.llvm 0.02 0.0001 0.0001 0.0001 0.0003 0.0009 | 1576 3656 848 4504 22544 | * 10+1 7 0+0 1 | 1 2 3 1 * 7
random.llvm 0.02 0.0002 0.0002 0.0001 0.0005 0.0014 | 2056 7176 1312 8488 46680 | * 15+2 7 0+0 1 | 8 2 6 * * 16
printargs.llvm 0.02 0.0001 0.0001 0.0000 0.0002 0.0008 | 3712 1048 704 1752 19104 | * 6+1 4 0+0 1 | 4 * 5 * * 9
indvars.llvm 0.02 0.0002 0.0001 0.0001 0.0004 0.0010 | 4752 1072 1024 2096 31536 | * 13+1 8 0+0 1 | 2 6 3 1 * 12
heapsort.llvm 0.02 0.0002 0.0002 0.0001 0.0005 0.0017 | 2856 6976 1992 8968 63368 | * 26+3 7 0+0 1 | 14 7 6 * 1 28
fib2.llvm 0.02 0.0002 0.0002 0.0001 0.0005 0.0013 | 5744 6168 1632 7800 42448 | * 21+5 8 0+0 1 | 6 1 7 * * 14
ackermann.llvm 0.02 0.0002 0.0002 0.0001 0.0005 0.0017 | 1744 1536 1192 2728 47528 | * 13+2 7 0+0 1 | 6 1 6 * * 13
hello.llvm 0.01 0.0001 0.0001 0.0000 0.0002 0.0006 | 752 472 472 944 14112 | * 2+0 2 0+0 1 | 3 * 4 * * 7
</pre><p>
<hr>
<a name="20021112-2"><h2>Nov 12, 2002 #2:</h2>
This build is the same as <a href="#20021112">before</a>, except now this is
compiled in release mode (optimizations enabled, assertions off).<p>
<pre>
Name: Anlyz: LocTime: BUTime: TDTime: TotTime: BCTime: LocSize: BUSize: TDSize: TotSize: BCSize: NumFold NumNodes main __main GlobGr
254.gap.lib 3.43 0.1783 0.6490 0.4676 1.7957 0.5938 | 2024904 2816256 2016824 6857984 16561248 | 5973 24033+3949 44+9 0+0 0+0
255.vortex.lib 3.01 0.1177 0.3156 0.6452 1.5678 0.4652 | 1381488 1260088 2000864 4642440 11691072 | 5851 7324+2837 166+11 0+0 0+0
300.twolf.lib 0.72 0.0547 0.0591 0.1054 0.3435 0.2076 | 466544 391448 394984 1252976 6950016 | 768 4127+784 90+53 0+0 0+0
197.parser.lib 0.38 0.0301 0.0400 0.0448 0.1712 0.1206 | 407728 224960 212368 964008 4442008 | 1332 2256+707 14+6 0+0 0+0
burg.llvm.lib 0.31 0.0207 0.0264 0.0359 0.1114 0.1493 | 535720 477752 185808 1265384 2998392 | 754 2273+576 45+7 0+0 0+0
164.gzip.llvm.lib 0.17 0.0089 0.0062 0.0070 0.0400 0.0977 | 201336 128072 135240 561056 1860784 | 24 971+87 8+2 0+0 0+0
optimizer-eval.llvm.lib 0.08 0.0033 0.0063 0.0311 0.0528 0.0131 | 101272 79216 61760 242248 624880 | * 309+41 72+27 0+0 0+0
256.bzip2.lib 0.08 0.0056 0.0028 0.0024 0.0242 0.0342 | 139696 84264 39688 335984 1371144 | * 563+37 8+2 0+0 0+0
181.mcf.lib 0.07 0.0038 0.0049 0.0055 0.0345 0.0155 | 109872 142976 43664 313504 585632 | 167 388+51 22+10 0+0 0+0
sim.llvm.lib 0.05 0.0031 0.0023 0.0026 0.0187 0.0159 | 55880 51128 21864 225776 728104 | * 260+35 39+22 0+0 0+0
voronoi.llvm.lib 0.04 0.0028 0.0037 0.0054 0.0165 0.0098 | 79696 83000 27112 203160 412912 | 18 299+77 15+8 0+0 0+0
hash.llvm.lib 0.04 0.0006 0.0008 0.0008 0.0045 0.0038 | 25568 23384 8184 70024 150480 | * 117+17 14+6 0+0 0+0
bh.llvm.lib 0.04 0.0025 0.0021 0.0019 0.0118 0.0114 | 75208 51032 27800 202752 482440 | 64 194+35 6+2 0+0 0+0
sgefa.llvm.lib 0.03 0.0019 0.0026 0.0028 0.0124 0.0085 | 85856 82224 67032 260752 375800 | * 130+24 24+14 0+0 0+0
health.llvm.lib 0.03 0.0010 0.0012 0.0013 0.0077 0.0072 | 30416 30184 12704 80824 197952 | 18 97+31 12+4 0+0 0+0
tsp.llvm.lib 0.02 0.0009 0.0006 0.0005 0.0044 0.0044 | 18416 14448 4880 52472 183104 | 22 42+15 7+4 0+0 0+0
power.llvm.lib 0.02 0.0008 0.0007 0.0007 0.0049 0.0065 | 19592 27536 7848 63072 218032 | * 81+18 11+2 0+0 0+0
perimeter.llvm.lib 0.02 0.0006 0.0006 0.0004 0.0039 0.0035 | 15200 14104 3944 46320 158680 | * 35+15 7+4 0+0 0+0
objinst.llvm.lib 0.02 0.0004 0.0004 0.0006 0.0038 0.0026 | 11368 15280 4112 45376 90432 | 32 45+14 16+10 0+0 0+0
mst.llvm.lib 0.02 0.0008 0.0008 0.0007 0.0047 0.0046 | 18952 16568 7024 58032 183080 | 10 97+15 12+3 0+0 0+0
methcall.llvm.lib 0.02 0.0004 0.0004 0.0005 0.0035 0.0026 | 10944 11088 3928 39584 87008 | 30 43+12 14+8 0+0 0+0
llubenchmark.llvm.lib 0.02 0.0005 0.0003 0.0003 0.0037 0.0030 | 11008 9448 2600 33976 123336 | * 31+7 15+5 0+0 0+0
lists.llvm.lib 0.02 0.0010 0.0010 0.0014 0.0054 0.0036 | 25352 15608 14344 67520 139752 | 29 67+26 3+1 0+0 0+0
em3d.llvm.lib 0.02 0.0011 0.0013 0.0011 0.0063 0.0055 | 24320 32736 12984 86912 224936 | 1 178+28 12+4 0+0 0+0
bisort.llvm.lib 0.02 0.0006 0.0005 0.0003 0.0033 0.0030 | 13520 11672 3704 45912 125120 | * 35+13 7+4 0+0 0+0
treeadd.llvm.lib 0.01 0.0003 0.0003 0.0002 0.0023 0.0019 | 8064 7512 2200 29880 70776 | * 25+7 6+3 0+0 0+0
sumarraymalloc.llvm.lib 0.01 0.0002 0.0002 0.0002 0.0020 0.0015 | 2712 7000 2048 25576 54608 | * 23+5 7+4 0+0 0+0
sumarray.llvm.lib 0.01 0.0001 0.0001 0.0001 0.0011 0.0007 | 904 3192 624 4720 15112 | * 6+1 4+1 0+0 0+0
sumarray2d.llvm.lib 0.01 0.0002 0.0001 0.0001 0.0013 0.0009 | 1568 3536 848 8176 22504 | * 10+1 7+1 0+0 0+0
sieve.llvm.lib 0.01 0.0002 0.0002 0.0001 0.0020 0.0033 | 2152 6144 1616 23240 216328 | * 22+2 12+1 0+0 0+0
random.llvm.lib 0.01 0.0002 0.0002 0.0001 0.0017 0.0014 | 7616 1632 1320 23104 46680 | * 15+2 3+1 0+0 0+0
printargs.llvm.lib 0.01 0.0001 0.0001 0.0001 0.0011 0.0008 | 1248 1048 704 5144 19104 | * 6+1 4+1 0+0 0+0
pi.llvm.lib 0.01 0.0002 0.0001 0.0001 0.0016 0.0011 | 5392 3800 4728 13920 35880 | * 17+2 13+2 0+0 0+0
matrixTranspose.llvm.lib 0.01 0.0002 0.0001 0.0001 0.0012 0.0013 | 5800 1144 736 7680 69712 | * 8+1 5+1 0+0 0+0
matrix.llvm.lib 0.01 0.0003 0.0003 0.0003 0.0028 0.0018 | 10088 8616 10672 40912 68728 | * 38+9 12+8 0+0 0+0
indvars.llvm.lib 0.01 0.0002 0.0001 0.0001 0.0014 0.0010 | 4760 1080 1016 9392 31536 | * 13+1 8+1 0+0 0+0
hello.llvm.lib 0.01 0.0001 0.0001 0.0000 0.0009 0.0007 | 752 2952 472 6512 12216 | * 2+0 0+0 0+0 0+0
heapsort.llvm.lib 0.01 0.0002 0.0002 0.0001 0.0021 0.0017 | 2856 6968 2008 26672 63368 | * 26+3 7+2 0+0 0+0
fib2.llvm.lib 0.01 0.0002 0.0002 0.0001 0.0019 0.0013 | 5696 6136 1640 26200 41992 | * 21+5 8+3 0+0 0+0
ary3.llvm.lib 0.01 0.0003 0.0004 0.0002 0.0026 0.0018 | 10264 21184 3008 45968 72576 | 6 44+5 12+3 0+0 0+0
ackermann.llvm.lib 0.01 0.0002 0.0002 0.0001 0.0016 0.0014 | 1752 5736 1200 24944 46728 | * 13+2 3+1 0+0 0+0
</pre><p>
<hr>
<a name="20021112"><h2>Nov 12, 2002:</h2>
<a
href="http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20021111/001567.html">This
small change</a> is important to programs with large SCC's. It basically makes
sure to inline calls to non-scc functions before we inline <b>any</b> intra-scc
calls. The problem is that inlining an SCC call could add <b>more</b> call
sites that would slow things down.<p>
Note that the total time underestimates the improvement. Take a look at the
change on BU time/total time to get an accurate accessment. I had some of the
graph IO printing code commented out in the last run, which affected Analyze
time, but not total time.<p>
<pre>
Name: Anlyz: LocTime: BUTime: TDTime: TotTime: BCTime: LocSize: BUSize: TDSize: TotSize: BCSize: NumFold NumNodes main __main GlobGr
254.gap.lib 17.69 0.8298 4.1158 2.4087 8.9138 2.9912 | 2024984 <b>2840288</b> <b>2024560</b> <b>6889832</b> 16554904 | <b>5985</b> <b>24035+3950</b> 44+9 0+0 0+0
255.vortex.lib 14.99 0.5988 1.8871 3.6557 7.3284 2.4054 | 1381056 <b>1259144</b> <b>1997120</b> <b>4637320</b> 11689312 | <b>5853</b> <b>7328+2841</b> 166+11 0+0 0+0
300.twolf.lib 3.34 0.2774 0.2827 0.5115 1.5475 1.0153 | 466528 391512 396552 1254592 6936728 | 749 4128+784 90+53 0+0 0+0
197.parser.lib 1.85 0.1485 0.3190 0.2156 0.8689 0.6872 | 408392 <b>225184</b> <b>212552</b> <b>965384</b> 4447944 | <b>1343</b> 2257+707 14+6 0+0 0+0
burg.llvm.lib 1.22 0.1027 0.1926 0.1739 0.5598 0.4947 | 530600 <b>474592</b> 185792 <b>1190984</b> 3040208 | <b>758</b> 2273+576 45+7 0+0 0+0
164.gzip.llvm.lib 0.74 0.0398 0.0559 0.0350 0.1957 0.4561 | 145952 184776 70872 499912 1876248 | 24 971+87 8+2 0+0 0+0
optimizer-eval.llvm.lib 0.43 0.0183 0.0485 0.2054 0.3047 0.0839 | 101184 79456 61760 242400 624688 | * 309+41 72+27 0+0 0+0
256.bzip2.lib 0.34 0.0241 0.0404 0.0113 0.1250 0.1624 | 139504 83400 39712 335144 1373216 | * 563+37 8+2 0+0 0+0
181.mcf.lib 0.23 0.0216 0.0279 0.0301 0.1126 0.0795 | 115448 146520 43680 322864 589440 | 166 388+51 22+10 0+0 0+0
sim.llvm.lib 0.20 0.0137 0.0138 0.0131 0.0800 0.0876 | 81632 51496 21872 226584 734152 | * 260+35 39+22 0+0 0+0
voronoi.llvm.lib 0.17 0.0139 0.0246 0.0282 0.0811 0.0591 | 79824 84152 27112 204904 420568 | 18 299+77 15+8 0+0 0+0
sgefa.llvm.lib 0.16 0.0090 0.0195 0.0201 0.0848 0.0542 | 85688 100456 67024 277864 368680 | * 130+24 24+14 0+0 0+0
bh.llvm.lib 0.16 0.0121 0.0164 0.0115 0.0581 0.0682 | 75000 51080 27760 217632 470720 | 61 194+35 6+2 0+0 0+0
power.llvm.lib <b>0.13</b> 0.0044 <b>0.0122</b> 0.0037 0.0282 0.0484 | 27776 17688 18144 71424 213760 | * 81+18 11+2 0+0 0+0
em3d.llvm.lib 0.11 0.0060 0.0110 0.0059 0.0308 0.0561 | 33040 36256 13008 90632 227520 | 1 178+28 12+4 0+0 0+0
health.llvm.lib 0.10 0.0052 <b>0.0203</b> 0.0073 0.0406 0.0421 | 30632 31432 12704 89592 199888 | 18 97+31 12+4 0+0 0+0
tsp.llvm.lib 0.07 0.0051 0.0063 0.0027 0.0217 0.0332 | 18232 14336 4920 51888 180744 | 21 43+15 8+4 0+0 0+0
mst.llvm.lib 0.07 0.0040 0.0065 0.0037 0.0215 0.0296 | 18624 25576 7040 65808 178832 | 10 97+15 12+3 0+0 0+0
lists.llvm.lib 0.07 0.0043 0.0131 0.0071 0.0299 0.0269 | 24552 16920 14440 68024 141480 | 30 67+26 3+1 0+0 0+0
fib2.llvm.lib <b>0.07</b> <b>0.0053</b> <b>0.0217</b> 0.0008 <b>0.0313</b> <b>0.0076</b> | 7960 6288 1640 28408 42256 | * 21+5 8+3 0+0 0+0
perimeter.llvm.lib 0.06 0.0031 0.0064 0.0021 0.0190 0.0275 | 15016 14192 3936 45912 156352 | * 35+15 7+4 0+0 0+0
hash.llvm.lib 0.06 0.0031 0.0050 0.0052 0.0200 0.0211 | 25728 16608 8208 63576 151680 | * 117+17 14+6 0+0 0+0
bisort.llvm.lib 0.06 0.0030 0.0055 0.0019 0.0318 <b>0.0126</b> | 13288 11408 3712 39448 127360 | * 35+13 7+4 0+0 0+0
sumarraymalloc.llvm.lib 0.04 0.0009 0.0014 0.0009 0.0075 <b>0.0240</b> | 7040 2672 2048 25872 54352 | * 23+5 7+4 0+0 0+0
objinst.llvm.lib 0.04 0.0019 0.0050 0.0032 0.0154 <b>0.0100</b> | 11280 15784 4112 45296 89856 | 34 45+14 16+10 0+0 0+0
methcall.llvm.lib 0.04 0.0018 0.0047 0.0031 0.0145 <b>0.0122</b> | 11008 9880 3928 38624 87976 | 30 43+12 14+8 0+0 0+0
matrix.llvm.lib 0.04 0.0013 0.0021 0.0014 0.0106 <b>0.0198</b> | 8808 8872 3072 33144 69112 | * 38+9 12+8 0+0 0+0
llubenchmark.llvm.lib 0.04 0.0024 0.0026 0.0015 0.0142 0.0118 | 11072 11760 2624 36480 124344 | * 31+7 15+5 0+0 0+0
heapsort.llvm.lib 0.04 0.0009 0.0019 0.0007 0.0073 <b>0.0137</b> | 2856 6968 2008 26976 63160 | * 26+3 7+2 0+0 0+0
ary3.llvm.lib 0.04 0.0013 0.0020 0.0011 0.0090 <b>0.0134</b> | 10240 13104 10888 45832 73064 | 6 44+5 12+3 0+0 0+0
ackermann.llvm.lib 0.04 0.0007 0.0015 0.0004 0.0066 0.0262 | 1744 5728 1200 22056 46448 | * 13+2 3+1 0+0 0+0
treeadd.llvm.lib 0.03 0.0015 0.0028 0.0010 0.0090 0.0084 | 3856 7384 2200 29784 72064 | * 25+7 6+3 0+0 0+0
sieve.llvm.lib 0.03 0.0008 0.0012 0.0006 0.0061 0.0162 | 2176 6176 1632 23432 216840 | * 22+2 12+1 0+0 0+0
random.llvm.lib <b>0.03</b> 0.0008 0.0017 0.0004 0.0059 <b>0.0133</b> | 2056 5720 1320 22080 45264 | * 15+2 3+1 0+0 0+0
matrixTranspose.llvm.lib 0.03 0.0005 0.0010 0.0003 0.0032 0.0129 | 4272 1144 736 8560 68448 | * 8+1 5+1 0+0 0+0
hello.llvm.lib 0.03 0.0004 0.0015 0.0001 0.0066 0.0107 | 752 2952 472 6512 14160 | * 2+0 0+0 0+0 0+0
sumarray2d.llvm.lib <b>0.02</b> 0.0005 0.0009 0.0002 0.0034 <b>0.0055</b> | 1568 3584 848 8264 23288 | * 10+1 7+1 0+0 0+0
printargs.llvm.lib <b>0.02</b> 0.0004 0.0013 0.0002 0.0032 0.0058 | 1240 1048 696 5128 19160 | * 6+1 4+1 0+0 0+0
pi.llvm.lib 0.02 0.0008 0.0021 0.0005 0.0052 0.0036 | 5392 1560 1392 8344 36032 | * 17+2 13+2 0+0 0+0
indvars.llvm.lib 0.02 0.0006 0.0010 0.0003 0.0037 0.0036 | 4744 1072 4208 12544 31336 | * 13+1 8+1 0+0 0+0
sumarray.llvm.lib <b>0.01</b> 0.0004 0.0008 0.0002 0.0026 <b>0.0029</b> | 904 3192 624 4720 15152 | * 6+1 4+1 0+0 0+0
</pre><p>
<hr>
<a name="20021111-2"><h2>Nov 11, 2002 #2:</h2>
This is the result after <a
href="http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20021111/001565.html">fixing
some major bugs</a>. The globals list was supposed to be kept sorted, but there
was one minor, tiny, little, bug that caused it to get screwed up sometimes.
This caused vortex to explode, fixing it gets things back in control where you'd
expect. Viola.<p>
This also includes a merging bug that caused some things to be merged and some
other things to happen when they shouldn't, which accounts for folding
reductions.<p>
<pre>
Name: Anlyz: LocTime: BUTime: TDTime: TotTime: BCTime: LocSize: BUSize: TDSize: TotSize: BCSize: NumFold NumNodes main __main GlobGr
254.gap.lib 17.65 0.8186 4.5919 2.3718 9.2483 2.8978 | <b>2024984</b> <b>2984936</b> <b>2025480</b> <b>7035400</b> <b>16554904</b> | <b>6853</b> <b>24032+3950</b> 44+9 0+0 0+0
255.vortex.lib 15.02 0.5766 2.4586 <b>3.5717</b> <b>7.6692</b> 2.2728 | <b>1381056</b> <b>1340216</b> <b>2461232</b> <b>5182504</b> <b>11689312</b> | <b>7127</b> <b>7302+2815</b> 166+11 0+0 0+0
300.twolf.lib 3.23 0.2747 0.2856 0.5057 1.5129 0.9846 | <b>466528</b> <b>391512</b> <b>396552</b> <b>1254592</b> <b>6936728</b> | <b>749</b> <b>4128+784</b> <b>90+53</b> 0+0 0+0
197.parser.lib 1.84 0.1528 0.3458 0.2180 0.8983 0.6469 | <b>408392</b> <b>225312</b> <b>212688</b> <b>965648</b> <b>4447944</b> | <b>1357</b> <b>2257+707</b> 14+6 0+0 0+0
burg.llvm.lib 1.20 0.1017 0.1867 0.1765 0.5525 0.4912 | <b>530600</b> <b>473296</b> <b>185792</b> <b>1189688</b> <b>3040208</b> | <b>756</b> <b>2273+576</b> <b>45+7</b> 0+0 0+0
164.gzip.llvm.lib 0.71 0.0392 0.0649 0.0330 0.2008 0.4263 | <b>145952</b> <b>184776</b> <b>70872</b> <b>499912</b> <b>1876248</b> | 24 971+87 8+2 0+0 0+0
optimizer-eval.llvm.lib 0.42 0.0163 0.0446 0.2063 0.2953 <b>0.0798</b> | <b>101184</b> <b>79456</b> <b>61760</b> <b>242400</b> <b>624688</b> | * 309+41 72+27 0+0 0+0
256.bzip2.lib 0.34 0.0238 0.0491 0.0112 0.1311 0.1543 | <b>139504</b> <b>83400</b> <b>39712</b> <b>335144</b> <b>1373216</b> | * 563+37 8+2 0+0 0+0
181.mcf.lib 0.20 0.0174 0.0267 0.0272 0.0906 0.0744 | <b>115448</b> <b>146520</b> <b>43680</b> <b>322864</b> <b>589440</b> | <b>166</b> <b>388+51</b> <b>22+10</b> 0+0 0+0
sim.llvm.lib 0.19 0.0135 0.0136 0.0130 0.0776 0.0794 | <b>81632</b> <b>51496</b> <b>21872</b> <b>226584</b> <b>734152</b> | * <b>260+35</b> 39+22 0+0 0+0
voronoi.llvm.lib 0.17 0.0137 0.0267 0.0286 0.0829 0.0561 | <b>79824</b> <b>84152</b> <b>27112</b> <b>204904</b> <b>420568</b> | 18 299+77 15+8 0+0 0+0
bh.llvm.lib 0.16 0.0116 0.0161 0.0111 0.0591 0.0675 | <b>75000</b> <b>51080</b> <b>27760</b> <b>217632</b> <b>470720</b> | 61 194+35 6+2 0+0 0+0
sgefa.llvm.lib 0.14 0.0086 0.0201 0.0208 0.0656 0.0517 | <b>85688</b> <b>100456</b> <b>67024</b> <b>277864</b> <b>368680</b> | * 130+24 24+14 0+0 0+0
sumarray2d.llvm.lib <b>0.11</b> 0.0005 0.0009 0.0002 0.0033 <b>0.0922</b> | <b>1568</b> <b>3584</b> <b>848</b> <b>8264</b> <b>23288</b> | * 10+1 7+1 0+0 0+0
health.llvm.lib 0.09 0.0050 0.0082 0.0073 0.0280 0.0419 | <b>30632</b> <b>31432</b> <b>12704</b> <b>89592</b> <b>199888</b> | <b>18</b> <b>97+31</b> <b>12+4</b> 0+0 0+0
em3d.llvm.lib 0.09 0.0058 0.0110 0.0059 0.0304 0.0395 | <b>33040</b> <b>36256</b> <b>13008</b> <b>90632</b> <b>227520</b> | <b>1</b> <b>178+28</b> 12+4 0+0 0+0
power.llvm.lib 0.08 0.0042 0.0067 0.0040 0.0222 0.0365 | <b>27776</b> <b>17688</b> <b>18144</b> <b>71424</b> <b>213760</b> | * 81+18 11+2 0+0 0+0
mst.llvm.lib 0.08 0.0039 0.0072 0.0037 0.0218 0.0306 | <b>18624</b> <b>25576</b> 7040 <b>65808</b> <b>178832</b> | 10 97+15 12+3 0+0 0+0
lists.llvm.lib 0.08 0.0043 0.0137 0.0072 0.0306 0.0283 | <b>24552</b> <b>16920</b> 14440 <b>68024</b> 141480 | 30 67+26 3+1 0+0 0+0
tsp.llvm.lib 0.07 0.0048 0.0066 0.0027 0.0217 0.0327 | <b>18232</b> <b>14336</b> <b>4920</b> <b>51888</b> <b>180744</b> | 21 <b>43+15</b> <b>8+4</b> 0+0 0+0
perimeter.llvm.lib 0.06 0.0031 0.0066 0.0024 0.0194 0.0260 | <b>15016</b> <b>14192</b> <b>3936</b> <b>45912</b> <b>156352</b> | * 35+15 7+4 0+0 0+0
bisort.llvm.lib 0.06 0.0029 0.0056 0.0018 0.0230 0.0229 | <b>13288</b> <b>11408</b> 3712 <b>39448</b> <b>127360</b> | * 35+13 7+4 0+0 0+0
objinst.llvm.lib 0.05 0.0019 0.0048 0.0031 0.0153 0.0174 | <b>11280</b> <b>15784</b> <b>4112</b> <b>45296</b> <b>89856</b> | 34 45+14 16+10 0+0 0+0
methcall.llvm.lib 0.05 0.0017 0.0043 0.0028 0.0135 0.0187 | <b>11008</b> <b>9880</b> <b>3928</b> <b>38624</b> <b>87976</b> | 30 43+12 14+8 0+0 0+0
heapsort.llvm.lib 0.05 0.0009 0.0020 0.0007 0.0074 <b>0.0306</b> | <b>2856</b> <b>6968</b> <b>2008</b> <b>26976</b> <b>63160</b> | * 26+3 7+2 0+0 0+0
hash.llvm.lib 0.05 0.0030 0.0052 0.0040 0.0184 0.0173 | <b>25728</b> <b>16608</b> <b>8208</b> <b>63576</b> <b>151680</b> | * 117+17 14+6 0+0 0+0
sumarraymalloc.llvm.lib 0.04 0.0009 0.0015 0.0009 0.0067 0.0156 | 7040 2672 2048 25872 54352 | * 23+5 7+4 0+0 0+0
random.llvm.lib 0.04 0.0009 0.0018 0.0004 0.0060 0.0223 | 2056 5720 1320 22080 45264 | * 15+2 3+1 0+0 0+0
llubenchmark.llvm.lib 0.04 0.0022 0.0028 0.0015 0.0130 0.0118 | <b>11072</b> <b>11760</b> <b>2624</b> <b>36480</b> <b>124344</b> | * 31+7 15+5 0+0 0+0
ackermann.llvm.lib 0.04 0.0007 0.0015 0.0004 0.0055 0.0230 | 1744 5728 1200 22056 46448 | * 13+2 3+1 0+0 0+0
treeadd.llvm.lib 0.03 0.0015 0.0029 0.0009 0.0090 0.0076 | 3856 7384 2200 29784 72064 | * 25+7 6+3 0+0 0+0
sieve.llvm.lib 0.03 0.0007 0.0013 0.0005 0.0060 0.0140 | 2176 6176 1632 23432 216840 | * 22+2 12+1 0+0 0+0
printargs.llvm.lib 0.03 0.0005 0.0015 0.0002 0.0034 0.0077 | 1240 1048 696 5128 19160 | * 6+1 4+1 0+0 0+0
matrixTranspose.llvm.lib 0.03 0.0005 0.0010 0.0003 0.0032 0.0167 | <b>4272</b> 1144 736 <b>8560</b> <b>68448</b> | * 8+1 5+1 0+0 0+0
matrix.llvm.lib 0.03 0.0013 0.0022 0.0014 0.0092 0.0100 | <b>8808</b> <b>8872</b> <b>3072</b> <b>33144</b> <b>69112</b> | * 38+9 12+8 0+0 0+0
hello.llvm.lib 0.03 0.0004 0.0014 0.0001 0.0067 0.0123 | 752 2952 472 6512 <b>14160</b> | * 2+0 0+0 0+0 0+0
fib2.llvm.lib 0.03 0.0008 0.0015 0.0007 0.0061 <b>0.0135</b> | <b>7960</b> <b>6288</b> <b>1640</b> <b>28408</b> <b>42256</b> | * 21+5 8+3 0+0 0+0
ary3.llvm.lib 0.03 0.0012 0.0020 0.0011 0.0086 0.0084 | <b>10240</b> <b>13104</b> <b>10888</b> <b>45832</b> 73064 | 6 44+5 12+3 0+0 0+0
sumarray.llvm.lib 0.02 0.0003 0.0009 0.0002 0.0028 <b>0.0114</b> | 904 3192 624 4720 15152 | * 6+1 4+1 0+0 0+0
pi.llvm.lib 0.02 0.0008 0.0020 0.0004 0.0050 0.0037 | 5392 1560 1392 8344 36032 | * 17+2 13+2 0+0 0+0
indvars.llvm.lib 0.02 <b>0.0005</b> 0.0009 0.0003 0.0035 0.0035 | <b>4744</b> <b>1072</b> <b>4208</b> <b>12544</b> 31336 | * 13+1 8+1 0+0 0+0
</pre><p>
<hr>
<a name="20021111"><h2>Nov 11, 2002:</h2>
This is the first successful run of all of the benchmarks! This is still
compiled in debug mode, still has lots of tweaks and minor improvements that
could be made, lots of optimizations even, but they will have to wait for a
bit.<p>
Also note that we now include time taken the parse the bytecode file into LLVM
IR, and the space used by the LLVM IR.<p>
<pre>
Name: Anlyz: LocTime: BUTime: TDTime: TotTime: BCTime: LocSize: BUSize: TDSize: TotSize: BCSize: NumFold NumNodes main __main GlobGr
255.vortex.lib <b>24.44</b> <b>0.5896</b> <b>2.7741</b> <b>11.5906</b> <b>16.5760</b> <b>2.3257</b> | <b>1381816</b> <b>1338688</b> <b>14822760</b> <b>17543264</b> <b>11691568</b> | <b>7288</b> <b>7321+3135</b> <b>166+11</b> <b>0+0</b> <b>0+0</b>
254.gap.lib 19.51 0.8708 4.6071 3.5835 10.6354 2.9075 | 2024600 <b>3155592</b> <b>2323136</b> <b>7503328</b> 16555920 | <b>6934</b> <b>24027+3950</b> <b>44+9</b> 0+0 0+0
300.twolf.lib 3.38 0.2753 0.2930 0.5233 1.5807 0.9966 | 466248 <b>392352</b> <b>398296</b> <b>1256896</b> 6936800 | <b>765</b> <b>4129+784</b> <b>91+53</b> 0+0 0+0
197.parser.lib 1.89 0.1478 0.3243 0.2178 0.8755 0.6667 | 408560 <b>224928</b> <b>213736</b> <b>966696</b> 4451256 | <b>1350</b> <b>2259+711</b> <b>14+6</b> 0+0 0+0
burg.llvm.lib 1.23 0.1039 0.1877 0.1779 0.5589 0.4972 | 530224 <b>471200</b> <b>183504</b> <b>1184928</b> 3039960 | <b>790</b> <b>2239+575</b> <b>42+7</b> 0+0 0+0
164.gzip.llvm.lib 0.71 0.0408 0.0578 0.0332 0.1965 0.4323 | 201664 <b>128768</b> <b>70864</b> <b>498912</b> 1870880 | 24 <b>971+87</b> <b>8+2</b> 0+0 0+0
optimizer-eval.llvm.lib 0.51 0.0166 0.0480 0.2086 0.3041 <b>0.1716</b> | 81584 <b>78352</b> <b>60304</b> <b>238616</b> 620296 | * <b>309+41</b> <b>72+27</b> 0+0 0+0
256.bzip2.lib 0.33 0.0240 0.0383 0.0114 0.1214 0.1565 | 139536 <b>84224</b> <b>39704</b> <b>335680</b> 1370784 | * <b>563+37</b> <b>8+2</b> 0+0 0+0
181.mcf.lib 0.22 0.0184 0.0286 0.0287 0.0959 0.0874 | 111384 <b>145792</b> <b>43360</b> <b>317776</b> 589808 | <b>156</b> <b>393+51</b> <b>23+10</b> 0+0 0+0
sim.llvm.lib 0.20 0.0136 0.0137 0.0130 0.0792 0.0848 | 55376 <b>81000</b> <b>21960</b> <b>253344</b> 721520 | * <b>261+36</b> <b>39+22</b> 0+0 0+0
voronoi.llvm.lib 0.17 0.0135 0.0262 0.0289 0.0833 0.0553 | 79696 <b>87968</b> <b>27128</b> <b>208568</b> 419920 | 18 <b>299+77</b> <b>15+8</b> 0+0 0+0
bh.llvm.lib 0.16 0.0116 0.0164 0.0118 0.0590 0.0665 | 55864 71416 27432 219376 473840 | 61 194+35 6+2 0+0 0+0
sgefa.llvm.lib 0.15 0.0089 0.0222 0.0246 0.0720 0.0530 | 85904 82240 67064 260872 364520 | * 130+24 24+14 0+0 0+0
health.llvm.lib 0.10 0.0050 0.0096 0.0055 0.0275 0.0450 | 29880 27920 7608 73008 199064 | 71 79+29 10+4 0+0 0+0
tsp.llvm.lib 0.08 0.0049 0.0072 0.0027 0.0224 0.0350 | 25704 14472 4872 52216 176600 | 21 42+15 7+4 0+0 0+0
power.llvm.lib 0.08 0.0041 0.0067 0.0037 0.0222 0.0361 | 28512 17760 7848 61960 214128 | * 81+18 11+2 0+0 0+0
em3d.llvm.lib 0.08 0.0060 0.0113 0.0055 0.0312 0.0315 | 24280 32960 12536 86576 224616 | 13 172+25 12+4 0+0 0+0
perimeter.llvm.lib 0.07 0.0031 0.0069 0.0020 0.0196 0.0261 | 14936 14112 3928 45592 155208 | * 35+15 7+4 0+0 0+0
mst.llvm.lib 0.07 0.0039 0.0067 0.0037 0.0216 0.0285 | 27408 16752 7040 66048 178328 | 10 97+15 12+3 0+0 0+0
lists.llvm.lib 0.07 0.0043 0.0128 0.0072 0.0299 0.0276 | 24544 16912 14440 68008 141480 | 30 67+26 3+1 0+0 0+0
hash.llvm.lib 0.06 0.0030 0.0051 0.0054 0.0202 0.0186 | 17936 24808 8216 64232 153552 | * 117+17 14+6 0+0 0+0
methcall.llvm.lib 0.05 0.0017 0.0047 0.0029 0.0142 0.0174 | 10984 9856 9144 44000 87328 | 30 43+12 14+8 0+0 0+0
objinst.llvm.lib 0.04 0.0019 0.0042 0.0033 0.0147 0.0114 | 11072 15328 10536 50496 87064 | 34 45+14 16+10 0+0 0+0
matrix.llvm.lib 0.04 0.0012 0.0021 0.0016 0.0094 <b>0.0164</b> | 8720 8784 3048 36600 68048 | * 38+9 12+8 0+0 0+0
llubenchmark.llvm.lib 0.04 0.0021 0.0027 0.0014 0.0130 0.0117 | 4728 <b>9368</b> <b>2608</b> <b>33440</b> 122712 | * 31+7 15+5 0+0 0+0
bisort.llvm.lib 0.04 0.0029 0.0056 0.0019 0.0160 0.0125 | 13608 11744 3712 45984 126584 | * 35+13 7+4 0+0 0+0
ary3.llvm.lib 0.04 0.0012 0.0020 0.0011 0.0088 0.0138 | 8648 19856 2976 43080 73064 | 6 44+5 12+3 0+0 0+0
ackermann.llvm.lib 0.04 0.0007 0.0017 0.0004 0.0058 <b>0.0226</b> | 1744 5728 1200 22056 46448 | * 13+2 3+1 0+0 0+0
treeadd.llvm.lib 0.03 0.0014 0.0029 0.0009 0.0090 0.0077 | 3856 7384 2200 29784 72064 | * 25+7 6+3 0+0 0+0
sumarraymalloc.llvm.lib 0.03 0.0009 <b>0.0017</b> 0.0009 0.0069 0.0100 | 7040 2672 2048 25872 54352 | * 23+5 7+4 0+0 0+0
sieve.llvm.lib 0.03 0.0007 0.0012 0.0005 0.0060 0.0138 | 2176 6176 1632 23432 216840 | * 22+2 12+1 0+0 0+0
random.llvm.lib 0.03 0.0008 0.0018 0.0004 0.0060 <b>0.0137</b> | 2056 5720 1320 22080 45264 | * 15+2 3+1 0+0 0+0
matrixTranspose.llvm.lib 0.03 0.0005 0.0010 0.0003 0.0033 <b>0.0151</b> | 4248 1144 736 8520 68104 | * 8+1 5+1 0+0 0+0
hello.llvm.lib <b>0.03</b> 0.0004 0.0018 0.0001 <b>0.0064</b> <b>0.0105</b> | 752 2952 472 6512 12264 | * 2+0 0+0 0+0 0+0
heapsort.llvm.lib 0.03 0.0009 0.0020 0.0007 0.0074 0.0080 | 7448 7224 1992 28032 62704 | * 26+3 7+2 0+0 0+0
sumarray2d.llvm.lib 0.02 0.0005 0.0009 0.0002 0.0033 0.0030 | 4208 856 3656 10904 21968 | * 10+1 7+1 0+0 0+0
printargs.llvm.lib 0.02 0.0004 0.0014 0.0002 0.0033 <b>0.0061</b> | 1240 1048 696 5128 19160 | * 6+1 4+1 0+0 0+0
pi.llvm.lib 0.02 0.0007 0.0019 0.0004 0.0050 0.0037 | 5392 1560 1392 8344 36032 | * 17+2 13+2 0+0 0+0
indvars.llvm.lib 0.02 <b>0.0011</b> 0.0010 0.0003 0.0043 0.0035 | 1744 4088 1024 9696 31336 | * 13+1 8+1 0+0 0+0
fib2.llvm.lib 0.02 0.0008 0.0015 0.0007 0.0061 0.0050 | 2416 10376 1648 30088 43792 | * 21+5 8+3 0+0 0+0
sumarray.llvm.lib 0.01 <b>0.0003</b> 0.0009 0.0002 0.0027 0.0022 | 904 3192 624 4720 15152 | * 6+1 4+1 0+0 0+0
</pre><p>
<hr>
<a name="20021110"><h2>Nov 10, 2002:</h2>
This data set has the prototype Tarjan SCC code in to help with cases that were
causing exponential behavior. This gets Gap working, but Vortex is still either
infinite looping or really slow. I'm almost certain there are a couple of bugs
still remaining in the implementation, so these should be regarded as
preliminary numbers.<p>
Here is some trivia for you: Vortex contains a SCC with 38 nodes, and another
with 19. Gap contains SCCs of size 2, 2, 20, 6, 2.<p>
Also note that the bytecode file for GAP is 3x the size of the bytecode file for
twolf.<p>
<pre>
Name: Anlyz: LocTime: BUTime: TDTime: TotTime: BCTime: LocSize: BUSize: TDSize: TotSize: BCSize: NumFold NumNodes main __main GlobGr
255.vortex.lib <b>7.56</b> * * * * * | * * * * * | * * * * *
254.gap.lib <b>22.53</b> <b>0.8908</b> <b>7.0430</b> <b>3.2424</b> <b>12.8506</b> <b>3.1879</b> | <b>2024600</b> <b>5229888</b> <b>3882656</b> <b>11137144</b> <b>16555920</b> | <b>6959</b> <b>42275+3949</b> <b>59+9</b> <b>0+0</b> <b>0+0</b>
300.twolf.lib 3.92 0.3259 0.3470 0.8163 2.0253 1.0287 | <b>466248</b> <b>405936</b> <b>456456</b> <b>1328640</b> <b>6936800</b> | <b>821</b> <b>4119+784</b> <b>90+53</b> 0+0 0+0
197.parser.lib 2.23 0.1939 <b>0.4020</b> 0.2499 1.0864 0.7768 | 408560 <b>229568</b> <b>220672</b> <b>978272</b> 4451256 | <b>1362</b> <b>2272+704</b> <b>16+6</b> 0+0 0+0
burg.llvm.lib 1.28 0.1085 0.1942 0.1954 0.5911 0.5072 | 530224 <b>477440</b> <b>290376</b> <b>1298040</b> 3039960 | <b>796</b> <b>2248+575</b> <b>39+7</b> 0+0 0+0
164.gzip.llvm.lib 0.67 0.0392 0.0506 0.0326 0.1873 0.4044 | 201664 <b>130312</b> <b>72000</b> <b>501592</b> 1870880 | 24 <b>988+87</b> <b>12+2</b> 0+0 0+0
optimizer-eval.llvm.lib 0.43 0.0172 0.0570 0.2122 0.3200 0.0725 | 81584 <b>78640</b> <b>60384</b> <b>238984</b> 620296 | * <b>299+41</b> <b>62+27</b> 0+0 0+0
256.bzip2.lib 0.34 0.0250 <b>0.0374</b> 0.0117 0.1242 0.1508 | 139536 <b>84856</b> <b>40208</b> <b>336816</b> 1370784 | * <b>569+37</b> <b>12+2</b> 0+0 0+0
181.mcf.lib 0.23 0.0304 0.0296 0.0438 0.1255 0.0685 | 111384 <b>145928</b> <b>38568</b> <b>313120</b> 589808 | <b>161</b> <b>384+51</b> <b>27+10</b> 0+0 0+0
sim.llvm.lib 0.22 0.0138 0.0162 0.0146 0.0850 0.0891 | 55376 <b>81680</b> <b>21784</b> <b>253848</b> 721520 | * <b>259+36</b> <b>37+22</b> 0+0 0+0
voronoi.llvm.lib 0.20 0.0140 0.0311 0.0293 0.0962 0.0547 | 79696 <b>85176</b> <b>27272</b> <b>205920</b> 419920 | 18 <b>294+76</b> <b>17+8</b> 0+0 0+0
sgefa.llvm.lib 0.17 0.0088 0.0250 0.0223 0.0730 0.0615 | 85904 <b>82240</b> <b>67064</b> <b>260872</b> 364520 | * 130+24 24+14 0+0 0+0
bh.llvm.lib 0.15 0.0120 0.0173 0.0126 0.0614 0.0548 | 55864 <b>71416</b> <b>27432</b> <b>219376</b> 473840 | 61 194+35 6+2 0+0 0+0
em3d.llvm.lib 0.09 0.0066 0.0111 0.0088 0.0350 0.0284 | 24280 <b>32960</b> <b>12536</b> <b>86576</b> 224616 | <b>13</b> <b>172+25</b> 12+4 0+0 0+0
health.llvm.lib 0.08 0.0052 0.0098 0.0062 0.0287 0.0330 | 29880 <b>27920</b> <b>7608</b> <b>73008</b> 199064 | 71 79+29 10+4 0+0 0+0
mst.llvm.lib 0.07 0.0048 <b>0.0068</b> 0.0056 0.0266 0.0218 | 27408 <b>16752</b> <b>7040</b> <b>66048</b> 178328 | 10 97+15 12+3 0+0 0+0
tsp.llvm.lib 0.06 0.0049 <b>0.0069</b> 0.0026 0.0222 0.0212 | 25704 <b>14472</b> <b>4872</b> <b>52216</b> 176600 | 21 42+15 7+4 0+0 0+0
power.llvm.lib 0.06 0.0042 <b>0.0065</b> 0.0036 0.0217 0.0214 | 28512 <b>17760</b> <b>7848</b> <b>61960</b> 214128 | * 81+18 11+2 0+0 0+0
lists.llvm.lib 0.06 0.0042 0.0113 0.0071 0.0293 0.0146 | 24544 <b>16912</b> <b>14440</b> <b>68008</b> 141480 | 30 67+26 3+1 0+0 0+0
perimeter.llvm.lib 0.05 0.0030 0.0058 0.0020 0.0186 0.0161 | 14936 <b>14112</b> <b>3928</b> <b>45592</b> 155208 | * 35+15 7+4 0+0 0+0
methcall.llvm.lib 0.05 0.0017 <b>0.0042</b> 0.0028 0.0137 0.0099 | 10984 <b>9856</b> <b>9144</b> <b>44000</b> 87328 | 30 43+12 14+8 0+0 0+0
hash.llvm.lib 0.05 0.0031 0.0050 0.0039 0.0187 0.0163 | 17936 <b>24808</b> <b>8216</b> <b>64232</b> 153552 | * 117+17 14+6 0+0 0+0
bisort.llvm.lib 0.05 0.0048 <b>0.0053</b> 0.0018 0.0188 0.0125 | 13608 <b>11744</b> <b>3712</b> <b>45984</b> 126584 | * 35+13 7+4 0+0 0+0
objinst.llvm.lib 0.04 0.0018 <b>0.0044</b> 0.0032 0.0163 0.0103 | 11072 <b>15328</b> <b>10536</b> <b>50496</b> 87064 | <b>34</b> 45+14 16+10 0+0 0+0
llubenchmark.llvm.lib 0.04 0.0021 <b>0.0022</b> 0.0014 0.0125 0.0124 | 4728 <b>9520</b> <b>2624</b> <b>33608</b> 122712 | * 31+7 15+5 0+0 0+0
treeadd.llvm.lib 0.03 0.0015 <b>0.0024</b> 0.0009 0.0085 0.0077 | 3856 <b>7384</b> <b>2200</b> <b>29784</b> 72064 | * 25+7 6+3 0+0 0+0
sumarraymalloc.llvm.lib 0.03 0.0009 <b>0.0035</b> 0.0009 0.0088 0.0058 | 7040 <b>2672</b> <b>2048</b> <b>25872</b> 54352 | * 23+5 7+4 0+0 0+0
sieve.llvm.lib 0.03 0.0007 <b>0.0011</b> 0.0005 0.0060 0.0144 | 2176 <b>6176</b> <b>1632</b> <b>23432</b> 216840 | * 22+2 12+1 0+0 0+0
random.llvm.lib 0.03 0.0008 <b>0.0016</b> 0.0004 0.0063 0.0050 | 2056 <b>5720</b> <b>1320</b> <b>22080</b> 45264 | * 15+2 3+1 0+0 0+0
matrix.llvm.lib 0.03 0.0012 0.0021 0.0014 0.0093 0.0081 | 8720 <b>8784</b> <b>3048</b> <b>36600</b> 68048 | * 38+9 12+8 0+0 0+0
heapsort.llvm.lib 0.03 0.0010 <b>0.0018</b> 0.0006 0.0084 0.0064 | 7448 <b>7224</b> <b>1992</b> <b>28032</b> 62704 | * 26+3 7+2 0+0 0+0
fib2.llvm.lib 0.03 0.0008 <b>0.0016</b> 0.0007 0.0063 0.0048 | 2416 <b>10376</b> <b>1648</b> <b>30088</b> 43792 | * 21+5 8+3 0+0 0+0
ary3.llvm.lib 0.03 0.0012 0.0019 0.0011 0.0086 0.0073 | 8648 <b>19856</b> <b>2976</b> <b>43080</b> 73064 | 6 44+5 12+3 0+0 0+0
sumarray2d.llvm.lib 0.02 0.0004 <b>0.0008</b> 0.0003 0.0031 0.0029 | 4208 856 3656 10904 21968 | * 10+1 7+1 0+0 0+0
printargs.llvm.lib 0.02 0.0005 <b>0.0012</b> 0.0002 0.0031 0.0024 | 1240 <b>1048</b> <b>696</b> <b>5128</b> 19160 | * 6+1 4+1 0+0 0+0
pi.llvm.lib 0.02 0.0007 <b>0.0015</b> 0.0004 0.0050 0.0035 | 5392 <b>1560</b> <b>1392</b> <b>8344</b> 36032 | * 17+2 13+2 0+0 0+0
matrixTranspose.llvm.lib 0.02 0.0006 <b>0.0011</b> 0.0003 0.0036 0.0051 | 4248 <b>1144</b> <b>736</b> 8520 68104 | * 8+1 5+1 0+0 0+0
indvars.llvm.lib 0.02 0.0005 <b>0.0009</b> 0.0003 0.0035 0.0037 | 1744 4088 <b>1024</b> <b>9696</b> 31336 | * 13+1 8+1 0+0 0+0
ackermann.llvm.lib 0.02 0.0008 <b>0.0014</b> 0.0004 0.0056 0.0060 | 1744 <b>5728</b> <b>1200</b> <b>22056</b> 46448 | * 13+2 3+1 0+0 0+0
sumarray.llvm.lib 0.01 <b>0.0014</b> <b>0.0008</b> 0.0002 0.0036 0.0021 | 904 <b>3192</b> 624 <b>4720</b> 15152 | * 6+1 4+1 0+0 0+0
hello.llvm.lib 0.01 0.0004 <b>0.0015</b> 0.0001 0.0028 0.0019 | 752 2952 472 6512 12264 | * 2+0 0+0 0+0 0+0
</pre><p>
<hr>
<a name="20021109-2"><h2>Nov 9, 2002 #2:</h2>
This has the first part of the globals graph implemented, this simply deletes
the nodes that should be moved to the globals graph, without saving them and
then later merging them back in (The GlobGr size indicates the size of the
globals graph: right now it is empty, this will be fixed in the future). From
this we can get some <b>best case</b> times that the final algorithm will not be
able to match, but it is interesting to see badly how the N<sup>2</sup> case
hurts the TD pass.<p>
Note that I now know that gap and vortex are not working because of an infinite
loop in the algorithm, now that this is identified, hopefully it will be fixed
shortly.<p>
Note that these numbers are still with a debug build. Compiling with
optimizations and without assertions improves run time 3-4x.<p>
<pre>
Name: Anlyz: LocTime: BUTime: TDTime: TotTime: LocSize: BUSize: TDSize: TotSize: NumFold NumNodes main __main GlobGr
254.gap.lib 4.92 * * * * | * * * * | * * * * *
255.vortex.lib 2.78 * * * * | * * * * | * * * * *
300.twolf.lib <b>3.50</b> 0.2890 <b>0.3094</b> <b>0.5272</b> <b>1.6337</b> | <b>487976</b> <b>434248</b> <b>418472</b> <b>1340696</b> | <b>794</b> <b>4223+808</b> <b>88+45</b> <b>0+0</b> 0+0
197.parser.lib <b>1.70</b> 0.1517 <b>0.1978</b> <b>0.2152</b> <b>0.7588</b> | <b>408560</b> <b>243688</b> <b>213776</b> <b>985496</b> | <b>1327</b> <b>2257+706</b> <b>14+6</b> <b>0+0</b> 0+0
burg.llvm.lib <b>1.14</b> 0.1056 <b>0.1296</b> <b>0.1720</b> <b>0.5084</b> | <b>530224</b> <b>478880</b> <b>179080</b> <b>1188184</b> | <b>722</b> <b>2167+577</b> <b>30+7</b> <b>0+0</b> 0+0
164.gzip.llvm.lib 0.65 0.0406 <b>0.0256</b> <b>0.0328</b> <b>0.1651</b> | <b>201664</b> <b>129304</b> <b>70864</b> <b>499448</b> | <b>24</b> <b>971+87</b> <b>8+2</b> <b>0+0</b> 0+0
optimizer-eval.llvm.lib 0.40 0.0170 <b>0.0366</b> 0.2099 0.3047 | <b>81584</b> <b>79352</b> <b>62232</b> <b>241544</b> | * <b>309+41</b> <b>72+27</b> <b>0+0</b> 0+0
256.bzip2.lib <b>0.29</b> 0.0249 <b>0.0107</b> <b>0.0112</b> <b>0.0943</b> | <b>139536</b> <b>84752</b> <b>39720</b> <b>336224</b> | <b>*</b> <b>563+37</b> <b>8+2</b> <b>0+0</b> 0+0
181.mcf.lib 0.20 0.0185 0.0247 <b>0.0285</b> 0.1042 | <b>111384</b> <b>145912</b> <b>43544</b> <b>318080</b> | <b>156</b> <b>393+51</b> <b>23+10</b> <b>0+0</b> 0+0
sim.llvm.lib 0.18 0.0143 0.0106 <b>0.0129</b> 0.0765 | <b>55376</b> <b>83072</b> <b>21968</b> <b>255424</b> | * <b>261+36</b> <b>39+22</b> <b>0+0</b> 0+0
voronoi.llvm.lib 0.15 0.0152 0.0203 0.0309 0.0807 | <b>79696</b> <b>87280</b> <b>27336</b> <b>208088</b> | <b>18</b> <b>299+77</b> <b>15+8</b> <b>0+0</b> 0+0
bh.llvm.lib 0.13 0.0120 0.0100 <b>0.0110</b> 0.0506 | <b>55864</b> <b>72480</b> <b>27632</b> <b>220640</b> | <b>61</b> <b>194+35</b> <b>6+2</b> <b>0+0</b> 0+0
sgefa.llvm.lib 0.12 0.0088 <b>0.0165</b> <b>0.0199</b> 0.0616 | <b>85904</b> <b>82032</b> <b>67032</b> <b>260632</b> | * <b>130+24</b> <b>24+14</b> <b>0+0</b> 0+0
health.llvm.lib 0.07 0.0051 0.0065 0.0054 0.0243 | <b>29880</b> <b>31328</b> <b>7816</b> <b>76624</b> | 71 <b>79+29</b> <b>10+4</b> <b>0+0</b> 0+0
em3d.llvm.lib 0.07 0.0059 0.0058 <b>0.0058</b> 0.0254 | <b>24280</b> <b>33360</b> <b>13344</b> <b>87784</b> | <b>10</b> <b>179+27</b> <b>12+4</b> <b>0+0</b> 0+0
power.llvm.lib 0.06 0.0043 0.0029 0.0051 0.0197 | <b>28512</b> <b>17808</b> <b>8008</b> <b>62168</b> | * <b>81+18</b> <b>11+2</b> <b>0+0</b> 0+0
tsp.llvm.lib 0.05 0.0051 0.0031 <b>0.0027</b> 0.0185 | <b>25704</b> <b>14576</b> <b>5040</b> <b>52488</b> | <b>21</b> <b>42+15</b> <b>7+4</b> <b>0+0</b> 0+0
perimeter.llvm.lib 0.05 0.0030 0.0036 0.0020 0.0163 | <b>14936</b> <b>22008</b> <b>4296</b> <b>53856</b> | * <b>35+15</b> <b>7+4</b> <b>0+0</b> 0+0
mst.llvm.lib 0.05 0.0051 0.0033 <b>0.0038</b> 0.0193 | <b>27408</b> <b>16880</b> <b>7216</b> <b>66352</b> | 10 <b>97+15</b> <b>12+3</b> <b>0+0</b> 0+0
lists.llvm.lib 0.05 0.0042 0.0058 0.0071 0.0227 | <b>24544</b> <b>17384</b> <b>13696</b> <b>67736</b> | <b>30</b> <b>67+26</b> <b>3+1</b> <b>0+0</b> 0+0
hash.llvm.lib 0.05 0.0030 0.0033 0.0041 0.0168 | <b>17936</b> <b>25000</b> <b>8544</b> <b>64752</b> | * <b>117+17</b> <b>14+6</b> <b>0+0</b> 0+0
objinst.llvm.lib 0.04 0.0018 0.0018 0.0033 0.0122 | <b>11072</b> <b>16344</b> <b>12040</b> <b>53016</b> | <b>35</b> <b>45+14</b> <b>16+10</b> <b>0+0</b> 0+0
methcall.llvm.lib 0.04 0.0017 0.0015 0.0029 0.0111 | <b>10984</b> <b>9816</b> <b>11880</b> <b>46696</b> | <b>30</b> <b>43+12</b> <b>14+8</b> <b>0+0</b> 0+0
llubenchmark.llvm.lib 0.04 0.0021 <b>0.0010</b> <b>0.0015</b> 0.0115 | <b>4728</b> <b>9384</b> <b>2808</b> <b>33656</b> | * <b>31+7</b> <b>15+5</b> <b>0+0</b> 0+0
bisort.llvm.lib 0.04 0.0029 0.0022 <b>0.0019</b> 0.0128 | <b>13608</b> <b>11840</b> <b>3888</b> <b>46256</b> | * <b>35+13</b> <b>7+4</b> <b>0+0</b> 0+0
treeadd.llvm.lib 0.03 0.0014 0.0009 0.0010 0.0071 | <b>3856</b> <b>12496</b> <b>2392</b> <b>35088</b> | * <b>25+7</b> <b>6+3</b> <b>0+0</b> 0+0
sumarraymalloc.llvm.lib 0.03 0.0009 0.0008 0.0010 0.0063 | <b>7040</b> <b>2192</b> <b>2656</b> <b>26000</b> | * <b>23+5</b> <b>7+4</b> <b>0+0</b> 0+0
sieve.llvm.lib 0.03 0.0007 0.0005 0.0006 0.0063 | <b>2176</b> <b>5832</b> <b>1968</b> <b>23424</b> | * <b>22+2</b> <b>12+1</b> <b>0+0</b> 0+0
matrixTranspose.llvm.lib <b>0.03</b> 0.0005 0.0002 0.0003 0.0026 | <b>4248</b> <b>792</b> <b>1088</b> <b>8520</b> | * <b>8+1</b> <b>5+1</b> <b>0+0</b> 0+0
matrix.llvm.lib 0.03 0.0013 0.0013 0.0015 0.0085 | <b>8720</b> <b>8704</b> <b>3416</b> <b>36888</b> | * <b>38+9</b> <b>12+8</b> <b>0+0</b> 0+0
ary3.llvm.lib 0.03 0.0012 0.0012 0.0012 0.0078 | <b>8648</b> <b>14136</b> <b>3328</b> <b>37712</b> | 6 <b>44+5</b> <b>12+3</b> <b>0+0</b> 0+0
random.llvm.lib 0.02 0.0008 0.0004 0.0005 0.0047 | <b>2056</b> <b>4720</b> <b>1656</b> <b>21416</b> | * <b>15+2</b> <b>3+1</b> <b>0+0</b> 0+0
pi.llvm.lib 0.02 0.0007 0.0003 <b>0.0005</b> 0.0036 | <b>5392</b> <b>1384</b> <b>4768</b> <b>11544</b> | * <b>17+2</b> <b>13+2</b> <b>0+0</b> 0+0
hello.llvm.lib 0.02 0.0004 <b>0.0001</b> <b>0.0001</b> 0.0015 | <b>752</b> <b>2952</b> <b>472</b> <b>6512</b> | * <b>2+0</b> <b>0+0</b> <b>0+0</b> 0+0
heapsort.llvm.lib 0.02 0.0009 0.0006 0.0007 0.0062 | <b>7448</b> <b>6864</b> <b>2360</b> <b>28040</b> | * <b>26+3</b> <b>7+2</b> <b>0+0</b> 0+0
fib2.llvm.lib 0.02 0.0008 0.0007 0.0007 0.0055 | <b>2416</b> <b>5680</b> <b>2000</b> <b>25744</b> | * <b>21+5</b> <b>8+3</b> <b>0+0</b> 0+0
ackermann.llvm.lib <b>0.02</b> <b>0.0007</b> <b>0.0004</b> <b>0.0005</b> <b>0.0046</b> | <b>1744</b> <b>5368</b> <b>1552</b> <b>22048</b> | * <b>13+2</b> <b>3+1</b> <b>0+0</b> 0+0
sumarray.llvm.lib 0.01 0.0003 0.0002 0.0002 0.0021 | <b>904</b> <b>2232</b> <b>624</b> <b>3760</b> | * <b>6+1</b> <b>4+1</b> 0+0 0+0
sumarray2d.llvm.lib 0.01 0.0004 0.0002 0.0003 0.0026 | <b>4208</b> <b>856</b> <b>3656</b> <b>10904</b> | * <b>10+1</b> <b>7+1</b> <b>0+0</b> 0+0
printargs.llvm.lib 0.01 0.0004 0.0002 0.0003 0.0023 | <b>1240</b> <b>704</b> <b>1064</b> <b>5152</b> | * <b>6+1</b> <b>4+1</b> <b>0+0</b> 0+0
indvars.llvm.lib 0.01 0.0005 0.0003 0.0003 0.0030 | <b>1744</b> <b>4088</b> <b>1032</b> <b>9704</b> | * <b>13+1</b> <b>8+1</b> <b>0+0</b> 0+0
</pre><p>
<hr>
<a name="20021109-1"><h2>Nov 9, 2002:</h2>
Same as the <a href="#20021108-3">previous run</a>, but now with a small tweak:
constants are never put into the scalar map for a function. This is in
preparation for the global graph work, but it does speed analysis up
marginally:<p>
<pre>
Name: Anlyz: LocTime: BUTime: TDTime: TotTime: LocSize: BUSize: TDSize: TotSize: NumFold NumNodes main __main
254.gap.lib 2.16 * * * * | * * * * | * * * *
255.vortex.lib 1.11 * * * * | * * * * | * * * *
300.twolf.lib 11.63 0.2468 0.7464 7.5333 9.2461 | <b>595576</b> <b>795896</b> <b>10397040</b> <b>11788512</b> | <b>3577</b> <b>161901+1222</b> 854+0 854+0
197.parser.lib 10.97 0.1258 0.4903 8.6508 9.5864 | <b>464920</b> <b>621904</b> <b>12987664</b> <b>14309904</b> | <b>2643</b> <b>197546+1185</b> 601+0 601+0
burg.llvm.lib 5.18 0.0904 0.2948 3.7480 4.3338 | <b>576064</b> <b>893240</b> <b>4821880</b> <b>6356592</b> | <b>1557</b> <b>72659+919</b> 436+0 436+0
164.gzip.llvm.lib 1.28 0.0355 0.1037 0.5037 0.7448 | <b>228456</b> <b>511192</b> <b>1971048</b> <b>2809016</b> | <b>70</b> <b>16642+233</b> 171+0 171+0
256.bzip2.lib 0.69 0.0201 0.0535 0.3301 0.4626 | <b>163016</b> <b>284360</b> <b>1450312</b> <b>1970944</b> | 20 <b>11464+202</b> 148+0 148+0
optimizer-eval.llvm.lib 0.57 0.0195 0.0846 0.3000 0.4423 | <b>86832</b> <b>180296</b> <b>702840</b> <b>988152</b> | * 3693+101 63+0 63+0
sim.llvm.lib 0.26 0.0137 0.0195 0.0619 0.1439 | <b>92280</b> <b>106632</b> <b>330888</b> <b>602464</b> | * <b>2738+67</b> 99+0 99+0
181.mcf.lib 0.23 0.0164 0.0294 0.0572 0.1265 | <b>133872</b> <b>128088</b> <b>229576</b> <b>508384</b> | <b>180</b> <b>1923+73</b> 44+0 44+0
voronoi.llvm.lib 0.19 0.0119 0.0245 0.0606 0.1138 | <b>83592</b> <b>93192</b> <b>211920</b> <b>402648</b> | 17 <b>1734+106</b> 30+0 30+0
sgefa.llvm.lib 0.17 0.0071 0.0333 0.0406 0.0994 | <b>88880</b> <b>102320</b> <b>133176</b> <b>349144</b> | * 634+55 31+0 31+0
bh.llvm.lib 0.15 0.0102 0.0154 0.0239 0.0697 | <b>77528</b> <b>80672</b> <b>110160</b> <b>316400</b> | 66 <b>716+64</b> 13+0 13+0
em3d.llvm.lib 0.09 0.0045 0.0105 0.0229 0.0477 | <b>37816</b> <b>55256</b> <b>123168</b> <b>232944</b> | <b>8</b> <b>1032+59</b> 28+0 28+0
mst.llvm.lib 0.07 0.0033 0.0056 0.0115 0.0310 | <b>30744</b> <b>21600</b> <b>62072</b> <b>129088</b> | 10 <b>471+36</b> 21+0 21+0
health.llvm.lib 0.07 0.0042 0.0080 0.0105 0.0313 | <b>31520</b> <b>31784</b> <b>45624</b> <b>123896</b> | 71 <b>362+40</b> 14+0 14+0
tsp.llvm.lib 0.06 0.0046 0.0047 0.0060 0.0240 | <b>19552</b> <b>26040</b> <b>25800</b> <b>85696</b> | 19 <b>248+31</b> 10+0 10+0
power.llvm.lib 0.06 0.0034 0.0050 0.0086 0.0254 | <b>30904</b> <b>31232</b> <b>29704</b> <b>99512</b> | * 277+35 9+0 9+0
perimeter.llvm.lib 0.05 0.0025 0.0044 0.0037 0.0195 | <b>15760</b> <b>24296</b> <b>8552</b> <b>61448</b> | * <b>106+24</b> 4+0 4+0
lists.llvm.lib 0.05 0.0037 0.0075 0.0105 0.0283 | <b>25912</b> <b>29360</b> <b>28352</b> <b>101472</b> | 50 <b>252+34</b> 10+0 10+0
hash.llvm.lib 0.05 0.0025 0.0040 0.0059 0.0194 | <b>18464</b> <b>25408</b> <b>24192</b> <b>81464</b> | * <b>242+23</b> 7+0 7+0
llubenchmark.llvm.lib 0.04 0.0017 0.0022 0.0038 0.0198 | <b>12040</b> <b>13368</b> <b>17600</b> <b>54016</b> | * <b>145+20</b> 15+0 15+0
bisort.llvm.lib 0.04 0.0024 0.0035 0.0051 0.0176 | <b>14648</b> <b>28160</b> <b>22256</b> <b>76136</b> | * <b>211+27</b> 10+0 10+0
treeadd.llvm.lib 0.03 0.0011 0.0015 0.0020 0.0090 | <b>9320</b> <b>8552</b> <b>10120</b> <b>44152</b> | * <b>77+14</b> 5+0 5+0
sieve.llvm.lib 0.03 0.0006 0.0006 0.0008 0.0063 | <b>8032</b> <b>1720</b> <b>2552</b> <b>22672</b> | * <b>31+4</b> 2+0 2+0
objinst.llvm.lib 0.03 0.0015 0.0021 <b>0.0036</b> 0.0129 | <b>11272</b> <b>19896</b> <b>6096</b> <b>50920</b> | 33 <b>74+17</b> 3+0 3+0
methcall.llvm.lib 0.03 0.0014 0.0018 0.0028 0.0111 | <b>10936</b> <b>15720</b> <b>5152</b> <b>45064</b> | 26 <b>59+14</b> 2+0 2+0
matrix.llvm.lib 0.03 0.0014 0.0023 0.0025 0.0118 | <b>8984</b> <b>8096</b> <b>4352</b> <b>37776</b> | * <b>47+11</b> 1+0 1+0
ary3.llvm.lib 0.03 0.0010 0.0014 0.0014 0.0084 | <b>8992</b> <b>8624</b> <b>4344</b> <b>37624</b> | 6 <b>52+7</b> 1+0 1+0
sumarraymalloc.llvm.lib 0.02 0.0007 0.0009 0.0012 0.0069 | <b>2936</b> <b>6984</b> <b>7216</b> <b>31496</b> | * <b>39+8</b> 2+0 2+0
random.llvm.lib 0.02 0.0006 0.0006 0.0008 0.0057 | <b>2336</b> <b>6000</b> <b>2856</b> <b>26944</b> | * <b>32+5</b> 3+0 3+0
pi.llvm.lib 0.02 0.0006 0.0006 0.0013 0.0047 | <b>5816</b> <b>7240</b> <b>6688</b> <b>19744</b> | * 34+6 3+0 3+0
heapsort.llvm.lib 0.02 0.0007 0.0009 0.0012 0.0070 | <b>3128</b> <b>7336</b> <b>4008</b> <b>29640</b> | * <b>46+6</b> 3+0 3+0
fib2.llvm.lib 0.02 0.0007 0.0008 0.0008 0.0056 | <b>5704</b> <b>1928</b> <b>2520</b> <b>22440</b> | * <b>26+6</b> 1+0 1+0
sumarray.llvm.lib 0.01 0.0003 0.0002 0.0003 0.0022 | <b>960</b> <b>3176</b> <b>608</b> <b>6856</b> | * 7+2 0+0 0+0
sumarray2d.llvm.lib 0.01 0.0003 0.0003 0.0004 0.0028 | <b>1736</b> <b>6056</b> <b>1064</b> <b>11176</b> | * 15+3 1+0 1+0
printargs.llvm.lib 0.01 0.0003 0.0004 0.0005 0.0026 | <b>1464</b> <b>848</b> <b>3512</b> <b>5824</b> | * 13+4 1+0 1+0
matrixTranspose.llvm.lib 0.01 0.0004 0.0004 0.0005 0.0030 | <b>4384</b> <b>1248</b> <b>3824</b> <b>9456</b> | * 17+4 3+0 3+0
indvars.llvm.lib 0.01 0.0004 0.0005 0.0005 0.0033 | <b>4800</b> <b>7440</b> <b>1224</b> <b>13464</b> | * 18+3 1+0 1+0
hello.llvm.lib 0.01 0.0003 0.0003 0.0003 0.0021 | <b>976</b> <b>3024</b> <b>2968</b> <b>9224</b> | * 8+3 1+0 1+0
ackermann.llvm.lib 0.00 0.0000 0.0000 0.0001 0.0004 | <b>72</b> 0 832 <b>904</b> | * 0+0 * *
</pre><p>
<hr>
<a name="20021108-3"><h2>Nov 8, 2002 #3:</h2>
Same as the <a href="#20021108-2">previous run</a>, but now we automatically
collapse arrays down to a single element in the representation. The graphs
produced should be exactly the same, it's just memory consumption that goes
dramatically down, for example: 197.parser (64M-&gt;14M), 164.gzip
(14M-&gt;2.7M), 256.bzip (9M -&gt; 1.9M), etc.<p>
With reduced memory consumption comes higher performance of course (better cache
behavior n stuff).<p>
<pre>
Name: Anlyz: LocTime: BUTime: TDTime: TotTime: LocSize: BUSize: TDSize: TotSize: NumFold NumNodes main __main
254.gap.lib 71.65 * * * * | * * * * | * * * *
255.vortex.lib <b>4.62</b> * * * * | * * * * | * * * *
300.twolf.lib 12.22 0.2369 0.8840 8.0785 9.9177 | <b>573880</b> <b>770752</b> <b>10364040</b> <b>11708672</b> | <b>3514</b> 161528+1101 854+0 854+0
197.parser.lib <b>11.73</b> 0.1216 <b>0.5217</b> <b>9.3368</b> <b>10.3099</b> | <b>461720</b> <b>619960</b> <b>12948496</b> <b>14266336</b> | <b>2641</b> 196932+1184 601+0 601+0
burg.llvm.lib 5.35 0.0857 0.2873 3.9878 4.5484 | <b>650608</b> <b>906016</b> <b>4691952</b> <b>6248576</b> | <b>1555</b> 72533+902 436+0 436+0
164.gzip.llvm.lib <b>1.33</b> <b>0.0309</b> <b>0.1085</b> <b>0.5445</b> <b>0.7708</b> | <b>284312</b> <b>521048</b> <b>1877416</b> <b>2779368</b> | <b>67</b> 16632+232 171+0 171+0
256.bzip2.lib <b>0.73</b> 0.0191 <b>0.0588</b> <b>0.3611</b> <b>0.4995</b> | <b>156760</b> <b>336272</b> <b>1390240</b> <b>1956528</b> | <b>20</b> 11456+201 148+0 148+0
optimizer-eval.llvm.lib 0.56 0.0129 0.0957 0.2881 0.4359 | <b>85720</b> <b>178016</b> <b>750424</b> <b>1032352</b> | <b>*</b> 3693+101 63+0 63+0
sim.llvm.lib <b>0.29</b> 0.0126 <b>0.0237</b> <b>0.0731</b> <b>0.1630</b> | <b>93240</b> <b>106144</b> <b>331688</b> <b>626088</b> | <b>*</b> 2739+67 99+0 99+0
181.mcf.lib 0.28 0.0153 0.0379 <b>0.0649</b> 0.1457 | <b>136744</b> <b>155416</b> <b>202496</b> <b>511544</b> | <b>178</b> 1914+72 44+0 44+0
voronoi.llvm.lib 0.22 0.0122 0.0296 0.0728 0.1324 | <b>83568</b> <b>94008</b> <b>212560</b> <b>404128</b> | <b>17</b> 1733+106 30+0 30+0
sgefa.llvm.lib 0.19 0.0072 0.0375 0.0491 0.1131 | <b>102144</b> <b>109744</b> <b>117064</b> <b>353720</b> | <b>*</b> 634+55 31+0 31+0
bh.llvm.lib 0.17 0.0098 0.0164 0.0260 0.0728 | <b>78048</b> <b>82616</b> <b>86688</b> <b>311168</b> | 66 715+64 13+0 13+0
em3d.llvm.lib 0.11 0.0046 0.0114 0.0327 0.0590 | <b>36344</b> <b>64760</b> <b>125360</b> <b>243088</b> | <b>9</b> 1031+59 28+0 28+0
power.llvm.lib 0.09 0.0043 0.0053 0.0100 0.0296 | <b>22840</b> <b>33912</b> <b>30440</b> <b>103016</b> | <b>*</b> 277+35 9+0 9+0
tsp.llvm.lib 0.08 0.0043 0.0057 0.0066 0.0276 | <b>20640</b> <b>25416</b> <b>25784</b> <b>86464</b> | <b>19</b> 247+31 10+0 10+0
mst.llvm.lib 0.08 0.0033 0.0060 0.0123 0.0308 | <b>29088</b> 31400 <b>51632</b> <b>126792</b> | <b>10</b> 470+36 21+0 21+0
lists.llvm.lib 0.08 <b>0.0035</b> 0.0080 0.0111 0.0294 | <b>25048</b> <b>33872</b> <b>25520</b> <b>96760</b> | <b>50</b> 246+34 10+0 10+0
health.llvm.lib 0.08 <b>0.0043</b> 0.0083 0.0120 0.0344 | 31232 <b>31256</b> <b>45008</b> <b>122464</b> | <b>71</b> 361+40 14+0 14+0
perimeter.llvm.lib 0.07 0.0036 0.0047 0.0049 0.0251 | 15336 22904 <b>15968</b> <b>66864</b> | * 105+24 4+0 4+0
objinst.llvm.lib 0.06 0.0016 0.0024 <b>0.0090</b> 0.0191 | 11032 <b>15560</b> <b>12416</b> <b>52664</b> | <b>33</b> 73+17 3+0 3+0
bisort.llvm.lib 0.06 0.0023 0.0036 0.0065 0.0202 | 14376 <b>20968</b> <b>22152</b> <b>68568</b> | <b>*</b> 210+27 10+0 10+0
llubenchmark.llvm.lib 0.05 0.0018 0.0024 0.0042 0.0166 | 11824 <b>15464</b> <b>23480</b> <b>61776</b> | <b>*</b> 144+20 15+0 15+0
hash.llvm.lib 0.05 0.0026 0.0044 0.0062 0.0206 | <b>18192</b> <b>24928</b> <b>23976</b> <b>80496</b> | <b>*</b> 241+23 7+0 7+0
methcall.llvm.lib 0.04 0.0014 0.0019 0.0031 0.0120 | 10824 9704 11128 45312 | <b>26</b> 58+14 2+0 2+0
ary3.llvm.lib 0.04 0.0010 0.0015 0.0014 0.0102 | 8752 17136 4168 45720 | 6 50+7 1+0 1+0
treeadd.llvm.lib 0.03 0.0011 0.0016 0.0023 0.0098 | 9080 8408 <b>9944</b> <b>39424</b> | <b>*</b> 76+14 5+0 5+0
sieve.llvm.lib 0.03 0.0006 <b>0.0006</b> <b>0.0009</b> 0.0063 | <b>7856</b> <b>6056</b> <b>2480</b> <b>26760</b> | * 30+4 2+0 2+0
pi.llvm.lib 0.03 0.0006 0.0007 0.0012 0.0050 | 5696 5272 <b>5584</b> <b>16552</b> | * 34+6 3+0 3+0
matrix.llvm.lib 0.03 0.0010 0.0017 0.0018 0.0096 | 8584 17680 4208 46232 | * 46+11 1+0 1+0
heapsort.llvm.lib 0.03 0.0010 0.0009 0.0013 0.0076 | 2936 7224 3912 29240 | * 45+6 3+0 3+0
sumarraymalloc.llvm.lib 0.02 0.0007 0.0009 0.0015 0.0072 | 2720 <b>6872</b> <b>7128</b> <b>31152</b> | * 38+8 2+0 2+0
sumarray.llvm.lib 0.02 0.0003 0.0002 0.0003 0.0025 | <b>864</b> <b>3144</b> <b>592</b> <b>6712</b> | <b>*</b> 7+2 0+0 0+0
random.llvm.lib 0.02 0.0006 0.0006 0.0009 0.0057 | 6184 1808 2752 23600 | * 31+5 3+0 3+0
printargs.llvm.lib 0.02 0.0003 0.0004 0.0006 0.0028 | 1360 816 <b>3480</b> <b>5656</b> | * 13+4 1+0 1+0
matrixTranspose.llvm.lib 0.02 0.0004 <b>0.0004</b> <b>0.0006</b> <b>0.0034</b> | <b>5888</b> <b>1224</b> <b>4864</b> <b>11976</b> | * 17+4 3+0 3+0
indvars.llvm.lib <b>0.02</b> <b>0.0005</b> <b>0.0005</b> <b>0.0005</b> <b>0.0037</b> | <b>4680</b> <b>3552</b> <b>1200</b> <b>9432</b> | * 18+3 1+0 1+0
fib2.llvm.lib 0.02 0.0007 0.0008 0.0009 0.0059 | 6176 1808 2400 23008 | * 25+6 1+0 1+0
sumarray2d.llvm.lib <b>0.01</b> <b>0.0004</b> <b>0.0004</b> <b>0.0004</b> <b>0.0030</b> | <b>1648</b> <b>6024</b> <b>4144</b> <b>14136</b> | * 15+3 1+0 1+0
hello.llvm.lib 0.01 0.0003 0.0003 0.0003 0.0022 | 880 592 2944 6672 | * 8+3 1+0 1+0
ackermann.llvm.lib <b>0.00</b> 0.0000 0.0000 0.0002 0.0004 | 0 0 832 832 | * 0+0 * *
</pre><p>
<hr>
<a name="20021108-2"><h2>Nov 8, 2002 #2:</h2>
Same as the <a href="#20021108">previous run</a>, but with a huge bug fix:
before, all of the call nodes (from the local pass) were being passed up in the
BU pass, causing graph exposions. Now these call sites are not propagated. The
times and sized of graphs are all much smaller now.<p>
<pre>
Name: Anlyz: LocTime: BUTime: TDTime: TotTime: LocSize: BUSize: TDSize: TotSize: NumFold NumNodes main __main
254.gap.lib <b>130.47</b> * * * * | * * * * | * * * *
255.vortex.lib <b>86.17</b> * * * * | * * * * | * * * *
197.parser.lib <b>26.50</b> 0.1601 <b>1.4931</b> <b>22.7485</b> <b>24.7647</b> | <b>2187656</b> <b>4037056</b> <b>57704672</b> <b>64165544</b> | <b>4550</b> <b>196932+1184</b> 601+0 601+0
300.twolf.lib <b>14.33</b> 0.2311 1.0000 <b>10.1733</b> <b>12.1591</b> | 629008 <b>1085616</b> <b>15564712</b> <b>17279336</b> | <b>4655</b> <b>161528+1101</b> 854+0 854+0
burg.llvm.lib <b>6.71</b> 0.0904 <b>0.3799</b> <b>5.1871</b> <b>5.8809</b> | <b>745152</b> <b>1254280</b> <b>6822216</b> <b>8821648</b> | <b>3253</b> <b>72533+902</b> <b>436+0</b> <b>436+0</b>
164.gzip.llvm.lib <b>6.07</b> 0.1158 0.9992 <b>4.1925</b> <b>5.3966</b> | <b>2113120</b> <b>2772872</b> <b>9043760</b> <b>14026344</b> | <b>233</b> <b>16632+232</b> 171+0 171+0
256.bzip2.lib <b>2.16</b> 0.0239 0.1987 <b>1.6047</b> <b>1.8899</b> | 372776 <b>1059888</b> <b>7503640</b> <b>9009560</b> | <b>132</b> <b>11456+201</b> 148+0 148+0
sim.llvm.lib 1.54 0.0163 0.2356 1.0723 1.3738 | <b>106096</b> <b>124280</b> <b>400760</b> <b>726152</b> | <b>41</b> <b>2739+67</b> 99+0 99+0
optimizer-eval.llvm.lib <b>0.58</b> 0.0126 <b>0.0890</b> <b>0.3282</b> <b>0.4696</b> | <b>110464</b> <b>188584</b> <b>1055832</b> <b>1373072</b> | <b>287</b> <b>3693+101</b> 63+0 63+0
181.mcf.lib 0.33 0.0155 0.0465 <b>0.1437</b> <b>0.2308</b> | <b>156864</b> <b>225184</b> <b>805584</b> <b>1204520</b> | <b>209</b> <b>1914+72</b> 44+0 44+0
voronoi.llvm.lib <b>0.19</b> 0.0111 0.0253 <b>0.0644</b> <b>0.1178</b> | <b>83248</b> <b>93616</b> <b>238648</b> <b>429504</b> | <b>31</b> <b>1733+106</b> 30+0 30+0
sgefa.llvm.lib 0.18 0.0069 0.0398 0.0492 0.1156 | 104712 <b>108472</b> <b>178920</b> <b>416872</b> | <b>67</b> <b>634+55</b> 31+0 31+0
bh.llvm.lib <b>0.16</b> 0.0100 0.0177 <b>0.0355</b> <b>0.0838</b> | <b>81376</b> <b>93656</b> <b>190104</b> <b>428952</b> | 66 <b>715+64</b> 13+0 13+0
health.llvm.lib 0.10 <b>0.0230</b> 0.0084 0.0138 0.0551 | 31232 <b>31552</b> <b>56984</b> <b>134736</b> | <b>75</b> <b>361+40</b> 14+0 14+0
em3d.llvm.lib 0.09 0.0045 0.0117 <b>0.0255</b> 0.0519 | <b>37336</b> <b>67808</b> <b>126960</b> <b>248728</b> | <b>50</b> <b>1031+59</b> <b>28+0</b> <b>28+0</b>
power.llvm.lib 0.07 0.0035 0.0053 <b>0.0105</b> <b>0.0287</b> | <b>23432</b> <b>31680</b> <b>42680</b> <b>113616</b> | <b>3</b> <b>277+35</b> 9+0 9+0
mst.llvm.lib 0.07 0.0033 0.0060 <b>0.0145</b> 0.0333 | <b>29080</b> <b>31400</b> <b>56720</b> <b>131872</b> | <b>35</b> <b>470+36</b> 21+0 21+0
lists.llvm.lib 0.07 <b>0.0079</b> 0.0129 0.0170 0.0453 | <b>27616</b> <b>39648</b> <b>75280</b> <b>154864</b> | <b>54</b> <b>246+34</b> 10+0 10+0
indvars.llvm.lib 0.07 0.0020 0.0257 0.0269 0.0569 | <b>85496</b> <b>87560</b> 161216 <b>334272</b> | * 18+3 1+0 1+0
tsp.llvm.lib 0.06 0.0041 0.0049 <b>0.0065</b> 0.0250 | <b>19360</b> <b>26216</b> <b>26712</b> <b>86912</b> | <b>23</b> <b>247+31</b> 10+0 10+0
perimeter.llvm.lib 0.05 0.0024 0.0045 <b>0.0039</b> 0.0194 | <b>15336</b> <b>22904</b> <b>16288</b> <b>67184</b> | * <b>105+24</b> 4+0 4+0
hash.llvm.lib 0.05 0.0029 0.0043 <b>0.0066</b> 0.0211 | 25880 <b>18176</b> <b>28168</b> <b>85624</b> | <b>2</b> <b>241+23</b> 7+0 7+0
bisort.llvm.lib <b>0.05</b> 0.0022 0.0036 0.0064 0.0192 | 14376 <b>28616</b> <b>22416</b> <b>76480</b> | <b>3</b> <b>210+27</b> 10+0 10+0
llubenchmark.llvm.lib 0.04 0.0017 0.0026 0.0045 0.0169 | 11824 <b>24304</b> <b>18168</b> <b>65304</b> | <b>8</b> <b>144+20</b> 15+0 15+0
treeadd.llvm.lib 0.03 0.0013 0.0016 0.0023 0.0101 | <b>9080</b> <b>8408</b> <b>11224</b> <b>40704</b> | <b>2</b> <b>76+14</b> 5+0 5+0
sumarray2d.llvm.lib 0.03 0.0014 0.0097 0.0106 0.0238 | 42056 46440 83192 174008 | * 15+3 1+0 1+0
sieve.llvm.lib 0.03 0.0008 0.0021 0.0032 0.0103 | 16064 <b>14264</b> <b>35312</b> <b>76008</b> | * <b>30+4</b> 2+0 2+0
objinst.llvm.lib <b>0.03</b> 0.0015 0.0024 <b>0.0037</b> 0.0134 | 11032 <b>15488</b> <b>11440</b> <b>51616</b> | 39 <b>73+17</b> 3+0 3+0
methcall.llvm.lib 0.03 0.0014 0.0018 0.0030 0.0115 | <b>10824</b> <b>9704</b> <b>11128</b> <b>45312</b> | 31 <b>58+14</b> 2+0 2+0
matrix.llvm.lib 0.03 0.0011 0.0017 0.0018 0.0109 | <b>8584</b> <b>17680</b> <b>4208</b> <b>46232</b> | * <b>46+11</b> 1+0 1+0
ary3.llvm.lib 0.03 0.0010 0.0014 0.0014 0.0085 | 8752 <b>17136</b> <b>4168</b> <b>45720</b> | 6 <b>50+7</b> 1+0 1+0
sumarraymalloc.llvm.lib 0.02 0.0007 0.0009 0.0013 0.0070 | 2720 <b>12824</b> <b>3376</b> <b>33352</b> | * <b>38+8</b> 2+0 2+0
random.llvm.lib 0.02 0.0006 0.0009 0.0009 0.0060 | <b>6184</b> <b>1808</b> <b>2752</b> <b>23600</b> | * <b>31+5</b> 3+0 3+0
pi.llvm.lib 0.02 0.0006 0.0007 0.0011 0.0049 | 5696 <b>5272</b> <b>6544</b> <b>17512</b> | * <b>34+6</b> 3+0 3+0
matrixTranspose.llvm.lib 0.02 0.0007 0.0033 0.0034 0.0095 | 14088 9424 29480 52992 | * 17+4 3+0 3+0
heapsort.llvm.lib <b>0.02</b> 0.0008 0.0009 0.0013 <b>0.0076</b> | 2936 <b>7224</b> <b>3912</b> <b>29240</b> | * <b>45+6</b> 3+0 3+0
fib2.llvm.lib 0.02 0.0014 0.0008 0.0009 0.0067 | <b>6176</b> <b>1808</b> <b>2400</b> <b>23008</b> | * <b>25+6</b> 1+0 1+0
sumarray.llvm.lib <b>0.01</b> 0.0003 0.0003 0.0003 0.0022 | 1280 3552 584 7528 | 3 7+2 0+0 0+0
printargs.llvm.lib 0.01 0.0005 0.0004 0.0006 0.0030 | 1360 <b>816</b> <b>4760</b> <b>6936</b> | * <b>13+4</b> 1+0 1+0
hello.llvm.lib 0.01 0.0003 0.0003 0.0003 0.0022 | 880 <b>592</b> <b>2944</b> <b>6672</b> | * <b>8+3</b> 1+0 1+0
ackermann.llvm.lib 0.01 0.0000 0.0000 0.0001 0.0004 | 0 0 832 832 | * 0+0 * *
</pre><p>
<hr>
<a name="20021108"><h2>Nov 8, 2002:</h2>
Same as the <a href="#20021107-2">previous run</a>, but now the Top-Down pass
has been rewritten to:<p>
<ul>
<li>Actually work on all of the benchmarks
<li>Require less book-keeping
<li>Only clone a caller graph into a particular callee graph once
<li>Not prune nodes as aggressively, this is probably the reason for many
slowdowns below.
</ul><p>
Looking deeper into the results, gzip got slower by a factor of 4, optimizer
eval got slower by a factor of 3, sim slowed down just a little bit.<p>
Note that without the globals graph, some benchmarks are still VERY slow (those
with heavy use of globals).<p>
<pre>
Name: Anlyz: LocTime: BUTime: TDTime: TotTime: LocSize: BUSize: TDSize: TotSize: NumFold NumNodes main __main
254.gap.lib 330.50 * * * * | * * * * | * * * *
255.vortex.lib * * * * * | * * * * | * * * *
197.parser.lib 120.10 0.1649 11.8198 105.3900 118.0119 | 2188536 4525320 60972272 67921544 | 22575 202604+8604 601+0 601+0
300.twolf.lib 72.38 0.2431 1.8500 30.5671 72.3845 | 629008 1375352 16515832 18520192 | 18090 163168+3906 854+0 854+0
burg.llvm.lib 34.18 0.0871 1.0919 15.8467 34.1754 | 749304 1755232 7209416 9779360 | 21707 78464+4387 393+0 393+0
164.gzip.llvm.lib 21.81 0.1149 1.2083 19.6981 21.1201 | 2055024 3145544 8929008 14227896 | 2387 18236+1588 171+0 171+0
256.bzip2.lib 7.44 0.0250 0.3032 6.2987 7.4430 | 372776 1205520 7660752 9312304 | 1765 11947+1011 148+0 148+0
optimizer-eval.llvm.lib 3.24 0.0131 1.0648 1.9117 3.0792 | 110456 343032 1971952 2443624 | 5293 4186+1033 63+0 63+0
sim.llvm.lib 2.27 0.0170 0.2274 1.7720 2.0708 | 104728 130376 451320 759088 | 62 2755+122 99+0 99+0
181.mcf.lib 0.61 0.0162 0.0556 0.3631 0.4646 | 156648 234864 866704 1275064 | 243 2023+163 44+0 44+0
voronoi.llvm.lib 0.45 0.0117 0.0447 0.2557 0.3385 | 83088 150936 337552 585520 | 157 2063+390 30+0 30+0
bh.llvm.lib 0.38 0.0101 0.0253 0.1778 0.2394 | 79736 129328 245408 502512 | 66 858+198 13+0 13+0
sgefa.llvm.lib 0.27 0.0071 0.0396 0.0780 0.1465 | 104712 112576 204600 446656 | 130 640+103 31+0 31+0
power.llvm.lib 0.14 0.0035 0.0080 0.0451 0.0675 | 31272 49768 66968 155680 | 6 359+96 9+0 9+0
em3d.llvm.lib 0.13 0.0046 0.0140 0.0524 0.0825 | 37096 65320 122624 241744 | 141 920+127 21+0 21+0
mst.llvm.lib 0.13 0.0033 0.0084 0.0381 0.0605 | 29104 36104 70496 150376 | 100 506+91 21+0 21+0
lists.llvm.lib 0.12 0.0036 0.0118 0.0328 0.0664 | 27880 33064 98728 177520 | 58 270+63 10+0 10+0
bisort.llvm.lib 0.11 0.0023 0.0047 0.0125 0.0270 | 14376 29520 33808 88776 | 6 226+42 10+0 10+0
indvars.llvm.lib 0.11 0.0020 0.0254 0.0310 0.0606 | 85520 88232 161216 334968 | * 18+3 1+0 1+0
health.llvm.lib 0.10 0.0044 0.0113 0.0255 0.0519 | 31232 44592 53456 144248 | 79 385+69 14+0 14+0
tsp.llvm.lib 0.10 0.0042 0.0062 0.0176 0.0382 | 27840 19008 51376 112528 | 27 271+55 10+0 10+0
hash.llvm.lib 0.10 0.0026 0.0056 0.0168 0.0336 | 25880 29936 35312 104528 | 6 271+44 7+0 7+0
heapsort.llvm.lib 0.09 0.0007 0.0009 0.0015 0.0429 | 2936 7384 4064 29552 | * 47+7 3+0 3+0
perimeter.llvm.lib 0.08 0.0025 0.0064 0.0090 0.0271 | 15432 25616 18552 72440 | * 121+39 4+0 4+0
objinst.llvm.lib 0.08 0.0015 0.0027 0.0076 0.0180 | 11032 16088 19848 60624 | 39 78+25 3+0 3+0
sumarray2d.llvm.lib 0.06 0.0011 0.0098 0.0111 0.0241 | 42056 46440 83192 174008 | * 15+3 1+0 1+0
ary3.llvm.lib 0.06 0.0010 0.0016 0.0021 0.0096 | 8752 17528 4696 46640 | 6 55+10 1+0 1+0
llubenchmark.llvm.lib 0.05 0.0018 0.0034 0.0063 0.0199 | 11824 20384 28056 71272 | 32 141+31 15+0 15+0
treeadd.llvm.lib 0.05 0.0012 0.0023 0.0036 0.0121 | 9120 17640 10960 53880 | 4 82+18 5+0 5+0
sumarray.llvm.lib 0.04 0.0003 0.0003 0.0003 0.0022 | 1280 3552 584 7528 | 3 7+2 0+0 0+0
methcall.llvm.lib 0.03 0.0014 0.0021 0.0045 0.0147 | 10680 16000 11784 51720 | 31 63+19 2+0 2+0
sieve.llvm.lib 0.03 0.0008 0.0022 0.0047 0.0120 | 16064 14528 39672 80632 | * 32+5 2+0 2+0
fib2.llvm.lib 0.03 0.0007 0.0009 0.0011 0.0063 | 5512 6088 2544 26432 | * 27+7 1+0 1+0
matrix.llvm.lib 0.02 0.0010 0.0017 0.0021 0.0100 | 8760 8104 8976 42184 | * 48+12 1+0 1+0
matrixTranspose.llvm.lib 0.02 0.0007 0.0034 0.0037 0.0098 | 14088 9424 29480 52992 | * 17+4 3+0 3+0
sumarraymalloc.llvm.lib 0.02 0.0007 0.0010 0.0016 0.0075 | 2720 12928 3536 33544 | * 40+9 2+0 2+0
pi.llvm.lib 0.02 0.0006 0.0007 0.0014 0.0052 | 5696 5368 5680 16744 | * 35+7 3+0 3+0
random.llvm.lib 0.02 0.0006 0.0007 0.0012 0.0061 | 2136 6040 7248 31176 | * 33+6 3+0 3+0
printargs.llvm.lib 0.02 0.0003 0.0004 0.0007 0.0030 | 1360 1024 1728 4112 | * 14+5 1+0 1+0
hello.llvm.lib 0.02 0.0003 0.0003 0.0005 0.0023 | 880 648 768 4552 | * 9+4 1+0 1+0
ackermann.llvm.lib 0.02 0.0000 0.0000 0.0002 0.0004 | 0 0 832 832 | * 0+0 * *
</pre><p>
<hr>
<a name="20021107-2"><h2>Nov 7, 2002 #2:</h2>
Same as the <a href="#20021107">previous run</a>, but now we actually handle
constants (especially constantexprs) correctly in the local and all subsequent
passes. This seems to dramatically improve many benchmarks, only slowing down
gzip significantly.<p>
<pre>
Name: Anlyz: LocTime: BUTime: TDTime: TotTime: LocSize: BUSize: TDSize: TotSize: NumFold NumNodes main __main
300.twolf.lib 30.88 * * * * | * * * * | * * * *
255.vortex.lib 15.71 * * * * | * * * * | * * * *
254.gap.lib 6.07 analyze: ../../../include/llvm/Analysis/DSNode.h:77: DSNode::~DSNode(): Assertion `Referrers.empty() && "Referrers to dead node exist!"' failed.
164.gzip.llvm.lib 5.32 0.1157 1.0296 3.4025 4.6326 | 2054352 2631576 7804656 12588904 | 398 13372+217 174+3 174+3
256.bzip2.lib 2.36 0.0250 0.1913 1.8190 2.0966 | 371928 1045320 7533440 9023600 | 407 11415+149 151+2 151+2
sim.llvm.lib 1.97 0.0174 0.2155 1.4731 1.7539 | 104584 120112 449736 747416 | 46 2745+52 101+2 101+2
197.parser.lib 1.27 analyze: ../../../include/llvm/Analysis/DSNode.h:77: DSNode::~DSNode(): Assertion `Referrers.empty() && "Referrers to dead node exist!"' failed.
optimizer-eval.llvm.lib 1.09 0.0132 0.0926 0.8104 0.9528 | 109416 186592 1827184 2141376 | 1709 8189+43 63+0 63+0
burg.llvm.lib 0.81 analyze: ../../../include/llvm/Analysis/DSNode.h:77: DSNode::~DSNode(): Assertion `Referrers.empty() && "Referrers to dead node exist!"' failed.
181.mcf.lib 0.38 0.0163 0.0470 0.1847 0.2714 | 156304 219896 808112 1201160 | 226 1859+0 44+0 44+0
voronoi.llvm.lib 0.22 0.0118 0.0241 0.0776 0.1293 | 82728 87872 214584 399128 | 31 1650+0 30+0 30+0
sgefa.llvm.lib 0.19 0.0074 0.0324 0.0716 0.1303 | 104560 104744 200024 434096 | 89 610+1 32+0 32+0
bh.llvm.lib 0.17 0.0106 0.0158 0.0344 0.0813 | 80112 86984 210008 425144 | 66 678+3 16+0 16+0
em3d.llvm.lib 0.16 0.0067 0.0111 0.0619 0.0899 | 37600 55936 217632 327872 | 90 1584+522 38+3 38+3
health.llvm.lib 0.10 0.0044 0.0071 0.0117 0.0322 | 31120 38712 35248 120048 | 81 328+0 14+0 14+0
lists.llvm.lib 0.09 0.0037 0.0075 0.0296 0.0477 | 27792 32968 83288 162264 | 61 222+0 10+0 10+0
llubenchmark.llvm.lib 0.09 0.0018 0.0021 0.0060 0.0178 | 11104 12176 32552 66840 | 35 152+22 17+1 17+1
power.llvm.lib 0.08 0.0036 0.0045 0.0139 0.0308 | 21672 31000 40512 109008 | 5 246+0 9+0 9+0
mst.llvm.lib 0.07 0.0033 0.0051 0.0125 0.0296 | 28368 27552 49088 119680 | 54 435+1 21+0 21+0
indvars.llvm.lib 0.07 0.0020 0.0199 0.0281 0.0521 | 85496 84840 164280 334616 | * 15+0 1+0 1+0
perimeter.llvm.lib 0.06 0.0027 0.0035 0.0037 0.0180 | 15312 12112 14536 54800 | * 83+0 4+0 4+0
tsp.llvm.lib 0.05 0.0045 0.0041 0.0063 0.0254 | 27736 15016 25296 82352 | 28 228+1 11+0 11+0
hash.llvm.lib 0.04 0.0025 0.0038 0.0054 0.0202 | 18288 24528 26104 82320 | 2 220+0 7+0 7+0
bisort.llvm.lib 0.04 0.0025 0.0030 0.0050 0.0178 | 14296 19056 28384 72808 | 5 186+0 10+0 10+0
sumarray2d.llvm.lib 0.04 0.0011 0.0077 0.0102 0.0210 | 42032 46264 83960 174576 | * 12+0 1+0 1+0
treeadd.llvm.lib 0.04 0.0011 0.0013 0.0017 0.0086 | 9008 7360 10264 42432 | 2 64+0 5+0 5+0
objinst.llvm.lib 0.03 0.0021 0.0019 0.0049 0.0147 | 10928 15344 24592 64520 | 31 151+72 9+4 9+4
methcall.llvm.lib 0.03 0.0014 0.0016 0.0030 0.0111 | 15520 8928 8032 45736 | 27 99+44 8+4 8+4
matrix.llvm.lib 0.03 0.0010 0.0015 0.0017 0.0086 | 8680 8424 8200 41304 | * 39+0 1+0 1+0
sieve.llvm.lib 0.03 0.0007 0.0021 0.0032 0.0101 | 10320 13864 34512 72456 | * 26+0 2+0 2+0
sumarraymalloc.llvm.lib 0.03 0.0007 0.0008 0.0008 0.0060 | 2656 6144 6848 30024 | * 31+0 2+0 2+0
matrixTranspose.llvm.lib 0.03 0.0006 0.0027 0.0034 0.0087 | 14064 9080 28600 51744 | * 14+0 3+0 3+0
ary3.llvm.lib 0.02 0.0011 0.0013 0.0012 0.0081 | 8720 6968 8256 39992 | 6 44+0 1+0 1+0
heapsort.llvm.lib 0.02 0.0008 0.0008 0.0008 0.0077 | 2896 13464 2552 33728 | * 39+0 3+0 3+0
random.llvm.lib 0.02 0.0007 0.0006 0.0006 0.0056 | 6296 4848 6112 29856 | * 26+0 3+0 3+0
fib2.llvm.lib 0.01 0.0007 0.0007 0.0006 0.0052 | 5488 5408 1344 24888 | * 19+0 1+0 1+0
pi.llvm.lib 0.01 0.0006 0.0006 0.0009 0.0043 | 5656 4768 5416 15840 | * 29+0 3+0 3+0
printargs.llvm.lib 0.01 0.0003 0.0003 0.0003 0.0023 | 1336 560 728 2624 | * 9+0 1+0 1+0
sumarray.llvm.lib 0.01 0.0003 0.0003 0.0002 0.0022 | 1256 2456 456 6280 | 3 5+0 0+0 0+0
hello.llvm.lib 0.01 0.0003 0.0003 0.0002 0.0019 | 840 2872 3136 6848 | * 5+0 1+0 1+0
ackermann.llvm.lib 0.01 * * * * | * * * * | * 0+0 * *
</pre><p>
<hr>
<a name="20021107"><h2>Nov 7, 2002:</h2>
Notes: Debug build, no globals graph, no array collapsing.<p>
Things are a big slower than before due to corrected handling of global
variables.
<pre>
Name: Anlyz: LocTime: BUTime: TDTime: TotTime: LocSize: BUSize: TDSize: TotSize: NumFold NumNodes main __main
254.gap.lib 6.23 analyze: ../../../include/llvm/Analysis/DSNode.h:77: DSNode::~DSNode(): Assertion `Referrers.empty() && "Referrers to dead node exist!"' failed.
sim.llvm.lib 3.77 0.0156 0.3313 1.6634 2.0787 | 63080 98008 192424 426656 | * 1825+84 63+2 63+2
300.twolf.lib 374.15 * * * * | * * * * | * * * *
255.vortex.lib 185.26 * * * * | * * * * | * * * *
256.bzip2.lib 1.10 0.0158 0.0679 0.7397 0.8794 | 213592 385312 3368648 4040464 | 18 5238+257 64+1 64+1
164.gzip.llvm.lib 1.08 0.0260 0.0797 0.3326 0.5279 | 235048 421744 1484408 2237792 | 21 9628+634 113+1 113+1
197.parser.lib 1.06 analyze: ../../../include/llvm/Analysis/DSNode.h:77: DSNode::~DSNode(): Assertion `Referrers.empty() && "Referrers to dead node exist!"' failed.
burg.llvm.lib 0.71 analyze: ../../../include/llvm/Analysis/DSNode.h:77: DSNode::~DSNode(): Assertion `Referrers.empty() && "Referrers to dead node exist!"' failed.
optimizer-eval.llvm.lib 0.67 0.0115 0.0793 0.4125 0.5422 | 78080 141896 372592 610760 | 58 666+27 2+0 2+0
181.mcf.lib 0.32 0.0125 0.0418 0.1271 0.2052 | 120504 192920 545696 876008 | 186 753+0 14+0 14+0
voronoi.llvm.lib 0.18 0.0098 0.0204 0.0661 0.1116 | 78560 83344 116304 292200 | 19 1006+0 16+0 16+0
sgefa.llvm.lib 0.16 0.0064 0.0340 0.0413 0.0999 | 82280 96016 67960 270944 | * 125+2 2+0 2+0
sieve.llvm.lib 0.16 0.0007 0.0028 0.0209 0.0295 | 9872 13808 38872 76312 | * 22+0 1+0 1+0
lists.llvm.lib 0.15 0.0027 0.0061 0.0042 0.0217 | 22256 14256 3208 51720 | 52 38+0 0+0 0+0
bh.llvm.lib 0.14 0.0082 0.0140 0.0171 0.0630 | 73320 75448 42920 255160 | 74 402+4 10+0 10+0
em3d.llvm.lib 0.14 0.0037 0.0091 0.0303 0.0522 | 33816 50768 109200 202192 | 10 925+410 19+3 19+3
hash.llvm.lib 0.14 0.0020 0.0033 0.0036 0.0154 | 17488 23928 12584 67400 | * 131+0 2+0 2+0
llubenchmark.llvm.lib 0.13 0.0013 0.0011 0.0019 0.0128 | 9680 2144 10072 32904 | * 51+10 4+1 4+1
indvars.llvm.lib 0.12 0.0022 0.0248 0.0422 0.0713 | 82040 87944 160872 333400 | * 12+0 0+0 0+0
ary3.llvm.lib 0.12 0.0008 0.0011 0.0009 0.0072 | 7992 7808 2416 34264 | 6 37+0 0+0 0+0
health.llvm.lib 0.10 0.0035 0.0067 0.0067 0.0280 | 28432 27984 12640 83984 | 72 151+1 6+0 6+0
hello.llvm.lib 0.10 0.0002 0.0002 0.0002 0.0016 | 504 2816 336 3656 | * 2+0 0+0 0+0
ackermann.llvm.lib 0.09 0.0004 0.0005 0.0004 0.0045 | 6976 992 840 18736 | * 10+0 0+0 0+0
objinst.llvm.lib 0.08 0.0014 0.0019 0.0052 0.0137 | 9480 19064 12216 54416 | 25 148+80 7+4 7+4
sumarray2d.llvm.lib 0.08 0.0012 0.0096 0.0109 0.0235 | 41416 47080 80696 171512 | * 9+0 0+0 0+0
methcall.llvm.lib 0.08 0.0011 0.0016 0.0032 0.0108 | 3952 17528 8584 43720 | 23 104+52 7+4 7+4
heapsort.llvm.lib 0.08 0.0006 0.0008 0.0007 0.0063 | 2264 13720 2216 33016 | * 33+0 2+0 2+0
fib2.llvm.lib 0.08 0.0005 0.0006 0.0004 0.0048 | 1776 5312 1080 23992 | * 14+0 0+0 0+0
tsp.llvm.lib 0.07 0.0036 0.0035 0.0041 0.0197 | 17304 13808 17968 63704 | 18 95+1 4+0 4+0
random.llvm.lib 0.07 0.0005 0.0006 0.0005 0.0066 | 1584 4704 5752 25264 | * 21+0 2+0 2+0
pi.llvm.lib 0.07 0.0004 0.0004 0.0005 0.0031 | 4744 1248 4368 10360 | * 14+0 0+0 0+0
power.llvm.lib 0.06 0.0031 0.0063 0.0070 0.0251 | 19440 28024 23544 86832 | * 146+0 4+0 4+0
bisort.llvm.lib 0.06 0.0019 0.0036 0.0026 0.0168 | 12776 18296 6808 48952 | * 89+0 4+0 4+0
matrixTranspose.llvm.lib 0.06 0.0005 0.0019 0.0025 0.0065 | 9136 14520 25336 48992 | * 10+0 1+0 1+0
printargs.llvm.lib 0.06 0.0003 0.0003 0.0003 0.0021 | 888 504 512 1904 | * 5+0 0+0 0+0
perimeter.llvm.lib 0.05 0.0026 0.0042 0.0044 0.0220 | 13968 12464 3928 43016 | * 35+0 1+0 1+0
mst.llvm.lib 0.05 0.0026 0.0040 0.0052 0.0227 | 16520 25840 14016 71048 | 10 217+1 9+0 9+0
sumarray.llvm.lib 0.05 0.0002 0.0003 0.0002 0.0020 | 976 3424 464 6976 | 3 5+0 0+0 0+0
treeadd.llvm.lib 0.03 0.0010 0.0011 0.0009 0.0085 | 7928 6424 2088 28432 | * 27+0 1+0 1+0
matrix.llvm.lib 0.02 0.0020 0.0013 0.0014 0.0090 | 7856 10416 2200 36232 | * 32+0 0+0 0+0
sumarraymalloc.llvm.lib 0.02 0.0006 0.0007 0.0005 0.0056 | 2032 5984 1368 23472 | * 17+0 0+0 0+0
</pre><p>
<hr>
<a name="20021106"><h2>Nov 6, 2002:</h2>
Notes: Debug build, no globals graph, no array collapsing.<p>
<pre>
Name: LocTime: BUTime: TDTime: TotTime: AnlzTime: LocSize: BUSize: TDSize: TotSize: NumFold NumNodes main __main
ackermann.llvm.lib 0.0004 0.0005 0.0004 0.0045 0m0.040s | 6976 992 840 18736 | * 10+0 0+0 0+0
ary3.llvm.lib 0.0008 0.0012 0.0012 0.0074 0m0.034s | 7992 7808 2416 34264 | 6 37+0 0+0 0+0
fib2.llvm.lib 0.0005 0.0006 0.0004 0.0047 0m0.019s | 1776 5312 1080 23992 | * 14+0 0+0 0+0
hash.llvm.lib 0.0020 0.0031 0.0036 0.0157 0m0.046s | 17488 23928 12584 67400 | * 131+0 2+0 2+0
heapsort.llvm.lib 0.0006 0.0008 0.0007 0.0061 0m0.023s | 2264 13720 2216 33016 | * 33+0 2+0 2+0
hello.llvm.lib 0.0002 0.0002 0.0002 0.0015 0m0.014s | 504 2816 336 3656 | * 2+0 0+0 0+0
lists.llvm.lib 0.0029 0.0057 0.0057 0.0203 0m0.077s | 22272 14264 12128 60688 | 57 38+0 0+0 0+0
llubenchmark.llvm.lib 0.0012 0.0011 0.0017 0.0111 0m0.036s | 9680 2144 9944 32776 | * 49+8 4+1 4+1
matrix.llvm.lib 0.0008 0.0013 0.0014 0.0079 0m0.038s | 7848 10416 2200 36176 | * 32+0 0+0 0+0
matrixTranspose.llvm.lib 0.0004 0.0015 0.0019 0.0054 0m0.031s | 9136 14520 25336 48992 | * 10+0 1+0 1+0
methcall.llvm.lib 0.0010 0.0018 0.0030 0.0108 0m0.080s | 3952 17528 9024 44160 | 30 112+52 7+4 7+4
objinst.llvm.lib 0.0011 0.0018 0.0058 0.0149 0m0.061s | 9480 19064 13192 55392 | 37 163+80 7+4 7+4
pi.llvm.lib 0.0005 0.0004 0.0005 0.0032 0m0.027s | 4744 1248 4368 10360 | * 14+0 0+0 0+0
printargs.llvm.lib 0.0003 0.0005 0.0003 0.0023 0m0.042s | 888 504 512 1904 | * 5+0 0+0 0+0
random.llvm.lib 0.0005 0.0005 0.0005 0.0056 0m0.032s | 1584 4704 5752 25264 | * 21+0 2+0 2+0
sumarray.llvm.lib 0.0002 0.0003 0.0002 0.0020 0m0.034s | 976 3424 464 6976 | 3 5+0 0+0 0+0
sumarray2d.llvm.lib 0.0010 0.0077 0.0111 0.0216 0m0.047s | 41416 47080 80696 171512 | * 9+0 0+0 0+0
sumarraymalloc.llvm.lib 0.0007 0.0007 0.0005 0.0054 0m0.032s | 2032 5984 1368 23472 | * 17+0 0+0 0+0
indvars.llvm.lib 0.0018 0.0189 0.0264 0.0490 0m0.065s | 82040 87944 160872 333400 | * 12+0 0+0 0+0
bh.llvm.lib 0.0113 0.0128 0.0163 0.0597 0m0.148s | 55112 75768 42928 240056 | 74 400+5 11+0 11+0
bisort.llvm.lib 0.0018 0.0024 0.0024 0.0123 0m0.051s | 12776 18296 6808 48952 | * 89+0 4+0 4+0
em3d.llvm.lib 0.0035 0.0098 0.0196 0.0490 0m0.103s | 33816 49744 54144 146112 | 10 518+33 14+1 14+1
health.llvm.lib 0.0033 0.0061 0.0057 0.0226 0m0.088s | 28432 27992 12640 83992 | 72 151+1 6+0 6+0
mst.llvm.lib 0.0025 0.0039 0.0050 0.0192 0m0.074s | 16520 25840 14016 71048 | 10 217+1 9+0 9+0
perimeter.llvm.lib 0.0020 0.0032 0.0025 0.0154 0m0.045s | 13968 12720 3928 43272 | * 35+0 1+0 1+0
power.llvm.lib 0.0027 0.0039 0.0060 0.0232 0m0.062s | 20960 30136 23504 82696 | * 146+0 4+0 4+0
treeadd.llvm.lib 0.0009 0.0010 0.0008 0.0070 0m0.054s | 7928 6424 2088 28432 | * 27+0 1+0 1+0
tsp.llvm.lib 0.0035 0.0034 0.0032 0.0187 0m0.064s | 17304 13808 17968 63704 | 18 95+1 4+0 4+0
voronoi.llvm.lib 0.0093 0.0193 0.0567 0.1033 0m0.199s | 78560 83336 116312 292200 | 19 1006+0 16+0 16+0
optimizer-eval.llvm.lib 0.0099 0.1017 0.4073 0.5492 0m0.674s | 76736 140000 409448 644528 | 58 1259+23 7+0 7+0
sgefa.llvm.lib 0.0057 0.0283 0.0357 0.0863 0m0.153s | 82280 96016 67728 270712 | * 121+2 2+0 2+0
sieve.llvm.lib 0.0006 0.0020 0.0030 0.0096 0m0.033s | 9872 13808 38872 76312 | * 22+0 1+0 1+0
sim.llvm.lib 0.0134 0.2127 1.1230 1.3938 0m1.559s | 62864 98984 200600 457536 | * 1807+206 71+7 71+7
164.gzip.llvm.lib 0.0225 0.0727 0.2910 0.4651 0m1.003s | 235048 421864 1439120 2192624 | 17 9181+106 114+1 114+1
181.mcf.lib 0.0121 0.0354 0.1096 0.1780 0m0.292s | 120504 192920 545720 876032 | 195 753+0 14+0 14+0
197.parser.lib analyze: ../../../include/llvm/Analysis/DSNode.h:74: DSNode::~DSNode(): Assertion `Referrers.empty() && "Referrers to dead node exist!"' failed.
254.gap.lib analyze: ../../../include/llvm/Analysis/DSNode.h:74: DSNode::~DSNode(): Assertion `Referrers.empty() && "Referrers to dead node exist!"' failed.
255.vortex.lib analyze: ../../../include/llvm/Analysis/DSNode.h:74: DSNode::~DSNode(): Assertion `Referrers.empty() && "Referrers to dead node exist!"' failed.
256.bzip2.lib 0.0149 0.0604 0.6503 0.7810 0m1.027s | 210880 387776 3371632 4041800 | 18 5005+76 65+1 65+1
300.twolf.lib 0.1806 0.5248 42.5463 43.8329 0m45.785s | 522056 653816 10076992 11252864 | 1269 78066+4900 410+12 410+12
burg.llvm.lib analyze: ../../../include/llvm/Analysis/DSNode.h:74: DSNode::~DSNode(): Assertion `Referrers.empty() && "Referrers to dead node exist!"' failed.
</pre>
<hr>
<address><a href="mailto:sabre@nondot.org">Chris Lattner</a></address>
<!-- Created: Wed Nov 6 19:57:57 CST 2002 -->
<!-- hhmts start -->
Last modified: Thu Nov 14 20:00:50 CST 2002
<!-- hhmts end -->
</body>
</html>

View File

@@ -0,0 +1,238 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Extending LLVM: Adding instructions, intrinsics, types, etc.</title>
<link rel="stylesheet" href="llvm.css" type="text/css">
</head>
<body>
<div class="doc_title">
Extending LLVM: Adding instructions, intrinsics, types, etc.
</div>
<ol>
<li><a href="#introduction">Introduction and Warning</a></li>
<li><a href="#intrinsic">Adding a new intrinsic function</a></li>
<li><a href="#instruction">Adding a new instruction</a></li>
<li><a href="#type">Adding a new type</a>
<ol>
<li><a href="#fund_type">Adding a new fundamental type</a></li>
<li><a href="#derived_type">Adding a new derived type</a></li>
</ol></li>
</ol>
<div class="doc_author">
<p>Written by <a href="http://misha.brukman.net">Misha Brukman</a></p>
</div>
<!-- *********************************************************************** -->
<div class="doc_section">
<a name="introduction">Introduction and Warning</a>
</div>
<!-- *********************************************************************** -->
<div class="doc_text">
<p>During the course of using LLVM, you may wish to customize it for your
research project or for experimentation. At this point, you may realize that
you need to add something to LLVM, whether it be a new fundamental type, a new
intrinsic function, or a whole new instruction.</p>
<p>When you come to this realization, stop and think. Do you really need to
extend LLVM? Is it a new fundamental capability that LLVM does not support at
its current incarnation or can it be synthesized from already pre-existing LLVM
elements? If you are not sure, ask on the <a
href="http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev">LLVM-dev</a> list. The
reason is that extending LLVM will get involved as you need to update all the
different passes that you intend to use with your extension, and there are
<em>many</em> LLVM analyses and transformations, so it may be quite a bit of
work.</p>
<p>Adding an <a href="#intrinsic">intrinsic function</a> is easier than adding
an instruction, and is transparent to optimization passes which treat it as an
unanalyzable function. If your added functionality can be expressed as a
function call, an intrinsic function is the method of choice for LLVM
extension.</p>
<p>Before you invest a significant amount of effort into a non-trivial
extension, <span class="doc_warning">ask on the list</span> if what you are
looking to do can be done with already-existing infrastructure, or if maybe
someone else is already working on it. You will save yourself a lot of time and
effort by doing so.</p>
<p>Finally, these are my notes, and since my extensions are not complete, I may
be missing steps. If you find some omissions, please let me know <a
href="http://misha.brukman.net/contact.html">directly</a> or post on <a
href="http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev">LLVM-dev</a>.</p>
</div>
<!-- *********************************************************************** -->
<div class="doc_section">
<a name="intrinsic">Adding a new intrinsic function</a>
</div>
<!-- *********************************************************************** -->
<div class="doc_text">
<p>Adding a new intrinsic function to LLVM is much easier than adding a new
instruction. Almost all extensions to LLVM should start as an intrinsic
function and then be turned into an instruction if warranted.</p>
<ol>
<li><tt>llvm/docs/LangRef.html</tt>:
Document the intrinsic. Decide whether it is code generator specific and
what the restrictions are. Talk to other people about it so that you are
sure it's a good idea.</li>
<li><tt>llvm/include/llvm/Intrinsics.h</tt>:
add an enum in the <tt>llvm::Intrinsic</tt> namespace</li>
<li><tt>llvm/lib/CodeGen/IntrinsicLowering.cpp</tt>:
implement the lowering for this intrinsic</li>
<li><tt>llvm/lib/VMCore/Verifier.cpp</tt>:
Add code to check the invariants of the intrinsic are respected.</li>
<li><tt>llvm/lib/VMCore/Function.cpp (<tt>Function::getIntrinsicID()</tt>)</tt>:
Identify the new intrinsic function, returning the enum for the intrinsic
that you added.</li>
<li><tt>llvm/lib/Analysis/BasicAliasAnalysis.cpp</tt>: If the new intrinsic does
not access memory or does not write to memory, add it to the relevant list
of functions.</li>
<li><tt>llvm/lib/Transforms/Utils/Local.cpp</tt>: If it is possible to constant
propagate your intrinsic, add support to it in the
<tt>canConstantFoldCallTo</tt> and <tt>ConstantFoldCall</tt> functions.</li>
<li>Test your intrinsic</li>
<li><tt>llvm/test/Regression/*</tt>: add your test cases to the test suite.</li>
</ol>
<p>If this intrinsic requires code generator support (ie, it cannot be lowered).
You should also add support to the code generator in question.</p>
</div>
<!-- *********************************************************************** -->
<div class="doc_section">
<a name="instruction">Adding a new instruction</a>
</div>
<!-- *********************************************************************** -->
<div class="doc_text">
<p><span class="doc_warning">WARNING: adding instructions changes the bytecode
format, and it will take some effort to maintain compatibility with
the previous version.</span> Only add an instruction if it is absolutely
necessary.</p>
<ol>
<li><tt>llvm/include/llvm/Instruction.def</tt>:
add a number for your instruction and an enum name</li>
<li><tt>llvm/include/llvm/Instructions.h</tt>:
add a definition for the class that will represent your instruction</li>
<li><tt>llvm/include/llvm/Support/InstVisitor.h</tt>:
add a prototype for a visitor to your new instruction type</li>
<li><tt>llvm/lib/AsmParser/Lexer.l</tt>:
add a new token to parse your instruction from assembly text file</li>
<li><tt>llvm/lib/AsmParser/llvmAsmParser.y</tt>:
add the grammar on how your instruction can be read and what it will
construct as a result</li>
<li><tt>llvm/lib/Bytecode/Reader/InstructionReader.cpp</tt>:
add a case for your instruction and how it will be parsed from bytecode</li>
<li><tt>llvm/lib/VMCore/Instruction.cpp</tt>:
add a case for how your instruction will be printed out to assembly</li>
<li><tt>llvm/lib/VMCore/Instructions.cpp</tt>:
implement the class you defined in <tt>llvm/include/llvm/Instructions.h</tt></li>
</ol>
<p>Also, you need to implement (or modify) any analyses or passes that you want
to understand this new instruction.</p>
</div>
<!-- *********************************************************************** -->
<div class="doc_section">
<a name="type">Adding a new type</a>
</div>
<!-- *********************************************************************** -->
<div class="doc_text">
<p><span class="doc_warning">WARNING: adding new types changes the bytecode
format, and will break compatibility with currently-existing LLVM
installations.</span> Only add new types if it is absolutely necessary.</p>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection">
<a name="fund_type">Adding a fundamental type</a>
</div>
<div class="doc_text">
<ol>
<li><tt>llvm/include/llvm/Type.def</tt>:
add enum for the type</li>
<li><tt>llvm/include/llvm/Type.h</tt>:
add ID number for the new type; add static <tt>Type*</tt> for this type</li>
<li><tt>llvm/lib/VMCore/Type.cpp</tt>:
add mapping from <tt>TypeID</tt> =&gt; <tt>Type*</tt>;
initialize the static <tt>Type*</tt></li>
<li><tt>llvm/lib/AsmReader/Lexer.l</tt>:
add ability to parse in the type from text assembly</li>
<li><tt>llvm/lib/AsmReader/llvmAsmParser.y</tt>:
add a token for that type</li>
</ol>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection">
<a name="derived_type">Adding a derived type</a>
</div>
<div class="doc_text">
<p>TODO</p>
</div>
<!-- *********************************************************************** -->
<hr>
<address>
<a href="http://jigsaw.w3.org/css-validator/check/referer"><img
src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a>
<a href="http://validator.w3.org/check/referer"><img
src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /></a>
<a href="http://misha.brukman.net">Misha Brukman</a><br>
<a href="http://llvm.cs.uiuc.edu">The LLVM Compiler Infrastructure</a>
<br>
Last modified: $Date$
</address>
</body>
</html>

View File

@@ -1,145 +1,533 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>LLVM: Frequently Asked Questions</title>
<style type="text/css">
@import url("llvm.css");
.question { font-weight: bold }
.answer { margin-left: 2em }
</style>
</head>
<body>
<h1>
<center>
LLVM: Frequently Asked Questions
</center>
</h1>
<div class="doc_title">
LLVM: Frequently Asked Questions
</div>
<hr>
<!--=====================================================================-->
<h2>
<a name="source">Source Code</a>
</h2>
<!--=====================================================================-->
<dl compact>
<dt> <b>In what language is LLVM written?</b>
<dd>
All of the LLVM tools and libraries are written in C++ with extensive use
of the STL.
<p>
<dt><b>How portable is the LLVM source code?</b>
<dd>
The LLVM source code should be portable to most modern UNIX-like operating
systems. Most of the code is written in standard C++ with operating
system services abstracted to a support library. The tools required to
build and test LLVM have been ported to a plethora of platforms.
<p>
Some porting problems may exist in the following areas:
<ul>
<li>The GCC front end code is not as portable as the LLVM suite, so it
may not compile as well on unsupported platforms.
<p>
<li>The Python test classes are more UNIX-centric than they should be,
so porting to non-UNIX like platforms (i.e. Windows, MacOS 9) will
require some effort.
<p>
<li>The LLVM build system relies heavily on UNIX shell tools, like the
Bourne Shell and sed. Porting to systems without these tools (MacOS 9,
Plan 9) will require more effort.
</ul>
</dl>
<hr>
<!--=====================================================================-->
<h2>
<a name="build">Build Problems</a>
</h2>
<!--=====================================================================-->
<dl compact>
<dt><b>When I run configure, it finds the wrong C compiler.</b>
<dd>
The <tt>configure</tt> script attempts to locate first <tt>gcc</tt> and
then <tt>cc</tt>, unless it finds compiler paths set in <tt>CC</tt> and
<tt>CXX</tt> for the C and C++ compiler, respectively.
If <tt>configure</tt> finds the wrong compiler, either adjust your
<tt>PATH</tt> environment variable or set <tt>CC</tt> and <tt>CXX</tt>
explicitly.
<p>
<dt><b>I compile the code, and I get some error about /localhome</b>.
<dd>
There are several possible causes for this. The first is that you
didn't set a pathname properly when using <tt>configure</tt>, and it
defaulted to a pathname that we use on our research machines.
<p>
Another possibility is that we hardcoded a path in our Makefiles. If
you see this, please email the LLVM bug mailing list with the name of
the offending Makefile and a description of what is wrong with it.
<dt><b>The <tt>configure</tt> script finds the right C compiler, but it
uses the LLVM linker from a previous build. What do I do?</b>
<dd>
The <tt>configure</tt> script uses the <tt>PATH</tt> to find
executables, so if it's grabbing the wrong linker/assembler/etc, there
are two ways to fix it:
<ol>
<li><a href="#license">License</a>
<ol>
<li>Adjust your <tt>PATH</tt> environment variable so that the
correct program appears first in the <tt>PATH</tt>. This may work,
but may not be convenient when you want them <i>first</i> in your
path for other work.
<p>
<li>Why are the LLVM source code and the front-end distributed under different
licenses?</li>
<li>Does the University of Illinois Open Source License really qualify as an
"open source" license?</li>
<li>Can I modify LLVM source code and redistribute the modified source?</li>
<li>Can I modify LLVM source code and redistribute binaries or other tools
based on it, without redistributing the source?</li>
</ol></li>
<li>Run <tt>configure</tt> with an alternative <tt>PATH</tt> that
is correct. In a Borne compatible shell, the syntax would be:
<p>
<tt>PATH=<the path without the bad program> ./configure ...</tt>
<p>
This is still somewhat inconvenient, but it allows
<tt>configure</tt> to do its work without having to adjust your
<tt>PATH</tt> permanently.
<li><a href="#source">Source code</a>
<ol>
<li>In what language is LLVM written?</li>
<li>How portable is the LLVM source code?</li>
</ol></li>
<li><a href="#build">Build Problems</a>
<ol>
<li>When I run configure, it finds the wrong C compiler.</li>
<li>I compile the code, and I get some error about <tt>/localhome</tt>.</li>
<li>The <tt>configure</tt> script finds the right C compiler, but it uses the
LLVM linker from a previous build. What do I do?</li>
<li>When creating a dynamic library, I get a strange GLIBC error.</li>
<li>I've updated my source tree from CVS, and now my build is trying to use a
file/directory that doesn't exist.</li>
<li>I've modified a Makefile in my source tree, but my build tree keeps using
the old version. What do I do?</li>
<li>I've upgraded to a new version of LLVM, and I get strange build
errors.</li>
<li>I've built LLVM and am testing it, but the tests freeze.</li>
<li>Why do test results differ when I perform different types of builds?</li>
<li>Compiling LLVM with GCC 3.3.2 fails, what should I do?</li>
<li>When I use the test suite, all of the C Backend tests fail. What is
wrong?</li>
</ol></li>
<li><a href="#cfe">Using the GCC Front End</a>
<ol>
<li>
When I compile software that uses a configure script, the configure script
thinks my system has all of the header files and libraries it is testing
for. How do I get configure to work correctly?
</li>
<li>
When I compile code using the LLVM GCC front end, it complains that it
cannot find libcrtend.a.
</li>
</ol>
</li>
<dt><b>When creating a dynamic library, I get a strange GLIBC error.</b>
<dd>
Under some operating systems (i.e. Linux), libtool does not work correctly
if GCC was compiled with the --disable-shared option. To work around this,
install your own version of GCC that has shared libraries enabled by
default.
<p>
<li><a href="#cfe_code">Questions about code generated by the GCC front-end</a>
<ol>
<li>What is this <tt>__main()</tt> call that gets inserted into
<tt>main()</tt>?</li>
<li>Where did all of my code go??</li>
<li>What is this <tt>llvm.global_ctors</tt> and
<tt>_GLOBAL__I__tmp_webcompile...</tt> stuff that happens when I
#include &lt;iostream&gt;?</li>
</ol>
</li>
</ol>
<dt><b>I've updated my source tree from CVS, and now my build is trying to
use a file/directory that doesn't exist.</b>
<dd>
You need to re-run configure in your object directory. When new Makefiles
are added to the source tree, they have to be copied over to the object
tree in order to be used by the build.
<p>
<div class="doc_author">
<p>Written by <a href="http://llvm.cs.uiuc.edu">The LLVM Team</a></p>
</div>
<dt><b>I've modified a Makefile in my source tree, but my build tree keeps
using the old version. What do I do?</b>
<dd>
If the Makefile already exists in your object tree, you can just run the
following command in the top level directory of your object tree:
<p>
<tt>./config.status &lt;relative path to Makefile&gt;</tt>
<p>
If the Makefile is new, you will have to modify the configure script to copy
it over.
<p>
<dt><b>I've upgraded to a new version of LLVM, and I get strange build
errors.</b>
<dd>
Sometimes changes to the LLVM source code alters how the build system
works. Changes in libtool, autoconf, or header file dependencies are
especially prone to this sort of problem.
<p>
The best thing to try is to remove the old files and re-build. In most
cases, this takes care of the problem. To do this, just type <tt>make
clean</tt> and then <tt>make</tt> in the directory that fails to build.
<p>
</dl>
<!-- *********************************************************************** -->
<div class="doc_section">
<a name="license">License</a>
</div>
<!-- *********************************************************************** -->
<div class="question">
<p>Why are the LLVM source code and the front-end distributed under different
licenses?</p>
</div>
<div class="answer">
<p>The C/C++ front-ends are based on GCC and must be distributed under the GPL.
Our aim is to distribute LLVM source code under a <em>much less restrictive</em>
license, in particular one that does not compel users who distribute tools based
on modifying the source to redistribute the modified source code as well.</p>
</div>
<div class="question">
<p>Does the University of Illinois Open Source License really qualify as an
"open source" license?</p>
</div>
<div class="answer">
<p>Yes, the license is <a
href="http://www.opensource.org/licenses/UoI-NCSA.php">certified</a> by the Open
Source Initiative (OSI).</p>
</div>
<div class="question">
<p>Can I modify LLVM source code and redistribute the modified source?</p>
</div>
<div class="answer">
<p>Yes. The modified source distribution must retain the copyright notice and
follow the three bulletted conditions listed in the <a
href="http://llvm.cs.uiuc.edu/releases/1.2/LICENSE.TXT">LLVM license</a>.</p>
</div>
<div class="question">
<p>Can I modify LLVM source code and redistribute binaries or other tools based
on it, without redistributing the source?</p>
</div>
<div class="answer">
<p>Yes, this is why we distribute LLVM under a less restrictive license than
GPL, as explained in the first question above.</p>
</div>
<!-- *********************************************************************** -->
<div class="doc_section">
<a name="source">Source Code</a>
</div>
<!-- *********************************************************************** -->
<div class="question">
<p>In what language is LLVM written?</p>
</div>
<div class="answer">
<p>All of the LLVM tools and libraries are written in C++ with extensive use of
the STL.</p>
</div>
<div class="question">
<p>How portable is the LLVM source code?</p>
</div>
<div class="answer">
<p>The LLVM source code should be portable to most modern UNIX-like operating
systems. Most of the code is written in standard C++ with operating system
services abstracted to a support library. The tools required to build and test
LLVM have been ported to a plethora of platforms.</p>
<p>Some porting problems may exist in the following areas:</p>
<ul>
<li>The GCC front end code is not as portable as the LLVM suite, so it may not
compile as well on unsupported platforms.</li>
<li>The Python test classes are more UNIX-centric than they should be, so
porting to non-UNIX like platforms (i.e. Windows, MacOS 9) will require some
effort.</li>
<li>The LLVM build system relies heavily on UNIX shell tools, like the Bourne
Shell and sed. Porting to systems without these tools (MacOS 9, Plan 9) will
require more effort.</li>
</ul>
</div>
<!-- *********************************************************************** -->
<div class="doc_section">
<a name="build">Build Problems</a>
</div>
<!-- *********************************************************************** -->
<div class="question">
<p>When I run configure, it finds the wrong C compiler.</p>
</div>
<div class="answer">
<p>The <tt>configure</tt> script attempts to locate first <tt>gcc</tt> and then
<tt>cc</tt>, unless it finds compiler paths set in <tt>CC</tt> and <tt>CXX</tt>
for the C and C++ compiler, respectively.</p>
<p>If <tt>configure</tt> finds the wrong compiler, either adjust your
<tt>PATH</tt> environment variable or set <tt>CC</tt> and <tt>CXX</tt>
explicitly.</p>
</div>
<div class="question">
<p>I compile the code, and I get some error about <tt>/localhome</tt>.</p>
</div>
<div class="answer">
<p>There are several possible causes for this. The first is that you didn't set
a pathname properly when using <tt>configure</tt>, and it defaulted to a
pathname that we use on our research machines.</p>
<p>Another possibility is that we hardcoded a path in our Makefiles. If you see
this, please email the LLVM bug mailing list with the name of the offending
Makefile and a description of what is wrong with it.</p>
</div>
<div class="question">
<p>The <tt>configure</tt> script finds the right C compiler, but it uses the
LLVM linker from a previous build. What do I do?</p>
</div>
<div class="answer">
<p>The <tt>configure</tt> script uses the <tt>PATH</tt> to find executables, so
if it's grabbing the wrong linker/assembler/etc, there are two ways to fix
it:</p>
<ol>
<li><p>Adjust your <tt>PATH</tt> environment variable so that the correct
program appears first in the <tt>PATH</tt>. This may work, but may not be
convenient when you want them <i>first</i> in your path for other
work.</p></li>
<li><p>Run <tt>configure</tt> with an alternative <tt>PATH</tt> that is
correct. In a Borne compatible shell, the syntax would be:</p>
<p><tt>PATH=[the path without the bad program] ./configure ...</tt></p>
<p>This is still somewhat inconvenient, but it allows <tt>configure</tt>
to do its work without having to adjust your <tt>PATH</tt>
permanently.</p></li>
</ol>
</div>
<div class="question">
<p>When creating a dynamic library, I get a strange GLIBC error.</p>
</div>
<div class="answer">
<p>Under some operating systems (i.e. Linux), libtool does not work correctly if
GCC was compiled with the --disable-shared option. To work around this, install
your own version of GCC that has shared libraries enabled by default.</p>
</div>
<div class="question">
<p>I've updated my source tree from CVS, and now my build is trying to use a
file/directory that doesn't exist.</p>
</div>
<div class="answer">
<p>You need to re-run configure in your object directory. When new Makefiles
are added to the source tree, they have to be copied over to the object tree in
order to be used by the build.</p>
</div>
<div class="question">
<p>I've modified a Makefile in my source tree, but my build tree keeps using the
old version. What do I do?</p>
</div>
<div class="answer">
<p>If the Makefile already exists in your object tree, you
can just run the following command in the top level directory of your object
tree:</p>
<p><tt>./config.status &lt;relative path to Makefile&gt;</tt><p>
<p>If the Makefile is new, you will have to modify the configure script to copy
it over.</p>
</div>
<div class="question">
<p>I've upgraded to a new version of LLVM, and I get strange build errors.</p>
</div>
<div class="answer">
<p>Sometimes, changes to the LLVM source code alters how the build system works.
Changes in libtool, autoconf, or header file dependencies are especially prone
to this sort of problem.</p>
<p>The best thing to try is to remove the old files and re-build. In most
cases, this takes care of the problem. To do this, just type <tt>make
clean</tt> and then <tt>make</tt> in the directory that fails to build.</p>
</div>
<div class="question">
<p>I've built LLVM and am testing it, but the tests freeze.</p>
</div>
<div class="answer">
<p>This is most likely occurring because you built a profile or release
(optimized) build of LLVM and have not specified the same information on the
<tt>gmake</tt> command line.</p>
<p>For example, if you built LLVM with the command:</p>
<p><tt>gmake ENABLE_PROFILING=1</tt>
<p>...then you must run the tests with the following commands:</p>
<p><tt>cd llvm/test<br>gmake ENABLE_PROFILING=1</tt></p>
</div>
<div class="question">
<p>Why do test results differ when I perform different types of builds?</p>
</div>
<div class="answer">
<p>The LLVM test suite is dependent upon several features of the LLVM tools and
libraries.</p>
<p>First, the debugging assertions in code are not enabled in optimized or
profiling builds. Hence, tests that used to fail may pass.</p>
<p>Second, some tests may rely upon debugging options or behavior that is only
available in the debug build. These tests will fail in an optimized or profile
build.</p>
</div>
<div class="question">
<p>Compiling LLVM with GCC 3.3.2 fails, what should I do?</p>
</div>
<div class="answer">
<p>This is <a href="http://gcc.gnu.org/PR?13392">a bug in GCC</a>, and
affects projects other than LLVM. Try upgrading or downgrading your GCC.</p>
</div>
<div class="question">
<p>
When I use the test suite, all of the C Backend tests fail. What is
wrong?
</p>
</div>
<div class="answer">
<p>
If you build LLVM and the C Backend tests fail in <tt>llvm/test/Programs</tt>,
then chances are good that the directory pointed to by the LLVM_LIB_SEARCH_PATH
environment variable does not contain the libcrtend.a library.
</p>
<p>
To fix it, verify that LLVM_LIB_SEARCH_PATH points to the correct directory
and that libcrtend.a is inside. For pre-built LLVM GCC front ends, this
should be the absolute path to
<tt>cfrontend/&lt;<i>platform</i>&gt;/llvm-gcc/bytecode-libs</tt>. If you've
built your own LLVM GCC front end, then ensure that you've built and installed
the libraries in <tt>llvm/runtime</tt> and have LLVM_LIB_SEARCH_PATH pointing
to the <tt>LLVMGCCDIR/bytecode-libs</tt> subdirectory.
</p>
</div>
<!-- *********************************************************************** -->
<div class="doc_section">
<a name="cfe">Using the GCC Front End</a>
</div>
<div class="question">
<p>
When I compile software that uses a configure script, the configure script
thinks my system has all of the header files and libraries it is testing for.
How do I get configure to work correctly?
</p>
</div>
<div class="answer">
<p>
The configure script is getting things wrong because the LLVM linker allows
symbols to be undefined at link time (so that they can be resolved during JIT
or translation to the C back end). That is why configure thinks your system
"has everything."
</p>
<p>
To work around this, perform the following steps:
</p>
<ol>
<li>
Make sure the CC and CXX environment variables contains the full path to the
LLVM GCC front end.
</li>
<li>
Make sure that the regular C compiler is first in your PATH.
</li>
<li>
Add the string "-Wl,-native" to your CFLAGS environment variable.
</li>
</ol>
<p>
This will allow the gccld linker to create a native code executable instead of
a shell script that runs the JIT. Creating native code requires standard
linkage, which in turn will allow the configure script to find out if code is
not linking on your system because the feature isn't available on your system.
</p>
</div>
<div class="question">
<p>
When I compile code using the LLVM GCC front end, it complains that it cannot
find libcrtend.a.
</p>
</div>
<div class="answer">
<p>
In order to find libcrtend.a, you must have the directory in which it lives in
your LLVM_LIB_SEARCH_PATH environment variable. For the binary distribution of
the LLVM GCC front end, this will be the full path of the bytecode-libs
directory inside of the LLVM GCC distribution.
</p>
</div>
<!-- *********************************************************************** -->
<div class="doc_section">
<a name="cfe_code">Questions about code generated by the GCC front-end</a>
</div>
<div class="question"><p>
What is this <tt>__main()</tt> call that gets inserted into <tt>main()</tt>?
</p></div>
<div class="answer">
<p>
The <tt>__main</tt> call is inserted by the C/C++ compiler in order to guarantee
that static constructors and destructors are called when the program starts up
and shuts down. In C, you can create static constructors and destructors by
using GCC extensions, and in C++ you can do so by creating a global variable
whose class has a ctor or dtor.
</p>
<p>
The actual implementation of <tt>__main</tt> lives in the
<tt>llvm/runtime/GCCLibraries/crtend/</tt> directory in the source-base, and is
linked in automatically when you link the program.
</p>
</div>
<!--=========================================================================-->
<div class="question"><p>
Where did all of my code go??
</p></div>
<div class="answer">
<p>
If you are using the LLVM demo page, you may often wonder what happened to all
of the code that you typed in. Remember that the demo script is running the
code through the LLVM optimizers, so if your code doesn't actually do anything
useful, it might all be deleted.
</p>
<p>
To prevent this, make sure that the code is actually needed. For example, if
you are computing some expression, return the value from the function instead of
leaving it in a local variable. If you really want to constrain the optimizer,
you can read from and assign to <tt>volatile</tt> global variables.
</p>
</div>
<!--=========================================================================-->
<div class="question"><p>
What is this <tt>llvm.global_ctors</tt> and <tt>_GLOBAL__I__tmp_webcompile...</tt> stuff that happens when I #include &lt;iostream&gt;?
</p></div>
<div class="answer">
<p>
If you #include the &lt;iostream&gt; header into a C++ translation unit, the
file will probably use the <tt>std::cin</tt>/<tt>std::cout</tt>/... global
objects. However, C++ does not guarantee an order of initialization between
static objects in different translation units, so if a static ctor/dtor in your
.cpp file used <tt>std::cout</tt>, for example, the object would not necessarily
be automatically initialized before your use.
</p>
<p>
To make <tt>std::cout</tt> and friends work correctly in these scenarios, the
STL that we use declares a static object that gets created in every translation
unit that includes &lt;iostream&gt;. This object has a static constructor and
destructor that initializes and destroys the global iostream objects before they
could possibly be used in the file. The code that you see in the .ll file
corresponds to the constructor and destructor registration code.
</p>
<p>
If you would like to make it easier to <b>understand</b> the LLVM code generated
by the compiler in the demo page, consider using printf instead of iostreams to
print values.
</p>
</div>
<!-- *********************************************************************** -->
<hr>
<address>
<a href="http://jigsaw.w3.org/css-validator/check/referer"><img
src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a>
<a href="http://validator.w3.org/check/referer"><img
src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!"></a>
<a href="http://llvm.cs.uiuc.edu">LLVM Compiler Infrastructure</a><br>
Last modified: $Date$
</address>
</body>
</html>

View File

@@ -0,0 +1,533 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Accurate Garbage Collection with LLVM</title>
<link rel="stylesheet" href="llvm.css" type="text/css">
</head>
<body>
<div class="doc_title">
Accurate Garbage Collection with LLVM
</div>
<ol>
<li><a href="#introduction">Introduction</a>
<ul>
<li><a href="#feature">GC features provided and algorithms supported</a></li>
</ul>
</li>
<li><a href="#interfaces">Interfaces for user programs</a>
<ul>
<li><a href="#roots">Identifying GC roots on the stack: <tt>llvm.gcroot</tt></a></li>
<li><a href="#allocate">Allocating memory from the GC</a></li>
<li><a href="#barriers">Reading and writing references to the heap</a></li>
<li><a href="#explicit">Explicit invocation of the garbage collector</a></li>
</ul>
</li>
<li><a href="#gcimpl">Implementing a garbage collector</a>
<ul>
<li><a href="#llvm_gc_readwrite">Implementing <tt>llvm_gc_read</tt> and <tt>llvm_gc_write</tt></a></li>
<li><a href="#callbacks">Callback functions used to implement the garbage collector</a></li>
</ul>
</li>
<li><a href="#gcimpls">GC implementations available</a>
<ul>
<li><a href="#semispace">SemiSpace - A simple copying garbage collector</a></li>
</ul>
</li>
<!--
<li><a href="#codegen">Implementing GC support in a code generator</a></li>
-->
</ol>
<div class="doc_author">
<p>Written by <a href="mailto:sabre@nondot.org">Chris Lattner</a></p>
</div>
<!-- *********************************************************************** -->
<div class="doc_section">
<a name="introduction">Introduction</a>
</div>
<!-- *********************************************************************** -->
<div class="doc_text">
<p>Garbage collection is a widely used technique that frees the programmer from
having to know the life-times of heap objects, making software easier to produce
and maintain. Many programming languages rely on garbage collection for
automatic memory management. There are two primary forms of garbage collection:
conservative and accurate.</p>
<p>Conservative garbage collection often does not require any special support
from either the language or the compiler: it can handle non-type-safe
programming languages (such as C/C++) and does not require any special
information from the compiler. The [LINK] Boehm collector is an example of a
state-of-the-art conservative collector.</p>
<p>Accurate garbage collection requires the ability to identify all pointers in
the program at run-time (which requires that the source-language be type-safe in
most cases). Identifying pointers at run-time requires compiler support to
locate all places that hold live pointer variables at run-time, including the
<a href="#roots">processor stack and registers</a>.</p>
<p>
Conservative garbage collection is attractive because it does not require any
special compiler support, but it does have problems. In particular, because the
conservative garbage collector cannot <i>know</i> that a particular word in the
machine is a pointer, it cannot move live objects in the heap (preventing the
use of compacting and generational GC algorithms) and it can occasionally suffer
from memory leaks due to integer values that happen to point to objects in the
program. In addition, some aggressive compiler transformations can break
conservative garbage collectors (though these seem rare in practice).
</p>
<p>
Accurate garbage collectors do not suffer from any of these problems, but they
can suffer from degraded scalar optimization of the program. In particular,
because the runtime must be able to identify and update all pointers active in
the program, some optimizations are less effective. In practice, however, the
locality and performance benefits of using aggressive garbage allocation
techniques dominates any low-level losses.
</p>
<p>
This document describes the mechanisms and interfaces provided by LLVM to
support accurate garbage collection.
</p>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection">
<a name="feature">GC features provided and algorithms supported</a>
</div>
<div class="doc_text">
<p>
LLVM provides support for a broad class of garbage collection algorithms,
including compacting semi-space collectors, mark-sweep collectors, generational
collectors, and even reference counting implementations. It includes support
for <a href="#barriers">read and write barriers</a>, and associating <a
href="#roots">meta-data with stack objects</a> (used for tagless garbage
collection). All LLVM code generators support garbage collection, including the
C backend.
</p>
<p>
We hope that the primitive support built into LLVM is sufficient to support a
broad class of garbage collected languages, including Scheme, ML, scripting
languages, Java, C#, etc. That said, the implemented garbage collectors may
need to be extended to support language-specific features such as finalization,
weak references, or other features. As these needs are identified and
implemented, they should be added to this specification.
</p>
<p>
LLVM does not currently support garbage collection of multi-threaded programs or
GC-safe points other than function calls, but these will be added in the future
as there is interest.
</p>
</div>
<!-- *********************************************************************** -->
<div class="doc_section">
<a name="interfaces">Interfaces for user programs</a>
</div>
<!-- *********************************************************************** -->
<div class="doc_text">
<p>This section describes the interfaces provided by LLVM and by the garbage
collector run-time that should be used by user programs. As such, this is the
interface that front-end authors should generate code for.
</p>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection">
<a name="roots">Identifying GC roots on the stack: <tt>llvm.gcroot</tt></a>
</div>
<div class="doc_text">
<div class="doc_code"><tt>
void %llvm.gcroot(&lt;ty&gt;** %ptrloc, &lt;ty2&gt;* %metadata)
</tt></div>
<p>
The <tt>llvm.gcroot</tt> intrinsic is used to inform LLVM of a pointer variable
on the stack. The first argument contains the address of the variable on the
stack, and the second contains a pointer to metadata that should be associated
with the pointer (which <b>must</b> be a constant or global value address). At
runtime, the <tt>llvm.gcroot</tt> intrinsic stores a null pointer into the
specified location to initialize the pointer.</p>
<p>
Consider the following fragment of Java code:
</p>
<pre>
{
Object X; // A null-initialized reference to an object
...
}
</pre>
<p>
This block (which may be located in the middle of a function or in a loop nest),
could be compiled to this LLVM code:
</p>
<pre>
Entry:
;; In the entry block for the function, allocate the
;; stack space for X, which is an LLVM pointer.
%X = alloca %Object*
...
;; "CodeBlock" is the block corresponding to the start
;; of the scope above.
CodeBlock:
;; Initialize the object, telling LLVM that it is now live.
;; Java has type-tags on objects, so it doesn't need any
;; metadata.
call void %llvm.gcroot(%Object** %X, sbyte* null)
...
;; As the pointer goes out of scope, store a null value into
;; it, to indicate that the value is no longer live.
store %Object* null, %Object** %X
...
</pre>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection">
<a name="allocate">Allocating memory from the GC</a>
</div>
<div class="doc_text">
<div class="doc_code"><tt>
sbyte *%llvm_gc_allocate(unsigned %Size)
</tt></div>
<p>The <tt>llvm_gc_allocate</tt> function is a global function defined by the
garbage collector implementation to allocate memory. It returns a
zeroed-out block of memory of the appropriate size.</p>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection">
<a name="barriers">Reading and writing references to the heap</a>
</div>
<div class="doc_text">
<div class="doc_code"><tt>
sbyte *%llvm.gcread(sbyte *, sbyte **)<br>
void %llvm.gcwrite(sbyte*, sbyte*, sbyte**)
</tt></div>
<p>Several of the more interesting garbage collectors (e.g., generational
collectors) need to be informed when the mutator (the program that needs garbage
collection) reads or writes object references into the heap. In the case of a
generational collector, it needs to keep track of which "old" generation objects
have references stored into them. The amount of code that typically needs to be
executed is usually quite small (and not on the critical path of any
computation), so the overall performance impact of the inserted code is
tolerable.</p>
<p>To support garbage collectors that use read or write barriers, LLVM provides
the <tt>llvm.gcread</tt> and <tt>llvm.gcwrite</tt> intrinsics. The first
intrinsic has exactly the same semantics as a non-volatile LLVM load and the
second has the same semantics as a non-volatile LLVM store, with the
additions that they also take a pointer to the start of the memory
object as an argument. At code generation
time, these intrinsics are replaced with calls into the garbage collector
(<tt><a href="#llvm_gc_readwrite">llvm_gc_read</a></tt> and <tt><a
href="#llvm_gc_readwrite">llvm_gc_write</a></tt> respectively), which are then
inlined into the code.
</p>
<p>
If you are writing a front-end for a garbage collected language, every load or
store of a reference from or to the heap should use these intrinsics instead of
normal LLVM loads/stores.</p>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection">
<a name="initialize">Garbage collector startup and initialization</a>
</div>
<div class="doc_text">
<div class="doc_code"><tt>
void %llvm_gc_initialize(unsigned %InitialHeapSize)
</tt></div>
<p>
The <tt>llvm_gc_initialize</tt> function should be called once before any other
garbage collection functions are called. This gives the garbage collector the
chance to initialize itself and allocate the heap spaces. The initial heap size
to allocate should be specified as an argument.
</p>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection">
<a name="explicit">Explicit invocation of the garbage collector</a>
</div>
<div class="doc_text">
<div class="doc_code"><tt>
void %llvm_gc_collect()
</tt></div>
<p>
The <tt>llvm_gc_collect</tt> function is exported by the garbage collector
implementations to provide a full collection, even when the heap is not
exhausted. This can be used by end-user code as a hint, and may be ignored by
the garbage collector.
</p>
</div>
<!-- *********************************************************************** -->
<div class="doc_section">
<a name="gcimpl">Implementing a garbage collector</a>
</div>
<!-- *********************************************************************** -->
<div class="doc_text">
<p>
Implementing a garbage collector for LLVM is fairly straight-forward. The LLVM
garbage collectors are provided in a form that makes them easy to link into the
language-specific runtime that a language front-end would use. They require
functionality from the language-specific runtime to get information about <a
href="#gcdescriptors">where pointers are located in heap objects</a>.
</p>
<p>The
implementation must include the <a
href="#allocate"><tt>llvm_gc_allocate</tt></a> and <a
href="#explicit"><tt>llvm_gc_collect</tt></a> functions, and it must implement
the <a href="#llvm_gc_readwrite">read/write barrier</a> functions as well. To
do this, it will probably have to <a href="#traceroots">trace through the roots
from the stack</a> and understand the <a href="#gcdescriptors">GC descriptors
for heap objects</a>. Luckily, there are some <a href="#gcimpls">example
implementations</a> available.
</p>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection">
<a name="llvm_gc_readwrite">Implementing <tt>llvm_gc_read</tt> and <tt>llvm_gc_write</tt></a>
</div>
<div class="doc_text">
<div class="doc_code"><tt>
void *llvm_gc_read(void*, void **)<br>
void llvm_gc_write(void*, void *, void**)
</tt></div>
<p>
These functions <i>must</i> be implemented in every garbage collector, even if
they do not need read/write barriers. In this case, just load or store the
pointer, then return.
</p>
<p>
If an actual read or write barrier is needed, it should be straight-forward to
implement it.
</p>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection">
<a name="callbacks">Callback functions used to implement the garbage collector</a>
</div>
<div class="doc_text">
<p>
Garbage collector implementations make use of call-back functions that are
implemented by other parts of the LLVM system.
</p>
</div>
<!--_________________________________________________________________________-->
<div class="doc_subsubsection">
<a name="traceroots">Tracing GC pointers from the program stack</a>
</div>
<div class="doc_text">
<div class="doc_code"><tt>
void llvm_cg_walk_gcroots(void (*FP)(void **Root, void *Meta));
</tt></div>
<p>
The <tt>llvm_cg_walk_gcroots</tt> function is a function provided by the code
generator that iterates through all of the GC roots on the stack, calling the
specified function pointer with each record. For each GC root, the address of
the pointer and the meta-data (from the <a
href="#gcroot"><tt>llvm.gcroot</tt></a> intrinsic) are provided.
</p>
</div>
<!--_________________________________________________________________________-->
<div class="doc_subsubsection">
<a name="staticroots">Tracing GC pointers from static roots</a>
</div>
<div class="doc_text">
TODO
</div>
<!--_________________________________________________________________________-->
<div class="doc_subsubsection">
<a name="gcdescriptors">Tracing GC pointers from heap objects</a>
</div>
<div class="doc_text">
<p>
The three most common ways to keep track of where pointers live in heap objects
are (listed in order of space overhead required):</p>
<ol>
<li>In languages with polymorphic objects, pointers from an object header are
usually used to identify the GC pointers in the heap object. This is common for
object-oriented languages like Self, Smalltalk, Java, or C#.</li>
<li>If heap objects are not polymorphic, often the "shape" of the heap can be
determined from the roots of the heap or from some other meta-data [<a
href="#appel89">Appel89</a>, <a href="#goldberg91">Goldberg91</a>, <a
href="#tolmach94">Tolmach94</a>]. In this case, the garbage collector can
propagate the information around from meta data stored with the roots. This
often eliminates the need to have a header on objects in the heap. This is
common in the ML family.</li>
<li>If all heap objects have pointers in the same locations, or pointers can be
distinguished just by looking at them (e.g., the low order bit is clear), no
book-keeping is needed at all. This is common for Lisp-like languages.</li>
</ol>
<p>The LLVM garbage collectors are capable of supporting all of these styles of
language, including ones that mix various implementations. To do this, it
allows the source-language to associate meta-data with the <a
href="#roots">stack roots</a>, and the heap tracing routines can propagate the
information. In addition, LLVM allows the front-end to extract GC information
from in any form from a specific object pointer (this supports situations #1 and
#3).
</p>
<p><b>Making this efficient</b></p>
</div>
<!-- *********************************************************************** -->
<div class="doc_section">
<a name="gcimpls">GC implementations available</a>
</div>
<!-- *********************************************************************** -->
<div class="doc_text">
<p>
To make this more concrete, the currently implemented LLVM garbage collectors
all live in the <tt>llvm/runtime/GC/*</tt> directories in the LLVM source-base.
If you are interested in implementing an algorithm, there are many interesting
possibilities (mark/sweep, a generational collector, a reference counting
collector, etc), or you could choose to improve one of the existing algorithms.
</p>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection">
<a name="semispace">SemiSpace - A simple copying garbage collector</a>
</div>
<div class="doc_text">
<p>
SemiSpace is a very simple copying collector. When it starts up, it allocates
two blocks of memory for the heap. It uses a simple bump-pointer allocator to
allocate memory from the first block until it runs out of space. When it runs
out of space, it traces through all of the roots of the program, copying blocks
to the other half of the memory space.
</p>
</div>
<!--_________________________________________________________________________-->
<div class="doc_subsubsection">
Possible Improvements
</div>
<div class="doc_text">
<p>
If a collection cycle happens and the heap is not compacted very much (say less
than 25% of the allocated memory was freed), the memory regions should be
doubled in size.</p>
</div>
<!-- *********************************************************************** -->
<div class="doc_section">
<a name="references">References</a>
</div>
<!-- *********************************************************************** -->
<div class="doc_text">
<p><a name="appel89">[Appel89]</a> Runtime Tags Aren't Necessary. Andrew
W. Appel. Lisp and Symbolic Computation 19(7):703-705, July 1989.</p>
<p><a name="goldberg91">[Goldberg91]</a> Tag-free garbage collection for
strongly typed programming languages. Benjamin Goldberg. ACM SIGPLAN
PLDI'91.</p>
<p><a name="tolmach94">[Tolmach94]</a> Tag-free garbage collection using
explicit type parameters. Andrew Tolmach. Proceedings of the 1994 ACM
conference on LISP and functional programming.</p>
</div>
<!-- *********************************************************************** -->
<hr>
<address>
<a href="http://jigsaw.w3.org/css-validator/check/referer"><img
src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a>
<a href="http://validator.w3.org/check/referer"><img
src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!"></a>
<a href="mailto:sabre@nondot.org">Chris Lattner</a><br>
<a href="http://llvm.cs.uiuc.edu">LLVM Compiler Infrastructure</a><br>
Last modified: $Date$
</address>
</body>
</html>

File diff suppressed because it is too large Load Diff

View File

@@ -1,12 +1,49 @@
By Chris:
LLVM has been designed with two primary goals in mind. First we strive to enable the best possible division of labor between static and dynamic compilers, and second, we need a flexible and powerful interface between these two complementary stages of compilation. We feel that providing a solution to these two goals will yield an excellent solution to the performance problem faced by modern architectures and programming languages.
LLVM has been designed with two primary goals in mind. First we strive to
enable the best possible division of labor between static and dynamic
compilers, and second, we need a flexible and powerful interface
between these two complementary stages of compilation. We feel that
providing a solution to these two goals will yield an excellent solution
to the performance problem faced by modern architectures and programming
languages.
A key insight into current compiler and runtime systems is that a compiler may fall in anywhere in a "continuum of compilation" to do its job. On one side, scripting languages statically compile nothing and dynamically compile (or equivalently, interpret) everything. On the far other side, traditional static compilers process everything statically and nothing dynamically. These approaches have typically been seen as a tradeoff between performance and portability. On a deeper level, however, there are two reasons that optimal system performance may be obtained by a system somewhere in between these two extremes: Dynamic application behavior and social constraints.
A key insight into current compiler and runtime systems is that a
compiler may fall in anywhere in a "continuum of compilation" to do its
job. On one side, scripting languages statically compile nothing and
dynamically compile (or equivalently, interpret) everything. On the far
other side, traditional static compilers process everything statically and
nothing dynamically. These approaches have typically been seen as a
tradeoff between performance and portability. On a deeper level, however,
there are two reasons that optimal system performance may be obtained by a
system somewhere in between these two extremes: Dynamic application
behavior and social constraints.
From a technical perspective, pure static compilation cannot ever give optimal performance in all cases, because applications have varying dynamic behavior that the static compiler cannot take into consideration. Even compilers that support profile guided optimization generate poor code in the real world, because using such optimization tunes that application to one particular usage pattern, whereas real programs (as opposed to benchmarks) often have several different usage patterns.
From a technical perspective, pure static compilation cannot ever give
optimal performance in all cases, because applications have varying dynamic
behavior that the static compiler cannot take into consideration. Even
compilers that support profile guided optimization generate poor code in
the real world, because using such optimization tunes that application
to one particular usage pattern, whereas real programs (as opposed to
benchmarks) often have several different usage patterns.
On a social level, static compilation is a very shortsighted solution to the performance problem. Instruction set architectures (ISAs) continuously evolve, and each implementation of an ISA (a processor) must choose a set of tradeoffs that make sense in the market context that it is designed for. With every new processor introduced, the vendor faces two fundamental problems: First, there is a lag time between when a processor is introduced to when compilers generate quality code for the architecture. Secondly, even when compilers catch up to the new architecture there is often a large body of legacy code that was compiled for previous generations and will not or can not be upgraded. Thus a large percentage of code running on a processor may be compiled quite sub-optimally for the current characteristics of the dynamic execution environment.
For these reasons, LLVM has been designed from the beginning as a long-term solution to these problems. Its design allows the large body of platform independent, static, program optimizations currently in compilers to be reused unchanged in their current form. It also provides important static type information to enable powerful dynamic and link time optimizations to be performed quickly and efficiently. This combination enables an increase in effective system performance for real world environments.
On a social level, static compilation is a very shortsighted solution to
the performance problem. Instruction set architectures (ISAs) continuously
evolve, and each implementation of an ISA (a processor) must choose a set
of tradeoffs that make sense in the market context that it is designed for.
With every new processor introduced, the vendor faces two fundamental
problems: First, there is a lag time between when a processor is introduced
to when compilers generate quality code for the architecture. Secondly,
even when compilers catch up to the new architecture there is often a large
body of legacy code that was compiled for previous generations and will
not or can not be upgraded. Thus a large percentage of code running on a
processor may be compiled quite sub-optimally for the current
characteristics of the dynamic execution environment.
For these reasons, LLVM has been designed from the beginning as a long-term
solution to these problems. Its design allows the large body of platform
independent, static, program optimizations currently in compilers to be
reused unchanged in their current form. It also provides important static
type information to enable powerful dynamic and link time optimizations
to be performed quickly and efficiently. This combination enables an
increase in effective system performance for real world environments.

View File

@@ -1,61 +1,71 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><title>How to submit an LLVM bug report</title></head>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>How to submit an LLVM bug report</title>
<link rel="stylesheet" href="llvm.css" type="text/css">
</head>
<body>
<body bgcolor=white>
<div class="doc_title">
How to submit an LLVM bug report
</div>
<table width="100%" bgcolor="#330077" border=0 cellpadding=4 cellspacing=0>
<tr><td>&nbsp; <font size=+3 color="#EEEEFF" face="Georgia,Palatino,Times,Roman"><b>How to submit an LLVM bug report</b></font></td>
</tr></table>
<table border="0" width="100%">
<tr>
<td valign="top">
<table border=0 width=100%>
<tr><td valign=top>
<p><font size=+1>
<ol>
<li><a href="#introduction">Introduction - Got bugs?</a>
<li><a href="#introduction">Introduction - Got bugs?</a></li>
<li><a href="#crashers">Crashing Bugs</a>
<ul>
<li><a href="#front-end">Front-end bugs</a>
<li><a href="#gccas">GCCAS bugs</a>
<li><a href="#gccld">GCCLD bugs</a>
<li><a href="#passes">Bugs in LLVM passes</a>
</ul>
<li><a href="#miscompilations">Miscompilations</a>
<li><a href="#codegen">Incorrect code generation (JIT and LLC)</a>
</ul></li>
<li><a href="#miscompilations">Miscompilations</a></li>
<li><a href="#codegen">Incorrect code generation (JIT and LLC)</a></li>
<p><b>Written by <a href="mailto:sabre@nondot.org">Chris Lattner</a> and
<a href="http://misha.brukman.net">Misha Brukman</a></b><p>
</ol><p></font>
</td><td valign=top align=right>
<img src="Debugging.gif" width=444 height=314>
</td></tr>
</ol>
<div class="doc_author">
<p>Written by <a href="mailto:sabre@nondot.org">Chris Lattner</a> and
<a href="http://misha.brukman.net">Misha Brukman</a></p>
</div>
</td>
<td align="right">
<img src="img/Debugging.gif" alt="Debugging" width="444" height="314">
</td>
</tr>
</table>
<!-- *********************************************************************** -->
<table width="100%" bgcolor="#330077" border=0 cellpadding=4 cellspacing=0>
<tr><td align=center><font color="#EEEEFF" size=+2 face="Georgia,Palatino"><b>
<a name="introduction">Introduction - Got bugs?
</b></font></td></tr></table><ul>
<div class="doc_section">
<a name="introduction">Introduction - Got bugs?</a>
</div>
<!-- *********************************************************************** -->
If you're working with LLVM and run into a bug, we definitely want to know about
it. This document describes what you can do to increase the odds of getting it
fixed quickly.<p>
<div class="doc_text">
Basically you have to do two things at a minimum. First, decide whether the bug
<a href="#crashers">crashes the compiler</a> (or an LLVM pass), or if the
<p>If you're working with LLVM and run into a bug, we definitely want to know
about it. This document describes what you can do to increase the odds of
getting it fixed quickly.</p>
<p>Basically you have to do two things at a minimum. First, decide whether the
bug <a href="#crashers">crashes the compiler</a> (or an LLVM pass), or if the
compiler is <a href="#miscompilations">miscompiling</a> the program. Based on
what type of bug it is, follow the instructions in the linked section to narrow
down the bug so that the person who fixes it will be able to find the problem
more easily.<p>
more easily.</p>
<p>Once you have a reduced test-case, go to <a
href="http://llvm.cs.uiuc.edu/bugs/enter_bug.cgi">the LLVM Bug Tracking
System</a>, select the category in which the bug falls, and fill out the form
with the necessary details. The bug description should contain the following
information:</p>
Once you have a reduced test-case, go to
<a href="http://llvm.cs.uiuc.edu/bugs/enter_bug.cgi">
the LLVM Bug Tracking System,
</a>
select the catagory in which the bug falls, and fill out the form with the
necessary details. The bug description should contain the following
information:
<ul>
<li>All information necessary to reproduce the problem.</li>
<li>The reduced test-case that triggers the bug.</li>
@@ -63,218 +73,288 @@ information:
repository).</li>
</ul>
<p>
Thanks for helping us make LLVM better!<p>
<p>Thanks for helping us make LLVM better!</p>
</div>
<!-- *********************************************************************** -->
</ul><table width="100%" bgcolor="#330077" border=0 cellpadding=4 cellspacing=0>
<tr><td align=center><font color="#EEEEFF" size=+2 face="Georgia,Palatino"><b>
<a name="crashers">Crashing Bugs
</b></font></td></tr></table><ul>
<div class="doc_section">
<a name="crashers">Crashing Bugs</a>
</div>
<!-- *********************************************************************** -->
More often than not, bugs in the compiler cause it to crash - often due to an
<div class="doc_text">
<p>More often than not, bugs in the compiler cause it to crash - often due to an
assertion failure of some sort. If you are running <tt><b>opt</b></tt> or
<tt><b>analyze</b></tt> directly, and something crashes, jump to the section on
<a href="#passes">bugs in LLVM passes</a>. Otherwise, the most important
piece of the puzzle is to figure out if it is the GCC-based front-end that is
buggy or if it's one of the LLVM tools that has problems.<p>
buggy or if it's one of the LLVM tools that has problems.</p>
To figure out which program is crashing (the front-end, <tt><b>gccas</b></tt>,
or <tt><b>gccld</b></tt>), run the <tt><b>llvm-gcc</b></tt> command line as you
were when the crash occurred, but add a <tt>-v</tt> option to the command line.
The compiler will print out a bunch of stuff, and should end with telling you
that one of <tt><b>cc1</b></tt>, <tt><b>gccas</b></tt>, or <tt><b>gccld</b></tt>
crashed.<p>
<p>To figure out which program is crashing (the front-end,
<tt><b>gccas</b></tt>, or <tt><b>gccld</b></tt>), run the
<tt><b>llvm-gcc</b></tt> command line as you were when the crash occurred, but
add a <tt>-v</tt> option to the command line. The compiler will print out a
bunch of stuff, and should end with telling you that one of
<tt><b>cc1</b>/<b>cc1plus</b></tt>, <tt><b>gccas</b></tt>, or
<tt><b>gccld</b></tt> crashed.</p>
<ul>
<li>If <tt><b>cc1</b></tt> crashed, you found a problem with the front-end.
Jump ahead to the section on <a href="#front-end">front-end bugs</a>.
<li>If <tt><b>gccas</b></tt> crashed, you found a bug in <a href="#gccas">one of
the passes in <tt><b>gccas</b></tt></a>.
<li>If <tt><b>gccld</b></tt> crashed, you found a bug in <a href="#gccld">one
of the passes in <tt><b>gccld</b></tt></a>.
<li>Otherwise, something really weird happened. Email the list with what you
have at this point.
</ul><p>
<li>If <tt><b>cc1</b></tt> or <tt><b>cc1plus</b></tt> crashed, you found a
problem with the front-end.
Jump ahead to the section on <a href="#front-end">front-end bugs</a>.</li>
<li>If <tt><b>gccas</b></tt> crashed, you found a bug in <a href="#gccas">one
of the passes in <tt><b>gccas</b></tt></a>.</li>
<li>If <tt><b>gccld</b></tt> crashed, you found a bug in <a href="#gccld">one
of the passes in <tt><b>gccld</b></tt></a>.</li>
<li>Otherwise, something really weird happened. Email the list with what you
have at this point.</li>
</ul>
</div>
<!-- ======================================================================= -->
</ul><table width="100%" bgcolor="#441188" border=0 cellpadding=4 cellspacing=0>
<tr><td>&nbsp;</td><td width="100%">&nbsp;
<font color="#EEEEFF" face="Georgia,Palatino"><b>
<a name="front-end">Front-end bugs
</b></font></td></tr></table><ul>
<div class="doc_subsection">
<a name="front-end">Front-end bugs</a>
</div>
If the problem is in the front-end, you should re-run the same
<div class="doc_text">
<p>If the problem is in the front-end, you should re-run the same
<tt>llvm-gcc</tt> command that resulted in the crash, but add the
<tt>-save-temps</tt> option. The compiler will crash again, but it
will leave behind a <tt><i>foo</i>.i</tt> file (containing preprocessed
C source code) and possibly <tt><i>foo</i>.s</tt> (containing LLVM
assembly code), for each compiled <tt><i>foo</i>.c</tt> file. Send us
the <tt><i>foo</i>.i</tt> file, along with a brief description of the
error it caused.<p>
<tt>-save-temps</tt> option. The compiler will crash again, but it will leave
behind a <tt><i>foo</i>.i</tt> file (containing preprocessed C source code) and
possibly <tt><i>foo</i>.s</tt> (containing LLVM assembly code), for each
compiled <tt><i>foo</i>.c</tt> file. Send us the <tt><i>foo</i>.i</tt> file,
along with a brief description of the error it caused.</p>
</div>
<!-- ======================================================================= -->
</ul><table width="100%" bgcolor="#441188" border=0 cellpadding=4 cellspacing=0>
<tr><td>&nbsp;</td><td width="100%">&nbsp;
<font color="#EEEEFF" face="Georgia,Palatino"><b>
<a name="gccas">GCCAS bugs
</b></font></td></tr></table><ul>
<div class="doc_subsection">
<a name="gccas">GCCAS bugs</a>
</div>
If you find that a bug crashes in the <tt><b>gccas</b></tt> stage of
<div class="doc_text">
<p>If you find that a bug crashes in the <tt><b>gccas</b></tt> stage of
compilation, compile your test-case to a <tt>.s</tt> file with the
<tt>-save-temps</tt> option to <tt><b>llvm-gcc</b></tt>. Then run:<p>
<tt>-save-temps</tt> option to <tt><b>llvm-gcc</b></tt>. Then run:</p>
<pre>
<b>gccas</b> -debug-pass=Arguments &lt; /dev/null -o - &gt; /dev/null
</pre><p>
<div class="doc_code">
<p><tt><b>gccas</b> -debug-pass=Arguments &lt; /dev/null -o - &gt; /dev/null</tt></p>
</div>
... which will print a list of arguments, indicating the list of passes that
<p>... which will print a list of arguments, indicating the list of passes that
<tt><b>gccas</b></tt> runs. Once you have the input file and the list of
passes, go to the section on <a href="#passes">debugging bugs in LLVM
passes</a>.<p>
passes</a>.</p>
</div>
<!-- ======================================================================= -->
</ul><table width="100%" bgcolor="#441188" border=0 cellpadding=4 cellspacing=0>
<tr><td>&nbsp;</td><td width="100%">&nbsp;
<font color="#EEEEFF" face="Georgia,Palatino"><b>
<a name="gccld">GCCLD bugs
</b></font></td></tr></table><ul>
<div class="doc_subsection">
<a name="gccld">GCCLD bugs</a>
</div>
If you find that a bug crashes in the <tt><b>gccld</b></tt> stage of
<div class="doc_text">
<p>If you find that a bug crashes in the <tt><b>gccld</b></tt> stage of
compilation, gather all of the <tt>.o</tt> bytecode files and libraries that are
being linked together (the "<tt><b>llvm-gcc</b> -v</tt>" output should include
the full list of objects linked). Then run:<p>
the full list of objects linked). Then run:</p>
<pre>
<b>llvm-as</b> &lt; /dev/null &gt; null.bc
<b>gccld</b> -debug-pass=Arguments null.bc
</pre><p>
<div class="doc_code">
<p><tt><b>llvm-as</b> &lt; /dev/null &gt; null.bc<br>
<b>gccld</b> -debug-pass=Arguments null.bc</tt>
</p>
</div>
... which will print a list of arguments, indicating the list of passes that
<p>... which will print a list of arguments, indicating the list of passes that
<tt><b>gccld</b></tt> runs. Once you have the input files and the list of
passes, go to the section on <a href="#passes">debugging bugs in LLVM
passes</a>.<p>
passes</a>.</p>
</div>
<!-- ======================================================================= -->
</ul><table width="100%" bgcolor="#441188" border=0 cellpadding=4 cellspacing=0>
<tr><td>&nbsp;</td><td width="100%">&nbsp;
<font color="#EEEEFF" face="Georgia,Palatino"><b>
<a name="passes">Bugs in LLVM passes
</b></font></td></tr></table><ul>
<div class="doc_subsection">
<a name="passes">Bugs in LLVM passes</a>
</div>
At this point, you should have some number of LLVM assembly files or bytecode
<div class="doc_text">
<p>At this point, you should have some number of LLVM assembly files or bytecode
files and a list of passes which crash when run on the specified input. In
order to reduce the list of passes (which is probably large) and the input to
something tractable, use the <tt><b>bugpoint</b></tt> tool as follows:<p>
something tractable, use the <tt><b>bugpoint</b></tt> tool as follows:</p>
<pre>
<b>bugpoint</b> &lt;input files&gt; &lt;list of passes&gt;
</pre><p>
<div class="doc_code">
<p><tt><b>bugpoint</b> &lt;input files&gt; &lt;list of passes&gt;</tt></p>
</div>
<tt><b>bugpoint</b></tt> will print a bunch of output as it reduces the
test-case, but it should eventually print something like this:<p>
<p><tt><b>bugpoint</b></tt> will print a bunch of output as it reduces the
test-case, but it should eventually print something like this:</p>
<pre>
...
Emitted bytecode to 'bugpoint-reduced-simplified.bc'
<div class="doc_code">
<p><tt>
...<br>
Emitted bytecode to 'bugpoint-reduced-simplified.bc'<br>
<br>
*** You can reproduce the problem with: opt bugpoint-reduced-simplified.bc -licm<br>
</tt></p>
</div>
*** You can reproduce the problem with: opt bugpoint-reduced-simplified.bc -licm
</pre><p>
Once you complete this, please send the LLVM bytecode file and the command line
to reproduce the problem to the llvmbugs mailing list.<p>
<p>Once you complete this, please send the LLVM bytecode file and the command
line to reproduce the problem to the llvmbugs mailing list.</p>
</div>
<!-- *********************************************************************** -->
</ul><table width="100%" bgcolor="#330077" border=0 cellpadding=4 cellspacing=0>
<tr><td align=center><font color="#EEEEFF" size=+2 face="Georgia,Palatino"><b>
<a name="miscompilations">Miscompilations</a>
</b></font></td></tr></table><ul>
<div class="doc_section">
<a name="miscompilations">Miscompilations</a>
</div>
<!-- *********************************************************************** -->
A miscompilation occurs when a pass does not correctly transform a program, thus
producing errors that are only noticed during execution. This is different from
producing invalid LLVM code (i.e., code not in SSA form, using values before
defining them, etc.) which the verifier will check for after a pass finishes its
run.<p>
<div class="doc_text">
To debug a miscompilation, you should choose which program you wish to run the
output through, e.g. C backend, the JIT, or LLC, and a selection of passes, one
of which may be causing the error, and run, for example:
<p>A miscompilation occurs when a pass does not correctly transform a program,
thus producing errors that are only noticed during execution. This is different
from producing invalid LLVM code (i.e., code not in SSA form, using values
before defining them, etc.) which the verifier will check for after a pass
finishes its run.</p>
<pre>
<b>bugpoint</b> -run-cbe [... optimization passes ...] file-to-test.bc
</pre>
<p>If it looks like the LLVM compiler is miscompiling a program, the very first
thing to check is to make sure it is not using undefined behavior. In
particular, check to see if the program <a
href="http://valgrind.kde.org/">valgrind</a>s clean, passes purify, or some
other memory checker tool. Many of the "LLVM bugs" that we have chased down
ended up being bugs in the program being compiled, not LLVM.</p>
<tt>bugpoint</tt> will try to narrow down your list of passes to the one pass
<p>Once you determine that the program itself is not buggy, you should choose
which code generator you wish to compile the program with (e.g. C backend, the
JIT, or LLC) and optionally a series of LLVM passes to run. For example:</p>
<div class="doc_code">
<p><tt>
<b>bugpoint</b> -run-cbe [... optzn passes ...] file-to-test.bc --args -- [program arguments]</tt></p>
</div>
<p><tt>bugpoint</tt> will try to narrow down your list of passes to the one pass
that causes an error, and simplify the bytecode file as much as it can to assist
you. It will print a message letting you know how to reproduce the resulting
error.
error.</p>
</div>
<!-- *********************************************************************** -->
</ul><table width="100%" bgcolor="#330077" border=0 cellpadding=4 cellspacing=0>
<tr><td align=center><font color="#EEEEFF" size=+2 face="Georgia,Palatino"><b>
<a name="codegen">Incorrect code generation</a>
</b></font></td></tr></table><ul>
<div class="doc_section">
<a name="codegen">Incorrect code generation</a>
</div>
<!-- *********************************************************************** -->
Similarly to debugging incorrect compilation by mis-behaving passes, you can
<div class="doc_text">
<p>Similarly to debugging incorrect compilation by mis-behaving passes, you can
debug incorrect code generation by either LLC or the JIT, using
<tt>bugpoint</tt>. The process <tt>bugpoint</tt> follows in this case is to try
to narrow the code down to a function that is miscompiled by one or the other
method, but since for correctness, the entire program must be run,
<tt>bugpoint</tt> will compile the code it deems to not be affected with the C
Backend, and then link in the shared object it generates.<p>
Backend, and then link in the shared object it generates.</p>
To debug the JIT:
<p>To debug the JIT:</p>
<div class="doc_code">
<pre>
<b>bugpoint</b> -run-jit -output=[correct output file] [bytecodefile]
bugpoint -run-jit -output=[correct output file] [bytecode file] \
--tool-args -- [arguments to pass to lli] \
--args -- [program arguments]
</pre>
</div>
Similarly, to debug the LLC, one would run:
<p>Similarly, to debug the LLC, one would run:</p>
<div class="doc_code">
<pre>
<b>bugpoint</b> -run-llc -output=[correct output file] [bytecodefile]
bugpoint -run-llc -output=[correct output file] [bytecode file] \
--tool-args -- [arguments to pass to llc] \
--args -- [program arguments]
</pre>
</div>
At the end of a successful <tt>bugpoint</tt> run, you will be presented
<p><b>Special note:</b> if you are debugging MultiSource or SPEC tests that
already exist in the <tt>llvm/test</tt> hierarchy, there is an easier way to
debug the JIT, LLC, and CBE, using the pre-written Makefile targets, which
will pass the program options specified in the Makefiles:</p>
<div class="doc_code">
<p><tt>
cd llvm/test/../../program<br>
make bugpoint-jit
</tt></p>
</div>
<p>At the end of a successful <tt>bugpoint</tt> run, you will be presented
with two bytecode files: a <em>safe</em> file which can be compiled with the C
backend and the <em>test</em> file which either LLC or the JIT
mis-codegenerates, and thus causes the error.<p>
mis-codegenerates, and thus causes the error.</p>
To reproduce the error that <tt>bugpoint</tt> found, it is sufficient to do the
following:
<p>To reproduce the error that <tt>bugpoint</tt> found, it is sufficient to do
the following:</p>
<ol>
<li>Regenerate the shared object from the safe bytecode file:<br>
<pre>
<b>llvm-dis</b> -c safe.bc -o safe.c<br>
<b>gcc</b> -shared safe.c -o safe.so
</pre></li>
<li>If debugging LLC, compile test bytecode native and link with the shared object:<br>
<pre>
<b>llc</b> test.bc -o test.s -f<br>
gcc test.s safe.so -o test.llc<br>
./test.llc [program options]
</pre></li>
<p>
If debugging the JIT, load the shared object and supply the test bytecode:<br>
<pre>
<b>lli</b> -load=safe.so test.bc [program options]
</pre></li>
<li><p>Regenerate the shared object from the safe bytecode file:</p>
<div class="doc_code">
<p><tt>
<b>llc</b> -march=c safe.bc -o safe.c<br>
<b>gcc</b> -shared safe.c -o safe.so
</tt></p>
</div></li>
<li><p>If debugging LLC, compile test bytecode native and link with the shared
object:</p>
<div class="doc_code">
<p><tt>
<b>llc</b> test.bc -o test.s -f<br>
<b>gcc</b> test.s safe.so -o test.llc<br>
./test.llc [program options]
</tt></p>
</div></li>
<li><p>If debugging the JIT, load the shared object and supply the test
bytecode:</p>
<div class="doc_code">
<p><tt><b>lli</b> -load=safe.so test.bc [program options]</tt></p>
</div></li>
</ol>
<!-- *********************************************************************** -->
</ul>
<!-- *********************************************************************** -->
</div>
<hr><font size-1>
<address><a href="mailto:sabre@nondot.org">Chris Lattner</a></address>
<!-- Created: Tue Aug 6 15:00:33 CDT 2002 -->
<!-- hhmts start -->
Last modified: Tue Oct 14 15:57:47 CDT 2003
<!-- hhmts end -->
</font></body></html>
<!-- *********************************************************************** -->
<hr>
<address>
<a href="http://jigsaw.w3.org/css-validator/check/referer"><img
src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a>
<a href="http://validator.w3.org/check/referer"><img
src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /></a>
<a href="mailto:sabre@nondot.org">Chris Lattner</a><br>
<a href="http://llvm.cs.uiuc.edu">The LLVM Compiler Infrastructure</a>
<br>
Last modified: $Date$
</address>
</body>
</html>

View File

@@ -0,0 +1,180 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<link rel="stylesheet" href="llvm.css" type="text/css">
<title>LLVM vs. the World - Comparing Compilers to Compilers</title>
</head>
<body>
<div class="doc_title">
LLVM vs. the World - Comparing Compilers to Compilers
</div>
<ol>
<li><a href="#introduction">Introduction</a></li>
<li><a href="#generalapplicability">General Applicability</a></li>
<li><a href="#typesystem">Type System</a></li>
<li><a href="#dataflowinformation">Control-flow and Data-flow Information</a></li>
<li><a href="#registers">Registers</a></li>
<li><a href="#programmerinterface">Programmer Interface</a></li>
<li><a href="#codeemission">Machine Code Emission</a></li>
</ol>
<div class="doc_author">
<p>Written by Brian R. Gaeke</p>
</div>
<!-- *********************************************************************** -->
<div class="doc_section">
<a name="introduction">Introduction</a>
</div>
<!-- *********************************************************************** -->
<div class="doc_text">
<p>Whether you are a stranger to LLVM or not, and whether you are considering
using it for your projects or not, you may find it useful to understand how we
compare ourselves to other well-known compilers. The following list of points
should help you understand -- from our point of view -- some of the important
ways in which we see LLVM as different from other selected compilers and
code generation systems.</p>
<p>At the moment, we only compare ourselves below to <a
href="http://gcc.gnu.org/">GCC</a> and <a
href="http://www.gnu.org/software/lightning/">GNU lightning</a>, but we will try
to revise and expand it as our knowledge and experience permit. Contributions are
welcome.</p>
</div>
<!-- *********************************************************************** -->
<div class="doc_section">
<a name="generalapplicability">General Applicability</a>
</div>
<!-- *********************************************************************** -->
<div class="doc_text">
<p>GNU lightning: Only currently usable for dynamic runtime emission of binary
machine code to memory. Supports one backend at a time.</p>
<p>LLVM: Supports compilation of C and C++ (with more languages coming soon),
strong SSA-based optimization at compile-time, link-time, run-time, and
off-line, and multiple platform backends with Just-in-Time and ahead-of-time
compilation frameworks. (See our document on <a
href="http://llvm.cs.uiuc.edu/pubs/2004-01-30-CGO-LLVM.html">Lifelong
Code Optimization</a> for more.)</p>
<p>GCC: Many relatively mature platform backends support assembly-language code
generation from many source languages. No run-time compilation
support.</p>
</div>
<!-- *********************************************************************** -->
<div class="doc_section">
<a name="typesystem">Type System</a>
</div>
<!-- *********************************************************************** -->
<div class="doc_text">
<p>GNU lightning: C integer types and "void *" are supported. No type checking
is performed. Explicit type casts are not typically necessary unless the
underlying machine-specific types are distinct (e.g., sign- or zero-extension is
apparently necessary, but casting "int" to "void *" would not be.)
Floating-point support may not work on all platforms (it does not appear to be
documented in the latest release).</p>
<p>LLVM: Compositional type system based on C types, supporting structures,
opaque types, and C integer and floating point types. Explicit cast instructions
are required to transform a value from one type to another.</p>
<p>GCC: Union of high-level types including those used in Pascal, C, C++, Ada,
Java, and FORTRAN.</p>
</div>
<!-- *********************************************************************** -->
<div class="doc_section">
<a name="dataflowinformation">Control-flow and Data-flow Information</a>
</div>
<!-- *********************************************************************** -->
<div class="doc_text">
<p>GNU lightning: No data-flow information encoded in the generated program. No
support for calculating CFG or def-use chains over generated programs.</p>
<p>LLVM: Scalar values in Static Single-Assignment form; def-use chains and CFG
always implicitly available and automatically kept up to date.</p>
<p>GCC: Trees and RTL do not directly encode data-flow info; but def-use chains
and CFGs can be calculated on the side. They are not automatically kept up to
date.</p>
</div>
<!-- *********************************************************************** -->
<div class="doc_section">
<a name="registers">Registers</a>
</div>
<!-- *********************************************************************** -->
<div class="doc_text">
<p>GNU lightning: Very small fixed register set -- it takes the least common
denominator of supported platforms; basically it inherits its tiny register set
from IA-32, unnecessarily crippling targets like PowerPC with a large register
set.</p>
<p>LLVM: An infinite register set, reduced to a particular platform's finite
register set by register allocator.</p>
<p>GCC: Trees and RTL provide an arbitrarily large set of values. Reduced to a
particular platform's finite register set by register allocator.</p>
</div>
<!-- *********************************************************************** -->
<div class="doc_section">
<a name="programmerinterface">Programmer Interface</a>
</div>
<!-- *********************************************************************** -->
<div class="doc_text">
<p>GNU lightning: Library interface based on C preprocessor macros that emit
binary code for a particular instruction to memory. No support for manipulating
code before emission.</p>
<p>LLVM: Library interface based on classes representing platform-independent
intermediate code (Instruction) and platform-dependent code (MachineInstr) which
can be manipulated arbitrarily and then emitted to memory.</p>
<p>GCC: Internal header file interface (tree.h) to abstract syntax trees,
representing roughly the union of all possible supported source-language
constructs; also, an internal header file interface (rtl.h, rtl.def) to a
low-level IR called RTL which represents roughly the union of all possible
target machine instructions.</p>
</div>
<!-- *********************************************************************** -->
<div class="doc_section">
<a name="codeemission">Machine Code Emission</a>
</div>
<!-- *********************************************************************** -->
<div class="doc_text">
<p>GNU lightning: Only supports binary machine code emission to memory.</p>
<p>LLVM: Supports writing out assembly language to a file, and binary machine
code to memory, from the same back-end.</p>
<p>GCC: Supports writing out assembly language to a file. No support for
emitting machine code to memory.</p>
</div>
<!-- *********************************************************************** -->
<hr>
<div class="doc_footer">
<address>Brian R. Gaeke</address>
<a href="http://llvm.cs.uiuc.edu">The LLVM Compiler Infrastructure</a>
<br>
Last modified: $Date$
</div>
</body>
</html>

File diff suppressed because it is too large Load Diff

300
llvm/docs/ObjectFiles.html Normal file
View File

@@ -0,0 +1,300 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>
<head>
<title>Object Files: Understanding The Result Of LLVM Compilation</title>
<link rel="stylesheet" href="llvm.css" type="text/css">
</head>
<body>
<div class="doc_title">Object Files: Understanding The Result Of LLVM Compilation</div>
<hr>
<ol>
<li><a href="#abstract">Abstract</a></li>
<li><a href="#introduction">Introduction</a></li>
<li><a href="#files">File Contents</a></li>
<li><a href="#rot">Linkage Rules Of Thumb</a>
<ol>
<li><a href="#always">Always Link vmcore.o, support.a</a>
<li><a href="#placeholder">Placeholder</a>
</ol>
</li>
</ol>
<div class="doc_author">
<p>Written by <a href="mailto:rspencer@x10sys.com">Reid Spencer</a></p>
</div>
<hr>
<!-- ======================================================================= -->
<div class="doc_section"><a name="abstract">Abstract</a></div>
<div class="doc_text">
<p>This document describes the contents of the many objects files and libraries
that are produced by compiling LLVM. To make use of LLVM this information is
needed in order to understand what files should be linked into your program.
</p>
</div>
<!-- ======================================================================= -->
<div class="doc_section"> <a name="introduction">Introduction</a></div>
<div class="doc_text">
<p>If you're writing a compiler, virtual machine, or any other utility for
LLVM, you'll need to figure out which of the many .a (archive) and .o
(object) files you will need to link with to be successful. An
understanding of the contents of these files and their inter-relationships
will be useful in coming up with an optimal specification for the objects
and libraries to link with.
</p>
<p>The purpose of this document is to hopefully reduce some of the trial and
error that the author experienced in using LLVM.
</p>
</div>
<!-- ======================================================================= -->
<div class="doc_section"><a name="files"></a>File Contents</div>
<div class="doc_text">
<p>The table below provides a summary of the basic contents of each file.</p>
<table class="doc_table"
style="width:80%; text-align: left; border: 2px solid blue; border-collapse: collapse;">
<tr class="doc_table">
<td colspan="2" class="doc_section">Summary Of LLVM Library And Object Files
</td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue"><h2><u>Library</u></h2></td>
<td style="border: 2px solid blue"><h2><u>Description</u></h2></td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue">libipo.a</td>
<td style="border: 2px solid blue">
An archive of all inter-procedural optimizations.
</td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue">libscalaropts.a</td>
<td style="border: 2px solid blue">
An archive of all scalar optimizations.
</td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue">libtransforms.a</td>
<td style="border: 2px solid blue">
An archive of just the level raise pass.
</td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue">libtarget.a</td>
<td style="border: 2px solid blue">
An archive containing code generator support for describing
target architectures.
</td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue">libanalysis.a</td>
<td style="border: 2px solid blue">
An archive containing intra-procedural analyses.
</td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue">libdatastructure.a</td>
<td style="border: 2px solid blue">
An archive containing optimizations for data structures.
</td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue">libinstrument.a</td>
<td style="border: 2px solid blue">No idea.</td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue">libregalloc.a</td>
<td style="border: 2px solid blue">Register Allocation code.</td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue">libipa.a</td>
<td style="border: 2px solid blue">
An archive containing inter-procedural analyses</td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue">libtransformutils.a</td>
<td style="border: 2px solid blue">
Utiltities for transformations?
</td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue">libsupport.a</td>
<td style="border: 2px solid blue">General support utilities</td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue">libevar.a</td>
<td style="border: 2px solid blue">Live variable analysis for SPARC</td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue"><h2><u>Object File</u></h2></td>
<td style="border: 2px solid blue"><h2><u>Description</u></h2></td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue">support.o</td>
<td style="border: 2px solid blue">General support utilities</td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue">asmparser.o</td>
<td style="border: 2px solid blue">Assembler Parser</td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue">bcreader.o</td>
<td style="border: 2px solid blue">Byte Code Reader</td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue">bcwriter.o</td>
<td style="border: 2px solid blue">Byte Code Writer</td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue">sched.o</td>
<td style="border: 2px solid blue">SPARC instruction scheduler</td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue">selectiondag.o</td>
<td style="border: 2px solid blue">Aggressive instruction selector for Directed Acyclic Graphs</td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue">transformutils.o</td>
<td style="border: 2px solid blue">Utilities for code transformations</td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue">ipa.o</td>
<td style="border: 2px solid blue">Inter-Procedural Analysis Optimizations</td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue">select.o</td>
<td style="border: 2px solid blue">SPARC instruction selector</td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue">cwriter.o</td>
<td style="border: 2px solid blue">"C" Code Writer</td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue">profpaths.o</td>
<td style="border: 2px solid blue">Path profiling instrumentation</td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue">regalloc.o</td>
<td style="border: 2px solid blue">Register Allocation</td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue">instrument.o</td>
<td style="border: 2px solid blue">Instrumentation? Of What?</td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue">datastructure.o</td>
<td style="border: 2px solid blue">Data Structure Analysis</td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue">codegen.o</td>
<td style="border: 2px solid blue">Native code generation</td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue">livevar.o</td>
<td style="border: 2px solid blue">Live Variable Analysis</td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue">vmcore.o</td>
<td style="border: 2px solid blue">Virtual Machine Core</td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue">lli-interpreter.o</td>
<td style="border: 2px solid blue">Interpreter for LLVM ByteCode</td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue">lli-jit.o</td>
<td style="border: 2px solid blue">
Just-In-Time Compiler For LLVM ByteCode
</td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue">executionengine.o</td>
<td style="border: 2px solid blue">Engine for LLI</td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue">debugger.o</td>
<td style="border: 2px solid blue">Source Level Debugging Support</td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue">analysis.o</td>
<td style="border: 2px solid blue">General Framework For Analysis?</td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue">sparc.o</td>
<td style="border: 2px solid blue">Sun SPARC Processor Specific</td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue">target.o</td>
<td style="border: 2px solid blue">Target Machine Support?</td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue">transforms.o</td>
<td style="border: 2px solid blue">Code Transformations</td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue">x86.o</td>
<td style="border: 2px solid blue">Intel x86 Processor Specific</td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue">powerpc.o</td>
<td style="border: 2px solid blue">PowerPC Processor Specific</td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue">scalaropts.o</td>
<td style="border: 2px solid blue">Optimizations For Scalars</td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue">ipo.o</td>
<td style="border: 2px solid blue">Inter-Procedural Optimization</td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue">trace.o</td>
<td style="border: 2px solid blue">Support For Tracing/Debugging?</td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue">profile_rt.o</td>
<td style="border: 2px solid blue">Runtime Library For Profiler</td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue">sample.o</td>
<td style="border: 2px solid blue">Sample Program ?</td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue">stkr_compiler.o</td>
<td style="border: 2px solid blue">Stacker Language Compiler Library</td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue">stkr_runtime.o</td>
<td style="border: 2px solid blue">Stacker Language Runtime Library</td>
</tr>
</table>
</div>
<p></p>
<!-- ======================================================================= -->
<div class="doc_section"><a name="rot">Linkage Rules Of Thumb</a></div>
<div class="doc_text">
<p>This section contains various "rules of thumb" about what files you
should link into your programs.</p>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection"><a name="always">Always Link vmcore.o support.a</a>
</div>
<div class="doc_text">
<p>No matter what you do with LLVM, you'll always need to link with vmcore.o
and support.a.</p>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection"><a name="Placeholder">Placeholder</a></div>
<div class="doc_text">
<p>Need more rules of thumb here.</p>
</div>
<!-- ======================================================================= -->
<hr>
<div class="doc_footer">
<address><a href="mailto:rspencer@x10sys.com">Reid Spencer</a></address>
<a href="http://llvm.cs.uiuc.edu">The LLVM Compiler Infrastructure</a>
<br>Last modified: $Date$ </div>
</body>
</html>
<!-- vim: sw=2 ts=2 ai
-->

View File

@@ -1,157 +1,172 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><title>Open LLVM Projects</title></head>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Open LLVM Projects</title>
<link rel="stylesheet" href="llvm.css" type="text/css">
</head>
<body>
<body bgcolor=white>
<center><h1><font size=7>Open LLVM Projects</font></h1></center>
<div class="doc_title">
Open LLVM Projects
</div>
<ul>
<li><a href="#what">What is this?</a>
<li><a href="#what">What is this?</a></li>
<li><a href="#improving">Improving the current system</a>
<ol>
<li><a href="#glibc">Port glibc to LLVM</a>
<li><a href="#NightlyTest">Improving the Nightly Tester</a>
<li><a href="#programs">Compile programs with the LLVM Compiler</a>
<li><a href="#llvm_ir">Extend the LLVM intermediate representation</a>
<li><a href="#misc_imp">Miscellaneous Improvements</a>
</ol>
<li><a href="#code-cleanups">Implementing Code Cleanup bugs</a></li>
<li><a href="#glibc">Port glibc to LLVM</a></li>
<li><a href="#programs">Compile programs with the LLVM Compiler</a></li>
<li><a href="#llvm_ir">Extend the LLVM intermediate representation</a></li>
<li><a href="#misc_imp">Miscellaneous Improvements</a></li>
</ol></li>
<li><a href="#new">Adding new capabilities to LLVM</a>
<ol>
<li><a href="#pointeranalysis">Pointer and Alias Analysis</a>
<li><a href="#profileguided">Profile Guided Optimization</a>
<li><a href="#xforms">New Transformations and Analyses</a>
<li><a href="#x86be">X86 Back-end Improvements</a>
<li><a href="#misc_new">Miscellaneous Additions</a>
</ol>
<li><a href="#newfeaturebugs">Implementing new feature PRs</a></li>
<li><a href="#pointeranalysis">Pointer and Alias Analysis</a></li>
<li><a href="#profileguided">Profile Guided Optimization</a></li>
<li><a href="#xforms">New Transformations and Analyses</a></li>
<li><a href="#x86be">X86 Back-end Improvements</a></li>
<li><a href="#misc_new">Miscellaneous Additions</a></li>
</ol></li>
</ul>
<br><br>
<div class="doc_author">
<p>Written by the <a href="http://llvm.cs.uiuc.edu/">LLVM Team</a></p>
</div>
<!-- *********************************************************************** -->
<table width="100%" bgcolor="#330077" border=0 cellpadding=4 cellspacing=0>
<tr><td align=center><font color="#EEEEFF" size=+2 face="Georgia,Palatino"><b>
<a name="what">What is this?
</b></font></td></tr></table><ul>
<div class="doc_section">
<a name="what">What is this?</a>
</div>
<!-- *********************************************************************** -->
This document is meant to be a sort of "big TODO list" for LLVM. Each project
in this document is something that would be useful for LLVM to have, and would
also be a great way to get familiar with the system. Some of these projects are
small and self-contained, which may be implemented in a couple of days, others
are larger. Several of these projects may lead to interesting research projects
in their own right. In any case, we welcome all contributions.<p>
<div class="doc_text">
If you are thinking about tackling one of these projects, please send a mail to
the <a href="http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev">LLVM
<p>This document is meant to be a sort of "big TODO list" for LLVM. Each
project in this document is something that would be useful for LLVM to have, and
would also be a great way to get familiar with the system. Some of these
projects are small and self-contained, which may be implemented in a couple of
days, others are larger. Several of these projects may lead to interesting
research projects in their own right. In any case, we welcome all
contributions.</p>
<p>If you are thinking about tackling one of these projects, please send a mail
to the <a href="http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev">LLVM
Developer's</a> mailing list, so that we know the project is being worked on.
Additionally this is a good way to get more information about a specific project
or to suggest other projects to add to this page.<p>
or to suggest other projects to add to this page.
</p>
<p>The projects in this page are open-ended. More specific projects are
filed as unassigned enhancements in the <a href="http://llvm.cs.uiuc.edu/bugs/">
LLVM bug tracker</a>. See the <a href="http://llvm.cs.uiuc.edu/bugs/buglist.cgi?keywords_type=allwords&amp;keywords=&amp;bug_status=NEW&amp;bug_status=ASSIGNED&amp;bug_status=REOPENED&amp;bug_severity=enhancement&amp;emailassigned_to1=1&amp;emailtype1=substring&amp;email1=unassigned">list of currently outstanding issues</a> if you wish to help improve LLVM.</p>
</div>
<!-- *********************************************************************** -->
</ul><table width="100%" bgcolor="#330077" border=0 cellpadding=4 cellspacing=0>
<tr><td align=center><font color="#EEEEFF" size=+2 face="Georgia,Palatino"><b>
<a name="improving">Improving the current system
</b></font></td></tr></table><ul>
<div class="doc_section">
<a name="improving">Improving the current system</a>
</div>
<!-- *********************************************************************** -->
Improvements to the current infrastructure are always very welcome and tend to
be fairly straight-forward to implement. Here are some of the key areas that
can use improvement...<p>
<div class="doc_text">
<p>Improvements to the current infrastructure are always very welcome and tend
to be fairly straight-forward to implement. Here are some of the key areas that
can use improvement...</p>
</div>
<!-- ======================================================================= -->
</ul><table width="50%" bgcolor="#441188" border=0 cellpadding=4 cellspacing=0>
<tr><td>&nbsp;</td><td width=100%>&nbsp;
<font color="#EEEEFF" size=+1 face="Georgia,Palatino"><b>
<a name="glibc">Port glibc to LLVM
</b></font></td></tr></table><ul>
<div class="doc_subsection">
<a name="code-cleanups">Implementing Code Cleanup bugs</a>
</div>
It would be very useful to <a
href="http://www.gnu.org/software/libc/porting.html">port</a> <a
href="http://www.gnu.org/software/glibc/">glibc</a> to LLVM. This would allow a
<div class="doc_text">
<p>
The <a href="http://llvm.cs.uiuc.edu/bugs/">LLVM bug tracker</a> occasionally
has <a href="http://llvm.cs.uiuc.edu/bugs/buglist.cgi?short_desc_type=allwordssubstr&short_desc=&long_desc_type=allwordssubstr&long_desc=&bug_file_loc_type=allwordssubstr&bug_file_loc=&status_whiteboard_type=allwordssubstr&status_whiteboard=&keywords_type=allwords&keywords=code-cleanup&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&emailassigned_to1=1&emailtype1=substring&email1=&emailassigned_to2=1&emailreporter2=1&emailcc2=1&emailtype2=substring&email2=&bugidtype=include&bug_id=&votes=&changedin=&chfieldfrom=&chfieldto=Now&chfieldvalue=&cmdtype=doit&order=Bug+Number&field0-0-0=noop&type0-0-0=noop&value0-0-0=">"code-cleanup" bugs</a> filed in it. Taking one of these and fixing it is a good
way to get your feet wet in the LLVM code and discover how some of its components
work.
</p>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection">
<a name="glibc">Port glibc to LLVM</a>
</div>
<div class="doc_text">
<p>It would be very useful to <a
href="http://www.gnu.org/software/libc/manual/html_node/Porting.html">port</a> <a
href="http://www.gnu.org/software/libc/">glibc</a> to LLVM. This would allow a
variety of interprocedural algorithms to be much more effective in the face of
library calls. The most important pieces to port are things like the string
library and the <tt>stdio</tt> related functions... low-level system calls like
'<tt>read</tt>' should stay unimplemented in LLVM.<p>
'<tt>read</tt>' should stay unimplemented in LLVM.</p>
</div>
<!-- ======================================================================= -->
</ul><table width="50%" bgcolor="#441188" border=0 cellpadding=4 cellspacing=0>
<tr><td>&nbsp;</td><td width=100%>&nbsp;
<font color="#EEEEFF" size=+1 face="Georgia,Palatino"><b>
<a name="NightlyTest">Improving the Nightly Tester
</b></font></td></tr></table><ul>
<div class="doc_subsection">
<a name="programs">Compile programs with the LLVM Compiler</a>
</div>
The <a href="/testresults/">Nightly Tester</a> is a simple perl script (located
in utils/NightlyTest.pl) which runs every night to generate a daily report. It
could use the following improvements:<p>
<div class="doc_text">
<ol>
<li>Olden timings - Time the compilation and execution times for the Olden
benchmark suite, keeping track of these values over time.
<li>Graphs - It would be great to have gnuplot graphs to keep track of how the
tree is changing over time. We already gather a several statistics, it
just necessary to add the script-fu to gnuplotize it.
<li>Regression tests - We should run the regression tests in addition to the
program tests...
</ol><p>
<!-- ======================================================================= -->
</ul><table width="50%" bgcolor="#441188" border=0 cellpadding=4 cellspacing=0>
<tr><td>&nbsp;</td><td width=100%>&nbsp;
<font color="#EEEEFF" size=+1 face="Georgia,Palatino"><b>
<a name="programs">Compile programs with the LLVM Compiler
</b></font></td></tr></table><ul>
We are always looking for new testcases and benchmarks for use with LLVM. In
<p>We are always looking for new testcases and benchmarks for use with LLVM. In
particular, it is useful to try compiling your favorite C source code with LLVM.
If it doesn't compile, try to figure out why or report it to the <a
href="http://mail.cs.uiuc.edu/pipermail/llvmbugs/">llvm-bugs</a> list. If you
get the program to compile, it would be extremely useful to convert the build
system to be compatible with the LLVM Programs testsuite so that we can check it
into CVS and the automated tester can use it to track progress of the
compiler.<p>
compiler.</p>
When testing a code, try running it with a variety of optimizations, and with
all the back-ends: CBE, llc, and lli.<p>
<p>When testing a code, try running it with a variety of optimizations, and with
all the back-ends: CBE, llc, and lli.</p>
</div>
<!-- ======================================================================= -->
</ul><table width="50%" bgcolor="#441188" border=0 cellpadding=4 cellspacing=0>
<tr><td>&nbsp;</td><td width=100%>&nbsp;
<font color="#EEEEFF" size=+1 face="Georgia,Palatino"><b>
<a name="llvm_ir">Extend the LLVM intermediate representation
</b></font></td></tr></table><ul>
<div class="doc_subsection">
<a name="llvm_ir">Extend the LLVM intermediate representation</a>
</div>
<div class="doc_text">
<ol>
<li>Add a new conditional move instruction: <tt>X = select bool Cond, Y, Z</tt>
<li>Add support for platform independent prefetch support. The GCC <a
<li>Add support for platform-independent prefetch support. The GCC <a
href="http://gcc.gnu.org/projects/prefetch.html">prefetch project</a> page
has a good survey of the prefetching capabilities of a variety of modern
processors.
processors.</li>
</ol>
</div>
<!-- ======================================================================= -->
</ul><table width="50%" bgcolor="#441188" border=0 cellpadding=4 cellspacing=0>
<tr><td>&nbsp;</td><td width=100%>&nbsp;
<font color="#EEEEFF" size=+1 face="Georgia,Palatino"><b>
<a name="misc_imp">Miscellaneous Improvements
</b></font></td></tr></table><ul>
<div class="doc_subsection">
<a name="misc_imp">Miscellaneous Improvements</a>
</div>
<div class="doc_text">
<ol>
<li>Someone needs to look into getting the <tt>ranlib</tt> tool to index LLVM
bytecode files, so that linking in .a files is not hideously slow. They
would also then have to implement the reader for this index in
<tt>gccld</tt>.<br>
<tt>gccld</tt>.</li>
<li>Rework the PassManager to be more flexible</li>
<li>Improve the efficiency of the bytecode loader/writer<br>
<li>Extend the FunctionPassManager to use a ModuleProvider to stream functions
in on demand. This would improve the efficiency of the JIT.
<li>Rework the PassManager to be more flexible
<li>Some transformations and analyses only work on reducible flow graphs. It
would be nice to have a transformation which could be "required" by these passes
which makes irreducible graphs reducible. This can easily be accomplished
@@ -159,124 +174,187 @@ through code duplication. See <a
href="http://citeseer.nj.nec.com/janssen97making.html">Making Graphs Reducible
with Controlled Node Splitting</a> and perhaps <a
href="http://doi.acm.org/10.1145/262004.262005">Nesting of Reducible and
Irreducible Loops</a>.
Irreducible Loops</a>.</li>
</ol>
</div>
<!-- *********************************************************************** -->
</ul><table width="100%" bgcolor="#330077" border=0 cellpadding=4 cellspacing=0>
<tr><td align=center><font color="#EEEEFF" size=+2 face="Georgia,Palatino"><b>
<a name="new">Adding new capabilities to LLVM
</b></font></td></tr></table><ul>
<div class="doc_section">
<a name="new">Adding new capabilities to LLVM</a>
</div>
<!-- *********************************************************************** -->
Sometimes creating new things is more fun that improving existing things. These
projects tend to be more involved and perhaps require more work, but can also be
very rewarding.<p>
<div class="doc_text">
<p>Sometimes creating new things is more fun than improving existing things.
These projects tend to be more involved and perhaps require more work, but can
also be very rewarding.</p>
</div>
<!-- ======================================================================= -->
</ul><table width="50%" bgcolor="#441188" border=0 cellpadding=4 cellspacing=0>
<tr><td>&nbsp;</td><td width=100%>&nbsp;
<font color="#EEEEFF" size=+1 face="Georgia,Palatino"><b>
<a name="pointeranalysis">Pointer and Alias Analysis
</b></font></td></tr></table><ul>
<div class="doc_subsection">
<a name="newfeaturebugs">Implementing new feature PRs</a>
</div>
We have a <a href="AliasAnalysis.html">strong base for development</a> of both
pointer analysis based optimizations as well as pointer analyses themselves. It
seems natural to want to take advantage of this...<p>
<div class="doc_text">
<p>Many ideas for feature requests are stored in LLVM bugzilla. Just <a href="http://llvm.org/bugs/buglist.cgi?short_desc_type=allwordssubstr&short_desc=&long_desc_type=allwordssubstr&long_desc=&bug_file_loc_type=allwordssubstr&bug_file_loc=&status_whiteboard_type=allwordssubstr&status_whiteboard=&keywords_type=allwords&keywords=new-feature&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&emailassigned_to1=1&emailtype1=substring&email1=&emailassigned_to2=1&emailreporter2=1&emailcc2=1&emailtype2=substring&email2=&bugidtype=include&bug_id=&votes=&changedin=&chfieldfrom=&chfieldto=Now&chfieldvalue=&cmdtype=doit&namedcmd=All+PRs&newqueryname=&order=Bug+Number&field0-0-0=noop&type0-0-0=noop&value0-0-0=">search for bugs with a "new-feature" keyword</a>.</p>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection">
<a name="pointeranalysis">Pointer and Alias Analysis</a>
</div>
<div class="doc_text">
<p>We have a <a href="AliasAnalysis.html">strong base for development</a> of
both pointer analysis based optimizations as well as pointer analyses
themselves. It seems natural to want to take advantage of this...</p>
<ol>
<li>Implement a flow-sensitive context-sensitive alias analysis algorithm<br>
- Pick one of the somewhat efficient algorithms, but strive for maximum
precision
<li>Implement a flow-sensitive context-insensitive alias analysis algorithm<br>
- Just an efficient local algorithm perhaps?
precision</li>
<li>Implement an interface to update analyses in response to common code motion
transformations
<li>Implement alias analysis based optimizations:
<li>Implement a flow-sensitive context-insensitive alias analysis algorithm<br>
- Just an efficient local algorithm perhaps?</li>
<li>Implement alias-analysis-based optimizations:
<ul>
<li>Dead store elimination
</ul>
<li>Dead store elimination</li>
<li>...</li>
</ul></li>
</ol>
</div>
<!-- ======================================================================= -->
</ul><table width="50%" bgcolor="#441188" border=0 cellpadding=4 cellspacing=0>
<tr><td>&nbsp;</td><td width=100%>&nbsp;
<font color="#EEEEFF" size=+1 face="Georgia,Palatino"><b>
<a name="profileguided">Profile Guided Optimization
</b></font></td></tr></table><ul>
<div class="doc_subsection">
<a name="profileguided">Profile Guided Optimization</a>
</div>
We are getting to the point where we really need a unified infrastructure for
profile guided optimizations. It would be wonderful to be able to write profile
guided transformations which can be performed either at static compile time
(compile time or offline optimization time) or at runtime in a JIT type setup.
The LLVM transformation itself shouldn't need to know how it is being used.<p>
<div class="doc_text">
Ideas for profile guided transformations:<p>
<p>We now have a unified infrastructure for writing profile-guided
transformations, which will work either at offline-compile-time or in the JIT,
but we don't have many transformations. We would welcome new profile-guided
transformations as well as improvements to the current profiling system.
</p>
<p>Ideas for profile guided transformations:</p>
<ol>
<li>Superblock formation (with many optimizations)
<li>Loop unrolling/peeling
<li>Profile directed inlining
<li>Code layout
<li>...
</ol><p>
<li>Superblock formation (with many optimizations)</li>
<li>Loop unrolling/peeling</li>
<li>Profile directed inlining</li>
<li>Code layout</li>
<li>...</li>
</ol>
<p>Improvements to the existing support:</p>
<ol>
<li>The current block and edge profiling code that gets inserted is very simple
and inefficient. Through the use of control-dependence information, many fewer
counters could be inserted into the code. Also, if the execution count of a
loop is known to be a compile-time or runtime constant, all of the counters in
the loop could be avoided.</li>
<li>You could implement one of the "static profiling" algorithms which analyze a
piece of code an make educated guesses about the relative execution frequencies
of various parts of the code.</li>
<li>You could add path profiling support, or adapt the existing LLVM path
profiling code to work with the generic profiling interfaces.</li>
</ol>
</div>
<!-- ======================================================================= -->
</ul><table width="50%" bgcolor="#441188" border=0 cellpadding=4 cellspacing=0>
<tr><td>&nbsp;</td><td width=100%>&nbsp;
<font color="#EEEEFF" size=+1 face="Georgia,Palatino"><b>
<a name="xforms">New Transformations and Analyses
</b></font></td></tr></table><ul>
<div class="doc_subsection">
<a name="xforms">New Transformations and Analyses</a>
</div>
<div class="doc_text">
<ol>
<li>Implement a Dependence Analysis Infrastructure<br>
- Design some way to represent and query dep analysis
<li>Implement a faster Dominator Set Construction Algorithm<br>
- A linear time or nearly so algorithm
<li>Implement a strength reduction pass
<li>Value range propagation pass
<li>Implement an unswitching pass
<li>Write a loop unroller, with a simple heuristic for when to unroll
- Design some way to represent and query dep analysis</li>
<li>Implement a strength reduction pass</li>
<li>Value range propagation pass</li>
</ol>
</div>
<!-- ======================================================================= -->
</ul><table width="50%" bgcolor="#441188" border=0 cellpadding=4 cellspacing=0>
<tr><td>&nbsp;</td><td width=100%>&nbsp;
<font color="#EEEEFF" size=+1 face="Georgia,Palatino"><b>
<a name="x86be">X86 Back-end Improvements
</b></font></td></tr></table><ul>
<div class="doc_section">
<a name="x86be">X86 Back-end Improvements</a>
</div>
<div class="doc_text">
<ol>
<li>Implement a global register allocator
<li>Implement a better instruction selector
<li>Implement a better instruction selector</li>
<li>Implement support for the "switch" instruction without requiring the
lower-switches pass.
lower-switches pass.</li>
<li>Implement interprocedural register allocation. The CallGraphSCCPass can be
used to implement a bottom-up analysis that will determine the *actual*
registers clobbered by a function. Use the pass to fine tune register usage
in callers based on *actual* registers used by the callee.</li>
</ol>
</div>
<!-- ======================================================================= -->
</ul><table width="50%" bgcolor="#441188" border=0 cellpadding=4 cellspacing=0>
<tr><td>&nbsp;</td><td width=100%>&nbsp;
<font color="#EEEEFF" size=+1 face="Georgia,Palatino"><b>
<a name="misc_new">Miscellaneous Additions
</b></font></td></tr></table><ul>
<div class="doc_section">
<a name="misc_new">Miscellaneous Additions</a>
</div>
<div class="doc_text">
<ol>
<li>Write a new frontend for some language (Java? OCaml? Forth?)
<li>Write a new backend for a target (IA64? MIPS? MMIX?)
<li>Port the <a href="http://www-sop.inria.fr/mimosa/fp/Bigloo/">Bigloo</A>
Scheme compiler, from Manuel Serrano at INRIA Sophia-Antipolis, to
output LLVM bytecode. It seems that it can already output .NET
bytecode, JVM bytecode, and C, so LLVM would ostensibly be another good
candidate.</li>
<li>Write a new frontend for C/C++ <b>in</b> C++, giving us the ability to
directly use LLVM C++ classes from within a compiler rather than use
C-based wrapper functions a la llvm-gcc. One possible starting point is the <a
href="http://www.parashift.com/c++-faq-lite/compiler-dependencies.html#faq-37.11">C++
yacc grammar by Ed Willink</a>.</li>
<li>Write a new frontend for some other language (Java? OCaml? Forth?)</li>
<li>Write a new backend for a target (IA64? MIPS? MMIX?)</li>
<li>Write a disassembler for machine code that would use TableGen to output
<tt>MachineInstr</tt>s for transformations, optimizations, etc.</li>
<li>Random test vector generator: Use a C grammar to generate random C code;
run it through llvm-gcc, then run a random set of passes on it using opt.
Try to crash opt. When opt crashes, use bugpoint to reduce the test case and
mail the result to yourself. Repeat ad infinitum.</li>
<li>Design a simple, recognizable logo.</li>
</ol>
</div>
<!-- *********************************************************************** -->
</ul>
<!-- *********************************************************************** -->
<hr><font size-1>
<address><a href="mailto:sabre@nondot.org">Chris Lattner</a></address>
<!-- Created: Tue Aug 6 15:00:33 CDT 2002 -->
<!-- hhmts start -->
Last modified: Wed Oct 1 16:48:54 CDT 2003
<!-- hhmts end -->
</font></body></html>
<hr>
<address>
<a href="http://jigsaw.w3.org/css-validator/check/referer"><img
src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a>
<a href="http://validator.w3.org/check/referer"><img
src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!"></a>
<a href="mailto:sabre@nondot.org">Chris Lattner</a><br>
<a href="http://llvm.cs.uiuc.edu">LLVM Compiler Infrastructure</a><br>
Last modified: $Date$
</address>
</body>
</html>

File diff suppressed because it is too large Load Diff

View File

@@ -1,135 +1,120 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<head>
<title>Creating an LLVM Project</title>
</head>
<link rel="stylesheet" href="llvm.css" type="text/css">
</head>
<body>
<body bgcolor=white>
<center><h1>Creating an LLVM Project<br></h1></center>
<!--===============================================================-->
<h2><a name="a">Overview</a><hr></h2>
<!--===============================================================-->
The LLVM build system is designed to facilitate the building of third party
projects that use LLVM header files, libraries, and tools. In order to use
these facilities, a Makefile from a project must do the following things:
<div class="doc_title">Creating an LLVM Project</div>
<ol>
<li><a href="#overview">Overview</a></li>
<li><a href="#create">Create a project from the Sample Project</a></li>
<li><a href="#source">Source tree layout</a></li>
<li><a href="#makefiles">Writing LLVM-style Makefiles</a>
<ol>
<li>Set environment variables.
<p>
There are several environment variables that a Makefile needs to set to
use the LLVM build system:
<dl compact>
<dt>LLVM_SRC_ROOT
<dd>
The root of the LLVM source tree.
<p>
<li><a href="#reqVars">Required Variables</a></li>
<li><a href="#varsBuildDir">Variables for Building Subdirectories</a></li>
<li><a href="#varsBuildLib">Variables for Building Libraries</a></li>
<li><a href="#varsBuildProg">Variables for Building Programs</a></li>
<li><a href="#miscVars">Miscellaneous Variables</a></li>
</ol></li>
<li><a href="#objcode">Placement of object code</a></li>
<li><a href="#help">Further help</a></li>
</ol>
<dt>LLVM_OBJ_ROOT
<dd>
The root of the LLVM object tree.
<p>
<div class="doc_author">
<p>Written by John Criswell</p>
</div>
<dt>BUILD_SRC_ROOT
<dd>
The root of the project's source tree.
<p>
<!-- *********************************************************************** -->
<div class="doc_section"><a name="overview">Overview</a></div>
<!-- *********************************************************************** -->
<dt>BUILD_OBJ_ROOT
<dd>
The root of the project's object tree.
<p>
<div class="doc_text">
<dt>BUILD_SRC_DIR
<dd>
The directory containing the current source to be compiled.
<p>
<p>The LLVM build system is designed to facilitate the building of third party
projects that use LLVM header files, libraries, and tools. In order to use
these facilities, a Makefile from a project must do the following things:</p>
<dt>BUILD_OBJ_DIR
<dd>
The directory where the current source will place the new object
files. This should always be the current directory.
<p>
<ol>
<li>Set environment variables.There are several environment variables that a
Makefile needs to set to use the LLVM build system:
<dt>LEVEL
<dd>
The relative path from the current directory to the root of the
object tree.
<p>
</dl>
<ul>
<li><tt>LLVM_SRC_ROOT</tt> - The root of the LLVM source tree.</li>
<li><tt>LLVM_OBJ_ROOT</tt> - The root of the LLVM object tree.</li>
<li><tt>BUILD_SRC_ROOT</tt> - The root of the project's source tree.</li>
<li><tt>BUILD_OBJ_ROOT</tt> - The root of the project's object tree.</li>
<li><tt>BUILD_SRC_DIR</tt> - The directory containing the current source to be
compiled.</li>
<li><tt>BUILD_OBJ_DIR</tt> - The directory where the current source will place
the new object files. This should always be the current directory.</li>
<li><tt>LEVEL</tt> - The relative path from the current directory to the root
of the object tree.</li>
</ul></li>
<li>Include <tt>Makefile.config</tt> from <tt>$(LLVM_OBJ_ROOT)</tt>.</li>
<li>Include <tt>Makefile.rules</tt> from <tt>$(LLVM_SRC_ROOT)</tt>.</li>
</ol>
<li>Include the LLVM Makefile.config from $(LLVM_OBJ_ROOT).
<p>
<p>There are two ways that you can set all of these variables:</p>
<li>Include the LLVM Makefile.rules from $(LLVM_SRC_ROOT).
</ol>
<ol>
<li>You can write your own Makefiles which hard-code these values.</li>
There are two ways that you can set all of these variables:
<ol>
<li>
You can write your own Makefiles which hard-code these values.
<li> You can use the pre-made LLVM sample project. This sample project includes
Makefiles, a configure script that can be used to configure the location of
LLVM, and the ability to support multiple object directories from a single
source directory.</li>
</ol>
<li>
You can use the pre-made LLVM sample project. This sample project
includes Makefiles, a configure script that can be used to configure
the location of LLVM, and the ability to support multiple object
directories from a single source directory.
</ol>
<p>This document assumes that you will base your project off of the LLVM sample
project found in <tt>llvm/projects/sample</tt>. If you want to devise your own
build system, studying the sample project and LLVM Makefiles will probably
provide enough information on how to write your own Makefiles.</p>
This document assumes that you will base your project off of the LLVM
sample project found in <tt>llvm/projects/sample</tt>. If you want to
devise your own build system, studying the sample project and LLVM
Makefiles will probably provide enough information on how to write your own
Makefiles.
<p>
</div>
<!--===============================================================-->
<h2><a name="a">Create a Project from the Sample Project</a><hr></h2>
<!--===============================================================-->
<!-- *********************************************************************** -->
<div class="doc_section">
<a name="create">Create a Project from the Sample Project</a>
</div>
<!-- *********************************************************************** -->
Follow these simple steps to start your project:
<div class="doc_text">
<ol>
<li>
Copy the <tt>llvm/projects/sample</tt> directory to any place
of your choosing. You can place it anywhere you like. Rename the
directory to match the name of your project.
<p>
<p>Follow these simple steps to start your project:</p>
<li>
Add your source code and Makefiles to your source tree.
<p>
<ol>
<li>Copy the <tt>llvm/projects/sample</tt> directory to any place of your
choosing. You can place it anywhere you like. Rename the directory to match
the name of your project.</li>
<li>
If you want your Makefiles to be configured by the
<tt>configure</tt> script, or if you want to support multiple
object directories, add your Makefiles to the <tt>configure</tt>
script by adding them into the <tt>autoconf/configure.ac</tt> file.
The macro <tt>AC_CONFIG_MAKEFILE</tt> will copy a file, unmodified,
from the source directory to the object directory.
<li>Add your source code and Makefiles to your source tree.</li>
<p>
After updating <tt>autoconf/configure.ac</tt>, regenerate the
configure script with these commands:
<p>
<tt>
cd autoconf<br>
autoconf -o ../configure
</tt>
<li>If you want your Makefiles to be configured by the <tt>configure</tt>
script, or if you want to support multiple object directories, add your
Makefiles to the <tt>configure</tt> script by adding them into the
<tt>autoconf/configure.ac</tt> file. The macro <tt>AC_CONFIG_MAKEFILE</tt> will
copy a file, unmodified, from the source directory to the object directory.</li>
<p>
<li>After updating <tt>autoconf/configure.ac</tt>, regenerate the
configure script with these commands:
You must be using Autoconf version 2.57 or higher.
<p>
<div class="doc_code">
<p><tt>% cd autoconf<br>
% autoconf -o ../configure</tt></p>
</div>
<li>
Run <tt>configure</tt> in the directory in which you want to place
object code. Use the following options to tell your project where it
can find LLVM:
<p>You must be using Autoconf version 2.57 or higher.</p></li>
<dl compact>
<li>Run <tt>configure</tt> in the directory in which you want to place
object code. Use the following options to tell your project where it
can find LLVM:
<dl>
<dt><tt>--with-llvmsrc=&lt;directory&gt;</tt>
<dd>
Tell your project where the LLVM source tree is located.
@@ -138,26 +123,32 @@
<dd>
Tell your project where the LLVM object tree is located.
</dl>
</ol>
</ol>
That's it! Now all you have to do is type <tt>gmake</tt> in the root of
your object directory, and your project should build.
<p>That's it! Now all you have to do is type <tt>gmake</tt> in the root of
your object directory, and your project should build.</p>
<!--===============================================================-->
<h2><a name="Source Tree Layout">Source Tree Layout</a><hr></h2>
<!--===============================================================-->
</div>
In order to use the LLVM build system, you will want to organize your
source code so that it can benefit from the build system's features.
Mainly, you want your source tree layout to look similar to the LLVM
source tree layout. The best way to do this is to just copy the
project tree from <tt>llvm/projects/sample</tt> and modify it to meet
your needs, but you can certainly add to it if you want.
<!-- *********************************************************************** -->
<div class="doc_section">
<a name="source">Source Tree Layout</a>
</div>
<!-- *********************************************************************** -->
Underneath your top level directory, you should have the following
directories:
<div class="doc_text">
<dl compact>
<p>In order to use the LLVM build system, you will want to organize your
source code so that it can benefit from the build system's features.
Mainly, you want your source tree layout to look similar to the LLVM
source tree layout. The best way to do this is to just copy the
project tree from <tt>llvm/projects/sample</tt> and modify it to meet
your needs, but you can certainly add to it if you want.</p>
<p>Underneath your top level directory, you should have the following
directories:</p>
<dl>
<dt><b>lib</b>
<dd>
This subdirectory should contain all of your library source
@@ -222,31 +213,54 @@
need to find a way to use the source provided within that directory
on your own.
</ul>
</dl>
</dl>
Typically, you will want to build your <b>lib</b> directory first
followed by your <b>tools</b> directory.
<p>Typically, you will want to build your <b>lib</b> directory first followed by
your <b>tools</b> directory.</p>
<!--===============================================================-->
<h2><a name="Makefile Variables">Writing LLVM Style Makefiles</a><hr></h2>
<!--===============================================================-->
The LLVM build system provides a convenient way to build libraries and
executables. Most of your project Makefiles will only need to define a few
variables. Below is a list of the variables one can set and what they can
do:
</div>
<h3> Required Variables </h3>
<dl compact>
<!-- *********************************************************************** -->
<div class="doc_section">
<a name="makefiles">Writing LLVM Style Makefiles</a>
</div>
<!-- *********************************************************************** -->
<div class="doc_text">
<p>The LLVM build system provides a convenient way to build libraries and
executables. Most of your project Makefiles will only need to define a few
variables. Below is a list of the variables one can set and what they can
do:</p>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection">
<a name="reqVars">Required Variables</a>
</div>
<div class="doc_text">
<dl>
<dt>LEVEL
<dd>
This variable is the relative path from this Makefile to the
top directory of your project's source code. For example, if
your source code is in /tmp/src, then the Makefile in
/tmp/src/jump/high would set LEVEL to "../..".
</dl>
your source code is in <tt>/tmp/src</tt>, then the Makefile in
<tt>/tmp/src/jump/high</tt> would set <tt>LEVEL</tt> to <tt>"../.."</tt>.
</dl>
<h3> Variables for Building Subdirectories</h3>
<dl compact>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection">
<a name="varsBuildDir">Variables for Building Subdirectories</a>
</div>
<div class="doc_text">
<dl>
<dt>DIRS
<dd>
This is a space separated list of subdirectories that should be
@@ -266,10 +280,18 @@
This is a list of directories that can be built if they exist,
but will not cause an error if they do not exist. They are
built serially in the order in which they are listed.
</dl>
</dl>
<h3> Variables for Building Libraries</h3>
<dl compact>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection">
<a name="varsBuildLib">Variables for Building Libraries</a>
</div>
<div class="doc_text">
<dl>
<dt>LIBRARYNAME
<dd>
This variable contains the base name of the library that will
@@ -289,10 +311,18 @@
<dd>
If SHARED_LIBRARY is defined in your Makefile, a shared
(or dynamic) library will be built.
</dl>
</dl>
<h3> Variables for Building Programs</h3>
<dl compact>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection">
<a name="varsBuildProg">Variables for Building Programs</a>
</div>
<div class="doc_text">
<dl>
<dt>TOOLNAME
<dd>
This variable contains the name of the program that will
@@ -322,12 +352,20 @@
following line in your <tt>Makefile</tt>:
<p>
<tt>
LIBS+=-lsample
LIBS += -lsample
</tt>
</dl>
</dl>
<h3> Miscellaneous Variables</h3>
<dl compact>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection">
<a name="miscVars">Miscellaneous Variables</a>
</div>
<div class="doc_text">
<dl>
<dt>ExtraSource
<dd>
This variable contains a space separated list of extra source
@@ -347,41 +385,67 @@
opposed to overwriting them. The master Makefiles may already
have useful options in them that you may not want to overwrite.
<p>
</dl>
</dl>
<!--===============================================================-->
<h2><a name="objcode">Placement of Object Code</a><hr></h2>
<!--===============================================================-->
</div>
The final location of built libraries and executables will depend upon
whether you do a Debug, Release, or Profile build.
<!-- *********************************************************************** -->
<div class="doc_section">
<a name="objcode">Placement of Object Code</a>
</div>
<!-- *********************************************************************** -->
<dl compact>
<div class="doc_text">
<p>The final location of built libraries and executables will depend upon
whether you do a Debug, Release, or Profile build.</p>
<dl>
<dt>Libraries
<dd>
All libraries (static and dynamic) will be stored in
BUILD_OBJ_ROOT/lib/&lt;type&gt;, where type is <tt>Debug</tt>,
<tt>BUILD_OBJ_ROOT/lib/&lt;type&gt;</tt>, where type is <tt>Debug</tt>,
<tt>Release</tt>, or <tt>Profile</tt> for a debug, optimized, or
profiled build, respectively.
<p>
profiled build, respectively.<p>
<dt>Executables
<dd>
All executables will be stored in BUILD_OBJ_ROOT/lib/&lt;type&gt;,
where type is <tt>Debug</tt>, <tt>Release</tt>, or <tt>Profile</tt> for
a debug, optimized, or profiled build, respectively.
</dl>
<dd>All executables will be stored in
<tt>BUILD_OBJ_ROOT/tools/&lt;type&gt;</tt>, where type is <tt>Debug</tt>,
<tt>Release</tt>, or <tt>Profile</tt> for a debug, optimized, or profiled
build, respectively.
</dl>
<!--===============================================================-->
<h2><a name="help">Further Help</a><hr></h2>
<!--===============================================================-->
</div>
If you have any questions or need any help creating an LLVM project,
the LLVM team would be more than happy to help. You can always post your
questions to the LLVM Developers Mailing List (<a
href="mailto:llvmdev.cs.uiuc.edu">llvmdev@cs.uiuc.edu</a>).
<!-- *********************************************************************** -->
<div class="doc_section">
<a name="help">Further Help</a>
</div>
<!-- *********************************************************************** -->
<div class="doc_text">
<p>If you have any questions or need any help creating an LLVM project,
the LLVM team would be more than happy to help. You can always post your
questions to the <a
href="http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev">LLVM Developers
Mailing List</a>.</p>
</div>
<!-- *********************************************************************** -->
<hr>
Written by <a href="mailto:criswell@uiuc.edu">John Criswell</a>.
<address>
<a href="http://jigsaw.w3.org/css-validator/check/referer"><img
src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a>
<a href="http://validator.w3.org/check/referer"><img
src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /></a>
<a href="mailto:criswell@uiuc.edu">John Criswell</a><br>
<a href="http://llvm.cs.uiuc.edu">The LLVM Compiler Infrastructure</a>
<br>
Last modified: $Date$
</address>
</body>
</html>

File diff suppressed because it is too large Load Diff

View File

@@ -1,179 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>LLVM Public Release Project</title>
</head>
<body bgcolor="white">
<center>
<h1><font size="7">LLVM Public Release Project</font></h1>
</center>
<ul>
<li><a href="#what">What is this?</a> </li>
<li><a href="#priorities">Priorities</a>
<ol>
<li><a href="#high">High Priority</a> </li>
<li><a href="#medium">Medimum Priority</a> </li>
<li><a href="#low">Low Priority</a> </li>
</ol>
</li>
</ul>
<br>
<!-- *********************************************************************** -->
<table width="100%" bgcolor="#330077" border="0" cellpadding="4"
cellspacing="0">
<tbody>
<tr>
<td align="center"><font color="#eeeeff" size="+2"
face="Georgia,Palatino"><b> <a name="what">What is this? </a></b><a
name="what"></a></font></td>
</tr>
</tbody>
</table>
<ul>
<!-- *********************************************************************** -->
This document is a list of things to do before the LLVM project is
publicly released. &nbsp;It will provide a checklist so that we know
what has been done and what is left to be done. &nbsp;It will also keep
a "wishlist" of desirable features.
<p><!-- *********************************************************************** -->
</p>
</ul>
<table width="100%" bgcolor="#330077" border="0" cellpadding="4"
cellspacing="0">
<tbody>
<tr>
<td align="center"><font color="#eeeeff" size="+2"
face="Georgia,Palatino"><b> <a name="priorities">Priorities</a></b><a
name="improving"></a></font></td>
</tr>
</tbody>
</table>
<ul>
<!-- *********************************************************************** -->The
list of things to do...
<p><!-- ======================================================================= -->
</p>
</ul>
<table width="50%" bgcolor="#441188" border="0" cellpadding="4"
cellspacing="0">
<tbody>
<tr>
<td>&nbsp;</td>
<td width="100%">&nbsp;&nbsp;<font color="#eeeeff" size="+1"
face="Georgia,Palatino"><b><a name="high">High Priority</a></b><a
name="glibc"></a></font></td>
</tr>
</tbody>
</table>
<ul>
<ul>
<ul>
</ul>
<li>Documentation</li>
<ul>
<li>Expand documentation on creating an LLVM project.</li>
</ul>
<li>Licenses</li>
<ul>
<li>Create license files for anything in the distribution that is
not under our license.<br>
</li>
</ul>
<li>Ensure SafeCode builds.</li>
<li>Create a system for managing development and releases (i.e. CVS
branching, labeling revisions, etc).</li>
<li>Create a web page for downloading LLVM.
<li>Create a method for requesting the GCC front end source code.
</ul>
<p><!-- ======================================================================= -->
</p>
</ul>
<table width="50%" bgcolor="#441188" border="0" cellpadding="4"
cellspacing="0">
<tbody>
<tr>
<td>&nbsp;</td>
<td width="100%">&nbsp;&nbsp;<font color="#eeeeff" size="+1"
face="Georgia,Palatino"><b><a name="medium">Medium Priority</a></b><a
name="NightlyTest"></a></font></td>
</tr>
</tbody>
</table>
<ul>
<ul>
<li>Improve documentation on how to create an LLVM project.<br>
</li>
<li>Test Suite</li>
<ul>
<li>Add Feature and Regression tests to nightly tester.</li>
<li>Develop better QMTest database method.<br>
</li>
</ul>
<li>Write regression tests.</li>
<ul>
<li>The C++ constructor on dlopen() bug on Solaris.</li>
</ul>
</ul>
<ul>
<li>Release Management</li>
</ul>
<ul>
<ul>
<li>Find and implement a bug reporting system (i.e. Bugzilla).</li>
</ul>
</ul>
<p><!-- ======================================================================= -->
</p>
</ul>
<table width="50%" bgcolor="#441188" border="0" cellpadding="4"
cellspacing="0">
<tbody>
<tr>
<td>&nbsp;</td>
<td width="100%">&nbsp;&nbsp;<font color="#eeeeff" size="+1"
face="Georgia,Palatino"><b><a name="low">Low Priority</a></b><a
name="programs"></a></font></td>
</tr>
</tbody>
</table>
<ul>
<ul>
<li>GCC C Front End</li>
<ul>
<li>Place the C front end into the CVS repository.</li>
<li>Ensure that the C front end compiles and installs nicely.</li>
</ul>
<li>Create an installer for the software.</li>
<li>Testing</li>
<ul>
<li>Create descriptions of what each test is doing (test
specifications).<br>
</li>
<li>Test LLVM on various Linux distributions.</li>
<li>Test LLVM on various Solaris versions.</li>
<li>Test LLVM on Solaris/x86.</li>
</ul>
<ul>
</ul>
<li>Documentation</li>
<ul>
<li>Create man pages for the LLVM utilities.</li>
<li>Create man pages for the LLVM libraries.</li>
</ul>
<li>Rewrite this page without Netscape Composer :)<br>
</li>
</ul>
</ul>
<font size-1="">
<address><a href="mailto:criswell@cs.uiuc.edu">John Criswell</a></address>
<!-- Created: Tue Aug 6 15:00:33 CDT 2002 --><!-- hhmts start --> Last
modified: Sat May 31 14:54:03 CDT 2003<!-- hhmts end --> </font> <br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
</body>
</html>

File diff suppressed because it is too large Load Diff

1414
llvm/docs/Stacker.html Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,203 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>System Library</title>
<link rel="stylesheet" href="llvm.css" type="text/css">
</head>
<body>
<div class="doc_title">System Library</div>
<div class="doc_warning">
<p>Warning: This document is a work in progress.</p>
</div>
<ul>
<li><a href="#abstract">Abstract</a></li>
<li><a href="#requirements">System Library Requirements</a>
<ol>
<li><a href="#headers">Hide System Header Files</a></li>
<li><a href="#nofunc">No Exposed Functions</a></li>
<li><a href="#nodata">No Exposed Data</a></li>
<li><a href="#xcptns">No Exceptions</a></li>
<li><a href="#errors">Standard Error Codes</a></li>
<li><a href="#overhead">Minimize Overhead</a></li>
</ol></li>
<li><a href="#design">System Library Design</a>
<ol>
<li><a href="#opaque">Use Opaque Classes</a></li>
<li><a href="#common">Common Implementations</a></li>
<li><a href="#multi_imps">Multiple Implementations</a></li>
<li><a href="#lowlevel">Use Low Level Interfaces</a></li>
<li><a href="#memalloc">No Memory Allocation</a></li>
<li><a href="#virtuals">No Virtual Methods</a></li>
</ol></li>
<li><a href="#detail">System Library Details</a>
<ol>
<li><a href="#bug">Tracking Bugzilla Bug: 351</a></li>
<li><a href="#refimpl">Reference Implementatation</a></li>
</ol></li>
</ul>
<div class="doc_author">
<p>Written by <a href="rspencer@x10sys.com">Reid Spencer</a></p>
</div>
<!-- *********************************************************************** -->
<div class="doc_section"><a name="abstract">Abstract</a></div>
<div class="doc_text">
<p>This document describes the requirements, design, and implementation
details of LLVM's System Library. The library is composed of the header files
in <tt>llvm/include/llvm/System</tt> and the source files in
<tt>llvm/lib/System</tt>. The goal of this library is to completely shield
LLVM from the variations in operating system interfaces. By centralizing
LLVM's use of operating system interfaces, we make it possible for the LLVM
tool chain and runtime libraries to be more easily ported to new platforms.
The library also unclutters the rest of LLVM from #ifdef use and special
cases for specific operating systems.</p>
<p>The System Library was donated to LLVM by Reid Spencer who formulated the
original design as part of the eXtensible Programming System (XPS) which is
based, in part, on LLVM.</p>
</div>
<!-- *********************************************************************** -->
<div class="doc_section">
<a name="requirements">System Library Requirements</a>
</div>
<div class="doc_text">
<p>The System library's requirements are aimed at shielding LLVM from the
variations in operating system interfaces. The following sections define the
requirements needed to fulfill this objective.</p>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection"><a name="headers">Hide System Header Files</a></div>
<div class="doc_text">
<p>To be written.</p>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection"><a name="nofunc">No Exposed Functions</a></div>
<div class="doc_text">
<p>To be written.</p>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection"><a name="nodata">No Exposed Data</a></div>
<div class="doc_text">
<p>To be written.</p>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection"><a name="xcptns">No Exceptions</a></div>
<div class="doc_text">
<p>To be written.</p>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection"><a name="errors">Standard Error Codes</a></div>
<div class="doc_text">
<p>To be written.</p>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection"><a name="overhead">Minimize Overhead</a></div>
<div class="doc_text">
<p>To be written.</p>
</div>
<!-- *********************************************************************** -->
<div class="doc_section"><a name="design">System Library Design</a></div>
<div class="doc_text">
<p>In order to fulfill the requirements of the system library, strict design
objectives must be maintained in the library as it evolves. The goal here
is to provide interfaces to operating system concepts (files, memory maps,
sockets, signals, locking, etc) efficiently and in such a way that the
remainder of LLVM is completely operating system agnostic.</p>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection"><a name="opaque">Use Opaque Classes</a></div>
<div class="doc_text">
<p>no public data</p>
<p>onlyprimitive typed private/protected data</p>
<p>data size is "right" for platform, not max of all platforms</p>
<p>each class corresponds to O/S concept</p>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection"><a name="common">Common Implementations</a></div>
<div class="doc_text">
<p>To be written.</p>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection">
<a name="multi_imps">Multiple Implementations</a>
</div>
<div class="doc_text">
<p>To be written.</p>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection">
<a name="low_level">Use Low Level Interfaces</a>
</div>
<div class="doc_text">
<p>To be written.</p>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection"><a name="memalloc">No Memory Allocation</a></div>
<div class="doc_text">
<p>To be written.</p>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection"><a name="virtuals">No Virtual Methods</a></div>
<div class="doc_text">
<p>To be written.</p>
</div>
<!-- *********************************************************************** -->
<div class="doc_section"><a name="detail">System Library Details</a></div>
<div class="doc_text">
<p>To be written.</p>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection"><a name="bug">Bug 351</a></div>
<div class="doc_text">
<p>See <a href="http://llvm.cs.uiuc.edu/PR351">bug 351</a>
for further details on the progress of this work</p>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection">
<a name="refimpl">Reference Implementation</a>
</div>
<div class="doc_text">
<p>The <tt>linux</tt> implementation of the system library will always be the
reference implementation. This means that (a) the concepts defined by the
linux must be identically replicated in the other implementations and (b) the
linux implementation must always be complete (provide implementations for all
concepts).</p>
</div>
<!-- *********************************************************************** -->
<hr>
<address>
<a href="http://jigsaw.w3.org/css-validator/check/referer"><img
src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a>
<a href="http://validator.w3.org/check/referer"><img
src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!"></a>
<a href="mailto:rspencer@x10sys.com">Reid Spencer</a><br>
<a href="http://llvm.cs.uiuc.edu">LLVM Compiler Infrastructure</a><br>
Last modified: $Date$
</address>
</body>
</html>

View File

@@ -0,0 +1,565 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>TableGen Fundamentals</title>
<link rel="stylesheet" href="llvm.css" type="text/css">
</head>
<body>
<div class="doc_title">TableGen Fundamentals</div>
<div class="doc_text">
<ul>
<li><a href="#introduction">Introduction</a>
<ol>
<li><a href="#concepts">Basic concepts</a></li>
<li><a href="#example">An example record</a></li>
<li><a href="#running">Running TableGen</a></li>
</ol></li>
<li><a href="#syntax">TableGen syntax</a>
<ol>
<li><a href="#primitives">TableGen primitives</a>
<ol>
<li><a href="#comments">TableGen comments</a></li>
<li><a href="#types">The TableGen type system</a></li>
<li><a href="#values">TableGen values and expressions</a></li>
</ol></li>
<li><a href="#classesdefs">Classes and definitions</a>
<ol>
<li><a href="#valuedef">Value definitions</a></li>
<li><a href="#recordlet">'let' expressions</a></li>
<li><a href="#templateargs">Class template arguments</a></li>
</ol></li>
<li><a href="#filescope">File scope entities</a>
<ol>
<li><a href="#include">File inclusion</a></li>
<li><a href="#globallet">'let' expressions</a></li>
</ol></li>
</ol></li>
<li><a href="#backends">TableGen backends</a>
<ol>
<li><a href="#">todo</a></li>
</ol></li>
</ul>
</div>
<div class="doc_author">
<p>Written by <a href="mailto:sabre@nondot.org">Chris Lattner</a></p>
</div>
<!-- *********************************************************************** -->
<div class="doc_section"><a name="introduction">Introduction</a></div>
<!-- *********************************************************************** -->
<div class="doc_text">
<p>TableGen's purpose is to help a human develop and maintain records of
domain-specific information. Because there may be a large number of these
records, it is specifically designed to allow writing flexible descriptions and
for common features of these records to be factored out. This reduces the
amount of duplication in the description, reduces the chance of error, and
makes it easier to structure domain specific information.</p>
<p>The core part of TableGen <a href="#syntax">parses a file</a>, instantiates
the declarations, and hands the result off to a domain-specific "<a
href="#backends">TableGen backend</a>" for processing. The current major user
of TableGen is the <a href="CodeGenerator.html">LLVM code generator</a>.</p>
<p>Note that if you work on TableGen much, and use emacs or vim, that you can
find an emacs "TableGen mode" and a vim language file in
<tt>llvm/utils/emacs</tt> and <tt>llvm/utils/vim</tt> directory of your LLVM
distribution, respectively.</p>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection"><a name="running">Basic concepts</a></div>
<div class="doc_text">
<p>TableGen files consist of two key parts: 'classes' and 'definitions', both
of which are considered 'records'.</p>
<p><b>TableGen records</b> have a unique name, a list of values, and a list of
superclasses. The list of values is main data that TableGen builds for each
record, it is this that holds the domain specific information for the
application. The interpretation of this data is left to a specific <a
href="#backends">TableGen backend</a>, but the structure and format rules are
taken care of and fixed by TableGen.</p>
<p><b>TableGen definitions</b> are the concrete form of 'records'. These
generally do not have any undefined values, and are marked with the
'<tt>def</tt>' keyword.</p>
<p><b>TableGen classes</b> are abstract records that are used to build and
describe other records. These 'classes' allow the end-user to build
abstractions for either the domain they are targetting (such as "Register",
"RegisterClass", and "Instruction" in the LLVM code generator) or for the
implementor to help factor out common properties of records (such as "FPInst",
which is used to represent floating point instructions in the X86 backend).
TableGen keeps track of all of the classes that are used to build up a
definition, so the backend can find all definitions of a particular class, such
as "Instruction".</p>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection"><a name="example">An example record</a></div>
<div class="doc_text">
<p>With no other arguments, TableGen parses the specified file and prints out
all of the classes, then all of the definitions. This is a good way to see what
the various definitions expand to fully. Running this on the <tt>X86.td</tt>
file prints this (at the time of this writing):</p>
<pre>
...
<b>def</b> ADDrr8 { <i>// Instruction X86Inst I2A8 Pattern</i>
<b>string</b> Name = "add";
<b>string</b> Namespace = "X86";
<b>list</b>&lt;Register&gt; Uses = [];
<b>list</b>&lt;Register&gt; Defs = [];
<b>bit</b> isReturn = 0;
<b>bit</b> isBranch = 0;
<b>bit</b> isCall = 0;
<b>bit</b> isTwoAddress = 1;
<b>bit</b> isTerminator = 0;
<b>dag</b> Pattern = (set R8, (plus R8, R8));
<b>bits</b>&lt;8&gt; Opcode = { 0, 0, 0, 0, 0, 0, 0, 0 };
Format Form = MRMDestReg;
<b>bits</b>&lt;5&gt; FormBits = { 0, 0, 0, 1, 1 };
ArgType Type = Arg8;
<b>bits</b>&lt;3&gt; TypeBits = { 0, 0, 1 };
<b>bit</b> hasOpSizePrefix = 0;
<b>bit</b> printImplicitUses = 0;
<b>bits</b>&lt;4&gt; Prefix = { 0, 0, 0, 0 };
FPFormat FPForm = ?;
<b>bits</b>&lt;3&gt; FPFormBits = { 0, 0, 0 };
}
...
</pre>
<p>This definition corresponds to an 8-bit register-register add instruction in
the X86. The string after the '<tt>def</tt>' string indicates the name of the
record ("<tt>ADDrr8</tt>" in this case), and the comment at the end of the line
indicates the superclasses of the definition. The body of the record contains
all of the data that TableGen assembled for the record, indicating that the
instruction is part of the "X86" namespace, should be printed as "<tt>add</tt>"
in the assembly file, it is a two-address instruction, has a particular
encoding, etc. The contents and semantics of the information in the record is
specific to the needs of the X86 backend, and is only shown as an example.</p>
<p>As you can see, a lot of information is needed for every instruction
supported by the code generator, and specifying it all manually would be
unmaintainble, prone to bugs, and tiring to do in the first place. Because we
are using TableGen, all of the information was derived from the following
definition:</p>
<pre>
<b>def</b> ADDrr8 : I2A8&lt;"add", 0x00, MRMDestReg&gt;,
Pattern&lt;(set R8, (plus R8, R8))&gt;;
</pre>
<p>This definition makes use of the custom I2A8 (two address instruction with
8-bit operand) class, which is defined in the X86-specific TableGen file to
factor out the common features that instructions of its class share. A key
feature of TableGen is that it allows the end-user to define the abstractions
they prefer to use when describing their information.</p>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection"><a name="running">Running TableGen</a></div>
<div class="doc_text">
<p>TableGen runs just like any other LLVM tool. The first (optional) argument
specifies the file to read. If a filename is not specified, <tt>tblgen</tt>
reads from standard input.</p>
<p>To be useful, one of the <a href="#backends">TableGen backends</a> must be
used. These backends are selectable on the command line (type '<tt>tblgen
--help</tt>' for a list). For example, to get a list of all of the definitions
that subclass a particular type (which can be useful for building up an enum
list of these records), use the <tt>--print-enums</tt> option:</p>
<pre>
$ tblgen X86.td -print-enums -class=Register
AH, AL, AX, BH, BL, BP, BX, CH, CL, CX, DH, DI, DL, DX,
EAX, EBP, EBX, ECX, EDI, EDX, ESI, ESP, FP0, FP1, FP2, FP3, FP4, FP5, FP6,
SI, SP, ST0, ST1, ST2, ST3, ST4, ST5, ST6, ST7,
$ tblgen X86.td -print-enums -class=Instruction
ADCrr32, ADDri16, ADDri16b, ADDri32, ADDri32b, ADDri8, ADDrr16, ADDrr32,
ADDrr8, ADJCALLSTACKDOWN, ADJCALLSTACKUP, ANDri16, ANDri16b, ANDri32, ANDri32b,
ANDri8, ANDrr16, ANDrr32, ANDrr8, BSWAPr32, CALLm32, CALLpcrel32, ...
</pre>
<p>The default backend prints out all of the records, as described <a
href="#example">above</a>.</p>
<p>If you plan to use TableGen for some purpose, you will most likely have to
<a href="#backends">write a backend</a> that extracts the information specific
to what you need and formats it in the appropriate way.</p>
</div>
<!-- *********************************************************************** -->
<div class="doc_section"><a name="syntax">TableGen syntax</a></div>
<!-- *********************************************************************** -->
<div class="doc_text">
<p>TableGen doesn't care about the meaning of data (that is up to the backend
to define), but it does care about syntax, and it enforces a simple type system.
This section describes the syntax and the constructs allowed in a TableGen file.
</p>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection"><a name="primitives">TableGen primitives</a></div>
<!-- -------------------------------------------------------------------------->
<div class="doc_subsubsection"><a name="comments">TableGen comments</a></div>
<div class="doc_text">
<p>TableGen supports BCPL style "<tt>//</tt>" comments, which run to the end of
the line, and it also supports <b>nestable</b> "<tt>/* */</tt>" comments.</p>
</div>
<!-- -------------------------------------------------------------------------->
<div class="doc_subsubsection">
<a name="types">The TableGen type system</a>
</div>
<div class="doc_text">
<p>TableGen files are strongly typed, in a simple (but complete) type-system.
These types are used to perform automatic conversions, check for errors, and to
help interface designers constrain the input that they allow. Every <a
href="#valuedef">value definition</a> is required to have an associated type.
</p>
<p>TableGen supports a mixture of very low-level types (such as <tt>bit</tt>)
and very high-level types (such as <tt>dag</tt>). This flexibility is what
allows it to describe a wide range of information conveniently and compactly.
The TableGen types are:</p>
<ul>
<li>"<tt><b>bit</b></tt>" - A 'bit' is a boolean value that can hold either 0 or
1.</li>
<li>"<tt><b>int</b></tt>" - The 'int' type represents a simple 32-bit integer
value, such as 5.</li>
<li>"<tt><b>string</b></tt>" - The 'string' type represents an ordered sequence
of characters of arbitrary length.</li>
<li>"<tt><b>bits</b>&lt;n&gt;</tt>" - A 'bits' type is an arbitrary, but fixed,
size integer that is broken up into individual bits. This type is useful
because it can handle some bits being defined while others are undefined.</li>
<li>"<tt><b>list</b>&lt;ty&gt;</tt>" - This type represents a list whose
elements are some other type. The contained type is arbitrary: it can even be
another list type.</li>
<li>Class type - Specifying a class name in a type context means that the
defined value must be a subclass of the specified class. This is useful in
conjunction with the "list" type, for example, to constrain the elements of the
list to a common base class (e.g., a <tt><b>list</b>&lt;Register&gt;</tt> can
only contain definitions derived from the "<tt>Register</tt>" class).</li>
<li>"<tt><b>code</b></tt>" - This represents a big hunk of text. NOTE: I don't
remember why this is distinct from string!</li>
<li>"<tt><b>dag</b></tt>" - This type represents a nestable directed graph of
elements.</li>
</ul>
<p>To date, these types have been sufficient for describing things that
TableGen has been used for, but it is straight-forward to extend this list if
needed.</p>
</div>
<!-- -------------------------------------------------------------------------->
<div class="doc_subsubsection">
<a name="values">TableGen values and expressions</a>
</div>
<div class="doc_text">
<p>TableGen allows for a pretty reasonable number of different expression forms
when building up values. These forms allow the TableGen file to be written in a
natural syntax and flavor for the application. The current expression forms
supported include:</p>
<ul>
<li><tt>?</tt> - uninitialized field</li>
<li><tt>0b1001011</tt> - binary integer value</li>
<li><tt>07654321</tt> - octal integer value (indicated by a leading 0)</li>
<li><tt>7</tt> - decimal integer value</li>
<li><tt>0x7F</tt> - hexadecimal integer value</li>
<li><tt>"foo"</tt> - string value</li>
<li><tt>[{ ... }]</tt> - code fragment</li>
<li><tt>[ X, Y, Z ]</tt> - list value.</li>
<li><tt>{ a, b, c }</tt> - initializer for a "bits&lt;3&gt;" value</li>
<li><tt>value</tt> - value reference</li>
<li><tt>value{17}</tt> - access to one bit of a value</li>
<li><tt>value{15-17}</tt> - access to multiple bits of a value</li>
<li><tt>DEF</tt> - reference to a record definition</li>
<li><tt>X.Y</tt> - reference to the subfield of a value</li>
<li><tt>list[4-7,17,2-3]</tt> - A slice of the 'list' list, including elements
4,5,6,7,17,2, and 3 from it. Elements may be included multiple times.</li>
<li><tt>(DEF a, b)</tt> - a dag value. The first element is required to be a
record definition, the remaining elements in the list may be arbitrary other
values, including nested `<tt>dag</tt>' values.</li>
</ul>
<p>Note that all of the values have rules specifying how they convert to values
for different types. These rules allow you to assign a value like "7" to a
"bits&lt;4&gt;" value, for example.</p>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection">
<a name="classesdefs">Classes and definitions</a>
</div>
<div class="doc_text">
<p>As mentioned in the <a href="#concepts">intro</a>, classes and definitions
(collectively known as 'records') in TableGen are the main high-level unit of
information that TableGen collects. Records are defined with a <tt>def</tt> or
<tt>class</tt> keyword, the record name, and an optional list of "<a
href="#templateargs">template arguments</a>". If the record has superclasses,
they are specified as a comma seperated list that starts with a colon character
(":"). If <a href="#valuedef">value definitions</a> or <a href="#recordlet">let
expressions</a> are needed for the class, they are enclosed in curly braces
("{}"); otherwise, the record ends with a semicolon. Here is a simple TableGen
file:</p>
<pre>
<b>class</b> C { <b>bit</b> V = 1; }
<b>def</b> X : C;
<b>def</b> Y : C {
<b>string</b> Greeting = "hello";
}
</pre>
<p>This example defines two definitions, <tt>X</tt> and <tt>Y</tt>, both of
which derive from the <tt>C</tt> class. Because of this, they both get the
<tt>V</tt> bit value. The <tt>Y</tt> definition also gets the Greeting member
as well.</p>
<p>In general, classes are useful for collecting together the commonality
between a group of records and isolating it in a single place. Also, classes
permit the specification of default values for their subclasses, allowing the
subclasses to override them as they wish.</p>
</div>
<!---------------------------------------------------------------------------->
<div class="doc_subsubsection">
<a name="valuedef">Value definitions</a>
</div>
<div class="doc_text">
<p>Value definitions define named entries in records. A value must be defined
before it can be referred to as the operand for another value definition or
before the value is reset with a <a href="#recordlet">let expression</a>. A
value is defined by specifying a <a href="#types">TableGen type</a> and a name.
If an initial value is available, it may be specified after the type with an
equal sign. Value definitions require terminating semicolons.</p>
</div>
<!-- -------------------------------------------------------------------------->
<div class="doc_subsubsection">
<a name="recordlet">'let' expressions</a>
</div>
<div class="doc_text">
<p>A record-level let expression is used to change the value of a value
definition in a record. This is primarily useful when a superclass defines a
value that a derived class or definition wants to override. Let expressions
consist of the '<tt>let</tt>' keyword followed by a value name, an equal sign
("="), and a new value. For example, a new class could be added to the example
above, redefining the <tt>V</tt> field for all of its subclasses:</p>
<pre>
<b>class</b> D : C { let V = 0; }
<b>def</b> Z : D;
</pre>
<p>In this case, the <tt>Z</tt> definition will have a zero value for its "V"
value, despite the fact that it derives (indirectly) from the <tt>C</tt> class,
because the <tt>D</tt> class overrode its value.</p>
</div>
<!-- -------------------------------------------------------------------------->
<div class="doc_subsubsection">
<a name="templateargs">Class template arguments</a>
</div>
<div class="doc_text">
<p>TableGen permits the definition of parameterized classes as well as normal
concrete classes. Parameterized TableGen classes specify a list of variable
bindings (which may optionally have defaults) that are bound when used. Here is
a simple example:</p>
<pre>
<b>class</b> FPFormat&lt;<b>bits</b>&lt;3&gt; val&gt; {
<b>bits</b>&lt;3&gt; Value = val;
}
<b>def</b> NotFP : FPFormat&lt;0&gt;;
<b>def</b> ZeroArgFP : FPFormat&lt;1&gt;;
<b>def</b> OneArgFP : FPFormat&lt;2&gt;;
<b>def</b> OneArgFPRW : FPFormat&lt;3&gt;;
<b>def</b> TwoArgFP : FPFormat&lt;4&gt;;
<b>def</b> SpecialFP : FPFormat&lt;5&gt;;
</pre>
<p>In this case, template arguments are used as a space efficient way to specify
a list of "enumeration values", each with a "Value" field set to the specified
integer.</p>
<p>The more esoteric forms of <a href="#values">TableGen expressions</a> are
useful in conjunction with template arguments. As an example:</p>
<pre>
<b>class</b> ModRefVal&lt;<b>bits</b>&lt;2&gt; val&gt; {
<b>bits</b>&lt;2&gt; Value = val;
}
<b>def</b> None : ModRefVal&lt;0&gt;;
<b>def</b> Mod : ModRefVal&lt;1&gt;;
<b>def</b> Ref : ModRefVal&lt;2&gt;;
<b>def</b> ModRef : ModRefVal&lt;3&gt;;
<b>class</b> Value&lt;ModRefVal MR&gt; {
<i>// decode some information into a more convenient format, while providing
// a nice interface to the user of the "Value" class.</i>
<b>bit</b> isMod = MR.Value{0};
<b>bit</b> isRef = MR.Value{1};
<i>// other stuff...</i>
}
<i>// Example uses</i>
<b>def</b> bork : Value&lt;Mod&gt;;
<b>def</b> zork : Value&lt;Ref&gt;;
<b>def</b> hork : Value&lt;ModRef&gt;;
</pre>
<p>This is obviously a contrived example, but it shows how template arguments
can be used to decouple the interface provided to the user of the class from the
actual internal data representation expected by the class. In this case,
running <tt>tblgen</tt> on the example prints the following definitions:</p>
<pre>
<b>def</b> bork { <i>// Value</i>
bit isMod = 1;
bit isRef = 0;
}
<b>def</b> hork { <i>// Value</i>
bit isMod = 1;
bit isRef = 1;
}
<b>def</b> zork { <i>// Value</i>
bit isMod = 0;
bit isRef = 1;
}
</pre>
<p> This shows that TableGen was able to dig into the argument and extract a
piece of information that was requested by the designer of the "Value" class.
For more realistic examples, please see existing users of TableGen, such as the
X86 backend.</p>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection">
<a name="filescope">File scope entities</a>
</div>
<!-- -------------------------------------------------------------------------->
<div class="doc_subsubsection">
<a name="include">File inclusion</a>
</div>
<div class="doc_text">
<p>TableGen supports the '<tt>include</tt>' token, which textually substitutes
the specified file in place of the include directive. The filename should be
specified as a double quoted string immediately after the '<tt>include</tt>'
keyword. Example:</p>
<pre>
<b>include</b> "foo.td"
</pre>
</div>
<!-- -------------------------------------------------------------------------->
<div class="doc_subsubsection">
<a name="globallet">'let' expressions</a>
</div>
<div class="doc_text">
<p> "let" expressions at file scope are similar to <a href="#recordlet">"let"
expressions within a record</a>, except they can specify a value binding for
multiple records at a time, and may be useful in certain other cases.
File-scope let expressions are really just another way that TableGen allows the
end-user to factor out commonality from the records.</p>
<p>File-scope "let" expressions take a comma-seperated list of bindings to
apply, and one of more records to bind the values in. Here are some
examples:</p>
<pre>
<b>let</b> isTerminator = 1, isReturn = 1 <b>in</b>
<b>def</b> RET : X86Inst&lt;"ret", 0xC3, RawFrm, NoArg&gt;;
<b>let</b> isCall = 1 <b>in</b>
<i>// All calls clobber the non-callee saved registers...</i>
<b>let</b> Defs = [EAX, ECX, EDX, FP0, FP1, FP2, FP3, FP4, FP5, FP6] in {
<b>def</b> CALLpcrel32 : X86Inst&lt;"call", 0xE8, RawFrm, NoArg&gt;;
<b>def</b> CALLr32 : X86Inst&lt;"call", 0xFF, MRMS2r, Arg32&gt;;
<b>def</b> CALLm32 : X86Inst&lt;"call", 0xFF, MRMS2m, Arg32&gt;;
}
</pre>
<p>File-scope "let" expressions are often useful when a couple of definitions
need to be added to several records, and the records do not otherwise need to be
opened, as in the case with the CALL* instructions above.</p>
</div>
<!-- *********************************************************************** -->
<div class="doc_section"><a name="backends">TableGen backends</a></div>
<!-- *********************************************************************** -->
<div class="doc_text">
<p>How they work, how to write one. This section should not contain details
about any particular backend, except maybe -print-enums as an example. This
should highlight the APIs in <tt>TableGen/Record.h</tt>.</p>
</div>
<!-- *********************************************************************** -->
<hr>
<address>
<a href="http://jigsaw.w3.org/css-validator/check/referer"><img
src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a>
<a href="http://validator.w3.org/check/referer"><img
src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /></a>
<a href="mailto:sabre@nondot.org">Chris Lattner</a><br>
<a href="http://llvm.cs.uiuc.edu">LLVM Compiler Infrastructure</a><br>
Last modified: $Date$
</address>
</body>
</html>

View File

@@ -1,11 +1,10 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" href="llvm.css" type="text/css" media="screen" />
<title>LLVM Test Suite Guide</title>
<link rel="stylesheet" href="llvm.css" type="text/css">
</head>
<body>
<div class="doc_title">
@@ -16,256 +15,237 @@
<li><a href="#overview">Overview</a></li>
<li><a href="#Requirements">Requirements</a></li>
<li><a href="#quick">Quick Start</a></li>
<li><a href="#org">LLVM Test Suite Organization</a></li>
<li><a href="#org">LLVM Test Suite Organization</a>
<ul>
<li><a href="#codefragments">Code Fragments</a></li>
<li><a href="#wholeprograms">Whole Programs</a></li>
</ul>
</ul></li>
<li><a href="#tree">LLVM Test Suite Tree</a></li>
<li><a href="#qmstructure">QMTest Structure</a></li>
<li><a href="#progstructure">Programs Structure</a></li>
<li><a href="#run">Running the LLVM Tests</a></li>
<p><b>Written by John T. Criswell</b></p>
<li><a href="#nightly">Running the nightly tester</a></li>
</ol>
<!--===============================================================-->
<div class="doc_section"><a name="overview">Overview</a></div>
<!--===============================================================-->
<div class="doc_author">
<p>Written by John T. Criswell</p>
</div>
<div class="doc_text">
<p>
This document is the reference manual for the LLVM test suite. It
documents the structure of the LLVM test suite, the tools needed to
use it, and how to add and run tests.
</p>
</div>
<!--===============================================================-->
<div class="doc_section"><a name="overview">Overview</a></div>
<!--===============================================================-->
<!--===============================================================-->
<div class="doc_section"><a name="Requirements">Requirements</a></div>
<!--===============================================================-->
<div class="doc_text">
<div class="doc_text">
<p>
In order to use the LLVM test suite, you will need all of the software
required to build LLVM, plus the following:
</p>
<dl compact>
<dt><A HREF="http://www.qmtest.com">QMTest</A></dt>
<dd>The LLVM test suite uses QMTest to organize and
run tests.</dd>
<p>This document is the reference manual for the LLVM test suite. It documents
the structure of the LLVM test suite, the tools needed to use it, and how to add
and run tests.</p>
<dt><A HREF="http://www.python.org">Python</A></dt>
<dd>You will need a Python interpreter that works with
QMTest. Python will need zlib and SAX support
enabled.</dd>
</dl>
</div>
</div>
<!--===============================================================-->
<div class="doc_section"><a name="quick">Quick Start</a></div>
<!--===============================================================-->
<!--===============================================================-->
<div class="doc_section"><a name="Requirements">Requirements</a></div>
<!--===============================================================-->
<div class="doc_text">
<p>
The tests are located in the LLVM source tree under the directory
<tt>llvm/test</tt>. To run all of the tests in LLVM, use the Master
Makefile in that directory:
</p>
<pre>
% make -C llvm/test
</pre>
<div class="doc_text">
<p>
To run only the code fragment tests (i.e. those that do basic testing of
LLVM), run the tests organized by QMTest:
</p>
<p>In order to use the LLVM test suite, you will need all of the software
required to build LLVM, plus the following:</p>
<pre>
% make -C llvm/test qmtest
</pre>
<dl>
<dt><a href="http://www.qmtest.com">QMTest</A></dt>
<dd>The LLVM test suite uses QMTest to organize and run tests. <b>Note:
you will need <a href="http://llvm.cs.uiuc.edu/qm-2.0.3.tar.gz">QMTest
2.0.3 (source tar.gz file)</a> to be successful. The tests do not run with
any other version.</b></dd>
<p>
To run only the tests that compile and execute whole programs, run the
Programs tests:
</p>
<dt><a href="http://www.python.org">Python</A></dt>
<dd>You will need a Python interpreter that works with QMTest. Python will
need zlib and SAX support enabled.</dd>
</dl>
<pre>
% make -C llvm/test/Programs
</pre>
</div>
</div>
<!--===============================================================-->
<div class="doc_section"><h2><a name="org">LLVM Test Suite
Organization </a></div>
<!--===============================================================-->
<!--===============================================================-->
<div class="doc_section"><a name="quick">Quick Start</a></div>
<!--===============================================================-->
<div class="doc_text">
<p>The LLVM test suite contains two major categories of tests: code
fragments and whole programs.</p>
</div>
<div class="doc_text">
<div class="doc_subsection"><a name="codefragments">Code Fragments</a>
</div>
<p> The tests are located in the LLVM source tree under the directory
<tt>llvm/test</tt>. To run all of the tests in LLVM, use the Master Makefile in
that directory:</p>
<div class="doc_text">
<p>
Code fragments are small pieces of code that test a specific
feature of LLVM or trigger a specific bug in LLVM. They are
usually written in LLVM assembly language, but can be
written in other languages if the test targets a
particular language front end.
</p><p>
Code fragments are not complete programs, and they are
never executed to determine correct behavior.
</p><p>
The tests in the Features and
Regression directories contain code fragments.
</p>
</div>
<pre>
% gmake -C llvm/test
</pre>
<div class="doc_subsection"><a name="wholeprograms">Whole Programs</a>
</div>
<p>To run only the code fragment tests (i.e. those that do basic testing of
LLVM), run the tests organized by QMTest:</p>
<div class="doc_text">
<p>
Whole Programs are pieces of code which can be compiled and
linked into a stand-alone program that can be executed. These
programs are generally written in high level languages such as C
or C++, but sometimes they are written straight in LLVM
assembly.
</p><p>
These programs are compiled and then executed using several
different methods (native compiler, LLVM C backend, LLVM JIT,
LLVM native code generation, etc). The output of these programs
is compared to ensure that LLVM is compiling the program
correctly.
</p><p>
In addition to compiling and executing programs, whole program
tests serve as a way of benchmarking LLVM performance, both in
terms of the efficiency of the programs generated as well as the
speed with which LLVM compiles, optimizes, and generates code.
</p><p>
The Programs directory contains all tests which compile and
benchmark whole programs.
</p>
</div>
<pre>
% gmake -C llvm/test qmtest
</pre>
<!--===============================================================-->
<div class="doc_section"><h2><a name="tree">LLVM Test Suite Tree</a>
</div>
<!--===============================================================-->
<p>To run only the tests that compile and execute whole programs, run the
Programs tests:</p>
<div class="doc_text">
<p>Each type of test in the LLVM test suite has its own directory. The
major subtrees of the test suite directory tree are as follows:</p>
<pre>
% gmake -C llvm/test/Programs
</pre>
<ul>
</div>
<!--===============================================================-->
<div class="doc_section"><a name="org">LLVM Test Suite Organization</a></div>
<!--===============================================================-->
<div class="doc_text">
<p>The LLVM test suite contains two major categories of tests: code
fragments and whole programs.</p>
</div>
<div class="doc_subsection"><a name="codefragments">Code Fragments</a>
</div>
<div class="doc_text">
<p>Code fragments are small pieces of code that test a specific feature of LLVM
or trigger a specific bug in LLVM. They are usually written in LLVM assembly
language, but can be written in other languages if the test targets a particular
language front end.</p>
<p>Code fragments are not complete programs, and they are never executed to
determine correct behavior.</p>
<p>The tests in the Features and Regression directories contain code
fragments.</p>
</div>
<div class="doc_subsection"><a name="wholeprograms">Whole Programs</a></div>
<div class="doc_text">
<p>Whole Programs are pieces of code which can be compiled and linked into a
stand-alone program that can be executed. These programs are generally written
in high level languages such as C or C++, but sometimes they are written
straight in LLVM assembly.</p>
<p>These programs are compiled and then executed using several different
methods (native compiler, LLVM C backend, LLVM JIT, LLVM native code generation,
etc). The output of these programs is compared to ensure that LLVM is compiling
the program correctly.</p>
<p>In addition to compiling and executing programs, whole program tests serve as
a way of benchmarking LLVM performance, both in terms of the efficiency of the
programs generated as well as the speed with which LLVM compiles, optimizes, and
generates code.</p>
<p>The Programs directory contains all tests which compile and benchmark whole
programs.</p>
</div>
<!--===============================================================-->
<div class="doc_section"><a name="tree">LLVM Test Suite Tree</a></div>
<!--===============================================================-->
<div class="doc_text">
<p>Each type of test in the LLVM test suite has its own directory. The major
subtrees of the test suite directory tree are as follows:</p>
<ul>
<li>Features
<p>
This directory contains sample codes that test various features
of the LLVM language. These pieces of sample code are run
through various assembler, disassembler, and optimizer passes.
</p>
<p>This directory contains sample codes that test various features of the
LLVM language. These pieces of sample code are run through various
assembler, disassembler, and optimizer passes.</p>
<li>Regression
<p>
This directory contains regression tests for LLVM. When a bug
is found in LLVM, a regression test containing just enough
code to reproduce the problem should be written and placed
somewhere underneath this directory. In most cases, this
will be a small piece of LLVM assembly language code, often
distilled from an actual application or benchmark.
</p>
<p>This directory contains regression tests for LLVM. When a bug is found
in LLVM, a regression test containing just enough code to reproduce the
problem should be written and placed somewhere underneath this directory.
In most cases, this will be a small piece of LLVM assembly language code,
often distilled from an actual application or benchmark.</p>
<li>Programs
<p>
The Programs directory contains programs that can be compiled
with LLVM and executed. These programs are compiled using the
native compiler and various LLVM backends. The output from the
program compiled with the native compiler is assumed correct;
the results from the other programs are compared to the native
program output and pass if they match.
</p><p>
In addition for testing correctness, the Programs directory
also performs timing tests of various LLVM optimizations.
It also records compilation times for the compilers and the
JIT. This information can be used to compare the
effectiveness of LLVM's optimizations and code generation.
</p><p>
The Programs directory is subdivided into several smaller
subdirectories:
<p>The Programs directory contains programs that can be compiled with LLVM
and executed. These programs are compiled using the native compiler and
various LLVM backends. The output from the program compiled with the native
compiler is assumed correct; the results from the other programs are
compared to the native program output and pass if they match. </p>
<p> In addition for testing correctness, the Programs directory also
performs timing tests of various LLVM optimizations. It also records
compilation times for the compilers and the JIT. This information can be
used to compare the effectiveness of LLVM's optimizations and code
generation.</p>
<p>The Programs directory is subdivided into several smaller subdirectories:
</p>
<ul>
<li>Programs/SingleSource
<p>
The SingleSource directory contains test programs that
are only a single source file in size. These are
usually small benchmark programs or small programs that
calculate a particular value. Several such programs are
grouped together in each directory.
</p>
<p>The SingleSource directory contains test programs that are only a
single source file in size. These are usually small benchmark programs
or small programs that calculate a particular value. Several such
programs are grouped together in each directory.</p></li>
<li>Programs/MultiSource
<p>
The MultiSource directory contains subdirectories which
contain entire programs with multiple source files.
Large benchmarks and whole applications go here.
</p>
<p>The MultiSource directory contains subdirectories which contain
entire programs with multiple source files. Large benchmarks and whole
applications go here.</p></li>
<li>Programs/External
<p>
The External directory contains Makefiles for building
code that is external to (i.e. not distributed with)
LLVM. The most prominent member of this directory is
the SPEC 2000 benchmark suite. The presence and
location of these external programs is configured by the
LLVM <tt>configure</tt> script.
</p>
</ul>
<p>The External directory contains Makefiles for building code that is
external to (i.e. not distributed with) LLVM. The most prominent member
of this directory is the SPEC 2000 benchmark suite. The presence and
location of these external programs is configured by the LLVM
<tt>configure</tt> script.</p></li>
<p>
</ul></li>
<li>QMTest
<p>
This directory contains the QMTest information files. Inside
this directory are QMTest administration files and the Python
code that implements the LLVM test and database classes.
</p>
</ul>
</div>
<p>This directory contains the QMTest information files. Inside this
directory are QMTest administration files and the Python code that
implements the LLVM test and database classes.</p>
<!--===============================================================-->
<div class="doc_section"><h2><a name="qmstructure">QMTest Structure</a>
</div>
<!--===============================================================-->
</ul>
<div class="doc_text">
<p>
The LLVM test suite is partially driven by QMTest and partially
driven by GNU Make. Specifically, the Features and Regression tests
are all driven by QMTest. The Programs directory is currently
driven by a set of Makefiles.
</p><p>
The QMTest system needs to have several pieces of information
available; these pieces of configuration information are known
collectively as the "context" in QMTest parlance. Since the context
for LLVM is relatively large, the master Makefile in llvm/test
sets it for you.
</p><p>
The LLVM database class makes the subdirectories of llvm/test a
QMTest test database. For each directory that contains tests driven by
QMTest, it knows what type of test the source file is and how to run it.
</p><p>
Hence, the QMTest namespace is essentially what you see in the
Feature and Regression directories, but there is some magic that
the database class performs (as described below).
</p><p>
The QMTest namespace is currently composed of the following tests and
test suites:
</p>
</div>
<ul>
<!--===============================================================-->
<div class="doc_section"><a name="qmstructure">QMTest Structure</a></div>
<!--===============================================================-->
<div class="doc_text">
<p>The LLVM test suite is partially driven by QMTest and partially
driven by GNU Make. Specifically, the Features and Regression tests
are all driven by QMTest. The Programs directory is currently
driven by a set of Makefiles.</p>
<p>The QMTest system needs to have several pieces of information
available; these pieces of configuration information are known
collectively as the "context" in QMTest parlance. Since the context
for LLVM is relatively large, the master Makefile in llvm/test
sets it for you.</p>
<p>The LLVM database class makes the subdirectories of llvm/test a
QMTest test database. For each directory that contains tests driven by
QMTest, it knows what type of test the source file is and how to run it.</p>
<p>Hence, the QMTest namespace is essentially what you see in the
Feature and Regression directories, but there is some magic that
the database class performs (as described below).</p>
<p>The QMTest namespace is currently composed of the following tests and test
suites:</p>
<ul>
<li>Feature
<p>
These are the feature tests found in the Feature directory.
@@ -273,155 +253,168 @@
</p>
<ul>
<li>ad
<p>
Assembler/Disassembler tests. These tests verify that a
piece of LLVM assembly language can be assembled into
bytecode and then disassembled into the original
assembly language code. It does this several times to
ensure that assembled output can be disassembled and
disassembler output can be assembled. It also verifies
that the give assembly language file can be assembled
correctly.
</p>
<p>Assembler/Disassembler tests. These tests verify that a piece of LLVM
assembly language can be assembled into bytecode and then disassembled
into the original assembly language code. It does this several times to
ensure that assembled output can be disassembled and disassembler output
can be assembled. It also verifies that the give assembly language file
can be assembled correctly.</p></li>
<li>opt
<p>
Optimizer tests. These tests verify that two of the
optimizer passes completely optimize a program (i.e.
after a single pass, they cannot optimize a program
any further).
</p>
<p>Optimizer tests. These tests verify that two of the optimizer passes
completely optimize a program (i.e. after a single pass, they cannot
optimize a program any further).</p></li>
<li>mc
<p>
Machine code tests. These tests verify that the LLVM
assembly language file can be translated into native
assembly code.
</p>
<p> Machine code tests. These tests verify that the LLVM assembly
language file can be translated into native assembly code.</p></li>
<li>cc
<p>
C code tests. These tests verify that the specified
LLVM assembly code can be converted into C source code
using the C backend.
</p>
<p>C code tests. These tests verify that the specified LLVM assembly
code can be converted into C source code using the C backend.</p></li>
</ul>
<p>
The LLVM database class looks at every file in the Feature
directory and creates a fake test hierarchy containing
<tt>Feature.&lt;testtype&gt;.&lt;testname&gt;</tt>. So, if you
add an LLVM assembly language file to the Feature directory, it
actually creates 5 new tests: assembler/disassembler, assembler,
optimizer, machine code, and C code.
<p>The LLVM database class looks at every file in the Feature directory and
creates a fake test hierarchy containing
<tt>Feature.&lt;testtype&gt;.&lt;testname&gt;</tt>. So, if you add an LLVM
assembly language file to the Feature directory, it actually creates 5 new
tests: assembler/disassembler, assembler, optimizer, machine code, and C code.
</p>
<li>Regression
<p>
These are the regression tests. There is one suite for each
subdirectory of the Regression directory. If you add a new
subdirectory there, you will need to modify, at least, the
<tt>RegressionMap</tt> variable in <tt>QMTest/llvmdb.py</tt> so
that QMTest knows how to run the tests in the new subdirectory.
</p>
</ul>
</div>
<p>These are the regression tests. There is one suite for each
subdirectory of the Regression directory. If you add a new subdirectory
there, you will need to modify, at least, the <tt>RegressionMap</tt>
variable in <tt>QMTest/llvmdb.py</tt> so that QMTest knows how to run the
tests in the new subdirectory.</p>
<!--===============================================================-->
<div class="doc_section"><h2><a name="progstructure">Programs
Structure</a></div>
<!--===============================================================-->
</ul>
<div class="doc_text">
<p>
As mentioned previously, the Programs tree in llvm/test provides three
types of tests: MultiSource, SingleSource, and External. Each tree is
then subdivided into several categories, including applications,
benchmarks, regression tests, code that is strange grammatically, etc.
These organizations should be relatively self explanatory.
</p><p>
In addition to the regular Programs tests, the Programs tree also
provides a mechanism for compiling the programs in different ways. If
the variable TEST is defined on the gmake command line, the test system
will include a Makefile named <tt>TEST.&lt;value of TEST
variable&gt;.Makefile</tt>. This Makefile can modify build rules to
yield different results.
</p><p>
For example, the LLVM nightly tester uses <tt>TEST.nightly.Makefile</tt>
to create the nightly test reports. To run the nightly tests, run
<tt>gmake TEST=nightly</tt>.
</p><p>
There are several TEST Makefiles available in the tree. Some of them
are designed for internal LLVM research and will not work outside of the
LLVM research group. They may still be valuable, however, as a guide to
writing your own TEST Makefile for any optimization or analysis passes
that you develop with LLVM.
</p>
</div>
</div>
<!--===============================================================-->
<div class="doc_section"><h2><a name="run">Running the LLVM Tests</a>
</div>
<!--===============================================================-->
<!--===============================================================-->
<div class="doc_section"><a name="progstructure">Programs Structure</a></div>
<!--===============================================================-->
<div class="doc_text">
<p>
First, all tests are executed within the LLVM object directory tree.
They <i>are not</i> executed inside of the LLVM source tree. This is
because the test suite creates temporary files during execution.
</p><p>
The master Makefile in llvm/test is capable of running both the
QMTest driven tests and the Programs tests. By default, it will run
all of the tests.
</p><p>
To run only the QMTest driven tests, run <tt>make qmtest</tt> at the
command line in llvm/tests. To run a specific qmtest, suffix the test
name with ".t" when running make.
</p><p>
For example, to run the Regression.LLC tests, type
<tt>make Regression.LLC.t</tt> in llvm/tests.
</p><p>
Note that the Makefiles in llvm/test/Features and llvm/test/Regression
are gone. You must now use QMTest from the llvm/test directory to run
them.
</p><p>
To run the Programs test, cd into the llvm/test/Programs directory and
type <tt>make</tt>. Alternatively, you can type <tt>make
TEST=&lt;type&gt; test</tt> to run one of the specialized tests in
llvm/test/Programs/TEST.&lt;type&gt;.Makefile. For example, you could
run the nightly tester tests using the following commands:
</p>
<div class="doc_text">
<pre>
<p>As mentioned previously, the Programs tree in llvm/test provides three types
of tests: MultiSource, SingleSource, and External. Each tree is then subdivided
into several categories, including applications, benchmarks, regression tests,
code that is strange grammatically, etc. These organizations should be
relatively self explanatory.</p>
<p>In addition to the regular Programs tests, the Programs tree also provides a
mechanism for compiling the programs in different ways. If the variable TEST is
defined on the gmake command line, the test system will include a Makefile named
<tt>TEST.&lt;value of TEST variable&gt;.Makefile</tt>. This Makefile can modify
build rules to yield different results.</p>
<p>For example, the LLVM nightly tester uses <tt>TEST.nightly.Makefile</tt> to
create the nightly test reports. To run the nightly tests, run <tt>gmake
TEST=nightly</tt>.</p>
<p>There are several TEST Makefiles available in the tree. Some of them are
designed for internal LLVM research and will not work outside of the LLVM
research group. They may still be valuable, however, as a guide to writing your
own TEST Makefile for any optimization or analysis passes that you develop with
LLVM.</p>
</div>
<!--===============================================================-->
<div class="doc_section"><a name="run">Running the LLVM Tests</a></div>
<!--===============================================================-->
<div class="doc_text">
<p>First, all tests are executed within the LLVM object directory tree. They
<i>are not</i> executed inside of the LLVM source tree. This is because the
test suite creates temporary files during execution. </p>
<p>The master Makefile in llvm/test is capable of running both the QMTest driven
tests and the Programs tests. By default, it will run all of the tests.</p>
<p>To run only the QMTest driven tests, run <tt>gmake qmtest</tt> at the
command line in llvm/tests. To run a specific qmtest, suffix the test name with
".t" when running gmake.</p>
<p>For example, to run the Regression.LLC tests, type <tt>gmake
Regression.LLC.t</tt> in llvm/tests.</p>
<p>Note that the Makefiles in llvm/test/Features and llvm/test/Regression are
gone. You must now use QMTest from the llvm/test directory to run them.</p>
<p>To run the Programs test, cd into the llvm/test/Programs directory and type
<tt>gmake</tt>. Alternatively, you can type <tt>gmake TEST=&lt;type&gt;
test</tt> to run one of the specialized tests in
llvm/test/Programs/TEST.&lt;type&gt;.Makefile. For example, you could run the
nightly tester tests using the following commands:</p>
<pre>
% cd llvm/test/Programs
% make TEST=nightly test
</pre>
% gmake TEST=nightly test
</pre>
<p>
Regardless of which test you're running, the results are printed on
standard output and standard error. You can redirect these results to a
file if you choose.
</p><p>
Some tests are known to fail. Some are bugs that we have not fixed yet;
others are features that we haven't added yet (or may never add). In
QMTest, the result for such tests will be XFAIL (eXpected FAILure). In
this way, you can tell the difference between an expected and unexpected
failure.
</p><p>
The Programs tests have no such feature as of this time. If the test
passes, only warnings and other miscellaneous output will be generated.
If a test fails, a large &lt;program&gt; FAILED message will be
displayed. This will help you separate benign warnings from actual test
failures.
</p>
</div>
<p>Regardless of which test you're running, the results are printed on standard
output and standard error. You can redirect these results to a file if you
choose.</p>
<p>Some tests are known to fail. Some are bugs that we have not fixed yet;
others are features that we haven't added yet (or may never add). In QMTest,
the result for such tests will be XFAIL (eXpected FAILure). In this way, you
can tell the difference between an expected and unexpected failure.</p>
<p>The Programs tests have no such feature as of this time. If the test passes,
only warnings and other miscellaneous output will be generated. If a test
fails, a large &lt;program&gt; FAILED message will be displayed. This will help
you separate benign warnings from actual test failures.</p>
</div>
<!--===============================================================-->
<div class="doc_section"><a name="nightly">Running the nightly tester</a></div>
<!--===============================================================-->
<div class="doc_text">
<p>
The <a href="http://llvm.cs.uiuc.edu/testresults/">LLVM Nightly Testers</a>
automatically check out an LLVM tree, build it, run the "nightly"
program test (described above) and all of the regression tests, then
delete the checked out tree. This tester is designed to ensure that
programs don't break as well as keep track of LLVM's progress over time.</p>
<p>
If you'd like to set up an instance of the nightly tester to run on your
machine, take a look at the comments at the top of the utils/NightlyTester.pl
file. We usually run it from a crontab entry that looks ilke this:
</p>
<pre>
5 3 * * * LLVM_LIB_SEARCH_PATH=.../llvm-gcc/bytecode-libs $HOME/llvm/utils/NightlyTest.pl -parallel -enable-linscan ...CVSREPOSTRING... $HOME/buildtest-X86 $HOME/cvs/testresults-X86
</pre>
<p>
Take a look at the NightlyTest.pl file to see what all of the flags and
strings do. If you start running the nightly tests, please let us know and
we'll link your page to the global tester page. Thanks!
</p>
</div>
<!-- *********************************************************************** -->
<hr><font size="-1">
<address>John T. Criswell</address>
Last modified: $Date$
</font>
<hr>
<address>
<a href="http://jigsaw.w3.org/css-validator/check/referer"><img
src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a>
<a href="http://validator.w3.org/check/referer"><img
src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /></a>
John T. Criswell<br>
<a href="http://llvm.cs.uiuc.edu">The LLVM Compiler Infrastructure</a><br>
Last modified: $Date$
</address>
</body>
</html>

File diff suppressed because it is too large Load Diff

View File

@@ -201,7 +201,7 @@ DISTRIBUTE_GROUP_DOC = NO
# The TAB_SIZE tag can be used to set the number of spaces in a tab.
# Doxygen uses this value to replace tabs by spaces in code fragments.
TAB_SIZE = 8
TAB_SIZE = 2
# The GENERATE_TODOLIST tag can be used to enable (YES) or
# disable (NO) the todo list. This list is created by putting \todo
@@ -301,7 +301,7 @@ WARN_LOGFILE =
# directories like "/usr/src/myproject". Separate the files or directories with
# spaces.
INPUT = ..
INPUT = .. ./doxygen.intro
# If the value of the INPUT tag contains directories, you can use the
# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
@@ -411,7 +411,7 @@ ALPHABETICAL_INDEX = YES
# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
# in which this list will be split (can be a number in the range [1..20])
COLS_IN_ALPHA_INDEX = 5
COLS_IN_ALPHA_INDEX = 4
# In case all classes in a project start with a common prefix, all
# classes will be put under the same header in the alphabetical index.
@@ -439,20 +439,20 @@ HTML_OUTPUT = .
# each generated HTML page. If it is left blank doxygen will generate a
# standard header.
HTML_HEADER =
HTML_HEADER = doxygen.header
# The HTML_FOOTER tag can be used to specify a personal HTML footer for
# each generated HTML page. If it is left blank doxygen will generate a
# standard footer.
HTML_FOOTER =
HTML_FOOTER = doxygen.footer
# The HTML_STYLESHEET tag can be used to specify a user defined cascading
# style sheet that is used by each HTML page. It can be used to
# fine-tune the look of the HTML output. If the tag is left blank doxygen
# will generate a default style sheet
HTML_STYLESHEET =
HTML_STYLESHEET = doxygen.css
# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
# files or namespaces will be aligned in HTML using tables. If set to
@@ -861,38 +861,3 @@ DOT_CLEANUP = YES
# used. If set to NO the values of all tags below this one will be ignored.
SEARCHENGINE = NO
# The CGI_NAME tag should be the name of the CGI script that
# starts the search engine (doxysearch) with the correct parameters.
# A script with this name will be generated by doxygen.
CGI_NAME =
# The CGI_URL tag should be the absolute URL to the directory where the
# cgi binaries are located. See the documentation of your http daemon for
# details.
CGI_URL =
# The DOC_URL tag should be the absolute URL to the directory where the
# documentation is located. If left blank the absolute path to the
# documentation, with file:// prepended to it, will be used.
DOC_URL =
# The DOC_ABSPATH tag should be the absolute path to the directory where the
# documentation is located. If left blank the directory on the local machine
# will be used.
DOC_ABSPATH =
# The BIN_ABSPATH tag must point to the directory where the doxysearch binary
# is installed.
BIN_ABSPATH =
# The EXT_DOC_PATHS tag can be used to specify one or more paths to
# documentation generated for other projects. This allows doxysearch to search
# the documentation for these projects as well.
EXT_DOC_PATHS =

90
llvm/docs/doxygen.css Normal file
View File

@@ -0,0 +1,90 @@
BODY { background: white; color: black; font-family: Verdana,Arial,sans-serif; }
H1 { text-align: center; }
H2 { text-align: center; }
H3 { text-align: center; }
CAPTION { font-weight: bold }
A.qindex {}
A.qindexRef {}
A.el { text-decoration: none; font-weight: bold }
A.elRef { font-weight: bold }
A.code { text-decoration: none; font-weight: normal; color: #4444ee }
A.codeRef { font-weight: normal; color: #4444ee }
A:link {
cursor: pointer;
text-decoration: none;
font-weight: bolder;
}
A:visited {
cursor: pointer;
text-decoration: underline;
font-weight: bolder;
}
A:hover {
cursor: pointer;
text-decoration: underline;
font-weight: bolder;
}
A:active {
cursor: pointer;
text-decoration: underline;
font-weight: bolder;
font-style: italic;
}
DL.el { margin-left: -1cm }
DIV.fragment { width: 100%; border: none; background-color: #eeeeee }
DIV.ah { background-color: black; font-weight: bold; color: #ffffff; margin-bottom: 3px; margin-top: 3px }
TD.md { background-color: #f2f2ff; font-weight: bold; }
TD.mdname1 { background-color: #f2f2ff; font-weight: bold; color: #602020; }
TD.mdname { background-color: #f2f2ff; font-weight: bold; color: #602020; width: 600px; }
DIV.groupHeader { margin-left: 16px; margin-top: 12px; margin-bottom: 6px; font-weight: bold }
DIV.groupText { margin-left: 16px; font-style: italic; font-size: smaller }
TD.indexkey {
background-color: #eeeeff;
font-weight: bold;
padding-right : 10px;
padding-top : 2px;
padding-left : 10px;
padding-bottom : 2px;
margin-left : 0px;
margin-right : 0px;
margin-top : 2px;
margin-bottom : 2px
}
TD.indexvalue {
background-color: #eeeeff;
font-style: italic;
padding-right : 10px;
padding-top : 2px;
padding-left : 10px;
padding-bottom : 2px;
margin-left : 0px;
margin-right : 0px;
margin-top : 2px;
margin-bottom : 2px
}
span.keyword { color: #008000 }
span.keywordtype { color: #604020 }
span.keywordflow { color: #e08000 }
span.comment { color: #800000 }
span.preprocessor { color: #806020 }
span.stringliteral { color: #002080 }
span.charliteral { color: #008080 }
.footer {
font-size: 80%;
font-weight: bold;
text-align: center;
vertical-align: middle;
}
.title {
font-size: 25pt;
color: black; background: url("../img/lines.gif");
font-weight: bold;
border-width: 1px;
border-style: solid none solid none;
text-align: center;
vertical-align: middle;
padding-left: 8pt;
padding-top: 1px;
padding-bottom: 2px
}

10
llvm/docs/doxygen.footer Normal file
View File

@@ -0,0 +1,10 @@
<hr>
<p class="footer">
Generated on $datetime for <a href="http://llvm.cs.uiuc.edu">LLVM</a> by
<a href="http://www.doxygen.org">doxygen $doxygenversion</a><br/>
Copyright &copy; 2003,2004 University of Illinois at Urbana-Champaign. All
Rights Reserved.</p>
</body>
</html>

9
llvm/docs/doxygen.header Normal file
View File

@@ -0,0 +1,9 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head>
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"/>
<meta name="keywords" content="LLVM,Low Level Virtual Machine,C++,doxygen,API,documentation"/>
<meta name="description" content="C++ source code API documentation for the Low Level Virtual Machine (LLVM)."/>
<title>LLVM: $title</title>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head><body>
<p class="title">LLVM API Documentation</p>

25
llvm/docs/doxygen.intro Normal file
View File

@@ -0,0 +1,25 @@
////////////////////////////////////////////////////////////////////////////////
/// @file doxygen.intro
/// @author Reid Spencer <rspencer@x10sys.com>
/// @date 2003/12/30
/// @brief LLVM API documentation introduction.
////////////////////////////////////////////////////////////////////////////////
///
/// @mainpage LLVM:Low Level Virtual Machine
///
/// @section main_intro Introduction
/// Welcome to the Low Level Virtual Machine (LLVM)
///
/// This documentation describes the @b internal software that makes
/// up LLVM, not the @b external use of LLVM. There are no instructions
/// here on how to use LLVM, only the APIs that make up the software. For usage
/// instructions, please see the programmer's guide or reference manual.
///
/// @section main_caveat Caveat
/// This documentation is generated directly from the source code with doxygen.
/// Since LLVM is constantly under active development, what you're about to
/// read is out of date! However, it may still be useful since certain portions
/// of LLVM are very stable.
///
/// @section main_changelog Change Log
/// - Original content written 12/30/2003 by Reid Spencer

View File

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

BIN
llvm/docs/img/lines.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 91 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

200
llvm/docs/index.html Normal file
View File

@@ -0,0 +1,200 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Documentation for the LLVM System</title>
<link rel="stylesheet" href="llvm.css" type="text/css">
</head>
<body>
<div class="doc_title">Documentation for the LLVM System</div>
<div class="doc_text">
<ul>
<li><a href="#llvmdesign">LLVM Design</a></li>
<li><a href="#userguide">LLVM User Guides</a></li>
<li><a href="#llvmprog">General LLVM Programming Documentation</a></li>
<li><a href="#subsystems">LLVM Subsystem Documentation</a></li>
<li><a href="#maillist">LLVM Mailing Lists</a></li>
</ul>
</div>
<div class="doc_author">
<p>Written by <a href="http://llvm.cs.uiuc.edu">The LLVM Team</a></p>
</div>
<!--=======================================================================-->
<div class="doc_section"><a name="llvmdesign">LLVM Design</a></div>
<!--=======================================================================-->
<ul>
<li><a href="pubs/2004-01-30-CGO-LLVM.html"> LLVM: A Compilation Framework for
Lifelong Program Analysis &amp; Transformation</a>: - Describes
the LLVM instruction set and compilation strategy. This should be the first
document you read to get an overview of LLVM.</li>
<li><a href="LangRef.html">LLVM Reference Manual</a> - Defines the LLVM
intermediate representation, the assembly form of the different nodes, and
provides reference information about the different tools in LLVM.</li>
<li><a href="BytecodeFormat.html">LLVM Bytecode File Format</a></li>
</ul>
<!--=======================================================================-->
<div class="doc_section"><a name="userguide">LLVM User Guides</a></div>
<!--=======================================================================-->
<ul>
<li><a href="GettingStarted.html">The LLVM Getting Started Guide</a> -
Discusses how to get up and running quickly with the LLVM infrastructure.
Everything from unpacking and compilation of the distribution to execution of
some tools.</li>
<li><a href="CommandGuide/index.html">LLVM Command Guide</a> - A reference
manual for the LLVM command line utilities ("man" pages for LLVM tools).</li>
<li><a href="FAQ.html">Frequently Asked Questions</a> - A list of common
questions and problems and their solutions.</li>
<li><a href="ReleaseNotes.html">Release notes for the current release</a>
- This describes new features, known bugs, and other limitations.</li>
<li><a href="HowToSubmitABug.html">How to Submit A Bug Report</a> -
Instructions for properly submitting information about any bugs you run into in
the LLVM system.</li>
<li><a href="TestingGuide.html">LLVM Test Suite Guide</a> - A reference
manual for using the LLVM test suite.</li>
<li><a href="CFEBuildInstrs.html">How to build the C/C++ front-end</a> -
Instructions for building the front-end from source.</li>
<li><a name="irc">You can probably find help on the unofficial LLVM IRC
channel</a>. We often are on irc.oftc.net in the #llvm channel. If you are
using the mozilla browser, and have chatzilla installed, you can join by <a
href="irc://irc.oftc.net/llvm">clicking here</a>.</li>
</ul>
<!--=======================================================================-->
<div class="doc_section"><a name="llvmprog">General LLVM Programming Documentation</a></div>
<!--=======================================================================-->
<ul>
<li><a href="ProgrammersManual.html">The LLVM Programmers Manual</a> -
Introduction to the general layout of the LLVM sourcebase, important classes
and APIs, and some tips &amp; tricks.</li>
<li><a href="Projects.html">LLVM Project Guide</a> - How-to guide and
templates for new projects that <em>use</em> the LLVM infrastructure. The
templates (directory organization, Makefiles, and test tree) allow the project
code to be located outside (or inside) the <tt>llvm/</tt> tree, while using LLVM
header files and libraries.</li>
<li><a href="CommandLine.html">CommandLine library Reference Manual</a> -
Provides information on using the command line parsing library.</li>
<li><a href="CodingStandards.html">Recommended LLVM Coding standards</a> -
Details the LLVM coding standards and provides useful information on writing
efficient C++ code.</li>
<li><a href="OpenProjects.html">Open Projects</a> - Look here if you are
interested in doing something with LLVM but aren't sure what needs to be
done.</li>
<li><a href="ExtendingLLVM.html">Extending LLVM</a> - Look here to see how
to add instructions and intrinsics to LLVM.</li>
<li><a href="CodingStandards.html">Coding Standards</a> - Guidelines for
hacking LLVM source.</li>
<li><a href="http://llvm.cs.uiuc.edu/doxygen/">Doxygen generated
documentation</a> (<a href="http://llvm.cs.uiuc.edu/doxygen/inherits.html">
classes</a>)</li>
<li><a href="http://llvm.cs.uiuc.edu/cvsweb/cvsweb.cgi/llvm">CVSWeb CVS Tree
Browser</a></li>
</ul>
<!--=======================================================================-->
<div class="doc_section"><a name="subsystems">LLVM Subsystem Documentation</a></div>
<!--=======================================================================-->
<ul>
<li><a href="WritingAnLLVMPass.html">Writing an LLVM Pass</a> - Information
on how to write LLVM transformations and analyses.</li>
<li><a href="CodeGenerator.html">The LLVM Target-Independent Code
Generator</a> - The design and implementation of the LLVM code generator.
Useful if you are working on retargetting LLVM to a new architecture, designing
a new codegen pass, or enhancing existing components.</li>
<li><a href="TableGenFundamentals.html">TableGen Fundamentals</a> -
Describes the TableGen tool, which is used heavily by the LLVM code
generator.</li>
<li><a href="AliasAnalysis.html">Alias Analysis in LLVM</a> - Information
on how to write a new alias analysis implementation or how to use existing
analyses.</li>
<li><a href="Stacker.html">The Stacker Cronicles</a> - This document
describes both the Stacker language and LLVM frontend, but also some details
about LLVM useful for those writing front-ends.</li>
<li><a href="GarbageCollection.html">Accurate Garbage Collection with
LLVM</a> - The interfaces source-language compilers should use for compiling
GC'd programs.</li>
<li><a href="SourceLevelDebugging.html">Source Level Debugging with
LLVM</a> - This document describes the design and philosophy behind the LLVM
source-level debugger.</li>
<li><a href="Bugpoint.html">Bugpoint</a> automatic bug finder and
test-case reducer description and usage information.</li>
</ul>
<!--=======================================================================-->
<div class="doc_section"><a name="maillist">LLVM Mailing Lists</a></div>
<!--=======================================================================-->
<ul>
<li>The <a href="http://mail.cs.uiuc.edu/mailman/listinfo/llvm-announce">
LLVM Announcements List</a>: This is a low volume list that provides important
announcements regarding LLVM. It gets email about once a month.</li>
<li>The <a href="http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev">Developer's
List</a>: This list is for people who want to be included in technical
discussions of LLVM. People post to this list when they have questions about
writing code for or using the LLVM tools. It is relatively low volume.</li>
<li>The <a href="http://mail.cs.uiuc.edu/pipermail/llvmbugs/">Bugs &amp;
Patches Archive</a>: This list gets emailed every time a bug is opened and
closed, and when people submit patches to be included in LLVM. It is higher
volume than the LLVMdev list.</li>
<li>The <a href="http://mail.cs.uiuc.edu/pipermail/llvm-commits/">CVS Commits
Archive</a>: This list contains all commit messages that are made when LLVM
developers commit code changes to the CVS archive. It is useful for those who
want to stay on the bleeding edge of LLVM development. This list is very high
volume.</li>
</ul>
<!-- *********************************************************************** -->
<hr>
<address>
<a href="http://jigsaw.w3.org/css-validator/check/referer"><img
src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a>
<a href="http://validator.w3.org/check/referer"><img
src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!"></a>
<a href="http://llvm.cs.uiuc.edu">LLVM Compiler Infrastructure</a><br>
Last modified: $Date$
</address>

View File

@@ -3,25 +3,58 @@
*/
/* Common styles */
.body { text: black; background: white; margin: 0 0 0 0 }
.body { color: black; background: white; margin: 0 0 0 0 }
/* No borders on image links */
a:link img, a:visited img {border-style: none}
address img { float: right; width: 88px; height: 31px; }
address { clear: right; }
/*
* Documentation
*/
/* Common for title and header */
.doc_title, .doc_section, .doc_subsection {
color: #eeeeff; background: #330077;
color: black; background: url("img/lines.gif");
font-family: "Georgia,Palatino,Times,Roman"; font-weight: bold;
padding-left: 8pt
border-width: 1px;
border-style: solid none solid none;
text-align: center;
vertical-align: middle;
padding-left: 8pt;
padding-top: 1px;
padding-bottom: 2px
}
.doc_title { text-align: left; font-size: 25pt }
.doc_section { text-align: center; font-size: 22pt }
.doc_subsection { background: #441188; width: 50%;
text-align: left; font-size: 12pt; padding: 4 4 4 22 }
.doc_section { text-align: center; font-size: 22pt;
margin: 20pt 0pt 5pt 0pt; }
.doc_subsection { width: 75%;
text-align: left; font-size: 12pt; padding: 4pt 4pt 4pt 4pt;
margin: 1.5em 0.5em 0.5em 0.5em }
.doc_subsubsection { margin: 2.0em 0.5em 0.5em 0.5em;
font-weight: bold; font-style: oblique;
border-bottom: 1px solid #999999; font-size: 12pt;
width: 75%; }
.doc_author { text-align: left; font-weight: bold; padding-left: 20pt }
.doc_text { text-align: left; padding-left: 20pt }
/* Publications */
.pub_title { font-family: "Georgia,Palatino,Times,Roman"; font-size: 24pt;
text-align: center }
.pub_author { font-size: 14pt; text-align: center }
.doc_footer { text-align: left; padding: 0 0 0 0 }
.doc_red { color: red }
.doc_table { text-align: center; width: 90%;
padding: 1px 1px 1px 1px; border: 1px; }
.doc_table_nw { text-align: center; border: 1px;
padding: 1px 1px 1px 1px; }
.doc_warning { color: red; font-weight: bold }
.doc_code { border: solid 1px gray; background: #eeeeee;
margin: 0 1em 0 1em;
padding: 0 1em 0 1em;
display:table;
}

View File

@@ -23,10 +23,11 @@
* 2) If alloca.h cannot be found, then try stdlib.h. Some platforms
* (notably FreeBSD) defined alloca() there.
*/
#ifndef __GNUC__
# ifdef HAVE_ALLOCA_H
# include <alloca.h>
# else
#ifdef _MSC_VER
/* noop on Visual C++ */
#elif defined(HAVE_ALLOCA_H)
#include <alloca.h>
#elif !defined(__GNUC__)
# ifdef _AIX
# pragma alloca
# else
@@ -34,17 +35,12 @@
char * alloca ();
# endif
# endif
# endif
#else
# ifdef HAVE_ALLOCA_H
# include <alloca.h>
# else
# ifdef HAVE_STDLIB_H
# include <stdlib.h>
# else
# error "The function alloca() is required but not found!"
# endif
# endif
#endif
#endif

View File

@@ -8,12 +8,6 @@
/* Define to 1 if using `alloca.c'. */
#undef C_ALLOCA
/* Define if the machine is Big-Endian */
#undef ENDIAN_BIG
/* Define if the machine is Little-Endian */
#undef ENDIAN_LITTLE
/* Define to 1 if you have `alloca', as a function or macro. */
#undef HAVE_ALLOCA
@@ -21,11 +15,8 @@
*/
#undef HAVE_ALLOCA_H
/* Define to 1 if you have the <assert.h> header file. */
#undef HAVE_ASSERT_H
/* define if the compiler has bidirectional iterator */
#undef HAVE_BI_ITERATOR
/* Define to 1 if you have the `backtrace' function. */
#undef HAVE_BACKTRACE
/* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
@@ -33,17 +24,15 @@
/* Define if dlopen() is available on this platform. */
#undef HAVE_DLOPEN
/* Define to 1 if you have the <errno.h> header file. */
#undef HAVE_ERRNO_H
/* define if the compiler has ext/slist */
#undef HAVE_EXT_SLIST
/* Define to 1 if you have the <execinfo.h> header file. */
#undef HAVE_EXECINFO_H
/* Define to 1 if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
/* define if the compiler has STL iterators */
#undef HAVE_FWD_ITERATOR
/* Define to 1 if your compiler defines finite in the <ieeefp.h> header file.
*/
#undef HAVE_FINITE_IN_IEEEFP_H
/* Define to 1 if you have the `getcwd' function. */
#undef HAVE_GETCWD
@@ -51,21 +40,33 @@
/* Define to 1 if you have the `getpagesize' function. */
#undef HAVE_GETPAGESIZE
/* Define to 1 if you have the `getrusage' function. */
#undef HAVE_GETRUSAGE
/* Define to 1 if you have the `gettimeofday' function. */
#undef HAVE_GETTIMEOFDAY
/* define if the compiler has ext/hash_map */
#undef HAVE_GNU_EXT_HASH_MAP
/* define if the compiler has ext/hash_set in __gnu_cc */
#undef HAVE_GNU_EXT_HASH_SET
/* Define to 1 if the system has the type `int64_t'. */
#undef HAVE_INT64_T
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define to 1 if you have the `isatty' function. */
#undef HAVE_ISATTY
/* Define to 1 if your compiler defines isinf in the <cmath> header file. */
#undef HAVE_ISINF_IN_CMATH
/* Define to 1 if your compiler defines isinf in the <math.h> header file. */
#undef HAVE_ISINF_IN_MATH_H
/* Define to 1 if your compiler defines isnan in the <cmath> header file. */
#undef HAVE_ISNAN_IN_CMATH
/* Define to 1 if your compiler defines isnan in the <math.h> header file. */
#undef HAVE_ISNAN_IN_MATH_H
/* Define to 1 if you have the `elf' library (-lelf). */
#undef HAVE_LIBELF
@@ -75,18 +76,22 @@
/* Define to 1 if you have the <link.h> header file. */
#undef HAVE_LINK_H
/* Define if you can use -Wl,-R. to pass -R. to the linker, in order to add
the current directory to the dynamic linker search path. */
#undef HAVE_LINK_R
/* Define if mallinfo() is available on this platform. */
#undef HAVE_MALLINFO
/* Define to 1 if you have the <malloc.h> header file. */
#undef HAVE_MALLOC_H
/* Define to 1 if you have the <math.h> header file. */
#undef HAVE_MATH_H
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define to 1 if you have the `mkstemp' function. */
#undef HAVE_MKSTEMP
/* Define to 1 if you have a working `mmap' system call. */
#undef HAVE_MMAP
@@ -100,8 +105,8 @@
/* define if the compiler implements namespaces */
#undef HAVE_NAMESPACES
/* Define to 1 if you have the <signal.h> header file. */
#undef HAVE_SIGNAL_H
/* Define to have the %a format string */
#undef HAVE_PRINTF_A
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
@@ -109,42 +114,23 @@
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
/* define if the compiler has ext/hash_map */
#undef HAVE_STD_EXT_HASH_MAP
/* Define to 1 if your compiler defines std::isinf in the <cmath> header file.
*/
#undef HAVE_STD_ISINF_IN_CMATH
/* define if the compiler has ext/hash_set in std */
#undef HAVE_STD_EXT_HASH_SET
/* define if the compiler has STL iterators */
#undef HAVE_STD_ITERATOR
/* Define to 1 if you have the `strcspn' function. */
#undef HAVE_STRCSPN
/* Define to 1 if your compiler defines std::isnan in the <cmath> header file.
*/
#undef HAVE_STD_ISNAN_IN_CMATH
/* Define to 1 if you have the `strdup' function. */
#undef HAVE_STRDUP
/* Define to 1 if you have the `strerror' function. */
#undef HAVE_STRERROR
/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define to 1 if you have the `strspn' function. */
#undef HAVE_STRSPN
/* Define to 1 if you have the `strstr' function. */
#undef HAVE_STRSTR
/* Define to 1 if you have the `strtod' function. */
#undef HAVE_STRTOD
/* Define to 1 if you have the `strtol' function. */
#undef HAVE_STRTOL
/* Define to 1 if you have the `strtoll' function. */
#undef HAVE_STRTOLL
@@ -175,6 +161,9 @@
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define to 1 if you have the <windows.h> header file. */
#undef HAVE_WINDOWS_H
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
@@ -193,6 +182,9 @@
/* Define as the return type of signal handlers (`int' or `void'). */
#undef RETSIGTYPE
/* Extension that shared libraries have, e.g., ".so". */
#undef SHLIBEXT
/* If using the C implementation of alloca, define if you know the
direction of stack growth for your system; otherwise it will be
automatically deduced at run-time.
@@ -214,18 +206,8 @@
`char[]'. */
#undef YYTEXT_POINTER
/* Define to empty if `const' does not conform to ANSI C. */
#undef const
/* Define as `__inline' if that's what the C compiler calls it, or to nothing
if it is not supported. */
#undef inline
/* Define to `int' if <sys/types.h> does not define. */
#undef pid_t
/* Define to `unsigned' if <sys/types.h> does not define. */
#undef size_t
/* Define to have the %a format string in printf() */
#undef HAVE_PRINTF_A

View File

@@ -16,17 +16,8 @@
#include "Config/config.h"
/*
* According to the man pages on dlopen(), we sometimes need link.h. So,
* go grab it just in case.
*/
#ifdef HAVE_DLFCN_H
#include <dlfcn.h>
#ifdef HAVE_LINK_H
#include <link.h>
#endif
#endif
#endif

View File

@@ -1,23 +0,0 @@
/*
* The LLVM Compiler Infrastructure
*
* This file was developed by the LLVM research group and is distributed under
* the University of Illinois Open Source License. See LICENSE.TXT for details.
*
******************************************************************************
*
* Description:
* This header file is the autoconf replacement for link.h (if it lives
* on the system).
*/
#ifndef _CONFIG_LINK_H
#define _CONFIG_LINK_H
#include "Config/config.h"
#ifdef HAVE_LINK_H
#include <link.h>
#endif
#endif

View File

@@ -0,0 +1,49 @@
/*
* The LLVM Compiler Infrastructure
*
* This file was developed by the LLVM research group and is distributed under
* the University of Illinois Open Source License. See LICENSE.TXT for details.
*
******************************************************************************
*
* This header file provides a platform-independent way of quering page size.
*/
#ifndef PAGESIZE_H
#define PAGESIZE_H
#include "Config/unistd.h"
#include <sys/param.h>
namespace llvm {
/* Compatibility chart:
*
* Linux/x86: _SC_PAGESIZE, _SC_PAGE_SIZE
* MacOS X/PowerPC: v. 10.2: NBPG,
* v. 10.3: _SC_PAGESIZE
* Solaris/Sparc: _SC_PAGESIZE, _SC_PAGE_SIZE
*/
/**
* GetPageSize - wrapper to return page size in bytes for various
* architecture/OS combinations
*/
unsigned GetPageSize() {
#ifdef _SC_PAGESIZE
return sysconf(_SC_PAGESIZE);
#elif defined(_SC_PAGE_SIZE)
return sysconf(_SC_PAGE_SIZE);
#elif defined(NBPG)
#ifndef CLSIZE
#define CLSIZE 1
#endif
return NBPG * CLSIZE;
#else
return 4096; /* allocate 4KB as a fall-back */
#endif
}
}
#endif

View File

@@ -1,23 +0,0 @@
/*
* The LLVM Compiler Infrastructure
*
* This file was developed by the LLVM research group and is distributed under
* the University of Illinois Open Source License. See LICENSE.TXT for details.
*
*===----------------------------------------------------------------------===//
*
* Description:
* This header file is the autoconf replacement for stdlib.h (if it lives
* on the system).
*/
#ifndef _CONFIG_STDLIB_H
#define _CONFIG_STDLIB_H
#include "Config/config.h"
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#endif

View File

@@ -1,23 +0,0 @@
/*
* The LLVM Compiler Infrastructure
*
* This file was developed by the LLVM research group and is distributed under
* the University of Illinois Open Source License. See LICENSE.TXT for details.
*
*===----------------------------------------------------------------------===//
*
* Description:
* This header file is the autoconf replacement for string.h (if it lives
* on the system).
*/
#ifndef _CONFIG_STRING_H
#define _CONFIG_STRING_H
#include "Config/config.h"
#ifdef HAVE_STRING_H
#include <string.h>
#endif
#endif

View File

@@ -20,7 +20,7 @@
#include "Config/config.h"
#ifdef HAVE_SYS_MMAN_H
#if defined(HAVE_SYS_MMAN_H) && !defined(_MSC_VER)
#include <sys/mman.h>
#endif

View File

@@ -1,4 +1,4 @@
/*===-- Config/sys/resource.h - Annotation classes --------------*- C++ -*-===//
/*===-- Config/sys/resource.h -----------------------------------*- C++ -*-===//
*
* The LLVM Compiler Infrastructure
*
@@ -18,22 +18,16 @@
#include "Config/config.h"
#ifdef HAVE_SYS_RESOURCE_H
#if defined(HAVE_SYS_RESOURCE_H) && !defined(_MSC_VER)
/*
* In LLVM, we use sys/resource.h to use getrusage() and maybe some other
* stuff. Some man pages say that you also need sys/time.h and unistd.h.
* So, to be paranoid, we will try to include all three if possible.
*/
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
#include "Config/sys/time.h"
#include <sys/resource.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include "Config/unistd.h"
#endif

View File

@@ -1,4 +1,4 @@
/*===-- Config/sys/stat.h - Annotation classes --------------*- ----C++ -*-===//
/*===-- Config/sys/stat.h -----------------------------------*- ----C++ -*-===//
*
* The LLVM Compiler Infrastructure
*
@@ -21,5 +21,9 @@
#include <sys/stat.h>
#endif
#if defined(_MSC_VER)
#define S_ISREG(X) ((X) & _S_IFREG)
#endif
#endif

View File

@@ -1,4 +1,4 @@
/*===-- Config/sys/time.h - Annotation classes ------------------*- C++ -*-===//
/*===-- Config/sys/time.h ---------------------------------------*- C++ -*-===//
*
* The LLVM Compiler Infrastructure
*
@@ -17,7 +17,7 @@
#include "Config/config.h"
#ifdef HAVE_SYS_TIME_H
#if defined(HAVE_SYS_TIME_H) && !defined(_MSC_VER)
#include <sys/time.h>
#endif

View File

@@ -1,4 +1,4 @@
/*===-- Config/sys/types.h - Annotation classes --------------*- C++ -*-===//
/*===-- Config/sys/types.h --------------------------------------*- C++ -*-===//
*
* The LLVM Compiler Infrastructure
*

View File

@@ -1,4 +1,4 @@
/*===-- Config/sys/wait.h - Annotation classes ------------------*- C++ -*-===//
/*===-- Config/sys/wait.h ---------------------------------------*- C++ -*-===//
*
* The LLVM Compiler Infrastructure
*

Some files were not shown because too many files have changed in this diff Show More