Compare commits

...

1706 Commits

Author SHA1 Message Date
John Criswell
303b238cc3 Updated code and source sizes.
Fixed some minor typos.

llvm-svn: 12513
2004-03-19 21:59:23 +00:00
John Criswell
c1d8934838 Not ready for prime time.
llvm-svn: 12512
2004-03-19 20:57:39 +00:00
John Criswell
3c96135937 Updated to latest revision in the trunk.
Fixed some typos.

llvm-svn: 12511
2004-03-19 20:08:17 +00:00
John Criswell
3c0d59f546 Added a remark about setting LLVM_LIB_SEARCH_PATH. I forgot to do this on
PowerPC, and it made the test results scary.

llvm-svn: 12509
2004-03-19 17:00:35 +00:00
John Criswell
510529f5e1 Merged in Chris's fix from trunk (revision 1.138).
llvm-svn: 12508
2004-03-19 15:11:25 +00:00
John Criswell
df834c2b61 Removed PowerPC directory.
llvm-svn: 12503
2004-03-18 17:47:49 +00:00
John Criswell
d0118041ec Removing the PowerPC code generator from the LLVM 1.2 Release Tree.
This is good because it will make LLVM more "polished," but bad because
there might be a joe out there who could take this and flesh it out into
a real code generator.

llvm-svn: 12502
2004-03-18 17:47:08 +00:00
John Criswell
87340561e3 Removed PowerPC code generation options from llc. The PowerPC code
generator isn't even at an experimental stage (if I understand the comments
correctly).

llvm-svn: 12501
2004-03-18 17:32:36 +00:00
John Criswell
d118722f63 Gave Darwin its own expectations file.
llvm-svn: 12499
2004-03-18 16:41:59 +00:00
John Criswell
052debc4d8 Updated code from trunk.
llvm-svn: 12498
2004-03-18 16:41:44 +00:00
John Criswell
9f115d2063 cvs slurp revision 1.14 from mainline.
llvm-svn: 12497
2004-03-18 15:04:57 +00:00
John Criswell
e2fb1d0251 Defined the NO_DUMMY_DECL variable. This removes the zlib hack that
for "bad compilers" that generates a type conflict resolution error when
linking zlib with gccld.

llvm-svn: 12478
2004-03-17 23:12:00 +00:00
John Criswell
3c5f2201c9 Slurping up Revision 1.25 of this document, which is described as:
"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: 12476
2004-03-17 21:22:18 +00:00
John Criswell
3f024e982f Removed the -dsa-track-integers option.
llvm-svn: 12475
2004-03-17 21:20:14 +00:00
John Criswell
51a4de5f2e Updated options for release 1.2.
llvm-svn: 12473
2004-03-17 20:58:09 +00:00
John Criswell
6babfa929c Added information about how to get QMTest 2.0.3.
llvm-svn: 12472
2004-03-17 20:07:32 +00:00
CVS to SVN Conversion
bb8b55b1e4 This commit was manufactured by cvs2svn to create branch 'release_12'.
llvm-svn: 12471
2004-03-17 17:42:09 +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
1049 changed files with 146631 additions and 26944 deletions

View File

@@ -56,7 +56,7 @@ D: The `paths' pass
N: Reid Spencer N: Reid Spencer
E: rspencer@x10sys.com E: rspencer@x10sys.com
W: http://extprosys.sourceforge.net/ W: http://extprosys.sourceforge.net/
D: Complete 'llvm' namespacification, bug fixes and improvements D: Complete 'llvm' namespacification, Stacker, bug fixes, and improvements
N: Bill Wendling N: Bill Wendling
E: wendling@isanbard.org E: wendling@isanbard.org

View File

@@ -4,8 +4,8 @@ LLVM Release License
University of Illinois/NCSA University of Illinois/NCSA
Open Source License Open Source License
Copyright (c) 2003, University of Illinois at Urbana-Champaign. All rights Copyright (c) 2003, 2004 University of Illinois at Urbana-Champaign.
reserved. All rights reserved.
Developed by: Developed by:
@@ -49,3 +49,48 @@ 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. 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 This file will describe the copyrights, license, and restrictions which apply
to that code. 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
------- ---------
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
D: llvm/test/Programs/MultiSource/Applications/d
Lambda: llvm/test/Programs/MultiSource/Applications/lambda-0.1.3
hbd: llvm/test/Programs/MultiSource/Applications/hbd
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

@@ -7,9 +7,13 @@
# #
##===----------------------------------------------------------------------===## ##===----------------------------------------------------------------------===##
LEVEL = . LEVEL = .
DIRS = lib/Support utils lib tools runtime DIRS = lib/Support utils lib tools
OPTIONAL_DIRS = projects OPTIONAL_DIRS = projects
ifneq ($(MAKECMDGOALS),tools-only)
DIRS += runtime
endif
include $(LEVEL)/Makefile.common include $(LEVEL)/Makefile.common
test :: all test :: all
@@ -22,25 +26,27 @@ distclean:: clean
$(LEVEL)/config.log \ $(LEVEL)/config.log \
$(LEVEL)/TAGS $(LEVEL)/TAGS
tools-only: tools-only: all
@for dir in lib/Support utils lib tools; do $(MAKE) -C $$dir; done
AUTOCONF = autoconf
AUTOHEADER = autoheader
configure: autoconf/configure.ac autoconf/aclocal.m4
cd autoconf && $(AUTOCONF) -o ../configure configure.ac
include/Config/config.h.in: autoconf/configure.ac autoconf/aclocal.m4
$(AUTOHEADER) -I autoconf autoconf/configure.ac
# Install support for llvm include files.
# Install support for llvm include files:
.PHONY: install-includes .PHONY: install-includes
install-includes: install-includes:
$(MKDIR) $(includedir)/llvm $(MKDIR) $(DESTDIR)$(includedir)/llvm
cd include && find * '!' '(' -name '*~' -o -name .cvsignore ')' -print | grep -v CVS | pax -rwdvpe $(includedir)/llvm cd include && find * '!' '(' -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 * '!' '(' -name '*~' -o -name .cvsignore ')' -print | grep -v CVS | pax -rwdvpe $(DESTDIR)$(includedir)/llvm
endif
install:: install-includes install:: install-includes
# Build tags database for Emacs/Xemacs:
.PHONY: tags
TAGS: tags
all:: tags
tags:
$(ETAGS) $(ETAGSFLAGS) `find $(wildcard $(SourceDir)/include $(SourceDir)/lib $(SourceDir)/tools) -name '*.cpp' -o -name '*.h'`

View File

@@ -2,102 +2,78 @@
# #
# This file is included by Makefile.common. It defines paths and other # This file is included by Makefile.common. It defines paths and other
# values specific to a particular installation of LLVM. # values specific to a particular installation of LLVM.
#
#===-----------------------------------------------------------------------==== #===-----------------------------------------------------------------------====
#
# Target operating system for which LLVM will be compiled. # Target operating system for which LLVM will be compiled.
#
OS=@OS@ OS=@OS@
#
# Target hardware architecture # Target hardware architecture
#
ARCH=@ARCH@ ARCH=@ARCH@
# Endian-ness of the target
ENDIAN=@ENDIAN@
# Path to the C++ compiler to use. This is an optional setting, which defaults # Path to the C++ compiler to use. This is an optional setting, which defaults
# to whatever your gmake defaults to. # to whatever your gmake defaults to.
# #
# Under Linux, for some reason the compiler driver wants to search the PATH 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. # find the system assembler, which breaks if the LLVM assembler is in our path.
# Hack it to use the assembler in /usr/bin directly. # Hack it to use the assembler in /usr/bin directly.
#
CXX = @CXX@ CXX = @CXX@
# We have the same problem with the CC binary, which use used by testcases for # We have the same problem with the CC binary, which use used by testcases for
# native builds. # native builds.
#
CC := @CC@ CC := @CC@
# # Linker flags.
# Compilation flags for the C and C++ compilers.
#
#
# 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@
LDFLAGS+=@LDFLAGS@ LDFLAGS+=@LDFLAGS@
#
# Removed since it prevents the tests from working properly.
#
#LIBS+=@LIBS@
#
# Libraries needed by tools # Libraries needed by tools
#
TOOLLINKOPTS=@LIBS@ TOOLLINKOPTS=@LIBS@
# # Path to the library archiver program.
# Path to the archiver program.
#
AR_PATH = @AR@ AR_PATH = @AR@
#
# The pathnames of the Flex and Bison programs, respectively. # The pathnames of the Flex and Bison programs, respectively.
# YACC = @YACC@
BISON = @YACC@ BISON = @BISON@
FLEX = @LEX@ FLEX = @LEX@
#
# Paths to miscellaneous programs. # Paths to miscellaneous programs.
# RPWD = pwd
RPWD = @RPWD@ SED = sed
SED = @SED@ RM = rm
RM = @RM@ ECHO = echo
ECHO = @ECHO@
MKDIR = @abs_top_srcdir@/autoconf/mkinstalldirs MKDIR = @abs_top_srcdir@/autoconf/mkinstalldirs
DATE = @DATE@ DATE = date
MV = @MV@ MV = mv
INSTALL = @INSTALL@ INSTALL = @INSTALL@
DOT = @DOT@ DOT = @DOT@
ETAGS = @ETAGS@ ETAGS = @ETAGS@
ETAGSFLAGS = @ETAGSFLAGS@
#
# Determine the target for which LLVM should generate code. # Determine the target for which LLVM should generate code.
#
LLVMGCCARCH := @target@/3.4-llvm 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. # 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 # Set OBJ_ROOT to "." if you do not want to use a separate place for
# object files. # object files.
#
#OBJ_ROOT = .
OBJ_ROOT := . OBJ_ROOT := .
# Path to location for LLVM front-end this should only be specified here if you # Path to location for LLVM C/C++ front-end. You can modify this if you
# want to override the value set in Makefile.$(uname) # want to override the value set by configure.
#
LLVMGCCDIR := @LLVMGCCDIR@ 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 # 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 # 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 # space is limited or when you just don't want to spend time running the C
# frontend. # frontend.
#
#USE_PRECOMPILED_BYTECODE := 1 #USE_PRECOMPILED_BYTECODE := 1
@UPB@ @UPB@
@@ -105,71 +81,51 @@ LLVMGCCDIR := @LLVMGCCDIR@
# versions of the test/Programs/* programs. This is used as the bytecode source # 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 # when USE_PRECOMPILED_BYTECODE is specified or when source code is not
# available for the program (such as SPEC). # available for the program (such as SPEC).
#
BYTECODE_REPOSITORY := @BCR@ BYTECODE_REPOSITORY := @BCR@
# Path to location for purify, this is only needed if you build with
# ENABLE_PURIFY=1
#
PURIFY = @PURIFY@
#
# SPEC benchmarks: # 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. # You must provide the SPEC benchmarks on your own.
# @USE_SPEC2000@
@USE_SPEC@ @USE_SPEC95@
# # Path to the SPEC benchmarks.
# Path to the SPEC benchmarks. If you have the SPEC benchmarks, place the SPEC2000_ROOT := @SPEC2000_ROOT@
# path here. SPEC95_ROOT := @SPEC95_ROOT@
#
#SPEC_ROOT := /home/vadve/shared/benchmarks/speccpu2000/benchspec # Path to the Povray source code.
SPEC_ROOT := @SPEC_ROOT@ @USE_POVRAY@
POVRAY_ROOT := @POVRAY_ROOT@
#
# Path to the PAPI code. This is used by the reoptimizer only. # Path to the PAPI code. This is used by the reoptimizer only.
#
#PAPIDIR := /home/vadve/shared/papi-2.3.4.1 #PAPIDIR := /home/vadve/shared/papi-2.3.4.1
PAPIDIR := @PAPIDIR@ PAPIDIR := @PAPIDIR@
# These are options that can either be enabled here, or can be enabled on the # 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 # When ENABLE_OPTIMIZED is enabled, Release builds of all of the LLVM code are
# turned on, and Debug builds are turned off. # turned on, and Debug builds are turned off.
#
#ENABLE_OPTIMIZED = 1 #ENABLE_OPTIMIZED = 1
@ENABLE_OPTIMIZED@ @ENABLE_OPTIMIZED@
# When ENABLE_PROFILING is enabled, the llvm source base is built with profile # When ENABLE_PROFILING is enabled, the llvm source base is built with profile
# information to allow gprof to be used to get execution frequencies. # information to allow gprof to be used to get execution frequencies.
#
#ENABLE_PROFILING = 1 #ENABLE_PROFILING = 1
#
# This option tells the Makefiles to produce verbose output. # This option tells the Makefiles to produce verbose output.
# It essentially prints the commands that make is executing # It essentially prints the commands that make is executing
#
#VERBOSE = 1 #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 # Enable JIT for this platform
#
@JIT@ @JIT@
#
# Disable LLC diffs for testing. # Disable LLC diffs for testing.
#
@DISABLE_LLC_DIFFS@ @DISABLE_LLC_DIFFS@
# Shared library extension for this platform.
SHLIBEXT = @SHLIBEXT@
########################################################################### ###########################################################################
# Directory Configuration # Directory Configuration
# This section of the Makefile determines what is where. To be # This section of the Makefile determines what is where. To be
@@ -186,37 +142,27 @@ PAPIDIR := @PAPIDIR@
# #
########################################################################### ###########################################################################
#
# Set the object build directory. By default, it is the current directory. # Set the object build directory. By default, it is the current directory.
#
ifndef BUILD_OBJ_DIR ifndef BUILD_OBJ_DIR
BUILD_OBJ_DIR := $(subst //,/,$(shell $(RPWD))) BUILD_OBJ_DIR := $(subst //,/,$(shell $(RPWD)))
endif endif
#
# Set the root of the object directory. # Set the root of the object directory.
#
ifndef BUILD_OBJ_ROOT ifndef BUILD_OBJ_ROOT
BUILD_OBJ_ROOT := $(subst //,/,$(shell cd $(BUILD_OBJ_DIR)/$(LEVEL); $(RPWD))) BUILD_OBJ_ROOT := $(subst //,/,$(shell cd $(BUILD_OBJ_DIR)/$(LEVEL); $(RPWD)))
endif endif
#
# Set the source build directory. That is almost always the current directory. # Set the source build directory. That is almost always the current directory.
#
ifndef BUILD_SRC_DIR ifndef BUILD_SRC_DIR
BUILD_SRC_DIR := $(subst //,/,@abs_top_srcdir@/$(patsubst $(BUILD_OBJ_ROOT)%,%,$(BUILD_OBJ_DIR))) BUILD_SRC_DIR := $(subst //,/,@abs_top_srcdir@/$(patsubst $(BUILD_OBJ_ROOT)%,%,$(BUILD_OBJ_DIR)))
endif endif
#
# Set the source root directory. # Set the source root directory.
#
ifndef BUILD_SRC_ROOT ifndef BUILD_SRC_ROOT
BUILD_SRC_ROOT := $(subst //,/,@abs_top_srcdir@) BUILD_SRC_ROOT := $(subst //,/,@abs_top_srcdir@)
endif endif
#
# Set the LLVM object directory. # Set the LLVM object directory.
#
ifndef LLVM_OBJ_ROOT ifndef LLVM_OBJ_ROOT
ifdef LLVM_SRC_ROOT ifdef LLVM_SRC_ROOT
LLVM_OBJ_ROOT := $(shell cd $(LLVM_SRC_ROOT); $(RPWD)) LLVM_OBJ_ROOT := $(shell cd $(LLVM_SRC_ROOT); $(RPWD))
@@ -225,23 +171,18 @@ LLVM_OBJ_ROOT := $(BUILD_OBJ_ROOT)
endif endif
endif endif
#
# Set the LLVM source directory. # Set the LLVM source directory.
# It is typically the root directory of what we're compiling now. # It is typically the root directory of what we're compiling now.
#
ifndef LLVM_SRC_ROOT ifndef LLVM_SRC_ROOT
LLVM_SRC_ROOT := $(BUILD_SRC_ROOT) LLVM_SRC_ROOT := $(BUILD_SRC_ROOT)
endif endif
#
# Set SourceDir for backwards compatbility. # Set SourceDir for backwards compatbility.
#
ifndef SourceDir ifndef SourceDir
SourceDir=$(BUILD_SRC_DIR) SourceDir=$(BUILD_SRC_DIR)
endif endif
# Installation directories, as provided by the configure script. # Installation directories, as provided by the configure script.
exec_prefix = @exec_prefix@ exec_prefix = @exec_prefix@
prefix = @prefix@ prefix = @prefix@
program_transform_name = @program_transform_name@ program_transform_name = @program_transform_name@
@@ -253,6 +194,7 @@ sysconfdir = @sysconfdir@
sharedstatedir = @sharedstatedir@ sharedstatedir = @sharedstatedir@
localstatedir = @localstatedir@ localstatedir = @localstatedir@
libdir = @libdir@ libdir = @libdir@
bytecode_libdir = $(LLVMGCCDIR)/bytecode-libs
includedir = @includedir@ includedir = @includedir@
infodir = @infodir@ infodir = @infodir@
mandir = @mandir@ mandir = @mandir@

View File

@@ -71,12 +71,14 @@ all::$(LLVM_OBJ_ROOT)/config.status
ifdef SHARED_LIBRARY ifdef SHARED_LIBRARY
# if SHARED_LIBRARY is specified, the default is to build the dynamic lib # if SHARED_LIBRARY is specified, the default is to build the dynamic lib
all:: dynamic all:: dynamic
install:: install-dynamic-library
endif endif
ifdef BYTECODE_LIBRARY ifdef BYTECODE_LIBRARY
# if BYTECODE_LIBRARY is specified, the default is to build the bytecode lib # if BYTECODE_LIBRARY is specified, the default is to build the bytecode lib
all:: bytecodelib all:: bytecodelib
install:: bytecodelib-install install:: install-bytecode-library
install-bytecode:: install-bytecode-library
endif endif
# Default Rule: Make sure it's also a :: rule # Default Rule: Make sure it's also a :: rule
@@ -91,6 +93,9 @@ test::
# Default rule for building only bytecode. # Default rule for building only bytecode.
bytecode:: bytecode::
# Default rule for installing only bytecode.
install-bytecode::
# Print out the directories used for building # Print out the directories used for building
prdirs:: prdirs::
@${ECHO} "Build Source Root: " $(BUILD_SRC_ROOT) @${ECHO} "Build Source Root: " $(BUILD_SRC_ROOT)
@@ -108,7 +113,7 @@ prdirs::
########################################################################### ###########################################################################
.SUFFIXES: .SUFFIXES:
.SUFFIXES: .c .cpp .h .hpp .y .l .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 .SUFFIXES: .ps .dot .d
# #
@@ -116,7 +121,7 @@ prdirs::
# slightly since GNU Make will not try to find implicit rules for targets # slightly since GNU Make will not try to find implicit rules for targets
# which are marked as Phony. # 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 .PHONY: clean distclean install test bytecode prdirs
########################################################################### ###########################################################################
@@ -248,9 +253,7 @@ LGCCLDPROG := $(LLVMTOOLCURRENT)/gccld
# The LLVM GCC front-end in C and C++ flavors # The LLVM GCC front-end in C and C++ flavors
# #
LLVMGCC := PATH=$(LLVMTOOLCURRENT):$(PATH) $(LLVMGCCDIR)/bin/gcc LLVMGCC := PATH=$(LLVMTOOLCURRENT):$(PATH) $(LLVMGCCDIR)/bin/gcc
LCC1 := $(LLVMGCCDIR)/libexec/gcc/$(LLVMGCCARCH)/cc1
LLVMGXX := PATH=$(LLVMTOOLCURRENT):$(PATH) $(LLVMGCCDIR)/bin/g++ 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 # Some of the compiled LLVM tools which are used for compilation of runtime
@@ -290,6 +293,9 @@ CPPFLAGS += -D_GNU_SOURCE
# Pull in limit macros from stdint.h, even in C++: # Pull in limit macros from stdint.h, even in C++:
CPPFLAGS += -D__STDC_LIMIT_MACROS CPPFLAGS += -D__STDC_LIMIT_MACROS
### FIXME: this is GCC specific
CPPFLAGS += -DDEPRECATED='__attribute__ ((deprecated))'
CompileCommonOpts := -Wall -W -Wwrite-strings -Wno-unused CompileCommonOpts := -Wall -W -Wwrite-strings -Wno-unused
CompileOptimizeOpts := -O3 -DNDEBUG -finline-functions CompileOptimizeOpts := -O3 -DNDEBUG -finline-functions
@@ -353,7 +359,7 @@ Depend := $(CXX) -MM -I$(LEVEL)/include $(CPPFLAGS)
DependC := $(CC) -MM -I$(LEVEL)/include $(CPPFLAGS) DependC := $(CC) -MM -I$(LEVEL)/include $(CPPFLAGS)
# Archive a bunch of .o files into a .a file... # Archive a bunch of .o files into a .a file...
AR = ${AR_PATH} cq AR = $(AR_PATH) cr
#---------------------------------------------------------- #----------------------------------------------------------
@@ -363,7 +369,8 @@ AR = ${AR_PATH} cq
# #
ifndef Source ifndef Source
Source := $(notdir $(ExtraSource) $(wildcard $(SourceDir)/*.cpp \ Source := $(notdir $(ExtraSource) $(wildcard $(SourceDir)/*.cpp \
$(SourceDir)/*.c $(SourceDir)/*.y $(SourceDir)/*.l)) $(SourceDir)/*.cc $(SourceDir)/*.c $(SourceDir)/*.y \
$(SourceDir)/*.l))
endif endif
# #
@@ -388,7 +395,7 @@ RObjectsG := $(addprefix $(BUILD_OBJ_DIR)/Debug/,$(RObjs))
#--------------------------------------------------------- #---------------------------------------------------------
ifdef DIRS ifdef DIRS
all install clean test bytecode stripped-bytecode:: all install clean test bytecode stripped-bytecode install-bytecode::
$(VERB) for dir in ${DIRS}; do \ $(VERB) for dir in ${DIRS}; do \
if [ ! -f $$dir/Makefile ]; \ if [ ! -f $$dir/Makefile ]; \
then \ then \
@@ -407,8 +414,9 @@ clean :: $(addsuffix /.makeclean , $(PARALLEL_DIRS))
test :: $(addsuffix /.maketest , $(PARALLEL_DIRS)) test :: $(addsuffix /.maketest , $(PARALLEL_DIRS))
bytecode :: $(addsuffix /.makebytecode, $(PARALLEL_DIRS)) bytecode :: $(addsuffix /.makebytecode, $(PARALLEL_DIRS))
stripped-bytecode :: $(addsuffix /.makestripped-bytecode, $(PARALLEL_DIRS)) stripped-bytecode :: $(addsuffix /.makestripped-bytecode, $(PARALLEL_DIRS))
install-bytecode :: $(addsuffix /.makeinstall-bytecode, $(PARALLEL_DIRS))
%/.makeall %/.makeinstall %/.makeclean %/.maketest %/.makebytecode %/.makestripped-bytecode: %/.makeall %/.makeinstall %/.makeclean %/.maketest %/.makebytecode %/.makestripped-bytecode %/.makeinstall-bytecode:
$(VERB) if [ ! -f $(@D)/Makefile ]; \ $(VERB) if [ ! -f $(@D)/Makefile ]; \
then \ then \
$(MKDIR) $(@D); \ $(MKDIR) $(@D); \
@@ -419,7 +427,7 @@ endif
# Handle directories that may or may not exist # Handle directories that may or may not exist
ifdef OPTIONAL_DIRS ifdef OPTIONAL_DIRS
all install clean test bytecode stripped-bytecode:: all install clean test bytecode stripped-bytecode install-bytecode::
$(VERB) for dir in ${OPTIONAL_DIRS}; do \ $(VERB) for dir in ${OPTIONAL_DIRS}; do \
if [ -d $(SourceDir)/$$dir ]; \ if [ -d $(SourceDir)/$$dir ]; \
then\ then\
@@ -454,44 +462,55 @@ endif
# of it. For this reason, sometimes it's useful to use libraries as .a files. # 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 ifdef LIBRARYNAME
# Make sure there isn't any extranous whitespace on the LIBRARYNAME option # Make sure there isn't any extranous whitespace on the LIBRARYNAME option
LIBRARYNAME := $(strip $(LIBRARYNAME)) LIBRARYNAME := $(strip $(LIBRARYNAME))
LIBNAME_O := $(DESTLIBRELEASE)/lib$(LIBRARYNAME).so LIBNAME_O := $(DESTLIBRELEASE)/lib$(LIBRARYNAME)$(SHLIBEXT)
LIBNAME_P := $(DESTLIBPROFILE)/lib$(LIBRARYNAME).so LIBNAME_P := $(DESTLIBPROFILE)/lib$(LIBRARYNAME)$(SHLIBEXT)
LIBNAME_G := $(DESTLIBDEBUG)/lib$(LIBRARYNAME).so LIBNAME_G := $(DESTLIBDEBUG)/lib$(LIBRARYNAME)$(SHLIBEXT)
LIBNAME_CUR := $(DESTLIBCURRENT)/lib$(LIBRARYNAME)$(SHLIBEXT)
LIBNAME_AO := $(DESTLIBRELEASE)/lib$(LIBRARYNAME).a LIBNAME_AO := $(DESTLIBRELEASE)/lib$(LIBRARYNAME).a
LIBNAME_AP := $(DESTLIBPROFILE)/lib$(LIBRARYNAME).a LIBNAME_AP := $(DESTLIBPROFILE)/lib$(LIBRARYNAME).a
LIBNAME_AG := $(DESTLIBDEBUG)/lib$(LIBRARYNAME).a LIBNAME_AG := $(DESTLIBDEBUG)/lib$(LIBRARYNAME).a
LIBNAME_ACUR := $(DESTLIBCURRENT)/lib$(LIBRARYNAME).a
LIBNAME_OBJO := $(DESTLIBRELEASE)/$(LIBRARYNAME).o LIBNAME_OBJO := $(DESTLIBRELEASE)/$(LIBRARYNAME).o
LIBNAME_OBJP := $(DESTLIBPROFILE)/$(LIBRARYNAME).o LIBNAME_OBJP := $(DESTLIBPROFILE)/$(LIBRARYNAME).o
LIBNAME_OBJG := $(DESTLIBDEBUG)/$(LIBRARYNAME).o LIBNAME_OBJG := $(DESTLIBDEBUG)/$(LIBRARYNAME).o
LIBNAME_OBJCUR := $(DESTLIBCURRENT)/$(LIBRARYNAME).o
LIBNAME_BC := $(DESTLIBBYTECODE)/lib$(LIBRARYNAME).bc LIBNAME_BC := $(DESTLIBBYTECODE)/lib$(LIBRARYNAME).bc
#-------------------------------------------------------------------- #--------------------------------------------------------------------
# Library Targets # Library Targets
# Modify the top level targets to build the desired libraries. # Modify the top level targets to build the desired libraries.
#-------------------------------------------------------------------- #--------------------------------------------------------------------
# dynamic target builds a shared object version of the library... # dynamic target builds a shared object version of the library...
dynamic:: $(DESTLIBCURRENT)/lib$(LIBRARYNAME).so dynamic:: $(LIBNAME_CUR)
bytecodelib:: $(LIBNAME_BC) 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 ======= @${ECHO} ======= Installing $(LIBRARYNAME) bytecode library =======
cp $< $@ cp $< $@
# Does the library want a .o version built? # Does the library want a .o version built?
ifndef DONT_BUILD_RELINKED ifndef DONT_BUILD_RELINKED
all:: $(DESTLIBCURRENT)/$(LIBRARYNAME).o all:: $(LIBNAME_OBJCUR)
install:: install-single-object-library
endif endif
# Does the library want an archive version built? # Does the library want an archive version built?
ifdef BUILD_ARCHIVE ifdef BUILD_ARCHIVE
all:: $(DESTLIBCURRENT)/lib$(LIBRARYNAME).a all:: $(LIBNAME_ACUR)
install:: install-archive-library
endif endif
#-------------------------------------------------------------------- #--------------------------------------------------------------------
@@ -536,6 +555,10 @@ $(LIBNAME_G): $(ObjectsG) $(LibSubDirs) $(DESTLIBDEBUG)/.dir
$(VERB) $(LIBTOOL) --mode=install $(INSTALL) $*.la $(DESTLIBCURRENT) $(VERB) $(LIBTOOL) --mode=install $(INSTALL) $*.la $(DESTLIBCURRENT)
@${ECHO} ======= Finished building $(LIBRARYNAME) dynamic debug library ======= @${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. # Rules for building static archive libraries.
# #
@@ -557,6 +580,9 @@ $(LIBNAME_AG): $(ObjectsG) $(LibSubDirs) $(DESTLIBDEBUG)/.dir
$(VERB) $(Link) -g $(STRIP) -o $@ $(ObjectsG) $(LibSubDirs) -static $(VERB) $(Link) -g $(STRIP) -o $@ $(ObjectsG) $(LibSubDirs) -static
@${ECHO} ======= Finished building $(LIBRARYNAME) archive debug library ======= @${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. # Rules for building .o libraries.
@@ -584,23 +610,10 @@ $(LIBNAME_OBJG): $(ObjectsG) $(LibSubDirs) $(DESTLIBDEBUG)/.dir
@${ECHO} "Linking `basename $@`" @${ECHO} "Linking `basename $@`"
$(VERB) $(Relink) -o $@ $(RObjectsG) $(LibSubDirs) $(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 endif
#------------------------------------------------------------------------ #------------------------------------------------------------------------
@@ -681,8 +694,8 @@ $(TOOLEXENAME_P): $(ObjectsP) $(USED_LIB_PATHS_P) $(DESTTOOLPROFILE)/.dir
@${ECHO} ======= Finished building $(TOOLNAME) profile executable ======= @${ECHO} ======= Finished building $(TOOLNAME) profile executable =======
install:: $(TOOLEXENAMES) install:: $(TOOLEXENAMES)
$(MKDIR) $(bindir) $(MKDIR) $(DESTDIR)$(bindir)
$(LIBTOOL) --mode=install $(INSTALL_PROGRAM) -c -m 0755 $(TOOLEXENAMES) $(bindir)/$(TOOLNAME) $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) -c -m 0755 $(TOOLEXENAMES) $(DESTDIR)$(bindir)/$(TOOLNAME)
endif endif
@@ -796,7 +809,10 @@ clean::
$(VERB) $(RM) -rf $(BUILD_OBJ_DIR)/Debug $(BUILD_OBJ_DIR)/Release $(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)/Profile $(BUILD_OBJ_DIR)/Depend
$(VERB) $(RM) -rf $(BUILD_OBJ_DIR)/BytecodeObj $(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) $(VERB) $(RM) -f $(LEX_OUTPUT) $(YACC_OUTPUT)
########################################################################### ###########################################################################

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

View File

@@ -5888,10 +5888,8 @@ if test "$ac_cv_cxx_namespaces" = yes; then
fi fi
]) ])
#
# Check for hash_map extension. This is from # Check for hash_map extension. This is from
# http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_have_ext_hash_map.html # http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_have_ext_hash_map.html
#
AC_DEFUN([AC_CXX_HAVE_STD_EXT_HASH_MAP], AC_DEFUN([AC_CXX_HAVE_STD_EXT_HASH_MAP],
[AC_CACHE_CHECK([whether the compiler has <ext/hash_map> defining template class std::hash_map], [AC_CACHE_CHECK([whether the compiler has <ext/hash_map> defining template class std::hash_map],
ac_cv_cxx_have_std_ext_hash_map, ac_cv_cxx_have_std_ext_hash_map,
@@ -5904,9 +5902,12 @@ using namespace std;
#endif],[hash_map<int, int> t;], #endif],[hash_map<int, int> t;],
[ac_cv_cxx_have_std_ext_hash_map=yes], [ac_cv_cxx_have_std_ext_hash_map=no]) [ac_cv_cxx_have_std_ext_hash_map=yes], [ac_cv_cxx_have_std_ext_hash_map=no])
AC_LANG_RESTORE]) AC_LANG_RESTORE])
if test "$ac_cv_cxx_have_std_ext_hash_map" = yes; then HAVE_STD_EXT_HASH_MAP=0
AC_DEFINE(HAVE_STD_EXT_HASH_MAP,,[Define if the compiler has a header <ext/hash_map> that defines template class std::hash_map.]) if test "$ac_cv_cxx_have_std_ext_hash_map" = yes
fi]) then
HAVE_STD_EXT_HASH_MAP=1
fi
AC_SUBST(HAVE_STD_EXT_HASH_MAP)])
AC_DEFUN([AC_CXX_HAVE_GNU_EXT_HASH_MAP], AC_DEFUN([AC_CXX_HAVE_GNU_EXT_HASH_MAP],
[AC_CACHE_CHECK([whether the compiler has <ext/hash_map> defining template class __gnu_cxx::hash_map], [AC_CACHE_CHECK([whether the compiler has <ext/hash_map> defining template class __gnu_cxx::hash_map],
@@ -5920,9 +5921,12 @@ using namespace __gnu_cxx;
#endif],[hash_map<int,int> t; ], #endif],[hash_map<int,int> t; ],
[ac_cv_cxx_have_gnu_ext_hash_map=yes],[ac_cv_cxx_have_gnu_ext_hash_map=no]) [ac_cv_cxx_have_gnu_ext_hash_map=yes],[ac_cv_cxx_have_gnu_ext_hash_map=no])
AC_LANG_RESTORE]) AC_LANG_RESTORE])
if test "$ac_cv_cxx_have_gnu_ext_hash_map" = yes; then HAVE_GNU_EXT_HASH_MAP=0
AC_DEFINE(HAVE_GNU_EXT_HASH_MAP,,[Define if the compiler has a header <ext/hash_map> that defines template class __gnu_cxx::hash_map.]) if test "$ac_cv_cxx_have_gnu_ext_hash_map" = yes
fi]) then
HAVE_GNU_EXT_HASH_MAP=1
fi
AC_SUBST(HAVE_GNU_EXT_HASH_MAP)])
AC_DEFUN([AC_CXX_HAVE_GLOBAL_HASH_MAP], AC_DEFUN([AC_CXX_HAVE_GLOBAL_HASH_MAP],
[AC_CACHE_CHECK([whether the compiler has <hash_map> defining template class ::hash_map], [AC_CACHE_CHECK([whether the compiler has <hash_map> defining template class ::hash_map],
@@ -5933,18 +5937,20 @@ AC_DEFUN([AC_CXX_HAVE_GLOBAL_HASH_MAP],
AC_TRY_COMPILE([#include <hash_map>],[hash_map<int,int> t; ], AC_TRY_COMPILE([#include <hash_map>],[hash_map<int,int> t; ],
[ac_cv_cxx_have_global_hash_map=yes], [ac_cv_cxx_have_global_hash_map=no]) [ac_cv_cxx_have_global_hash_map=yes], [ac_cv_cxx_have_global_hash_map=no])
AC_LANG_RESTORE]) AC_LANG_RESTORE])
if test "$ac_cv_cxx_have_global_hash_map" = yes; then HAVE_GLOBAL_HASH_MAP=0
AC_DEFINE(HAVE_GLOBAL_HASH_MAP,,[Define if the compiler has a header <hash_map> that defines template class ::hash_map.]) if test "$ac_cv_cxx_have_global_hash_map" = yes
fi]) then
HAVE_GLOBAL_HASH_MAP=1
fi
AC_SUBST(HAVE_GLOBAL_HASH_MAP)])
AC_DEFUN([AC_CXX_HAVE_HASH_MAP], AC_DEFUN([AC_CXX_HAVE_HASH_MAP],
[AC_CXX_HAVE_STD_EXT_HASH_MAP [AC_CXX_HAVE_STD_EXT_HASH_MAP
AC_CXX_HAVE_GNU_EXT_HASH_MAP AC_CXX_HAVE_GNU_EXT_HASH_MAP
AC_CXX_HAVE_GLOBAL_HASH_MAP]) AC_CXX_HAVE_GLOBAL_HASH_MAP])
#
# Check for hash_set extension. This is modified from # Check for hash_set extension. This is modified from
# http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_have_ext_hash_set.html # http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_have_ext_hash_set.html
#
AC_DEFUN([AC_CXX_HAVE_STD_EXT_HASH_SET], AC_DEFUN([AC_CXX_HAVE_STD_EXT_HASH_SET],
[AC_CACHE_CHECK([whether the compiler has <ext/hash_set> defining template class std::hash_set], [AC_CACHE_CHECK([whether the compiler has <ext/hash_set> defining template class std::hash_set],
ac_cv_cxx_have_std_ext_hash_set, ac_cv_cxx_have_std_ext_hash_set,
@@ -5957,9 +5963,12 @@ using namespace std;
#endif],[hash_set<int> t; ], #endif],[hash_set<int> t; ],
[ac_cv_cxx_have_std_ext_hash_set=yes], [ac_cv_cxx_have_std_ext_hash_set=no]) [ac_cv_cxx_have_std_ext_hash_set=yes], [ac_cv_cxx_have_std_ext_hash_set=no])
AC_LANG_RESTORE]) AC_LANG_RESTORE])
if test "$ac_cv_cxx_have_std_ext_hash_set" = yes; then HAVE_STD_EXT_HASH_SET=0
AC_DEFINE(HAVE_STD_EXT_HASH_SET,,[Define if the compiler has a header <ext/hash_set> that defines template class std::hash_set.]) if test "$ac_cv_cxx_have_std_ext_hash_set" = yes
fi]) then
HAVE_STD_EXT_HASH_SET=1
fi
AC_SUBST(HAVE_STD_EXT_HASH_SET)])
AC_DEFUN([AC_CXX_HAVE_GNU_EXT_HASH_SET], AC_DEFUN([AC_CXX_HAVE_GNU_EXT_HASH_SET],
[AC_CACHE_CHECK( [AC_CACHE_CHECK(
@@ -5974,9 +5983,12 @@ using namespace __gnu_cxx;
#endif],[hash_set<int> t; ], #endif],[hash_set<int> t; ],
[ac_cv_cxx_have_gnu_ext_hash_set=yes], [ac_cv_cxx_have_gnu_ext_hash_set=no]) [ac_cv_cxx_have_gnu_ext_hash_set=yes], [ac_cv_cxx_have_gnu_ext_hash_set=no])
AC_LANG_RESTORE]) AC_LANG_RESTORE])
if test "$ac_cv_cxx_have_gnu_ext_hash_set" = yes; then HAVE_GNU_EXT_HASH_SET=0
AC_DEFINE(HAVE_GNU_EXT_HASH_SET,,[Define if the compiler has a header <ext/hash_set> that defines template class __gnu_cxx::hash_set.]) if test "$ac_cv_cxx_have_gnu_ext_hash_set" = yes
fi]) then
HAVE_GNU_EXT_HASH_SET=1
fi
AC_SUBST(HAVE_GNU_EXT_HASH_SET)])
AC_DEFUN([AC_CXX_HAVE_GLOBAL_HASH_SET], AC_DEFUN([AC_CXX_HAVE_GLOBAL_HASH_SET],
[AC_CACHE_CHECK([whether the compiler has <hash_set> defining template class ::hash_set], [AC_CACHE_CHECK([whether the compiler has <hash_set> defining template class ::hash_set],
@@ -5987,19 +5999,20 @@ AC_DEFUN([AC_CXX_HAVE_GLOBAL_HASH_SET],
AC_TRY_COMPILE([#include <hash_set>],[hash_set<int> t; return 0;], AC_TRY_COMPILE([#include <hash_set>],[hash_set<int> t; return 0;],
[ac_cv_cxx_have_global_hash_set=yes], [ac_cv_cxx_have_global_hash_set=no]) [ac_cv_cxx_have_global_hash_set=yes], [ac_cv_cxx_have_global_hash_set=no])
AC_LANG_RESTORE]) AC_LANG_RESTORE])
if test "$ac_cv_cxx_have_global_hash_set" = yes; then HAVE_GLOBAL_HASH_SET=0
AC_DEFINE(HAVE_GLOBAL_HASH_SET,,[Define if the compiler has a header <hash_set> that defines template class ::hash_set.]) if test "$ac_cv_cxx_have_global_hash_set" = yes
fi]) then
HAVE_GLOBAL_HASH_SET=1
fi
AC_SUBST(HAVE_GLOBAL_HASH_SET)])
AC_DEFUN([AC_CXX_HAVE_HASH_SET], AC_DEFUN([AC_CXX_HAVE_HASH_SET],
[AC_CXX_HAVE_STD_EXT_HASH_SET [AC_CXX_HAVE_STD_EXT_HASH_SET
AC_CXX_HAVE_GNU_EXT_HASH_SET AC_CXX_HAVE_GNU_EXT_HASH_SET
AC_CXX_HAVE_GLOBAL_HASH_SET]) AC_CXX_HAVE_GLOBAL_HASH_SET])
#
# Check for standard iterator extension. This is modified from # Check for standard iterator extension. This is modified from
# http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_have_ext_hash_set.html # http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_have_ext_hash_set.html
#
AC_DEFUN([AC_CXX_HAVE_STD_ITERATOR], AC_DEFUN([AC_CXX_HAVE_STD_ITERATOR],
[AC_CACHE_CHECK(whether the compiler has the standard iterator, [AC_CACHE_CHECK(whether the compiler has the standard iterator,
ac_cv_cxx_have_std_iterator, ac_cv_cxx_have_std_iterator,
@@ -6013,10 +6026,12 @@ using namespace std;
ac_cv_cxx_have_std_iterator=yes, ac_cv_cxx_have_std_iterator=no) ac_cv_cxx_have_std_iterator=yes, ac_cv_cxx_have_std_iterator=no)
AC_LANG_RESTORE AC_LANG_RESTORE
]) ])
if test "$ac_cv_cxx_have_std_iterator" = yes; then HAVE_STD_ITERATOR=0
AC_DEFINE(HAVE_STD_ITERATOR,,[define if the compiler has STL iterators]) if test "$ac_cv_cxx_have_std_iterator" = yes
then
HAVE_STD_ITERATOR=1
fi fi
]) AC_SUBST(HAVE_STD_ITERATOR)])
# #
# Check for bidirectional iterator extension. This is modified from # Check for bidirectional iterator extension. This is modified from
@@ -6035,15 +6050,15 @@ using namespace std;
ac_cv_cxx_have_bi_iterator=yes, ac_cv_cxx_have_bi_iterator=no) ac_cv_cxx_have_bi_iterator=yes, ac_cv_cxx_have_bi_iterator=no)
AC_LANG_RESTORE AC_LANG_RESTORE
]) ])
if test "$ac_cv_cxx_have_bi_iterator" = yes; then HAVE_BI_ITERATOR=0
AC_DEFINE(HAVE_BI_ITERATOR,,[define if the compiler has bidirectional iterator]) if test "$ac_cv_cxx_have_bi_iterator" = yes
then
HAVE_BI_ITERATOR=1
fi fi
]) AC_SUBST(HAVE_BI_ITERATOR)])
#
# Check for forward iterator extension. This is modified from # Check for forward iterator extension. This is modified from
# http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_have_ext_hash_set.html # http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_have_ext_hash_set.html
#
AC_DEFUN([AC_CXX_HAVE_FWD_ITERATOR], AC_DEFUN([AC_CXX_HAVE_FWD_ITERATOR],
[AC_CACHE_CHECK(whether the compiler has forward iterators, [AC_CACHE_CHECK(whether the compiler has forward iterators,
ac_cv_cxx_have_fwd_iterator, ac_cv_cxx_have_fwd_iterator,
@@ -6057,41 +6072,12 @@ using namespace std;
ac_cv_cxx_have_fwd_iterator=yes, ac_cv_cxx_have_fwd_iterator=no) ac_cv_cxx_have_fwd_iterator=yes, ac_cv_cxx_have_fwd_iterator=no)
AC_LANG_RESTORE AC_LANG_RESTORE
]) ])
if test "$ac_cv_cxx_have_fwd_iterator" = yes; then HAVE_FWD_ITERATOR=0
AC_DEFINE(HAVE_FWD_ITERATOR,,[define if the compiler has STL iterators]) if test "$ac_cv_cxx_have_fwd_iterator" = yes
then
HAVE_FWD_ITERATOR=1
fi fi
]) AC_SUBST(HAVE_FWD_ITERATOR)])
#
# Check for slist extension. This is from
# http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_have_ext_slist.html
#
AC_DEFUN([AC_CXX_HAVE_EXT_SLIST],
[AC_CACHE_CHECK(whether the compiler has ext/slist,
ac_cv_cxx_have_ext_slist,
[AC_REQUIRE([AC_CXX_NAMESPACES])
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_TRY_COMPILE([#include <ext/slist>
#ifdef HAVE_NAMESPACES
using namespace std;
#endif],[slist<int> s; return 0;],
ac_cv_cxx_have_ext_slist=std, ac_cv_cxx_have_ext_slist=no)
AC_TRY_COMPILE([#include <ext/slist>
#ifdef HAVE_NAMESPACES
using namespace __gnu_cxx;
#endif],[slist<int> s; return 0;],
ac_cv_cxx_have_ext_slist=gnu, ac_cv_cxx_have_ext_slist=no)
AC_LANG_RESTORE
])
if test "$ac_cv_cxx_have_ext_slist" = std; then
AC_DEFINE(HAVE_EXT_SLIST,std,[define if the compiler has ext/slist])
fi
if test "$ac_cv_cxx_have_ext_slist" = gnu; then
AC_DEFINE(HAVE_EXT_SLIST,gnu,[define if the compiler has ext/slist])
fi
])
# #
# Check for FLEX. This is modified from # Check for FLEX. This is modified from
@@ -6111,6 +6097,10 @@ fi
# Check for Bison. This is modified from # Check for Bison. This is modified from
# http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_namespaces.html # http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_namespaces.html
# #
# This macro verifies that Bison is installed. If successful, then
# 1) YACC is set to bison -y (to emulate YACC calls)
# 2) BISON is set to bison
#
AC_DEFUN([AC_PROG_BISON], AC_DEFUN([AC_PROG_BISON],
[AC_CACHE_CHECK(, [AC_CACHE_CHECK(,
ac_cv_has_bison, ac_cv_has_bison,
@@ -6119,7 +6109,7 @@ ac_cv_has_bison,
if test "$YACC" != "bison -y"; then if test "$YACC" != "bison -y"; then
AC_MSG_ERROR([bison not found but required]) AC_MSG_ERROR([bison not found but required])
else else
AC_SUBST(YACC,[bison],[location of bison]) AC_SUBST(BISON,[bison],[location of bison])
fi fi
]) ])

View File

@@ -1,21 +1,5 @@
dnl Autoconf requirements dnl Initialize autoconf
dnl AC_INIT(package, version, bug-report-address) AC_INIT([[[LLVM]]],[[[1.1]]],[llvmbugs@cs.uiuc.edu])
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 Place all of the extra autoconf files into the config subdirectory dnl Place all of the extra autoconf files into the config subdirectory
AC_CONFIG_AUX_DIR([autoconf]) AC_CONFIG_AUX_DIR([autoconf])
@@ -30,9 +14,7 @@ then
fi fi
fi fi
dnl
dnl Configure all of the projects present in our source tree. dnl Configure all of the projects present in our source tree.
dnl
for i in `ls ${srcdir}/projects` for i in `ls ${srcdir}/projects`
do do
if test ${i} != "CVS" if test ${i} != "CVS"
@@ -58,7 +40,6 @@ AC_CONFIG_MAKEFILE(test/Programs/Makefile)
AC_CONFIG_MAKEFILE(test/Programs/Makefile.programs) AC_CONFIG_MAKEFILE(test/Programs/Makefile.programs)
AC_CONFIG_MAKEFILE(test/Programs/TEST.aa.Makefile) AC_CONFIG_MAKEFILE(test/Programs/TEST.aa.Makefile)
AC_CONFIG_MAKEFILE(test/Programs/TEST.dsgraph.report) 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.aa.report)
AC_CONFIG_MAKEFILE(test/Programs/TEST.example.Makefile) AC_CONFIG_MAKEFILE(test/Programs/TEST.example.Makefile)
AC_CONFIG_MAKEFILE(test/Programs/TEST.nightly.Makefile) AC_CONFIG_MAKEFILE(test/Programs/TEST.nightly.Makefile)
@@ -69,10 +50,12 @@ AC_CONFIG_MAKEFILE(test/Programs/TEST.dsgraph.Makefile)
AC_CONFIG_MAKEFILE(test/Programs/TEST.jit.report) AC_CONFIG_MAKEFILE(test/Programs/TEST.jit.report)
AC_CONFIG_MAKEFILE(test/Programs/TEST.typesafe.Makefile) AC_CONFIG_MAKEFILE(test/Programs/TEST.typesafe.Makefile)
AC_CONFIG_MAKEFILE(test/Programs/TEST.dsgraph.gnuplot) 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/Makefile)
AC_CONFIG_MAKEFILE(test/Programs/External/SPEC/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/Makefile.spec)
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)
AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Makefile.multisrc) AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Makefile.multisrc)
AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/analyzer/test.in) AC_CONFIG_MAKEFILE(test/Programs/MultiSource/Benchmarks/FreeBench/analyzer/test.in)
@@ -90,15 +73,12 @@ 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/MultiSource/Benchmarks/FreeBench/pifft/test.in)
AC_CONFIG_MAKEFILE(test/Programs/SingleSource/Makefile) AC_CONFIG_MAKEFILE(test/Programs/SingleSource/Makefile)
AC_CONFIG_MAKEFILE(test/Programs/SingleSource/Makefile.singlesrc) AC_CONFIG_MAKEFILE(test/Programs/SingleSource/Makefile.singlesrc)
AC_CONFIG_MAKEFILE(test/Programs/SingleSource/UnitTests/SetjmpLongjmp/Makefile)
AC_CONFIG_MAKEFILE(tools/Makefile) AC_CONFIG_MAKEFILE(tools/Makefile)
AC_CONFIG_MAKEFILE(utils/Makefile) AC_CONFIG_MAKEFILE(utils/Makefile)
AC_CONFIG_MAKEFILE(projects/Makefile) AC_CONFIG_MAKEFILE(projects/Makefile)
dnl ************************************************************************** dnl Find the install program (needs to be done before canonical stuff)
dnl * Determine which system we are building on
dnl **************************************************************************
dnl Check the install program (needs to be done before canonical stuff)
AC_PROG_INSTALL AC_PROG_INSTALL
dnl Check which host for which we're compiling. This will tell us which LLVM dnl Check which host for which we're compiling. This will tell us which LLVM
@@ -154,10 +134,6 @@ case $target in
;; ;;
esac esac
dnl **************************************************************************
dnl * Check for programs.
dnl **************************************************************************
dnl Check for compilation tools dnl Check for compilation tools
AC_PROG_CXX AC_PROG_CXX
AC_PROG_CC(gcc) AC_PROG_CC(gcc)
@@ -168,7 +144,6 @@ if test "$GCC" != "yes"
then then
AC_MSG_ERROR([gcc required but not found]) AC_MSG_ERROR([gcc required but not found])
fi fi
if test "$GXX" != "yes" if test "$GXX" != "yes"
then then
AC_MSG_ERROR([g++ required but not found]) AC_MSG_ERROR([g++ required but not found])
@@ -178,86 +153,41 @@ dnl Verify that GCC is version 3.0 or higher
gccmajor=`$CC --version | head -n 1 | awk '{print $NF;}' | cut -d. -f1` gccmajor=`$CC --version | head -n 1 | awk '{print $NF;}' | cut -d. -f1`
if test "$gccmajor" -lt "3" if test "$gccmajor" -lt "3"
then then
AC_MSG_ERROR([gcc 3.x required]) AC_MSG_ERROR([gcc 3.x required, but you have a lower version])
fi 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 CHECK_GNU_MAKE
if test -z "$_cv_gnu_make_command" if test -z "$_cv_gnu_make_command"
then then
AC_MSG_ERROR([GNU Make required but not found]) AC_MSG_ERROR([GNU Make required but not found])
fi fi
dnl Check for compiler-compiler tools (reminds me of Little Caesar's Pizza) dnl Checks for other tools
AC_PROG_FLEX AC_PROG_FLEX
AC_PROG_BISON AC_PROG_BISON
dnl Check for libtool
AC_PROG_LIBTOOL AC_PROG_LIBTOOL
dnl Check for our special programs dnl Checks for tools we can get away with not having:
AC_PATH_PROG(RPWD,[pwd],[false]) AC_PATH_PROG(DOT,[dot],[true dot])
if test ${RPWD} = "false" 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 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 fi
AC_PATH_PROG(QMTEST,[qmtest],[true qmtest])
AC_PATH_PROG(AR,[ar],[false]) if test "$QMTEST" = "false"
if test ${AR} = "false"
then then
AC_MSG_ERROR([ar required but not found]) AC_MSG_WARN([QMTest is required for the test suite, but it was 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])
fi fi
dnl Verify that the version of python available is high enough for qmtest dnl Verify that the version of python available is high enough for qmtest
@@ -271,20 +201,17 @@ then
then then
if test "$pyminor" -lt "2" if test "$pyminor" -lt "2"
then then
AC_MSG_WARN([Python 2.2 or greater required for qmtest]) AC_MSG_WARN([QMTest requires Python 2.2 or later])
fi fi
fi fi
else else
AC_MSG_WARN([Python 2.2 or greater required for qmtest]) AC_MSG_WARN([QMTest requires Python 2.2 or later])
fi fi
dnl Verify that the source directory is valid dnl Verify that the source directory is valid
AC_CONFIG_SRCDIR(["Makefile.config.in"]) AC_CONFIG_SRCDIR(["Makefile.config.in"])
dnl ************************************************************************** dnl Checks for libraries:
dnl * Check for libraries.
dnl **************************************************************************
dnl libelf is for sparc only; we can ignore it if we don't have it dnl libelf is for sparc only; we can ignore it if we don't have it
AC_CHECK_LIB(elf, elf_begin) AC_CHECK_LIB(elf, elf_begin)
@@ -296,46 +223,29 @@ AC_SEARCH_LIBS(mallinfo,malloc,AC_DEFINE([HAVE_MALLINFO],[1],[Define if mallinfo
dnl pthread locking functions are optional - but llvm will not be thread-safe dnl pthread locking functions are optional - but llvm will not be thread-safe
dnl without locks. dnl without locks.
AC_SEARCH_LIBS(pthread_mutex_lock,pthread,AC_DEFINE(HAVE_PTHREAD_MUTEX_LOCK,1,[Define if PThread mutexes (e.g., pthread_mutex_lock) are available in the system's thread library.])) 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 The math libraries are used by the test code, but not by the actual LLVM dnl We don't check for ancient stuff or things that are guaranteed to be there
dnl code. dnl by the C++ standard. We always use the <cfoo> versions of <foo.h> C headers.
dnl
dnl AC_CHECK_LIB(m, cos)
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 **************************************************************************
AC_HEADER_STDC AC_HEADER_STDC
AC_HEADER_SYS_WAIT AC_HEADER_SYS_WAIT
dnl Check for ANSI C/POSIX header files dnl Checks for POSIX and other various system-specific header files
AC_CHECK_HEADERS(assert.h fcntl.h limits.h sys/time.h unistd.h errno.h signal.h math.h) 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)
dnl Check for system specific header files dnl Check for things that need to be included in public headers, and so
AC_CHECK_HEADERS(malloc.h sys/mman.h sys/resource.h) dnl for which we may not have access to a HAVE_* preprocessor #define.
dnl (primarily used in DataTypes.h)
dnl Check for header files associated with dlopen and friends AC_CHECK_HEADER([sys/types.h],
AC_CHECK_HEADERS(dlfcn.h link.h) [INCLUDE_SYS_TYPES_H='#include <sys/types.h>'],
[INCLUDE_SYS_TYPES_H=''])
dnl ************************************************************************** AC_SUBST(INCLUDE_SYS_TYPES_H)
dnl * Checks for typedefs, structures, and compiler characteristics. AC_CHECK_HEADER([inttypes.h],
dnl ************************************************************************** [INCLUDE_INTTYPES_H='#include <inttypes.h>'],
[INCLUDE_INTTYPES_H=''])
dnl Check for const and inline keywords AC_SUBST(INCLUDE_INTTYPES_H)
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 dnl Check for types
AC_TYPE_PID_T AC_TYPE_PID_T
@@ -348,62 +258,38 @@ AC_STRUCT_TM
dnl Check for various C features dnl Check for various C features
AC_C_PRINTF_A 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 dnl Check for C++ extensions
AC_CXX_HAVE_HASH_MAP AC_CXX_HAVE_HASH_MAP
AC_CXX_HAVE_HASH_SET AC_CXX_HAVE_HASH_SET
AC_CXX_HAVE_EXT_SLIST
AC_CXX_HAVE_STD_ITERATOR AC_CXX_HAVE_STD_ITERATOR
AC_CXX_HAVE_BI_ITERATOR AC_CXX_HAVE_BI_ITERATOR
AC_CXX_HAVE_FWD_ITERATOR AC_CXX_HAVE_FWD_ITERATOR
dnl ************************************************************************** dnl Checks for library functions.
dnl * Checks for library functions.
dnl **************************************************************************
AC_FUNC_ALLOCA AC_FUNC_ALLOCA
AC_PROG_GCC_TRADITIONAL
AC_FUNC_MEMCMP
AC_FUNC_MMAP AC_FUNC_MMAP
if test "$ac_cv_func_mmap_fixed_mapped" = "no"
then
AC_MSG_ERROR([mmap() required but not found])
fi
AC_FUNC_MMAP_FILE AC_FUNC_MMAP_FILE
if test ${ac_cv_func_mmap_file} = "no" if test "$ac_cv_func_mmap_file" = "no"
then then
AC_MSG_ERROR([mmap() of files required but not found]) AC_MSG_ERROR([mmap() of files required but not found])
fi fi
AC_HEADER_MMAP_ANONYMOUS AC_HEADER_MMAP_ANONYMOUS
AC_TYPE_SIGNAL AC_TYPE_SIGNAL
AC_CHECK_FUNCS(getcwd gettimeofday strcspn strdup strerror strspn strstr strtod strtol strtoq strtoll) AC_CHECK_FUNCS(getcwd gettimeofday strdup strtoq strtoll backtrace)
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_FUNC(mprotect,,AC_MSG_ERROR([Function mprotect() required but not found])) AC_CHECK_FUNC(mprotect,,AC_MSG_ERROR([Function mprotect() required but not found]))
dnl Determine if the linker supports the -R option. dnl Determine if the linker supports the -R option.
AC_LINK_USE_R() AC_LINK_USE_R
dnl ************************************************************************** dnl --enable/--with command-line options:
dnl * Enable various compile-time options dnl Check whether they want to do an optimized build:
dnl **************************************************************************
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
AC_ARG_ENABLE(optimized,AC_HELP_STRING([--enable-optimized],[Compile with optimizations enabled (default is NO)]),,enableval=no) AC_ARG_ENABLE(optimized,AC_HELP_STRING([--enable-optimized],[Compile with optimizations enabled (default is NO)]),,enableval=no)
if test ${enableval} = "no" if test ${enableval} = "no"
then then
@@ -412,28 +298,73 @@ else
AC_SUBST(ENABLE_OPTIMIZED,[[ENABLE_OPTIMIZED=1]]) AC_SUBST(ENABLE_OPTIMIZED,[[ENABLE_OPTIMIZED=1]])
fi fi
dnl Spec Benchmarks dnl Spec 2000 Benchmarks
AC_ARG_ENABLE(spec2000,AC_HELP_STRING([--enable-spec],[Compile SPEC 2000 benchmarks (default is NO)]),,enableval=no) AC_ARG_ENABLE(spec2000,AC_HELP_STRING([--enable-spec2000],[Compile SPEC 2000 benchmarks (default is NO)]),,enableval=no)
if test ${enableval} = "no" if test ${enableval} = "no"
then then
if test -d /home/vadve/shared/benchmarks/speccpu2000/benchspec if test -d /home/vadve/shared/benchmarks/speccpu2000/benchspec
then then
AC_SUBST(SPEC_ROOT,[/home/vadve/shared/benchmarks/speccpu2000/benchspec]) AC_SUBST(SPEC2000_ROOT,[/home/vadve/shared/benchmarks/speccpu2000/benchspec])
AC_SUBST(USE_SPEC,[[USE_SPEC=1]]) AC_SUBST(USE_SPEC2000,[[USE_SPEC2000=1]])
else else
AC_SUBST(USE_SPEC,[[]]) AC_SUBST(USE_SPEC2000,[[]])
AC_SUBST(SPEC_ROOT,[]) AC_SUBST(SPEC2000_ROOT,[])
fi fi
else else
if test ${enableval} = "" if test ${enableval} = ""
then then
AC_SUBST(SPEC_ROOT,[/home/vadve/shared/benchmarks/speccpu2000/benchspec]) AC_SUBST(SPEC2000_ROOT,[/home/vadve/shared/benchmarks/speccpu2000/benchspec])
else else
AC_SUBST(SPEC_ROOT,[${enableval}]) AC_SUBST(SPEC2000_ROOT,[${enableval}])
fi fi
AC_SUBST(USE_SPEC,[[USE_SPEC=1]]) AC_SUBST(USE_SPEC2000,[[USE_SPEC2000=1]])
fi fi
dnl Spec 95 Benchmarks
AC_ARG_ENABLE(spec95,AC_HELP_STRING([--enable-spec95],[Compile SPEC 95 benchmarks (default is NO)]),,enableval=no)
if test ${enableval} = "no"
then
if test -d /home/vadve/shared/benchmarks/spec95/benchspec
then
AC_SUBST(SPEC95_ROOT,[/home/vadve/shared/benchmarks/spec95/benchspec])
AC_SUBST(USE_SPEC95,[[USE_SPEC95=1]])
else
AC_SUBST(USE_SPEC95,[[]])
AC_SUBST(SPEC95_ROOT,[])
fi
else
if test ${enableval} = ""
then
AC_SUBST(SPEC95_ROOT,[/home/vadve/shared/benchmarks/spec95/benchspec])
else
AC_SUBST(SPEC95_ROOT,[${enableval}])
fi
AC_SUBST(USE_SPEC95,[[USE_SPEC95=1]])
fi
dnl Povray External Benchmark
AC_ARG_ENABLE(povray,AC_HELP_STRING([--enable-povray],[Compile Povray benchmark (default is NO)]),,enableval=no)
if test ${enableval} = "no"
then
if test -d /home/vadve/shared/benchmarks/povray31
then
AC_SUBST(POVRAY_ROOT,[/home/vadve/shared/benchmarks/povray31])
AC_SUBST(USE_POVRAY,[[USE_POVRAY=1]])
else
AC_SUBST(USE_POVRAY,[[]])
AC_SUBST(POVRAY_ROOT,[])
fi
else
if test ${enableval} = ""
then
AC_SUBST(POVRAY_ROOT,[/home/vadve/shared/benchmarks/povray31])
else
AC_SUBST(POVRAY_ROOT,[${enableval}])
fi
AC_SUBST(USE_POVRAY,[[USE_POVRAY=1]])
fi
dnl Precompiled Bytecode Option dnl Precompiled Bytecode Option
AC_ARG_ENABLE(precompiled_bytecode,AC_HELP_STRING([--enable-precompiled_bytecode],[Use pre-compiled bytecode (default is NO)]),,enableval=no) AC_ARG_ENABLE(precompiled_bytecode,AC_HELP_STRING([--enable-precompiled_bytecode],[Use pre-compiled bytecode (default is NO)]),,enableval=no)
if test ${enableval} = "no" if test ${enableval} = "no"
@@ -443,7 +374,6 @@ else
AC_SUBST(UPB,[[USE_PRECOMPILED_BYTECODE=1]]) AC_SUBST(UPB,[[USE_PRECOMPILED_BYTECODE=1]])
fi fi
dnl LLC Diff Option 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) 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" if test ${enableval} = "no"
@@ -455,7 +385,6 @@ fi
dnl JIT Option dnl JIT Option
AC_ARG_ENABLE(jit,AC_HELP_STRING([--enable-jit],[Enable Just In Time Compiling (default is YES)]),,enableval=default) AC_ARG_ENABLE(jit,AC_HELP_STRING([--enable-jit],[Enable Just In Time Compiling (default is YES)]),,enableval=default)
if test ${enableval} = "no" if test ${enableval} = "no"
then then
AC_SUBST(JIT,[[]]) AC_SUBST(JIT,[[]])
@@ -473,13 +402,8 @@ else
esac esac
fi fi
dnl ************************************************************************** dnl Find the LLVM GCC-based C/C++ front end
dnl * Set the location of various third-party software packages
dnl **************************************************************************
dnl Location of the LLVM C front end
AC_ARG_WITH(llvmgccdir,AC_HELP_STRING([--with-llvmgccdir],[Location of LLVM GCC front-end]),AC_SUBST(LLVMGCCDIR,[$withval])) 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]) AC_MSG_CHECKING([for llvm-gcc])
LLVM_GCC_CHECK=no LLVM_GCC_CHECK=no
if test -d "$LLVMGCCDIR" if test -d "$LLVMGCCDIR"
@@ -495,7 +419,6 @@ if test "$LLVM_GCC_CHECK" = "no"
then then
llvmgccwarn=yes llvmgccwarn=yes
fi fi
AC_MSG_CHECKING([whether llvm-gcc is sane]) AC_MSG_CHECKING([whether llvm-gcc is sane])
LLVM_GCC_SANE=no LLVM_GCC_SANE=no
if test -x "$LLVM_GCC_CHECK" if test -x "$LLVM_GCC_CHECK"
@@ -507,6 +430,10 @@ then
LLVM_GCC_SANE=yes LLVM_GCC_SANE=yes
fi fi
rm conftest.c 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 fi
AC_MSG_RESULT($LLVM_GCC_SANE) AC_MSG_RESULT($LLVM_GCC_SANE)
if test "$LLVM_GCC_SANE" = "no" if test "$LLVM_GCC_SANE" = "no"
@@ -520,18 +447,25 @@ AC_ARG_WITH(bcrepos,AC_HELP_STRING([--with-bcrepos],[Location of Bytecode Reposi
dnl Location of PAPI 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])) 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 dnl Get libtool's idea of what the shared library suffix is.
AC_ARG_WITH(purify,AC_HELP_STRING([--with-purify],[Location of purify program]),AC_SUBST(PURIFY,[$withval])) 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 Create the output files
dnl * Configure other software packages (via AC_CONFIG_SUBDIRS) AC_OUTPUT(Makefile.config
dnl ************************************************************************** include/Support/DataTypes.h
include/Support/ThreadSupport.h
dnl ************************************************************************** include/Support/hash_map
dnl * Create the output files include/Support/hash_set
dnl ************************************************************************** include/Support/iterator)
AC_OUTPUT(Makefile.config)
dnl Warn loudly if llvm-gcc was not obviously working
if test $llvmgccwarn = yes if test $llvmgccwarn = yes
then then
AC_MSG_WARN([***** llvm C/C++ front end was not found, or does not]) AC_MSG_WARN([***** llvm C/C++ front end was not found, or does not])
@@ -541,3 +475,4 @@ then
AC_MSG_WARN([***** Runtime libraries (in llvm/runtime) will not be built,]) 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.]) AC_MSG_WARN([***** but you should be able to build the llvm tools.])
fi fi

2105
llvm/configure vendored

File diff suppressed because it is too large Load Diff

View File

@@ -2,8 +2,8 @@
"http://www.w3.org/TR/html4/strict.dtd"> "http://www.w3.org/TR/html4/strict.dtd">
<html> <html>
<head> <head>
<link rel="stylesheet" href="llvm.css" type="text/css">
<title>Alias Analysis Infrastructure in LLVM</title> <title>Alias Analysis Infrastructure in LLVM</title>
<link rel="stylesheet" href="llvm.css" type="text/css">
</head> </head>
<body> <body>
@@ -65,7 +65,7 @@ href="#MustNoMay">Must, May, or No</a> alias response, indicating that two
pointers do point to the same object, might point to the same object, or are pointers do point to the same object, might point to the same object, or are
known not to point to the same object.</p> known not to point to the same object.</p>
<p>The <a href="/doxygen/classAliasAnalysis.html">AliasAnalysis</a> class is the <p>The <a href="/doxygen/classllvm_1_1AliasAnalysis.html">AliasAnalysis</a> class is the
centerpiece of the LLVM Alias Analysis related infrastructure. This class is centerpiece of the LLVM Alias Analysis related infrastructure. This class is
the common interface between clients of alias analysis information and the the common interface between clients of alias analysis information and the
implementations providing it. In addition to simple alias analysis information, implementations providing it. In addition to simple alias analysis information,
@@ -89,7 +89,7 @@ know</a>.</p>
<div class="doc_text"> <div class="doc_text">
<p>The <a href="/doxygen/classAliasAnalysis.html">AliasAnalysis</a> class <p>The <a href="/doxygen/classllvm_1_1AliasAnalysis.html">AliasAnalysis</a> class
defines the interface that Alias Analysis implementations should support. This defines the interface that Alias Analysis implementations should support. This
class exports two important enums: <tt>AliasResult</tt> and class exports two important enums: <tt>AliasResult</tt> and
<tt>ModRefResult</tt> which represent the result of an alias query or a mod/ref <tt>ModRefResult</tt> which represent the result of an alias query or a mod/ref
@@ -199,7 +199,7 @@ is returned.</p>
straight-forward. There are already several implementations that you can use straight-forward. There are already several implementations that you can use
for examples, and the following information should help fill in any details. for examples, and the following information should help fill in any details.
For a minimal example, take a look at the <a For a minimal example, take a look at the <a
href="/doxygen/structNoAA.html"><tt>no-aa</tt></a> implementation.</p> href="/doxygen/structllvm_1_1NoAA.html"><tt>no-aa</tt></a> implementation.</p>
</div> </div>
@@ -277,7 +277,7 @@ a <tt>BasicBlockPass</tt>, or <tt>InitializeAliasAnalysis</tt> for an
<div class="doc_text"> <div class="doc_text">
<p>All of the <a href="/doxygen/classAliasAnalysis.html">AliasAnalysis</a> <p>All of the <a href="/doxygen/classllvm_1_1AliasAnalysis.html">AliasAnalysis</a>
virtual methods default to providing conservatively correct information virtual methods default to providing conservatively correct information
(returning "May" Alias and "Mod/Ref" for alias and mod/ref queries (returning "May" Alias and "Mod/Ref" for alias and mod/ref queries
respectively). Depending on the capabilities of the analysis you are respectively). Depending on the capabilities of the analysis you are
@@ -355,7 +355,7 @@ to do anything special to handle load instructions: just use the
<p>Many transformations need information about alias <b>sets</b> that are active <p>Many transformations need information about alias <b>sets</b> that are active
in some scope, rather than information about pairwise aliasing. The <tt><a in some scope, rather than information about pairwise aliasing. The <tt><a
href="/doxygen/classAliasSetTracker.html">AliasSetTracker</a></tt> class is used href="/doxygen/classllvm_1_1AliasSetTracker.html">AliasSetTracker</a></tt> class is used
to efficiently build these Alias Sets from the pairwise alias analysis to efficiently build these Alias Sets from the pairwise alias analysis
information provided by the AliasAnalysis interface.</p> information provided by the AliasAnalysis interface.</p>
@@ -366,9 +366,9 @@ simply iterate through the constructed alias sets, using the AliasSetTracker
<tt>begin()</tt>/<tt>end()</tt> methods.</p> <tt>begin()</tt>/<tt>end()</tt> methods.</p>
<p>The <tt>AliasSet</tt>s formed by the <tt>AliasSetTracker</tt> are guaranteed <p>The <tt>AliasSet</tt>s formed by the <tt>AliasSetTracker</tt> are guaranteed
to be disjoint, calculate mod/ref information for the set, and keep track of to be disjoint, calculate mod/ref information and volatility for the set, and
whether or not all of the pointers in the set are Must aliases. The keep track of whether or not all of the pointers in the set are Must aliases.
AliasSetTracker also makes sure that sets are properly folded due to call The AliasSetTracker also makes sure that sets are properly folded due to call
instructions, and can provide a list of pointers in each set.</p> instructions, and can provide a list of pointers in each set.</p>
<p>As an example user of this, the <a href="/doxygen/structLICM.html">Loop <p>As an example user of this, the <a href="/doxygen/structLICM.html">Loop
@@ -376,11 +376,38 @@ Invariant Code Motion</a> pass uses AliasSetTrackers to build alias information
about each loop nest. If an AliasSet in a loop is not modified, then all load about each loop nest. If an AliasSet in a loop is not modified, then all load
instructions from that set may be hoisted out of the loop. If any alias sets instructions from that set may be hoisted out of the loop. If any alias sets
are stored <b>and</b> are must alias sets, then the stores may be sunk to are stored <b>and</b> are must alias sets, then the stores may be sunk to
outside of the loop. Both of these transformations obviously only apply if the outside of the loop, promoting the memory location to a register for the
pointer argument is loop-invariant.</p> duration of the loop nest. Both of these transformations obviously only apply
if the pointer argument is loop-invariant.</p>
</div> </div>
<div class="doc_subsubsection">
The AliasSetTracker implementation
</div>
<div class="doc_text">
<p>The AliasSetTracker class is implemented to be as efficient as possible. It
uses the union-find algorithm to efficiently merge AliasSets when a pointer is
inserted into the AliasSetTracker that aliases multiple sets. The primary data
structure is a hash table mapping pointers to the AliasSet they are in.</p>
<p>The AliasSetTracker class must maintain a list of all of the LLVM Value*'s
that are in each AliasSet. Since the hash table already has entries for each
LLVM Value* of interest, the AliasesSets thread the linked list through these
hash-table nodes to avoid having to allocate memory unnecessarily, and to make
merging alias sets extremely efficient (the linked list merge is constant time).
</p>
<p>You shouldn't need to understand these details if you are just a client of
the AliasSetTracker, but if you look at the code, hopefully this brief
description will help make sense of why things are designed the way they
are.</p>
</div>
<!-- ======================================================================= --> <!-- ======================================================================= -->
<div class="doc_subsection"> <div class="doc_subsection">
<a name="direct">Using the AliasAnalysis interface directly</a> <a name="direct">Using the AliasAnalysis interface directly</a>
@@ -479,7 +506,7 @@ printed.</p>
<hr> <hr>
<address> <address>
<a href="http://jigsaw.w3.org/css-validator/"><img <a href="http://jigsaw.w3.org/css-validator/check/referer"><img
src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a> src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a>
<a href="http://validator.w3.org/check/referer"><img <a href="http://validator.w3.org/check/referer"><img
src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /></a> src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /></a>

View File

@@ -14,6 +14,7 @@
<ol> <ol>
<li><a href="#cautionarynote">A Cautionary Note</a> <li><a href="#cautionarynote">A Cautionary Note</a>
<li><a href="#instructions">Instructions</a> <li><a href="#instructions">Instructions</a>
<li><a href="#license">License Information</a>
</ol> </ol>
<div class="doc_text"> <div class="doc_text">
@@ -88,6 +89,8 @@ process, and you should <b>only</b> try to do it if:</p>
<p> <p>
<b>Linux/x86:</b> <b>Linux/x86:</b>
<br>
<b>MacOS X/PowerPC:</b>
</p> </p>
<pre> <pre>
@@ -100,18 +103,22 @@ process, and you should <b>only</b> try to do it if:</p>
</pre> </pre>
<p> <p>
<b>Solaris/Sparc:</b> <b>Solaris/SPARC:</b>
</p> </p>
<p> <p>
For Solaris/Sparc, LLVM only supports SparcV9. Therefore, the configure For Solaris/SPARC, LLVM only supports the SPARC V9. Therefore, the
command line should like something like this: 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> </p>
<pre> <pre>
% cd build % cd build
% ../src/configure --prefix=$CFEINSTALL --disable-threads --disable-nls --disable-shared \ % ../src/configure --prefix=$CFEINSTALL --disable-threads --disable-nls \
--enable-languages=c,c++ --host=sparcv9-sun-solaris2.8 --disable-shared --enable-languages=c,c++ --host=sparcv9-sun-solaris2.8 \
--disable-c-mbchar
% gmake all-gcc % gmake all-gcc
% setenv LLVM_LIB_SEARCH_PATH `pwd`/gcc % setenv LLVM_LIB_SEARCH_PATH `pwd`/gcc
% gmake all; gmake install % gmake all; gmake install
@@ -180,7 +187,7 @@ libgcc.a library, which you can find by running
<pre> <pre>
% gmake -C runtime % gmake -C runtime
% mkdir $CFEINSTALL/bytecode-libs % mkdir $CFEINSTALL/bytecode-libs
% gmake -C runtime install % gmake -C runtime install-bytecode
% setenv LLVM_LIB_SEARCH_PATH $CFEINSTALL/bytecode-libs % setenv LLVM_LIB_SEARCH_PATH $CFEINSTALL/bytecode-libs
</pre></li> </pre></li>
@@ -196,6 +203,68 @@ following means:</p>
</ol> </ol>
</div> </div>
<!-- *********************************************************************** -->
<div class="doc_section">
<a name="license">License Information</a>
</div>
<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> <hr>

View File

@@ -35,6 +35,29 @@ language.
Print a summary of command line options. Print a summary of command line options.
<p> <p>
<li> -q
<br>
Quiet mode. With this option, analysis pass names are not printed.
<p>
<li> -load &lt;plugin&gt;
<br>
Load the specified dynamic object with name <tt>plugin</tt>. 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 <tt>plugin</tt>. Use
'<tt><tt>analyze</tt> -load &lt;plugin&gt; -help</tt>' to see the new
list of available analysis passes.
<p>
<li> -profile-info-file &lt;filename&gt;
<br>
Specify the name of the file loaded by the -profile-loader option.
<p>
<li> -stats <li> -stats
<br> <br>
Print statistics. Print statistics.
@@ -45,24 +68,6 @@ language.
Record the amount of time needed for each pass and print it to standard Record the amount of time needed for each pass and print it to standard
error. error.
<p> <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> </ul>
<h3>EXIT STATUS</h3> <h3>EXIT STATUS</h3>

View File

@@ -47,43 +47,43 @@ any of the passes crash, or if they produce malformed output,
<tt>bugpoint</tt> starts the <a href="#crashdebug">crash debugger</a>.<p> <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 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 specified, <tt>bugpoint</tt> runs the test program with the C backend (which is
is assumed to generate good code) to generate a reference output. Once assumed to generate good code) to generate a reference output. Once
<tt>bugpoint</tt> has a reference output for the test program, it tries <tt>bugpoint</tt> has a reference output for the test program, it tries
executing it executing it with the <a href="#opt_run-">selected</a> code generator. If the
with the <a href="#opt_run-">selected</a> code generator. If selected code generator crashes, <tt>bugpoint</tt> starts the <a
the resulting output differs from the reference output, it assumes the href="#crashdebug">crash debugger</a> on the code generator. Otherwise, if the
difference resulted from a code generator failure, and starts the resulting output differs from the reference output, it assumes the difference
<a href="#codegendebug">code generator debugger</a>.<p> 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 Finally, if the output of the selected code generator matches the reference
have been applied to it. If its output differs from the reference output, output, <tt>bugpoint</tt> runs the test program after all of the LLVM passes
it assumes the difference resulted from a failure in one of the LLVM passes, have been applied to it. If its output differs from the reference output, it
and enters the assumes the difference resulted from a failure in one of the LLVM passes, and
<a href="#miscompilationdebug">miscompilation debugger</a>. Otherwise, enters the <a href="#miscompilationdebug">miscompilation
there is no problem <tt>bugpoint</tt> can debug.<p> debugger</a>. Otherwise, there is no problem <tt>bugpoint</tt> can debug.<p>
<a name="crashdebug"> <a name="crashdebug">
<h4>Crash debugger</h4> <h4>Crash debugger</h4>
If an optimizer crashes, <tt>bugpoint</tt> will try as hard as it can to If an optimizer or code generator crashes, <tt>bugpoint</tt> will try as hard as
reduce the list of passes and the size of the test program. First, it can to reduce the list of passes (for optimizer crashes) and the size of the
<tt>bugpoint</tt> figures out which combination of passes triggers the bug. This test program. First, <tt>bugpoint</tt> figures out which combination of
is useful when debugging a problem exposed by <tt>gccas</tt>, for example, optimizer passes triggers the bug. This is useful when debugging a problem
because it runs over 25 optimizations.<p> exposed by <tt>gccas</tt>, for example, because it runs over 25
optimizations.<p>
Next, <tt>bugpoint</tt> tries removing functions from the test program, to Next, <tt>bugpoint</tt> tries removing functions from the test program, to
reduce its reduce its size. Usually it is able to reduce a test program to a single
size. Usually it is able to reduce a test program function, when debugging intraprocedural optimizations. Once the number of
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 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, 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 <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 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 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 reproduce the failure with <tt><a href="opt.html">opt</a></tt>, <tt><a
<tt><a href="analyze.html">analyze</a></tt>.<p> href="analyze.html">analyze</a></tt>, or <tt><a href="llc.html">llc</a></tt>.<p>
<a name="codegendebug"> <a name="codegendebug">
<h4>Code generator debugger</h4> <h4>Code generator debugger</h4>
@@ -153,13 +153,18 @@ non-obvious ways. Here are some hints and tips:<p>
you might try <tt>llvm-link -v</tt> on the same set of input files. If 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. 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> </ol>
<h3>OPTIONS</h3> <h3>OPTIONS</h3>
<ul> <ul>
<li><tt>-additional-so &lt;library.so&gt;</tt><br> <li><tt>-additional-so &lt;library&gt;</tt><br>
Load <tt>&lt;library.so&gt;</tt> into the test program whenever it is run. 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 This is useful if you are debugging programs which depend on non-LLVM
libraries (such as the X or curses libraries) to run.<p> libraries (such as the X or curses libraries) to run.<p>
@@ -175,12 +180,26 @@ non-obvious ways. Here are some hints and tips:<p>
part of the <tt>-args</tt> option, not as options to <tt>bugpoint</tt> part of the <tt>-args</tt> option, not as options to <tt>bugpoint</tt>
itself.<p> itself.<p>
<li><tt>-disable-{adce,dce,simplifycfg}</tt><br> <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 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 test program. By default, <tt>bugpoint</tt> uses these passes internally
when attempting to reduce test programs. If you're trying to find when attempting to reduce test programs. If you're trying to find
a bug in one of these passes, <tt>bugpoint</tt> may crash.<p> a bug in one of these passes, <tt>bugpoint</tt> may crash.<p>
<li><tt>-enable-correct-eh-support</tt><br>
Make the -lowerinvoke pass insert expensive, but correct, exception
handling code.<p>
<li><tt>-internalize-public-api-file &lt;filename&gt;</tt><br>
Preserve the symbols listed in the file <tt>filename</tt>.<p>
<li><tt>-internalize-public-api-list &lt;list&gt;</tt><br>
Preserve the symbols listed in <tt>list</tt>.<p>
<li> <tt>-help</tt><br> <li> <tt>-help</tt><br>
Print a summary of command line options.<p> Print a summary of command line options.<p>
@@ -189,14 +208,14 @@ non-obvious ways. Here are some hints and tips:<p>
test program, whenever it runs, to come from that file. test program, whenever it runs, to come from that file.
<p> <p>
<a name="opt_load"><li> <tt>-load &lt;plugin.so&gt;</tt><br> <a name="opt_load"><li> <tt>-load &lt;plugin&gt;</tt><br>
Load the dynamic object <tt>&lt;plugin.so&gt;</tt> into <tt>bugpoint</tt> Load the dynamic object <tt>&lt;plugin&gt;</tt> into <tt>bugpoint</tt>
itself. This object should register new itself. This object should register new
optimization passes. Once loaded, the object will add new command line optimization passes. Once loaded, the object will add new command line
options to enable various optimizations. To see the new complete list options to enable various optimizations. To see the new complete list
of optimizations, use the -help and -load options together: of optimizations, use the -help and -load options together:
<p> <p>
<tt>bugpoint -load &lt;plugin.so&gt; -help</tt> <tt>bugpoint -load &lt;plugin&gt; -help</tt>
<p> <p>
<a name="opt_output"><li><tt>-output &lt;filename&gt;</tt><br> <a name="opt_output"><li><tt>-output &lt;filename&gt;</tt><br>
@@ -206,6 +225,9 @@ non-obvious ways. Here are some hints and tips:<p>
<tt>bugpoint</tt> will attempt to generate a reference output by <tt>bugpoint</tt> will attempt to generate a reference output by
compiling the program with the C backend and running it.<p> 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> <a name="opt_run-"><li><tt>-run-{int,jit,llc,cbe}</tt><br>
Whenever the test program is compiled, <tt>bugpoint</tt> should generate Whenever the test program is compiled, <tt>bugpoint</tt> should generate
code for it using the specified code generator. These options allow code for it using the specified code generator. These options allow

View File

@@ -35,11 +35,17 @@ unused types.
The <tt>extract</tt> command reads its input from standard input if filename is 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. omitted or if filename is -. The output is always written to standard output.
<h3> <h3>OPTIONS</h3>
OPTIONS
</h3>
<ul> <ul>
<ul>
<li> -f
<br>
Force overwrite. Normally, <tt>extract</tt> will refuse to overwrite an
output file that already exists. With this option, <tt>extract</tt>
will overwrite the output file and replace it with new bytecode.
<p>
<li>-func &lt;function&gt; <li>-func &lt;function&gt;
<br> <br>
Extract the specified function from the LLVM bytecode. Extract the specified function from the LLVM bytecode.
@@ -49,6 +55,23 @@ OPTIONS
<br> <br>
Print a summary of command line options. Print a summary of command line options.
<p> <p>
<li> -o &lt;filename&gt;
<br>
Specify the output filename. If filename is "-" (the default), then
<tt>extract</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> </ul>
<h3> <h3>

View File

@@ -44,6 +44,17 @@ OPTIONS
Disable the inlining pass. By default, it is enabled. Disable the inlining pass. By default, it is enabled.
<p> <p>
<li> -disable-opt
<br>
Disable all assemble-time optimization passes.
<p>
<li>-enable-correct-eh-support
<br>
Instruct the -lowerinvoke pass to insert code for correct exception handling
support. This is expensive and is by default omitted for efficiency.
<p>
<li> -stats <li> -stats
<br> <br>
Print statistics. Print statistics.

View File

@@ -32,24 +32,35 @@ optimizations on the program.
<h4>Search Order</h4> <h4>Search Order</h4>
<p>
When looking for objects specified on the command line, <tt>gccld</tt> will 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 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 specified by the <tt>LLVM_LIB_SEARCH_PATH</tt> environment variable. If it
cannot find the object, it fails. cannot find the object, it fails.
<p> </p>
<p>
When looking for a library specified with the -l option, <tt>gccld</tt> first 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 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 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 lib&lt;library&gt;.&lt;shared library extension&gt;, in that order, in each
search path with the -L option. These directories are searched in order they directory added to the library search path with the -L option. These
directories are searched in the order they
were specified. If the library cannot be located, then <tt>gccld</tt> looks in 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 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. variable. If it does not find a library there, it fails.
</p>
<p>
The shared library extension is usually <tt>.so</tt>, but it may differ
depending upon the system.
</p>
<p>
The -L option is global. It does not matter where it is specified in the list 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 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. is applied to all libraries, preceding or succeeding, in the command line.
</p>
<h4>Link order</h4> <h4>Link order</h4>
@@ -106,6 +117,11 @@ using the -native option.
Disable all link-time optimization passes. Disable all link-time optimization passes.
<p> <p>
<li> -disable-inlining
<br>
Do not run the inliner pass.
<p>
<li> -L=&lt;directory&gt; <li> -L=&lt;directory&gt;
<br> <br>
Add directory to the list of directories to search when looking for Add directory to the list of directories to search when looking for
@@ -131,9 +147,9 @@ using the -native option.
<br> <br>
Specify libraries to include when linking the output file. When Specify libraries to include when linking the output file. When
linking, <tt>gccld</tt> will first attempt to load a file with the linking, <tt>gccld</tt> will first attempt to load a file with the
pathname library. If that fails, it will then attempt to load pathname <tt>library</tt>. 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, lib&lt;library&gt;.bc, lib&lt;library&gt;.a, and
in that order. lib&lt;library&gt;.&lt;shared library extension&gt;, in that order.
<p> <p>
<li> -link-as-library <li> -link-as-library

View File

@@ -90,11 +90,14 @@ OPTIONS
architectures are: architectures are:
<dl compact> <dl compact>
<di> x86 <dt> x86 </dt>
<dd>IA-32 (Pentium and above)</dd> <dd>IA-32 (Pentium and above)</dd>
<di> sparc <dt> sparcv9 </dt>
<dd>SPARC V9</dd> <dd>SPARC V9</dd>
<dt> c </dt>
<dd>Emit C code</dd>
</dl> </dl>
<p> <p>
@@ -103,6 +106,12 @@ OPTIONS
Specify the output filename. Specify the output filename.
<p> <p>
<li>-enable-correct-eh-support
<br>
Instruct the -lowerinvoke pass to insert code for correct exception handling
support. This is expensive and is by default omitted for efficiency.
<p>
<li> -help <li> -help
<br> <br>
Print a summary of command line options. Print a summary of command line options.
@@ -139,16 +148,34 @@ OPTIONS
<li>-regalloc=&lt;ra&gt; <li>-regalloc=&lt;ra&gt;
<br> <br>
Specify the register allocator to use. The default is <i>simple</i>. Specify the register allocator to use. The default is <i>local</i>.
Valid register allocators are: Valid register allocators are:
<p>
<dl compact> <dl compact>
<di> simple <dt> simple </dt>
<dd>Very simple register allocator</dd> <dd>Very simple register allocator</dd>
<di> local <dt> local </dt>
<dd>Local register allocator</dd> <dd>Local register allocator</dd>
<dt> linearscan </dt>
<dd>Linear scan global register allocator (experimental)</dd>
</dl> </dl>
<li>-spiller=&lt;sp&gt;
<br>
Specify the spiller to use for register allocators that support it.
Currently this option is used by the linear scan register
allocator. The default is <i>local</i>.
Valid spillers are:
<p> <p>
<dl compact>
<dt> simple </dt>
<dd>Simple spiller</dd>
<dt> local </dt>
<dd>Local spiller</dd>
</dl>
</ul> </ul>
@@ -159,11 +186,6 @@ OPTIONS
Disable peephole optimization pass. Disable peephole optimization pass.
<p> <p>
<li>-disable-preopt
<br>
Disable optimizations prior to instruction selection.
<p>
<li>-disable-sched <li>-disable-sched
<br> <br>
Disable local scheduling pass. Disable local scheduling pass.

View File

@@ -53,11 +53,6 @@ The default output file for <tt>llvm-dis</tt> is determined by the following log
readable format. This is the default behavior. readable format. This is the default behavior.
<p> <p>
<li> -c
<br>
Instruct <tt>llvm-dis</tt> to generate C source code.
<p>
<li> -f <li> -f
<br> <br>
Force overwrite. Normally, <tt>llvm-dis</tt> will refuse to overwrite Force overwrite. Normally, <tt>llvm-dis</tt> will refuse to overwrite

View File

@@ -10,18 +10,19 @@
<tt>llvm-prof</tt> <tt>llvm-prof</tt>
<h3>SYNOPSIS</h3> <h3>SYNOPSIS</h3>
<tt>llvm-prof [options] [bytecode file] [LLVM passes]</tt> <tt>llvm-prof [options] [bytecode file] [llvmprof.out]</tt>
<h3>DESCRIPTION</h3> <h3>DESCRIPTION</h3>
The <tt>llvm-prof</tt> tool reads in an '<tt>llvmprof.out</tt>' file, a bytecode The <tt>llvm-prof</tt> tool reads in an '<tt>llvmprof.out</tt>' file (which can
file for the program, and produces a human readable report, suitable for optionally use a specific file with the third program argument), a bytecode file
determining where the program hotspots are.<p> for the program, and produces a human readable report, suitable for determining
where the program hotspots are.<p>
This program is often used in conjunction with the <tt>utils/profile.sh</tt> This program is often used in conjunction with the <tt>utils/profile.pl</tt>
script. This script automatically instruments a program, runs it with the JIT, script. This script automatically instruments a program, runs it with the JIT,
then runs <tt>llvm-prof</tt> to format a report. To get more information about then runs <tt>llvm-prof</tt> to format a report. To get more information about
<tt>utils/profile.sh</tt>, execute it with the <tt>--help</tt> option.<p> <tt>utils/profile.pl</tt>, execute it with the <tt>--help</tt> option.<p>
<h3>OPTIONS</h3> <h3>OPTIONS</h3>
@@ -29,7 +30,7 @@ then runs <tt>llvm-prof</tt> to format a report. To get more information about
<li><tt>--annotated-llvm</tt> or <tt>-A</tt><br> <li><tt>--annotated-llvm</tt> or <tt>-A</tt><br>
In addition to the normal report printed, print out the code for the In addition to the normal report printed, print out the code for the
program, annotated we execution frequency information. This can be program, annotated with execution frequency information. This can be
particularly useful when trying to visualize how frequently basic blocks particularly useful when trying to visualize how frequently basic blocks
are executed. This is most useful with basic block profiling are executed. This is most useful with basic block profiling
information or better.<p> information or better.<p>
@@ -39,12 +40,17 @@ then runs <tt>llvm-prof</tt> to format a report. To get more information about
Using this option enables the <tt>--annotated-llvm</tt> option, but it Using this option enables the <tt>--annotated-llvm</tt> option, but it
prints the entire module, instead of just the most commonly executed prints the entire module, instead of just the most commonly executed
functions.<p> functions.<p>
<li><tt>-time-passes</tt><br>
Record the amount of time needed for each pass and print it to standard
error.
</ul> </ul>
<h3>EXIT STATUS</h3> <h3>EXIT STATUS</h3>
<tt>llvm-prof</tt> returns 1 if it cannot load the bytecode file or the profile <tt>llvm-prof</tt> returns 1 if it cannot load the bytecode file or the profile
information, otherwise it exits with zero. information. Otherwise, it exits with zero.
<HR> <HR>
Maintained by the <a href="http://llvm.cs.uiuc.edu">LLVM Team</a>. Maintained by the <a href="http://llvm.cs.uiuc.edu">LLVM Team</a>.

View File

@@ -53,6 +53,11 @@ writes its output to the standard output.
Specify the output filename. Specify the output filename.
<p> <p>
<li> -profile-info-file &lt;filename&gt;
<br>
Specify the name of the file loaded by the -profile-loader option.
<p>
<li> -stats <li> -stats
<br> <br>
Print statistics. Print statistics.
@@ -88,14 +93,14 @@ writes its output to the standard output.
Quiet mode. Do not print messages on whether the program was modified. Quiet mode. Do not print messages on whether the program was modified.
<p> <p>
<li> -load &lt;plugin.so&gt; <li> -load &lt;plugin&gt;
<br> <br>
Load the dynamic object &lt;plugin.so&gt;. This object should register new Load the dynamic object &lt;plugin&gt;. This object should register new
optimization passes. Once loaded, the object will add new command line optimization passes. Once loaded, the object will add new command line
options to enable various optimizations. To see the new complete list options to enable various optimizations. To see the new complete list
of optimizations, use the -help and -load options together: of optimizations, use the -help and -load options together:
<p> <p>
<tt>opt -load &lt;plugin.so&gt; -help</tt> <tt>opt -load &lt;plugin&gt; -help</tt>
<p> <p>
<li> -p <li> -p

View File

@@ -48,7 +48,9 @@
errors.</li> errors.</li>
<li>I've built LLVM and am testing it, but the tests freeze.</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>Why do test results differ when I perform different types of builds?</li>
<li>Compiling LLVM with GCC 3.3 on SuSE 9 fails, what should I do?</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> </ol></li>
<li><a href="#cfe">Using the GCC Front End</a> <li><a href="#cfe">Using the GCC Front End</a>
@@ -70,6 +72,7 @@
<ol> <ol>
<li>What is this <tt>__main()</tt> call that gets inserted into <li>What is this <tt>__main()</tt> call that gets inserted into
<tt>main()</tt>?</li> <tt>main()</tt>?</li>
<li>Where did all of my code go??</li>
</ol> </ol>
</li> </li>
</ol> </ol>
@@ -110,7 +113,7 @@ Source Initiative (OSI).</p>
<div class="answer"> <div class="answer">
<p>Yes. The modified source distribution must retain the copyright notice and <p>Yes. The modified source distribution must retain the copyright notice and
follow the three bulletted conditions listed in the <a follow the three bulletted conditions listed in the <a
href="http://llvm.cs.uiuc.edu/releases/1.0/LICENSE.TXT">LLVM license</a>.</p> href="http://llvm.cs.uiuc.edu/releases/1.2/LICENSE.TXT">LLVM license</a>.</p>
</div> </div>
<div class="question"> <div class="question">
@@ -329,12 +332,37 @@ build.</p>
</div> </div>
<div class="question"> <div class="question">
<p>Compiling LLVM with GCC 3.3 on SuSE 9 fails, what should I do?</p> <p>Compiling LLVM with GCC 3.3.2 fails, what should I do?</p>
</div> </div>
<div class="answer"> <div class="answer">
<p>This is a bug in the customized version of GCC shipped with SuSE, and affects <p>This is <a href="http://gcc.gnu.org/PR?13392">a bug in GCC</a>, and
projects other than LLVM. Complain loudly to SuSE. :)</p> 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>
<!-- *********************************************************************** --> <!-- *********************************************************************** -->
@@ -387,13 +415,13 @@ not linking on your system because the feature isn't available on your system.
<div class="question"> <div class="question">
<p> <p>
When I compile code using the LLVM GCC front end, it complains that it cannot When I compile code using the LLVM GCC front end, it complains that it cannot
find crtend.o. find libcrtend.a.
</p> </p>
</div> </div>
<div class="answer"> <div class="answer">
<p> <p>
In order to find crtend.o, you must have the directory in which it lives in 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 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 the LLVM GCC front end, this will be the full path of the bytecode-libs
directory inside of the LLVM GCC distribution. directory inside of the LLVM GCC distribution.
@@ -406,11 +434,9 @@ directory inside of the LLVM GCC distribution.
<a name="cfe_code">Questions about code generated by the GCC front-end</a> <a name="cfe_code">Questions about code generated by the GCC front-end</a>
</div> </div>
<div class="question"> <div class="question"><p>
<p>
What is this <tt>__main()</tt> call that gets inserted into <tt>main()</tt>? What is this <tt>__main()</tt> call that gets inserted into <tt>main()</tt>?
</p> </p></div>
</div>
<div class="answer"> <div class="answer">
<p> <p>
@@ -426,10 +452,29 @@ The actual implementation of <tt>__main</tt> lives in the
<tt>llvm/runtime/GCCLibraries/crtend/</tt> directory in the source-base, and is <tt>llvm/runtime/GCCLibraries/crtend/</tt> directory in the source-base, and is
linked in automatically when you link the program. linked in automatically when you link the program.
</p> </p>
</div> </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>
<!-- *********************************************************************** --> <!-- *********************************************************************** -->
<!-- *********************************************************************** --> <!-- *********************************************************************** -->

View File

@@ -96,8 +96,8 @@ from the LLVM suite.</p>
<ol> <ol>
<li><tt>cd <i>where-you-want-the-C-front-end-to-live</i></tt> <li><tt>cd <i>where-you-want-the-C-front-end-to-live</i></tt>
<li><tt>gunzip --stdout cfrontend.<i>platform</i>.tar.gz | tar -xvf -</tt> <li><tt>gunzip --stdout cfrontend.<i>platform</i>.tar.gz | tar -xvf -</tt>
<li><b>Sparc Only:</b><br> <li><b>Sparc and MacOS X Only:</b><br>
<tt>cd cfrontend/sparc<br> <tt>cd cfrontend/<i>platform</i><br>
./fixheaders</tt> ./fixheaders</tt>
</ol></li> </ol></li>
@@ -106,7 +106,7 @@ from the LLVM suite.</p>
<li>With the distributed files: <li>With the distributed files:
<ol> <ol>
<li><tt>cd <i>where-you-want-llvm-to-live</i></tt> <li><tt>cd <i>where-you-want-llvm-to-live</i></tt>
<li><tt>gunzip --stdout llvm.tar.gz | tar -xvf -</tt> <li><tt>gunzip --stdout llvm-<i>version</i>.tar.gz | tar -xvf -</tt>
<li><tt>cd llvm</tt> <li><tt>cd llvm</tt>
</ol></li> </ol></li>
@@ -129,7 +129,8 @@ from the LLVM suite.</p>
header files for the default platform. Useful options include: header files for the default platform. Useful options include:
<ul> <ul>
<li><tt>--with-llvmgccdir=<i>directory</i></tt> <li><tt>--with-llvmgccdir=<i>directory</i></tt>
<p>Specify where the LLVM GCC frontend is installed.</p></li> <p>Specify the full pathname of where the LLVM GCC frontend is
installed.</p></li>
<li><tt>--enable-spec2000=<i>directory</i></tt> <li><tt>--enable-spec2000=<i>directory</i></tt>
<p>Enable the SPEC2000 benchmarks for testing. The SPEC2000 <p>Enable the SPEC2000 benchmarks for testing. The SPEC2000
benchmarks should be available in benchmarks should be available in
@@ -181,24 +182,49 @@ software you will need.</p>
<li>Linux on x86 (Pentium and above) <li>Linux on x86 (Pentium and above)
<ul> <ul>
<li>Approximately 760 MB of Free Disk Space <li>Approximately 1.02 GB of Free Disk Space
<ul> <ul>
<li>Source code: 30 MB</li> <li>Source code: 45 MB</li>
<li>Object code: 670 MB</li> <li>Object code: 956 MB</li>
<li>GCC front end: 60 MB</li> <li>GCC front end: 40 MB</li>
</ul></li>
</ul></li> </ul></li>
</ul>
</li>
<li>Solaris on SparcV9 (Ultrasparc) <li>Solaris on SparcV9 (Ultrasparc)
<ul> <ul>
<li>Approximately 1.24 GB of Free Disk Space <li>Approximately 1.75 GB of Free Disk Space
<ul> <ul>
<li>Source code: 30 MB</li> <li>Source code: 45 MB</li>
<li>Object code: 1000 MB</li> <li>Object code: 1705 MB</li>
<li>GCC front end: 210 MB</li> <li>GCC front end: 50 MB</li>
</ul></li>
</ul></li> </ul></li>
</ul>
</li>
<li>FreeBSD on x86 (Pentium and above)
<ul>
<li>Approximately 935 MB of Free Disk Space
<ul>
<li>Source code: 45 MB</li>
<li>Object code: 850 MB</li>
<li>GCC front end: 40 MB</li>
</ul></li>
</ul>
</li>
<li>MacOS X on PowerPC
<ul>
<li>No native code generation
<li>Approximately 1.25 GB of Free Disk Space
<ul>
<li>Source code: 45 MB</li>
<li>Object code: 1160 MB</li>
<li>GCC front end: 40 MB</li>
</ul></li>
</ul>
</li>
</ul> </ul>
<p>The LLVM suite <i>may</i> compile on other platforms, but it is not <p>The LLVM suite <i>may</i> compile on other platforms, but it is not
@@ -238,21 +264,36 @@ installed:</p>
LLVM:</p> LLVM:</p>
<ul> <ul>
<li><A href="http://www.gnu.org/software/autoconf">GNU Autoconf</A> <li><A href="http://www.gnu.org/software/automake">GNU Automake</A></li>
<li><A href="http://www.gnu.org/software/autoconf">GNU Autoconf</A></li>
<li><A href="http://savannah.gnu.org/projects/m4">GNU M4</A> <li><A href="http://savannah.gnu.org/projects/m4">GNU M4</A>
<p>If you want to make changes to the configure scripts, you will need GNU <p>If you want to make changes to the configure scripts, you will need GNU
autoconf (2.57 or higher), and consequently, GNU M4 (version 1.4 or autoconf (2.57 or higher), and consequently, GNU M4 (version 1.4 or
higher).</p></li> higher). You will also need automake. Any old version of
automake from 1.4p5 on should work; we only use aclocal from that
package.</p></li>
<li><A href="http://www.codesourcery.com/qm/qmtest">QMTest</A></li> <li><A href="http://www.codesourcery.com/qm/qmtest">QMTest 2.0.3</A></li>
<li><A href="http://www.python.org">Python</A> <li><A href="http://www.python.org">Python</A>
<p>These are needed to use the LLVM test suite.</p></li> <p>
These are needed to use the LLVM test suite. Please note that newer
versions of QMTest may not work with the LLVM test suite. QMTest 2.0.3
can be retrieved from the QMTest CVS repository using the following
commands:
<ul>
<li><tt>cvs -d :pserver:anoncvs@cvs.codesourcery.com:/home/qm/Repository login</tt>
</li>
<li>When prompted, use <tt>anoncvs</tt> as the password.
</li>
<li><tt>cvs -d :pserver:anoncvs@cvs.codesourcery.com:/home/qm/Repository co -r release-2-0-3 qm</tt>
</li>
</ul>
</p></li>
</ul> </ul>
<p>The remainder of this guide is meant to get you up and running with <p>The remainder of this guide is meant to get you up and running with
LLVM and to give you some basic information about the LLVM environment. LLVM and to give you some basic information about the LLVM environment.
A <a href="#starting">complete guide to installation</a> is provided in the A <a href="#starting">complete guide to installation</a> is provided in the
@@ -286,7 +327,7 @@ of this document below</i>. In any of the examples below, simply replace
each of these names with the appropriate pathname on your local system. each of these names with the appropriate pathname on your local system.
All these paths are absolute:</p> All these paths are absolute:</p>
<dl compact> <dl>
<dt>SRC_ROOT <dt>SRC_ROOT
<dd> <dd>
This is the top level directory of the LLVM source tree. This is the top level directory of the LLVM source tree.
@@ -322,7 +363,7 @@ variables. There are also some shell aliases which you may find useful.
You can set these on the command line, or better yet, set them in your You can set these on the command line, or better yet, set them in your
<tt>.cshrc</tt> or <tt>.profile</tt>. <tt>.cshrc</tt> or <tt>.profile</tt>.
<dl compact> <dl>
<dt><tt>LLVM_LIB_SEARCH_PATH</tt>=<tt><i>LLVMGCCDIR</i>/bytecode-libs</tt> <dt><tt>LLVM_LIB_SEARCH_PATH</tt>=<tt><i>LLVMGCCDIR</i>/bytecode-libs</tt>
<dd> <dd>
This environment variable helps the LLVM GCC front end find bytecode This environment variable helps the LLVM GCC front end find bytecode
@@ -340,36 +381,45 @@ You can set these on the command line, or better yet, set them in your
<!-- ======================================================================= --> <!-- ======================================================================= -->
<div class="doc_subsection"> <div class="doc_subsection">
<a name="unpack">Unpacking the LLVM Archives</a></h3> <a name="unpack">Unpacking the LLVM Archives</a>
</div> </div>
<div class="doc_text"> <div class="doc_text">
<p> <p>
If you have the LLVM distribution, you will need to unpack it before you If you have the LLVM distribution, you will need to unpack it before you
can begin to compile it. LLVM is distributed as a set of three files. Each can begin to compile it. LLVM is distributed as a set of two files: the LLVM
suite and the LLVM GCC front end compiled for your platform. Each
file is a TAR archive that is compressed with the gzip program. file is a TAR archive that is compressed with the gzip program.
</p> </p>
<p> The three files are as follows: <p> The files are as follows:
<dl compact> <dl>
<dt>llvm.tar.gz <dt>llvm-1.2.tar.gz
<dd>This is the source code to the LLVM suite. <dd>This is the source code to the LLVM suite.
<p> <p>
<dt>cfrontend.sparc.tar.gz <dt>cfrontend-1.2.sparc-sun-solaris2.8.tar.gz
<dd>This is the binary release of the GCC front end for Solaris/Sparc. <dd>This is the binary release of the GCC front end for Solaris/Sparc.
<p> <p>
<dt>cfrontend.x86.tar.gz <dt>cfrontend-1.2.i686-redhat-linux-gnu.tar.gz
<dd>This is the binary release of the GCC front end for Linux/x86. <dd>This is the binary release of the GCC front end for Linux/x86.
<p>
<dt>cfrontend-1.2.i386-unknown-freebsd5.1.tar.gz
<dd>This is the binary release of the GCC front end for FreeBSD/x86.
<p>
<dt>cfrontend-1.2.powerpc-apple-darwin7.0.0.tar.gz
<dd>This is the binary release of the GCC front end for MacOS X/PPC.
</dl> </dl>
</div> </div>
<!-- ======================================================================= --> <!-- ======================================================================= -->
<div class="doc_subsection"> <div class="doc_subsection">
<a name="checkout">Checkout LLVM from CVS</a></h3> <a name="checkout">Checkout LLVM from CVS</a>
</div> </div>
<div class="doc_text"> <div class="doc_text">
@@ -390,14 +440,38 @@ follows:</p>
directory and fully populate it with the LLVM source code, Makefiles, directory and fully populate it with the LLVM source code, Makefiles,
test directories, and local copies of documentation files.</p> test directories, and local copies of documentation files.</p>
<p>Note that the GCC front end is not included in the CVS repository. You <p>If you want to get a specific release (as opposed to the most recent
should have downloaded the binary distribution for your platform.</p> revision), you can specify a label. The following releases have the following
label:</p>
<ul>
<li>
Release 1.2: <b>RELEASE_12</b>
</li>
<li>
Release 1.1: <b>RELEASE_11</b>
</li>
<li>
Release 1.0: <b>RELEASE_1</b>
</li>
</ul>
<p>
If you would like to get the GCC front end source code, you can also get it
from the CVS repository:
<ul>
<li><tt>cvs -z3 -d :pserver:anon@llvm-cvs.cs.uiuc.edu:/var/cvs/llvm co
llvm-gcc</tt>
</ul>
</p>
</div> </div>
<!-- ======================================================================= --> <!-- ======================================================================= -->
<div class="doc_subsection"> <div class="doc_subsection">
<a name="installcf">Install the GCC Front End</a></h3> <a name="installcf">Install the GCC Front End</a>
</div> </div>
<div class="doc_text"> <div class="doc_text">
@@ -411,14 +485,14 @@ location must be specified when the LLVM suite is configured.</p>
<ol> <ol>
<li><tt>cd <i>where-you-want-the-front-end-to-live</i></tt></li> <li><tt>cd <i>where-you-want-the-front-end-to-live</i></tt></li>
<li><tt>gunzip --stdout cfrontend.<i>platform</i>.tar.gz | tar -xvf <li><tt>gunzip --stdout cfrontend-<i>version</i>.<i>platform</i>.tar.gz | tar -xvf
-</tt></li> -</tt></li>
</ol> </ol>
<p>If you are on a Sparc/Solaris machine, you will need to fix the header <p>If you are using Solaris/Sparc or MacOS X/PPC, you will need to fix the
files:</p> header files:</p>
<p><tt>cd cfrontend/sparc<br> <p><tt>cd cfrontend/<i>platform</i><br>
./fixheaders</tt></p> ./fixheaders</tt></p>
<p>The binary versions of the GCC front end may not suit all of your needs. For <p>The binary versions of the GCC front end may not suit all of your needs. For
@@ -442,7 +516,8 @@ not for the faint of heart, so be forewarned.</p>
<p>Once checked out from the CVS repository, the LLVM suite source code must be <p>Once checked out from the CVS repository, the LLVM suite source code must be
configured via the <tt>configure</tt> script. This script sets variables in configured via the <tt>configure</tt> script. This script sets variables in
<tt>llvm/Makefile.config</tt> and <tt>llvm/include/Config/config.h</tt>. It <tt>llvm/Makefile.config</tt> and <tt>llvm/include/Config/config.h</tt>. It
also populates <i>OBJ_ROOT</i> with the Makefiles needed to build LLVM.</p> also populates <i>OBJ_ROOT</i> with the Makefiles needed to begin building
LLVM.</p>
<p>The following environment variables are used by the <tt>configure</tt> <p>The following environment variables are used by the <tt>configure</tt>
script to configure the build system:</p> script to configure the build system:</p>
@@ -472,11 +547,12 @@ script to configure the build system:</p>
<p>The following options can be used to set or enable LLVM specific options:</p> <p>The following options can be used to set or enable LLVM specific options:</p>
<dl compact> <dl>
<dt><i>--with-llvmgccdir=LLVMGCCDIR</i> <dt><i>--with-llvmgccdir=LLVMGCCDIR</i>
<dd> <dd>
Path to the location where the LLVM C front end binaries and Path to the location where the LLVM GCC front end binaries and
associated libraries will be installed. associated libraries were installed. This must be specified as an
absolute pathname.
<p> <p>
<dt><i>--enable-optimized</i> <dt><i>--enable-optimized</i>
<dd> <dd>
@@ -486,7 +562,8 @@ script to configure the build system:</p>
<p> <p>
<dt><i>--enable-jit</i> <dt><i>--enable-jit</i>
<dd> <dd>
Compile the Just In Time (JIT) functionality. This is not available Compile the Just In Time (JIT) compiler functionality. This is not
available
on all platforms. The default is dependent on platform, so it is best on all platforms. The default is dependent on platform, so it is best
to explicitly enable it if you want it. to explicitly enable it if you want it.
<p> <p>
@@ -499,6 +576,19 @@ script to configure the build system:</p>
benchmarks. If <tt>directory</tt> is left unspecified, <tt>configure</tt> benchmarks. If <tt>directory</tt> is left unspecified, <tt>configure</tt>
uses the default value uses the default value
<tt>/home/vadve/shared/benchmarks/speccpu2000/benchspec</tt>. <tt>/home/vadve/shared/benchmarks/speccpu2000/benchspec</tt>.
<p>
<dt><i>--enable-spec95</i>
<dt><i>--enable-spec95=&lt;<tt>directory</tt>&gt;</i>
<dd>
Enable the use of SPEC95 when testing LLVM. It is similar to the
<i>--enable-spec2000</i> option.
<p>
<dt><i>--enable-povray</i>
<dt><i>--enable-povray=&lt;<tt>directory</tt>&gt;</i>
<dd>
Enable the use of Povray as an external test. Versions of Povray written
in C should work. This option is similar to the <i>--enable-spec2000</i>
option.
</dl> </dl>
<p>To configure LLVM, follow these steps:</p> <p>To configure LLVM, follow these steps:</p>
@@ -519,10 +609,10 @@ script to configure the build system:</p>
<tt>LLVM_LIB_SEARCH_PATH</tt> environment variable in your startup scripts. <tt>LLVM_LIB_SEARCH_PATH</tt> environment variable in your startup scripts.
This environment variable is used to locate "system" libraries like This environment variable is used to locate "system" libraries like
"<tt>-lc</tt>" and "<tt>-lm</tt>" when linking. This variable should be set to "<tt>-lc</tt>" and "<tt>-lm</tt>" when linking. This variable should be set to
the absolute path for the bytecode-libs subdirectory of the GCC front end the absolute path of the <tt>bytecode-libs</tt> subdirectory of the GCC front
install, or <i>LLVMGCCDIR</i>/bytecode-libs. For example, one might set end, or <i>LLVMGCCDIR</i>/<tt>bytecode-libs</tt>. For example, one might set
<tt>LLVM_LIB_SEARCH_PATH</tt> to <tt>LLVM_LIB_SEARCH_PATH</tt> to
<tt>/home/vadve/lattner/local/x86/llvm-gcc/bytecode-libs</tt> for the X86 <tt>/home/vadve/lattner/local/x86/llvm-gcc/bytecode-libs</tt> for the x86
version of the GCC front end on our research machines.</p> version of the GCC front end on our research machines.</p>
</div> </div>
@@ -537,7 +627,7 @@ version of the GCC front end on our research machines.</p>
<p>Once you have configured LLVM, you can build it. There are three types of <p>Once you have configured LLVM, you can build it. There are three types of
builds:</p> builds:</p>
<dl compact> <dl>
<dt>Debug Builds <dt>Debug Builds
<dd> <dd>
These builds are the default when one types <tt>gmake</tt> (unless the These builds are the default when one types <tt>gmake</tt> (unless the
@@ -577,7 +667,7 @@ command:</p>
<p>There are several special targets which are useful when working with the LLVM <p>There are several special targets which are useful when working with the LLVM
source code:</p> source code:</p>
<dl compact> <dl>
<dt><tt>gmake clean</tt> <dt><tt>gmake clean</tt>
<dd> <dd>
Removes all files generated by the build. This includes object files, Removes all files generated by the build. This includes object files,
@@ -604,7 +694,7 @@ source code:</p>
<p>It is also possible to override default values from <tt>configure</tt> by <p>It is also possible to override default values from <tt>configure</tt> by
declaring variables on the command line. The following are some examples:</p> declaring variables on the command line. The following are some examples:</p>
<dl compact> <dl>
<dt><tt>gmake ENABLE_OPTIMIZED=1</tt> <dt><tt>gmake ENABLE_OPTIMIZED=1</tt>
<dd> <dd>
Perform a Release (Optimized) build. Perform a Release (Optimized) build.
@@ -655,10 +745,10 @@ platforms or configurations using the same source tree.</p>
<p>The LLVM build will place files underneath <i>OBJ_ROOT</i> in directories <p>The LLVM build will place files underneath <i>OBJ_ROOT</i> in directories
named after the build type:</p> named after the build type:</p>
<dl compact> <dl>
<dt>Debug Builds <dt>Debug Builds
<dd> <dd>
<dl compact> <dl>
<dt>Tools <dt>Tools
<dd><tt><i>OBJ_ROOT</i>/tools/Debug</tt> <dd><tt><i>OBJ_ROOT</i>/tools/Debug</tt>
<dt>Libraries <dt>Libraries
@@ -668,7 +758,7 @@ named after the build type:</p>
<dt>Release Builds <dt>Release Builds
<dd> <dd>
<dl compact> <dl>
<dt>Tools <dt>Tools
<dd><tt><i>OBJ_ROOT</i>/tools/Release</tt> <dd><tt><i>OBJ_ROOT</i>/tools/Release</tt>
<dt>Libraries <dt>Libraries
@@ -678,7 +768,7 @@ named after the build type:</p>
<dt>Profile Builds <dt>Profile Builds
<dd> <dd>
<dl compact> <dl>
<dt>Tools <dt>Tools
<dd><tt><i>OBJ_ROOT</i>/tools/Profile</tt> <dd><tt><i>OBJ_ROOT</i>/tools/Profile</tt>
<dt>Libraries <dt>Libraries
@@ -697,7 +787,7 @@ named after the build type:</p>
<div class="doc_text"> <div class="doc_text">
<p>One useful source of information about the LLVM source base is the LLVM <a <p>One useful source of information about the LLVM source base is the LLVM <a
href="http://www.doxygen.org">doxygen</a> documentation, available at <tt><a href="http://www.doxygen.org">doxygen</a> documentation available at <tt><a
href="http://llvm.cs.uiuc.edu/doxygen/">http://llvm.cs.uiuc.edu/doxygen/</a></tt>. href="http://llvm.cs.uiuc.edu/doxygen/">http://llvm.cs.uiuc.edu/doxygen/</a></tt>.
The following is a brief introduction to code layout:</p> The following is a brief introduction to code layout:</p>
@@ -756,7 +846,7 @@ library. The three main subdirectories of this directory are:</p>
almost all code exists in libraries, making it very easy to share code among the almost all code exists in libraries, making it very easy to share code among the
different <a href="#tools">tools</a>.</p> different <a href="#tools">tools</a>.</p>
<dl compact> <dl>
<dt><tt>llvm/lib/VMCore/</tt><dd> This directory holds the core LLVM <dt><tt>llvm/lib/VMCore/</tt><dd> This directory holds the core LLVM
source files that implement core classes like Instruction and BasicBlock. source files that implement core classes like Instruction and BasicBlock.
@@ -781,7 +871,7 @@ different <a href="#tools">tools</a>.</p>
<dt><tt>llvm/lib/Target/</tt><dd> This directory contains files that <dt><tt>llvm/lib/Target/</tt><dd> This directory contains files that
describe various target architectures for code generation. For example, describe various target architectures for code generation. For example,
the llvm/lib/Target/Sparc directory holds the Sparc machine the llvm/lib/Target/SparcV9 directory holds the Sparc machine
description.<br> description.<br>
<dt><tt>llvm/lib/CodeGen/</tt><dd> This directory contains the major parts <dt><tt>llvm/lib/CodeGen/</tt><dd> This directory contains the major parts
@@ -834,33 +924,30 @@ the LLVM infrastructure.</p>
<p>The <b>tools</b> directory contains the executables built out of the <p>The <b>tools</b> directory contains the executables built out of the
libraries above, which form the main part of the user interface. You can libraries above, which form the main part of the user interface. You can
always get help for a tool by typing <tt>tool_name --help</tt>. The always get help for a tool by typing <tt>tool_name --help</tt>. The
following is a brief introduction to the most important tools.</p> following is a brief introduction to the most important tools:</p>
<dl compact> <dl>
<dt> <dt><tt><b>analyze</b></tt> <dd><tt>analyze</tt> is used to run a specific
<dt><tt><b>analyze</b></tt><dd> <tt>analyze</tt> is used to run a specific
analysis on an input LLVM bytecode file and print out the results. It is analysis on an input LLVM bytecode file and print out the results. It is
primarily useful for debugging analyses, or familiarizing yourself with primarily useful for debugging analyses, or familiarizing yourself with
what an analysis does.<p> what an analysis does.<p>
<dt><tt><b>bugpoint</b></tt><dd> <tt>bugpoint</tt> is used to debug <dt><tt><b>bugpoint</b></tt> <dd><tt>bugpoint</tt> is used to debug
optimization passes or code generation backends by narrowing down the optimization passes or code generation backends by narrowing down the
given test case to the minimum number of passes and/or instructions that given test case to the minimum number of passes and/or instructions that
still cause a problem, whether it is a crash or miscompilation. See <a still cause a problem, whether it is a crash or miscompilation. See <a
href="HowToSubmitABug.html">HowToSubmitABug.html</a> for more information href="HowToSubmitABug.html">HowToSubmitABug.html</a> for more information
on using <tt>bugpoint</tt>.<p> on using <tt>bugpoint</tt>.<p>
<dt><tt><b>llvm-ar</b></tt><dd>The archiver produces an archive containing <dt><tt><b>llvm-ar</b></tt> <dd>The archiver produces an archive containing
the given LLVM bytecode files, optionally with an index for faster the given LLVM bytecode files, optionally with an index for faster
lookup.<p> lookup.<p>
<dt><tt><b>llvm-as</b></tt><dd>The assembler transforms the human readable <dt><tt><b>llvm-as</b></tt> <dd>The assembler transforms the human readable
LLVM assembly to LLVM bytecode.<p> LLVM assembly to LLVM bytecode.<p>
<dt><tt><b>llvm-dis</b></tt><dd>The disassembler transforms the LLVM <dt><tt><b>llvm-dis</b></tt><dd>The disassembler transforms the LLVM
bytecode to human readable LLVM assembly. Additionally, it can convert bytecode to human readable LLVM assembly.<p>
LLVM bytecode to C, which is enabled with the <tt>-c</tt> option.<p>
<dt><tt><b>llvm-link</b></tt><dd> <tt>llvm-link</tt>, not surprisingly, <dt><tt><b>llvm-link</b></tt><dd> <tt>llvm-link</tt>, not surprisingly,
links multiple LLVM modules into a single program.<p> links multiple LLVM modules into a single program.<p>
@@ -874,8 +961,9 @@ following is a brief introduction to the most important tools.</p>
functionality was compiled in), and will execute the code <i>much</i> functionality was compiled in), and will execute the code <i>much</i>
faster than the interpreter.<p> faster than the interpreter.<p>
<dt><tt><b>llc</b></tt><dd> <tt>llc</tt> is the LLVM backend compiler, <dt><tt><b>llc</b></tt><dd> <tt>llc</tt> is the LLVM backend compiler, which
which translates LLVM bytecode to a SPARC or x86 assembly file.<p> translates LLVM bytecode to a SPARC or x86 assembly file, or to C code (with
the -march=c option).<p>
<dt><tt><b>llvmgcc</b></tt><dd> <tt>llvmgcc</tt> is a GCC-based C frontend <dt><tt><b>llvmgcc</b></tt><dd> <tt>llvmgcc</tt> is a GCC-based C frontend
that has been retargeted to emit LLVM code as the machine code output. It that has been retargeted to emit LLVM code as the machine code output. It
@@ -884,8 +972,9 @@ following is a brief introduction to the most important tools.</p>
<tt>llvmgcc</tt> tool is currently not included in the LLVM CVS tree <tt>llvmgcc</tt> tool is currently not included in the LLVM CVS tree
because it is quite large and not very interesting.<p> because it is quite large and not very interesting.<p>
<ol> <blockquote>
<dt><tt><b>gccas</b></tt><dd> This tool is invoked by the <dl>
<dt><tt><b>gccas</b></tt> <dd>This tool is invoked by the
<tt>llvmgcc</tt> frontend as the "assembler" part of the compiler. This <tt>llvmgcc</tt> frontend as the "assembler" part of the compiler. This
tool actually assembles LLVM assembly to LLVM bytecode, tool actually assembles LLVM assembly to LLVM bytecode,
performs a variety of optimizations, and outputs LLVM bytecode. Thus performs a variety of optimizations, and outputs LLVM bytecode. Thus
@@ -897,19 +986,19 @@ following is a brief introduction to the most important tools.</p>
`<tt>as</tt>' utility so that the gcc frontend itself did not have to be `<tt>as</tt>' utility so that the gcc frontend itself did not have to be
modified to interface to a "weird" assembler.<p> modified to interface to a "weird" assembler.<p>
<dt><tt><b>gccld</b></tt><dd> <tt>gccld</tt> links together several LLVM <dt><tt><b>gccld</b></tt> <dd><tt>gccld</tt> links together several LLVM
bytecode files into one bytecode file and does some optimization. It is bytecode files into one bytecode file and does some optimization. It is
the linker invoked by the GCC frontend when multiple .o files need to be the linker invoked by the GCC frontend when multiple .o files need to be
linked together. Like <tt>gccas</tt>, the command line interface of linked together. Like <tt>gccas</tt>, the command line interface of
<tt>gccld</tt> is designed to match the system linker, to aid <tt>gccld</tt> is designed to match the system linker, to aid
interfacing with the GCC frontend.<p> interfacing with the GCC frontend.</dl><p>
</ol> </blockquote>
<dt><tt><b>opt</b></tt><dd> <tt>opt</tt> reads LLVM bytecode, applies a <dt><tt><b>opt</b></tt><dd> <tt>opt</tt> reads LLVM bytecode, applies a
series of LLVM to LLVM transformations (which are specified on the command series of LLVM to LLVM transformations (which are specified on the command
line), and then outputs the resultant bytecode. The '<tt>opt --help</tt>' line), and then outputs the resultant bytecode. The '<tt>opt --help</tt>'
command is a good way to get a list of the program transformations command is a good way to get a list of the program transformations
available in LLVM.<p> available in LLVM.
</dl> </dl>
@@ -926,19 +1015,19 @@ following is a brief introduction to the most important tools.</p>
of the utilities are actually required as part of the build process because they of the utilities are actually required as part of the build process because they
are code generators for parts of LLVM infrastructure.</p> are code generators for parts of LLVM infrastructure.</p>
<dl compact> <dl>
<td><tt><b>Burg/</b></tt><dd> <tt>Burg</tt> is an instruction selector <dt><tt><b>Burg/</b></tt> <dd><tt>Burg</tt> is an instruction selector
generator -- it builds trees on which it then performs pattern-matching to generator -- it builds trees on which it then performs pattern-matching to
select instructions according to the patterns the user has specified. Burg select instructions according to the patterns the user has specified. Burg
is currently used in the Sparc V9 backend.<p> is currently used in the Sparc V9 backend.<p>
<dt><tt><b>codegen-diff</b></tt><dd> <tt>codegen-diff</tt> is a script <dt><tt><b>codegen-diff</b></tt> <dd><tt>codegen-diff</tt> is a script
that finds differences between code that LLC generates and code that LLI that finds differences between code that LLC generates and code that LLI
generates. This is a useful tool if you are debugging one of them, generates. This is a useful tool if you are debugging one of them,
assuming that the other generates correct output. For the full user assuming that the other generates correct output. For the full user
manual, run <tt>`perldoc codegen-diff'</tt>.<p> manual, run <tt>`perldoc codegen-diff'</tt>.<p>
<dt><tt><b>cvsupdate</b></tt><dd> <tt>cvsupdate</tt> is a script that will <dt><tt><b>cvsupdate</b></tt> <dd><tt>cvsupdate</tt> is a script that will
update your CVS tree, but produce a much cleaner and more organized output update your CVS tree, but produce a much cleaner and more organized output
than simply running <tt>`cvs -z3 up -dP'</tt> will. For example, it will group than simply running <tt>`cvs -z3 up -dP'</tt> will. For example, it will group
together all the new and updated files and modified files in separate together all the new and updated files and modified files in separate
@@ -946,20 +1035,20 @@ are code generators for parts of LLVM infrastructure.</p>
top of your LLVM CVS tree, running <tt>utils/cvsupdate</tt> is the top of your LLVM CVS tree, running <tt>utils/cvsupdate</tt> is the
preferred way of updating the tree.<p> preferred way of updating the tree.<p>
<dt><tt><b>emacs/</b></tt><dd> The <tt>emacs</tt> directory contains <dt><tt><b>emacs/</b></tt> <dd>The <tt>emacs</tt> directory contains
syntax-highlighting files which will work with Emacs and XEmacs editors, syntax-highlighting files which will work with Emacs and XEmacs editors,
providing syntax highlighting support for LLVM assembly files and TableGen providing syntax highlighting support for LLVM assembly files and TableGen
description files. For information on how to use the syntax files, consult description files. For information on how to use the syntax files, consult
the <tt>README</tt> file in that directory.<p> the <tt>README</tt> file in that directory.<p>
<dt><tt><b>getsrcs.sh</b></tt><dd> The <tt>getsrcs.sh</tt> script finds <dt><tt><b>getsrcs.sh</b></tt> <dd>The <tt>getsrcs.sh</tt> script finds
and outputs all non-generated source files, which is useful if one wishes and outputs all non-generated source files, which is useful if one wishes
to do a lot of development across directories and does not want to to do a lot of development across directories and does not want to
individually find each file. One way to use it is to run, for example: individually find each file. One way to use it is to run, for example:
<tt>xemacs `utils/getsources.sh`</tt> from the top of your LLVM source <tt>xemacs `utils/getsources.sh`</tt> from the top of your LLVM source
tree.<p> tree.<p>
<dt><tt><b>makellvm</b></tt><dd> The <tt>makellvm</tt> script compiles all <dt><tt><b>makellvm</b></tt> <dd>The <tt>makellvm</tt> script compiles all
files in the current directory and then compiles and links the tool that files in the current directory and then compiles and links the tool that
is the first argument. For example, assuming you are in the directory is the first argument. For example, assuming you are in the directory
<tt>llvm/lib/Target/Sparc</tt>, if <tt>makellvm</tt> is in your path, <tt>llvm/lib/Target/Sparc</tt>, if <tt>makellvm</tt> is in your path,
@@ -968,17 +1057,17 @@ are code generators for parts of LLVM infrastructure.</p>
causing a re-linking of LLC.<p> causing a re-linking of LLC.<p>
<dt><tt><b>NightlyTest.pl</b></tt> and <dt><tt><b>NightlyTest.pl</b></tt> and
<tt><b>NightlyTestTemplate.html</b></tt><dd> These files are used in a <tt><b>NightlyTestTemplate.html</b></tt> <dd>These files are used in a
cron script to generate nightly status reports of the functionality of cron script to generate nightly status reports of the functionality of
tools, and the results can be seen by following the appropriate link on tools, and the results can be seen by following the appropriate link on
the <a href="http://llvm.cs.uiuc.edu/">LLVM homepage</a>.<p> the <a href="http://llvm.cs.uiuc.edu/">LLVM homepage</a>.<p>
<dt><tt><b>TableGen/</b></tt><dd> The <tt>TableGen</tt> directory contains <dt><tt><b>TableGen/</b></tt> <dd>The <tt>TableGen</tt> directory contains
the tool used to generate register descriptions, instruction set the tool used to generate register descriptions, instruction set
descriptions, and even assemblers from common TableGen description descriptions, and even assemblers from common TableGen description
files.<p> files.<p>
<dt><tt><b>vim/</b></tt><dd> The <tt>vim</tt> directory contains <dt><tt><b>vim/</b></tt> <dd>The <tt>vim</tt> directory contains
syntax-highlighting files which will work with the VIM editor, providing syntax-highlighting files which will work with the VIM editor, providing
syntax highlighting support for LLVM assembly files and TableGen syntax highlighting support for LLVM assembly files and TableGen
description files. For information on how to use the syntax files, consult description files. For information on how to use the syntax files, consult
@@ -1087,6 +1176,11 @@ out:</p>
<hr> <hr>
<address> <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="mailto:sabre@nondot.org">Chris Lattner</a><br>
<a href="http://llvm.cs.uiuc.edu">The LLVM Compiler Infrastructure</a><br> <a href="http://llvm.cs.uiuc.edu">The LLVM Compiler Infrastructure</a><br>
Last modified: $Date$ Last modified: $Date$

View File

@@ -11,8 +11,6 @@
How to submit an LLVM bug report How to submit an LLVM bug report
</div> </div>
<div>
<table border="0" width="100%"> <table border="0" width="100%">
<tr> <tr>
<td valign="top"> <td valign="top">
@@ -31,12 +29,14 @@
</ol> </ol>
<p><b>Written by <a href="mailto:sabre@nondot.org">Chris Lattner</a> and <div class="doc_text">
<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> <a href="http://misha.brukman.net">Misha Brukman</a></b></p>
</div>
</td> </td>
<td align="right"> <td align="right">
<img src="Debugging.gif" width="444" height="314"> <img src="Debugging.gif" alt="Debugging" width="444" height="314">
</td> </td>
</tr> </tr>
</table> </table>
@@ -96,12 +96,14 @@ buggy or if it's one of the LLVM tools that has problems.</p>
<tt><b>gccas</b></tt>, or <tt><b>gccld</b></tt>), run the <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 <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 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>, bunch of stuff, and should end with telling you that one of
<tt><b>gccas</b></tt>, or <tt><b>gccld</b></tt> crashed.</p> <tt><b>cc1</b>/<b>cc1plus</b></tt>, <tt><b>gccas</b></tt>, or
<tt><b>gccld</b></tt> crashed.</p>
<ul> <ul>
<li>If <tt><b>cc1</b></tt> crashed, you found a problem with the front-end. <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> 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 <li>If <tt><b>gccas</b></tt> crashed, you found a bug in <a href="#gccas">one
@@ -281,7 +283,7 @@ the following:</p>
<li>Regenerate the shared object from the safe bytecode file:<br> <li>Regenerate the shared object from the safe bytecode file:<br>
<pre> <pre>
<b>llvm-dis</b> -c safe.bc -o safe.c<br> <b>llc</b> -march=c safe.bc -o safe.c<br>
<b>gcc</b> -shared safe.c -o safe.so <b>gcc</b> -shared safe.c -o safe.so
</pre></li> </pre></li>
@@ -293,8 +295,8 @@ the following:</p>
./test.llc [program options] ./test.llc [program options]
</pre></li> </pre></li>
<p>If debugging the JIT, load the shared object and supply the test <li>If debugging the JIT, load the shared object and supply the test
bytecode:</p> bytecode:
<pre> <pre>
<b>lli</b> -load=safe.so test.bc [program options] <b>lli</b> -load=safe.so test.bc [program options]
@@ -305,14 +307,18 @@ bytecode:</p>
</div> </div>
<!-- *********************************************************************** --> <!-- *********************************************************************** -->
<hr> <hr>
<div class="doc_footer"> <address>
<address><a href="mailto:sabre@nondot.org">Chris Lattner</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:sabre@nondot.org">Chris Lattner</a><br>
<a href="http://llvm.cs.uiuc.edu">The LLVM Compiler Infrastructure</a> <a href="http://llvm.cs.uiuc.edu">The LLVM Compiler Infrastructure</a>
<br> <br>
Last modified: $Date$ Last modified: $Date$
</div> </address>
</body> </body>
</html> </html>

View File

@@ -1,180 +0,0 @@
<!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_text">
<p><b>Written by Brian R. Gaeke</b></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 tech report on <a
href="http://llvm.cs.uiuc.edu/pubs/2003-09-30-LifelongOptimizationTR.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. Relatively weak optimization 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>

View File

@@ -1,4 +1,5 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html> <html>
<head> <head>
<title>LLVM Assembly Language Reference Manual</title> <title>LLVM Assembly Language Reference Manual</title>
@@ -79,6 +80,7 @@
<ol> <ol>
<li><a href="#i_phi">'<tt>phi</tt>' Instruction</a></li> <li><a href="#i_phi">'<tt>phi</tt>' Instruction</a></li>
<li><a href="#i_cast">'<tt>cast .. to</tt>' Instruction</a></li> <li><a href="#i_cast">'<tt>cast .. to</tt>' Instruction</a></li>
<li><a href="#i_select">'<tt>select</tt>' Instruction</a></li>
<li><a href="#i_call">'<tt>call</tt>' Instruction</a></li> <li><a href="#i_call">'<tt>call</tt>' Instruction</a></li>
<li><a href="#i_vanext">'<tt>vanext</tt>' Instruction</a></li> <li><a href="#i_vanext">'<tt>vanext</tt>' Instruction</a></li>
<li><a href="#i_vaarg">'<tt>vaarg</tt>' Instruction</a></li> <li><a href="#i_vaarg">'<tt>vaarg</tt>' Instruction</a></li>
@@ -95,6 +97,20 @@
<li><a href="#i_va_copy">'<tt>llvm.va_copy</tt>' Intrinsic</a></li> <li><a href="#i_va_copy">'<tt>llvm.va_copy</tt>' Intrinsic</a></li>
</ol> </ol>
</li> </li>
<li><a href="#int_codegen">Code Generator Intrinsics</a>
<ol>
<li><a href="#i_returnaddress">'<tt>llvm.returnaddress</tt>' Intrinsic</a></li>
<li><a href="#i_frameaddress">'<tt>llvm.frameaddress</tt>' Intrinsic</a></li>
</ol>
</li>
<li><a href="#int_libc">Standard C Library Intrinsics</a>
<ol>
<li><a href="#i_memcpy">'<tt>llvm.memcpy</tt>' Intrinsic</a></li>
<li><a href="#i_memmove">'<tt>llvm.memmove</tt>' Intrinsic</a></li>
<li><a href="#i_memset">'<tt>llvm.memset</tt>' Intrinsic</a></li>
</ol>
</li>
<li><a href="#int_debugger">Debugger intrinsics</a>
</ol> </ol>
</li> </li>
</ol> </ol>
@@ -173,7 +189,7 @@ character can be used in a name.</li>
<li>Unnamed values are represented as an unsigned numeric value with <li>Unnamed values are represented as an unsigned numeric value with
a '%' prefix. For example, %12, %2, %44.</li> a '%' prefix. For example, %12, %2, %44.</li>
</ol> </ol>
<p>LLVM requires the values start with a '%' sign for two reasons: <p>LLVM requires that values start with a '%' sign for two reasons:
Compilers don't need to worry about name clashes with reserved words, Compilers don't need to worry about name clashes with reserved words,
and the set of reserved words may be expanded in the future without and the set of reserved words may be expanded in the future without
penalty. Additionally, unnamed identifiers allow a compiler to quickly penalty. Additionally, unnamed identifiers allow a compiler to quickly
@@ -241,12 +257,12 @@ href="#rw_stroustrup">1</a></sup>.<p> --> </div>
<div class="doc_text"> <div class="doc_text">
<p>The primitive types are the fundemental building blocks of the LLVM <p>The primitive types are the fundemental building blocks of the LLVM
system. The current set of primitive types are as follows:</p> system. The current set of primitive types are as follows:</p>
<p>
<table border="0" align="center"> <table border="0" style="align: center">
<tbody> <tbody>
<tr> <tr>
<td> <td>
<table border="1" cellspacing="0" cellpadding="4" align="center"> <table border="1" cellspacing="0" cellpadding="4" style="align: center">
<tbody> <tbody>
<tr> <tr>
<td><tt>void</tt></td> <td><tt>void</tt></td>
@@ -280,7 +296,7 @@ system. The current set of primitive types are as follows:</p>
</table> </table>
</td> </td>
<td valign="top"> <td valign="top">
<table border="1" cellspacing="0" cellpadding="4" align="center&quot;"> <table border="1" cellspacing="0" cellpadding="4">
<tbody> <tbody>
<tr> <tr>
<td><tt>bool</tt></td> <td><tt>bool</tt></td>
@@ -312,7 +328,7 @@ system. The current set of primitive types are as follows:</p>
</tr> </tr>
</tbody> </tbody>
</table> </table>
</p>
</div> </div>
<!-- _______________________________________________________________________ --> <!-- _______________________________________________________________________ -->
<div class="doc_subsubsection"> <a name="t_classifications">Type <div class="doc_subsubsection"> <a name="t_classifications">Type
@@ -320,8 +336,8 @@ Classifications</a> </div>
<div class="doc_text"> <div class="doc_text">
<p>These different primitive types fall into a few useful <p>These different primitive types fall into a few useful
classifications:</p> classifications:</p>
<p>
<table border="1" cellspacing="0" cellpadding="4" align="center"> <table border="1" cellspacing="0" cellpadding="4">
<tbody> <tbody>
<tr> <tr>
<td><a name="t_signed">signed</a></td> <td><a name="t_signed">signed</a></td>
@@ -350,7 +366,7 @@ uint, int, ulong, long, float, double, <a href="#t_pointer">pointer</a></tt></td
</tr> </tr>
</tbody> </tbody>
</table> </table>
</p>
<p>The <a href="#t_firstclass">first class</a> types are perhaps the <p>The <a href="#t_firstclass">first class</a> types are perhaps the
most important. Values of these types are the only ones which can be most important. Values of these types are the only ones which can be
produced by instructions, passed as arguments, or used as operands to produced by instructions, passed as arguments, or used as operands to
@@ -382,7 +398,7 @@ be any type with a size.</p>
<tt>[40 x uint]</tt>: Array of 40 unsigned integer values.</p> <tt>[40 x uint]</tt>: Array of 40 unsigned integer values.</p>
<p> </p> <p> </p>
<p>Here are some examples of multidimensional arrays:</p> <p>Here are some examples of multidimensional arrays:</p>
<p>
<table border="0" cellpadding="0" cellspacing="0"> <table border="0" cellpadding="0" cellspacing="0">
<tbody> <tbody>
<tr> <tr>
@@ -399,7 +415,7 @@ be any type with a size.</p>
</tr> </tr>
</tbody> </tbody>
</table> </table>
</p>
</div> </div>
<!-- _______________________________________________________________________ --> <!-- _______________________________________________________________________ -->
<div class="doc_subsubsection"> <a name="t_function">Function Type</a> </div> <div class="doc_subsubsection"> <a name="t_function">Function Type</a> </div>
@@ -421,7 +437,7 @@ which indicates that the function takes a variable number of arguments.
Variable argument functions can access their arguments with the <a Variable argument functions can access their arguments with the <a
href="#int_varargs">variable argument handling intrinsic</a> functions.</p> href="#int_varargs">variable argument handling intrinsic</a> functions.</p>
<h5>Examples:</h5> <h5>Examples:</h5>
<p>
<table border="0" cellpadding="0" cellspacing="0"> <table border="0" cellpadding="0" cellspacing="0">
<tbody> <tbody>
<tr> <tr>
@@ -443,7 +459,7 @@ in LLVM.</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
</p>
</div> </div>
<!-- _______________________________________________________________________ --> <!-- _______________________________________________________________________ -->
<div class="doc_subsubsection"> <a name="t_struct">Structure Type</a> </div> <div class="doc_subsubsection"> <a name="t_struct">Structure Type</a> </div>
@@ -460,7 +476,7 @@ instruction.</p>
<h5>Syntax:</h5> <h5>Syntax:</h5>
<pre> { &lt;type list&gt; }<br></pre> <pre> { &lt;type list&gt; }<br></pre>
<h5>Examples:</h5> <h5>Examples:</h5>
<p>
<table border="0" cellpadding="0" cellspacing="0"> <table border="0" cellpadding="0" cellspacing="0">
<tbody> <tbody>
<tr> <tr>
@@ -476,7 +492,7 @@ an <tt>int</tt>.</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
</p>
</div> </div>
<!-- _______________________________________________________________________ --> <!-- _______________________________________________________________________ -->
<div class="doc_subsubsection"> <a name="t_pointer">Pointer Type</a> </div> <div class="doc_subsubsection"> <a name="t_pointer">Pointer Type</a> </div>
@@ -487,7 +503,7 @@ reference to another object, which must live in memory.</p>
<h5>Syntax:</h5> <h5>Syntax:</h5>
<pre> &lt;type&gt; *<br></pre> <pre> &lt;type&gt; *<br></pre>
<h5>Examples:</h5> <h5>Examples:</h5>
<p>
<table border="0" cellpadding="0" cellspacing="0"> <table border="0" cellpadding="0" cellspacing="0">
<tbody> <tbody>
<tr> <tr>
@@ -503,7 +519,7 @@ an <tt>int</tt>.</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
</p>
</div> </div>
<!-- _______________________________________________________________________ --><!-- <!-- _______________________________________________________________________ --><!--
<div class="doc_subsubsection"> <div class="doc_subsubsection">
@@ -558,7 +574,7 @@ this case, a pointer to an array of char, and a pointer to a function),
and have one of the following linkage types:</a> and have one of the following linkage types:</a>
<p> </p> <p> </p>
<dl> <dl>
<a name="linkage_internal"> <dt><tt><b>internal</b></tt> </dt> <dt><tt><b><a name="linkage_internal">internal</a></b></tt> </dt>
<dd>Global values with internal linkage are only directly accessible <dd>Global values with internal linkage are only directly accessible
by objects in the current module. In particular, linking code into a by objects in the current module. In particular, linking code into a
module with an internal global value may cause the internal to be module with an internal global value may cause the internal to be
@@ -568,7 +584,7 @@ corresponds to the notion of the '<tt>static</tt>' keyword in C, or the
idea of "anonymous namespaces" in C++. idea of "anonymous namespaces" in C++.
<p> </p> <p> </p>
</dd> </dd>
</a><a name="linkage_linkonce"> <dt><tt><b>linkonce</b></tt>: </dt> <dt><tt><b><a name="linkage_linkonce">linkonce</a></b></tt>: </dt>
<dd>"<tt>linkonce</tt>" linkage is similar to <tt>internal</tt> <dd>"<tt>linkonce</tt>" linkage is similar to <tt>internal</tt>
linkage, with the twist that linking together two modules defining the linkage, with the twist that linking together two modules defining the
same <tt>linkonce</tt> globals will cause one of the globals to be same <tt>linkonce</tt> globals will cause one of the globals to be
@@ -576,14 +592,14 @@ discarded. This is typically used to implement inline functions.
Unreferenced <tt>linkonce</tt> globals are allowed to be discarded. Unreferenced <tt>linkonce</tt> globals are allowed to be discarded.
<p> </p> <p> </p>
</dd> </dd>
</a><a name="linkage_weak"> <dt><tt><b>weak</b></tt>: </dt> <dt><tt><b><a name="linkage_weak">weak</a></b></tt>: </dt>
<dd>"<tt>weak</tt>" linkage is exactly the same as <tt>linkonce</tt> <dd>"<tt>weak</tt>" linkage is exactly the same as <tt>linkonce</tt>
linkage, except that unreferenced <tt>weak</tt> globals may not be linkage, except that unreferenced <tt>weak</tt> globals may not be
discarded. This is used to implement constructs in C such as "<tt>int discarded. This is used to implement constructs in C such as "<tt>int
X;</tt>" at global scope. X;</tt>" at global scope.
<p> </p> <p> </p>
</dd> </dd>
</a><a name="linkage_appending"> <dt><tt><b>appending</b></tt>: </dt> <dt><tt><b><a name="linkage_appending">appending</a></b></tt>: </dt>
<dd>"<tt>appending</tt>" linkage may only be applied to global <dd>"<tt>appending</tt>" linkage may only be applied to global
variables of pointer to array type. When two global variables with variables of pointer to array type. When two global variables with
appending linkage are linked together, the two global arrays are appending linkage are linked together, the two global arrays are
@@ -592,13 +608,12 @@ the system linker append together "sections" with identical names when
.o files are linked. .o files are linked.
<p> </p> <p> </p>
</dd> </dd>
</a><a name="linkage_external"> <dt><tt><b>externally visible</b></tt>:</dt> <dt><tt><b><a name="linkage_external">externally visible</a></b></tt>:</dt>
<dd>If none of the above identifiers are used, the global is <dd>If none of the above identifiers are used, the global is
externally visible, meaning that it participates in linkage and can be externally visible, meaning that it participates in linkage and can be
used to resolve external symbol references. used to resolve external symbol references.
<p> </p> <p> </p>
</dd> </dd>
</a>
</dl> </dl>
<p> </p> <p> </p>
<p><a name="linkage_external">For example, since the "<tt>.LC0</tt>" <p><a name="linkage_external">For example, since the "<tt>.LC0</tt>"
@@ -609,45 +624,61 @@ external (i.e., lacking any linkage declarations), they are accessible
outside of the current module. It is illegal for a function <i>declaration</i> outside of the current module. It is illegal for a function <i>declaration</i>
to have any linkage type other than "externally visible".</a></p> to have any linkage type other than "externally visible".</a></p>
</div> </div>
<!-- ======================================================================= --> <!-- ======================================================================= -->
<div class="doc_subsection"> <a name="globalvars">Global Variables</a> </div> <div class="doc_subsection">
<a name="globalvars">Global Variables</a>
</div>
<div class="doc_text"> <div class="doc_text">
<p>Global variables define regions of memory allocated at compilation <p>Global variables define regions of memory allocated at compilation
time instead of run-time. Global variables may optionally be time instead of run-time. Global variables may optionally be
initialized. A variable may be defined as a global "constant", which initialized. A variable may be defined as a global "constant", which
indicates that the contents of the variable will never be modified indicates that the contents of the variable will never be modified
(opening options for optimization). Constants must always have an (opening options for optimization).</p>
initial value.</p>
<p>As SSA values, global variables define pointer values that are in <p>As SSA values, global variables define pointer values that are in
scope (i.e. they dominate) for all basic blocks in the program. Global scope (i.e. they dominate) for all basic blocks in the program. Global
variables always define a pointer to their "content" type because they variables always define a pointer to their "content" type because they
describe a region of memory, and all memory objects in LLVM are describe a region of memory, and all memory objects in LLVM are
accessed through pointers.</p> accessed through pointers.</p>
</div> </div>
<!-- ======================================================================= --> <!-- ======================================================================= -->
<div class="doc_subsection"> <a name="functionstructure">Functions</a> </div> <div class="doc_subsection">
<div class="doc_text"> <a name="functionstructure">Functions</a>
<p>LLVM function definitions are composed of a (possibly empty)
argument list, an opening curly brace, a list of basic blocks, and a
closing curly brace. LLVM function declarations are defined with the "<tt>declare</tt>"
keyword, a function name, and a function signature.</p>
<p>A function definition contains a list of basic blocks, forming the
CFG for the function. Each basic block may optionally start with a
label (giving the basic block a symbol table entry), contains a list of
instructions, and ends with a <a href="#terminators">terminator</a>
instruction (such as a branch or function return).</p>
<p>The first basic block in program is special in two ways: it is
immediately executed on entrance to the function, and it is not allowed
to have predecessor basic blocks (i.e. there can not be any branches to
the entry block of a function). Because the block can have no
predecessors, it also cannot have any <a href="#i_phi">PHI nodes</a>.</p>
<p>
LLVM functions are identified by their name and type signature. Hence, two
functions with the same name but different parameter lists or return values
are considered different functions, and LLVM will resolves references to each
appropriately.
</p>
</div> </div>
<div class="doc_text">
<p>LLVM function definitions are composed of a (possibly empty) argument list,
an opening curly brace, a list of basic blocks, and a closing curly brace. LLVM
function declarations are defined with the "<tt>declare</tt>" keyword, a
function name, and a function signature.</p>
<p>A function definition contains a list of basic blocks, forming the CFG for
the function. Each basic block may optionally start with a label (giving the
basic block a symbol table entry), contains a list of instructions, and ends
with a <a href="#terminators">terminator</a> instruction (such as a branch or
function return).</p>
<p>The first basic block in program is special in two ways: it is immediately
executed on entrance to the function, and it is not allowed to have predecessor
basic blocks (i.e. there can not be any branches to the entry block of a
function). Because the block can have no predecessors, it also cannot have any
<a href="#i_phi">PHI nodes</a>.</p>
<p>LLVM functions are identified by their name and type signature. Hence, two
functions with the same name but different parameter lists or return values are
considered different functions, and LLVM will resolves references to each
appropriately.</p>
</div>
<!-- *********************************************************************** --> <!-- *********************************************************************** -->
<div class="doc_section"> <a name="instref">Instruction Reference</a> </div> <div class="doc_section"> <a name="instref">Instruction Reference</a> </div>
<!-- *********************************************************************** --> <!-- *********************************************************************** -->
@@ -734,40 +765,61 @@ control flows to the '<tt>iffalse</tt>' <tt>label</tt> argument.</p>
href="#i_ret">ret</a> int 1<br>IfUnequal:<br> <a href="#i_ret">ret</a> int 0<br></pre> href="#i_ret">ret</a> int 1<br>IfUnequal:<br> <a href="#i_ret">ret</a> int 0<br></pre>
</div> </div>
<!-- _______________________________________________________________________ --> <!-- _______________________________________________________________________ -->
<div class="doc_subsubsection"> <a name="i_switch">'<tt>switch</tt>' <div class="doc_subsubsection">
Instruction</a> </div> <a name="i_switch">'<tt>switch</tt>' Instruction</a>
</div>
<div class="doc_text"> <div class="doc_text">
<h5>Syntax:</h5> <h5>Syntax:</h5>
<pre> switch uint &lt;value&gt;, label &lt;defaultdest&gt; [ int &lt;val&gt;, label &amp;dest&gt;, ... ]<br></pre>
<pre>
switch &lt;intty&gt; &lt;value&gt;, label &lt;defaultdest&gt; [ &lt;intty&gt; &lt;val&gt;, label &lt;dest&gt; ... ]
</pre>
<h5>Overview:</h5> <h5>Overview:</h5>
<p>The '<tt>switch</tt>' instruction is used to transfer control flow
to one of several different places. It is a generalization of the '<tt>br</tt>' <p>The '<tt>switch</tt>' instruction is used to transfer control flow to one of
several different places. It is a generalization of the '<tt>br</tt>'
instruction, allowing a branch to occur to one of many possible instruction, allowing a branch to occur to one of many possible
destinations.</p> destinations.</p>
<h5>Arguments:</h5> <h5>Arguments:</h5>
<p>The '<tt>switch</tt>' instruction uses three parameters: a '<tt>uint</tt>'
comparison value '<tt>value</tt>', a default '<tt>label</tt>' <p>The '<tt>switch</tt>' instruction uses three parameters: an integer
destination, and an array of pairs of comparison value constants and '<tt>label</tt>'s.</p> comparison value '<tt>value</tt>', a default '<tt>label</tt>' destination, and
an array of pairs of comparison value constants and '<tt>label</tt>'s. The
table is not allowed to contain duplicate constant entries.</p>
<h5>Semantics:</h5> <h5>Semantics:</h5>
<p>The <tt>switch</tt> instruction specifies a table of values and <p>The <tt>switch</tt> instruction specifies a table of values and
destinations. When the '<tt>switch</tt>' instruction is executed, this destinations. When the '<tt>switch</tt>' instruction is executed, this
table is searched for the given value. If the value is found, the table is searched for the given value. If the value is found, the
corresponding destination is branched to, otherwise the default value corresponding destination is branched to, otherwise the default value
it transfered to.</p> it transfered to.</p>
<h5>Implementation:</h5> <h5>Implementation:</h5>
<p>Depending on properties of the target machine and the particular <tt>switch</tt>
instruction, this instruction may be code generated as a series of <p>Depending on properties of the target machine and the particular
chained conditional branches, or with a lookup table.</p> <tt>switch</tt> instruction, this instruction may be code generated in different
ways, for example as a series of chained conditional branches, or with a lookup
table.</p>
<h5>Example:</h5> <h5>Example:</h5>
<pre> <i>; Emulate a conditional br instruction</i>
%Val = <a <pre>
href="#i_cast">cast</a> bool %value to uint<br> switch uint %Val, label %truedest [int 0, label %falsedest ]<br><br> <i>; Emulate an unconditional br instruction</i> <i>; Emulate a conditional br instruction</i>
%Val = <a href="#i_cast">cast</a> bool %value to int
switch int %Val, label %truedest [int 0, label %falsedest ]
<i>; Emulate an unconditional br instruction</i>
switch uint 0, label %dest [ ] switch uint 0, label %dest [ ]
<i>; Implement a jump table:</i> <i>; Implement a jump table:</i>
switch uint %val, label %otherwise [ int 0, label %onzero, switch uint %val, label %otherwise [ uint 0, label %onzero
int 1, label %onone, uint 1, label %onone
int 2, label %ontwo ] uint 2, label %ontwo ]
</pre> </pre>
</div> </div>
<!-- _______________________________________________________________________ --> <!-- _______________________________________________________________________ -->
@@ -1031,7 +1083,7 @@ identical types.</p>
<h5>Semantics:</h5> <h5>Semantics:</h5>
<p>The truth table used for the '<tt>and</tt>' instruction is:</p> <p>The truth table used for the '<tt>and</tt>' instruction is:</p>
<p> </p> <p> </p>
<center> <div style="align: center">
<table border="1" cellspacing="0" cellpadding="4"> <table border="1" cellspacing="0" cellpadding="4">
<tbody> <tbody>
<tr> <tr>
@@ -1061,7 +1113,7 @@ identical types.</p>
</tr> </tr>
</tbody> </tbody>
</table> </table>
</center> </div>
<h5>Example:</h5> <h5>Example:</h5>
<pre> &lt;result&gt; = and int 4, %var <i>; yields {int}:result = 4 &amp; %var</i> <pre> &lt;result&gt; = and int 4, %var <i>; yields {int}:result = 4 &amp; %var</i>
&lt;result&gt; = and int 15, 40 <i>; yields {int}:result = 8</i> &lt;result&gt; = and int 15, 40 <i>; yields {int}:result = 8</i>
@@ -1084,7 +1136,7 @@ identical types.</p>
<h5>Semantics:</h5> <h5>Semantics:</h5>
<p>The truth table used for the '<tt>or</tt>' instruction is:</p> <p>The truth table used for the '<tt>or</tt>' instruction is:</p>
<p> </p> <p> </p>
<center> <div style="align: center">
<table border="1" cellspacing="0" cellpadding="4"> <table border="1" cellspacing="0" cellpadding="4">
<tbody> <tbody>
<tr> <tr>
@@ -1114,7 +1166,7 @@ identical types.</p>
</tr> </tr>
</tbody> </tbody>
</table> </table>
</center> </div>
<h5>Example:</h5> <h5>Example:</h5>
<pre> &lt;result&gt; = or int 4, %var <i>; yields {int}:result = 4 | %var</i> <pre> &lt;result&gt; = or int 4, %var <i>; yields {int}:result = 4 | %var</i>
&lt;result&gt; = or int 15, 40 <i>; yields {int}:result = 47</i> &lt;result&gt; = or int 15, 40 <i>; yields {int}:result = 47</i>
@@ -1139,7 +1191,7 @@ identical types.</p>
<h5>Semantics:</h5> <h5>Semantics:</h5>
<p>The truth table used for the '<tt>xor</tt>' instruction is:</p> <p>The truth table used for the '<tt>xor</tt>' instruction is:</p>
<p> </p> <p> </p>
<center> <div style="align: center">
<table border="1" cellspacing="0" cellpadding="4"> <table border="1" cellspacing="0" cellpadding="4">
<tbody> <tbody>
<tr> <tr>
@@ -1169,7 +1221,7 @@ identical types.</p>
</tr> </tr>
</tbody> </tbody>
</table> </table>
</center> </div>
<p> </p> <p> </p>
<h5>Example:</h5> <h5>Example:</h5>
<pre> &lt;result&gt; = xor int 4, %var <i>; yields {int}:result = 4 ^ %var</i> <pre> &lt;result&gt; = xor int 4, %var <i>; yields {int}:result = 4 ^ %var</i>
@@ -1248,8 +1300,8 @@ Instruction</a> </div>
<p>The '<tt>malloc</tt>' instruction allocates memory from the system <p>The '<tt>malloc</tt>' instruction allocates memory from the system
heap and returns a pointer to it.</p> heap and returns a pointer to it.</p>
<h5>Arguments:</h5> <h5>Arguments:</h5>
<p>The the '<tt>malloc</tt>' instruction allocates <tt>sizeof(&lt;type&gt;)*NumElements</tt> <p>The '<tt>malloc</tt>' instruction allocates <tt>sizeof(&lt;type&gt;)*NumElements</tt>
bytes of memory from the operating system, and returns a pointer of the bytes of memory from the operating system and returns a pointer of the
appropriate type to the program. The second form of the instruction is appropriate type to the program. The second form of the instruction is
a shorter version of the first instruction that defaults to allocating a shorter version of the first instruction that defaults to allocating
one element.</p> one element.</p>
@@ -1455,38 +1507,111 @@ came from in the last <a href="#terminators">terminator</a> instruction.</p>
<h5>Example:</h5> <h5>Example:</h5>
<pre>Loop: ; Infinite loop that counts from 0 on up...<br> %indvar = phi uint [ 0, %LoopHeader ], [ %nextindvar, %Loop ]<br> %nextindvar = add uint %indvar, 1<br> br label %Loop<br></pre> <pre>Loop: ; Infinite loop that counts from 0 on up...<br> %indvar = phi uint [ 0, %LoopHeader ], [ %nextindvar, %Loop ]<br> %nextindvar = add uint %indvar, 1<br> br label %Loop<br></pre>
</div> </div>
<!-- _______________________________________________________________________ --> <!-- _______________________________________________________________________ -->
<div class="doc_subsubsection"> <a name="i_cast">'<tt>cast .. to</tt>' <div class="doc_subsubsection">
Instruction</a> </div> <a name="i_cast">'<tt>cast .. to</tt>' Instruction</a>
</div>
<div class="doc_text"> <div class="doc_text">
<h5>Syntax:</h5> <h5>Syntax:</h5>
<pre> &lt;result&gt; = cast &lt;ty&gt; &lt;value&gt; to &lt;ty2&gt; <i>; yields ty2</i>
<pre>
&lt;result&gt; = cast &lt;ty&gt; &lt;value&gt; to &lt;ty2&gt; <i>; yields ty2</i>
</pre> </pre>
<h5>Overview:</h5> <h5>Overview:</h5>
<p>The '<tt>cast</tt>' instruction is used as the primitive means to
convert integers to floating point, change data type sizes, and break <p>
type safety (by casting pointers).</p> The '<tt>cast</tt>' instruction is used as the primitive means to convert
integers to floating point, change data type sizes, and break type safety (by
casting pointers).
</p>
<h5>Arguments:</h5> <h5>Arguments:</h5>
<p>The '<tt>cast</tt>' instruction takes a value to cast, which must be
a first class value, and a type to cast it to, which must also be a <a <p>
href="#t_firstclass">first class</a> type.</p> The '<tt>cast</tt>' instruction takes a value to cast, which must be a first
class value, and a type to cast it to, which must also be a <a
href="#t_firstclass">first class</a> type.
</p>
<h5>Semantics:</h5> <h5>Semantics:</h5>
<p>This instruction follows the C rules for explicit casts when
determining how the data being cast must change to fit in its new <p>
container.</p> This instruction follows the C rules for explicit casts when determining how the
<p>When casting to bool, any value that would be considered true in the data being cast must change to fit in its new container.
context of a C '<tt>if</tt>' condition is converted to the boolean '<tt>true</tt>' </p>
values, all else are '<tt>false</tt>'.</p>
<p>When extending an integral value from a type of one signness to <p>
another (for example '<tt>sbyte</tt>' to '<tt>ulong</tt>'), the value When casting to bool, any value that would be considered true in the context of
is sign-extended if the <b>source</b> value is signed, and a C '<tt>if</tt>' condition is converted to the boolean '<tt>true</tt>' values,
zero-extended if the source value is unsigned. <tt>bool</tt> values all else are '<tt>false</tt>'.
are always zero extended into either zero or one.</p> </p>
<p>
When extending an integral value from a type of one signness to another (for
example '<tt>sbyte</tt>' to '<tt>ulong</tt>'), the value is sign-extended if the
<b>source</b> value is signed, and zero-extended if the source value is
unsigned. <tt>bool</tt> values are always zero extended into either zero or
one.
</p>
<h5>Example:</h5> <h5>Example:</h5>
<pre> %X = cast int 257 to ubyte <i>; yields ubyte:1</i>
<pre>
%X = cast int 257 to ubyte <i>; yields ubyte:1</i>
%Y = cast int 123 to bool <i>; yields bool:true</i> %Y = cast int 123 to bool <i>; yields bool:true</i>
</pre> </pre>
</div> </div>
<!-- _______________________________________________________________________ -->
<div class="doc_subsubsection">
<a name="i_select">'<tt>select</tt>' Instruction</a>
</div>
<div class="doc_text">
<h5>Syntax:</h5>
<pre>
&lt;result&gt; = select bool &lt;cond&gt;, &lt;ty&gt; &lt;val1&gt;, &lt;ty&gt; &lt;val2&gt; <i>; yields ty</i>
</pre>
<h5>Overview:</h5>
<p>
The '<tt>select</tt>' instruction is used to choose one value based on a
condition, without branching.
</p>
<h5>Arguments:</h5>
<p>
The '<tt>select</tt>' instruction requires a boolean value indicating the condition, and two values of the same <a href="#t_firstclass">first class</a> type.
</p>
<h5>Semantics:</h5>
<p>
If the boolean condition evaluates to true, the instruction returns the first
value argument, otherwise it returns the second value argument.
</p>
<h5>Example:</h5>
<pre>
%X = select bool true, ubyte 17, ubyte 42 <i>; yields ubyte:17</i>
</pre>
</div>
<!-- _______________________________________________________________________ --> <!-- _______________________________________________________________________ -->
<div class="doc_subsubsection"> <a name="i_call">'<tt>call</tt>' <div class="doc_subsubsection"> <a name="i_call">'<tt>call</tt>'
Instruction</a> </div> Instruction</a> </div>
@@ -1587,31 +1712,44 @@ an argument.</p>
<p>See the <a href="#int_varargs">variable argument processing</a> <p>See the <a href="#int_varargs">variable argument processing</a>
section.</p> section.</p>
</div> </div>
<!-- *********************************************************************** --> <!-- *********************************************************************** -->
<div class="doc_section"> <a name="intrinsics">Intrinsic Functions</a> </div> <div class="doc_section"> <a name="intrinsics">Intrinsic Functions</a> </div>
<!-- *********************************************************************** --> <!-- *********************************************************************** -->
<div class="doc_text"> <div class="doc_text">
<p>LLVM supports the notion of an "intrinsic function". These
functions have well known names and semantics, and are required to <p>LLVM supports the notion of an "intrinsic function". These functions have
follow certain restrictions. Overall, these instructions represent an well known names and semantics, and are required to follow certain
extension mechanism for the LLVM language that does not require restrictions. Overall, these instructions represent an extension mechanism for
changing all of the transformations in LLVM to add to the language (or the LLVM language that does not require changing all of the transformations in
the bytecode reader/writer, the parser, etc...).</p> LLVM to add to the language (or the bytecode reader/writer, the parser,
<p>Intrinsic function names must all start with an "<tt>llvm.</tt>" etc...).</p>
prefix, this prefix is reserved in LLVM for intrinsic names, thus
functions may not be named this. Intrinsic functions must always be <p>Intrinsic function names must all start with an "<tt>llvm.</tt>" prefix, this
external functions: you cannot define the body of intrinsic functions. prefix is reserved in LLVM for intrinsic names, thus functions may not be named
Intrinsic functions may only be used in call or invoke instructions: it this. Intrinsic functions must always be external functions: you cannot define
is illegal to take the address of an intrinsic function. Additionally, the body of intrinsic functions. Intrinsic functions may only be used in call
because intrinsic functions are part of the LLVM language, it is or invoke instructions: it is illegal to take the address of an intrinsic
required that they all be documented here if any are added.</p> function. Additionally, because intrinsic functions are part of the LLVM
<p>Unless an intrinsic function is target-specific, there must be a language, it is required that they all be documented here if any are added.</p>
lowering pass to eliminate the intrinsic or all backends must support
the intrinsic function.</p>
<p>
Adding an intrinsic to LLVM is straight-forward if it is possible to express the
concept in LLVM directly (ie, code generator support is not _required_). To do
this, extend the default implementation of the IntrinsicLowering class to handle
the intrinsic. Code generators use this class to lower intrinsics they do not
understand to raw LLVM instructions that they do.
</p>
</div> </div>
<!-- ======================================================================= --> <!-- ======================================================================= -->
<div class="doc_subsection"> <a name="int_varargs">Variable Argument <div class="doc_subsection">
Handling Intrinsics</a> </div> <a name="int_varargs">Variable Argument Handling Intrinsics</a>
</div>
<div class="doc_text"> <div class="doc_text">
<p>Variable argument support is defined in LLVM with the <a <p>Variable argument support is defined in LLVM with the <a
href="#i_vanext"><tt>vanext</tt></a> instruction and these three href="#i_vanext"><tt>vanext</tt></a> instruction and these three
@@ -1625,15 +1763,34 @@ used.</p>
<p>This example shows how the <a href="#i_vanext"><tt>vanext</tt></a> <p>This example shows how the <a href="#i_vanext"><tt>vanext</tt></a>
instruction and the variable argument handling intrinsic functions are instruction and the variable argument handling intrinsic functions are
used.</p> used.</p>
<pre>int %test(int %X, ...) {<br> ; Initialize variable argument processing<br> %ap = call sbyte*()* %<a <pre>
href="#i_va_start">llvm.va_start</a>()<br><br> ; Read a single integer argument<br> %tmp = vaarg sbyte* %ap, int<br><br> ; Advance to the next argument<br> %ap2 = vanext sbyte* %ap, int<br><br> ; Demonstrate usage of llvm.va_copy and llvm.va_end<br> %aq = call sbyte* (sbyte*)* %<a int %test(int %X, ...) {
href="#i_va_copy">llvm.va_copy</a>(sbyte* %ap2)<br> call void %<a ; Initialize variable argument processing
href="#i_va_end">llvm.va_end</a>(sbyte* %aq)<br><br> ; Stop processing of arguments.<br> call void %<a %ap = call sbyte* %<a href="#i_va_start">llvm.va_start</a>()
href="#i_va_end">llvm.va_end</a>(sbyte* %ap2)<br> ret int %tmp<br>}<br></pre>
; Read a single integer argument
%tmp = vaarg sbyte* %ap, int
; Advance to the next argument
%ap2 = vanext sbyte* %ap, int
; Demonstrate usage of llvm.va_copy and llvm.va_end
%aq = call sbyte* %<a href="#i_va_copy">llvm.va_copy</a>(sbyte* %ap2)
call void %<a href="#i_va_end">llvm.va_end</a>(sbyte* %aq)
; Stop processing of arguments.
call void %<a href="#i_va_end">llvm.va_end</a>(sbyte* %ap2)
ret int %tmp
}
</pre>
</div> </div>
<!-- _______________________________________________________________________ --> <!-- _______________________________________________________________________ -->
<div class="doc_subsubsection"> <a name="i_va_start">'<tt>llvm.va_start</tt>' <div class="doc_subsubsection">
Intrinsic</a> </div> <a name="i_va_start">'<tt>llvm.va_start</tt>' Intrinsic</a>
</div>
<div class="doc_text"> <div class="doc_text">
<h5>Syntax:</h5> <h5>Syntax:</h5>
<pre> call va_list ()* %llvm.va_start()<br></pre> <pre> call va_list ()* %llvm.va_start()<br></pre>
@@ -1650,9 +1807,12 @@ last argument of the function, the compiler can figure that out.</p>
<p>Note that this intrinsic function is only legal to be called from <p>Note that this intrinsic function is only legal to be called from
within the body of a variable argument function.</p> within the body of a variable argument function.</p>
</div> </div>
<!-- _______________________________________________________________________ --> <!-- _______________________________________________________________________ -->
<div class="doc_subsubsection"> <a name="i_va_end">'<tt>llvm.va_end</tt>' <div class="doc_subsubsection">
Intrinsic</a> </div> <a name="i_va_end">'<tt>llvm.va_end</tt>' Intrinsic</a>
</div>
<div class="doc_text"> <div class="doc_text">
<h5>Syntax:</h5> <h5>Syntax:</h5>
<pre> call void (va_list)* %llvm.va_end(va_list &lt;arglist&gt;)<br></pre> <pre> call void (va_list)* %llvm.va_end(va_list &lt;arglist&gt;)<br></pre>
@@ -1669,9 +1829,12 @@ Calls to <a href="#i_va_start"><tt>llvm.va_start</tt></a> and <a
href="#i_va_copy"><tt>llvm.va_copy</tt></a> must be matched exactly href="#i_va_copy"><tt>llvm.va_copy</tt></a> must be matched exactly
with calls to <tt>llvm.va_end</tt>.</p> with calls to <tt>llvm.va_end</tt>.</p>
</div> </div>
<!-- _______________________________________________________________________ --> <!-- _______________________________________________________________________ -->
<div class="doc_subsubsection"> <a name="i_va_copy">'<tt>llvm.va_copy</tt>' <div class="doc_subsubsection">
Intrinsic</a> </div> <a name="i_va_copy">'<tt>llvm.va_copy</tt>' Intrinsic</a>
</div>
<div class="doc_text"> <div class="doc_text">
<h5>Syntax:</h5> <h5>Syntax:</h5>
<pre> call va_list (va_list)* %llvm.va_copy(va_list &lt;destarglist&gt;)<br></pre> <pre> call va_list (va_list)* %llvm.va_copy(va_list &lt;destarglist&gt;)<br></pre>
@@ -1687,11 +1850,305 @@ element into the returned list. This intrinsic is necessary because the <tt><a
href="i_va_start">llvm.va_start</a></tt> intrinsic may be arbitrarily href="i_va_start">llvm.va_start</a></tt> intrinsic may be arbitrarily
complex and require memory allocation, for example.</p> complex and require memory allocation, for example.</p>
</div> </div>
<!-- ======================================================================= -->
<div class="doc_subsection">
<a name="int_codegen">Code Generator Intrinsics</a>
</div>
<div class="doc_text">
<p>
These intrinsics are provided by LLVM to expose special features that may only
be implemented with code generator support.
</p>
</div>
<!-- _______________________________________________________________________ -->
<div class="doc_subsubsection">
<a name="i_returnaddress">'<tt>llvm.returnaddress</tt>' Intrinsic</a>
</div>
<div class="doc_text">
<h5>Syntax:</h5>
<pre>
call void* ()* %llvm.returnaddress(uint &lt;level&gt;)
</pre>
<h5>Overview:</h5>
<p>
The '<tt>llvm.returnaddress</tt>' intrinsic returns a target-specific value
indicating the return address of the current function or one of its callers.
</p>
<h5>Arguments:</h5>
<p>
The argument to this intrinsic indicates which function to return the address
for. Zero indicates the calling function, one indicates its caller, etc. The
argument is <b>required</b> to be a constant integer value.
</p>
<h5>Semantics:</h5>
<p>
The '<tt>llvm.returnaddress</tt>' intrinsic either returns a pointer indicating
the return address of the specified call frame, or zero if it cannot be
identified. The value returned by this intrinsic is likely to be incorrect or 0
for arguments other than zero, so it should only be used for debugging purposes.
</p>
<p>
Note that calling this intrinsic does not prevent function inlining or other
aggressive transformations, so the value returned may not that of the obvious
source-language caller.
</p>
</div>
<!-- _______________________________________________________________________ -->
<div class="doc_subsubsection">
<a name="i_frameaddress">'<tt>llvm.frameaddress</tt>' Intrinsic</a>
</div>
<div class="doc_text">
<h5>Syntax:</h5>
<pre>
call void* ()* %llvm.frameaddress(uint &lt;level&gt;)
</pre>
<h5>Overview:</h5>
<p>
The '<tt>llvm.frameaddress</tt>' intrinsic returns the target-specific frame
pointer value for the specified stack frame.
</p>
<h5>Arguments:</h5>
<p>
The argument to this intrinsic indicates which function to return the frame
pointer for. Zero indicates the calling function, one indicates its caller,
etc. The argument is <b>required</b> to be a constant integer value.
</p>
<h5>Semantics:</h5>
<p>
The '<tt>llvm.frameaddress</tt>' intrinsic either returns a pointer indicating
the frame address of the specified call frame, or zero if it cannot be
identified. The value returned by this intrinsic is likely to be incorrect or 0
for arguments other than zero, so it should only be used for debugging purposes.
</p>
<p>
Note that calling this intrinsic does not prevent function inlining or other
aggressive transformations, so the value returned may not that of the obvious
source-language caller.
</p>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection">
<a name="int_libc">Standard C Library Intrinsics</a>
</div>
<div class="doc_text">
<p>
LLVM provides intrinsics for a few important standard C library functions.
These intrinsics allow source-language front-ends to pass information about the
alignment of the pointer arguments to the code generator, providing opportunity
for more efficient code generation.
</p>
</div>
<!-- _______________________________________________________________________ -->
<div class="doc_subsubsection">
<a name="i_memcpy">'<tt>llvm.memcpy</tt>' Intrinsic</a>
</div>
<div class="doc_text">
<h5>Syntax:</h5>
<pre>
call void (sbyte*, sbyte*, uint, uint)* %llvm.memcpy(sbyte* &lt;dest&gt;, sbyte* &lt;src&gt;,
uint &lt;len&gt;, uint &lt;align&gt;)
</pre>
<h5>Overview:</h5>
<p>
The '<tt>llvm.memcpy</tt>' intrinsic copies a block of memory from the source
location to the destination location.
</p>
<p>
Note that, unlike the standard libc function, the <tt>llvm.memcpy</tt> intrinsic
does not return a value, and takes an extra alignment argument.
</p>
<h5>Arguments:</h5>
<p>
The first argument is a pointer to the destination, the second is a pointer to
the source. The third argument is an (arbitrarily sized) integer argument
specifying the number of bytes to copy, and the fourth argument is the alignment
of the source and destination locations.
</p>
<p>
If the call to this intrinisic has an alignment value that is not 0 or 1, then
the caller guarantees that the size of the copy is a multiple of the alignment
and that both the source and destination pointers are aligned to that boundary.
</p>
<h5>Semantics:</h5>
<p>
The '<tt>llvm.memcpy</tt>' intrinsic copies a block of memory from the source
location to the destination location, which are not allowed to overlap. It
copies "len" bytes of memory over. If the argument is known to be aligned to
some boundary, this can be specified as the fourth argument, otherwise it should
be set to 0 or 1.
</p>
</div>
<!-- _______________________________________________________________________ -->
<div class="doc_subsubsection">
<a name="i_memmove">'<tt>llvm.memmove</tt>' Intrinsic</a>
</div>
<div class="doc_text">
<h5>Syntax:</h5>
<pre>
call void (sbyte*, sbyte*, uint, uint)* %llvm.memmove(sbyte* &lt;dest&gt;, sbyte* &lt;src&gt;,
uint &lt;len&gt;, uint &lt;align&gt;)
</pre>
<h5>Overview:</h5>
<p>
The '<tt>llvm.memmove</tt>' intrinsic moves a block of memory from the source
location to the destination location. It is similar to the '<tt>llvm.memcpy</tt>'
intrinsic but allows the two memory locations to overlap.
</p>
<p>
Note that, unlike the standard libc function, the <tt>llvm.memmove</tt> intrinsic
does not return a value, and takes an extra alignment argument.
</p>
<h5>Arguments:</h5>
<p>
The first argument is a pointer to the destination, the second is a pointer to
the source. The third argument is an (arbitrarily sized) integer argument
specifying the number of bytes to copy, and the fourth argument is the alignment
of the source and destination locations.
</p>
<p>
If the call to this intrinisic has an alignment value that is not 0 or 1, then
the caller guarantees that the size of the copy is a multiple of the alignment
and that both the source and destination pointers are aligned to that boundary.
</p>
<h5>Semantics:</h5>
<p>
The '<tt>llvm.memmove</tt>' intrinsic copies a block of memory from the source
location to the destination location, which may overlap. It
copies "len" bytes of memory over. If the argument is known to be aligned to
some boundary, this can be specified as the fourth argument, otherwise it should
be set to 0 or 1.
</p>
</div>
<!-- _______________________________________________________________________ -->
<div class="doc_subsubsection">
<a name="i_memset">'<tt>llvm.memset</tt>' Intrinsic</a>
</div>
<div class="doc_text">
<h5>Syntax:</h5>
<pre>
call void (sbyte*, ubyte, uint, uint)* %llvm.memset(sbyte* &lt;dest&gt;, ubyte &lt;val&gt;,
uint &lt;len&gt;, uint &lt;align&gt;)
</pre>
<h5>Overview:</h5>
<p>
The '<tt>llvm.memset</tt>' intrinsic fills a block of memory with a particular
byte value.
</p>
<p>
Note that, unlike the standard libc function, the <tt>llvm.memset</tt> intrinsic
does not return a value, and takes an extra alignment argument.
</p>
<h5>Arguments:</h5>
<p>
The first argument is a pointer to the destination to fill, the second is the
byte value to fill it with, the third argument is an (arbitrarily sized) integer
argument specifying the number of bytes to fill, and the fourth argument is the
known alignment of destination location.
</p>
<p>
If the call to this intrinisic has an alignment value that is not 0 or 1, then
the caller guarantees that the size of the copy is a multiple of the alignment
and that the destination pointer is aligned to that boundary.
</p>
<h5>Semantics:</h5>
<p>
The '<tt>llvm.memset</tt>' intrinsic fills "len" bytes of memory starting at the
destination location. If the argument is known to be aligned to some boundary,
this can be specified as the fourth argument, otherwise it should be set to 0 or
1.
</p>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection">
<a name="int_debugger">Debugger Intrinsics</a>
</div>
<div class="doc_text">
<p>
The LLVM debugger intrinsics (which all start with <tt>llvm.dbg.</tt> prefix),
are described in the <a
href="SourceLevelDebugging.html#format_common_intrinsics">LLVM Source Level
Debugging</a> document.
</p>
</div>
<!-- *********************************************************************** --> <!-- *********************************************************************** -->
<hr> <hr>
<div class="doc_footer"> <address>
<address><a href="mailto:sabre@nondot.org">Chris Lattner</a></address> <a href="http://jigsaw.w3.org/css-validator/check/referer"><img
<a href="http://llvm.cs.uiuc.edu">The LLVM Compiler Infrastructure</a> <br> src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a>
Last modified: $Date$ </div> <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> </body>
</html> </html>

298
llvm/docs/ObjectFiles.html Normal file
View File

@@ -0,0 +1,298 @@
<!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_text">
<p><b>Written by <a href="mailto:rspencer@x10sys.com">Reid Spencer</a> </b></p>
<p> </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

@@ -52,9 +52,16 @@ contributions.</p>
to the <a href="http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev">LLVM 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. 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 Additionally this is a good way to get more information about a specific project
or to suggest other projects to add to this page. Another good place to look or to suggest other projects to add to this page.
for ideas is the <a href="http://llvm.cs.uiuc.edu/bugs/">LLVM bug </p>
tracker</a>.</p>
<p>The projects in this page are open ended. More specific projects are
filed as unassigned enhancements in our <a href="http://llvm.cs.uiuc.edu/bugs/">
LLVM bug tracker</a>. Here is the current list:
</p>
<iframe src="http://llvm.cs.uiuc.edu/bugs/buglist.cgi?keywords_type=allwords&keywords=&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&bug_severity=enhancement&emailassigned_to1=1&emailtype1=substring&email1=unassigned" frameborder="1" align="center" width="100%" height="400">
</iframe>
</div> </div>
@@ -101,10 +108,6 @@ library and the <tt>stdio</tt> related functions... low-level system calls like
daily report. It could use the following improvements:</p> daily report. It could use the following improvements:</p>
<ol> <ol>
<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>
<li>Regression tests - We should run the regression tests in addition to the <li>Regression tests - We should run the regression tests in addition to the
program tests...</li> program tests...</li>
</ol> </ol>
@@ -140,10 +143,6 @@ all the back-ends: CBE, llc, and lli.</p>
<div class="doc_text"> <div class="doc_text">
<ol> <ol>
<li>Add a new conditional move instruction: <tt>X = select bool Cond, Y,
Z</tt></li>
<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 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 has a good survey of the prefetching capabilities of a variety of modern
@@ -166,11 +165,6 @@ all the back-ends: CBE, llc, and lli.</p>
would also then have to implement the reader for this index in would also then have to implement the reader for this index in
<tt>gccld</tt>.</li> <tt>gccld</tt>.</li>
<li>Improve the efficiency of the bytecode loader/writer</li>
<li>Extend the FunctionPassManager to use a ModuleProvider to stream functions
in on demand. This would improve the efficiency of the JIT.</li>
<li>Rework the PassManager to be more flexible</li> <li>Rework the PassManager to be more flexible</li>
<li>Some transformations and analyses only work on reducible flow graphs. It <li>Some transformations and analyses only work on reducible flow graphs. It
@@ -238,11 +232,11 @@ themselves. It seems natural to want to take advantage of this...</p>
<div class="doc_text"> <div class="doc_text">
<p>We are getting to the point where we really need a unified infrastructure for <p>We now have a unified infrastructure for writing profile-guided
profile guided optimizations. It would be wonderful to be able to write profile transformations, which will work either at offline-compile-time or in the JIT,
guided transformations which can be performed either at static compile time but we don't have many transformations. We would welcome new profile-guided
(compile time or offline optimization time) or at runtime in a JIT type setup. transformations as well as improvements to the current profiling system.
The LLVM transformation itself shouldn't need to know how it is being used.</p> </p>
<p>Ideas for profile guided transformations:</p> <p>Ideas for profile guided transformations:</p>
@@ -254,6 +248,23 @@ The LLVM transformation itself shouldn't need to know how it is being used.</p>
<li>...</li> <li>...</li>
</ol> </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> </div>
<!-- ======================================================================= --> <!-- ======================================================================= -->
@@ -266,8 +277,6 @@ The LLVM transformation itself shouldn't need to know how it is being used.</p>
<ol> <ol>
<li>Implement a Dependence Analysis Infrastructure<br> <li>Implement a Dependence Analysis Infrastructure<br>
- Design some way to represent and query dep analysis</li> - Design some way to represent and query dep analysis</li>
<li>Implement a faster Dominator Set Construction Algorithm<br>
- A linear time or nearly so algorithm</li>
<li>Implement a strength reduction pass</li> <li>Implement a strength reduction pass</li>
<li>Value range propagation pass</li> <li>Value range propagation pass</li>
<li>Implement an unswitching pass</li> <li>Implement an unswitching pass</li>
@@ -293,7 +302,7 @@ The LLVM transformation itself shouldn't need to know how it is being used.</p>
</div> </div>
<!-- ======================================================================= --> <!-- ======================================================================= -->
<div class="doc_subsection"> <div class="doc_section">
<a name="misc_new">Miscellaneous Additions</a> <a name="misc_new">Miscellaneous Additions</a>
</div> </div>
@@ -302,6 +311,11 @@ The LLVM transformation itself shouldn't need to know how it is being used.</p>
<ol> <ol>
<li>Write a new frontend for some language (Java? OCaml? Forth?)</li> <li>Write a new frontend for some language (Java? OCaml? Forth?)</li>
<li>Write a new backend for a target (IA64? MIPS? MMIX?)</li> <li>Write a new backend for a target (IA64? MIPS? MMIX?)</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> </ol>
</div> </div>

File diff suppressed because it is too large Load Diff

View File

@@ -3,12 +3,12 @@
<html> <html>
<head> <head>
<link rel="stylesheet" href="llvm.css" type="text/css"> <link rel="stylesheet" href="llvm.css" type="text/css">
<title>LLVM 1.1 Release Notes</title> <title>LLVM 1.2 Release Notes</title>
</head> </head>
<body> <body>
<div class="doc_title"> <div class="doc_title">
LLVM 1.1 Release Notes LLVM 1.2 Release Notes
</div> </div>
<ol> <ol>
@@ -18,7 +18,7 @@
<li><a href="#install-instructions">Installation Instructions</a></li> <li><a href="#install-instructions">Installation Instructions</a></li>
<li><a href="#knownproblems">Known Problems</a> <li><a href="#knownproblems">Known Problems</a>
<ul> <ul>
<!-- <li><a href="#portabilityprobs">Portability Problems</a> --> <li><a href="#experimental">Experimental features included with this release</a>
<li><a href="#core">Known problems with the LLVM Core</a> <li><a href="#core">Known problems with the LLVM Core</a>
<li><a href="#c-fe">Known problems with the C Front-end</a> <li><a href="#c-fe">Known problems with the C Front-end</a>
<li><a href="#c++-fe">Known problems with the C++ Front-end</a> <li><a href="#c++-fe">Known problems with the C++ Front-end</a>
@@ -30,7 +30,7 @@
</ol> </ol>
<div class="doc_text"> <div class="doc_text">
<p><b>Written by <a href="mailto:sabre@nondot.org">Chris Lattner</a></b><p> <p><b>Written by the <a href="http://llvm.cs.uiuc.edu">LLVM team</a></b><p>
</div> </div>
<!-- *********************************************************************** --> <!-- *********************************************************************** -->
@@ -42,11 +42,11 @@
<div class="doc_text"> <div class="doc_text">
<p>This document contains the release notes for the LLVM compiler <p>This document contains the release notes for the LLVM compiler
infrastructure, release 1.1. Here we describe the status of LLVM, including any infrastructure, release 1.2. Here we describe the status of LLVM, including any
known problems, and bug fixes from the previous release. The most up-to-date known problems and bug fixes from the previous release. The most up-to-date
version of this document can be found on the <a version of this document can be found on the <a
href="http://llvm.cs.uiuc.edu/releases/1.1/">LLVM 1.1 web site</a>. If you are href="http://llvm.cs.uiuc.edu/releases/1.2/">LLVM 1.2 web site</a>. If you are
not reading this on the LLVM web pages, you should probably go there, because not reading this on the LLVM web pages, you should probably go there because
this document may be updated after the release.</p> this document may be updated after the release.</p>
<p>For more information about LLVM, including information about potentially more <p>For more information about LLVM, including information about potentially more
@@ -70,86 +70,70 @@ href="http://llvm.cs.uiuc.edu/releases/">releases page</a>.</p>
<div class="doc_text"> <div class="doc_text">
<p>This is the second public release of the LLVM compiler infrastructure. This <p>
release is primarily a bugfix release, dramatically improving the C/C++ This is the third public release of the LLVM compiler infrastructure. This
front-end, and improving support for C++ in the LLVM core. This release also release incorporates several <a href="#newfeatures">new features</a> (including
includes a few new features, such as a simple profiler, support for Mac OS/X, exception handling support for the native code generators, the start of a
better interoperability with external source bases, a new example language source-level debugger, and profile guided optimizer components), many <a
front-end, and improvements in a few optimizations.</p> href="#qualityofimp">speedups</a> and <a href="#codequality">code quality</a>
improvements, documentation improvements, and a small collection of important <a
<p>At this time, LLVM is known to correctly compile the C &amp; C++ SPEC CPU2000 href="bugfix">bug fixes</a>. Overall, this is our highest quality release to
benchmarks with the C backend (X86 only), the Olden benchmarks, and the Ptrdist date, and we encourage you to upgrade if you are using LLVM 1.0 or 1.1.
benchmarks. It has also been used to compile
<b>many</b> other programs. LLVM now also works with a broad variety of
C++ programs, though it has still received much less testing than the C
front-end.
</p> </p>
<p> <p>
Note that the Sparc and X86 backends do not currently support exception throwing At this time, LLVM is known to correctly compile and run all C &amp; C++ SPEC
or long jumping (including 253.perlbmk in SPEC). For these programs, you must CPU2000 benchmarks, the Olden benchmarks, and the Ptrdist benchmarks. It has
use the C backend. Support for unwinding will be added in a future release. also been used to compile <b>many</b> other programs. LLVM now also works with
a broad variety of C++ programs, though it has still received less testing than
the C front-end.
</p> </p>
<!--=========================================================================--> <!--=========================================================================-->
<div class="doc_subsubsection"> <div class="doc_subsubsection">
This release implements the following new features: <a name="newfeatures">This release implements the following new features:</a>
</div> </div>
<ol> <ol>
<li><a <li><a href="SourceLevelDebugging.html">A new LLVM source-level debugger has been started.</a></li>
href="http://mail.cs.uiuc.edu/pipermail/llvmdev/2003-November/000528.html">A new <li>LLVM 1.2 encodes bytecode files for large programs in 10-30% less space.</li>
LLVM profiler, similar to gprof</a> is available</li> <li>LLVM can now feed profile information back into optimizers for Profile Guided Optimization, includes a simple basic block reordering pass, and supports edge profiling as well as function and block-level profiling.</li>
<li>The LLVM JIT lazily initializes global variables, reducing startup time for programs with lots of globals (like C++ programs).</li>
<li>LLVM and the C/C++ front-end now compile on Mac OS/X! Mac OS/X users can <li>The build and installation infrastructure in this release is dramatically
now explore the LLVM optimizer with the C backend and interpreter. Note that improved. There is now an <a
LLVM requires GCC 3.3 on Mac OS/X.</li> href="http://llvm.cs.uiuc.edu/PR105"><tt>autoconf/AutoRegen.sh</tt> script</a>
that you can run to rebuild the <tt>configure</tt> script and its associated
files as well as beta support for "<a
href="http://llvm.cs.uiuc.edu/PR208">make</a> <a
href="http://llvm.cs.uiuc.edu/PR220">install</a>" and <a
href="http://llvm.cs.uiuc.edu/PR203">RPM package generation</a>.</li>
<li>LLVM has been <a <li>The "tblgen" tool is <a href="TableGenFundamentals.html">now documented</a>.</li>
href="http://mail.cs.uiuc.edu/pipermail/llvmdev/2003-November/000554.html">moved <li>The target-independent code generator got several improvements:
into an 'llvm' C++ namespace</a>, for easier integration with third-party <ul>
code. Note that due to lack of namespace support in GDB 5.x, you will probably <li>It can now fold spill code into instructions (on targets that support it).</li>
want to upgrade to GDB 6 or better to debug LLVM code.</li> <li>A generic machine code spiller/rewriter was added. It provides an API for
global register allocators to eliminate virtual registers and add the
<li> appropriate spill code.</li>
The build system now copies Makefiles dynamically from the source tree to the <li>The represenation of machine code basic blocks is more efficient and has
object tree as subdirectories are built. This means that: an easier to use interface.</li>
<ol> </ul>
<li>
New directories can be added to the source tree, and the build will
automatically pick them up (i.e. no need to re-run <tt>configure</tt>).
</li>
<li>
You will need to build LLVM from the top of the object tree once to ensure
that all of the Makefiles are copied into the object tree subdirectories.
</li>
</ol>
</li> </li>
<li><a href="http://llvm.cs.uiuc.edu/PR253">LLVM now no longer depends on the boost library</a>.</li>
<li>A front-end for "Stacker" (a simple Forth-like language) is now <li>The X86 backend now generates <b>substantially</b> better native code and is faster.</li>
<a href="http://llvm.cs.uiuc.edu/PR136">included in the main LLVM tree</a>. <li>The C backend has been turned moved from the "llvm-dis" tool to the "llc"
Additionally, Reid Spencer, the author, contributed a document <a href="Stacker.html">describing his experiences writing Stacker, and the language itself</a>. This document is invaluable for others writing front-ends targetting LLVM.</li> tool. You can activate it with "<tt>llc -march=c foo.bc -o foo.c</tt>".</li>
<li>LLVM includes a new interprocedural optimization that marks global variables
<li>The <tt>configure</tt> script will now configure all projects placed in the "constant" when they are provably never written to.</li>
<tt>llvm/projects</tt> directory.</li> <li>LLVM now includes a new interprocedural optimization that converts small "by reference" arguments to "by value" arguments, which often improves the performance of C++ programs substantially.</li>
<li>Bugpoint can now do a better job reducing miscompilation problems by
<li>The <tt>-tailcallelim</tt> pass can now introduce "accumulator" variables reducing programs down to a particular loop nest, instead of just the function
to transform functions in many common cases that it could not before.</li> being miscompiled.</li>
<li>The GCSE and LICM passes can now operate on side-effect-free function calls, for example hoisting calls to "<tt>strlen</tt>" and folding "<tt>cos</tt>" common subexpressions.</li>
<li>The <tt>-licm</tt> pass can now sink instructions out the bottom of loops <li>LLVM has early support for a new <a
in addition to being able to hoist them out the top.</li> href="LangRef.html#i_select"><tt>select</tt></a> instruction, though it is
currently only supported by the C backend.</li>
<li>The <tt>-basicaa</tt> pass (the default alias analysis) has been upgraded
to be <a href="http://llvm.cs.uiuc.edu/PR86">significantly more
precise</a>.</li>
<li>LLVM 1.1 implements a simple size optimization for LLVM bytecode files.
This means that the 1.1 files are smaller than 1.0, but that 1.0 won't
read 1.1 bytecode files.</li>
<li><a href="http://llvm.cs.uiuc.edu/PR140">The gccld program produces a runner script that includes command-line options to load the necessary shared objects.</a></li>
</ol> </ol>
@@ -159,133 +143,113 @@ In this release, the following missing features were implemented:
</div> </div>
<ol> <ol>
<li><a href="http://llvm.cs.uiuc.edu/PR88">The interpreter does not support <li><a href="http://llvm.cs.uiuc.edu/PR16">Exception handling in the X86
invoke or unwind</a></li> &amp; Sparc native code generators</a> is now supported</li>
<li>The C/C++ front-end now supports the GCC <tt>__builtin_return_address</tt> and <tt>__builtin_frame_address</tt> extensions. These are also supported by the X86 backend and by the C backend.</li>
<li><a href="http://llvm.cs.uiuc.edu/PR249">[X86] Missing cast from ULong -> Double, cast FP -> bool and support for -9223372036854775808</a></li>
<li>The C/C++ front-end <a href="http://llvm.cs.uiuc.edu/PR273">now supports</a>
the "<a href="http://gcc.gnu.org/onlinedocs/gcc/Labels-as-Values.html#Labels%20as%20Values">labels as values</a>" GCC extension, often used to build "threaded interpreters".</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR99">Interpreter does not support the
<tt>vaarg</tt> instruction</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR117">llvm-nm cannot read archive
files</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR146">Interpreter does not handle
setne constant expression</a></li>
</ol> </ol>
<!--=========================================================================--> <!--=========================================================================-->
<div class="doc_subsubsection"> <div class="doc_subsubsection">
In this release, the following Quality of Implementation issues were <a name="qualityofimp">In this release, the following Quality of Implementation issues were fixed:</a>
fixed:
</div> </div>
<ol> <ol>
<li>The C++ front-end now compiles functions to <li><a href="http://llvm.cs.uiuc.edu/PR135">JIT should lazily initialize global variables</a></li>
<a href="http://llvm.cs.uiuc.edu/PR29">use the linkonce linkage type</a> <li><a href="http://llvm.cs.uiuc.edu/PR192">[X86] X86 Backend never releases memory for machine code structures</a></li>
more, giving the optimizer more freedom.</a></li> <li><a href="http://llvm.cs.uiuc.edu/PR196">[vmcore] OpaqueType objects memory leak</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR182">[llvmgcc] C front-end does not compile "extern inline" into linkonce</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR73">Bytecode format inconsistent</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR209">[loadvn/inline/scalarrepl] Slow optimizations with extremely large basic blocks</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR224">[asmparser] Really slow parsing of types with complex upreferences</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR205">[llvmgcc] C front-end does not emit 'zeroinitializer' when possible</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR233">[llvmgcc] Structure copies result in a LOT of code</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR239">LLVM is now much more memory efficient when handling large zero initialized arrays</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR275">[llvmgcc] Local array initializers are expanded into large amounts of code</a></li>
</ol>
<li>The C front-end now <a href="http://llvm.cs.uiuc.edu/PR84">generates <!--=========================================================================-->
type-safe code</a> in several cases that it did not before, which prevented <div class="doc_subsubsection">
some important optimizations.</li> In this release, the following build problems were fixed:
</div>
<li>The LLVM build system has been taught to catch some common configuration <ol>
problems that <a href="http://llvm.cs.uiuc.edu/PR96">caused it to get <li><a href="http://llvm.cs.uiuc.edu/PR210">[build] Makefiles break if C frontend target string has unexpected value</a></li>
horribly confused</a> before.</li> <li><a href="http://llvm.cs.uiuc.edu/PR214">[build] hard-wired assumption that shared-library extension is ".so"</a></li>
<li><A href="http://llvm.cs.uiuc.edu/PR222">make tools-only doesn't make lib/Support</a></li>
</ol>
<li>The LLVM header files are now <!--=========================================================================-->
<a href="http://llvm.cs.uiuc.edu/PR114">-Wold-style-cast clean</a>.</li> <div class="doc_subsubsection">
<a name="codequality">In this release, the following Code Quality issues were fixed:</a>
</div>
<li>The LLVM bytecode reader has been <a <ol>
href="http://llvm.cs.uiuc.edu/PR127">sped up a lot</a> (up to 4x in some <li><a href="http://llvm.cs.uiuc.edu/PR187">[loopsimplify] Many pointless phi nodes are created</a></li>
cases).</li> <li><a href="http://llvm.cs.uiuc.edu/PR237">[x86] wierd stack/frame pointer manipulation</a></li>
<li>In C++, methods and functions in anonymous namespaces <a href="http://llvm.cs.uiuc.edu/PR85">now get internal linkage</a>.</li> <li>The X86 backend now generate <tt>fchs</tt> to negate floating point numbers,
compiles memcpy() into the <tt>rep movs</tt> instruction, and makes much better
<li>Constant initializers now generate loops instead of potentially <a href="http://llvm.cs.uiuc.edu/PR75">huge amounts of straight-line code</a>.</li> use of powerful addressing modes and instructions.</li>
<li>Code for running C++ destructors is now properly shared when possible. Before, the C++ front-end
<a href="http://llvm.cs.uiuc.edu/PR11">generated N^2 amounts of duplicated cleanup code</a> in some cases.</li>
<li>The JIT used to <a href="http://llvm.cs.uiuc.edu/PR177">generate code for
all functions pointed to by globals</a> immediately, before the program
started execution, but now it waits until the first time they are called to
compile them. This dramatically speeds up short runs of large C++ programs,
which often have large numbers of functions pointed to by vtables.</li>
</ol> </ol>
<!--=========================================================================--> <!--=========================================================================-->
<div class="doc_subsubsection"> <div class="doc_subsubsection">
In this release, the following bugs in the previous release were fixed: <a name="bugfix">In this release, the following bugs in the previous release were fixed:</a>
</div> </div>
<p>Bugs in the LLVM Core:</p> <p>Bugs in the LLVM Core:</p>
<ol> <ol>
<li><a href="http://llvm.cs.uiuc.edu/PR57">[inliner] Inlining invoke with PHI in unwind target is broken</a></li> <li><a href="http://llvm.cs.uiuc.edu/PR179">[licm] LICM promotes volatile memory
<li><a href="http://llvm.cs.uiuc.edu/PR58">[linker] linkonce globals should link successfully to external globals</a></li> locations to registers</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR64">[constmerge] Constant merging pass merges constants with external linkage</a></li> <li><a href="http://llvm.cs.uiuc.edu/PR191">[licm] Memory read after free causes
<li><a href="http://llvm.cs.uiuc.edu/PR66">[scalarrepl] Scalar Replacement of aggregates is decimating structures it shouldn't be</a></li> infrequent crash</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR70">[instcombine] Resolving invoke inserts cast after terminator</a></li> <li><a href="http://llvm.cs.uiuc.edu/PR194">[indvars] Induction variable
<li><a href="http://llvm.cs.uiuc.edu/PR71">llvm-as crashes when labels are used in phi nodes</a></li> canonicalization always makes 32-bit indvars</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR72">[build problem] Callgraph.cpp not pulled in from libipa.a</a></li> <li><a href="http://llvm.cs.uiuc.edu/PR193">[constantmerge] Merging globals can
<li><a href="http://llvm.cs.uiuc.edu/PR77">Variables in scope of output setjmp cause use of invalid pointers!</a></li>
calls should be volatile</a> (Note that this does not effect correctness on <li><a href="http://llvm.cs.uiuc.edu/PR212">[bcreader] Bytecode reader misreads 'long -9223372036854775808'!</a></li>
many platforms, such as X86).</li> <li><a href="http://llvm.cs.uiuc.edu/bugs/show_bug.cgi?id=174">Tail duplication does not update SSA form correctly.</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR83">[X86] Emission of global bool initializers broken</a></li> <li><a href="http://llvm.cs.uiuc.edu/PR218">VMCore mishandles double -0.0</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR91">[gccld] The -r (relinking) option does not work correctly</a></li> <li><a href="http://llvm.cs.uiuc.edu/PR219">[X86] X86 backend code generates -0.0 as +0.0</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR92">[bcreader] Cannot read shift constant expressions from bytecode file</a></li> <li><a href="http://llvm.cs.uiuc.edu/PR223">[loopsimplify] Loopsimplify incorrectly updates dominator information</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR93">[lowersetjmp] Lowersetjmp pass breaks dominance properties!</a></li> <li><a href="http://llvm.cs.uiuc.edu/PR225">[pruneeh] -pruneeh pass removes invoke instructions it shouldn't</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR95">SymbolTable::getUniqueName is very inefficient</a></li> <li><a href="http://llvm.cs.uiuc.edu/PR228">[sparc] Boolean constants are emitted as true and false</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR97">bugpoint must not pass -R&lt;directory&gt; to Mach-O linker</a></li> <li><a href="http://llvm.cs.uiuc.edu/PR234">[interpreter] va_list values silently corrupted by function calls</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR98">[buildscripts] Building into objdir with .o in it fails</a></li> <li><a href="http://llvm.cs.uiuc.edu/PR235">Tablegen aborts on errors</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR101">[setjmp/longjmp] Linking C programs which use setjmp/longjmp sometimes fail with references to the C++ runtime library!</a></li> <li><a href="http://llvm.cs.uiuc.edu/PR236">[inliner] Error inlining intrinsic calls into invoke instructions</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR107">AsmParser Misses Symbol Redefinition Error</a></li> <li><a href="http://llvm.cs.uiuc.edu/PR245">Linking weak and strong global variables is dependent on link order</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR108">gccld -Lfoo -lfoo fails to find ./foo/libfoo.a</a></li> <li><a href="http://llvm.cs.uiuc.edu/PR258">Variables used to define non-printable FP constants are externally visible</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR110">[bcreader] Incorrect cast causes misread forward constant references</a></li> <li><a href="http://llvm.cs.uiuc.edu/PR259">CBE gives linkonce functions wrong linkage semantics</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR116">[adce] ADCE considers blocks without postdominators to be unreachable</a></li> <li><a href="http://llvm.cs.uiuc.edu/PR274">[JIT] Programs cannot resolve the fstat function</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR123">[X86] div and rem constant exprs invalidate iterators!</a></li> <li><a href="http://llvm.cs.uiuc.edu/PR284">[indvars] Induction variable analysis violates LLVM invariants</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR130">[vmcore] Symbol table doesn't rename colliding variables during type resolution</a></li> <li><a href="http://llvm.cs.uiuc.edu/PR296">[execution engines] Unhandled cast constant expression</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR138">Archive reader does not understand 4.4BSD/Mac OS X long filenames</a></li> <li><a href="http://llvm.cs.uiuc.edu/PR299">[Sparc] Code generator asserts on alloca of zero size type</a></li>
</ol> </ol>
<p>Bugs in the C/C++ front-end:</p> <p>Bugs in the C/C++ front-end:</p>
<ol> <ol>
<li><a href="http://llvm.cs.uiuc.edu/PR59">C++ frontend can crash when compiling virtual base classes</a></li> <li><a href="http://llvm.cs.uiuc.edu/PR186">Need weak linkage on memory
<li><a href="http://llvm.cs.uiuc.edu/PR62">C backend fails on constant cast expr to ptr-to-anonymous struct</a></li> management functions in libc runtime to allow them to be overriden</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR63">#ident is not recognized by C frontend</a></li> <li><a href="http://llvm.cs.uiuc.edu/PR202">[llvm-gcc] asserts when an extern inline function is redefined</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR65">C front-end miscompiles the builtin_expect intrinsic!</a></li> <li><a href="http://llvm.cs.uiuc.edu/PR204">[llvmg++] Dynamically initialized constants cannot be marked 'constant'</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR67">1.0 precompiled libstdc++ does not include wchar_t support</a></li> <li><a href="http://llvm.cs.uiuc.edu/PR216">[llvmgcc] floating-point unary minus is incorrect for +0.0</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR68">llvmgcc asserts when compiling functions renamed with asm's</a></li> <li><a href="http://llvm.cs.uiuc.edu/PR221">[llvm-gcc] miscompilation of 'X = Y = Z' with aggregate values</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR69">C frontend crashes on some programs with lots of types.</a></li> <li><a href="http://llvm.cs.uiuc.edu/PR272">[llvmgcc] Invalid code created for complex division operation</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR79">llvm-gcc crashes compiling global union initializer</a></li> <li><a href="http://llvm.cs.uiuc.edu/PR268">[llvmgcc] Incorrect code generation for pointer subtraction</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR80">C front-end crash on empty structure</a></li> <li><a href="http://llvm.cs.uiuc.edu/PR261">[llvmg++] Crash assigning pointers-to-members with casted types</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR81">CFrontend crashes when compiling C99 compound expressions</a></li> <li><a href="http://llvm.cs.uiuc.edu/PR291">[llvm-g++] Cleanups and gotos don't mix properly</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR87">llvm-gcc infinite loops on "case MAXINT:"</a></li> <li><a href="http://llvm.cs.uiuc.edu/PR297">[llvmgcc] Crash on auto register variable with specific register specified</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR89">[C++] Catch blocks make unparsable labels</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR90">[C++] Initializing array with constructable objects fail</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR94">llvm-gcc tries to add bools</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR104">[c++] C++ Frontend lays out superclasses like anonymous bitfields!</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR54">C front-end miscompiles unsigned enums whose LLVM types are signed</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR112">Casting a string constant to void crashes llvm-gcc</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR125">[llvmg++] Enum types are incorrectly shrunk to smaller than 'int' size</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR128">[llvmg++] Cannot use pointer to member to initialize global</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR131">[llvm-gcc] ?: operator as lvalue not implemented</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR133">[C/C++] Bogus warning about taking the address of 'register' variable</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR113">crash assigning into an array in a struct which contains a bitfield</a>.</li>
<li><a href="http://llvm.cs.uiuc.edu/PR6">Oversized integer bitfields cause crash</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR141">[llvm-gcc] Bitfields &amp; large array don't mix well</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR132">[llvm-gcc] Complex division is not supported</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR143">[llvm-gcc] Illegal union field reference</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR148">[llvmg++] Front-end attempts to return structure by value</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR152">[llvmg++] Pointer to member initializers not supported in constructors</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR155">[llvm-gcc] crash on union initialization</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR124">[llvm-g++] ?: expressions do not run correct number of destructors!</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR157">[llvm-gcc] Pointer & constant results in invalid shift</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR165">[llvmg++] call through array of pointers to member functions causes assertion</a></li>
</ol> </ol>
</div> </div>
@@ -299,13 +263,13 @@ many platforms, such as X86).</li>
<div class="doc_text"> <div class="doc_text">
<p>LLVM has been extensively tested on Intel and AMD machines running Red <p>LLVM has been extensively tested on Intel and AMD machines running Red
Hat Linux and has been tested on Sun UltraSPARC workstations running Solaris 8. Hat Linux and FreeBSD. It has also been tested on Sun UltraSPARC workstations running Solaris 8.
Additionally, Additionally,
LLVM works on Mac OS/X 10.3 and above, but only with the C backend or LLVM works on Mac OS X 10.3 and above, but only with the C backend or
interpreter (no native backend for the PowerPC is available yet). interpreter (no native backend for the PowerPC is available yet).
The core LLVM infrastructure uses "autoconf" for portability, so hopefully we The core LLVM infrastructure uses "autoconf" for portability, so hopefully we
work on more platforms than that. However, it is likely that we work on more platforms than that. However, it is likely that we
missed something, and that minor porting is required to get LLVM to work on missed something and that minor porting is required to get LLVM to work on
new platforms. We welcome portability patches and error messages.</p> new platforms. We welcome portability patches and error messages.</p>
</div> </div>
@@ -320,15 +284,38 @@ new platforms. We welcome portability patches and error messages.</p>
<p>This section contains all known problems with the LLVM system, listed by <p>This section contains all known problems with the LLVM system, listed by
component. As new problems are discovered, they will be added to these component. As new problems are discovered, they will be added to these
sections.</p> sections. If you run into a problem, please check the <a
href="http://llvm.cs.uiuc.edu/bugs/">LLVM bug database</a> and submit a bug if
there isn't already one.</p>
</div> </div>
<!-- _______________________________________________________________________ --> <!-- ======================================================================= -->
<!-- <div class="doc_subsection">
</ul><h4><a name="portability"><hr size=0>Portability Problems</h4><ul> <a name="experimental">Experimental features included with this release</a>
--> </div>
<div class="doc_text">
<p>
The following components of this LLVM release are either untested, known to be
broken or unreliable, or are in early development. These components should not
be relied on, and bugs should not be filed against them, but they may be useful
to some people. In particular, if you would like to work on one of these
components, please contact us on the llvmdev list.
</p>
<ul>
<li>The following passes are incomplete or buggy: <tt>-pgmdep, -memdep,
-ipmodref, -sortstructs, -swapstructs, -cee</tt></li>
<li>The <tt>-pre</tt> pass is incomplete (there are cases it doesn't handle that
it should) and not thoroughly tested.</li>
<li>The <tt>llvm-ar</tt> tool is incomplete and probably buggy.</li>
<li>The <tt>llvm-db</tt> tool is in a very early stage of development.</li>
</ul>
</div>
<!-- ======================================================================= --> <!-- ======================================================================= -->
<div class="doc_subsection"> <div class="doc_subsection">
@@ -354,8 +341,13 @@ table in the archive).</li>
<li><a href="http://llvm.cs.uiuc.edu/PR82">LLVM cannot handle structures with <li><a href="http://llvm.cs.uiuc.edu/PR82">LLVM cannot handle structures with
more than 256 elements</a>.</li> more than 256 elements</a>.</li>
</ul> <li>The gccld program <a href="http://llvm.cs.uiuc.edu/PR139">does not link objects/archives in the order specified on the command line.</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR240">The lower-invoke pass does not mark
values live across a setjmp as volatile</a>. This missing feature only affects
targets whose setjmp/longjmp libraries do not save and restore the entire
register file.</li>
</ul>
</div> </div>
<!-- ======================================================================= --> <!-- ======================================================================= -->
@@ -364,14 +356,10 @@ more than 256 elements</a>.</li>
</div> </div>
<!-- _______________________________________________________________________ --> <!-- _______________________________________________________________________ -->
<div class="doc_subsubsection"> <div class="doc_subsubsection">Bugs</div>
Bugs
</div>
<div class="doc_text"> <div class="doc_text">
<ul> <ul>
<li>C99 Variable sized arrays do not release stack memory when they go out of <li>C99 Variable sized arrays do not release stack memory when they go out of
scope. Thus, the following program may run out of stack space: scope. Thus, the following program may run out of stack space:
<pre> <pre>
@@ -381,8 +369,15 @@ more than 256 elements</a>.</li>
} }
</pre></li> </pre></li>
</ul> <li>
Initialization of global union variables can only be done
<a href="http://llvm.cs.uiuc.edu/bugs/show_bug.cgi?id=162">with the largest
union member</a>.
</li>
<li><a href="http://llvm.cs.uiuc.edu/PR244">[llvm-gcc] Error when an implicitly external function is re-declared as static</a></li>
</ul>
</div> </div>
<!-- _______________________________________________________________________ --> <!-- _______________________________________________________________________ -->
@@ -414,14 +409,12 @@ work:
the following extensions are known to <b>not be</b> supported: the following extensions are known to <b>not be</b> supported:
<ol> <ol>
<li><a href="http://gcc.gnu.org/onlinedocs/gcc/Local-Labels.html#Local%20Labels">Local Labels</a>: Labels local to a block.</li> <li><a href="http://gcc.gnu.org/onlinedocs/gcc/Local-Labels.html#Local%20Labels">Local Labels</a>: Labels local to a block.</li>
<li><a href="http://gcc.gnu.org/onlinedocs/gcc/Labels-as-Values.html#Labels%20as%20Values">Labels as Values</a>: Getting pointers to labels, and computed gotos.</li>
<li><a href="http://gcc.gnu.org/onlinedocs/gcc/Nested-Functions.html#Nested%20Functions">Nested Functions</a>: As in Algol and Pascal, lexical scoping of functions.</li> <li><a href="http://gcc.gnu.org/onlinedocs/gcc/Nested-Functions.html#Nested%20Functions">Nested Functions</a>: As in Algol and Pascal, lexical scoping of functions.</li>
<li><a href="http://gcc.gnu.org/onlinedocs/gcc/Constructing-Calls.html#Constructing%20Calls">Constructing Calls</a>: Dispatching a call to another function.</li> <li><a href="http://gcc.gnu.org/onlinedocs/gcc/Constructing-Calls.html#Constructing%20Calls">Constructing Calls</a>: Dispatching a call to another function.</li>
<li><a href="http://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html#Extended%20Asm">Extended Asm</a>: Assembler instructions with C expressions as operands.</li> <li><a href="http://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html#Extended%20Asm">Extended Asm</a>: Assembler instructions with C expressions as operands.</li>
<li><a href="http://gcc.gnu.org/onlinedocs/gcc/Constraints.html#Constraints">Constraints</a>: Constraints for asm operands</li> <li><a href="http://gcc.gnu.org/onlinedocs/gcc/Constraints.html#Constraints">Constraints</a>: Constraints for asm operands.</li>
<li><a href="http://gcc.gnu.org/onlinedocs/gcc/Asm-Labels.html#Asm%20Labels">Asm Labels</a>: Specifying the assembler name to use for a C symbol.</li> <li><a href="http://gcc.gnu.org/onlinedocs/gcc/Asm-Labels.html#Asm%20Labels">Asm Labels</a>: Specifying the assembler name to use for a C symbol.</li>
<li><a href="http://gcc.gnu.org/onlinedocs/gcc/Explicit-Reg-Vars.html#Explicit%20Reg%20Vars">Explicit Reg Vars</a>: Defining variables residing in specified registers.</li> <li><a href="http://gcc.gnu.org/onlinedocs/gcc/Explicit-Reg-Vars.html#Explicit%20Reg%20Vars">Explicit Reg Vars</a>: Defining variables residing in specified registers.</li>
<li><a href="http://gcc.gnu.org/onlinedocs/gcc/Return-Address.html#Return%20Address">Return Address</a>: Getting the return or frame address of a function.</li>
<li><a href="http://gcc.gnu.org/onlinedocs/gcc/Vector-Extensions.html#Vector%20Extensions">Vector Extensions</a>: Using vector instructions through built-in functions.</li> <li><a href="http://gcc.gnu.org/onlinedocs/gcc/Vector-Extensions.html#Vector%20Extensions">Vector Extensions</a>: Using vector instructions through built-in functions.</li>
<li><a href="http://gcc.gnu.org/onlinedocs/gcc/Target-Builtins.html#Target%20Builtins">Target Builtins</a>: Built-in functions specific to particular targets.</li> <li><a href="http://gcc.gnu.org/onlinedocs/gcc/Target-Builtins.html#Target%20Builtins">Target Builtins</a>: Built-in functions specific to particular targets.</li>
<li><a href="http://gcc.gnu.org/onlinedocs/gcc/Thread-Local.html#Thread-Local">Thread-Local</a>: Per-thread variables.</li> <li><a href="http://gcc.gnu.org/onlinedocs/gcc/Thread-Local.html#Thread-Local">Thread-Local</a>: Per-thread variables.</li>
@@ -431,7 +424,7 @@ work:
<p>The following GCC extensions are <b>partially</b> supported. An ignored <p>The following GCC extensions are <b>partially</b> supported. An ignored
attribute means that the LLVM compiler ignores the presence of the attribute, attribute means that the LLVM compiler ignores the presence of the attribute,
but the code should still work. An unsupported attribute is one which is but the code should still work. An unsupported attribute is one which is
ignored by the LLVM compiler, which will cause a different interpretation of ignored by the LLVM compiler and will cause a different interpretation of
the program.</p> the program.</p>
<ol> <ol>
@@ -441,7 +434,7 @@ work:
<li><a href="http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html#Function%20Attributes">Function Attributes</a>: <li><a href="http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html#Function%20Attributes">Function Attributes</a>:
Declaring that functions have no side effects, or that they can never Declaring that functions have no side effects or that they can never
return.<br> return.<br>
<b>Supported:</b> <tt>format</tt>, <tt>format_arg</tt>, <tt>non_null</tt>, <b>Supported:</b> <tt>format</tt>, <tt>format_arg</tt>, <tt>non_null</tt>,
@@ -486,6 +479,7 @@ work:
<p>The following extensions <b>are</b> known to be supported:</p> <p>The following extensions <b>are</b> known to be supported:</p>
<ol> <ol>
<li><a href="http://gcc.gnu.org/onlinedocs/gcc/Labels-as-Values.html#Labels%20as%20Values">Labels as Values</a>: Getting pointers to labels and computed gotos.</li>
<li><a href="http://gcc.gnu.org/onlinedocs/gcc/Statement-Exprs.html#Statement%20Exprs">Statement Exprs</a>: Putting statements and declarations inside expressions.</li> <li><a href="http://gcc.gnu.org/onlinedocs/gcc/Statement-Exprs.html#Statement%20Exprs">Statement Exprs</a>: Putting statements and declarations inside expressions.</li>
<li><a href="http://gcc.gnu.org/onlinedocs/gcc/Typeof.html#Typeof">Typeof</a>: <code>typeof</code>: referring to the type of an expression.</li> <li><a href="http://gcc.gnu.org/onlinedocs/gcc/Typeof.html#Typeof">Typeof</a>: <code>typeof</code>: referring to the type of an expression.</li>
<li><a href="http://gcc.gnu.org/onlinedocs/gcc/Lvalues.html#Lvalues">Lvalues</a>: Using <code>?:</code>, "<code>,</code>" and casts in lvalues.</li> <li><a href="http://gcc.gnu.org/onlinedocs/gcc/Lvalues.html#Lvalues">Lvalues</a>: Using <code>?:</code>, "<code>,</code>" and casts in lvalues.</li>
@@ -500,7 +494,8 @@ work:
<li><a href="http://gcc.gnu.org/onlinedocs/gcc/Subscripting.html#Subscripting">Subscripting</a>: Any array can be subscripted, even if not an lvalue.</li> <li><a href="http://gcc.gnu.org/onlinedocs/gcc/Subscripting.html#Subscripting">Subscripting</a>: Any array can be subscripted, even if not an lvalue.</li>
<li><a href="http://gcc.gnu.org/onlinedocs/gcc/Pointer-Arith.html#Pointer%20Arith">Pointer Arith</a>: Arithmetic on <code>void</code>-pointers and function pointers.</li> <li><a href="http://gcc.gnu.org/onlinedocs/gcc/Pointer-Arith.html#Pointer%20Arith">Pointer Arith</a>: Arithmetic on <code>void</code>-pointers and function pointers.</li>
<li><a href="http://gcc.gnu.org/onlinedocs/gcc/Initializers.html#Initializers">Initializers</a>: Non-constant initializers.</li> <li><a href="http://gcc.gnu.org/onlinedocs/gcc/Initializers.html#Initializers">Initializers</a>: Non-constant initializers.</li>
<li><a href="http://gcc.gnu.org/onlinedocs/gcc/Compound-Literals.html#Compound%20Literals">Compound Literals</a>: Compound literals give structures, unions or arrays as values.</li> <li><a href="http://gcc.gnu.org/onlinedocs/gcc/Compound-Literals.html#Compound%20Literals">Compound Literals</a>: Compound literals give structures, unions,
or arrays as values.</li>
<li><a href="http://gcc.gnu.org/onlinedocs/gcc/Designated-Inits.html#Designated%20Inits">Designated Inits</a>: Labeling elements of initializers.</li> <li><a href="http://gcc.gnu.org/onlinedocs/gcc/Designated-Inits.html#Designated%20Inits">Designated Inits</a>: Labeling elements of initializers.</li>
<li><a href="http://gcc.gnu.org/onlinedocs/gcc/Cast-to-Union.html#Cast%20to%20Union">Cast to Union</a>: Casting to union type from any member of the union.</li> <li><a href="http://gcc.gnu.org/onlinedocs/gcc/Cast-to-Union.html#Cast%20to%20Union">Cast to Union</a>: Casting to union type from any member of the union.</li>
<li><a href="http://gcc.gnu.org/onlinedocs/gcc/Case-Ranges.html#Case%20Ranges">Case Ranges</a>: `case 1 ... 9' and such.</li> <li><a href="http://gcc.gnu.org/onlinedocs/gcc/Case-Ranges.html#Case%20Ranges">Case Ranges</a>: `case 1 ... 9' and such.</li>
@@ -514,6 +509,7 @@ work:
<li><a href="http://gcc.gnu.org/onlinedocs/gcc/Alternate-Keywords.html#Alternate%20Keywords">Alternate Keywords</a>:<code>__const__</code>, <code>__asm__</code>, etc., for header files.</li> <li><a href="http://gcc.gnu.org/onlinedocs/gcc/Alternate-Keywords.html#Alternate%20Keywords">Alternate Keywords</a>:<code>__const__</code>, <code>__asm__</code>, etc., for header files.</li>
<li><a href="http://gcc.gnu.org/onlinedocs/gcc/Incomplete-Enums.html#Incomplete%20Enums">Incomplete Enums</a>: <code>enum foo;</code>, with details to follow.</li> <li><a href="http://gcc.gnu.org/onlinedocs/gcc/Incomplete-Enums.html#Incomplete%20Enums">Incomplete Enums</a>: <code>enum foo;</code>, with details to follow.</li>
<li><a href="http://gcc.gnu.org/onlinedocs/gcc/Function-Names.html#Function%20Names">Function Names</a>: Printable strings which are the name of the current function.</li> <li><a href="http://gcc.gnu.org/onlinedocs/gcc/Function-Names.html#Function%20Names">Function Names</a>: Printable strings which are the name of the current function.</li>
<li><a href="http://gcc.gnu.org/onlinedocs/gcc/Return-Address.html#Return%20Address">Return Address</a>: Getting the return or frame address of a function.</li>
<li><a href="http://gcc.gnu.org/onlinedocs/gcc/Unnamed-Fields.html#Unnamed%20Fields">Unnamed Fields</a>: Unnamed struct/union fields within structs/unions.</li> <li><a href="http://gcc.gnu.org/onlinedocs/gcc/Unnamed-Fields.html#Unnamed%20Fields">Unnamed Fields</a>: Unnamed struct/union fields within structs/unions.</li>
<li><a href="http://gcc.gnu.org/onlinedocs/gcc/Attribute-Syntax.html#Attribute%20Syntax">Attribute Syntax</a>: Formal syntax for attributes.</li> <li><a href="http://gcc.gnu.org/onlinedocs/gcc/Attribute-Syntax.html#Attribute%20Syntax">Attribute Syntax</a>: Formal syntax for attributes.</li>
</ol></li> </ol></li>
@@ -532,7 +528,7 @@ lists, please let us know (also including whether or not they work).</p>
<div class="doc_text"> <div class="doc_text">
<p>For this release, the C++ front-end is considered to be fully functional, but <p>For this release, the C++ front-end is considered to be fully functional but
has not been tested as thoroughly as the C front-end. It has been tested and has not been tested as thoroughly as the C front-end. It has been tested and
works for a number of non-trivial programs, but there may be lurking bugs. works for a number of non-trivial programs, but there may be lurking bugs.
Please report any bugs or problems.</p> Please report any bugs or problems.</p>
@@ -540,17 +536,14 @@ Please report any bugs or problems.</p>
</div> </div>
<!-- _______________________________________________________________________ --> <!-- _______________________________________________________________________ -->
<div class="doc_subsubsection"> <div class="doc_subsubsection">Bugs</div>
Bugs
</div>
<div class="doc_text"> <div class="doc_text">
<ul> <ul>
<li>The C++ front-end inherits all problems afflicting the <a href="#c-fe">C <li>The C++ front-end inherits all problems afflicting the <a href="#c-fe">C
front-end</a></li> front-end</a>.</li>
</ul> </ul>
</div> </div>
<!-- _______________________________________________________________________ --> <!-- _______________________________________________________________________ -->
@@ -570,7 +563,7 @@ href="http://gcc.gnu.org/gcc-3.4/changes.html">GCC 3.4 release notes</a>.</li>
<li>Destructors for local objects are not always run when a <tt>longjmp</tt> is <li>Destructors for local objects are not always run when a <tt>longjmp</tt> is
performed. In particular, destructors for objects in the <tt>longjmp</tt>ing performed. In particular, destructors for objects in the <tt>longjmp</tt>ing
function and in the <tt>setjmp</tt> receiver function may not be run. function and in the <tt>setjmp</tt> receiver function may not be run.
Objects in intervening stack frames will be destroyed however (which is Objects in intervening stack frames will be destroyed, however (which is
better than most compilers).</li> better than most compilers).</li>
<li>The LLVM C++ front-end follows the <a <li>The LLVM C++ front-end follows the <a
@@ -596,12 +589,7 @@ href="http://gcc.gnu.org/gcc-3.4/changes.html">GCC 3.4 release notes</a>.</li>
<div class="doc_text"> <div class="doc_text">
<ul> <ul>
<li>None so far.
<li>The X86 code generator <a
href="http://llvm.cs.uiuc.edu/PR16">does not currently
support the <tt>unwind</tt> instruction</a>, so code that throws a C++ exception
or calls the C <tt>longjmp</tt> function will abort.</li>
</ul> </ul>
</div> </div>
@@ -614,12 +602,7 @@ or calls the C <tt>longjmp</tt> function will abort.</li>
<div class="doc_text"> <div class="doc_text">
<ul> <ul>
<li>There are several programs in the LLVM testsuite that the Sparc code generator is known to miscompile.</li>
<li>The Sparc code generator <a
href="http://llvm.cs.uiuc.edu/PR15">does not currently
support the <tt>unwind</tt> instruction</a>, so code that throws a C++ exception
or calls the C <tt>longjmp</tt> function will abort.</li>
</ul> </ul>
</div> </div>
@@ -659,14 +642,15 @@ frontends.</li>
<div class="doc_text"> <div class="doc_text">
<p>A wide variety of additional information is available on the LLVM web page, <p>A wide variety of additional information is available on the LLVM web page,
including mailing lists publications describing algorithms and components including mailing lists and publications describing algorithms and components
implemented in LLVM. The web page also contains versions of the API implemented in LLVM. The web page also contains versions of the API
documentation which is up-to-date with the CVS version of the source code. You documentation which is up-to-date with the CVS version of the source code. You
can access versions of these documents specific to this release by going into can access versions of these documents specific to this release by going into
the "<tt>llvm/doc/</tt>" directory in the LLVM tree.</p> the "<tt>llvm/doc/</tt>" directory in the LLVM tree.</p>
<p>If you have any questions or comments about LLVM, please feel free to contact <p>If you have any questions or comments about LLVM, please feel free to contact
us via the mailing lists.</p> us via the <a href="http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev">mailing
lists</a>.</p>
</div> </div>
@@ -674,7 +658,7 @@ us via the mailing lists.</p>
<hr> <hr>
<address> <address>
<a href="http://jigsaw.w3.org/css-validator/"><img <a href="http://jigsaw.w3.org/css-validator/check/referer"><img
src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a> src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a>
<a href="http://validator.w3.org/check/referer"><img <a href="http://validator.w3.org/check/referer"><img
src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /></a> src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /></a>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,653 @@
<!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>
<ul>
<li><a href="#introduction">Introduction</a></li>
<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><a href="#syntax">TableGen syntax</a></li>
<ol>
<li><a href="#primitives">TableGen primitives</a></li>
<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><a href="#classesdefs">Classes and definitions</a></li>
<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><a href="#filescope">File scope entities</a></li>
<ol>
<li><a href="#include">File inclusion</a></li>
<li><a href="#globallet">'let' expressions</a></li>
</ol>
</ol>
<li><a href="#backends">TableGen backends</a></li>
<ol>
<li><a href="#">todo</a></li>
</ol>
<li><a href="#codegenerator">The LLVM code generator</a></li>
<ol>
<li><a href="#">todo</a></li>
</ol>
</ul>
<!-- *********************************************************************** -->
<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">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>
<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>
<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>
<p><pre>
<b>def</b> ADDrr8 : I2A8&lt;"add", 0x00, MRMDestReg&gt;,
Pattern&lt;(set R8, (plus R8, R8))&gt;;
</pre></p>
<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>
<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>
<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</tt></a>
</div>
<!----------------------------------------------------------------------------->
<div class="doc_subsubsection">
<a name="comments">TableGen comments</tt></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</tt></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>
<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>
<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</tt></a>
</div>
<div>
<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>
<p><ul>
<li>? - Uninitialized field.</li>
<li>0b1001011 - Binary integer value.</li>
<li>07654321 - Octal integer value (indicated by a leading 0).</li>
<li>7 - Decimal integer value.</li>
<li>0x7F - Hexadecimal integer value.</li>
<li>"foo" - String value.</li>
<li>[{ .... }] - Code fragment.</li>
<li>[ X, Y, Z ] - List value.</li>
<li>{ a, b, c } - Initializer for a "bits&lt;3&gt;" value.</li>
<li>value - Value reference.</li>
<li>value{17} - Access to one or more bits of a value.</li>
<li>DEF - Reference to a record definition.</li>
<li>X.Y - Reference to the subfield of a value.</li>
<li>(DEF a, b) - 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 'dag' values.</li>
</ul></p>
<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</tt></a>
</div>
<div>
<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>
<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>
<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</tt></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.
</div>
<!----------------------------------------------------------------------------->
<div class="doc_subsubsection">
<a name="recordlet">'let' expressions</tt></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>
<p><pre>
<b>class</b> D : C { let V = 0; }
<b>def</b> Z : D;
</pre></p>
<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</tt></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>
<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>
<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>
<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>
<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>
<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>
<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</tt></a>
</div>
<!----------------------------------------------------------------------------->
<div class="doc_subsubsection">
<a name="include">File inclusion</tt></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></p>
</div>
<!----------------------------------------------------------------------------->
<div class="doc_subsubsection">
<a name="globallet">'let' expressions</tt></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>
<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>
<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 TableGen/Record.h.
</p>
</div>
<!-- *********************************************************************** -->
<div class="doc_section"><a name="codegenerator">The LLVM code generator</a></div>
<!-- *********************************************************************** -->
<div class="doc_text">
<p>
This is just a temporary, convenient, place to put stuff about the code
generator before it gets its own document. This should describe all of the
tablegen backends used by the code generator and the classes/definitions they
expect.
</p>
</div>
<!-- *********************************************************************** -->
<hr>
<div class="doc_footer">
<address><a href="mailto:sabre@nondot.org">Chris Lattner</a></address>
<a href="http://llvm.cs.uiuc.edu">The LLVM Compiler Infrastructure</a>
<br>
Last modified: $Date$
</div>
</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> <html>
<head> <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> <title>LLVM Test Suite Guide</title>
<link rel="stylesheet" href="llvm.css" type="text/css">
</head> </head>
<body> <body>
<div class="doc_title"> <div class="doc_title">
@@ -16,256 +15,231 @@
<li><a href="#overview">Overview</a></li> <li><a href="#overview">Overview</a></li>
<li><a href="#Requirements">Requirements</a></li> <li><a href="#Requirements">Requirements</a></li>
<li><a href="#quick">Quick Start</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> <ul>
<li><a href="#codefragments">Code Fragments</a></li> <li><a href="#codefragments">Code Fragments</a></li>
<li><a href="#wholeprograms">Whole Programs</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="#tree">LLVM Test Suite Tree</a></li>
<li><a href="#qmstructure">QMTest Structure</a></li> <li><a href="#qmstructure">QMTest Structure</a></li>
<li><a href="#progstructure">Programs Structure</a></li> <li><a href="#progstructure">Programs Structure</a></li>
<li><a href="#run">Running the LLVM Tests</a></li> <li><a href="#run">Running the LLVM Tests</a></li>
<p><b>Written by John T. Criswell</b></p>
</ol> </ol>
<!--===============================================================--> <p><b>Written by John T. Criswell</b></p>
<div class="doc_section"><a name="overview">Overview</a></div>
<!--===============================================================-->
<div class="doc_text"> <!--===============================================================-->
<p> <div class="doc_section"><a name="overview">Overview</a></div>
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_text">
<div class="doc_section"><a name="Requirements">Requirements</a></div>
<!--===============================================================-->
<div class="doc_text"> <p>This document is the reference manual for the LLVM test suite. It documents
<p> the structure of the LLVM test suite, the tools needed to use it, and how to add
In order to use the LLVM test suite, you will need all of the software and run tests.</p>
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>
<dt><A HREF="http://www.python.org">Python</A></dt> </div>
<dd>You will need a Python interpreter that works with
QMTest. Python will need zlib and SAX support
enabled.</dd>
</dl>
</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"> <div class="doc_text">
<p>
The tests are located in the LLVM source tree under the directory <p>In order to use the LLVM test suite, you will need all of the software
<tt>llvm/test</tt>. To run all of the tests in LLVM, use the Master required to build LLVM, plus the following:</p>
Makefile in that directory:
</p> <dl>
<pre> <dt><a href="http://www.qmtest.com">QMTest</A></dt>
<dd>The LLVM test suite uses QMTest to organize and run tests.</dd>
<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 class="doc_section"><a name="quick">Quick Start</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>
% gmake -C llvm/test % gmake -C llvm/test
</pre> </pre>
<p> <p>To run only the code fragment tests (i.e. those that do basic testing of
To run only the code fragment tests (i.e. those that do basic testing of LLVM), run the tests organized by QMTest:</p>
LLVM), run the tests organized by QMTest:
</p>
<pre> <pre>
% gmake -C llvm/test qmtest % gmake -C llvm/test qmtest
</pre> </pre>
<p> <p>To run only the tests that compile and execute whole programs, run the
To run only the tests that compile and execute whole programs, run the Programs tests:</p>
Programs tests:
</p>
<pre> <pre>
% gmake -C llvm/test/Programs % gmake -C llvm/test/Programs
</pre> </pre>
</div>
<!--===============================================================--> </div>
<div class="doc_section"><h2><a name="org">LLVM Test Suite
Organization </a></h2></div>
<!--===============================================================-->
<div class="doc_text"> <!--===============================================================-->
<p>The LLVM test suite contains two major categories of tests: code <div class="doc_section"><a name="org">LLVM Test Suite Organization</a></div>
fragments and whole programs.</p> <!--===============================================================-->
</div>
<div class="doc_subsection"><a name="codefragments">Code Fragments</a> <div class="doc_text">
</div>
<div class="doc_text"> <p>The LLVM test suite contains two major categories of tests: code
<p> fragments and whole programs.</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>
<div class="doc_text"> <div class="doc_subsection"><a name="codefragments">Code Fragments</a>
<p> </div>
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_text">
<div class="doc_section"><h2><a name="tree">LLVM Test Suite Tree</a>
</div>
<!--===============================================================-->
<div class="doc_text"> <p>Code fragments are small pieces of code that test a specific feature of LLVM
<p>Each type of test in the LLVM test suite has its own directory. The or trigger a specific bug in LLVM. They are usually written in LLVM assembly
major subtrees of the test suite directory tree are as follows:</p> language, but can be written in other languages if the test targets a particular
language front end.</p>
<ul> <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 <li>Features
<p> <p>This directory contains sample codes that test various features of the
This directory contains sample codes that test various features LLVM language. These pieces of sample code are run through various
of the LLVM language. These pieces of sample code are run assembler, disassembler, and optimizer passes.</p>
through various assembler, disassembler, and optimizer passes.
</p>
<li>Regression <li>Regression
<p> <p>This directory contains regression tests for LLVM. When a bug is found
This directory contains regression tests for LLVM. When a bug in LLVM, a regression test containing just enough code to reproduce the
is found in LLVM, a regression test containing just enough problem should be written and placed somewhere underneath this directory.
code to reproduce the problem should be written and placed In most cases, this will be a small piece of LLVM assembly language code,
somewhere underneath this directory. In most cases, this often distilled from an actual application or benchmark.</p>
will be a small piece of LLVM assembly language code, often
distilled from an actual application or benchmark.
</p>
<li>Programs <li>Programs
<p> <p>The Programs directory contains programs that can be compiled with LLVM
The Programs directory contains programs that can be compiled and executed. These programs are compiled using the native compiler and
with LLVM and executed. These programs are compiled using the various LLVM backends. The output from the program compiled with the native
native compiler and various LLVM backends. The output from the compiler is assumed correct; the results from the other programs are
program compiled with the native compiler is assumed correct; compared to the native program output and pass if they match. </p>
the results from the other programs are compared to the native
program output and pass if they match. <p> In addition for testing correctness, the Programs directory also
</p><p> performs timing tests of various LLVM optimizations. It also records
In addition for testing correctness, the Programs directory compilation times for the compilers and the JIT. This information can be
also performs timing tests of various LLVM optimizations. used to compare the effectiveness of LLVM's optimizations and code
It also records compilation times for the compilers and the generation.</p>
JIT. This information can be used to compare the
effectiveness of LLVM's optimizations and code generation. <p>The Programs directory is subdivided into several smaller subdirectories:
</p><p>
The Programs directory is subdivided into several smaller
subdirectories:
</p> </p>
<ul> <ul>
<li>Programs/SingleSource <li>Programs/SingleSource
<p> <p>The SingleSource directory contains test programs that are only a
The SingleSource directory contains test programs that single source file in size. These are usually small benchmark programs
are only a single source file in size. These are or small programs that calculate a particular value. Several such
usually small benchmark programs or small programs that programs are grouped together in each directory.</p></li>
calculate a particular value. Several such programs are
grouped together in each directory.
</p>
<li>Programs/MultiSource <li>Programs/MultiSource
<p> <p>The MultiSource directory contains subdirectories which contain
The MultiSource directory contains subdirectories which entire programs with multiple source files. Large benchmarks and whole
contain entire programs with multiple source files. applications go here.</p></li>
Large benchmarks and whole applications go here.
</p>
<li>Programs/External <li>Programs/External
<p> <p>The External directory contains Makefiles for building code that is
The External directory contains Makefiles for building external to (i.e. not distributed with) LLVM. The most prominent member
code that is external to (i.e. not distributed with) of this directory is the SPEC 2000 benchmark suite. The presence and
LLVM. The most prominent member of this directory is location of these external programs is configured by the LLVM
the SPEC 2000 benchmark suite. The presence and <tt>configure</tt> script.</p></li>
location of these external programs is configured by the
LLVM <tt>configure</tt> script.
</p>
</ul>
<p> </ul></li>
<li>QMTest <li>QMTest
<p> <p>This directory contains the QMTest information files. Inside this
This directory contains the QMTest information files. Inside directory are QMTest administration files and the Python code that
this directory are QMTest administration files and the Python implements the LLVM test and database classes.</p>
code that implements the LLVM test and database classes.
</p>
</ul>
</div>
<!--===============================================================--> </ul>
<div class="doc_section"><h2><a name="qmstructure">QMTest Structure</a>
</div>
<!--===============================================================-->
<div class="doc_text"> </div>
<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> <!--===============================================================-->
<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 <li>Feature
<p> <p>
These are the feature tests found in the Feature directory. These are the feature tests found in the Feature directory.
@@ -273,157 +247,137 @@
</p> </p>
<ul> <ul>
<li>ad <li>ad
<p> <p>Assembler/Disassembler tests. These tests verify that a piece of LLVM
Assembler/Disassembler tests. These tests verify that a assembly language can be assembled into bytecode and then disassembled
piece of LLVM assembly language can be assembled into into the original assembly language code. It does this several times to
bytecode and then disassembled into the original ensure that assembled output can be disassembled and disassembler output
assembly language code. It does this several times to can be assembled. It also verifies that the give assembly language file
ensure that assembled output can be disassembled and can be assembled correctly.</p></li>
disassembler output can be assembled. It also verifies
that the give assembly language file can be assembled
correctly.
</p>
<li>opt <li>opt
<p> <p>Optimizer tests. These tests verify that two of the optimizer passes
Optimizer tests. These tests verify that two of the completely optimize a program (i.e. after a single pass, they cannot
optimizer passes completely optimize a program (i.e. optimize a program any further).</p></li>
after a single pass, they cannot optimize a program
any further).
</p>
<li>mc <li>mc
<p> <p> Machine code tests. These tests verify that the LLVM assembly
Machine code tests. These tests verify that the LLVM language file can be translated into native assembly code.</p></li>
assembly language file can be translated into native
assembly code.
</p>
<li>cc <li>cc
<p> <p>C code tests. These tests verify that the specified LLVM assembly
C code tests. These tests verify that the specified code can be converted into C source code using the C backend.</p></li>
LLVM assembly code can be converted into C source code
using the C backend.
</p>
</ul> </ul>
<p> <p>The LLVM database class looks at every file in the Feature directory and
The LLVM database class looks at every file in the Feature creates a fake test hierarchy containing
directory and creates a fake test hierarchy containing <tt>Feature.&lt;testtype&gt;.&lt;testname&gt;</tt>. So, if you add an LLVM
<tt>Feature.&lt;testtype&gt;.&lt;testname&gt;</tt>. So, if you assembly language file to the Feature directory, it actually creates 5 new
add an LLVM assembly language file to the Feature directory, it tests: assembler/disassembler, assembler, optimizer, machine code, and C code.
actually creates 5 new tests: assembler/disassembler, assembler,
optimizer, machine code, and C code.
</p> </p>
<li>Regression <li>Regression
<p> <p>These are the regression tests. There is one suite for each
These are the regression tests. There is one suite for each subdirectory of the Regression directory. If you add a new subdirectory
subdirectory of the Regression directory. If you add a new there, you will need to modify, at least, the <tt>RegressionMap</tt>
subdirectory there, you will need to modify, at least, the variable in <tt>QMTest/llvmdb.py</tt> so that QMTest knows how to run the
<tt>RegressionMap</tt> variable in <tt>QMTest/llvmdb.py</tt> so tests in the new subdirectory.</p>
that QMTest knows how to run the tests in the new subdirectory.
</p>
</ul>
</div>
<!--===============================================================--> </ul>
<div class="doc_section"><h2><a name="progstructure">Programs
Structure</a></div>
<!--===============================================================-->
<div class="doc_text"> </div>
<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"><h2><a name="run">Running the LLVM Tests</a> <div class="doc_section"><a name="progstructure">Programs Structure</a></div>
</div> <!--===============================================================-->
<!--===============================================================-->
<div class="doc_text"> <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> <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 % cd llvm/test/Programs
% gmake TEST=nightly test % gmake TEST=nightly test
</pre> </pre>
<p> <p>Regardless of which test you're running, the results are printed on standard
Regardless of which test you're running, the results are printed on output and standard error. You can redirect these results to a file if you
standard output and standard error. You can redirect these results to a choose.</p>
file if you choose.
</p><p> <p>Some tests are known to fail. Some are bugs that we have not fixed yet;
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,
others are features that we haven't added yet (or may never add). In the result for such tests will be XFAIL (eXpected FAILure). In this way, you
QMTest, the result for such tests will be XFAIL (eXpected FAILure). In can tell the difference between an expected and unexpected failure.</p>
this way, you can tell the difference between an expected and unexpected
failure. <p>The Programs tests have no such feature as of this time. If the test passes,
</p><p> only warnings and other miscellaneous output will be generated. If a test
The Programs tests have no such feature as of this time. If the test fails, a large &lt;program&gt; FAILED message will be displayed. This will help
passes, only warnings and other miscellaneous output will be generated. you separate benign warnings from actual test failures.</p>
If a test fails, a large &lt;program&gt; FAILED message will be
displayed. This will help you separate benign warnings from actual test </div>
failures.
</p>
</div>
<!-- *********************************************************************** --> <!-- *********************************************************************** -->
<hr><font size="-1"> <hr>
<address>John T. Criswell</address> <address>
<a href="http://llvm.cs.uiuc.edu">The LLVM Compiler Infrastructure</a> <a href="http://jigsaw.w3.org/css-validator/check/referer"><img
<br> src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a>
Last modified: $Date$ <a href="http://validator.w3.org/check/referer"><img
</font> 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> </body>
</html> </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. # 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. # 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 # The GENERATE_TODOLIST tag can be used to enable (YES) or
# disable (NO) the todo list. This list is created by putting \todo # 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 # directories like "/usr/src/myproject". Separate the files or directories with
# spaces. # spaces.
INPUT = .. INPUT = .. ./doxygen.intro
# If the value of the INPUT tag contains directories, you can use the # 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 # FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
@@ -439,20 +439,20 @@ HTML_OUTPUT = .
# each generated HTML page. If it is left blank doxygen will generate a # each generated HTML page. If it is left blank doxygen will generate a
# standard header. # standard header.
HTML_HEADER = HTML_HEADER = doxygen.header
# The HTML_FOOTER tag can be used to specify a personal HTML footer for # 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 # each generated HTML page. If it is left blank doxygen will generate a
# standard footer. # standard footer.
HTML_FOOTER = HTML_FOOTER = doxygen.footer
# The HTML_STYLESHEET tag can be used to specify a user defined cascading # 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 # 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 # fine-tune the look of the HTML output. If the tag is left blank doxygen
# will generate a default style sheet # 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, # 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 # files or namespaces will be aligned in HTML using tables. If set to

84
llvm/docs/doxygen.css Normal file
View File

@@ -0,0 +1,84 @@
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: 105%
font-weight: bold;
text-decoration: underline;
text-align: center;
}

9
llvm/docs/doxygen.footer Normal file
View File

@@ -0,0 +1,9 @@
<hr>
<p class="footer">
Generated on $datetime for $projectname version $projectnumber by
<a href="http://www.doxygen.org/index.html">doxygen $doxygenversion</a><br/>
Copyright &copy; 2003, University of Illinois at Urbana-Champaign. All Rights Reserved.<br/>
<a href="/index.php" onmouseover="window.status='Go To LLVM Home Page';return true;" title="LLVM Home Page">Home Page</a>
<a href="http://www.doxygen.org/index.html" onmouseover="window.status='Go To Doxygen Home Page';return true;" title="Doxygen Home Page">
<img src="doxygen.png" alt="Doxygen Logo" style="border:none;"/></a>
</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

@@ -48,7 +48,7 @@ Getting Started with LLVM
<dt> <dt>
For license information: For license information:
<dd> <dd>
<a href="../LICENSE.TXT">llvm/LICENSE.TXT</a> <a href="http://llvm.cs.uiuc.edu/cvsweb/cvsweb.cgi/llvm/LICENSE.TXT?rev=HEAD&content-type=text/x-cvsweb-markup">llvm/LICENSE.TXT</a>
<p> <p>
<dt> <dt>
@@ -120,11 +120,11 @@ LLVM Design Overview:
<dl compact> <dl compact>
<dt> <dt>
LLVM : A Compilation Framework for Lifelong Program Analysis LLVM: A Compilation Framework for Lifelong Program Analysis
and Transformation: &amp; Transformation
<dd> <dd>
<a href="http://llvm.cs.uiuc.edu/pubs/2003-09-30-LifelongOptimizationTR.html"> <a href="http://llvm.cs.uiuc.edu/pubs/2004-01-30-CGO-LLVM.html">
http://llvm.cs.uiuc.edu/pubs/2003-09-30-LifelongOptimizationTR.html </a> http://llvm.cs.uiuc.edu/pubs/2004-01-30-CGO-LLVM.html </a>
</dl> </dl>
@@ -182,6 +182,20 @@ LLVM Programming Documentation:
<a href="AliasAnalysis.html"> llvm/docs/AliasAnalysis.html</a> <a href="AliasAnalysis.html"> llvm/docs/AliasAnalysis.html</a>
<p> <p>
<dt>
Source Level Debugging with LLVM:
<dd>
<a href="SourceLevelDebugging.html"> llvm/docs/SourceLevelDebugging.html</a>
<p>
<dt>
TableGen Fundamentals:
<dd>
<a href="TableGenFundamentals.html"> llvm/docs/TableGenFundamentals.html</a>
<p>
<dt> <dt>
The Stacker Cronicles The Stacker Cronicles
<dd> <dd>

View File

@@ -47,5 +47,6 @@ address { clear: right; }
.doc_red { color: red } .doc_red { color: red }
.doc_table { text-align: center; width: 90%; padding: 1 1 1 1; border: 1 1 1 1 ; } .doc_table { text-align: center; width: 90%;
padding: 1px 1px 1px 1px; border: 1px; }

BIN
llvm/docs/venusflytrap.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

View File

@@ -8,12 +8,6 @@
/* Define to 1 if using `alloca.c'. */ /* Define to 1 if using `alloca.c'. */
#undef C_ALLOCA #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. */ /* Define to 1 if you have `alloca', as a function or macro. */
#undef HAVE_ALLOCA #undef HAVE_ALLOCA
@@ -21,11 +15,8 @@
*/ */
#undef HAVE_ALLOCA_H #undef HAVE_ALLOCA_H
/* Define to 1 if you have the <assert.h> header file. */ /* Define to 1 if you have the `backtrace' function. */
#undef HAVE_ASSERT_H #undef HAVE_BACKTRACE
/* define if the compiler has bidirectional iterator */
#undef HAVE_BI_ITERATOR
/* Define to 1 if you have the <dlfcn.h> header file. */ /* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H #undef HAVE_DLFCN_H
@@ -33,18 +24,12 @@
/* Define if dlopen() is available on this platform. */ /* Define if dlopen() is available on this platform. */
#undef HAVE_DLOPEN #undef HAVE_DLOPEN
/* Define to 1 if you have the <errno.h> header file. */ /* Define to 1 if you have the <execinfo.h> header file. */
#undef HAVE_ERRNO_H #undef HAVE_EXECINFO_H
/* define if the compiler has ext/slist */
#undef HAVE_EXT_SLIST
/* Define to 1 if you have the <fcntl.h> header file. */ /* Define to 1 if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H #undef HAVE_FCNTL_H
/* define if the compiler has STL iterators */
#undef HAVE_FWD_ITERATOR
/* Define to 1 if you have the `getcwd' function. */ /* Define to 1 if you have the `getcwd' function. */
#undef HAVE_GETCWD #undef HAVE_GETCWD
@@ -54,22 +39,6 @@
/* Define to 1 if you have the `gettimeofday' function. */ /* Define to 1 if you have the `gettimeofday' function. */
#undef HAVE_GETTIMEOFDAY #undef HAVE_GETTIMEOFDAY
/* Define if the compiler has a header <hash_map> that defines template class
::hash_map. */
#undef HAVE_GLOBAL_HASH_MAP
/* Define if the compiler has a header <hash_set> that defines template class
::hash_set. */
#undef HAVE_GLOBAL_HASH_SET
/* Define if the compiler has a header <ext/hash_map> that defines template
class __gnu_cxx::hash_map. */
#undef HAVE_GNU_EXT_HASH_MAP
/* Define if the compiler has a header <ext/hash_set> that defines template
class __gnu_cxx::hash_set. */
#undef HAVE_GNU_EXT_HASH_SET
/* Define to 1 if the system has the type `int64_t'. */ /* Define to 1 if the system has the type `int64_t'. */
#undef HAVE_INT64_T #undef HAVE_INT64_T
@@ -95,9 +64,6 @@
/* Define to 1 if you have the <malloc.h> header file. */ /* Define to 1 if you have the <malloc.h> header file. */
#undef HAVE_MALLOC_H #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. */ /* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H #undef HAVE_MEMORY_H
@@ -117,57 +83,21 @@
/* Define to have the %a format string */ /* Define to have the %a format string */
#undef HAVE_PRINTF_A #undef HAVE_PRINTF_A
/* Define if PThread mutexes (e.g., pthread_mutex_lock) are available in the
system's thread library. */
#undef HAVE_PTHREAD_MUTEX_LOCK
/* Define to 1 if you have the <signal.h> header file. */
#undef HAVE_SIGNAL_H
/* Define to 1 if you have the <stdint.h> header file. */ /* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H #undef HAVE_STDINT_H
/* Define to 1 if you have the <stdlib.h> header file. */ /* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H #undef HAVE_STDLIB_H
/* Define if the compiler has a header <ext/hash_map> that defines template
class std::hash_map. */
#undef HAVE_STD_EXT_HASH_MAP
/* Define if the compiler has a header <ext/hash_set> that defines template
class std::hash_set. */
#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 you have the `strdup' function. */ /* Define to 1 if you have the `strdup' function. */
#undef HAVE_STRDUP #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. */ /* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H #undef HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */ /* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H #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. */ /* Define to 1 if you have the `strtoll' function. */
#undef HAVE_STRTOLL #undef HAVE_STRTOLL
@@ -216,6 +146,9 @@
/* Define as the return type of signal handlers (`int' or `void'). */ /* Define as the return type of signal handlers (`int' or `void'). */
#undef RETSIGTYPE #undef RETSIGTYPE
/* Extension that shared libraries have, e.g., ".so". */
#undef SHLIBEXT
/* If using the C implementation of alloca, define if you know the /* If using the C implementation of alloca, define if you know the
direction of stack growth for your system; otherwise it will be direction of stack growth for your system; otherwise it will be
automatically deduced at run-time. automatically deduced at run-time.
@@ -237,13 +170,6 @@
`char[]'. */ `char[]'. */
#undef YYTEXT_POINTER #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. */ /* Define to `int' if <sys/types.h> does not define. */
#undef pid_t #undef pid_t

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 errno.h (if it lives
* on the system).
*/
#ifndef _CONFIG_ERRNO_H
#define _CONFIG_ERRNO_H
#include "Config/config.h"
#ifdef HAVE_ERRNO_H
#include <errno.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 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

@@ -1,4 +1,4 @@
/*===-- Config/sys/resource.h - Annotation classes --------------*- C++ -*-===// /*===-- Config/sys/resource.h -----------------------------------*- C++ -*-===//
* *
* The LLVM Compiler Infrastructure * The LLVM Compiler Infrastructure
* *

View File

@@ -1,4 +1,4 @@
/*===-- Config/sys/stat.h - Annotation classes --------------*- ----C++ -*-===// /*===-- Config/sys/stat.h -----------------------------------*- ----C++ -*-===//
* *
* The LLVM Compiler Infrastructure * The LLVM Compiler Infrastructure
* *

View File

@@ -1,4 +1,4 @@
/*===-- Config/sys/time.h - Annotation classes ------------------*- C++ -*-===// /*===-- Config/sys/time.h ---------------------------------------*- C++ -*-===//
* *
* The LLVM Compiler Infrastructure * The LLVM Compiler Infrastructure
* *

View File

@@ -1,4 +1,4 @@
/*===-- Config/sys/types.h - Annotation classes --------------*- C++ -*-===// /*===-- Config/sys/types.h --------------------------------------*- C++ -*-===//
* *
* The LLVM Compiler Infrastructure * 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 * The LLVM Compiler Infrastructure
* *

View File

@@ -68,7 +68,7 @@ class Annotation {
Annotation *Next; // The next annotation in the linked list Annotation *Next; // The next annotation in the linked list
public: public:
inline Annotation(AnnotationID id) : ID(id), Next(0) {} inline Annotation(AnnotationID id) : ID(id), Next(0) {}
virtual ~Annotation() {} // Designed to be subclassed virtual ~Annotation(); // Designed to be subclassed
// getID - Return the unique ID# of this annotation // getID - Return the unique ID# of this annotation
inline AnnotationID getID() const { return ID; } inline AnnotationID getID() const { return ID; }
@@ -95,14 +95,7 @@ class Annotable {
void operator=(const Annotable &); // Do not implement void operator=(const Annotable &); // Do not implement
public: public:
Annotable() : AnnotationList(0) {} Annotable() : AnnotationList(0) {}
virtual ~Annotable() { // Virtual because it's designed to be subclassed... virtual ~Annotable(); // Virtual because it's designed to be subclassed...
Annotation *A = AnnotationList;
while (A) {
Annotation *Next = A->getNext();
delete A;
A = Next;
}
}
// getAnnotation - Search the list for annotations of the specified ID. The // getAnnotation - Search the list for annotations of the specified ID. The
// pointer returned is either null (if no annotations of the specified ID // pointer returned is either null (if no annotations of the specified ID

View File

@@ -20,14 +20,15 @@
#ifndef SUPPORT_COMMANDLINE_H #ifndef SUPPORT_COMMANDLINE_H
#define SUPPORT_COMMANDLINE_H #define SUPPORT_COMMANDLINE_H
#include "Support/type_traits.h"
#include <string> #include <string>
#include <vector> #include <vector>
#include <utility> #include <utility>
#include <cstdarg> #include <cstdarg>
#include <cassert> #include <cassert>
#include "boost/type_traits/object_traits.hpp"
namespace llvm { namespace llvm {
/// cl Namespace - This namespace contains all of the command line option /// cl Namespace - This namespace contains all of the command line option
/// processing machinery. It is intentionally a short name to make qualified /// processing machinery. It is intentionally a short name to make qualified
/// usage concise. /// usage concise.
@@ -719,7 +720,7 @@ template <class DataType, bool ExternalStorage = false,
class ParserClass = parser<DataType> > class ParserClass = parser<DataType> >
class opt : public Option, class opt : public Option,
public opt_storage<DataType, ExternalStorage, public opt_storage<DataType, ExternalStorage,
::boost::is_class<DataType>::value> { is_class<DataType>::value> {
ParserClass Parser; ParserClass Parser;
virtual bool handleOccurrence(const char *ArgName, const std::string &Arg) { virtual bool handleOccurrence(const char *ArgName, const std::string &Arg) {

View File

@@ -11,7 +11,6 @@
// This file is important because different host OS's define different macros, // This file is important because different host OS's define different macros,
// which makes portability tough. This file exports the following definitions: // which makes portability tough. This file exports the following definitions:
// //
// ENDIAN_LITTLE : is #define'd if the host is little endian
// int64_t : is a typedef for the signed 64 bit system type // int64_t : is a typedef for the signed 64 bit system type
// uint64_t : is a typedef for the unsigned 64 bit system type // uint64_t : is a typedef for the unsigned 64 bit system type
// INT64_MAX : is a #define specifying the max value for int64_t's // INT64_MAX : is a #define specifying the max value for int64_t's
@@ -23,39 +22,24 @@
#ifndef SUPPORT_DATATYPES_H #ifndef SUPPORT_DATATYPES_H
#define SUPPORT_DATATYPES_H #define SUPPORT_DATATYPES_H
#include "Config/config.h"
// Note that this header's correct operation depends on __STDC_LIMIT_MACROS // Note that this header's correct operation depends on __STDC_LIMIT_MACROS
// being defined. We would define it here, but in order to prevent Bad Things // being defined. We would define it here, but in order to prevent Bad Things
// happening when system headers or C++ STL headers include stdint.h before // happening when system headers or C++ STL headers include stdint.h before
// we define it here, we define it on the g++ command line (in Makefile.rules). // we define it here, we define it on the g++ command line (in Makefile.rules).
#if !defined(__STDC_LIMIT_MACROS)
#ifdef HAVE_STDINT_H # error "Must #define __STDC_LIMIT_MACROS before #including Support/DataTypes.h"
#include <stdint.h>
#endif #endif
#ifdef HAVE_INTTYPES_H // Note that <inttypes.h> includes <stdint.h>, if this is a C99 system.
#include <inttypes.h> @INCLUDE_INTTYPES_H@
#endif @INCLUDE_SYS_TYPES_H@
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#if (defined(ENDIAN_LITTLE) && defined(ENDIAN_BIG))
#error "Cannot define both ENDIAN_LITTLE and ENDIAN_BIG!"
#endif
#if (!defined(ENDIAN_LITTLE) && !defined(ENDIAN_BIG))
#error "include/Support/DataTypes.h could not determine endianness!"
#endif
#if !defined(INT64_MAX) #if !defined(INT64_MAX)
/* We couldn't determine INT64_MAX; default it. */ /* We couldn't determine INT64_MAX; default it. */
#define INT64_MAX 9223372036854775807LL # define INT64_MAX 9223372036854775807LL
#endif #endif
#if !defined(UINT64_MAX) #if !defined(UINT64_MAX)
#define UINT64_MAX 0xffffffffffffffffULL # define UINT64_MAX 0xffffffffffffffffULL
#endif #endif
#endif /* SUPPORT_DATATYPES_H */ #endif /* SUPPORT_DATATYPES_H */

View File

@@ -0,0 +1,63 @@
//===- DenseMap.h - A dense map implmentation -------------------*- C++ -*-===//
//
// 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 implements a dense map. A dense map template takes two
// types. The first is the mapped type and the second is a functor
// that maps its argument to a size_t. On instantiation a "null" value
// can be provided to be used as a "does not exist" indicator in the
// map. A member function grow() is provided that given the value of
// the maximally indexed key (the argument of the functor) makes sure
// the map has enough space for it.
//
//===----------------------------------------------------------------------===//
#ifndef SUPPORT_DENSEMAP_H
#define SUPPORT_DENSEMAP_H
#include <vector>
namespace llvm {
template <typename T, typename ToIndexT>
class DenseMap {
typedef typename ToIndexT::argument_type IndexT;
typedef std::vector<T> StorageT;
StorageT storage_;
T nullVal_;
ToIndexT toIndex_;
public:
DenseMap() : nullVal_(T()) { }
explicit DenseMap(const T& val) : nullVal_(val) { }
typename StorageT::reference operator[](IndexT n) {
assert(toIndex_(n) < storage_.size() && "index out of bounds!");
return storage_[toIndex_(n)];
}
typename StorageT::const_reference operator[](IndexT n) const {
assert(toIndex_(n) < storage_.size() && "index out of bounds!");
return storage_[toIndex_(n)];
}
void clear() {
storage_.clear();
}
void grow(IndexT n) {
unsigned NewSize = toIndex_(n) + 1;
if (NewSize > storage_.size())
storage_.resize(NewSize, nullVal_);
}
};
} // End llvm namespace
#endif

295
llvm/include/Support/ELF.h Normal file
View File

@@ -0,0 +1,295 @@
//===-- Support/ELF.h - ELF constants and data structures -------*- C++ -*-===//
//
// 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 contains common, non-processor-specific data structures and
// constants for the ELF file format.
//
// The details of the ELF32 bits in this file are largely based on
// the Tool Interface Standard (TIS) Executable and Linking Format
// (ELF) Specification Version 1.2, May 1995. The ELF64 stuff is not
// standardized, as far as I can tell. It was largely based on information
// I found in OpenBSD header files.
//
//===----------------------------------------------------------------------===//
#include "Support/DataTypes.h"
#include <cstring>
#include <cstdlib>
namespace llvm {
namespace ELF {
typedef uint32_t Elf32_Addr; // Program address
typedef uint16_t Elf32_Half;
typedef uint32_t Elf32_Off; // File offset
typedef int32_t Elf32_Sword;
typedef uint32_t Elf32_Word;
typedef uint64_t Elf64_Addr;
typedef uint64_t Elf64_Off;
typedef int32_t Elf64_Shalf;
typedef int32_t Elf64_Sword;
typedef uint32_t Elf64_Word;
typedef int64_t Elf64_Sxword;
typedef uint64_t Elf64_Xword;
typedef uint32_t Elf64_Half;
typedef uint16_t Elf64_Quarter;
// Object file magic string.
static const char ElfMagic[] = { 0x7f, 'E', 'L', 'F', '\0' };
struct Elf32_Ehdr {
unsigned char e_ident[16]; // ELF Identification bytes
Elf32_Half e_type; // Type of file (see ET_* below)
Elf32_Half e_machine; // Required architecture for this file (see EM_*)
Elf32_Word e_version; // Must be equal to 1
Elf32_Addr e_entry; // Address to jump to in order to start program
Elf32_Off e_phoff; // Program header table's file offset, in bytes
Elf32_Off e_shoff; // Section header table's file offset, in bytes
Elf32_Word e_flags; // Processor-specific flags
Elf32_Half e_ehsize; // Size of ELF header, in bytes
Elf32_Half e_phentsize; // Size of an entry in the program header table
Elf32_Half e_phnum; // Number of entries in the program header table
Elf32_Half e_shentsize; // Size of an entry in the section header table
Elf32_Half e_shnum; // Number of entries in the section header table
Elf32_Half e_shstrndx; // Sect hdr table index of sect name string table
bool checkMagic () const {
return (memcmp (e_ident, ElfMagic, strlen (ElfMagic))) == 0;
}
unsigned char getFileClass () const { return e_ident[4]; }
unsigned char getDataEncoding () { return e_ident[5]; }
};
// 64-bit ELF header. Fields are the same as for ELF32, but with different
// types (see above).
struct Elf64_Ehdr {
unsigned char e_ident[16];
Elf64_Quarter e_type;
Elf64_Quarter e_machine;
Elf64_Half e_version;
Elf64_Addr e_entry;
Elf64_Off e_phoff;
Elf64_Off e_shoff;
Elf64_Half e_flags;
Elf64_Quarter e_ehsize;
Elf64_Quarter e_phentsize;
Elf64_Quarter e_phnum;
Elf64_Quarter e_shentsize;
Elf64_Quarter e_shnum;
Elf64_Quarter e_shstrndx;
};
// File types
enum {
ET_NONE = 0, // No file type
ET_REL = 1, // Relocatable file
ET_EXEC = 2, // Executable file
ET_DYN = 3, // Shared object file
ET_CORE = 4, // Core file
ET_LOPROC = 0xff00, // Beginning of processor-specific codes
ET_HIPROC = 0xffff // Processor-specific
};
// Machine architectures
enum {
EM_NONE = 0, // No machine
EM_M32 = 1, // AT&T WE 32100
EM_SPARC = 2, // SPARC
EM_386 = 3, // Intel 386
EM_68K = 4, // Motorola 68000
EM_88K = 5, // Motorola 88000
EM_486 = 6, // Intel 486 (deprecated)
EM_860 = 7, // Intel 80860
EM_MIPS = 8, // MIPS R3000
EM_PPC = 20, // PowerPC
EM_ARM = 40, // ARM
EM_ALPHA = 41, // DEC Alpha
EM_SPARCV9 = 43 // SPARC V9
};
// Object file classes.
enum {
ELFCLASS32 = 1, // 32-bit object file
ELFCLASS64 = 2 // 64-bit object file
};
// Object file byte orderings.
enum {
ELFDATA2LSB = 1, // Little-endian object file
ELFDATA2MSB = 2 // Big-endian object file
};
// Section header.
struct Elf32_Shdr {
Elf32_Word sh_name; // Section name (index into string table)
Elf32_Word sh_type; // Section type (SHT_*)
Elf32_Word sh_flags; // Section flags (SHF_*)
Elf32_Addr sh_addr; // Address where section is to be loaded
Elf32_Off sh_offset; // File offset of section data, in bytes
Elf32_Word sh_size; // Size of section, in bytes
Elf32_Word sh_link; // Section type-specific header table index link
Elf32_Word sh_info; // Section type-specific extra information
Elf32_Word sh_addralign; // Section address alignment
Elf32_Word sh_entsize; // Size of records contained within the section
};
// Section header for ELF64 - same fields as ELF32, different types.
struct Elf64_Shdr {
Elf64_Half sh_name;
Elf64_Half sh_type;
Elf64_Xword sh_flags;
Elf64_Addr sh_addr;
Elf64_Off sh_offset;
Elf64_Xword sh_size;
Elf64_Half sh_link;
Elf64_Half sh_info;
Elf64_Xword sh_addralign;
Elf64_Xword sh_entsize;
};
// Special section indices.
enum {
SHN_UNDEF = 0, // Undefined, missing, irrelevant, or meaningless
SHN_LORESERVE = 0xff00, // Lowest reserved index
SHN_LOPROC = 0xff00, // Lowest processor-specific index
SHN_HIPROC = 0xff1f, // Highest processor-specific index
SHN_ABS = 0xfff1, // Symbol has absolute value; does not need relocation
SHN_COMMON = 0xfff2, // FORTRAN COMMON or C external global variables
SHN_HIRESERVE = 0xffff // Highest reserved index
};
// Section types.
enum {
SHT_NULL = 0, // No associated section (inactive entry).
SHT_PROGBITS = 1, // Program-defined contents.
SHT_SYMTAB = 2, // Symbol table.
SHT_STRTAB = 3, // String table.
SHT_RELA = 4, // Relocation entries; explicit addends.
SHT_HASH = 5, // Symbol hash table.
SHT_DYNAMIC = 6, // Information for dynamic linking.
SHT_NOTE = 7, // Information about the file.
SHT_NOBITS = 8, // Data occupies no space in the file.
SHT_REL = 9, // Relocation entries; no explicit addends.
SHT_SHLIB = 10, // Reserved.
SHT_DYNSYM = 11, // Symbol table.
SHT_LOPROC = 0x70000000, // Lowest processor architecture-specific type.
SHT_HIPROC = 0x7fffffff, // Highest processor architecture-specific type.
SHT_LOUSER = 0x80000000, // Lowest type reserved for applications.
SHT_HIUSER = 0xffffffff // Highest type reserved for applications.
};
// Section flags.
enum {
SHF_WRITE = 0x1, // Section data should be writable during execution.
SHF_ALLOC = 0x2, // Section occupies memory during program execution.
SHF_EXECINSTR = 0x4, // Section contains executable machine instructions.
SHF_MASKPROC = 0xf0000000 // Bits indicating processor-specific flags.
};
// Symbol table entries.
struct Elf32_Sym {
Elf32_Word st_name; // Symbol name (index into string table)
Elf32_Addr st_value; // Value or address associated with the symbol
Elf32_Word st_size; // Size of the symbol
unsigned char st_info; // Symbol's type and binding attributes
unsigned char st_other; // Must be zero; reserved
Elf32_Half st_shndx; // Which section (header table index) it's defined in
// These accessors and mutators correspond to the ELF32_ST_BIND,
// ELF32_ST_TYPE, and ELF32_ST_INFO macros defined in the ELF specification:
unsigned char getBinding () const { return st_info >> 4; }
unsigned char getType () const { return st_info & 0x0f; }
void setBinding (unsigned char b) { setBindingAndType (b, getType ()); }
void setType (unsigned char t) { setBindingAndType (getBinding (), t); }
void setBindingAndType (unsigned char b, unsigned char t) {
st_info = (b << 4) + (t & 0x0f);
}
};
// Symbol bindings.
enum {
STB_LOCAL = 0, // Local symbol, not visible outside obj file containing def
STB_GLOBAL = 1, // Global symbol, visible to all object files being combined
STB_WEAK = 2, // Weak symbol, like global but lower-precedence
STB_LOPROC = 13, // Lowest processor-specific binding type
STB_HIPROC = 15 // Highest processor-specific binding type
};
// Symbol types.
enum {
STT_NOTYPE = 0, // Symbol's type is not specified
STT_OBJECT = 1, // Symbol is a data object (variable, array, etc.)
STT_FUNC = 2, // Symbol is executable code (function, etc.)
STT_SECTION = 3, // Symbol refers to a section
STT_FILE = 4, // Local, absolute symbol that refers to a file
STT_LOPROC = 13, // Lowest processor-specific symbol type
STT_HIPROC = 15 // Highest processor-specific symbol type
};
// Relocation entry, without explicit addend.
struct Elf32_Rel {
Elf32_Addr r_offset; // Location (file byte offset, or program virtual addr)
Elf32_Word r_info; // Symbol table index and type of relocation to apply
// These accessors and mutators correspond to the ELF32_R_SYM, ELF32_R_TYPE,
// and ELF32_R_INFO macros defined in the ELF specification:
Elf32_Word getSymbol () const { return (r_info >> 8); }
unsigned char getType () const { return (unsigned char) (r_info & 0x0ff); }
void setSymbol (Elf32_Word s) { setSymbolAndType (s, getType ()); }
void setType (unsigned char t) { setSymbolAndType (getSymbol(), t); }
void setSymbolAndType (Elf32_Word s, unsigned char t) {
r_info = (s << 8) + t;
};
};
// Relocation entry with explicit addend.
struct Elf32_Rela {
Elf32_Addr r_offset; // Location (file byte offset, or program virtual addr)
Elf32_Word r_info; // Symbol table index and type of relocation to apply
Elf32_Sword r_addend; // Compute value for relocatable field by adding this
// These accessors and mutators correspond to the ELF32_R_SYM, ELF32_R_TYPE,
// and ELF32_R_INFO macros defined in the ELF specification:
Elf32_Word getSymbol () const { return (r_info >> 8); }
unsigned char getType () const { return (unsigned char) (r_info & 0x0ff); }
void setSymbol (Elf32_Word s) { setSymbolAndType (s, getType ()); }
void setType (unsigned char t) { setSymbolAndType (getSymbol(), t); }
void setSymbolAndType (Elf32_Word s, unsigned char t) {
r_info = (s << 8) + t;
};
};
// Program header.
struct Elf32_Phdr {
Elf32_Word p_type; // Type of segment
Elf32_Off p_offset; // File offset where segment is located, in bytes
Elf32_Addr p_vaddr; // Virtual address of beginning of segment
Elf32_Addr p_paddr; // Physical address of beginning of segment (OS-specific)
Elf32_Word p_filesz; // Num. of bytes in file image of segment (may be zero)
Elf32_Word p_memsz; // Num. of bytes in mem image of segment (may be zero)
Elf32_Word p_flags; // Segment flags
Elf32_Word p_align; // Segment alignment constraint
};
enum {
PT_NULL = 0, // Unused segment.
PT_LOAD = 1, // Loadable segment.
PT_DYNAMIC = 2, // Dynamic linking information.
PT_INTERP = 3, // Interpreter pathname.
PT_NOTE = 4, // Auxiliary information.
PT_SHLIB = 5, // Reserved.
PT_PHDR = 6, // The program header table itself.
PT_LOPROC = 0x70000000, // Lowest processor-specific program hdr entry type.
PT_HIPROC = 0x7fffffff // Highest processor-specific program hdr entry type.
};
} // end namespace ELF
} // end namespace llvm

View File

@@ -70,38 +70,87 @@ void removeFile(const std::string &Filename);
/// ///
std::string getUniqueFilename(const std::string &FilenameBase); std::string getUniqueFilename(const std::string &FilenameBase);
/// /// MakeFileExecutable - This method turns on whatever access attributes are
/// Method: MakeFileExecutable() /// needed to make the specified file executable. It returns true on success.
///
/// Description:
/// This method turns on whatever access attributes are needed to make the
/// specified file executable.
///
/// Return value:
/// True - The operation succeeded.
/// False - The operation failed.
///
/// Notes:
/// In case of failure, the file's access attributes are unspecified. /// In case of failure, the file's access attributes are unspecified.
/// ///
bool MakeFileExecutable (const std::string & Filename); bool MakeFileExecutable(const std::string &Filename);
/// /// MakeFileReadable - This method turns on whatever access attributes are
/// Method: MakeFileReadable() /// needed to make the specified file readable. It returns true on success.
///
/// Description:
/// This method turns on whatever access attributes are needed to make the
/// specified file readable.
///
/// Return value:
/// True - The operation succeeded.
/// False - The operation failed.
///
/// Notes:
/// In case of failure, the file's access attributes are unspecified. /// In case of failure, the file's access attributes are unspecified.
/// ///
bool MakeFileReadable (const std::string & Filename); bool MakeFileReadable(const std::string &Filename);
/// getFileSize - Return the size of the specified file in bytes, or -1 if the
/// file cannot be read or does not exist.
long long getFileSize(const std::string &Filename);
/// getFileTimestamp - Get the last modified time for the specified file in an
/// unspecified format. This is useful to allow checking to see if a file was
/// updated since that last time the timestampt was aquired. If the file does
/// not exist or there is an error getting the time-stamp, zero is returned.
unsigned long long getFileTimestamp(const std::string &Filename);
/// FDHandle - Simple handle class to make sure a file descriptor gets closed
/// when the object is destroyed. This handle acts similarly to an
/// std::auto_ptr, in that the copy constructor and assignment operators
/// transfer ownership of the handle. This means that FDHandle's do not have
/// value semantics.
///
class FDHandle {
int FD;
public:
FDHandle() : FD(-1) {}
FDHandle(int fd) : FD(fd) {}
FDHandle(FDHandle &RHS) : FD(RHS.FD) {
RHS.FD = -1; // Transfer ownership
}
~FDHandle() throw();
/// get - Get the current file descriptor, without releasing ownership of it.
int get() const { return FD; }
operator int() const { return FD; }
FDHandle &operator=(int fd) throw();
FDHandle &operator=(FDHandle &RHS) {
int fd = RHS.FD;
RHS.FD = -1; // Transfer ownership
return operator=(fd);
}
/// release - Take ownership of the file descriptor away from the FDHandle
/// object, so that the file is not closed when the FDHandle is destroyed.
int release() {
int Ret = FD;
FD = -1;
return Ret;
}
};
/// FileRemover - This class is a simple object meant to be stack allocated.
/// If an exception is thrown from a region, the object removes the filename
/// specified (if deleteIt is true).
///
class FileRemover {
std::string Filename;
bool DeleteIt;
public:
FileRemover(const std::string &filename, bool deleteIt = true)
: Filename(filename), DeleteIt(deleteIt) {}
~FileRemover() {
if (DeleteIt) removeFile(Filename);
}
/// releaseFile - Take ownership of the file away from the FileRemover so it
/// will not be removed when the object is destroyed.
void releaseFile() { DeleteIt = false; }
};
} // End llvm namespace } // End llvm namespace
#endif #endif

View File

@@ -117,7 +117,7 @@ public:
} }
if (EI != EE) if (EI != EE)
O << "|truncated..."; O << "|<g64>truncated...";
O << "}"; O << "}";
} }
O << "}\"];\n"; // Finish printing the "node" line O << "}\"];\n"; // Finish printing the "node" line
@@ -126,6 +126,8 @@ public:
EI = GTraits::child_begin(Node); EI = GTraits::child_begin(Node);
for (unsigned i = 0; EI != EE && i != 64; ++EI, ++i) for (unsigned i = 0; EI != EE && i != 64; ++EI, ++i)
writeEdge(Node, i, EI); writeEdge(Node, i, EI);
for (; EI != EE; ++EI)
writeEdge(Node, 64, EI);
} }
void writeEdge(NodeType *Node, unsigned edgeidx, child_iterator EI) { void writeEdge(NodeType *Node, unsigned edgeidx, child_iterator EI) {

View File

@@ -18,6 +18,10 @@
namespace llvm { namespace llvm {
#if defined(log2)
# undef log2
#endif
inline unsigned log2(uint64_t C) { inline unsigned log2(uint64_t C) {
unsigned getPow; unsigned getPow;
for (getPow = 0; C > 1; ++getPow) for (getPow = 0; C > 1; ++getPow)

View File

@@ -73,9 +73,6 @@ static inline void deleter(T *Ptr) {
// mapped_iterator - This is a simple iterator adapter that causes a function to // mapped_iterator - This is a simple iterator adapter that causes a function to
// be dereferenced whenever operator* is invoked on the iterator. // be dereferenced whenever operator* is invoked on the iterator.
// //
// It turns out that this is disturbingly similar to boost::transform_iterator
//
#if 1
template <class RootIt, class UnaryFunc> template <class RootIt, class UnaryFunc>
class mapped_iterator { class mapped_iterator {
RootIt current; RootIt current;
@@ -131,28 +128,6 @@ operator+(typename mapped_iterator<_Iterator, Func>::difference_type N,
return mapped_iterator<_Iterator, Func>(X.getCurrent() - N); return mapped_iterator<_Iterator, Func>(X.getCurrent() - N);
} }
#else
// This fails to work, because some iterators are not classes, for example
// vector iterators are commonly value_type **'s
template <class RootIt, class UnaryFunc>
class mapped_iterator : public RootIt {
UnaryFunc Fn;
public:
typedef typename UnaryFunc::result_type value_type;
typedef typename UnaryFunc::result_type *pointer;
typedef void reference; // Can't modify value returned by fn
typedef mapped_iterator<RootIt, UnaryFunc> _Self;
typedef RootIt super;
inline explicit mapped_iterator(const RootIt &I) : super(I) {}
inline mapped_iterator(const super &It) : super(It) {}
inline value_type operator*() const { // All this work to do
return Fn(super::operator*()); // this little thing
}
};
#endif
// map_iterator - Provide a convenient way to create mapped_iterators, just like // map_iterator - Provide a convenient way to create mapped_iterators, just like
// make_pair is useful for creating pairs... // make_pair is useful for creating pairs...
@@ -163,6 +138,43 @@ inline mapped_iterator<ItTy, FuncTy> map_iterator(const ItTy &I, FuncTy F) {
} }
// next/prior - These functions unlike std::advance 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
template <typename ItTy, typename Dist>
inline ItTy next(ItTy it, Dist n)
{
std::advance(it, n);
return it;
}
template <typename ItTy>
inline ItTy next(ItTy it)
{
std::advance(it, 1);
return it;
}
template <typename ItTy, typename Dist>
inline ItTy prior(ItTy it, Dist n)
{
std::advance(it, -n);
return it;
}
template <typename ItTy>
inline ItTy prior(ItTy it)
{
std::advance(it, -1);
return it;
}
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
// Extra additions to <algorithm> // Extra additions to <algorithm>
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//

View File

@@ -19,11 +19,14 @@
namespace llvm { namespace llvm {
// RemoveFileOnSignal - This function registers signal handlers to ensure that /// RemoveFileOnSignal - This function registers signal handlers to ensure
// if a signal gets delivered that the named file is removed. /// that if a signal gets delivered that the named file is removed.
// ///
void RemoveFileOnSignal(const std::string &Filename); void RemoveFileOnSignal(const std::string &Filename);
/// PrintStackTraceOnErrorSignal - When an error signal (such as SIBABRT or
/// SIGSEGV) is delivered to the process, print a stack trace and then exit.
void PrintStackTraceOnErrorSignal();
} // End llvm namespace } // End llvm namespace
#endif #endif

View File

@@ -0,0 +1,65 @@
//===- SlowOperationInformer.h - Keep the user informed ---------*- C++ -*-===//
//
// 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 defines a simple object which can be used to let the user know what
// is going on when a slow operation is happening, and gives them the ability to
// cancel it. Potentially slow operations can stack allocate one of these
// objects, and periodically call the "progress" method to update the progress
// bar. If the operation takes more than 1 second to complete, the progress bar
// is automatically shown and updated. As such, the slow operation should not
// print stuff to the screen, and should not be confused if an extra line
// appears on the screen (ie, the cursor should be at the start of the line).
//
// If the user presses CTRL-C during the operation, the next invocation of the
// progress method with throw an std::string object indicating that the
// operation was cancelled. As such, client code must be exception safe around
// the progress method.
//
// Because SlowOperationInformers fiddle around with signals, they cannot be
// nested, and interact poorly with threads. The SIGALRM handler is set back to
// SIGDFL, but the SIGINT signal handler is restored when the
// SlowOperationInformer is destroyed.
//
//===----------------------------------------------------------------------===//
#ifndef SUPPORT_SLOW_OPERATION_INFORMER_H
#define SUPPORT_SLOW_OPERATION_INFORMER_H
#include <string>
#include <cassert>
namespace llvm {
class SlowOperationInformer {
std::string OperationName;
unsigned LastPrintAmount;
SlowOperationInformer(const SlowOperationInformer&); // DO NOT IMPLEMENT
void operator=(const SlowOperationInformer&); // DO NOT IMPLEMENT
public:
SlowOperationInformer(const std::string &Name);
~SlowOperationInformer();
/// progress - Clients should periodically call this method when they are in
/// an exception-safe state. The Amount variable should indicate how far
/// along the operation is, given in 1/10ths of a percent (in other words,
/// Amount should range from 0 to 1000).
void progress(unsigned Amount);
/// progress - Same as the method above, but this performs the division for
/// you, and helps you avoid overflow if you are dealing with largish
/// numbers.
void progress(unsigned Current, unsigned Maximum) {
assert(Maximum != 0 &&
"Shouldn't be doing work if there is nothing to do!");
progress(Current*1000ULL/Maximum);
}
};
} // end namespace llvm
#endif /* SLOW_OPERATION_INFORMER_H */

View File

@@ -15,9 +15,9 @@
// This is useful for reporting information like the number of instructions // This is useful for reporting information like the number of instructions
// simplified, optimized or removed by various transformations, like this: // simplified, optimized or removed by various transformations, like this:
// //
// static Statistic<> NumInstEliminated("GCSE - Number of instructions killed"); // static Statistic<> NumInstsKilled("gcse", "Number of instructions killed");
// //
// Later, in the code: ++NumInstEliminated; // Later, in the code: ++NumInstsKilled;
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
@@ -76,6 +76,8 @@ public:
const Statistic &operator=(DataType Val) { Value = Val; return *this; } const Statistic &operator=(DataType Val) { Value = Val; return *this; }
const Statistic &operator++() { ++Value; return *this; } const Statistic &operator++() { ++Value; return *this; }
DataType operator++(int) { return Value++; } DataType operator++(int) { return Value++; }
const Statistic &operator--() { --Value; return *this; }
DataType operator--(int) { return Value--; }
const Statistic &operator+=(const DataType &V) { Value += V; return *this; } const Statistic &operator+=(const DataType &V) { Value += V; return *this; }
const Statistic &operator-=(const DataType &V) { Value -= V; return *this; } const Statistic &operator-=(const DataType &V) { Value -= V; return *this; }
}; };

View File

@@ -97,6 +97,16 @@ static inline std::string ftostr(double V) {
return Buffer; return Buffer;
} }
/// getToken - This function extracts one token from source, ignoring any
/// leading characters that appear in the Delimiters string, and ending the
/// token at any of the characters that appear in the Delimiters string. If
/// there are no tokens in the source string, an empty string is returned.
/// The Source source string is updated in place to remove the returned string
/// and any delimiter prefix from it.
std::string getToken(std::string &Source,
const char *Delimiters = " \t\n\v\f\r");
} // End llvm namespace } // End llvm namespace
#endif #endif

View File

@@ -0,0 +1,34 @@
//===-- Support/ThreadSupport-NoSupport.h - Generic impl --------*- C++ -*-===//
//
// 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 defines a generic ThreadSupport implementation used when there is
// no supported threading mechanism on the current system. Users should never
// #include this file directly!
//
//===----------------------------------------------------------------------===//
// Users should never #include this file directly! As such, no include guards
// are needed.
#ifndef SUPPORT_THREADSUPPORT_H
#error "Code should not #include Support/ThreadSupport-NoSupport.h directly!"
#endif
namespace llvm {
/// Mutex - This class allows user code to protect variables shared between
/// threads. It implements a "recursive" mutex, to simplify user code.
///
/// Since there is no platform support for _creating threads_, the non-thread
/// implementation of this class is a noop.
///
struct Mutex {
void acquire () {}
void release () {}
};
}

View File

@@ -1,4 +1,4 @@
//===-- Support/Lock.h - Platform-agnostic mutual exclusion -----*- C++ -*-===// //===-- Support/ThreadSupport-PThreads.h - PThreads support -----*- C++ -*-===//
// //
// The LLVM Compiler Infrastructure // The LLVM Compiler Infrastructure
// //
@@ -7,63 +7,36 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
// //
// This file contains classes that implement locks (mutual exclusion // This file defines pthreads implementations of the generic threading
// variables) in a platform-agnostic way. Basically the user should // mechanisms. Users should never #include this file directly!
// just call Lock::create() to get a Lock object of the correct sort
// for the current platform, and use its acquire() and release()
// methods, or a LockHolder, to protect critical sections of code for
// thread-safety.
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#ifndef SUPPORT_LOCK_H // Users should never #include this file directly! As such, no include guards
#define SUPPORT_LOCK_H // are needed.
#ifndef SUPPORT_THREADSUPPORT_H
#error "Code should not #include Support/ThreadSupport/PThreads.h directly!"
#endif
#include <pthread.h> #include <pthread.h>
#include <cstdlib>
namespace llvm { namespace llvm {
/// Lock - Abstract class that provides mutual exclusion (also known /// Mutex - This class allows user code to protect variables shared between
/// as a mutex.) /// threads. It implements a "recursive" mutex, to simplify user code.
///
class Lock {
protected:
virtual ~Lock() {} // Derive from me
public:
virtual void acquire () { abort (); }
virtual void release () { abort (); }
/// create - Static method that returns a Lock of the correct class
/// for the current host OS.
/// ///
static Lock create (); class Mutex {
};
/// POSIXLock - Specialization of Lock class implemented using
/// pthread_mutex_t objects.
///
class POSIXLock : public Lock {
pthread_mutex_t mutex; pthread_mutex_t mutex;
public: Mutex(const Mutex &); // DO NOT IMPLEMENT
POSIXLock () { pthread_mutex_init (&mutex, 0); } void operator=(const Mutex &); // DO NOT IMPLEMENT
virtual ~POSIXLock () { pthread_mutex_destroy (&mutex); } public:
virtual void acquire () { pthread_mutex_lock (&mutex); } Mutex() {
virtual void release () { pthread_mutex_unlock (&mutex); } pthread_mutexattr_t Attr;
}; pthread_mutex_init(&mutex, &Attr);
}
/// LockHolder - Instances of this class acquire a given Lock when ~Mutex() { pthread_mutex_destroy(&mutex); }
/// constructed and hold that lock until destruction. Uncle Bjarne void acquire () { pthread_mutex_lock (&mutex); }
/// says, "Resource acquisition is allocation." Or is it the other way void release () { pthread_mutex_unlock (&mutex); }
/// around? I never can remember. };
///
class LockHolder {
Lock &L;
public:
LockHolder (Lock &_L) : L (_L) { L.acquire (); }
~LockHolder () { L.release (); }
};
} // end namespace llvm } // end namespace llvm
#endif // SUPPORT_LOCK_H

View File

@@ -0,0 +1,40 @@
//===-- Support/ThreadSupport.h - Generic threading support -----*- C++ -*-===//
//
// 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 defines platform-agnostic interfaces that can be used to write
// multi-threaded programs. Autoconf is used to chose the correct
// implementation of these interfaces, or default to a non-thread-capable system
// if no matching system support is available.
//
//===----------------------------------------------------------------------===//
#ifndef SUPPORT_THREADSUPPORT_H
#define SUPPORT_THREADSUPPORT_H
#if @HAVE_PTHREAD_MUTEX_LOCK@
#include "Support/ThreadSupport-PThreads.h"
#else
#include "Support/ThreadSupport-NoSupport.h"
#endif // If no system support is available
namespace llvm {
/// MutexLocker - Instances of this class acquire a given Lock when
/// constructed and hold that lock until destruction.
///
class MutexLocker {
Mutex &M;
MutexLocker(const MutexLocker &); // DO NOT IMPLEMENT
void operator=(const MutexLocker &); // DO NOT IMPLEMENT
public:
MutexLocker(Mutex &m) : M(m) { M.acquire(); }
~MutexLocker() { M.release(); }
};
}
#endif // SUPPORT_THREADSUPPORT_H

View File

@@ -25,9 +25,7 @@
// 3.1 __gnu_cxx ext/hash_map // 3.1 __gnu_cxx ext/hash_map
// //
#include "Config/config.h" #if @HAVE_GNU_EXT_HASH_MAP@
#ifdef HAVE_GNU_EXT_HASH_MAP
// This is for GCC-3.1+ which puts hash in ext/hash_map // This is for GCC-3.1+ which puts hash in ext/hash_map
# include <ext/hash_map> # include <ext/hash_map>
# ifndef HASH_NAMESPACE # ifndef HASH_NAMESPACE
@@ -35,7 +33,7 @@
# endif # endif
// GCC 3.0.x puts hash_map in <ext/hash_map> and in the std namespace. // GCC 3.0.x puts hash_map in <ext/hash_map> and in the std namespace.
#elif defined(HAVE_STD_EXT_HASH_MAP) #elif @HAVE_STD_EXT_HASH_MAP@
# include <ext/hash_map> # include <ext/hash_map>
# ifndef HASH_NAMESPACE # ifndef HASH_NAMESPACE
# define HASH_NAMESPACE std # define HASH_NAMESPACE std
@@ -43,7 +41,7 @@
// Older compilers such as GCC before version 3.0 do not keep // Older compilers such as GCC before version 3.0 do not keep
// extensions in the `ext' directory, and ignore the `std' namespace. // extensions in the `ext' directory, and ignore the `std' namespace.
#elif defined(HAVE_GLOBAL_HASH_MAP) #elif @HAVE_GLOBAL_HASH_MAP@
# include <hash_map> # include <hash_map>
# ifndef HASH_NAMESPACE # ifndef HASH_NAMESPACE
# define HASH_NAMESPACE std # define HASH_NAMESPACE std

View File

@@ -26,18 +26,16 @@
// 3.1 __gnu_cxx ext/hash_set // 3.1 __gnu_cxx ext/hash_set
// //
#include "Config/config.h"
// GCC versions 3.1 and later put hash_set in <ext/hash_set> and in // GCC versions 3.1 and later put hash_set in <ext/hash_set> and in
// the __gnu_cxx namespace. // the __gnu_cxx namespace.
#if defined(HAVE_GNU_EXT_HASH_SET) #if @HAVE_GNU_EXT_HASH_SET@
# include <ext/hash_set> # include <ext/hash_set>
# ifndef HASH_NAMESPACE # ifndef HASH_NAMESPACE
# define HASH_NAMESPACE __gnu_cxx # define HASH_NAMESPACE __gnu_cxx
# endif # endif
// GCC 3.0.x puts hash_set in <ext/hash_set> and in the std namespace. // GCC 3.0.x puts hash_set in <ext/hash_set> and in the std namespace.
#elif defined(HAVE_STD_EXT_HASH_SET) #elif @HAVE_STD_EXT_HASH_SET@
# include <ext/hash_set> # include <ext/hash_set>
# ifndef HASH_NAMESPACE # ifndef HASH_NAMESPACE
# define HASH_NAMESPACE std # define HASH_NAMESPACE std
@@ -45,7 +43,7 @@
// Older compilers such as GCC before version 3.0 do not keep // Older compilers such as GCC before version 3.0 do not keep
// extensions in the `ext' directory, and ignore the `std' namespace. // extensions in the `ext' directory, and ignore the `std' namespace.
#elif defined(HAVE_GLOBAL_HASH_SET) #elif @HAVE_GLOBAL_HASH_SET@
# include <hash_set> # include <hash_set>
# ifndef HASH_NAMESPACE # ifndef HASH_NAMESPACE
# define HASH_NAMESPACE std # define HASH_NAMESPACE std

View File

@@ -152,15 +152,109 @@ public:
return tmp; return tmp;
} }
// Internal interface, do not use...
pointer getNodePtrUnchecked() const { return NodePtr; }
};
// Dummy operators to make errors apparent... // do not implement. this is to catch errors when people try to use
template<class X> void operator+(X Val) {} // them as random access iterators
template<class X> void operator-(X Val) {} template<typename T>
void operator-(int, ilist_iterator<T>);
template<typename T>
void operator-(ilist_iterator<T>,int);
template<typename T>
void operator+(int, ilist_iterator<T>);
template<typename T>
void operator+(ilist_iterator<T>,int);
//===----------------------------------------------------------------------===//
// ilist_compat_iterator<Node> - Compatibility iterator for intrusive list.
// This makes an ilist<X> act like an std::list<X*>, where you have to
// dereference stuff multiple times. This should only be used for temporary
// migration purposes. Because we don't support "changing the pointer", we only
// expose constant pointers.
//
template<typename NodeTy>
class ilist_compat_iterator
: public bidirectional_iterator<NodeTy* const, ptrdiff_t> {
typedef ilist_traits<NodeTy> Traits;
typedef bidirectional_iterator<NodeTy* const, ptrdiff_t> super;
public:
typedef size_t size_type;
typedef typename super::pointer pointer;
typedef typename super::reference reference;
private:
NodeTy *NodePtr;
public:
ilist_compat_iterator(NodeTy *NP) : NodePtr(NP) {}
ilist_compat_iterator() : NodePtr(0) {}
// This is templated so that we can allow constructing a const iterator from
// a nonconst iterator...
template<class node_ty>
ilist_compat_iterator(const ilist_compat_iterator<node_ty> &RHS)
: NodePtr(RHS.getNodePtrUnchecked()) {}
// This is templated so that we can allow assigning to a const iterator from
// a nonconst iterator...
template<class node_ty>
const ilist_compat_iterator &operator=(const
ilist_compat_iterator<node_ty> &RHS) {
NodePtr = RHS.getNodePtrUnchecked();
return *this;
}
// Accessors...
operator pointer() const {
assert(Traits::getNext(NodePtr) != 0 && "Dereferencing end()!");
return &NodePtr;
}
reference operator*() const {
assert(Traits::getNext(NodePtr) != 0 && "Dereferencing end()!");
return NodePtr;
}
pointer operator->() { return &operator*(); }
const pointer operator->() const { return &operator*(); }
// Comparison operators
bool operator==(const ilist_compat_iterator &RHS) const {
return NodePtr == RHS.NodePtr;
}
bool operator!=(const ilist_compat_iterator &RHS) const {
return NodePtr != RHS.NodePtr;
}
// Increment and decrement operators...
ilist_compat_iterator &operator--() { // predecrement - Back up
NodePtr = Traits::getPrev(NodePtr);
assert(NodePtr && "--'d off the beginning of an ilist!");
return *this;
}
ilist_compat_iterator &operator++() { // preincrement - Advance
NodePtr = Traits::getNext(NodePtr);
assert(NodePtr && "++'d off the end of an ilist!");
return *this;
}
ilist_compat_iterator operator--(int) { // postdecrement operators...
ilist_compat_iterator tmp = *this;
--*this;
return tmp;
}
ilist_compat_iterator operator++(int) { // postincrement operators...
ilist_compat_iterator tmp = *this;
++*this;
return tmp;
}
// Internal interface, do not use... // Internal interface, do not use...
pointer getNodePtrUnchecked() const { return NodePtr; } pointer getNodePtrUnchecked() const { return NodePtr; }
}; };
// Allow ilist_iterators to convert into pointers to a node automatically when // Allow ilist_iterators to convert into pointers to a node automatically when
// used by the dyn_cast, cast, isa mechanisms... // used by the dyn_cast, cast, isa mechanisms...
@@ -213,19 +307,25 @@ public:
} }
~iplist() { clear(); delete Tail; } ~iplist() { clear(); delete Tail; }
// Iterator creation methods... // Iterator creation methods.
iterator begin() { return iterator(Head); } iterator begin() { return iterator(Head); }
const_iterator begin() const { return const_iterator(Head); } const_iterator begin() const { return const_iterator(Head); }
iterator end() { return iterator(Tail); } iterator end() { return iterator(Tail); }
const_iterator end() const { return const_iterator(Tail); } const_iterator end() const { return const_iterator(Tail); }
// reverse iterator creation methods... // reverse iterator creation methods.
reverse_iterator rbegin() { return reverse_iterator(end()); } reverse_iterator rbegin() { return reverse_iterator(end()); }
const_reverse_iterator rbegin() const{ return const_reverse_iterator(end()); } const_reverse_iterator rbegin() const{ return const_reverse_iterator(end()); }
reverse_iterator rend() { return reverse_iterator(begin()); } reverse_iterator rend() { return reverse_iterator(begin()); }
const_reverse_iterator rend() const {return const_reverse_iterator(begin());} const_reverse_iterator rend() const {return const_reverse_iterator(begin());}
// Miscellaneous inspection routines...
// "compatibility" iterator creation methods.
typedef ilist_compat_iterator<NodeTy> compat_iterator;
compat_iterator compat_begin() const { return compat_iterator(Head); }
compat_iterator compat_end() const { return compat_iterator(Tail); }
// Miscellaneous inspection routines.
size_type max_size() const { return size_type(-1); } size_type max_size() const { return size_type(-1); }
bool empty() const { return Head == Tail; } bool empty() const { return Head == Tail; }

View File

@@ -21,56 +21,46 @@
// 1. bidirectional_iterator // 1. bidirectional_iterator
// 2. forward_iterator // 2. forward_iterator
// //
// The #if directives' expressions are filled in by Autoconf.
//
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#ifndef SUPPORT_ITERATOR #ifndef SUPPORT_ITERATOR
#define SUPPORT_ITERATOR #define SUPPORT_ITERATOR
#include "Config/config.h"
#include <iterator> #include <iterator>
////////////////////////////////////////////////////////////////////////////// #if !@HAVE_BI_ITERATOR@
// If the bidirectional iterator is not defined, attempt to define it using # if @HAVE_STD_ITERATOR@
// the C++ standard iterator. /// If the bidirectional iterator is not defined, we attempt to define it in
////////////////////////////////////////////////////////////////////////////// /// terms of the C++ standard iterator. Otherwise, we import it with a "using"
#ifndef HAVE_BI_ITERATOR /// statement.
#ifdef HAVE_STD_ITERATOR ///
// Define stupid wrappers around std::iterator...
template<class Ty, class PtrDiffTy> template<class Ty, class PtrDiffTy>
struct bidirectional_iterator struct bidirectional_iterator
: public std::iterator<std::bidirectional_iterator_tag, Ty, PtrDiffTy> { : public std::iterator<std::bidirectional_iterator_tag, Ty, PtrDiffTy> {
}; };
# else
# error "Need to have standard iterator to define bidirectional iterator!"
# endif
#else #else
#error "Need to have standard iterator to define bidirectional iterator!"
#endif
#else
// Just use bidirectional_iterator directly.
using std::bidirectional_iterator; using std::bidirectional_iterator;
#endif #endif
////////////////////////////////////////////////////////////////////////////// #if !@HAVE_FWD_ITERATOR@
// If the forward iterator is not defined, attempt to define it using the # if @HAVE_STD_ITERATOR@
// C++ standard iterator. /// If the forward iterator is not defined, attempt to define it in terms of
////////////////////////////////////////////////////////////////////////////// /// the C++ standard iterator. Otherwise, we import it with a "using" statement.
#ifndef HAVE_FWD_ITERATOR ///
#ifdef HAVE_STD_ITERATOR
template<class Ty, class PtrDiffTy> template<class Ty, class PtrDiffTy>
struct forward_iterator struct forward_iterator
: public std::iterator<std::forward_iterator_tag, Ty, PtrDiffTy> { : public std::iterator<std::forward_iterator_tag, Ty, PtrDiffTy> {
}; };
# else
# error "Need to have standard iterator to define forward iterator!"
# endif
#else #else
#error "Need to have standard iterator to define forward iterator!"
#endif
#else
// Just use forward iterator directly.
using std::forward_iterator; using std::forward_iterator;
#endif #endif
#endif #endif

View File

@@ -1,44 +0,0 @@
//===-- Support/slist - "Portable" wrapper around slist ---------*- C++ -*-===//
//
// 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 provides a wrapper around the mysterious <slist> header file that
// seems to move around between GCC releases into and out of namespaces at will.
// #including this header will cause hash_map to be available in the global
// namespace.
//
//===----------------------------------------------------------------------===//
#ifndef SUPPORT_SLIST
#define SUPPORT_SLIST
#include "Config/config.h"
// Compiler Support Matrix
//
// Version Namespace Header File
// 2.95.x :: slist
// 3.0.4 std ext/slist
// 3.1 __gnu_cxx ext/slist
//
#ifdef HAVE_EXT_SLIST
#include <ext/slist>
#else
#include <slist>
#endif
#if HAVE_EXT_SLIST == std
using std::slist;
#endif
#if HAVE_EXT_SLIST == gnu
using __gnu_cxx::slist;
#endif
#endif

View File

@@ -0,0 +1,54 @@
//===- Support/type_traits.h - Simplfied type traits ------------*- C++ -*-===//
//
// 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 provides a template class that determines if a type is a class or
// not. The basic mechanism, based on using the pointer to member function of
// a zero argument to a function was "boosted" from the boost type_traits
// library. See http://www.boost.org/ for all the gory details.
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_SUPPORT_TYPE_TRAITS_H
#define LLVM_SUPPORT_TYPE_TRAITS_H
// This is actually the conforming implementation which works with abstract
// classes. However, enough compilers have trouble with it that most will use
// the one in boost/type_traits/object_traits.hpp. This implementation actually
// works with VC7.0, but other interactions seem to fail when we use it.
namespace llvm {
namespace dont_use
{
// These two functions should never be used. They are helpers to
// the is_class template below. They cannot be located inside
// is_class because doing so causes at least GCC to think that
// the value of the "value" enumerator is not constant. Placing
// them out here (for some strange reason) allows the sizeof
// operator against them to magically be constant. This is
// important to make the is_class<T>::value idiom zero cost. it
// evaluates to a constant 1 or 0 depending on whether the
// parameter T is a class or not (respectively).
template<typename T> char is_class_helper(void(T::*)(void));
template<typename T> double is_class_helper(...);
}
template <typename T>
struct is_class
{
// is_class<> metafunction due to Paul Mensonides (leavings@attbi.com). For
// more details:
// http://groups.google.com/groups?hl=en&selm=000001c1cc83%24e154d5e0%247772e50c%40c161550a&rnum=1
public:
enum { value = sizeof(char) == sizeof(dont_use::is_class_helper<T>(0)) };
};
}
#endif

View File

@@ -1,6 +0,0 @@
Boost
------------------------------------------------------------------------------
The boost header files are licensed under the LLVM license. They also have
additional copyrights that can be found in each individual source file in
llvm/include/boost.

View File

@@ -1,5 +0,0 @@
These files were taken from boost 1.28.0.
See http://www.boost.org for more information.

View File

@@ -1,69 +0,0 @@
// Boost config.hpp configuration header file ------------------------------//
// (C) Copyright Boost.org 2001. Permission to copy, use, modify, sell and
// distribute this software is granted provided this copyright notice appears
// in all copies. This software is provided "as is" without express or implied
// warranty, and with no claim as to its suitability for any purpose.
// See http://www.boost.org for most recent version.
// Boost config.hpp policy and rationale documentation has been moved to
// http://www.boost.org/libs/config
//
// CAUTION: This file is intended to be completely stable -
// DO NOT MODIFY THIS FILE!
//
#ifndef BOOST_CONFIG_HPP
#define BOOST_CONFIG_HPP
// if we don't have a user config, then use the default location:
#if !defined(BOOST_USER_CONFIG) && !defined(BOOST_NO_USER_CONFIG)
# define BOOST_USER_CONFIG <boost/config/user.hpp>
#endif
// include it first:
#ifdef BOOST_USER_CONFIG
# include BOOST_USER_CONFIG
#endif
// if we don't have a compiler config set, try and find one:
#if !defined(BOOST_COMPILER_CONFIG) && !defined(BOOST_NO_COMPILER_CONFIG) && !defined(BOOST_NO_CONFIG)
# include <boost/config/select_compiler_config.hpp>
#endif
// if we have a compiler config, include it now:
#ifdef BOOST_COMPILER_CONFIG
# include BOOST_COMPILER_CONFIG
#endif
// if we don't have a std library config set, try and find one:
#if !defined(BOOST_STDLIB_CONFIG) && !defined(BOOST_NO_STDLIB_CONFIG) && !defined(BOOST_NO_CONFIG)
# include <boost/config/select_stdlib_config.hpp>
#endif
// if we have a std library config, include it now:
#ifdef BOOST_STDLIB_CONFIG
# include BOOST_STDLIB_CONFIG
#endif
// if we don't have a platform config set, try and find one:
#if !defined(BOOST_PLATFORM_CONFIG) && !defined(BOOST_NO_PLATFORM_CONFIG) && !defined(BOOST_NO_CONFIG)
# include <boost/config/select_platform_config.hpp>
#endif
// if we have a platform config, include it now:
#ifdef BOOST_PLATFORM_CONFIG
# include BOOST_PLATFORM_CONFIG
#endif
// get config suffix code:
#include <boost/config/suffix.hpp>
#endif // BOOST_CONFIG_HPP

View File

@@ -1,83 +0,0 @@
// (C) Copyright Boost.org 2001. Permission to copy, use, modify, sell and
// distribute this software is granted provided this copyright notice appears
// in all copies. This software is provided "as is" without express or implied
// warranty, and with no claim as to its suitability for any purpose.
// See http://www.boost.org for most recent version.
// Borland C++ compiler setup:
// Version 5.0 and below:
# if __BORLANDC__ <= 0x0550
// Borland C++Builder 4 and 5:
# define BOOST_NO_MEMBER_TEMPLATE_FRIENDS
# if __BORLANDC__ == 0x0550
// Borland C++Builder 5, command-line compiler 5.5:
# define BOOST_NO_OPERATORS_IN_NAMESPACE
# endif
# endif
// Version 5.51 and below:
#if (__BORLANDC__ <= 0x551)
# define BOOST_NO_CV_SPECIALIZATIONS
# define BOOST_NO_CV_VOID_SPECIALIZATIONS
# define BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
#endif
// Version 6.0 and below:
#if (__BORLANDC__ <= 0x560) || !defined(BOOST_STRICT_CONFIG)
# define BOOST_NO_DEPENDENT_NESTED_DERIVATIONS
# define BOOST_NO_INTEGRAL_INT64_T
# define BOOST_NO_PRIVATE_IN_AGGREGATE
# define BOOST_NO_SWPRINTF
# define BOOST_NO_USING_TEMPLATE
// we shouldn't really need this - but too many things choke
// without it, this needs more investigation:
# define BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
#endif
// Borland C++Builder 6 defaults to using STLPort. If _USE_OLD_RW_STL is
// defined, then we have 0x560 or greater with the Rogue Wave implementation
// which presumably has the std::DBL_MAX bug.
#if ((__BORLANDC__ >= 0x550) && (__BORLANDC__ < 0x560)) || defined(_USE_OLD_RW_STL)
// <climits> is partly broken, some macros define symbols that are really in
// namespace std, so you end up having to use illegal constructs like
// std::DBL_MAX, as a fix we'll just include float.h and have done with:
#include <float.h>
#endif
//
// __int64:
//
#if __BORLANDC__ >= 0x530
# define BOOST_HAS_MS_INT64
#endif
//
// check for exception handling support:
//
#ifndef _CPPUNWIND
# define BOOST_NO_EXCEPTIONS
#endif
//
// Disable Win32 support in ANSI mode:
//
#pragma defineonoption BOOST_DISABLE_WIN32 -A
#define BOOST_COMPILER "Borland C++ version " BOOST_STRINGIZE(__BORLANDC__)
//
// versions check:
// we don't support Borland prior to version 5.4:
#if __BORLANDC__ < 0x540
# error "Compiler not supported or configured - please reconfigure"
#endif
//
// last known and checked version is 5.6:
#if (__BORLANDC__ > 0x560)
# if defined(BOOST_ASSERT_CONFIG)
# error "Unknown compiler version - please run the configure tests and report the results"
# else
# pragma message( "Unknown compiler version - please run the configure tests and report the results")
# endif
#endif

View File

@@ -1,65 +0,0 @@
// (C) Copyright Boost.org 2001. Permission to copy, use, modify, sell and
// distribute this software is granted provided this copyright notice appears
// in all copies. This software is provided "as is" without express or implied
// warranty, and with no claim as to its suitability for any purpose.
// See http://www.boost.org for most recent version.
// Comeau C++ compiler setup:
#include "boost/config/compiler/common_edg.hpp"
#if (__COMO_VERSION__ <= 4245) || !defined(BOOST_STRICT_CONFIG)
# if defined(_MSC_VER) && _MSC_VER <= 1300
# define BOOST_NO_STDC_NAMESPACE
# define BOOST_NO_SWPRINTF
# if _MSC_VER > 100
// only set this in non-strict mode:
# define BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP
# endif
# endif
// Void returns don't work when emulating VC 6 (Peter Dimov)
# if defined(_MSC_VER) && (_MSC_VER == 1200)
# define BOOST_NO_VOID_RETURNS
# endif
#endif // version 4245
//
// enable __int64 support in VC emulation mode
// we should also set BOOST_HAS_LONG_LONG when that is
// supported, but there is no way we can detect it:
//
# if defined(_MSC_VER) && (_MSC_VER >= 1200)
# define BOOST_HAS_MS_INT64
# endif
//
// disable win32 support unless we are in VC emulation mode,
// (what does this do to Como on top of Borland?):
//
#if defined(_WIN32) && (_MSC_VER+0 < 1000)
# define BOOST_DISABLE_WIN32
#endif
#define BOOST_COMPILER "Comeau compiler version " BOOST_STRINGIZE(__COMO_VERSION__)
//
// versions check:
// we don't know Comeau prior to version 4245:
#if __COMO_VERSION__ < 4245
# error "Compiler not configured - please reconfigure"
#endif
//
// last known and checked version is 4245:
#if (__COMO_VERSION__ > 4245)
# if defined(BOOST_ASSERT_CONFIG)
# error "Unknown compiler version - please run the configure tests and report the results"
# endif
#endif

View File

@@ -1,34 +0,0 @@
// (C) Copyright Boost.org 2001. Permission to copy, use, modify, sell and
// distribute this software is granted provided this copyright notice appears
// in all copies. This software is provided "as is" without express or implied
// warranty, and with no claim as to its suitability for any purpose.
// See http://www.boost.org for most recent version.
//
// Options common to all edg based compilers.
//
// This is included from within the individual compiler mini-configs.
#ifndef __EDG_VERSION__
# error This file requires that __EDG_VERSION__ be defined.
#endif
#if (__EDG_VERSION__ <= 238)
# define BOOST_NO_INTEGRAL_INT64_T
#endif
#if (__EDG_VERSION__ <= 240)
# define BOOST_NO_VOID_RETURNS
#endif
#if (__EDG_VERSION__ <= 241) && !defined(BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP)
# define BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP
#endif
#ifdef c_plusplus
// EDG has "long long" in non-strict mode
// However, some libraries have insufficient "long long" support
// #define BOOST_HAS_LONG_LONG
#endif

View File

@@ -1,18 +0,0 @@
// (C) Copyright Boost.org 2001. Permission to copy, use, modify, sell and
// distribute this software is granted provided this copyright notice appears
// in all copies. This software is provided "as is" without express or implied
// warranty, and with no claim as to its suitability for any purpose.
// See http://www.boost.org for most recent version.
// Dec Alpha True64 C++ compiler setup:
#define BOOST_COMPILER "Dec Alpha True64 " BOOST_STRINGIZE(__DECCXX_VER)
#include "boost/config/compiler/common_edg.hpp"
//
// versions check:
// Nothing to do here?

View File

@@ -1,59 +0,0 @@
// (C) Copyright Boost.org 2001. Permission to copy, use, modify, sell and
// distribute this software is granted provided this copyright notice appears
// in all copies. This software is provided "as is" without express or implied
// warranty, and with no claim as to its suitability for any purpose.
// See http://www.boost.org for most recent version.
// GNU C++ compiler setup:
# if __GNUC__ == 2 && __GNUC_MINOR__ == 91
// egcs 1.1 won't parse shared_ptr.hpp without this:
# define BOOST_NO_AUTO_PTR
# endif
# if __GNUC__ == 2 && __GNUC_MINOR__ < 95
//
// Prior to gcc 2.95 member templates only partly
// work - define BOOST_MSVC6_MEMBER_TEMPLATES
// instead since inline member templates mostly work.
//
# define BOOST_NO_MEMBER_TEMPLATES
# if __GNUC_MINOR__ >= 9
# define BOOST_MSVC6_MEMBER_TEMPLATES
# endif
# endif
# if __GNUC__ == 2 && __GNUC_MINOR__ <= 97
# define BOOST_NO_MEMBER_TEMPLATE_FRIENDS
# define BOOST_NO_OPERATORS_IN_NAMESPACE
# endif
//
// Threading support:
// Turn this on unconditionally here, it will get turned off again later
// if no threading API is detected.
//
#define BOOST_HAS_THREADS
//
// gcc has "long long"
//
#define BOOST_HAS_LONG_LONG
#define BOOST_COMPILER "GNU C++ version " BOOST_STRINGIZE(__GNUC__) "." BOOST_STRINGIZE(__GNUC_MINOR__)
//
// versions check:
// we don't know gcc prior to version 2.90:
#if (__GNUC__ == 2) && (__GNUC_MINOR__ < 90)
# error "Compiler not configured - please reconfigure"
#endif
//
// last known and checked version is 3.4:
#if (__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ > 4))
# if defined(BOOST_ASSERT_CONFIG)
# error "Unknown compiler version - please run the configure tests and report the results"
# else
# warning "Unknown compiler version - please run the configure tests and report the results"
# endif
#endif

View File

@@ -1,27 +0,0 @@
// (C) Copyright Boost.org 2001. Permission to copy, use, modify, sell and
// distribute this software is granted provided this copyright notice appears
// in all copies. This software is provided "as is" without express or implied
// warranty, and with no claim as to its suitability for any purpose.
// See http://www.boost.org for most recent version.
// Greenhills C++ compiler setup:
#define BOOST_COMPILER "Greenhills C++ version " BOOST_STRINGIZE(__ghs)
#include "boost/config/compiler/common_edg.hpp"
//
// versions check:
// we don't support Greenhills prior to version 0:
#if __ghs < 0
# error "Compiler not supported or configured - please reconfigure"
#endif
//
// last known and checked version is 0:
#if (__ghs > 0)
# if defined(BOOST_ASSERT_CONFIG)
# error "Unknown compiler version - please run the configure tests and report the results"
# endif
#endif

View File

@@ -1,41 +0,0 @@
// (C) Copyright Boost.org 2001. Permission to copy, use, modify, sell and
// distribute this software is granted provided this copyright notice appears
// in all copies. This software is provided "as is" without express or implied
// warranty, and with no claim as to its suitability for any purpose.
// See http://www.boost.org for most recent version.
// HP aCC C++ compiler setup:
#if (__HP_aCC <= 33100)
# define BOOST_NO_INTEGRAL_INT64_T
# define BOOST_NO_OPERATORS_IN_NAMESPACE
# if !defined(_NAMESPACE_STD)
# define BOOST_NO_STD_LOCALE
# define BOOST_NO_STRINGSTREAM
# endif
#endif
#if (__HP_aCC <= 33300) || !defined(BOOST_STRICT_CONFIG)
// member templates are sufficiently broken that we disable them for now
# define BOOST_NO_MEMBER_TEMPLATES
# define BOOST_NO_DEPENDENT_NESTED_DERIVATIONS
# define BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS
#endif
#define BOOST_COMPILER "HP aCC version " BOOST_STRINGIZE(__HP_aCC)
//
// versions check:
// we don't support HP aCC prior to version 0:
#if __HP_aCC < 33000
# error "Compiler not supported or configured - please reconfigure"
#endif
//
// last known and checked version is 0:
#if (__HP_aCC > 33300)
# if defined(BOOST_ASSERT_CONFIG)
# error "Unknown compiler version - please run the configure tests and report the results"
# endif
#endif

View File

@@ -1,82 +0,0 @@
// (C) Copyright Boost.org 2001. Permission to copy, use, modify, sell and
// distribute this software is granted provided this copyright notice appears
// in all copies. This software is provided "as is" without express or implied
// warranty, and with no claim as to its suitability for any purpose.
// See http://www.boost.org for most recent version.
// Intel compiler setup:
#include "boost/config/compiler/common_edg.hpp"
#ifdef __ICL
# define BOOST_COMPILER "Intel C++ version " BOOST_STRINGIZE(__ICL)
# define BOOST_INTEL_CXX_VERSION __ICL
#else
# define BOOST_COMPILER "Intel C++ version " BOOST_STRINGIZE(__ICC)
# define BOOST_INTEL_CXX_VERSION __ICC
#endif
#if (BOOST_INTEL_CXX_VERSION <= 500) && defined(_MSC_VER)
# define BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS
#endif
#if (BOOST_INTEL_CXX_VERSION <= 600) || !defined(BOOST_STRICT_CONFIG)
# if defined(_MSC_VER) && (_MSC_VER <= 1300) // added check for <= VC 7 (Peter Dimov)
// Intel C++ 5.0.1 uses EDG 2.45, but fails to activate Koenig lookup
// in the frontend even in "strict" mode, unless you use
// -Qoption,cpp,--arg_dep_lookup. (reported by Kirk Klobe & Thomas Witt)
// Similarly, -Qoption,cpp,--new_for_init enables new-style "for" loop
// variable scoping. (reported by Thomas Witt)
// Intel C++ 6.0 (currently in Beta test) doesn't have any front-end
// changes at all. (reported by Kirk Klobe)
# ifndef BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP
# define BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP
# endif
# define BOOST_NO_SWPRINTF
# define BOOST_NO_INCLASS_MEMBER_INITIALIZATION
# endif
// Void returns, 64 bit integrals don't work when emulating VC 6 (Peter Dimov)
# if defined(_MSC_VER) && (_MSC_VER <= 1200)
# define BOOST_NO_VOID_RETURNS
# define BOOST_NO_INTEGRAL_INT64_T
# endif
#endif
#if _MSC_VER+0 >= 1000
# ifndef _NATIVE_WCHAR_T_DEFINED
# define BOOST_NO_INTRINSIC_WCHAR_T
# endif
# if _MSC_VER >= 1200
# define BOOST_HAS_MS_INT64
# endif
# define BOOST_NO_SWPRINTF
#elif defined(_WIN32)
# define BOOST_DISABLE_WIN32
#endif
//
// versions check:
// we don't support Intel prior to version 5.0:
#if BOOST_INTEL_CXX_VERSION < 500
# error "Compiler not supported or configured - please reconfigure"
#endif
//
// last known and checked version is 600:
#if (BOOST_INTEL_CXX_VERSION > 600)
# if defined(BOOST_ASSERT_CONFIG)
# error "Unknown compiler version - please run the configure tests and report the results"
# elif defined(_MSC_VER)
# pragma message("Unknown compiler version - please run the configure tests and report the results")
# endif
#endif

View File

@@ -1,27 +0,0 @@
// (C) Copyright Boost.org 2001. Permission to copy, use, modify, sell and
// distribute this software is granted provided this copyright notice appears
// in all copies. This software is provided "as is" without express or implied
// warranty, and with no claim as to its suitability for any purpose.
// See http://www.boost.org for most recent version.
// Kai C++ compiler setup:
#include "boost/config/compiler/common_edg.hpp"
# if (__KCC_VERSION <= 4001) || !defined(BOOST_STRICT_CONFIG)
// at least on Sun, the contents of <cwchar> is not in namespace std
# define BOOST_NO_STDC_NAMESPACE
# endif
#define BOOST_COMPILER "Kai C++ version " BOOST_STRINGIZE(__KCC_VERSION)
//
// last known and checked version is 4001:
#if (__KCC_VERSION > 4001)
# if defined(BOOST_ASSERT_CONFIG)
# error "Unknown compiler version - please run the configure tests and report the results"
# endif
#endif

View File

@@ -1,55 +0,0 @@
// (C) Copyright Boost.org 2001. Permission to copy, use, modify, sell and
// distribute this software is granted provided this copyright notice appears
// in all copies. This software is provided "as is" without express or implied
// warranty, and with no claim as to its suitability for any purpose.
// See http://www.boost.org for most recent version.
// Metrowerks C++ compiler setup:
// locale support is disabled when linking with the dynamic runtime
# ifdef _MSL_NO_LOCALE
# define BOOST_NO_STD_LOCALE
# endif
# if __MWERKS__ <= 0x2301 // 5.3
# define BOOST_NO_FUNCTION_TEMPLATE_ORDERING
# define BOOST_NO_POINTER_TO_MEMBER_CONST
# define BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS
# define BOOST_NO_MEMBER_TEMPLATE_KEYWORD
# endif
# if __MWERKS__ <= 0x2401 // 6.2
//# define BOOST_NO_FUNCTION_TEMPLATE_ORDERING
# endif
# if(__MWERKS__ <= 0x2406) || !defined(BOOST_STRICT_CONFIG) // 7.0 & 7.1
# define BOOST_NO_MEMBER_TEMPLATE_FRIENDS
# endif
#if !__option(wchar_type)
# define BOOST_NO_INTRINSIC_WCHAR_T
#endif
#define BOOST_COMPILER "Metrowerks CodeWarrior C++ version " BOOST_STRINGIZE(__MWERKS__)
//
// versions check:
// we don't support Metrowerks prior to version 5.3:
#if __MWERKS__ < 0x2301
# error "Compiler not supported or configured - please reconfigure"
#endif
//
// last known and checked version is 0x2406:
#if (__MWERKS__ > 0x2406)
# if defined(BOOST_ASSERT_CONFIG)
# error "Unknown compiler version - please run the configure tests and report the results"
# endif
#endif

View File

@@ -1,49 +0,0 @@
// (C) Copyright Boost.org 2001. Permission to copy, use, modify, sell and
// distribute this software is granted provided this copyright notice appears
// in all copies. This software is provided "as is" without express or implied
// warranty, and with no claim as to its suitability for any purpose.
// See http://www.boost.org for most recent version.
// MPW C++ compilers setup:
# if defined(__SC__)
# define BOOST_COMPILER "MPW SCpp version " BOOST_STRINGIZE(__SC__)
# elif defined(__MRC__)
# define BOOST_COMPILER "MPW MrCpp version " BOOST_STRINGIZE(__MRC__)
# else
# error "Using MPW compiler configuration by mistake. Please update."
# endif
//
// MPW 8.90:
//
#if (MPW_CPLUS <= 0x890) || !defined(BOOST_STRICT_CONFIG)
# define BOOST_NO_CV_SPECIALIZATIONS
# define BOOST_NO_DEPENDENT_NESTED_DERIVATIONS
# define BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS
# define BOOST_NO_INCLASS_MEMBER_INITIALIZATION
# define BOOST_NO_INTRINSIC_WCHAR_T
# define BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
# define BOOST_NO_USING_TEMPLATE
# define BOOST_NO_CWCHAR
# define BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
# define BOOST_NO_STD_ALLOCATOR /* actually a bug with const reference overloading */
#endif
//
// versions check:
// we don't support MPW prior to version 8.9:
#if MPW_CPLUS < 0x890
# error "Compiler not supported or configured - please reconfigure"
#endif
//
// last known and checked version is 0x890:
#if (MPW_CPLUS > 0x890)
# if defined(BOOST_ASSERT_CONFIG)
# error "Unknown compiler version - please run the configure tests and report the results"
# endif
#endif

View File

@@ -1,23 +0,0 @@
// (C) Copyright Boost.org 2001. Permission to copy, use, modify, sell and
// distribute this software is granted provided this copyright notice appears
// in all copies. This software is provided "as is" without express or implied
// warranty, and with no claim as to its suitability for any purpose.
// See http://www.boost.org for most recent version.
// SGI C++ compiler setup:
#define BOOST_COMPILER "SGI Irix compiler version " BOOST_STRINGIZE(_COMPILER_VERSION)
#include "boost/config/compiler/common_edg.hpp"
//
// Threading support:
// Turn this on unconditionally here, it will get turned off again later
// if no threading API is detected.
//
#define BOOST_HAS_THREADS
//
// version check:
// probably nothing to do here?

View File

@@ -1,66 +0,0 @@
// (C) Copyright Boost.org 2001. Permission to copy, use, modify, sell and
// distribute this software is granted provided this copyright notice appears
// in all copies. This software is provided "as is" without express or implied
// warranty, and with no claim as to its suitability for any purpose.
// See http://www.boost.org for most recent version.
// Sun C++ compiler setup:
# if __SUNPRO_CC <= 0x500
# define BOOST_NO_MEMBER_TEMPLATES
# define BOOST_NO_FUNCTION_TEMPLATE_ORDERING
# endif
# if (__SUNPRO_CC <= 0x520)
//
// Sunpro 5.2 and earler:
//
// although sunpro 5.2 supports the syntax for
// inline initialization it often gets the value
// wrong, especially where the value is computed
// from other constants (J Maddock 6th May 2001)
# define BOOST_NO_INCLASS_MEMBER_INITIALIZATION
// Although sunpro 5.2 supports the syntax for
// partial specialization, it often seems to
// bind to the wrong specialization. Better
// to disable it until suppport becomes more stable
// (J Maddock 6th May 2001).
# define BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
# endif
# if (__SUNPRO_CC <= 0x530) || !defined(BOOST_STRICT_CONFIG)
// SunPro 5.3 has better support for partial specialization,
// but breaks when compiling std::less<shared_ptr<T> >
// (Jens Maurer 4 Nov 2001).
// std::less specialization fixed as reported by George
// Heintzelman; partial specialization re-enabled
// (Peter Dimov 17 Jan 2002)
//# define BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
// integral constant expressions with 64 bit numbers fail
# define BOOST_NO_INTEGRAL_INT64_T
# endif
#define BOOST_COMPILER "Sun compiler version " BOOST_STRINGIZE(__SUNPRO_CC)
//
// versions check:
// we don't support sunpro prior to version 4:
#if __SUNPRO_CC < 0x400
#error "Compiler not supported or configured - please reconfigure"
#endif
//
// last known and checked version is 0x530:
#if (__SUNPRO_CC > 0x530)
# if defined(BOOST_ASSERT_CONFIG)
# error "Unknown compiler version - please run the configure tests and report the results"
# endif
#endif

View File

@@ -1,36 +0,0 @@
// (C) Copyright Boost.org 2001. Permission to copy, use, modify, sell and
// distribute this software is granted provided this copyright notice appears
// in all copies. This software is provided "as is" without express or implied
// warranty, and with no claim as to its suitability for any purpose.
// See http://www.boost.org for most recent version.
// Visual Age (IBM) C++ compiler setup:
#define BOOST_NO_MEMBER_TEMPLATE_FRIENDS
#define BOOST_NO_INCLASS_MEMBER_INITIALIZATION
//
// On AIX thread support seems to be indicated by _THREAD_SAFE:
//
#ifdef _THREAD_SAFE
# define BOOST_HAS_THREADS
#endif
#define BOOST_COMPILER "IBM Visual Age" BOOST_STRINGIZE(__IBMCPP__)
//
// versions check:
// we don't support Visual age prior to version 5:
#if __IBMCPP__ < 500
#error "Compiler not supported or configured - please reconfigure"
#endif
//
// last known and checked version is 500:
#if (__IBMCPP__ > 500)
# if defined(BOOST_ASSERT_CONFIG)
# error "Unknown compiler version - please run the configure tests and report the results"
# endif
#endif

View File

@@ -1,111 +0,0 @@
// (C) Copyright Boost.org 2001. Permission to copy, use, modify, sell and
// distribute this software is granted provided this copyright notice appears
// in all copies. This software is provided "as is" without express or implied
// warranty, and with no claim as to its suitability for any purpose.
// See http://www.boost.org for most recent version.
// Microsoft Visual C++ compiler setup:
#define BOOST_MSVC _MSC_VER
// turn off the warnings before we #include anything
#pragma warning( disable : 4503 ) // warning: decorated name length exceeded
#if _MSC_VER <= 1200 // 1200 == VC++ 6.0
#pragma warning( disable : 4786 ) // ident trunc to '255' chars in debug info
# define BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS
# define BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS
# define BOOST_NO_VOID_RETURNS
// disable min/max macro defines on vc6:
//
# ifndef NOMINMAX
# define NOMINMAX
# endif
#endif
#if (_MSC_VER <= 1300) // || !defined(BOOST_STRICT_CONFIG) // VC7 Beta 2 or later
#if !defined(_MSC_EXTENSIONS) && !defined(BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS) // VC7 bug with /Za
# define BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS
#endif
# define BOOST_NO_INCLASS_MEMBER_INITIALIZATION
# define BOOST_NO_PRIVATE_IN_AGGREGATE
# define BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP
# define BOOST_NO_INTEGRAL_INT64_T
// VC++ 6/7 has member templates but they have numerous problems including
// cases of silent failure, so for safety we define:
# define BOOST_NO_MEMBER_TEMPLATES
// For VC++ experts wishing to attempt workarounds, we define:
# define BOOST_MSVC6_MEMBER_TEMPLATES
# define BOOST_NO_MEMBER_TEMPLATE_FRIENDS
# define BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
# define BOOST_NO_CV_VOID_SPECIALIZATIONS
# define BOOST_NO_FUNCTION_TEMPLATE_ORDERING
# define BOOST_NO_USING_TEMPLATE
# define BOOST_NO_SWPRINTF
//
// disable min/max macros if defined:
//
# ifdef min
# undef min
# endif
# ifdef max
# undef max
# endif
#endif
#if _MSC_VER <= 1301
# define BOOST_NO_SWPRINTF
#endif
#ifndef _NATIVE_WCHAR_T_DEFINED
# define BOOST_NO_INTRINSIC_WCHAR_T
#endif
//
// check for exception handling support:
#ifndef _CPPUNWIND
# define BOOST_NO_EXCEPTIONS
#endif
//
// __int64 support:
//
#if (_MSC_VER >= 1200) && defined(_MSC_EXTENSIONS)
# define BOOST_HAS_MS_INT64
#endif
//
// disable Win32 API's if compiler extentions are
// turned off:
//
#ifndef _MSC_EXTENSIONS
# define BOOST_DISABLE_WIN32
#endif
#define BOOST_COMPILER "Microsoft Visual C++ version " BOOST_STRINGIZE(_MSC_VER)
//
// versions check:
// we don't support Visual C++ prior to version 6:
#if _MSC_VER < 1200
#error "Compiler not supported or configured - please reconfigure"
#endif
//
// last known and checked version is 1301:
#if (_MSC_VER > 1301)
# if defined(BOOST_ASSERT_CONFIG)
# error "Unknown compiler version - please run the configure tests and report the results"
# else
# pragma message("Unknown compiler version - please run the configure tests and report the results")
# endif
#endif

View File

@@ -1,24 +0,0 @@
// (C) Copyright Boost.org 2001. Permission to copy, use, modify, sell and
// distribute this software is granted provided this copyright notice appears
// in all copies. This software is provided "as is" without express or implied
// warranty, and with no claim as to its suitability for any purpose.
// See http://www.boost.org for most recent version.
// IBM/Aix specific config options:
#define BOOST_PLATFORM "IBM Aix"
#define BOOST_HAS_UNISTD_H
#define BOOST_HAS_PTHREADS
#define BOOST_HAS_NL_TYPES_H
// Threading API's:
#define BOOST_HAS_PTHREAD_DELAY_NP
#define BOOST_HAS_PTHREAD_YIELD
// boilerplate code:
#include <boost/config/posix_features.hpp>

View File

@@ -1,15 +0,0 @@
// (C) Copyright Boost.org 2001. Permission to copy, use, modify, sell and
// distribute this software is granted provided this copyright notice appears
// in all copies. This software is provided "as is" without express or implied
// warranty, and with no claim as to its suitability for any purpose.
// See http://www.boost.org for most recent version.
#define BOOST_PLATFORM "AmigaOS"
#define BOOST_DISABLE_THREADS
#define BOOST_NO_CWCHAR
#define BOOST_NO_STD_WSTRING
#define BOOST_NO_INTRINSIC_WCHAR_T

View File

@@ -1,25 +0,0 @@
// (C) Copyright Boost.org 2001. Permission to copy, use, modify, sell and
// distribute this software is granted provided this copyright notice appears
// in all copies. This software is provided "as is" without express or implied
// warranty, and with no claim as to its suitability for any purpose.
// See http://www.boost.org for most recent version.
// BeOS specific config options:
#define BOOST_PLATFORM "BeOS"
#define BOOST_NO_CWCHAR
#define BOOST_NO_CWCTYPE
#define BOOST_HAS_UNISTD_H
#define BOOST_HAS_BETHREADS
#ifndef BOOST_DISABLE_THREADS
# define BOOST_HAS_THREADS
#endif
// boilerplate code:
#include <boost/config/posix_features.hpp>

View File

@@ -1,61 +0,0 @@
// (C) Copyright Boost.org 2001. Permission to copy, use, modify, sell and
// distribute this software is granted provided this copyright notice appears
// in all copies. This software is provided "as is" without express or implied
// warranty, and with no claim as to its suitability for any purpose.
// See http://www.boost.org for most recent version.
// generic BSD config options:
#if !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__OpenBSD__)
#error "This platform is not BSD"
#endif
#ifdef __FreeBSD__
#define BOOST_PLATFORM "FreeBSD " BOOST_STRINGIZE(__FreeBSD__)
#elif defined(__NetBSD__)
#define BOOST_PLATFORM "NetBSD " BOOST_STRINGIZE(__NetBSD__)
#elif defined(__OpenBSD__)
#define BOOST_PLATFORM "OpenBSD " BOOST_STRINGIZE(__OpenBSD__)
#endif
//
// is this the correct version check?
// FreeBSD has <nl_types.h> but does not
// advertise the fact in <unistd.h>:
//
#if defined(__FreeBSD__) && (__FreeBSD__ >= 3)
# define BOOST_HAS_NL_TYPES_H
#endif
//
// FreeBSD 3.x has pthreads support, but defines _POSIX_THREADS in <pthread.h>
// and not in <unistd.h>
//
#if defined(__FreeBSD__) && (__FreeBSD__ <= 3)
# define BOOST_HAS_PTHREADS
#endif
//
// No wide character support in the BSD header files:
//
#define BOOST_NO_CWCHAR
//
// The BSD <ctype.h> has macros only, no functions:
//
#define BOOST_NO_CTYPE_FUNCTIONS
//
// thread API's not auto detected:
//
#define BOOST_HAS_SCHED_YIELD
#define BOOST_HAS_NANOSLEEP
#define BOOST_HAS_GETTIMEOFDAY
#define BOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE
// boilerplate code:
#define BOOST_HAS_UNISTD_H
#include <boost/config/posix_features.hpp>

View File

@@ -1,37 +0,0 @@
// (C) Copyright Boost.org 2001. Permission to copy, use, modify, sell and
// distribute this software is granted provided this copyright notice appears
// in all copies. This software is provided "as is" without express or implied
// warranty, and with no claim as to its suitability for any purpose.
// See http://www.boost.org for most recent version.
// cygwin specific config options:
#define BOOST_PLATFORM "Cygwin"
#define BOOST_NO_CWCTYPE
#define BOOST_NO_CWCHAR
#define BOOST_NO_SWPRINTF
//
// Threading API:
// See if we have POSIX threads, if we do use them, otherwise
// revert to native Win threads.
#define BOOST_HAS_UNISTD_H
#include <unistd.h>
#if defined(_POSIX_THREADS) && (_POSIX_THREADS+0 >= 0) && !defined(BOOST_HAS_WINTHREADS)
# define BOOST_HAS_PTHREADS
# define BOOST_HAS_SCHED_YIELD
# define BOOST_HAS_GETTIMEOFDAY
# define BOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE
#else
# if !defined(BOOST_HAS_WINTHREADS)
# define BOOST_HAS_WINTHREADS
# endif
# define BOOST_HAS_FTIME
#endif
// boilerplate code:
#include <boost/config/posix_features.hpp>

View File

@@ -1,28 +0,0 @@
// (C) Copyright Boost.org 2001. Permission to copy, use, modify, sell and
// distribute this software is granted provided this copyright notice appears
// in all copies. This software is provided "as is" without express or implied
// warranty, and with no claim as to its suitability for any purpose.
// See http://www.boost.org for most recent version.
// hpux specific config options:
#define BOOST_PLATFORM "HP-UX"
// In principle, HP-UX has a nice <stdint.h> under the name <inttypes.h>
// However, it has the following problem:
// Use of UINT32_C(0) results in "0u l" for the preprocessed source
// (verifyable with gcc 2.95.3, assumed for HP aCC)
// #define BOOST_HAS_STDINT_H
#define BOOST_NO_SWPRINTF
#define BOOST_NO_CWCTYPE
// boilerplate code:
#define BOOST_HAS_UNISTD_H
#include <boost/config/posix_features.hpp>
#ifndef BOOST_HAS_GETTIMEOFDAY
// gettimeofday is always available
#define BOOST_HAS_GETTIMEOFDAY
#endif

View File

@@ -1,24 +0,0 @@
// (C) Copyright Boost.org 2001. Permission to copy, use, modify, sell and
// distribute this software is granted provided this copyright notice appears
// in all copies. This software is provided "as is" without express or implied
// warranty, and with no claim as to its suitability for any purpose.
// See http://www.boost.org for most recent version.
// SGI Irix specific config options:
#define BOOST_PLATFORM "SGI Irix"
#define BOOST_NO_SWPRINTF
//
// these are not auto detected by POSIX feature tests:
//
#define BOOST_HAS_GETTIMEOFDAY
#define BOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE
// boilerplate code:
#define BOOST_HAS_UNISTD_H
#include <boost/config/posix_features.hpp>

View File

@@ -1,87 +0,0 @@
// (C) Copyright Boost.org 2001. Permission to copy, use, modify, sell and
// distribute this software is granted provided this copyright notice appears
// in all copies. This software is provided "as is" without express or implied
// warranty, and with no claim as to its suitability for any purpose.
// See http://www.boost.org for most recent version.
// linux specific config options:
#define BOOST_PLATFORM "linux"
// make sure we have __GLIBC_PREREQ if available at all
#include <cstdlib>
//
// <stdint.h> added to glibc 2.1.1
// We can only test for 2.1 though:
//
#if defined(__GLIBC__) && ((__GLIBC__ > 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ >= 1)))
// <stdint.h> defines int64_t unconditionally, but <sys/types.h> defines
// int64_t only if __GNUC__. Thus, assume a fully usable <stdint.h>
// only when using GCC.
# if defined __GNUC__
# define BOOST_HAS_STDINT_H
# endif
#endif
//
// como on linux doesn't have std:: c functions:
//
#ifdef __COMO__
# define BOOST_NO_STDC_NAMESPACE
#endif
//
// If glibc is past version 2 then we definitely have
// gettimeofday, earlier versions may or may not have it:
//
#if defined(__GLIBC__) && (__GLIBC__ >= 2)
# define BOOST_HAS_GETTIMEOFDAY
#endif
#ifdef __USE_POSIX199309
# define BOOST_HAS_NANOSLEEP
#endif
#if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
// __GLIBC_PREREQ is available since 2.1.2
// swprintf is available since glibc 2.2.0
# if !__GLIBC_PREREQ(2,2) || (!defined(__USE_ISOC99) && !defined(__USE_UNIX98))
# define BOOST_NO_SWPRINTF
# endif
#else
# define BOOST_NO_SWPRINTF
#endif
// boilerplate code:
#define BOOST_HAS_UNISTD_H
#include <boost/config/posix_features.hpp>
#ifndef __GNUC__
//
// if the compiler is not gcc we still need to be able to parse
// the GNU system headers, some of which (mainly <stdint.h>)
// use GNU specific extensions:
//
# ifndef __extension__
# define __extension__
# endif
# ifndef __const__
# define __const__ const
# endif
# ifndef __volatile__
# define __volatile__ volatile
# endif
# ifndef __signed__
# define __signed__ signed
# endif
# ifndef __typeof__
# define __typeof__ typeof
# endif
# ifndef __inline__
# define __inline__ inline
# endif
#endif

View File

@@ -1,59 +0,0 @@
// (C) Copyright Boost.org 2001. Permission to copy, use, modify, sell and
// distribute this software is granted provided this copyright notice appears
// in all copies. This software is provided "as is" without express or implied
// warranty, and with no claim as to its suitability for any purpose.
// See http://www.boost.org for most recent version.
// Mac OS specific config options:
#define BOOST_PLATFORM "Mac OS"
// If __MACH__, we're using the BSD standard C library, not the MSL:
#if defined(__MACH__)
# define BOOST_NO_CTYPE_FUNCTIONS
# define BOOST_NO_CWCHAR
# ifndef BOOST_HAS_UNISTD_H
# define BOOST_HAS_UNISTD_H
# endif
// boilerplate code:
# include <boost/config/posix_features.hpp>
# ifndef BOOST_HAS_STDINT_H
# define BOOST_HAS_STDINT_H
# endif
//
// BSD runtime has pthreads, sched_yield and gettimeofday,
// of these only pthreads are advertised in <unistd.h>, so set the
// other options explicitly:
//
# define BOOST_HAS_SCHED_YIELD
# define BOOST_HAS_GETTIMEOFDAY
# ifndef __APPLE_CC__
// GCC strange "ignore std" mode works better if you pretend everything
// is in the std namespace, for the most part.
# define BOOST_NO_STDC_NAMESPACE
# endif
#else
// We will eventually support threads in non-Carbon builds, but we do
// not support this yet.
# if TARGET_CARBON
# define BOOST_HAS_MPTASKS
// The MP task implementation of Boost Threads aims to replace MP-unsafe
// parts of the MSL, so we turn on threads unconditionally.
# define BOOST_HAS_THREADS
// The remote call manager depends on this.
# define BOOST_BIND_ENABLE_PASCAL
# endif
#endif

Some files were not shown because too many files have changed in this diff Show More