Compare commits

...

5310 Commits

Author SHA1 Message Date
John Criswell
1c962223f4 Add PR#566; something I should have done before.
llvm-svn: 22118
2005-05-18 15:37:06 +00:00
John Criswell
c1dd9b667a Updated for LLVM 1.5.
llvm-svn: 22117
2005-05-18 14:41:07 +00:00
John Criswell
8e6ae64167 Fix name of LLVM CFE source tarball.
llvm-svn: 22110
2005-05-17 21:14:58 +00:00
John Criswell
762895b3f9 Fixed the descriptions of llvmc and llvm-ld to not be version specific.
Fixed some typos.

llvm-svn: 22108
2005-05-17 16:57:10 +00:00
John Criswell
6d9c9a176a Added Linux/Itanium back. Linux/PPC is the platform that we haven't used
yet.

llvm-svn: 22107
2005-05-17 16:19:48 +00:00
John Criswell
687343547a Merged from Mainline.
llvm-svn: 22106
2005-05-17 16:09:30 +00:00
John Criswell
4447fc67ef Merged Misha Modifications from Mainline.
llvm-svn: 22105
2005-05-17 16:08:29 +00:00
John Criswell
4d9d10c757 Updated from mainline.
llvm-svn: 22104
2005-05-17 16:07:32 +00:00
John Criswell
21c9bf15f5 Merged from mainline.
llvm-svn: 22103
2005-05-17 16:07:08 +00:00
John Criswell
033f60f6d4 Removed Linux/Itanium as we don't really know if it works.
Made other minor corrections.

llvm-svn: 22102
2005-05-17 16:05:22 +00:00
John Criswell
25b91e4ae0 Updated the version to 1.5.
llvm-svn: 22095
2005-05-16 19:30:22 +00:00
CVS to SVN Conversion
f2fed73d14 This commit was manufactured by cvs2svn to create branch 'release_15'.
llvm-svn: 22089
2005-05-16 17:13:10 +00:00
Chris Lattner
cb5596d51b more minor edits
llvm-svn: 22088
2005-05-16 17:13:10 +00:00
Chris Lattner
683a847c26 more edits
llvm-svn: 22087
2005-05-16 17:06:29 +00:00
Chris Lattner
7e1f26256d more edits, include stuff from the status update
llvm-svn: 22086
2005-05-16 16:56:09 +00:00
Duraid Madina
e5ee0d0730 pretty tiny change (looks like adding the HP-UX detection and line number
changes to me)

- not committing autoconf/configure.ac (oops, already committed that!)
- not committing include/llvm/Config/config.h.in (it remains unchanged)

llvm-svn: 22085
2005-05-16 16:33:34 +00:00
Chris Lattner
0ca648f813 flush on the right and indented on the left looks a bit weird.
llvm-svn: 22084
2005-05-16 16:30:10 +00:00
John Criswell
88190562e6 Added a note about how the type can be omitted in call instructions.
Added a note about how getelementptr can be used to index into structures
or arrays.
Fixed some typos, spelling, etc.

llvm-svn: 22083
2005-05-16 16:17:45 +00:00
Chris Lattner
15c74de0dd fix a typo duraid noticed
llvm-svn: 22082
2005-05-16 15:37:19 +00:00
Duraid Madina
3dbbc88f52 comment the hpux bit
llvm-svn: 22081
2005-05-16 06:59:53 +00:00
Chris Lattner
a3ea6446da more edits
llvm-svn: 22080
2005-05-16 06:58:39 +00:00
Duraid Madina
33464ad3a2 HP-UX system headers make a mess of isinf(), so much so that gcc fixincludes
can't patch it up for c++ (works in C though)

llvm-svn: 22079
2005-05-16 06:45:57 +00:00
Duraid Madina
60c9a3c171 hp-ux needs this to get through the System/Support libs
llvm-svn: 22078
2005-05-16 06:38:09 +00:00
Duraid Madina
5ea2ba8bae detect HP-UX when configuring
llvm-svn: 22077
2005-05-16 05:39:00 +00:00
Chris Lattner
a1a1e93da9 remove deprecated methods
llvm-svn: 22076
2005-05-16 01:49:23 +00:00
Chris Lattner
7caf6f6ca7 GCC4 + IA64 = badnews
llvm-svn: 22075
2005-05-15 22:26:45 +00:00
Reid Spencer
7ed7930dff Remove the check for the ffsll function. Its no longer needed by the
simplify-libcalls pass (pass now computes it without a call to ffsll).

llvm-svn: 22074
2005-05-15 22:15:11 +00:00
Chris Lattner
b57b28fbbf Improve statement
llvm-svn: 22073
2005-05-15 21:38:32 +00:00
Reid Spencer
f0b186e49e Don't eliminate a test case, just the form of the test case, from the
previous revision.

llvm-svn: 22072
2005-05-15 21:35:26 +00:00
Chris Lattner
847f580c7c This does not belong
llvm-svn: 22071
2005-05-15 21:31:36 +00:00
Reid Spencer
74305a6233 Don't look for __builtin_ffs, we'll never see it from llvm-gcc and there's
not reason to include it for other front ends.

llvm-svn: 22070
2005-05-15 21:27:34 +00:00
Reid Spencer
597618f9f8 Add a case with non-constant argument for testing the transform:
ffs(x) -> (x == 0 ? 0 : llvm.cttz(0)+1)

llvm-svn: 22069
2005-05-15 21:26:59 +00:00
Reid Spencer
17f7784c5d Provide this optimization as well:
ffs(x) -> (x == 0 ? 0 : 1+llvm.cttz(x))

llvm-svn: 22068
2005-05-15 21:19:45 +00:00
Chris Lattner
4e5a3a6df6 PPC "branch and link" instructions are branches in the PPC sense, but not
in the LLVM code generator sense (they are calls).  Don't mark them as such,
which fixes the regressions on the ppc tester last night

llvm-svn: 22065
2005-05-15 20:11:44 +00:00
Chris Lattner
0ae9b08916 Fix andrews changes to fit in 80 columns
llvm-svn: 22064
2005-05-15 19:54:37 +00:00
Chris Lattner
efa20fab2d ctlz = most signficant bits, cttz = least sig
llvm-svn: 22061
2005-05-15 19:39:26 +00:00
Chris Lattner
04d6ed5ef0 fix warning
llvm-svn: 22060
2005-05-15 17:25:14 +00:00
Chris Lattner
7f910cd444 fix compiler warning
llvm-svn: 22059
2005-05-15 17:23:19 +00:00
Reid Spencer
3de98ee643 Duh .. you actually have to #include Config/config.h before you can test
for one of the values that it defines!

llvm-svn: 22058
2005-05-15 17:20:47 +00:00
Reid Spencer
294715b33e Some cleanups for compilation with GCC 4.0.0 to remove warnings:
* Use C++ style casts, not C style casts
* Abstract base classes should have virtual destructor.

llvm-svn: 22057
2005-05-15 16:13:11 +00:00
Chris Lattner
b62a5f0c03 add a sparcv8 section, make this validate
llvm-svn: 22056
2005-05-15 16:01:20 +00:00
Chris Lattner
8563e39c01 more edits, add anchors
llvm-svn: 22055
2005-05-15 15:33:21 +00:00
Duraid Madina
9f406cb29b make angry compilers happy again
llvm-svn: 22054
2005-05-15 14:44:13 +00:00
Duraid Madina
73c4dbae23 aCC and STLport complained about this, because they're like that
llvm-svn: 22053
2005-05-15 13:05:48 +00:00
Chris Lattner
17b2e4837b edits to the simplify-libcalls element, move it higher in the list.
llvm-svn: 22052
2005-05-15 06:09:55 +00:00
Chris Lattner
55f987b45c add generated code
llvm-svn: 22051
2005-05-15 06:07:40 +00:00
Chris Lattner
1a61fa460f don't reserve space for tailcall arg areas. It explicitly managed.
llvm-svn: 22050
2005-05-15 06:07:10 +00:00
Reid Spencer
ea77685e20 Make note of the -simplify-libcalls pass.
llvm-svn: 22049
2005-05-15 06:05:11 +00:00
Chris Lattner
6e3decb6ea add test to check for tail calls
llvm-svn: 22048
2005-05-15 05:52:51 +00:00
Chris Lattner
97e3b65652 Teach reginfo how to deal with ADJSTACKPTRri, allowing us to generate:
add %ESP, 20
        jmp %EDX  # TAIL CALL

instead of:
        add %ESP, -8
        add %ESP, 28
        jmp %EDX  # TAIL CALL

llvm-svn: 22047
2005-05-15 05:49:58 +00:00
Chris Lattner
dd66a41e0e Implement proper tail calls in the X86 backend for all fastcc->fastcc
tail calls.

llvm-svn: 22046
2005-05-15 05:46:45 +00:00
Chris Lattner
406bddfb3a Substantial edits for the release notes.
llvm-svn: 22045
2005-05-15 05:44:51 +00:00
Chris Lattner
51836bbc82 Add some simplifications for MULH[SU]. This allows us to compile this:
long %bar(long %X) {
  %Y = mul long %X, 4294967297
  ret long %Y
}

to this:

l1_bar:
        mov %EAX, DWORD PTR [%ESP + 4]
        mov %EDX, %EAX
        add %EDX, DWORD PTR [%ESP + 8]
        ret

instead of:

l1_bar:
        mov %ECX, DWORD PTR [%ESP + 4]
        mov %EDX, 1
        mov %EAX, %ECX
        mul %EDX
        add %EDX, %ECX
        add %EDX, DWORD PTR [%ESP + 8]
        mov %EAX, %ECX
        ret

llvm-svn: 22044
2005-05-15 05:39:08 +00:00
Chris Lattner
3f5a98d1f4 Add markers in the asm file for tail calls, add a new ADJSTACKPTRri
sorta-pseudo-instruction

llvm-svn: 22042
2005-05-15 03:10:37 +00:00
Chris Lattner
468b9577b6 When inserting callee-save register reloads, make sure to skip over any
terminator instructions before the 'ret' in case the target has a
multi-instruction return sequence.

llvm-svn: 22041
2005-05-15 03:09:58 +00:00
Chris Lattner
6b5fa91a63 Yes, calltarget is the operand of the day.
llvm-svn: 22040
2005-05-15 01:10:30 +00:00
Chris Lattner
8d1ea49603 Make sure this is not eligible for tail-call-elimination so that we test
the correct thing.

llvm-svn: 22039
2005-05-14 23:54:55 +00:00
Chris Lattner
5366c859a7 When emitting the function epilog, check to see if there already a stack
adjustment.  If so, we merge the adjustment into the existing one.  This
allows us to generate:

caller2:
        sub %ESP, 12
        mov DWORD PTR [%ESP], 0
        mov %EAX, 1234567890
        mov %EDX, 0
        call func2
        add %ESP, 8
        ret 4

intead of:

caller2:
        sub %ESP, 12
        mov DWORD PTR [%ESP], 0
        mov %EAX, 1234567890
        mov %EDX, 0
        call func2
        sub %ESP, 4
        add %ESP, 12
        ret 4

for X86/fast-cc-merge-stack-adj.ll

llvm-svn: 22038
2005-05-14 23:53:43 +00:00
Chris Lattner
fe2ebdef4d new testcase
llvm-svn: 22037
2005-05-14 23:52:09 +00:00
Chris Lattner
f0649db870 Add some new instructions
llvm-svn: 22036
2005-05-14 23:35:21 +00:00
Chris Lattner
14b780fae5 add x86-64 abi
llvm-svn: 22035
2005-05-14 22:06:42 +00:00
Reid Spencer
6ed7d1ea62 * Truncate a long line.
* By default, doxygen output formatted for printing on letter size paper
  not A4.

llvm-svn: 22034
2005-05-14 20:06:31 +00:00
Reid Spencer
c51ced3e6b Forgot to commit this earlier. Its part of the simplify-libcalls
enhancement for ffs, ffsl, and ffsll optimizations. We can't do the opt
unless we also have the at least ffsll function. Notably SVR4 doesn't.

llvm-svn: 22033
2005-05-14 20:04:19 +00:00
Andrew Lenharth
8ecaa45625 mention the C++ exception problems on alpha
llvm-svn: 22029
2005-05-14 17:43:00 +00:00
Reid Spencer
5b3c66676c Add a test case for testing ffs libcall conversion to constant
llvm-svn: 22028
2005-05-14 16:44:43 +00:00
Reid Spencer
b195fcd5ef Changes for ffs lib call simplification:
* Check for availability of ffsll call in configure script
* Support ffs, ffsl, and ffsll conversion to constant value if the argument
  is constant.

llvm-svn: 22027
2005-05-14 16:42:52 +00:00
Chris Lattner
e4f71d036f Fix construction of ioport intrinsics, fixing X86/io.llx and io-port.llx
llvm-svn: 22026
2005-05-14 13:56:55 +00:00
Chris Lattner
403d1c204c Preserve calling conv when hacking on calls
llvm-svn: 22025
2005-05-14 12:28:32 +00:00
Chris Lattner
05c703ea85 preserve calling conventions when hacking on code
llvm-svn: 22024
2005-05-14 12:25:32 +00:00
Chris Lattner
bcefcf8552 Make sure to preserve the calling convention when changing an invoke into
a call.  This fixes Prolangs-C++/deriv2, kimwitu++, and Misc-C++/bigfib
on X86 with -enable-x86-fastcc.

llvm-svn: 22023
2005-05-14 12:21:56 +00:00
Chris Lattner
18b2c2f13c Pass i64 values correctly split in reg/mem to fastcc calls.
This fixes fourinarow with -enable-x86-fastcc.

llvm-svn: 22022
2005-05-14 12:03:10 +00:00
Chris Lattner
1b3520c90b Use target-specific nodes for calls. This allows the fastcc code to not have
to do ugly hackery to avoid emitting code like this:

   call foo
   mov vreg, EAX
   adjcallstackup ...

If foo is a fastcc call and if vreg gets spilled, we might end up with this:

   call foo
   mov [ESP+offset], EAX     ;; Offset doesn't consider the 12!
   sub ESP, 12

Which is bad.  The previous hacky code to deal with this was A) gross B) not
good enough.  In particular, it could miss cases and emit the bad code above.
Now we always emit this:

   call foo
   adjcallstackup ...
   mov vreg, EAX

directly.

This makes fastcc with callees poping the stack work much better.  Next
stop (finally!) really is tail calls.

llvm-svn: 22021
2005-05-14 08:48:15 +00:00
Chris Lattner
3268f244e6 allow token chain at start or end of node
llvm-svn: 22020
2005-05-14 08:34:53 +00:00
Chris Lattner
865359958b remove special case hacks for readport/readio from the binary operator
codepath

llvm-svn: 22019
2005-05-14 07:45:46 +00:00
Chris Lattner
566307f92a Implement fixme's by memoizing nodes.
llvm-svn: 22018
2005-05-14 07:42:29 +00:00
Chris Lattner
b76fb15aad add a new map
llvm-svn: 22017
2005-05-14 07:36:02 +00:00
Chris Lattner
833a4fbdc5 Turn this into a wrapper for a simpler version of getNode.
llvm-svn: 22016
2005-05-14 07:32:14 +00:00
Chris Lattner
96c262e24b Eliminate special purpose hacks for dynamic_stack_alloc.
llvm-svn: 22015
2005-05-14 07:29:57 +00:00
Chris Lattner
669e8c2c9c Use the general mechanism for creating multi-value nodes instead of using
special case hacks.

llvm-svn: 22014
2005-05-14 07:25:05 +00:00
Chris Lattner
024e1922e6 Ensure these casts are done with the hardware fildll instruction
llvm-svn: 22013
2005-05-14 07:09:25 +00:00
Chris Lattner
a36117b360 use a target-specific node and custom expander to lower long->FP to FILD64m.
This should fix some missing symbols problems on BSD and improve performance
of programs that use that operation.

llvm-svn: 22012
2005-05-14 06:52:07 +00:00
Chris Lattner
006f56b177 Wrap long line, actually add node to the graph.
llvm-svn: 22011
2005-05-14 06:42:57 +00:00
Chris Lattner
3eb8693279 legalize target-specific operations
llvm-svn: 22010
2005-05-14 06:34:48 +00:00
Chris Lattner
d553133308 add a getNode() version that allows construction of any node type.
llvm-svn: 22009
2005-05-14 06:20:26 +00:00
Chris Lattner
71595c95d6 Add a way to construct an arbitrary node, cleanly.
llvm-svn: 22008
2005-05-14 06:20:08 +00:00
Chris Lattner
eaff95da8f add accessors
llvm-svn: 22007
2005-05-14 06:19:11 +00:00
Reid Spencer
a27d7a67f7 Some minor adjustments for the 1.5 release.
llvm-svn: 22006
2005-05-14 05:52:07 +00:00
Chris Lattner
dbbdd165a6 Pass the dag into LowerOperation
llvm-svn: 22005
2005-05-14 05:51:05 +00:00
Chris Lattner
29dcc71d83 LowerOperation takes a dag
llvm-svn: 22004
2005-05-14 05:50:48 +00:00
Duraid Madina
9a449003d0 add a bit about the known problems on IA64
llvm-svn: 22003
2005-05-14 05:48:13 +00:00
Chris Lattner
c08d786ba5 Print the symbolic register name in a register allocator debug dump.
llvm-svn: 22002
2005-05-14 05:34:15 +00:00
Chris Lattner
d3cc996a47 Allow targets to have a custom int64->fp expander if desired
llvm-svn: 22001
2005-05-14 05:33:54 +00:00
Chris Lattner
b42e8723b0 this passes
llvm-svn: 22000
2005-05-14 02:35:38 +00:00
Chris Lattner
a11e367ae5 Fix this
llvm-svn: 21999
2005-05-14 02:33:20 +00:00
Chris Lattner
f47e4c174b minor changes
llvm-svn: 21998
2005-05-14 01:30:15 +00:00
Chris Lattner
48ec173312 user ops are not encoded in the bc format
llvm-svn: 21997
2005-05-14 01:26:46 +00:00
Reid Spencer
621fd111b5 Document the pseudo-instruction opcodes in opcode range 56-63. These are
used to support things like volatile load/store, tail calls, and calling
conventions without reserving space for the additional information.

llvm-svn: 21996
2005-05-14 00:06:06 +00:00
Chris Lattner
9b29fe2008 Make sure the start of the arg area and the end (after the RA is pushed)
is always 8-byte aligned for fastcc

llvm-svn: 21995
2005-05-13 23:49:10 +00:00
Chris Lattner
4e63e3f5c8 fix the assertion
llvm-svn: 21994
2005-05-13 23:35:47 +00:00
Chris Lattner
cbefe72fb2 Align doubles on 8-byte boundaries if possible.
llvm-svn: 21993
2005-05-13 23:14:17 +00:00
Chris Lattner
77b220f3d5 print stack object alignment in -print-machineinstr dumps
llvm-svn: 21992
2005-05-13 22:54:44 +00:00
Chris Lattner
5011ff0179 fix typo
llvm-svn: 21991
2005-05-13 22:46:57 +00:00
John Criswell
4a3327eead Minor fixup of typos.
llvm-svn: 21990
2005-05-13 22:25:59 +00:00
Chris Lattner
5900197232 new testcase
llvm-svn: 21989
2005-05-13 22:15:26 +00:00
Chris Lattner
2267d67941 Fix the problems with callee popped argument lists
llvm-svn: 21988
2005-05-13 22:13:49 +00:00
John Criswell
ca6db82fc4 Removed PPC Linux support, as no one seems to have used it yet.
llvm-svn: 21987
2005-05-13 21:55:49 +00:00
Chris Lattner
79e9fa5de1 Don't emit SAR X, 0 in the case of sdiv Y, 2
llvm-svn: 21986
2005-05-13 21:50:27 +00:00
Chris Lattner
7d387d207d Fix UnitTests/2005-05-13-SDivTwo.c
llvm-svn: 21985
2005-05-13 21:48:20 +00:00
Chris Lattner
c0e369ed66 switch to having the callee pop stack operands for fastcc. This is currently buggy
do not use

llvm-svn: 21984
2005-05-13 21:44:04 +00:00
Chris Lattner
f6fb5e91b2 Tolerate instrs with extra args
llvm-svn: 21982
2005-05-13 21:07:15 +00:00
John Criswell
4876135a51 Add a note about SPARC V8.
llvm-svn: 21981
2005-05-13 20:54:44 +00:00
Chris Lattner
1a12476531 allow RETI
llvm-svn: 21980
2005-05-13 20:46:35 +00:00
Chris Lattner
e4df5e4681 add support for fastcc and friends
llvm-svn: 21979
2005-05-13 20:40:52 +00:00
John Criswell
608f4805f3 Minor fixes.
llvm-svn: 21978
2005-05-13 20:38:44 +00:00
Chris Lattner
8abab9b0c7 treat TAILCALL nodes identically to CALL nodes
llvm-svn: 21977
2005-05-13 20:29:26 +00:00
Chris Lattner
f27e31d690 Build TAILCALL nodes in LowerCallTo, treat them like normal calls everywhere.
llvm-svn: 21976
2005-05-13 20:29:13 +00:00
John Criswell
d523492fcd Added some missing platforms.
Fixed some wording to be more accurate (I hope).

llvm-svn: 21975
2005-05-13 20:28:15 +00:00
John Criswell
61617f7843 More typo and wording fixes.
llvm-svn: 21974
2005-05-13 20:25:49 +00:00
Chris Lattner
153827b086 Add reassociation, minor cleanups.
llvm-svn: 21973
2005-05-13 20:18:49 +00:00
Chris Lattner
e59cddf838 close off B< tag
llvm-svn: 21972
2005-05-13 20:14:06 +00:00
Chris Lattner
91a649a28e remove htmlisms
llvm-svn: 21971
2005-05-13 20:13:39 +00:00
Chris Lattner
3ea0d3f6f0 fix typo
llvm-svn: 21970
2005-05-13 20:10:13 +00:00
Chris Lattner
d941d9c6a0 note how to disable inlining
llvm-svn: 21969
2005-05-13 20:09:33 +00:00
Chris Lattner
4aefdd0f62 fix link to llvm-ar
llvm-svn: 21968
2005-05-13 20:08:34 +00:00
Chris Lattner
9b3e5950b2 these don't use passes
llvm-svn: 21967
2005-05-13 20:04:33 +00:00
Chris Lattner
2d542fc8c0 this detail is not needed here
llvm-svn: 21966
2005-05-13 20:03:17 +00:00
Chris Lattner
6953a6e799 update this manual
llvm-svn: 21965
2005-05-13 20:01:11 +00:00
Chris Lattner
88bb4457fc Capitalize
llvm-svn: 21964
2005-05-13 19:49:09 +00:00
Andrew Lenharth
805fcb9f1a fix regression tests
llvm-svn: 21963
2005-05-13 19:49:02 +00:00
Chris Lattner
6fec835461 capitalize
llvm-svn: 21962
2005-05-13 19:48:34 +00:00
John Criswell
417cb0aec4 Minor corrections and clarifications.
llvm-svn: 21961
2005-05-13 19:48:07 +00:00
Chris Lattner
f4cfcc48f6 clarify that these are v9 options
llvm-svn: 21960
2005-05-13 19:45:45 +00:00
Chris Lattner
f9a4d96038 hide this option
llvm-svn: 21959
2005-05-13 19:44:21 +00:00
Chris Lattner
2e77db6af6 Add an isTailCall flag to LowerCallTo
llvm-svn: 21958
2005-05-13 18:50:42 +00:00
Chris Lattner
d0feb64443 Handle TAILCALL node
llvm-svn: 21957
2005-05-13 18:43:43 +00:00
Chris Lattner
46db599b61 add TAILCALL node
llvm-svn: 21956
2005-05-13 18:40:17 +00:00
Chris Lattner
57e3597583 This passes on sparc
llvm-svn: 21955
2005-05-13 18:37:58 +00:00
Reid Spencer
83745dda88 * Make some warning messages stand out a bit by putting **** at the end
* Fix a typo that prevents BuildMode from being printed

llvm-svn: 21954
2005-05-13 18:32:54 +00:00
Reid Spencer
6ab4ba4030 Fix the "stacker doesn't build without llvm-gcc" problem. The configure
script was defaulting the LLVMGCC variable to "llvm-gcc" if it couldn't
find llvm-gcc and --with-llvmgccdir was not specified. In this case, there
is no llvm-gcc available on the system so we shouldn't assume that the
user's path will find it any better than configure could. The fix is to
default it to an empty string. If LLVMGCC is empty, the makefiles will
avoid building things that depend on llvm-gcc and give a nice warning
message to that effect.

llvm-svn: 21953
2005-05-13 18:30:13 +00:00
Chris Lattner
e622357fbf remove test
llvm-svn: 21952
2005-05-13 18:19:29 +00:00
Chris Lattner
6e4c2302e6 add 'ret imm' instruction
llvm-svn: 21945
2005-05-13 17:56:48 +00:00
Reid Spencer
daeb5f0900 The previous hack didn't work because tools-only isn't defined and isn't
a target at this level of build. There shouldn't be a problem with building
the runtime library without llvm-gcc because the Makefile.rules checks
for an empty LLVMGCC variable before building bytecode modules.

llvm-svn: 21942
2005-05-13 17:42:54 +00:00
John Criswell
2d4fc4c676 These tests are currently expected to fail.
llvm-svn: 21941
2005-05-13 17:36:00 +00:00
Chris Lattner
5b256d67cc Force x86 backend
llvm-svn: 21940
2005-05-13 16:20:59 +00:00
Chris Lattner
6756f2f795 Realize that we don't support fmod directly, fixing CodeGen/Generic/print-arith-fp.ll
llvm-svn: 21939
2005-05-13 16:20:22 +00:00
Reid Spencer
74905e0fb5 Don't build runtime if tools-only :)
llvm-svn: 21938
2005-05-13 16:17:58 +00:00
Chris Lattner
0f0e75dfad fix buggy test
llvm-svn: 21937
2005-05-13 15:51:31 +00:00
Chris Lattner
bf33da2952 Fix buggy test
llvm-svn: 21936
2005-05-13 15:48:41 +00:00
Chris Lattner
1df9ffa483 let dj run this
llvm-svn: 21935
2005-05-13 15:44:55 +00:00
Andrew Lenharth
5dcd5c8896 fixed test case
llvm-svn: 21934
2005-05-13 15:42:07 +00:00
Chris Lattner
0b17b45a96 Do not CopyFromReg physregs for live-in values. Instead, create a vreg for
each live in, and copy the regs from the vregs.  As the very first thing we
do in the function, insert copies from the pregs to the vregs.  This fixes
problems where the token chain of CopyFromReg was not enough to allow reordering
of the copyfromreg nodes and other unchained nodes (e.g. div, which clobbers
eax on intel).

llvm-svn: 21932
2005-05-13 07:38:09 +00:00
Chris Lattner
d0b0ecca3f Emit function entry code after lowering hte arguments.
llvm-svn: 21931
2005-05-13 07:33:32 +00:00
Chris Lattner
0220b2952f Allow targets to emit code into the entry block of each function
llvm-svn: 21930
2005-05-13 07:23:21 +00:00
Chris Lattner
d705b39476 add a new method
llvm-svn: 21929
2005-05-13 07:23:03 +00:00
Chris Lattner
61d9d81770 calling a function with the wrong CC is undefined, turn it into an unreachable
instruction.  This is useful for catching optimizers that don't preserve
calling conventions

llvm-svn: 21928
2005-05-13 07:09:09 +00:00
Chris Lattner
91caf1d039 allow a virtual register to be associated with live-in values.
llvm-svn: 21927
2005-05-13 07:08:07 +00:00
Reid Spencer
39ec7f049d Make sure that decompression checks for the case that bzip2 returns
BZ_OK (meaning more data is expected) but there is no more input data. In
this case, the input file is probably truncated. Generate an exception that
indicates this case when its detected.

llvm-svn: 21926
2005-05-13 07:05:37 +00:00
Chris Lattner
ca968393ab When lowering invokes to calls, amke sure to preserve the calling conv. This
fixes Ptrdist/anagram with x86 llcbeta

llvm-svn: 21925
2005-05-13 06:27:02 +00:00
Chris Lattner
ae186e012c Prefer int 0 instead of long 0 for GEP arguments.
llvm-svn: 21924
2005-05-13 06:10:12 +00:00
Chris Lattner
bb1d60de9c Fix a problem that nate reduced for me.
llvm-svn: 21923
2005-05-13 05:17:00 +00:00
Chris Lattner
5a14c8a18e rename variables and functions to match renamed DAG nodes. Bonus feature:
I can actually remember which one is which now!

llvm-svn: 21922
2005-05-13 05:09:11 +00:00
Chris Lattner
4339c4b05a disable this test for now.
llvm-svn: 21920
2005-05-13 04:51:58 +00:00
Chris Lattner
2a4f7312cd do not call expandop on the same value more than once. This fixes
X86/2004-02-22-Casts.llx

llvm-svn: 21919
2005-05-13 04:45:13 +00:00
Chris Lattner
f26c015929 add a correct run line
llvm-svn: 21918
2005-05-13 04:20:57 +00:00
Chris Lattner
e3677d6354 fix a bad typeo
llvm-svn: 21917
2005-05-12 23:51:40 +00:00
Chris Lattner
d34cd28aa7 update comment
llvm-svn: 21916
2005-05-12 23:24:44 +00:00
Chris Lattner
2dce703710 rename the ADJCALLSTACKDOWN/ADJCALLSTACKUP nodes to be CALLSEQ_START/BEGIN.
llvm-svn: 21915
2005-05-12 23:24:06 +00:00
Chris Lattner
53eadd159b reg test
llvm-svn: 21914
2005-05-12 23:09:04 +00:00
Chris Lattner
7ce7a8fc81 Add a new -enable-x86-fastcc option that enables passing the first
two integer values in registers for the fastcc calling conv.

llvm-svn: 21912
2005-05-12 23:06:28 +00:00
Misha Brukman
16948006b6 * Remove reference to llvm-fefw
* Fix copyright line

llvm-svn: 21910
2005-05-12 22:15:34 +00:00
Misha Brukman
b151770b4a llvm-fefw doesn't exist (yet)
llvm-svn: 21907
2005-05-12 21:56:03 +00:00
Misha Brukman
cb3fc5ca75 Remove extraneous `U ' in copyright line
llvm-svn: 21906
2005-05-12 21:49:11 +00:00
Misha Brukman
f1ed8ede29 * Fix wording of the warning
* Add autoindent, smartindent, and smarttab options to the file

llvm-svn: 21905
2005-05-12 21:41:48 +00:00
Misha Brukman
7ced60afcc Remove extraneous colons after program names for consistency
llvm-svn: 21904
2005-05-12 21:39:01 +00:00
John Criswell
d85e1a85bf Shameless update of copyright years.
llvm-svn: 21903
2005-05-12 21:25:32 +00:00
John Criswell
878a202e89 Fix this test on Solaris.
Solaris grep is more traditional and (AFAIK) does not support regexs.
Also, single quotes should disable all shell interpretation, so no
backslashes should be needed (and, in fact, keep Solaris from working).

llvm-svn: 21902
2005-05-12 21:06:05 +00:00
Chris Lattner
33d1b6d28f LowerCallTo now takes the cc to use
llvm-svn: 21901
2005-05-12 19:57:08 +00:00
Chris Lattner
111778e665 Pass calling convention to use into lower call to
llvm-svn: 21900
2005-05-12 19:56:57 +00:00
Chris Lattner
36674a123e Pass in Calling Convention to use into LowerCallTo
llvm-svn: 21899
2005-05-12 19:56:45 +00:00
Chris Lattner
b5ff4e5e10 Enable pattern isel by default
llvm-svn: 21898
2005-05-12 19:56:09 +00:00
Chris Lattner
0bfd177e89 fix expansion of ct[lt]z nodes
llvm-svn: 21896
2005-05-12 19:27:51 +00:00
Chris Lattner
cf5f6b0ccb Expand 64-bit ctlz/cttz nodes for 32-bit targets
llvm-svn: 21895
2005-05-12 19:05:01 +00:00
Chris Lattner
26f0317f46 Fix uint->fp casts on PPC, allowing UnitTests/2005-05-12-Int64ToFP to
work on it.

llvm-svn: 21894
2005-05-12 18:52:34 +00:00
John Criswell
c932bef114 Correct a detail with the alloca instruction.
Functions do not exit with invoke; they exit with unwind.

llvm-svn: 21893
2005-05-12 16:55:34 +00:00
Chris Lattner
b5a78e0873 Allow something to be legalized multiple times. This can be used to reduce
legalization iteration

llvm-svn: 21892
2005-05-12 16:53:42 +00:00
John Criswell
02fdc6fab4 Fixed some typos.
llvm-svn: 21891
2005-05-12 16:52:32 +00:00
Chris Lattner
153587e555 Oops, don't do this after we figure out where to insert the call chains.
llvm-svn: 21890
2005-05-12 07:00:44 +00:00
Chris Lattner
8a5ad8468a Make sure to expand all nodes, avoiding unintentional node duplication.
llvm-svn: 21889
2005-05-12 06:54:21 +00:00
Chris Lattner
d2fb9ea262 handle a common case generated by the uint64 -> FP code path better
llvm-svn: 21888
2005-05-12 06:27:02 +00:00
Chris Lattner
f09c0b435b add fixme
llvm-svn: 21887
2005-05-12 06:04:14 +00:00
Chris Lattner
646c0f0234 Fix a really horrible problem that causes the JIT to miscompile any program
that use 64-bit integers on 32-bit hosts.

llvm-svn: 21886
2005-05-12 06:01:28 +00:00
Chris Lattner
a5bf1030bf Fix a problem where early legalization can cause token chain problems.
llvm-svn: 21885
2005-05-12 04:49:08 +00:00
Chris Lattner
f80969f29b These targets don't like setcc
llvm-svn: 21884
2005-05-12 02:06:00 +00:00
Chris Lattner
515f53d4fa Add a little hook
llvm-svn: 21883
2005-05-12 02:02:21 +00:00
Chris Lattner
8005e91432 Make legalize a bit more efficient, and canonicalize sub X, C -> add X, -C
llvm-svn: 21882
2005-05-12 00:17:04 +00:00
Nate Begeman
4ce1dea8af Add testcase for legalizing ISD::CTTZ efficiently. On PPC, ctlz(int) is
now codegen'd as this:

        addi r2, r3, -1
        andc r2, r2, r3
        cntlzw r2, r2
        subfic r3, r2, 32
        blr

llvm-svn: 21881
2005-05-11 23:45:54 +00:00
Nate Begeman
99fa5bc1fa Necessary changes to codegen cttz efficiently on PowerPC
1. Teach LegalizeDAG how to better legalize CTTZ if the target doesn't have
   CTPOP, but does have CTLZ
2. Teach PPC32 how to do sub x, const -> add x, -const for valid consts
3. Teach PPC32 how to do and (xor a, -1) b -> andc b, a
4. Teach PPC32 that ISD::CTLZ -> PPC::CNTLZW

llvm-svn: 21880
2005-05-11 23:43:56 +00:00
John Criswell
e5121fad61 Regression test for PR#563.
llvm-svn: 21879
2005-05-11 21:47:35 +00:00
Tanya Lattner
96726a46c7 Fixed issue that broke ssa.
llvm-svn: 21878
2005-05-11 21:45:03 +00:00
Chris Lattner
9c64b0cc18 fix some GCC 4 warnings
llvm-svn: 21877
2005-05-11 21:40:40 +00:00
John Criswell
72002e87cc Added support for decomposing constant expressions containing shr and shl
instructions.
Review of this commit would be greatly appreciated.

llvm-svn: 21876
2005-05-11 21:16:42 +00:00
Chris Lattner
991ce36798 Fix lowering of ctlz, so now UnitTests/2005-05-11-Popcount-ffs-fls passes
with the CBE

llvm-svn: 21875
2005-05-11 20:24:12 +00:00
Chris Lattner
fe5759b022 Fix lowering of cttz to work with signed values
llvm-svn: 21874
2005-05-11 20:02:14 +00:00
Chris Lattner
9ec975a4b5 fix and concisify intinsic lowering for ctpop. Unfortunately, this code
looks completely untested. :(

llvm-svn: 21873
2005-05-11 19:42:05 +00:00
Chris Lattner
06bbeb646f Fix the last remaining bug preventing us from switching the X86 BE over
from the simple isel to the pattern isel.  This forces inserted libcalls
to serialize against other function calls, which was breaking
UnitTests/2005-05-12-Int64ToFP.  Hopefully this will fix issues on other
targets as well.

llvm-svn: 21872
2005-05-11 19:02:11 +00:00
Chris Lattner
724f7eec77 Do not memoize ADJCALLSTACKDOWN nodes, provide a method to hack on them.
llvm-svn: 21871
2005-05-11 18:57:39 +00:00
Chris Lattner
490769c5b6 wrap long line
llvm-svn: 21870
2005-05-11 18:57:06 +00:00
Chris Lattner
7933dcdb6e new method
llvm-svn: 21869
2005-05-11 18:56:45 +00:00
Chris Lattner
56add05671 Make sure to legalize generated ctpop nodes, convert tabs to spaces
llvm-svn: 21868
2005-05-11 18:35:21 +00:00
Andrew Lenharth
0409e1e6d5 Legalize for CTLZ generates a ctpop, but this ctpop is not expanded.
This is bad.  It is generated if you are ctlz a type that is not
legal for the arch (aka ctlz of bytes on alpha legalize fine).

llvm-svn: 21867
2005-05-11 17:23:41 +00:00
Duraid Madina
a1ebbac9c0 expand count-leading/trailing-zeros; the test 2005-05-11-Popcount-ffs-fls.c
should now pass (the "LLVM" and "REF" results should be identical)

llvm-svn: 21866
2005-05-11 08:45:08 +00:00
Chris Lattner
446b611401 include the other bit count intrinsics
llvm-svn: 21863
2005-05-11 05:31:01 +00:00
Chris Lattner
7247324047 Add some notes for expanding clz/ctz
llvm-svn: 21862
2005-05-11 05:27:09 +00:00
Chris Lattner
05309bf58e Simplify this code, use the proper shift amount
llvm-svn: 21861
2005-05-11 05:21:31 +00:00
Duraid Madina
25163d8d60 add the popcount instruction and support this in the isel
the primary user of this will probably end up being find-first-set-bit/find-
last-set-bit, which i'll get around to...

llvm-svn: 21860
2005-05-11 05:16:09 +00:00
Chris Lattner
3740f39883 Legalize this correctly
llvm-svn: 21859
2005-05-11 05:09:47 +00:00
Chris Lattner
669c3b17eb No really IA*64* :)
llvm-svn: 21858
2005-05-11 05:03:56 +00:00
Chris Lattner
05ad4b8369 X86 has more than just 32-bit registers
llvm-svn: 21857
2005-05-11 05:00:34 +00:00
Chris Lattner
55e9cde37c implement expansion of ctpop nodes, implementing CodeGen/Generic/llvm-ct-intrinsics.ll
llvm-svn: 21856
2005-05-11 04:51:16 +00:00
Chris Lattner
93f4f5f467 Print bit count nodes correctly
llvm-svn: 21855
2005-05-11 04:50:30 +00:00
Chris Lattner
d08a2de07d new testcase
llvm-svn: 21854
2005-05-11 04:22:47 +00:00
Chris Lattner
0a338a6ba9 update this to reflect the new selection daggy world
llvm-svn: 21853
2005-05-11 03:53:53 +00:00
Chris Lattner
90391c1899 don't duplicate information, particularly when it's out of date!
llvm-svn: 21852
2005-05-11 03:35:57 +00:00
Chris Lattner
c18e92f3cd Do not use "" as a sentinal for a missing argument! This fixes PR560.
llvm-svn: 21850
2005-05-10 23:20:17 +00:00
Chris Lattner
afcc1a854b new testcase for PR562
llvm-svn: 21849
2005-05-10 22:32:29 +00:00
Misha Brukman
c3967716a8 Remove vim modeline; this should go into ~/.vimrc
llvm-svn: 21848
2005-05-10 22:06:41 +00:00
Misha Brukman
689f247ef4 Remove vim modeline, this belongs in ~/.vimrc
llvm-svn: 21847
2005-05-10 22:06:14 +00:00
Misha Brukman
3f2fa8de02 Consistently surround `cl::' code structures with <b> and <tt> to make them
stand out as code

llvm-svn: 21846
2005-05-10 22:05:27 +00:00
Misha Brukman
308a715acc Why output multiple strings, let the compiler concatenate them for us for free
llvm-svn: 21845
2005-05-10 22:03:50 +00:00
Misha Brukman
8b47707b5c * Convert tabs to spaces, fix code alignment
* Remove trailing whitespace
* Wrap long lines

llvm-svn: 21844
2005-05-10 22:02:28 +00:00
Duraid Madina
332b16aaeb note HP-UX support
llvm-svn: 21841
2005-05-10 06:57:53 +00:00
Chris Lattner
d8145bcd5b Convert feature of the simple isel over for the pattern isel to use.
llvm-svn: 21840
2005-05-10 03:53:18 +00:00
Chris Lattner
31c667e234 Fix Reassociate/shifttest.ll
llvm-svn: 21839
2005-05-10 03:39:25 +00:00
Jeff Cohen
915594d884 Silence some VC++ warnings
llvm-svn: 21838
2005-05-10 02:22:38 +00:00
Chris Lattner
abb36674a8 new testcase
llvm-svn: 21837
2005-05-10 00:33:36 +00:00
Chris Lattner
bfc796f622 If a function contains no allocas, all of the calls in it are trivially
suitable for tail calls.

llvm-svn: 21836
2005-05-09 23:51:13 +00:00
Chris Lattner
2d8b55c476 The semantics of cast X to bool are a comparison against zero, not a truncation!
llvm-svn: 21833
2005-05-09 22:17:13 +00:00
Chris Lattner
763a9e8c9b testcase I've had in my tree
llvm-svn: 21832
2005-05-09 21:21:10 +00:00
Chris Lattner
70ea07cfd2 Implement READPORT/WRITEPORT, implementing the last X86 regression tests
that were failing with the pattern selector.  Note that the support that
existed in the simple selector was clearly broken in several ways though
(which has also been fixed).

llvm-svn: 21831
2005-05-09 21:17:38 +00:00
Chris Lattner
e53158e21d do not emit illegal instructions
llvm-svn: 21830
2005-05-09 21:06:04 +00:00
Chris Lattner
46b5ca4310 Fix the syntax of the i/o instructions, these are obviously unused.
llvm-svn: 21829
2005-05-09 20:49:20 +00:00
Chris Lattner
6c6a39a7b8 legalize readio/writeio into load/stores, fixing CodeGen/X86/io.llx with
the pattern isel.

llvm-svn: 21828
2005-05-09 20:37:29 +00:00
Chris Lattner
ba45e6c432 legalize readio/writeio into a load/store if requested
llvm-svn: 21827
2005-05-09 20:36:57 +00:00
Chris Lattner
5385db5523 legalize READPORT, WRITEPORT, READIO, WRITEIO, at least in the basic cases
where they are directly supported by the architecture.  Wrap a bunch of
long lines :(

llvm-svn: 21826
2005-05-09 20:23:03 +00:00
Chris Lattner
20eaeae966 Add support for matching the READPORT, WRITEPORT, READIO, WRITEIO intrinsics
llvm-svn: 21825
2005-05-09 20:22:36 +00:00
Chris Lattner
67ab94510d Add support for READPORT, WRITEPORT, READIO, WRITEIO
llvm-svn: 21824
2005-05-09 20:22:17 +00:00
Chris Lattner
61171e59b2 Add READPORT, WRITEPORT, READIO, WRITEIO nodes, wrap long lines
llvm-svn: 21823
2005-05-09 20:21:27 +00:00
John Criswell
b3235830b6 Tell tblgen exactly where to find the include file.
llvm-svn: 21822
2005-05-09 19:32:08 +00:00
Chris Lattner
4ccd1f603c restore some non-dead code I removed last night breaking double casts to
uint

llvm-svn: 21821
2005-05-09 18:37:02 +00:00
Chris Lattner
129c5fea44 fold and (shl X, C1), C2 -> rlwinm when possible. Many other cases are possible,
include and (srl)    and the inverses (shl and) etc.

llvm-svn: 21820
2005-05-09 17:39:48 +00:00
Chris Lattner
0d9a700b39 new testcase
llvm-svn: 21819
2005-05-09 17:09:31 +00:00
Chris Lattner
1ab1691da9 Fold shifts into subsequent SHL's. These shifts often arise due to addrses
arithmetic lowering.

llvm-svn: 21818
2005-05-09 17:06:45 +00:00
John Criswell
05990f3302 Updated the list of code generators for LLVM 1.5.
Added information on getting LLVM 1.5 from CVS (hopefully readers will
understand that the label will work *after* LLVM 1.5 is released).

llvm-svn: 21817
2005-05-09 16:49:59 +00:00
John Criswell
cfdeb5cf72 Little corrections.
llvm-svn: 21816
2005-05-09 16:39:27 +00:00
Chris Lattner
7bd6ddb6f7 Fix bug noticed by Tzu-Chien Chiu, thanks!
llvm-svn: 21815
2005-05-09 15:41:03 +00:00
Duraid Madina
74a01fa211 fix and cleanup constmul code a bit, this fixes mediabench/toast and
probably a couple of other tests.

llvm-svn: 21814
2005-05-09 13:18:34 +00:00
Chris Lattner
a7fc3d9119 tweak test to accept the (good) code emitted by the pattern isel
llvm-svn: 21812
2005-05-09 05:54:27 +00:00
Chris Lattner
daa064d8fd Wrap long lines, remove dead code that is now handled by legalize
llvm-svn: 21811
2005-05-09 05:40:26 +00:00
Chris Lattner
e62661185c Fix FP -> bool casts
llvm-svn: 21810
2005-05-09 05:33:18 +00:00
Chris Lattner
b62f5082c5 implement and.ll:test33
llvm-svn: 21809
2005-05-09 04:58:36 +00:00
Chris Lattner
19519b3792 New testcase
llvm-svn: 21808
2005-05-09 04:54:18 +00:00
Reid Spencer
3992dbd2a0 Add note to self to complete the testing of all intrinsic functions as
specified in the LangRef document.

llvm-svn: 21807
2005-05-09 04:47:32 +00:00
Chris Lattner
57d294f2ac Don't use the load/store instruction as the source pointer, use the pointer
being stored/loaded through!

llvm-svn: 21806
2005-05-09 04:28:51 +00:00
Chris Lattner
c14f354895 memoize all nodes, even null Value* nodes. Do not add two token chain outputs
llvm-svn: 21805
2005-05-09 04:14:13 +00:00
Chris Lattner
f5675a0813 wrap long lines
llvm-svn: 21804
2005-05-09 04:08:33 +00:00
Chris Lattner
9440d6e260 Print SrcValue nodes correctly
llvm-svn: 21803
2005-05-09 04:08:27 +00:00
Chris Lattner
6972c31ab5 Fix X86/2005-05-08-FPStackifierPHI.ll: ugly gross hack.
llvm-svn: 21801
2005-05-09 03:36:39 +00:00
Chris Lattner
85013ae74a New testcase that crashes the pattern isel
llvm-svn: 21800
2005-05-09 03:36:11 +00:00
Chris Lattner
e251b5ca89 Preserve CC's when linking modules
llvm-svn: 21799
2005-05-09 01:09:39 +00:00
Chris Lattner
d0525a29d1 Preserve calling conventions when doing IPO
llvm-svn: 21798
2005-05-09 01:05:50 +00:00
Chris Lattner
21d1dde72a wrap long lines, preserve calling conventions when cloning functions and
turning calls into invokes

llvm-svn: 21797
2005-05-09 01:04:34 +00:00
Chris Lattner
bb0bfc4702 By definition, 'tail' calls cannot access the stack frame of their caller.
Expose this as a simple form of mod/ref information.  This implements
BasicAA/tailcall-modref.ll

llvm-svn: 21796
2005-05-08 23:58:12 +00:00
Chris Lattner
af008dcdd1 New testacse for information exposed by the 'tail' call marker.
llvm-svn: 21795
2005-05-08 23:57:34 +00:00
Chris Lattner
2ad5aa8334 Verify that varargs functions all have ccc
llvm-svn: 21792
2005-05-08 22:27:09 +00:00
Chris Lattner
a4c8022caf Convert non-address taken functions with C calling conventions to fastcc.
llvm-svn: 21791
2005-05-08 22:18:06 +00:00
Chris Lattner
257008beff If loopextract breaks the program provide output so that we can repro the
problem.

llvm-svn: 21790
2005-05-08 21:54:56 +00:00
Chris Lattner
2cbd1337ce add a testcase for a case we do not handle yet
llvm-svn: 21789
2005-05-08 21:47:42 +00:00
Chris Lattner
df3332660f Implement Reassociate/mul-neg-add.ll
llvm-svn: 21788
2005-05-08 21:41:35 +00:00
Chris Lattner
ce7d145b20 new testcase
llvm-svn: 21787
2005-05-08 21:41:18 +00:00
Chris Lattner
c4f8e2b0ed Bail out earlier
llvm-svn: 21786
2005-05-08 21:33:47 +00:00
Chris Lattner
877b114037 Teach reassociate that 0-X === X*-1
llvm-svn: 21785
2005-05-08 21:28:52 +00:00
Chris Lattner
90723bacb9 new testcase
llvm-svn: 21784
2005-05-08 21:28:33 +00:00
Chris Lattner
9f284e0a3c Fix PR557 and basictest[34].ll.
This makes reassociate realize that loads should be treated as unmovable, and
gives distinct ranks to distinct values defined in the same basic block, allowing
reassociate to do its thing.

llvm-svn: 21783
2005-05-08 20:57:04 +00:00
Chris Lattner
f9a33ede62 new testcases for PR557
llvm-svn: 21782
2005-05-08 20:56:02 +00:00
Chris Lattner
9187f3905e Add debugging information
llvm-svn: 21781
2005-05-08 20:09:57 +00:00
Chris Lattner
08582be283 eliminate gotos
llvm-svn: 21780
2005-05-08 19:48:43 +00:00
Chris Lattner
9acd314ba3 Wrap long lines. Fix "warning: conflicting types for built-in function 'memset'"
warning from the CBE+GCC.

llvm-svn: 21779
2005-05-08 19:46:29 +00:00
Chris Lattner
5847e5e10c Improve reassociation handling of inverses, implementing inverses.ll.
llvm-svn: 21778
2005-05-08 18:59:37 +00:00
Chris Lattner
2f1b13255d new testcase
llvm-svn: 21777
2005-05-08 18:54:40 +00:00
Chris Lattner
4922118dc4 clean up and modernize this pass.
llvm-svn: 21776
2005-05-08 18:45:26 +00:00
Chris Lattner
b18dbbfff5 Strength reduce SAR into SHR if there is no way sign bits could be shifted
in.  This tends to get cases like this:

  X = cast ubyte to int
  Y = shr int X, ...

Tested by: shift.ll:test24

llvm-svn: 21775
2005-05-08 17:34:56 +00:00
Chris Lattner
5140c15f08 new testcase
llvm-svn: 21774
2005-05-08 17:31:24 +00:00
Jeff Cohen
b127267a5a Update my info
llvm-svn: 21773
2005-05-08 01:07:48 +00:00
Chris Lattner
e1850b86b6 Refactor some code
llvm-svn: 21772
2005-05-08 00:19:31 +00:00
Chris Lattner
6e2086d7e4 Handle some simple cases where we can see that values get annihilated.
llvm-svn: 21771
2005-05-08 00:08:33 +00:00
Chris Lattner
4294cec0f1 Fix a miscompilation of crafty by clobbering the "A" variable.
llvm-svn: 21770
2005-05-07 23:49:08 +00:00
Chris Lattner
041f8b59c1 Move licm after reassociate, add some cond-propagate passes
llvm-svn: 21769
2005-05-07 22:45:35 +00:00
Chris Lattner
1e5065052a Rewrite the guts of the reassociate pass to be more efficient and logical. Instead
of trying to do local reassociation tweaks at each level, only process an expression
tree once (at its root).  This does not improve the reassociation pass in any real way.

llvm-svn: 21768
2005-05-07 21:59:39 +00:00
Reid Spencer
f2ff439c4b * Break tests into individual cases so its easier to see what's going on.
* Add four new cases to handle the new optimizations for strlen, dealing
  with:
    strlen(x) != 0 -> *x != 0
    strlen(x) == 0 -> *x == 0
  for each of two cases: strlen(x) != 0 and strlen(x) == 0

llvm-svn: 21767
2005-05-07 20:21:04 +00:00
Reid Spencer
170ae7ff70 * Add two strlen optimizations:
strlen(x) != 0 -> *x != 0
    strlen(x) == 0 -> *x == 0
* Change nested statistics to use style of other LLVM statistics so that
  only the name of the optimization (simplify-libcalls) is used as the
  statistic name, and the description indicates which specific all is
  optimized. Cuts down on some redundancy and saves a few bytes of space.
* Make note of stpcpy optimization that could be done.

llvm-svn: 21766
2005-05-07 20:15:59 +00:00
Reid Spencer
4f01a822b4 Don't increment the counter unless the debug flag is set.
llvm-svn: 21762
2005-05-07 04:59:45 +00:00
Chris Lattner
cea579932d Convert shifts to muls to assist reassociation. This implements
Reassociate/shifttest.ll

llvm-svn: 21761
2005-05-07 04:24:13 +00:00
Chris Lattner
30555b0d14 test that reassociate can handle shifts
llvm-svn: 21760
2005-05-07 04:23:29 +00:00
Chris Lattner
f43e974abd Simplify the code and rearrange it. No major functionality changes here.
llvm-svn: 21759
2005-05-07 04:08:02 +00:00
Jeff Cohen
6dc6672840 Silence VC++ warnings about unsafe mixing of ints and bools with the | operator.
llvm-svn: 21758
2005-05-07 02:44:04 +00:00
Chris Lattner
b34b273386 add note about bit builtins newly supported
llvm-svn: 21757
2005-05-07 02:21:21 +00:00
Chris Lattner
6ea3be51f8 new testcase
llvm-svn: 21756
2005-05-07 02:16:08 +00:00
Chris Lattner
573f64ecb5 fix bugs in my previous commit clarify the return type of the bit ops
llvm-svn: 21755
2005-05-07 01:46:40 +00:00
Chris Lattner
c792eb342c add a couple of notes
llvm-svn: 21754
2005-05-06 23:08:23 +00:00
Chris Lattner
0132affa89 document calling convention extensions
llvm-svn: 21753
2005-05-06 22:57:40 +00:00
Chris Lattner
9bbe58628b remove some dead (always dynamically false) flags
llvm-svn: 21752
2005-05-06 22:35:09 +00:00
Chris Lattner
129535c787 encode calling conventions for call/invoke instructions.
llvm-svn: 21751
2005-05-06 22:34:01 +00:00
Chris Lattner
f71853e277 new testcase
llvm-svn: 21750
2005-05-06 22:33:44 +00:00
Chris Lattner
f2e1c1969f encode function calling convs in the bytecode file. invoke and call are
still to come.

llvm-svn: 21749
2005-05-06 20:42:57 +00:00
Chris Lattner
53bdd31211 parse new calling conv specifiers
llvm-svn: 21748
2005-05-06 20:27:19 +00:00
Chris Lattner
b25b6304b7 wrap a longline
llvm-svn: 21747
2005-05-06 20:27:03 +00:00
Chris Lattner
f7b6d3191b add support for explicit calling conventions
llvm-svn: 21746
2005-05-06 20:26:43 +00:00
Chris Lattner
4147522d71 Add support for explicit calling conventions
llvm-svn: 21745
2005-05-06 20:26:26 +00:00
Chris Lattner
e29e1ff1e8 New file
llvm-svn: 21744
2005-05-06 19:59:08 +00:00
Chris Lattner
6d817c5486 use splice instead of remove/insert for a minor speedup
llvm-svn: 21743
2005-05-06 19:58:35 +00:00
Chris Lattner
6409f3490a remove some ugly hacks that are no longer needed since andrew removed the
varargs munging code

llvm-svn: 21742
2005-05-06 19:49:51 +00:00
Chris Lattner
7effa0ed06 BAD typeo which caused many testsuite failures last night. Note to self, do
not change code after testing it without retesting!

llvm-svn: 21741
2005-05-06 17:13:16 +00:00
Chris Lattner
18335f8925 clean up the CBE output a bit
llvm-svn: 21740
2005-05-06 06:58:42 +00:00
Chris Lattner
561b7eb9e1 add tail marker as a comment
llvm-svn: 21739
2005-05-06 06:53:07 +00:00
Chris Lattner
ec7773e9e8 Make the stub functions be tail calls
llvm-svn: 21738
2005-05-06 06:48:54 +00:00
Chris Lattner
6aacb0f9da Preserve tail marker
llvm-svn: 21737
2005-05-06 06:48:21 +00:00
Chris Lattner
9f3dced2c7 Implement Transforms/Inline/inline-tail.ll
llvm-svn: 21736
2005-05-06 06:47:52 +00:00
Chris Lattner
318e328fc4 Make sure to not accidentally get a bogus tail marker
llvm-svn: 21735
2005-05-06 06:47:37 +00:00
Chris Lattner
324d2eedb2 preserve the tail marker
llvm-svn: 21734
2005-05-06 06:46:58 +00:00
Chris Lattner
2db10ece5c add a default arg
llvm-svn: 21733
2005-05-06 06:22:10 +00:00
Chris Lattner
5879f9c24d Don't forget these are calls
llvm-svn: 21730
2005-05-06 06:21:59 +00:00
Chris Lattner
ca4d4bd2db lex tail
llvm-svn: 21729
2005-05-06 06:20:33 +00:00
Chris Lattner
2c9a46e758 test that tail call survives bytecodification
llvm-svn: 21728
2005-05-06 06:18:33 +00:00
Chris Lattner
fb6f1746f4 add bytecode reader support for tail calls
llvm-svn: 21727
2005-05-06 06:13:34 +00:00
Chris Lattner
abb5bd78ca Hilight tail
llvm-svn: 21726
2005-05-06 06:07:34 +00:00
Chris Lattner
eaf625dc5c These are legal for tail calls
llvm-svn: 21723
2005-05-06 05:59:50 +00:00
Chris Lattner
0603845a49 Add a 'tail' marker for call instructions, patch contributed by
Alexander Friedman.

llvm-svn: 21722
2005-05-06 05:51:46 +00:00
Chris Lattner
e23c139836 Add info on new 'tail' marker
llvm-svn: 21721
2005-05-06 05:47:36 +00:00
Chris Lattner
53db546b97 Wrap long lines
llvm-svn: 21720
2005-05-06 05:34:40 +00:00
Chris Lattner
a36d525741 DCE intrinsic instructions without side effects.
llvm-svn: 21719
2005-05-06 05:27:34 +00:00
Chris Lattner
b2d3ac8349 These intrinsics do not access memory
llvm-svn: 21718
2005-05-06 05:21:04 +00:00
Chris Lattner
ef298a3b8a Teach instcombine propagate zeroness through shl instructions, implementing
and.ll:test31

llvm-svn: 21717
2005-05-06 04:53:20 +00:00
Chris Lattner
8d83be2bf0 new testcases
llvm-svn: 21716
2005-05-06 04:52:46 +00:00
Chris Lattner
873804168e Implement shift.ll:test23. If we are shifting right then immediately truncating
the result, turn signed shift rights into unsigned shift rights if possible.

This leads to later simplification and happens *often* in 176.gcc.  For example,
this testcase:

struct xxx { unsigned int code : 8; };
enum codes { A, B, C, D, E, F };
int foo(struct xxx *P) {
  if ((enum codes)P->code == A)
     bar();
}

used to be compiled to:

int %foo(%struct.xxx* %P) {
        %tmp.1 = getelementptr %struct.xxx* %P, int 0, uint 0           ; <uint*> [#uses=1]
        %tmp.2 = load uint* %tmp.1              ; <uint> [#uses=1]
        %tmp.3 = cast uint %tmp.2 to int                ; <int> [#uses=1]
        %tmp.4 = shl int %tmp.3, ubyte 24               ; <int> [#uses=1]
        %tmp.5 = shr int %tmp.4, ubyte 24               ; <int> [#uses=1]
        %tmp.6 = cast int %tmp.5 to sbyte               ; <sbyte> [#uses=1]
        %tmp.8 = seteq sbyte %tmp.6, 0          ; <bool> [#uses=1]
        br bool %tmp.8, label %then, label %UnifiedReturnBlock

Now it is compiled to:

        %tmp.1 = getelementptr %struct.xxx* %P, int 0, uint 0           ; <uint*> [#uses=1]
        %tmp.2 = load uint* %tmp.1              ; <uint> [#uses=1]
        %tmp.2 = cast uint %tmp.2 to sbyte              ; <sbyte> [#uses=1]
        %tmp.8 = seteq sbyte %tmp.2, 0          ; <bool> [#uses=1]
        br bool %tmp.8, label %then, label %UnifiedReturnBlock

which is the difference between this:

foo:
        subl $4, %esp
        movl 8(%esp), %eax
        movl (%eax), %eax
        shll $24, %eax
        sarl $24, %eax
        testb %al, %al
        jne .LBBfoo_2

and this:

foo:
        subl $4, %esp
        movl 8(%esp), %eax
        movl (%eax), %eax
        testb %al, %al
        jne .LBBfoo_2

This occurs 3243 times total in the External tests, 215x in povray,
6x in each f2c'd program, 1451x in 176.gcc, 7x in crafty, 20x in perl,
25x in gap, 3x in m88ksim, 25x in ijpeg.

Maybe this will cause a little jump on gcc tommorow :)

llvm-svn: 21715
2005-05-06 04:18:52 +00:00
Chris Lattner
1524489f22 new testcase
llvm-svn: 21714
2005-05-06 04:11:32 +00:00
Chris Lattner
7208616ec0 Implement xor.ll:test22
llvm-svn: 21713
2005-05-06 02:07:39 +00:00
Chris Lattner
4c2d3781aa implement and.ll:test30 and set.ll:test21
llvm-svn: 21712
2005-05-06 01:53:19 +00:00
Chris Lattner
8169e16268 new testcase for unneeded and
llvm-svn: 21711
2005-05-06 01:52:52 +00:00
Chris Lattner
838dae0991 new testcase
llvm-svn: 21710
2005-05-06 01:51:05 +00:00
Chris Lattner
dd1e562ec3 implement or.ll:test20
llvm-svn: 21709
2005-05-06 00:58:50 +00:00
Chris Lattner
ce8dd82d66 new testcase
llvm-svn: 21708
2005-05-06 00:58:09 +00:00
Misha Brukman
584ed83d4a * Order #includes alphabetically
* Remove commented-out debug printouts

llvm-svn: 21707
2005-05-05 23:45:17 +00:00
Misha Brukman
c0aac8e858 Remove extra blank line
llvm-svn: 21706
2005-05-05 23:43:47 +00:00
Misha Brukman
3f670d29dc * Use consistent spacing for function arguments
* Output single-character strings as chars

llvm-svn: 21705
2005-05-05 22:38:21 +00:00
Misha Brukman
291f6b7223 Remove vim settings from source code; people should use llvm/utils/vim/vimrc
llvm-svn: 21704
2005-05-05 22:33:09 +00:00
Misha Brukman
08d66b4e10 Convert tabs to spaces
llvm-svn: 21703
2005-05-05 22:30:40 +00:00
Chris Lattner
4a454c80db new testcase for PR541
llvm-svn: 21702
2005-05-05 22:23:10 +00:00
Chris Lattner
1243e1c9f1 add support for undef values of opaque type, addressing PR541
llvm-svn: 21701
2005-05-05 22:21:19 +00:00
Chris Lattner
7ddaeb448b Add some extra checks. Opaque types don't have a null marker.
llvm-svn: 21700
2005-05-05 20:57:00 +00:00
Chris Lattner
2cc59a8066 new testcase
llvm-svn: 21699
2005-05-05 17:57:24 +00:00
Chris Lattner
7876156ba0 When hitting an unsupported intrinsic, actually print it
Lower debug info to noops.

llvm-svn: 21698
2005-05-05 17:55:17 +00:00
Andrew Lenharth
2dbbb3ab84 ctpop lowering in legalize
llvm-svn: 21697
2005-05-05 15:55:21 +00:00
Chris Lattner
807aa20f67 Fix a bug compimling Ruby, fixing this testcase:
LowerSetJmp/2005-05-05-OldUses.ll

llvm-svn: 21696
2005-05-05 15:47:43 +00:00
Chris Lattner
fa58898845 new testcase for a bug Jim found
llvm-svn: 21695
2005-05-05 15:47:16 +00:00
Andrew Lenharth
b8e94c3499 fix typo
llvm-svn: 21693
2005-05-04 19:25:37 +00:00
Andrew Lenharth
aed06a0e92 Well, add support for ct* for 21264 only.
21164 is broken until expand works.

llvm-svn: 21692
2005-05-04 19:12:09 +00:00
Andrew Lenharth
dd426dd04d Make promoteOp work for CT*
Proof?

ubyte %bar(ubyte %x) {
entry:
        %tmp.1 = call ubyte %llvm.ctlz( ubyte %x )
        ret ubyte %tmp.1
}

==>

zapnot $16,1,$0
CTLZ $0,$0
subq $0,56,$0
zapnot $0,1,$0
ret $31,($26),1

llvm-svn: 21691
2005-05-04 19:11:05 +00:00
Chris Lattner
809dfac421 Instcombine: cast (X != 0) to int, cast (X == 1) to int -> X iff X has only the low bit set.
This implements set.ll:test20.

This triggers 2x on povray, 9x on mesa, 11x on gcc, 2x on crafty, 1x on eon,
6x on perlbmk and 11x on m88ksim.

It allows us to compile these two functions into the same code:

struct s { unsigned int bit : 1; };
unsigned foo(struct s *p) {
  if (p->bit)
    return 1;
  else
    return 0;
}
unsigned bar(struct s *p) { return p->bit; }

llvm-svn: 21690
2005-05-04 19:10:26 +00:00
Chris Lattner
3538a4f6cc new testcase
llvm-svn: 21689
2005-05-04 19:05:02 +00:00
Reid Spencer
282d057485 Implement the IsDigitOptimization for simplifying calls to the isdigit
library function:
  isdigit(chr) -> 0 or 1 if chr is constant
  isdigit(chr) -> chr - '0' <= 9 otherwise

Although there are many calls to isdigit in llvm-test, most of them are
compiled away by macros leaving only this:

2 MultiSource/Applications/hexxagon

llvm-svn: 21688
2005-05-04 18:58:28 +00:00
Reid Spencer
f9a4a9681d Make sure both optimization cases get tested.
llvm-svn: 21687
2005-05-04 17:45:10 +00:00
Reid Spencer
190bb26157 Add a test case for the IsDigitOptimization class.
llvm-svn: 21686
2005-05-04 17:34:55 +00:00
Andrew Lenharth
702859084b comment fix
llvm-svn: 21685
2005-05-04 15:56:34 +00:00
Andrew Lenharth
dd9d3ac72b see if the legalize code propery compensates for the additional zeros introduced
llvm-svn: 21684
2005-05-04 15:51:07 +00:00
Reid Spencer
e84ee1bcd0 Correct the descriptions of WHILE...END and RROT. Thanks to Lalo Martins
for pointing out these errors.

llvm-svn: 21683
2005-05-04 15:43:40 +00:00
Reid Spencer
7063d1aa71 WHILE does not "pop" a value, it "examines" to top of stack. Make this
clear in the applicable comment.

llvm-svn: 21682
2005-05-04 15:33:48 +00:00
Andrew Lenharth
6b551024ac added a use of ctpop to debug stuff with
llvm-svn: 21681
2005-05-04 15:20:16 +00:00
Andrew Lenharth
5be6f131e6 fixup argument
llvm-svn: 21680
2005-05-04 14:58:31 +00:00
Reid Spencer
1e520fd661 * Correct the function prototypes for some of the functions to match the
actual spec (int -> uint)
* Add the ability to get/cache the strlen function prototype.
* Make sure generated values are appropriately named for debugging purposes
* Add the SPrintFOptimiation for 4 casts of sprintf optimization:
    sprintf(str,cstr) -> llvm.memcpy(str,cstr) (if cstr has no %)
    sprintf(str,"")   -> store sbyte 0, str
    sprintf(str,"%s",src) -> llvm.memcpy(str,src) (if src is constant)
    sprintf(str,"%c",chr) -> store chr, str   ; store sbyte 0, str+1

The sprintf optimization didn't fire as much as I had hoped:

  2 MultiSource/Applications/SPASS
  5 MultiSource/Benchmarks/McCat/18-imp
 22 MultiSource/Benchmarks/Prolangs-C/TimberWolfMC
  1 MultiSource/Benchmarks/Prolangs-C/assembler
  6 MultiSource/Benchmarks/Prolangs-C/unix-smail
  2 MultiSource/Benchmarks/mediabench/mpeg2/mpeg2dec

llvm-svn: 21679
2005-05-04 03:20:21 +00:00
Misha Brukman
23e9f163ad Minor clean-ups
llvm-svn: 21678
2005-05-03 20:30:34 +00:00
Andrew Lenharth
1d463526b4 initial descriptions of count intrinsics
llvm-svn: 21677
2005-05-03 18:01:48 +00:00
Andrew Lenharth
5e177826fd Implement count leading zeros (ctlz), count trailing zeros (cttz), and count
population (ctpop).  Generic lowering is implemented, however only promotion
is implemented for SelectionDAG at the moment.

More coming soon.

llvm-svn: 21676
2005-05-03 17:19:30 +00:00
Reid Spencer
f436286cf6 Fix this test to succeed even if "strchr" is on a call instruction.
llvm-svn: 21675
2005-05-03 17:09:38 +00:00
Reid Spencer
a6bbd18023 Add a test case for SPrintFOptimization.
llvm-svn: 21674
2005-05-03 17:08:45 +00:00
Andrew Lenharth
38cc7bacb4 yea yea yea
llvm-svn: 21673
2005-05-03 17:00:48 +00:00
Andrew Lenharth
2e18c628c4 note the vararg change, and other stuff
llvm-svn: 21672
2005-05-03 16:59:09 +00:00
Andrew Lenharth
bf50ff58ae pre add count tests
llvm-svn: 21671
2005-05-03 16:49:48 +00:00
Chris Lattner
c22333348e fix a bug in the 1 index GEP handling code
llvm-svn: 21670
2005-05-03 16:44:45 +00:00
Reid Spencer
38cabd7265 Implement optimizations for the strchr and llvm.memset library calls.
Neither of these activated as many times as was hoped:

strchr:
9 MultiSource/Applications/siod
1 MultiSource/Applications/d
2 MultiSource/Prolangs-C/archie-client
1 External/SPEC/CINT2000/176.gcc/176.gcc

llvm.memset:
no hits

llvm-svn: 21669
2005-05-03 07:23:44 +00:00
Reid Spencer
a064a84067 Add a test case for StrChrOptimizer for -simplify-libcalls
llvm-svn: 21668
2005-05-03 06:22:41 +00:00
Misha Brukman
d317d937b2 Clean up and correct llvmc configurations for C and C++
llvm-svn: 21667
2005-05-03 06:13:18 +00:00
Misha Brukman
18aa1d6438 std::string(NULL) does not a proper constructor make
llvm-svn: 21666
2005-05-03 06:10:51 +00:00
Chris Lattner
8298120f17 add direct support for making GEP instrs with one index
llvm-svn: 21665
2005-05-03 05:43:30 +00:00
Misha Brukman
cc42755633 Omit periods at the end of command-line switch explanations for consistency
llvm-svn: 21664
2005-05-03 05:36:14 +00:00
Reid Spencer
d18dbcbf4c A new test case for the LLVMMemSetOptimization.
llvm-svn: 21663
2005-05-03 04:00:24 +00:00
Jeff Cohen
4e3aedeaa6 Use ANSI-approved way of getting the value infinity (otherwise VC++ won't compile it)
llvm-svn: 21662
2005-05-03 03:13:01 +00:00
Reid Spencer
95d8efdfcf Avoid garbage output in the statistics display by ensuring that the
strings passed to Statistic's constructor are not destructable. The stats
are printed during static destruction and the SimplifyLibCalls module was
getting destructed before the statistics.

llvm-svn: 21661
2005-05-03 02:54:54 +00:00
Reid Spencer
49fa070401 Add the StrNCmpOptimization which is similar to strcmp.
Unfortunately, this optimization didn't trigger on any llvm-test tests.

llvm-svn: 21660
2005-05-03 01:43:45 +00:00
Reid Spencer
8204531db1 Correct the title and the success criteria: strcmp -> strncmp
llvm-svn: 21659
2005-05-03 00:52:19 +00:00
Reid Spencer
0a23afbedb Add a new test case for the StrNCmpOptimization.
llvm-svn: 21658
2005-05-03 00:50:43 +00:00
Reid Spencer
2d5c7beebd Implement the fprintf optimization which converts calls like this:
fprintf(F,"hello") -> fwrite("hello",strlen("hello"),1,F)
  fprintf(F,"%s","hello") -> fwrite("hello",strlen("hello"),1,F)
  fprintf(F,"%c",'x') -> fputc('c',F)

This optimization fires severals times in llvm-test:

313 MultiSource/Applications/Burg
302 MultiSource/Benchmarks/Prolangs-C/TimberWolfMC
189 MultiSource/Benchmarks/Prolangs-C/mybison
175 MultiSource/Benchmarks/Prolangs-C/football
130 MultiSource/Benchmarks/Prolangs-C/unix-tbl

llvm-svn: 21657
2005-05-02 23:59:26 +00:00
Reid Spencer
59605a1b57 Add a test case for testing the FPrintFOptimization.
llvm-svn: 21656
2005-05-02 23:07:14 +00:00
Andrew Lenharth
c73e633a41 fold fp div by 0 to inf, the way gcc does. This is legal according to the FP spec
llvm-svn: 21655
2005-05-02 21:25:47 +00:00
Andrew Lenharth
f5d58d1bc3 Remove support for 1.0 style varargs
amusing of course, because we will have to go back to those semantics soon

llvm-svn: 21654
2005-05-02 19:07:27 +00:00
John Criswell
f42ed7bdaf Fixed a comment.
llvm-svn: 21653
2005-05-02 14:47:42 +00:00
Duraid Madina
7acd5d5f06 support multiplication by constant negative integers
this constmul code is still buggy though, so beware. mul by 7427 is currently
broken, for example. will fix it when I get a moment :)

llvm-svn: 21652
2005-05-02 07:27:14 +00:00
Duraid Madina
0e73188c10 add support for bools to SELECT, this fixes Prolangs-C/bison from the
testsuite, however 09-vor is still dead (hopefully for other reasons!)

llvm-svn: 21651
2005-05-02 06:41:13 +00:00
Reid Spencer
d845d160f6 Mention that arguments to functions must be first class types.
llvm-svn: 21650
2005-05-01 22:22:57 +00:00
Tanya Lattner
846b8b00e2 Add accessor method,
llvm-svn: 21649
2005-05-01 16:22:41 +00:00
Tanya Lattner
c187835632 Adding ModuloSched SB.
llvm-svn: 21648
2005-05-01 16:14:34 +00:00
Chris Lattner
a816eee427 Implement getelementptr.ll:test11
llvm-svn: 21647
2005-05-01 04:42:15 +00:00
Chris Lattner
cdb2465152 new testcase
llvm-svn: 21646
2005-05-01 04:41:57 +00:00
Chris Lattner
a9d84e3388 Check for volatile loads only once.
Implement load.ll:test7

llvm-svn: 21645
2005-05-01 04:24:53 +00:00
Chris Lattner
da96eeb2d5 add a new testcase
llvm-svn: 21644
2005-05-01 04:24:15 +00:00
Tanya Lattner
9d43c75a55 SMS for superblocks.
llvm-svn: 21643
2005-05-01 01:27:47 +00:00
Tanya Lattner
bdfb9e61a0 Added extra constructor for superblocks.
llvm-svn: 21642
2005-05-01 01:25:53 +00:00
Tanya Lattner
4d0ee754e3 Fixed bug in searchPath function for finding nodes between two recurrences.
Changed dependence analyzer to only use dep distances of 2 or less.
This is experimental.

Changed MSchedGraph to be able to represent more then one BB (first steps).

llvm-svn: 21641
2005-04-30 23:07:59 +00:00
Andrew Lenharth
537332eba8 I was sure I had thought about this and there was a reason it should work.
But it is entirely possible I am just crazy.

llvm-svn: 21640
2005-04-30 14:19:13 +00:00
Alkis Evlogimenos
d7e534b2b3 Do not use deprecated APIs
llvm-svn: 21639
2005-04-30 07:13:31 +00:00
Reid Spencer
16449a9eb0 Fix a comment that stated the wrong thing.
llvm-svn: 21638
2005-04-30 06:45:47 +00:00
Chris Lattner
c8a6633dea Eliminate some random whitespace
llvm-svn: 21637
2005-04-30 04:44:07 +00:00
Chris Lattner
8002640eab Codegen and legalize sin/cos/llvm.sqrt as FSIN/FCOS/FSQRT calls. This patch
was contributed by Morten Ofstad, with some minor tweaks and bug fixes added
by me.

llvm-svn: 21636
2005-04-30 04:43:14 +00:00
Chris Lattner
9efa7e7533 add sin/cos tests
llvm-svn: 21635
2005-04-30 04:41:27 +00:00
Chris Lattner
9993823876 Doesn't support these nodes
llvm-svn: 21634
2005-04-30 04:26:56 +00:00
Chris Lattner
9c6bbafc15 This target doesn't support the FSIN/FCOS/FSQRT nodes yet
llvm-svn: 21633
2005-04-30 04:26:06 +00:00
Chris Lattner
db68d39a01 Add support for FSIN/FCOS when unsafe math ops are enabled. Patch contributed by
Morten Ofstad!

llvm-svn: 21632
2005-04-30 04:25:35 +00:00
Chris Lattner
3b20386551 Add support for llvm.sqrt and sin/cos if unsafe math optimizations are enabled.
llvm-svn: 21631
2005-04-30 04:12:40 +00:00
Chris Lattner
4a2cc6603d Expose an option allowing unsafe math optimizations. Patch contributed by
Morten Ofstad!

llvm-svn: 21630
2005-04-30 04:09:52 +00:00
Chris Lattner
30fe4ac2fb Lower llvm.sqrt -> fsqrt/sqrt
llvm-svn: 21629
2005-04-30 04:07:50 +00:00
Chris Lattner
7100fcde6c Add a test for llvm.sqrt
llvm-svn: 21628
2005-04-30 04:07:15 +00:00
Chris Lattner
1c636f1118 Add llvm.sqrt intrinsic, patch contributed by Morten Ofstad
llvm-svn: 21627
2005-04-30 03:44:07 +00:00
Reid Spencer
4c444fe007 * Don't depend on "guessing" what a FILE* is, just require that the actual
type be obtained from a CallInst we're optimizing.
* Make it possible for getConstantStringLength to return the ConstantArray
  that it extracts in case the content is needed by an Optimization.
* Implement the strcmp optimization
* Implement the toascii optimization

This pass is now firing several to many times in the following MultiSource
tests:

Applications/Burg      -   7 (strcat,strcpy)
Applications/siod      -  13 (strcat,strcpy,strlen)
Applications/spiff     - 120 (exit,fputs,strcat,strcpy,strlen)
Applications/treecc    -  66 (exit,fputs,strcat,strcpy)
Applications/kimwitu++ -  34 (strcmp,strcpy,strlen)
Applications/SPASS     - 588 (exit,fputs,strcat,strcpy,strlen)

llvm-svn: 21626
2005-04-30 03:17:54 +00:00
Reid Spencer
29c6b848db * Fix signed/unsigned usage problem
* Rearrange for readability.

llvm-svn: 21625
2005-04-30 03:06:36 +00:00
Reid Spencer
10e99b2667 A new test case for the ToAsciiOptimizer.
llvm-svn: 21624
2005-04-30 01:00:52 +00:00
Reid Spencer
89339ffb22 A new test case for the StrCmpOptimization in -simplify-libcalls.
llvm-svn: 21623
2005-04-30 00:52:04 +00:00
Reid Spencer
1279398b1c This is StrCpy, NOT StrCat!
llvm-svn: 21622
2005-04-29 23:02:15 +00:00
Reid Spencer
cadbe2bbf1 Get the name of the pass right in the documentation.
llvm-svn: 21621
2005-04-29 23:01:21 +00:00
Reid Spencer
a2ddce3119 Fix the success criteria for the test to make call instructions with "pow"
not just any occurrence of "pow".

llvm-svn: 21620
2005-04-29 10:11:23 +00:00
Reid Spencer
9610da2670 Actually make this pass test something related to fputs.
llvm-svn: 21619
2005-04-29 10:10:17 +00:00
Reid Spencer
9361697f93 Implement the optimizations for "pow" and "fputs" library calls.
llvm-svn: 21618
2005-04-29 09:39:47 +00:00
Reid Spencer
fc4cf1d435 Add a test case for the puts libcall optimization.
llvm-svn: 21616
2005-04-29 07:19:00 +00:00
Reid Spencer
2645640325 Add a testcase for optimizing the strcpy libcall.
llvm-svn: 21615
2005-04-29 06:01:28 +00:00
Reid Spencer
c968ea0495 Remove optimizations that don't require both operands to be constant. These
are moved to simplify-libcalls pass.

llvm-svn: 21614
2005-04-29 05:55:35 +00:00
Reid Spencer
a8b889490e New test case for testing pow(3) math library optimizations.
llvm-svn: 21613
2005-04-29 05:47:05 +00:00
Jeff Cohen
4bc952f703 Consistently use 'class' to silence VC++
llvm-svn: 21612
2005-04-29 03:05:44 +00:00
Reid Spencer
ed55a6b5e0 * Add constant folding for additional floating point library calls such as
sinh, cosh, etc.
* Make the name comparisons for the fp libcalls a little more efficient by
  switching on the first character of the name before doing comparisons.

llvm-svn: 21611
2005-04-28 23:01:59 +00:00
Chris Lattner
014d2c42e7 Add support for FSQRT node, patch contributed by Morten Ofstad
llvm-svn: 21610
2005-04-28 22:07:18 +00:00
Chris Lattner
59ecb57e4a These functions can set errno!
llvm-svn: 21609
2005-04-28 21:52:31 +00:00
Chris Lattner
61827484c7 Add some new X86 instrs, patch contributed by Morten Ofstad
llvm-svn: 21608
2005-04-28 21:50:05 +00:00
Chris Lattner
effaec5436 Codegen fabs/fabsf as FABS. Patch contributed by Morten Ofstad
llvm-svn: 21607
2005-04-28 21:48:42 +00:00
Chris Lattner
9d6fa98ec7 Legalize FSQRT, FSIN, FCOS nodes, patch contributed by Morten Ofstad
llvm-svn: 21606
2005-04-28 21:44:33 +00:00
Chris Lattner
2f82d2d58a Add FSQRT, FSIN, FCOS nodes, patch contributed by Morten Ofstad
llvm-svn: 21605
2005-04-28 21:44:03 +00:00
Reid Spencer
16983ca865 Remove from the TODO list those optimizations that are already handled by
constant folding implemented in lib/Transforms/Utils/Local.cpp.

llvm-svn: 21604
2005-04-28 18:05:16 +00:00
Reid Spencer
649ac283e4 Document additional libcall transformations that need to be written.
Help Wanted!

There's a lot of them to write.

llvm-svn: 21603
2005-04-28 04:40:06 +00:00
Reid Spencer
7ddcfb3375 Doxygenate.
llvm-svn: 21602
2005-04-27 21:29:20 +00:00
Chris Lattner
36ffb1ff37 remove 'statement with no effect' warning
llvm-svn: 21600
2005-04-27 20:12:17 +00:00
Andrew Lenharth
4a73c2cfdc Implement Value* tracking for loads and stores in the selection DAG. This enables one to use alias analysis in the backends.
(TRUNK)Stores and (EXT|ZEXT|SEXT)Loads have an extra SDOperand which is a SrcValueSDNode which contains the Value*.  Note that if the operation is introduced by the backend, it will still have the operand, but the value* will be null.

llvm-svn: 21599
2005-04-27 20:10:01 +00:00
Chris Lattner
0a6f42ac1d Unbreak the sparc backend.
llvm-svn: 21598
2005-04-27 18:57:15 +00:00
Reid Spencer
08b4940509 More Cleanup:
* Name the instructions by appending to name of original
* Factor common part out of a switch statement.

llvm-svn: 21597
2005-04-27 17:46:54 +00:00
Andrew Lenharth
3b63291fc1 import fix and plot multiple lines at once
llvm-svn: 21596
2005-04-27 17:32:41 +00:00
Andrew Lenharth
438225a8cb Generate a gnuplot script for any program and any test (like llc or gcc)
llvm-svn: 21593
2005-04-27 16:41:50 +00:00
Andrew Lenharth
e81871331f So you want to import nightly tester data into a data base? Have we got the perl script for you
llvm-svn: 21592
2005-04-27 16:03:01 +00:00
Andrew Lenharth
be6ce82937 fix for parse, and a start at db import. Using CVS as scp :)
llvm-svn: 21591
2005-04-27 14:57:26 +00:00
Duraid Madina
b071bef66a clean up some warnings
llvm-svn: 21590
2005-04-27 11:57:39 +00:00
Reid Spencer
e249a82e73 This is a cleanup commit:
* Correct stale documentation in a few places
* Re-order the file to better associate things and reduce line count
* Make the pass thread safe by caching the Function* objects needed by the
  optimizers in the pass object instead of globally.
* Provide the SimplifyLibCalls pass object to the optimizer classes so they
  can access cached Function* objects and TargetData info
* Make sure the pass resets its cache if the Module passed to runOnModule
  changes
* Rename CallOptimizer LibCallOptimization. All the classes are named
  *Optimization while the objects are *Optimizer.
* Don't cache Function* in the optimizer objects because they could be used
  by multiple PassManager's running in multiple threads
* Add an optimization for strcpy which is similar to strcat
* Add a "TODO" list at the end of the file for ideas on additional libcall
  optimizations that could be added (get ideas from other compilers).

Sorry for the huge diff. Its mostly reorganization of code. That won't
happen again as I believe the design and infrastructure for this pass is
now done or close to it.

llvm-svn: 21589
2005-04-27 07:54:40 +00:00
Chris Lattner
93f4e9dd26 detect functions that never return, and turn the instruction following a
call to them into an 'unreachable' instruction.

This triggers a bunch of times, particularly on gcc:

gzip: 36
gcc: 601
eon: 12
bzip: 38
llvm-svn: 21587
2005-04-27 04:52:23 +00:00
Chris Lattner
356cbfef73 Test the noreturn function optimization
llvm-svn: 21586
2005-04-27 04:51:01 +00:00
Reid Spencer
a21f83f809 Add the simplify-libcalls pass.
llvm-svn: 21585
2005-04-27 02:22:47 +00:00
Andrew Lenharth
9b3114d4ed A first step towards being able to do more interesting things with the nightly tester data. Moreinteresting things will come soon, so tune in
llvm-svn: 21584
2005-04-27 02:13:20 +00:00
Reid Spencer
dc11db68b6 Prefix the debug statistics so they group together.
llvm-svn: 21583
2005-04-27 00:20:23 +00:00
Reid Spencer
e95a647b2a In debug builds, make a statistic for each kind of call optimization. This
helps track down what gets triggered in the pass so its easier to identify
good test cases.

llvm-svn: 21582
2005-04-27 00:05:45 +00:00
Chris Lattner
7f4f773e9f This analysis doesn't take 'throwing' into consideration, it looks at
'unwinding'

llvm-svn: 21581
2005-04-26 23:53:25 +00:00
Reid Spencer
f9d4be187f Fix up the debug statement to actually use a newline .. radical concept.
llvm-svn: 21580
2005-04-26 23:07:08 +00:00
Reid Spencer
18b998192f Uh, this isn't argpromotion.
llvm-svn: 21579
2005-04-26 23:05:17 +00:00
Reid Spencer
2bc7a4f82a Add some debugging output so we can tell which calls are getting triggered
llvm-svn: 21578
2005-04-26 23:02:16 +00:00
Chris Lattner
2bfe36214d no parens
llvm-svn: 21577
2005-04-26 22:57:07 +00:00
Chris Lattner
730a5da1af update some paths
llvm-svn: 21576
2005-04-26 22:56:16 +00:00
Reid Spencer
f8c03d9db6 No, seriously folks, memcpy really does return void.
llvm-svn: 21575
2005-04-26 22:49:48 +00:00
Reid Spencer
aaca170867 memcpy returns void!!!!!
llvm-svn: 21574
2005-04-26 22:46:23 +00:00
Reid Spencer
7821d06c24 Convert the remainder of the intrinsic function prototypes to "declare"
form from the "call" form.

llvm-svn: 21573
2005-04-26 20:50:44 +00:00
Reid Spencer
cf669d87d0 Use the declare syntax not the call syntax for intrinsic prototypes so
the uninitiated reader is not confused.

llvm-svn: 21572
2005-04-26 20:41:16 +00:00
Chris Lattner
41d183ed8d don't let Reid build void*'s :)
llvm-svn: 21571
2005-04-26 20:03:33 +00:00
Reid Spencer
4855ebf622 Fix some bugs found by running on llvm-test:
* MemCpyOptimization can only be optimized if the 3rd and 4th arguments are
  constants and we weren't checking for that.
* The result of llvm.memcpy (and llvm.memmove) is void* not sbyte*, put in
  a cast.

llvm-svn: 21570
2005-04-26 19:55:57 +00:00
Reid Spencer
bb92b4fdfb Changes From Review Feedback:
* Have the SimplifyLibCalls pass acquire the TargetData and pass it down to
  the optimization classes so they can use it to make better choices for
  the signatures of functions, etc.
* Rearrange the code a little so the utility functions are closer to their
  usage and keep the core of the pass near the top of the files.
* Adjust the StrLen pass to get/use the correct prototype depending on the
  TargetData::getIntPtrType() result. The result of strlen is size_t which
  could be either uint or ulong depending on the platform.
* Clean up some coding nits (cast vs. dyn_cast, remove redundant items from
  a switch, etc.)
* Implement the MemMoveOptimization as a twin of MemCpyOptimization (they
  only differ in name).

llvm-svn: 21569
2005-04-26 19:13:17 +00:00
Reid Spencer
61a18b84cc Add a test case for MemMove.ll
llvm-svn: 21568
2005-04-26 19:05:51 +00:00
Reid Spencer
abeb186371 Result of strlen is size_t which is either uint or ulong, not int.
llvm-svn: 21567
2005-04-26 19:04:46 +00:00
Chris Lattner
eb2a461acf Make interval partition print correctly, patch contributed by
Vladimir Prus!

llvm-svn: 21566
2005-04-26 14:48:28 +00:00
Chris Lattner
bd43b9db9d Fix the compile failures from last night.
llvm-svn: 21565
2005-04-26 14:40:41 +00:00
Duraid Madina
e06ef80244 constmul bugfix: multiply by 27611 was broken
llvm-svn: 21564
2005-04-26 09:42:50 +00:00
Duraid Madina
bbd0cd71a8 clean up the code! (oops) lots more cleaning left, however.
llvm-svn: 21563
2005-04-26 08:43:47 +00:00
Reid Spencer
b4f7b83dce * Merge get_GVInitializer and getCharArrayLength into a single function
named getConstantStringLength. This is the common part of StrCpy and
  StrLen optimizations and probably several others, yet to be written. It
  performs all the validity checks for looking at constant arrays that are
  supposed to be null-terminated strings and then computes the actual
  length of the string.
* Implement the MemCpyOptimization class. This just turns memcpy of 1, 2, 4
  and 8 byte data blocks that are properly aligned on those boundaries into
  a load and a store. Much more could be done here but alignment
  restrictions and lack of knowledge of the target instruction set prevent
  use from doing significantly more. That will have to be delegated to the
  code generators as they lower llvm.memcpy calls.

llvm-svn: 21562
2005-04-26 07:45:18 +00:00
Reid Spencer
89011b6f3c Add a new test case for the llvm.memcpy simplification case.
llvm-svn: 21561
2005-04-26 07:40:40 +00:00
Duraid Madina
81ebb57771 * Add code to reduce multiplies by constant integers to shifts, adds and
subtracts. This is a very rough and nasty implementation of Lefevre's
  "pattern finding" algorithm. With a few small changes though, it should
  end up beating most other methods in common use, regardless of the size
  of the constant (currently, it's often one or two shifts worse)

  TODO: rewrite it so it's not hideously ugly (this is a translation from
        perl, which doesn't help ;)
        bypass most of it for multiplies by 2^n+1
	(eventually) teach it that some combinations of shift+add are
	cheaper than others (e.g. shladd on ia64, scaled adds on alpha)
	get it to try multiple booth encodings in search of the cheapest
	routine
	make it work for negative constants

  This is hacked up as a DAG->DAG transform, so once I clean it up I hope
  it'll be pulled out of here and put somewhere else. The only thing backends
  should really have to worry about for now is where to draw the line
  between using this code vs. going ahead and doing an integer multiply
  anyway.

llvm-svn: 21560
2005-04-26 07:23:02 +00:00
Reid Spencer
76dab9a523 * Implement StrLenOptimization
* Factor out commonalities between StrLenOptimization and StrCatOptimization
* Make sure that signatures return sbyte* not void*

llvm-svn: 21559
2005-04-26 05:24:00 +00:00
Reid Spencer
3f2710e64e * Add a test case for StrLenOptimization
* Rename ExitInMain and StrCat tests so they don't have the date the
  regression was entered since they are feature tests, not regressions.

llvm-svn: 21558
2005-04-26 05:22:38 +00:00
Reid Spencer
8ee5aacc38 Incorporate feedback from Chris:
* Change signatures of OptimizeCall and ValidateCalledFunction so they are
  non-const, allowing the optimization object to be modified. This is in
  support of caching things used across multiple calls.
* Provide two functions for constructing and caching function types
* Modify the StrCatOptimization to cache Function objects for strlen and
  llvm.memcpy so it doesn't regenerate them on each call site. Make sure
  these are invalidated each time we start the pass.
* Handle both a GEP Instruction and a GEP ConstantExpr
* Add additional checks to make sure we really are dealing with an arary of
  sbyte and that all the element initializers are ConstantInt or
  ConstantExpr that reduce to ConstantInt.
* Make sure the GlobalVariable is constant!
* Don't use ConstantArray::getString as it can fail and it doesn't give us
  the right thing. We must check for null bytes in the middle of the array.
* Use llvm.memcpy instead of memcpy so we can factor alignment into it.
* Don't use void* types in signatures, replace with sbyte* instead.

llvm-svn: 21555
2005-04-26 03:26:15 +00:00
Jeff Cohen
d45bdb45c1 Add SimplyLibCalls.cpp to VC++ build
llvm-svn: 21554
2005-04-26 02:57:49 +00:00
Reid Spencer
342fe9a833 Fix RUN: line to not always pass.
llvm-svn: 21553
2005-04-26 02:33:25 +00:00
Chris Lattner
cfa7ddd6e2 Fold (X > -1) | (Y > -1) --> (X&Y > -1)
llvm-svn: 21552
2005-04-26 01:18:33 +00:00
Reid Spencer
fe91dfec91 Changes due to code review and new implementation:
* Don't use std::string for the function names, const char* will suffice
* Allow each CallOptimizer to validate the function signature before
  doing anything
* Repeatedly loop over the functions until an iteration produces
  no more optimizations. This allows one optimization to insert a
  call that is optimized by another optimization.
* Implement the ConstantArray portion of the StrCatOptimization
* Provide a template for the MemCpyOptimization
* Make ExitInMainOptimization split the block, not delete everything
  after the return instruction.
(This covers revision 1.3 and 1.4, as the 1.3 comments were botched)

llvm-svn: 21548
2005-04-25 21:20:38 +00:00
Chris Lattner
f806459d90 implement some more logical compares with constants, so that:
int foo1(int x, int y) {
  int t1 = x >= 0;
  int t2 = y >= 0;
  return t1 & t2;
}
int foo2(int x, int y) {
  int t1 = x == -1;
  int t2 = y == -1;
  return t1 & t2;
}

produces:

_foo1:
        or r2, r4, r3
        srwi r2, r2, 31
        xori r3, r2, 1
        blr
_foo2:
        and r2, r4, r3
        addic r2, r2, 1
        li r2, 0
        addze r3, r2
        blr

instead of:

_foo1:
        srwi r2, r4, 31
        xori r2, r2, 1
        srwi r3, r3, 31
        xori r3, r3, 1
        and r3, r2, r3
        blr
_foo2:
        addic r2, r4, 1
        li r2, 0
        addze r2, r2
        addic r3, r3, 1
        li r3, 0
        addze r3, r3
        and r3, r2, r3
        blr

llvm-svn: 21547
2005-04-25 21:20:28 +00:00
Reid Spencer
f2534c7291 Lots of changes based on review and new functionality:
* Use a 

llvm-svn: 21546
2005-04-25 21:11:48 +00:00
Reid Spencer
172e9155c1 Update the test case to handle a few more (degenerate) cases and remove
the restriction that it is an XFAIL because it now passes.

llvm-svn: 21545
2005-04-25 21:08:34 +00:00
Chris Lattner
d373ff64aa Codegen x < 0 | y < 0 as (x|y) < 0. This allows us to compile this to:
_foo:
        or r2, r4, r3
        srwi r3, r2, 31
        blr

instead of:

_foo:
        srwi r2, r4, 31
        srwi r3, r3, 31
        or r3, r2, r3
        blr

llvm-svn: 21544
2005-04-25 21:03:25 +00:00
Chris Lattner
e093c6f565 Make dominates(A,B) work with post dominators. Patch contributed by
Naveen Neelakantam, thanks!

llvm-svn: 21543
2005-04-25 20:50:33 +00:00
Tanya Lattner
af0ac2744e Added question about turning off all optimizations. I think this has been asked once or twice.
llvm-svn: 21542
2005-04-25 20:36:56 +00:00
Chris Lattner
a21bf8d1be implement getelementptr.ll:test10
llvm-svn: 21541
2005-04-25 20:17:30 +00:00
Chris Lattner
20621b1e94 rename fn
llvm-svn: 21540
2005-04-25 20:17:16 +00:00
Chris Lattner
e680ee2a48 new testcase
llvm-svn: 21539
2005-04-25 20:17:00 +00:00
Chris Lattner
ecac782786 Correctly handle global-argument aliases induced in main
llvm-svn: 21537
2005-04-25 19:16:31 +00:00
Chris Lattner
5965359d8f Don't mess up SCC traversal when a node has null edges out of it.
llvm-svn: 21536
2005-04-25 19:16:17 +00:00
Chris Lattner
37b6b097ff document 'opaque' types
llvm-svn: 21535
2005-04-25 17:34:15 +00:00
Chris Lattner
d1039cc581 Add feedback from Vikram
llvm-svn: 21534
2005-04-25 15:47:57 +00:00
Reid Spencer
478d3b930a Make sure the target buffer is null terminated so we don't blow up
strcat when its called.

llvm-svn: 21533
2005-04-25 15:40:35 +00:00
Reid Spencer
20b0e43e1f A test case for testing the StrCatOptimizer, currently XFAILed everywhere.
llvm-svn: 21532
2005-04-25 07:29:30 +00:00
Reid Spencer
9bbaa2ab7f Post-Review Cleanup:
* Fix comments at top of file
* Change algorithm for running the call optimizations from n*n to something
  closer to n.
* Use a hash_map to store and lookup the optimizations since there will
  eventually (or potentially) be a large number of them. This gets lookup
  based on the name of the function to O(1). Each CallOptimizer now has a
  std::string member named func_name that tracks the name of the function
  that it applies to. It is this string that is entered into the hash_map
  for fast comparison against the function names encountered in the module.
* Cleanup some style issues pertaining to iterator invalidation
* Don't pass the Function pointer to the OptimizeCall function because if
  the optimization needs it, it can get it from the CallInst passed in.
* Add the skeleton for a new CallOptimizer, StrCatOptimizer which will
  eventually replace strcat's of constant strings with direct copies.

llvm-svn: 21526
2005-04-25 03:59:26 +00:00
Reid Spencer
23423346f8 Use the %name rather than the "name" format so those familiar with the
llvm-dis output don't go blind.

llvm-svn: 21525
2005-04-25 03:18:19 +00:00
Reid Spencer
ff7b16c1d6 Shut GCC 4.0 up about classes that have virtual functions but a non-virtual
destructor. Just add the do-nothing virtual destructor.

llvm-svn: 21524
2005-04-25 02:55:55 +00:00
Reid Spencer
0c2d046aa4 Declare a function to create the SimplifyLibCalls pass.
llvm-svn: 21523
2005-04-25 02:54:00 +00:00
Reid Spencer
39a762d149 A new pass to provide specific optimizations for certain well-known library
calls. The pass visits all external functions in the module and determines
if such function calls can be optimized. The optimizations are specific to
the library calls involved. This initial version only optimizes calls to
exit(3) when they occur in main(): it changes them to ret instructions.

llvm-svn: 21522
2005-04-25 02:53:12 +00:00
Reid Spencer
985f484263 A test case for the the ExitInMain libcall simplification.
llvm-svn: 21521
2005-04-25 02:50:08 +00:00
Reid Spencer
8edc8beacf Older compilers won't like the inline virtual destructor in the header file
so we put the destructor in Pass.cpp and make it non-inline.

llvm-svn: 21520
2005-04-25 01:01:35 +00:00
Chris Lattner
fc104de06d fix some bugs
llvm-svn: 21515
2005-04-25 00:38:52 +00:00
Reid Spencer
756d049c06 Fix a thinko in the documentation of the splitBasicBlock method. The branch
instruction is added to the original block, not the new block.

llvm-svn: 21513
2005-04-25 00:31:53 +00:00
Reid Spencer
9c47b25868 Shut GCC 4.0 up about classes with virtual functions but no virtual
destructor.

llvm-svn: 21510
2005-04-24 22:27:20 +00:00
Reid Spencer
ad750a80eb Shut GCC 4.0 up when it complains about classes with virtual functions that
don't have virtual destructors.

llvm-svn: 21507
2005-04-24 22:20:32 +00:00
Reid Spencer
4da978466d Make this readable for newbies and those who can only understand one set of
grammar rules for the English language.

llvm-svn: 21503
2005-04-24 20:56:18 +00:00
Misha Brukman
6818b33096 extract has been renamed to llvm-extract to avoid conflicting with another tool
llvm-svn: 21501
2005-04-24 17:46:58 +00:00
Chris Lattner
2f1457fd83 Eliminate cases where we could << by 64, which is undefined in C.
llvm-svn: 21500
2005-04-24 17:46:05 +00:00
Misha Brukman
ca1e0c6ae0 There are still uses for spaces in Makefiles -- to make text line up together,
regardless of the tab size/stop settings on the developer side

llvm-svn: 21499
2005-04-24 17:43:41 +00:00
Misha Brukman
e22594f3d7 extract has been renamed to llvm-extract to avoid conflicting with another tool
llvm-svn: 21498
2005-04-24 17:36:05 +00:00
Misha Brukman
3e9634eaa0 elisp code to help with LLVM code standards compliance
llvm-svn: 21497
2005-04-24 17:09:19 +00:00
Misha Brukman
831ad84eea .vimrc file to aid in LLVM coding standards conformance
llvm-svn: 21496
2005-04-24 17:05:04 +00:00
Chris Lattner
d6f636a340 Implement xor.ll:test21: select (not C), A, B -> select C, B, A
llvm-svn: 21495
2005-04-24 07:30:14 +00:00
Chris Lattner
b57d040464 Test that xor/select are folded into a select with inverted operands.
llvm-svn: 21494
2005-04-24 07:28:53 +00:00
Chris Lattner
2c7d177d25 Allow these methods to take a generic Value* to simplify clients. Use
const_cast instead of c casts.

llvm-svn: 21493
2005-04-24 07:28:37 +00:00
Chris Lattner
b220952aca allow these to take a generic Value*
llvm-svn: 21492
2005-04-24 07:28:04 +00:00
Chris Lattner
d1f46d3bf9 Use getPrimitiveSizeInBits() instead of getPrimitiveSize()*8
Completely rework the 'setcc (cast x to larger), y' code.  This code has
the advantage of implementing setcc.ll:test19 (being more general than
the previous code) and being correct in all cases.

This allows us to unxfail 2004-11-27-SetCCForCastLargerAndConstant.ll,
and close PR454.

llvm-svn: 21491
2005-04-24 06:59:08 +00:00
Chris Lattner
0de0638522 unxfail this.
llvm-svn: 21490
2005-04-24 06:55:40 +00:00
Chris Lattner
624d5cb006 add a new testcase which occurs in 181.mcf
llvm-svn: 21489
2005-04-24 06:55:33 +00:00
Misha Brukman
1c8d93b08f * The aesthetic police is on patrol!!...
* ... but it wasn't so busy as to not smell the roses and doxygenify comments

llvm-svn: 21487
2005-04-23 22:35:26 +00:00
Chris Lattner
396890d3ac Add a helper method
llvm-svn: 21486
2005-04-23 22:20:22 +00:00
Chris Lattner
8a878ccb25 Fix a bug in my previous checkin
llvm-svn: 21485
2005-04-23 22:01:39 +00:00
Chris Lattner
2908bc1e7a This file is never referenced
llvm-svn: 21484
2005-04-23 22:00:26 +00:00
Chris Lattner
6263766133 Add a method, remove last use of Type.def
llvm-svn: 21483
2005-04-23 22:00:09 +00:00
Chris Lattner
816394d7ad add a method, remove a dead #include
llvm-svn: 21482
2005-04-23 21:59:42 +00:00
Chris Lattner
6226f941b0 Types.def is going away
llvm-svn: 21481
2005-04-23 21:59:11 +00:00
Jeff Cohen
82639853c0 Eliminate tabs and trailing spaces
llvm-svn: 21480
2005-04-23 21:38:35 +00:00
Jeff Cohen
8047f13a88 Eliminate tabs and trailing spaces
llvm-svn: 21479
2005-04-23 21:26:11 +00:00
Chris Lattner
4bbf66b7a2 Propagate eq sets through the bu graphs to the cbu and eq graphs, fixing
a crash of the sfv on 188.ammp

llvm-svn: 21478
2005-04-23 21:11:05 +00:00
Chris Lattner
fdfb25a9e1 add a bunch of documentation about the LLVM type resolution machinery
llvm-svn: 21475
2005-04-23 17:27:36 +00:00
Reid Spencer
7fa89cfc9b Make the CBackend actually get included in llc by using USEDLIBS instead of
USEDLIB as the variable to which "CBackend" is appended. The surrounding
if clause is safe because currently the configure script ensures that the
CBackend target is always added to TARGETS_TO_BUILD. By using a non-hard
coded construct in the makefile, we gain uniformity and the ability to
change the default set of targets by only changing the configure script.

llvm-svn: 21474
2005-04-23 17:24:33 +00:00
Chris Lattner
c6ce71d434 make an advanced topics section, move symtab to it
llvm-svn: 21473
2005-04-23 16:10:52 +00:00
Chris Lattner
7eae28b9d9 This is not needed
llvm-svn: 21472
2005-04-23 16:00:27 +00:00
Chris Lattner
c5ad1ca942 add a search box for the documentation
llvm-svn: 21471
2005-04-23 15:55:18 +00:00
Chris Lattner
77c32c34d7 Generalize the setcc -> PHI and Select folding optimizations to work with
any constant RHS, not just a constant integer RHS.  This implements
select.ll:test17

llvm-svn: 21470
2005-04-23 15:31:55 +00:00
Chris Lattner
64a8a7f9b7 add a new testcase
llvm-svn: 21469
2005-04-23 15:31:03 +00:00
Chris Lattner
01c81ab706 Always enable the C backend. This fixes a *vast* number of failures on the
testers last night, as llc was not getting the cbe linked in.

llvm-svn: 21468
2005-04-23 14:36:22 +00:00
Alkis Evlogimenos
0166db6529 Add method to return the type this type will be promoted to if it is
passed through a variable argument function.

llvm-svn: 21462
2005-04-23 00:11:21 +00:00
Reid Spencer
51efcefa49 Mention the --enable-targets= option to configure.
llvm-svn: 21459
2005-04-22 20:27:33 +00:00
Misha Brukman
7937b07940 * Order #includes as per style guide
* Combine multiple ``std::cerr <<'' statements into one for simplicity

llvm-svn: 21458
2005-04-22 19:13:22 +00:00
Misha Brukman
fd8c2265fa Convert tabs to spaces
llvm-svn: 21457
2005-04-22 18:06:01 +00:00
Misha Brukman
36c6bc1bf4 Hyphenate the adjective `n-bit' when used to describe values and processors
llvm-svn: 21456
2005-04-22 18:02:52 +00:00
Misha Brukman
d5da38c9aa Build the `Skeleton' target when building "all" targets
llvm-svn: 21455
2005-04-22 18:00:34 +00:00
Reid Spencer
1e195bdd41 Document the --enable-targets= feature of the configure script.
llvm-svn: 21454
2005-04-22 17:58:03 +00:00
Alkis Evlogimenos
7afc9558e0 Silence gcc-4.0.0 warnings.
llvm-svn: 21453
2005-04-22 17:56:01 +00:00
Misha Brukman
e73e76dc42 Convert tabs to spaces
llvm-svn: 21452
2005-04-22 17:54:37 +00:00
Reid Spencer
948f453254 Don't always build CBackend and Skeleton. Make use of the TARGETS_TO_BUILD
parameter instead which will correctly list the set of targets to be built.

llvm-svn: 21451
2005-04-22 17:32:05 +00:00
Reid Spencer
e4481c7c82 Implement the --enable-targets= feature of the configure script. The make
variable TARGETS_TO_BUILD is used to determine which targets in lib/Target
are built and which libraries are linked into llc. This effectively
implements the feature. One item remains: disabling targets in the dejagnu
test suite.

llvm-svn: 21450
2005-04-22 17:20:11 +00:00
Reid Spencer
ce9612b23c Two changes:
1. Get rid of TOOLLINKOPTS as it is a hold over from llvm-test and only
   used to communicate additional libraries to the linker. The *standard*
   way to do that is with the LIBS variable which this change supports.

2. Allow the TARGETS_TO_BUILD variable to be set from the configuration
   substitution. This is the result of the --enable-target= parameter to
   the configure script.

llvm-svn: 21449
2005-04-22 17:14:14 +00:00
Reid Spencer
90dd65e4a7 Make sure the CBackend is always a target that is built.
llvm-svn: 21448
2005-04-22 17:06:18 +00:00
Reid Spencer
e482ca8bfa Consolidate the target selection options into a single option,
--enable-target which can take values "all", "host-only" or a comma
separated list of target names (alpha,ia64,powerpc,skeleton,sparc,x86)

llvm-svn: 21447
2005-04-22 17:02:18 +00:00
Andrew Lenharth
8f4081a8c9 keep track of max depth stats
llvm-svn: 21446
2005-04-22 13:35:18 +00:00
Reid Spencer
4742804864 First step in avoiding compilation/usage of non-relevant targets. New
options have been added to the configure script that control which targets
will be used. The options are:

--enable-target-this (default=disabled)
  This will specify that the target corresponding to the build host is
  the target that will be compiled/used. You can't use this with any of
  the other options (they'll be ignored). This is what most people want.

--disable-target-x86 (default=enabled)
  This will prevent the X86 target(s) from being compiled/used.

--disable-target-sparc (default=enabled)
  This will prevent both SparcV8 and SparcV9 from being compiled/used.

--disable-target-powerpc (default=enabled)
  This will prevent the PowerPC target from being compiled/used.

--disable-target-alpha (default=enabled)
  This will prevent the Alpha target from being compiled/used.

--disable-target-ia64 (default=enabled)
  This will prevent the IA64 target from being compiled/used.

Note that without any of these options, the default behavior is to build
all targets, as is the current practice.

All these options do is set up the substititution variable TARGETS_TO_BUILD
which contains the targets that should be compiled/used. The variable is
intended to be used in the makefiles. Those changes will come later.

llvm-svn: 21445
2005-04-22 07:27:28 +00:00
Tanya Lattner
42ed14860b Updated dependence analyzer. Fixed numerous bugs. Same stage scheduling, etc.
llvm-svn: 21444
2005-04-22 06:32:48 +00:00
Chris Lattner
e25cfaee55 Malloc/Free have mod/ref effects. Do not allow CSE of function calls that
call malloc/free.  This fixes PR555.

llvm-svn: 21443
2005-04-22 05:36:59 +00:00
Chris Lattner
16431f7b3c remove 'another common example', which doesn't work with VC++, and indent
another example properly

llvm-svn: 21442
2005-04-22 04:49:59 +00:00
Jeff Cohen
88e7b7288a Eliminate tabs and trailing spaces
llvm-svn: 21441
2005-04-22 04:13:13 +00:00
Misha Brukman
5191b4b2d0 Convert tabs to spaces
llvm-svn: 21440
2005-04-22 04:08:30 +00:00
Misha Brukman
774511633d Convert tabs to spaces
llvm-svn: 21439
2005-04-22 04:01:18 +00:00
Misha Brukman
1fabffbf37 Convert tabs to spaces
llvm-svn: 21438
2005-04-22 03:46:24 +00:00
Misha Brukman
4b45ec0be0 Convert tabs to spaces
llvm-svn: 21437
2005-04-22 03:35:49 +00:00
Misha Brukman
204572af9d Convert tabs to spaces
llvm-svn: 21436
2005-04-22 03:27:20 +00:00
Misha Brukman
8c0ca76517 Convert tabs to spaces
llvm-svn: 21433
2005-04-22 03:18:56 +00:00
Reid Spencer
a3d4e04da8 Add the RUN: prefix to the start of the run line so this test doesn't fail.
BTW .. isn't the date on this funky? We haven't reachec 2005-05-09 yet???

llvm-svn: 21432
2005-04-22 02:49:25 +00:00
Reid Spencer
7275e3fb31 Change some old-style casts to C++ style casts to avoid warnings in XPS
compilation. This change has been waiting in the wings for a long time but
since Misha just did a global change, I figured now was the time to commit
it.

llvm-svn: 21431
2005-04-22 02:31:56 +00:00
Reid Spencer
d6312210d1 There is no =head3. Convert to =head2.
llvm-svn: 21430
2005-04-22 02:16:19 +00:00
Reid Spencer
84f3911b09 Correct the documentation to match the program.
llvm-svn: 21429
2005-04-22 02:12:41 +00:00
Misha Brukman
650ba8eb56 Remove trailing whitespace
llvm-svn: 21428
2005-04-22 00:00:37 +00:00
Misha Brukman
b1c9317bb4 Remove trailing whitespace
llvm-svn: 21427
2005-04-21 23:48:37 +00:00
Misha Brukman
c88330ad13 * Remove trailing whitespace
* Convert tabs to spaces

llvm-svn: 21426
2005-04-21 23:38:14 +00:00
Misha Brukman
b440243e94 Remove trailing whitespace
llvm-svn: 21425
2005-04-21 23:30:14 +00:00
Misha Brukman
89b8c8d215 Remove trailing whitespace
llvm-svn: 21424
2005-04-21 23:13:11 +00:00
Misha Brukman
10468d8a3c Remove trailing whitespace
llvm-svn: 21422
2005-04-21 22:55:34 +00:00
Misha Brukman
91fb9ab60b * Remove trailing whitespace
* Convert tabs to spaces

llvm-svn: 21421
2005-04-21 22:43:08 +00:00
Misha Brukman
835702a094 Remove trailing whitespace
llvm-svn: 21420
2005-04-21 22:36:52 +00:00
Misha Brukman
b47d28bfe8 * Remove trailing whitespace
* Convert tabs to spaces

llvm-svn: 21418
2005-04-21 21:48:46 +00:00
Misha Brukman
2ecc34dd3c Remove trailing whitespace
llvm-svn: 21417
2005-04-21 21:44:41 +00:00
Misha Brukman
01808caded Remove trailing whitespace
llvm-svn: 21416
2005-04-21 21:13:18 +00:00
Misha Brukman
13f332cd3f * Remove trailing whitespace
* Convert tabs to spaces

llvm-svn: 21415
2005-04-21 21:10:11 +00:00
Chris Lattner
95e43ae162 Check for eqv matching
llvm-svn: 21414
2005-04-21 21:10:07 +00:00
Chris Lattner
3590ef1164 Match another form of eqv
llvm-svn: 21413
2005-04-21 21:09:11 +00:00
Misha Brukman
df586aa20e Remove trailing whitespace
llvm-svn: 21412
2005-04-21 20:59:05 +00:00
Misha Brukman
95aab4ef6d Remove trailing whitespace
llvm-svn: 21411
2005-04-21 20:48:15 +00:00
Chris Lattner
5c9ef1ba2d this passes on darwin
llvm-svn: 21410
2005-04-21 20:48:08 +00:00
Misha Brukman
01230b24ae Remove trailing whitespace
llvm-svn: 21409
2005-04-21 20:39:54 +00:00
Misha Brukman
01cada8797 Remove trailing whitespace
llvm-svn: 21408
2005-04-21 20:19:05 +00:00
Chris Lattner
486a1ec909 Handle stores of global address as stores of immediates. Instead of:
test1:
        movl $N, %eax
        movl %eax, G
        ret

emit:

test1:
        movl $N, G
        ret

llvm-svn: 21407
2005-04-21 19:11:03 +00:00
Chris Lattner
adcfc1748b Handle (store &GV -> mem) as a store immediate. This often occurs for
printf format strings and other stuff.  Instead of generating this:

        movl $l1__2E_str_1, %eax
        movl %eax, (%esp)

we now emit:

        movl $l1__2E_str_1, (%esp)

llvm-svn: 21406
2005-04-21 19:03:24 +00:00
Reid Spencer
c8b5d60937 Use the actual uid/gid for defaulting the fields in the archive.
llvm-svn: 21405
2005-04-21 17:49:57 +00:00
Chris Lattner
a3159af703 Fix a bug where we would not promote calls to invokes if they occured in
the same block as the setjmp.  Thanks to Greg Pettyjohn for noticing this!

llvm-svn: 21403
2005-04-21 16:46:46 +00:00
Reid Spencer
ce7ce1628f Eliminate calls to system dependent function getuid by using
the newly implemented sys::Process::GetCurrentUserId function. Replace
similarly for getgid.

llvm-svn: 21402
2005-04-21 16:15:19 +00:00
Reid Spencer
2d45e25125 Provide an implementation of the GetCurrentUserId and GetCurrentGroupId
methods that were recently added to the interface.

llvm-svn: 21401
2005-04-21 16:12:57 +00:00
Reid Spencer
5e92ead30d Add two new methods for getting the User Id and Group Id values for the
current process.

llvm-svn: 21400
2005-04-21 16:12:04 +00:00
Chris Lattner
c346bf59ee Add doxygen comments, patch contributed by Evan Jones.
llvm-svn: 21397
2005-04-21 16:10:03 +00:00
Chris Lattner
4c5c96f35f add support for taking and resolving the address of free.
llvm-svn: 21396
2005-04-21 16:09:43 +00:00
Chris Lattner
631ee94316 add support for taking the address of free.
llvm-svn: 21395
2005-04-21 16:08:59 +00:00
Chris Lattner
954c64d532 Improve doxygen, from part of Evan's patch that didn't apply.
llvm-svn: 21394
2005-04-21 16:06:03 +00:00
Chris Lattner
7ceb081f3f Improve doxygen documentation, patch contributed by Evan Jones!
llvm-svn: 21393
2005-04-21 16:04:49 +00:00
Chris Lattner
f6302441f0 Improve and elimination. On PPC, for:
bool %test(int %X) {
        %Y = and int %X, 8
        %Z = setne int %Y, 0
        ret bool %Z
}

we now generate this:

        rlwinm r2, r3, 0, 28, 28
        srwi r3, r2, 3

instead of this:

        rlwinm r2, r3, 0, 28, 28
        srwi r2, r2, 3
        rlwinm r3, r2, 0, 31, 31

I'll leave it to Nate to get it down to one instruction. :)

---------------------------------------------------------------------

llvm-svn: 21391
2005-04-21 06:28:15 +00:00
Chris Lattner
ab1ed77570 Fold (x & 8) != 0 and (x & 8) == 8 into (x & 8) >> 3.
This turns this PPC code:

        rlwinm r2, r3, 0, 28, 28
        cmpwi cr7, r2, 8
        mfcr r2
        rlwinm r3, r2, 31, 31, 31

into this:

        rlwinm r2, r3, 0, 28, 28
        srwi r2, r2, 3
        rlwinm r3, r2, 0, 31, 31

Next up, nuking the extra and.

llvm-svn: 21390
2005-04-21 06:12:41 +00:00
Chris Lattner
374e659466 Instcombine this:
%shortcirc_val = select bool %tmp.1, bool true, bool %tmp.4             ; <bool> [#uses=1]
        %tmp.6 = cast bool %shortcirc_val to int                ; <int> [#uses=1]

into this:

        %shortcirc_val = or bool %tmp.1, %tmp.4         ; <bool> [#uses=1]
        %tmp.6 = cast bool %shortcirc_val to int                ; <int> [#uses=1]

not this:

        %tmp.4.cast = cast bool %tmp.4 to int           ; <int> [#uses=1]
        %tmp.6 = select bool %tmp.1, int 1, int %tmp.4.cast             ; <int> [#uses=1]

llvm-svn: 21389
2005-04-21 05:43:13 +00:00
Chris Lattner
b38b443b15 Teach simplifycfg that setcc is cheap and non-trapping, so that it can
convert this:

        %tmp.1 = seteq int %i, 0                ; <bool> [#uses=1]
        br bool %tmp.1, label %shortcirc_done, label %shortcirc_next

shortcirc_next:         ; preds = %entry
        %tmp.4 = seteq int %j, 0                ; <bool> [#uses=1]
        br label %shortcirc_done

shortcirc_done:         ; preds = %shortcirc_next, %entry
        %shortcirc_val = phi bool [ %tmp.4, %shortcirc_next ], [ true, %entry ]         ; <bool> [#uses=1]

to this:
        %tmp.1 = seteq int %i, 0                ; <bool> [#uses=1]
        %tmp.4 = seteq int %j, 0                ; <bool> [#uses=1]
        %shortcirc_val = select bool %tmp.1, bool true, bool %tmp.4             ; <bool> [#uses=1]

... which is later simplified by instcombine into an or.

llvm-svn: 21388
2005-04-21 05:31:13 +00:00
Chris Lattner
b7848974cd Fix some broken links, taking care of PR554
llvm-svn: 21387
2005-04-21 04:53:58 +00:00
Chris Lattner
0727518f81 update to match build changes.
llvm-svn: 21386
2005-04-21 04:52:37 +00:00
Reid Spencer
8424ba373e For Bug 543:
Standardize the error messages to be in "path: what failed: why" format.
Also attempt to use the correct errno to ThrowErrno in situations where
the errno value is erased by subsequent system calls.

llvm-svn: 21385
2005-04-21 02:50:10 +00:00
Reid Spencer
b02566dc1c For Bug 543:
Allow the ThrowErrno function to optionally accept an error number
parameter so that callers can specify the error number to be used.

llvm-svn: 21384
2005-04-21 02:30:32 +00:00
Misha Brukman
2f72bafb60 Remove trailing whitespace at the end of lines
llvm-svn: 21380
2005-04-20 16:42:34 +00:00
Misha Brukman
ea548c0cb1 Remove trailing whitespace, patch by Markus Oberhumer.
llvm-svn: 21379
2005-04-20 16:05:03 +00:00
Misha Brukman
5e7bac21d5 Add FIXME by Markus Oberhumer from bug 545: not checking for "." in $PATH may
result in returning executable files that won't be runnable.

llvm-svn: 21378
2005-04-20 15:42:11 +00:00
Misha Brukman
a9a8c1b65b Do not mark directories as `executable', we only want program files
Patch by Markus Oberhumer.

llvm-svn: 21377
2005-04-20 15:33:22 +00:00
Misha Brukman
ee6770f1a3 #include system headers after all LLVM headers
llvm-svn: 21374
2005-04-20 04:51:29 +00:00
Misha Brukman
17092bd0a4 Eliminate trailing spaces at end-of-line
llvm-svn: 21372
2005-04-20 04:08:35 +00:00
Misha Brukman
3f4fe46796 Consistently eschew space between *' or &' and function argument name
llvm-svn: 21371
2005-04-20 04:07:47 +00:00
Misha Brukman
1001aea4d3 Ignore dangling symlinks in getDirectoryContents()
Thanks to Markus Oberhumer for the patch!

llvm-svn: 21370
2005-04-20 04:04:07 +00:00
Misha Brukman
8cd50bf269 Initialize fields mode, uid, and gid.
Patch by Markus Oberhumer.  Thanks!

llvm-svn: 21369
2005-04-20 03:55:35 +00:00
Misha Brukman
bebcaeb816 Align comments together for consistency
llvm-svn: 21368
2005-04-20 03:52:59 +00:00
Misha Brukman
64a8c3ed91 * Print commands as we execute them with `-v'
* Add option `-save-temps'
Patch contributed by Markus Oberhumer.

llvm-svn: 21367
2005-04-20 03:22:18 +00:00
Chris Lattner
8cb10a1775 Wrap some long lines.
Make IPSCCP strip off dead constant exprs that are using functions, making
them appear as though their address is taken.  This allows us to propagate
some more pool descriptors, lowering the overhead of pool alloc.

llvm-svn: 21363
2005-04-19 19:16:19 +00:00
Chris Lattner
14db4a2895 ignore generated files
llvm-svn: 21362
2005-04-19 15:34:36 +00:00
Chris Lattner
b17483028f fix bogus warning
llvm-svn: 21361
2005-04-19 15:32:30 +00:00
Chris Lattner
07ad98dbe2 fix PR549
llvm-svn: 21360
2005-04-19 15:27:29 +00:00
Chris Lattner
181c818373 Bug fixed
llvm-svn: 21355
2005-04-19 06:08:04 +00:00
Chris Lattner
5c219469a0 Eliminate a broken transformation, fixing PR548
llvm-svn: 21354
2005-04-19 06:04:18 +00:00
Chris Lattner
53c40624f9 Add completely untested support for mtcrf/mfcrf encoding
llvm-svn: 21353
2005-04-19 05:41:52 +00:00
Chris Lattner
baa9be572b switch over the rest of the formats that use RC to use isDOT
llvm-svn: 21352
2005-04-19 05:21:30 +00:00
Chris Lattner
f9172e14c9 Convert the XForm instrs and XSForm instruction over to use isDOT
llvm-svn: 21351
2005-04-19 05:15:18 +00:00
Chris Lattner
5b78da4571 Now that the ppc64 and vmx operands of I are always 0, forward substitute
them away.

llvm-svn: 21350
2005-04-19 05:05:22 +00:00
Chris Lattner
116a9e5a34 convert over bform and iform instructions
llvm-svn: 21349
2005-04-19 05:00:59 +00:00
Chris Lattner
b2367e398e Convert over DForm and DSForm instructions
llvm-svn: 21348
2005-04-19 04:59:28 +00:00
Chris Lattner
15709c2c33 Convert XLForm and XForm instructions over to use PPC64 when appropriate.
llvm-svn: 21347
2005-04-19 04:51:30 +00:00
Chris Lattner
d790d22f22 Convert XO XS and XFX forms to use isPPC64
llvm-svn: 21346
2005-04-19 04:40:07 +00:00
Chris Lattner
c7cb8c77fb Turn PPC64 and VMX into classes that can be added to instructions instead of
bits that must be passed up the inheritance hierarchy.  Convert MForm and AForm
instructions over

llvm-svn: 21345
2005-04-19 04:32:54 +00:00
Chris Lattner
ef94374a1c Major change to tblgen: instead of resolving values every time a class is
finished up, only resolve fully when the def is defined.  This allows things
to be changed and all uses to be propagated through.  This implements
TableGen/LazyChange.td and fixes TemplateArgRename.td in the process.

None of the .td files used in LLVM backends are changed at all by this
patch.

llvm-svn: 21344
2005-04-19 03:36:21 +00:00
Chris Lattner
ab77740715 New testcase for a changing values late and allowing them to propagate
llvm-svn: 21343
2005-04-19 03:34:58 +00:00
Chris Lattner
d90d566dee Make this significantly harder
llvm-svn: 21342
2005-04-19 02:58:57 +00:00
Chris Lattner
17bd7c5a88 Add a real run line
llvm-svn: 21341
2005-04-19 02:53:26 +00:00
Chris Lattner
c00f712fc0 fix this testcase
llvm-svn: 21340
2005-04-19 02:52:04 +00:00
Chris Lattner
2b76da7d1f new testcase
llvm-svn: 21339
2005-04-19 02:26:23 +00:00
Chris Lattner
f2fab50974 add a run line
llvm-svn: 21338
2005-04-19 01:37:24 +00:00
Chris Lattner
ed8335e35b Tell dj to run the tests in this directory
llvm-svn: 21337
2005-04-19 01:36:41 +00:00
Chris Lattner
3ff0e11294 implementing shifting of literal integers
llvm-svn: 21336
2005-04-19 01:17:35 +00:00
Chris Lattner
101fc501d0 Add initial lexer and parser support for shifting values. Every use of this
will lead to it being rejected though.

llvm-svn: 21335
2005-04-19 01:11:03 +00:00
Nate Begeman
2331c061ee Next round of PPC CR optimizations. For the following code:
int %bar(float %a, float %b, float %c, float %d) {
entry:
    %tmp.1 = setlt float %a, %d
    %tmp.2 = setlt float %b, %d
    %or = or bool %tmp.1, %tmp.2
    %tmp.3 = setgt float %c, %d
    %tmp.4 = or bool %or, %tmp.3
    %tmp.5 = and bool %tmp.4, true
    %retval = cast bool %tmp.5 to int
    ret int %retval
}

We now emit:

_bar:
.LBB_bar_0:     ; entry
        fcmpu cr0, f1, f4
        fcmpu cr1, f2, f4
        cror 0, 0, 4
        fcmpu cr1, f3, f4
        cror 28, 0, 5
        mfcr r2
        rlwinm r3, r2, 29, 31, 31
        blr

Instead of:

_bar:
.LBB_bar_0:     ; entry
        fcmpu cr7, f1, f4
        mfcr r2
        rlwinm r2, r2, 29, 31, 31
        fcmpu cr7, f2, f4
        mfcr r3
        rlwinm r3, r3, 29, 31, 31
        or r2, r2, r3
        fcmpu cr7, f3, f4
        mfcr r3
        rlwinm r3, r3, 30, 31, 31
        or r3, r2, r3
        blr

llvm-svn: 21321
2005-04-18 07:48:09 +00:00
Chris Lattner
ee84413730 silence a bogus warning
llvm-svn: 21320
2005-04-18 05:26:21 +00:00
Chris Lattner
b61ecb5875 Fold setcc of MVT::i1 operands into logical operations
llvm-svn: 21319
2005-04-18 04:48:12 +00:00
Chris Lattner
6d40fd01fe Another minor simplification: handle setcc (zero_extend x), c -> setcc(x, c')
llvm-svn: 21318
2005-04-18 04:30:45 +00:00
Chris Lattner
868d473009 Another simple xform
llvm-svn: 21317
2005-04-18 04:11:19 +00:00
Chris Lattner
bd22d83d15 Fold:
// (X != 0) | (Y != 0) -> (X|Y != 0)
        // (X == 0) & (Y == 0) -> (X|Y == 0)

Compiling this:

int %bar(int %a, int %b) {
        entry:
        %tmp.1 = setne int %a, 0
        %tmp.2 = setne int %b, 0
        %tmp.3 = or bool %tmp.1, %tmp.2
        %retval = cast bool %tmp.3 to int
        ret int %retval
        }

to this:

_bar:
        or r2, r3, r4
        addic r3, r2, -1
        subfe r3, r3, r2
        blr

instead of:

_bar:
        addic r2, r3, -1
        subfe r2, r2, r3
        addic r3, r4, -1
        subfe r3, r3, r4
        or r3, r2, r3
        blr

llvm-svn: 21316
2005-04-18 03:59:53 +00:00
Chris Lattner
d929f8bcd3 Make the AND elimination operation recursive and significantly more powerful,
eliminating an and for Nate's testcase:

int %bar(int %a, int %b) {
        entry:
        %tmp.1 = setne int %a, 0
        %tmp.2 = setne int %b, 0
        %tmp.3 = or bool %tmp.1, %tmp.2
        %retval = cast bool %tmp.3 to int
        ret int %retval
        }

generating:

_bar:
        addic r2, r3, -1
        subfe r2, r2, r3
        addic r3, r4, -1
        subfe r3, r3, r4
        or r3, r2, r3
        blr

instead of:

_bar:
        addic r2, r3, -1
        subfe r2, r2, r3
        addic r3, r4, -1
        subfe r3, r3, r4
        or r2, r2, r3
        rlwinm r3, r2, 0, 31, 31
        blr

llvm-svn: 21315
2005-04-18 03:48:41 +00:00
Nate Begeman
602a45f415 Change codegen for setcc to read the bit directly out of the condition
register.  Added support in the .td file for the g5-specific variant
  of cr -> gpr moves that executes faster, but we currently don't
  generate it.

llvm-svn: 21314
2005-04-18 02:43:24 +00:00
Chris Lattner
ed5189da51 Add support for targets that require stubs for external functions.
llvm-svn: 21313
2005-04-18 01:44:27 +00:00
Chris Lattner
f281f791b5 Handle ExternalSymbol operands in the PPC JIT
llvm-svn: 21312
2005-04-18 00:46:10 +00:00
Nate Begeman
f24225d4d7 Update dejagnu tests to use the new pattern isel flag
llvm-svn: 21311
2005-04-16 04:25:48 +00:00
Jeff Cohen
df4f480498 Add CondPropagate.cpp to VC++ Transforms project
llvm-svn: 21310
2005-04-16 02:51:44 +00:00
Nate Begeman
779c5cbb44 Make pattern isel default for ppc
Add new ppc beta option related to using condition registers
Make pattern isel control flag (-enable-pattern-isel) global and tristate
  0 == off
  1 == on
  2 == target default

llvm-svn: 21309
2005-04-15 22:12:16 +00:00
Chris Lattner
e0a9d042e2 new pass
llvm-svn: 21307
2005-04-15 21:13:16 +00:00
Chris Lattner
16a50fd0a0 a new simple pass, which will be extended to be more useful in the future.
This pass forward branches through conditions when it can show that the
conditions is either always true or false for a predecessor.  This currently
only handles the most simple cases of this, but is successful at threading
across 2489 branches and 65 switch instructions in 176.gcc, which isn't bad.

llvm-svn: 21306
2005-04-15 19:28:32 +00:00
Chris Lattner
d041242256 add a new prototype
llvm-svn: 21305
2005-04-15 19:24:49 +00:00
Chris Lattner
8579c2c474 new testcase
llvm-svn: 21304
2005-04-15 19:24:36 +00:00
Andrew Lenharth
00ce283b3f fix calls
llvm-svn: 21303
2005-04-14 17:34:20 +00:00
Andrew Lenharth
7ae3aba5aa a 21264 fix, and fix the operator precidence on an and -> zap check (should fix hundreds of test cases
llvm-svn: 21302
2005-04-14 16:24:00 +00:00
Andrew Lenharth
10b7bceb8e added a random and mask test
llvm-svn: 21301
2005-04-14 16:17:49 +00:00
Duraid Madina
0a7c2b9078 print negative 64 bit immediates as negative numbers, makes things a little
easier on the eyes, not that numbers like 18446744073709541376 are bad or
anything

llvm-svn: 21300
2005-04-14 10:08:01 +00:00
Duraid Madina
dfbbcc098b oops, this stopped us turning movl r4=0xFFFFFFFF;; and rX, r4 into zxt4
llvm-svn: 21299
2005-04-14 10:06:35 +00:00
Nate Begeman
53d3eccbe2 Implement multi-way branches through logical ops on condition registers.
This can generate considerably shorter code, reducing the size of crafty
by almost 1%.  Also fix the printing of mcrf.  The code is currently
disabled until it gets a bit more testing, but should work as-is.

llvm-svn: 21298
2005-04-14 09:45:08 +00:00
Nate Begeman
80c095f422 Add a couple missing transforms in getSetCC that were triggering assertions
in the PPC Pattern ISel

llvm-svn: 21297
2005-04-14 08:56:52 +00:00
Duraid Madina
f6b666fb06 we have zextloads, not sextloads!
llvm-svn: 21296
2005-04-14 08:37:32 +00:00
Nate Begeman
65a82c562e Add the necessary support to codegen condition register logical ops with
register allocated condition registers.  Make sure that the printed
  output is gas compatible.

llvm-svn: 21295
2005-04-14 03:20:38 +00:00
Nate Begeman
be21011911 Start allocating condition registers. Almost all explicit uses of CR0 are
now gone.  Next step is to get rid of the remaining ones and then start
allocating bools to CRs where appropriate.

llvm-svn: 21294
2005-04-13 23:15:44 +00:00
Nate Begeman
dd1bb81d04 Implement the fold shift X, zext(Y) -> shift X, Y at the target level,
where it is safe to do so.

llvm-svn: 21293
2005-04-13 22:14:14 +00:00
Nate Begeman
04ae873648 Add CodeGen tests for the recent SelectionDAG transforms
llvm-svn: 21292
2005-04-13 21:45:13 +00:00
Nate Begeman
4ddd81657b Disbale the broken fold of shift + sz[ext] for now
Move the transform for select (a < 0) ? b : 0 into the dag from ppc isel
Enable the dag to fold and (setcc, 1) -> setcc for targets where setcc
  always produces zero or one.

llvm-svn: 21291
2005-04-13 21:23:31 +00:00
Chris Lattner
56d177a344 fix an infinite loop
llvm-svn: 21289
2005-04-13 20:06:29 +00:00
Chris Lattner
e3d17d8225 fix some serious miscompiles on ia64, alpha, and ppc
llvm-svn: 21288
2005-04-13 19:53:40 +00:00
Chris Lattner
8c3d409dc7 avoid work when possible, perhaps fix the problem nate and andrew are seeing
with != 0 comparisons vanishing.

llvm-svn: 21287
2005-04-13 19:41:05 +00:00
Andrew Lenharth
93341a0f82 WOW, function calls still seem to work after this.
llvm-svn: 21286
2005-04-13 17:17:28 +00:00
Andrew Lenharth
c3621316ee prepare for func call optimization
llvm-svn: 21285
2005-04-13 16:19:50 +00:00
Andrew Lenharth
c2ff402c84 regression case for faster call sequence
llvm-svn: 21284
2005-04-13 16:16:01 +00:00
Andrew Lenharth
714dd6a0ec check that casts still use zap
llvm-svn: 21283
2005-04-13 13:00:16 +00:00
Duraid Madina
2f2312575b * add the shladd instruction
* fold left shifts of 1, 2, 3 or 4 bits into adds

  This doesn't save much now, but should get a serious workout once
  multiplies by constants get converted to shift/add/sub sequences.
  Hold on! :)

llvm-svn: 21282
2005-04-13 06:12:04 +00:00
Andrew Lenharth
c7287c8eda add matches for SxADDL and company, as well as simplify the SxADDQ code
llvm-svn: 21281
2005-04-13 05:19:55 +00:00
Chris Lattner
e69ad5fd12 Implement expansion of unsigned i64 -> FP.
Note that this probably only works for little endian targets, but is enough
to get siod working :)

llvm-svn: 21280
2005-04-13 05:09:42 +00:00
Duraid Madina
e7ef27bcfe * if ANDing with a constant of the form:
0x00000..00FFF..FF
      ^      ^
      ^      ^
    any number of
    0's followed by
    some number of
    1's

    then we use dep.z to just paste zeros over the input. For the special
    cases where this is zxt1/zxt2/zxt4, we use those instructions instead,
    because we're all about readability!!!
    that's what it's about!! readability!

  *twitch* ;D

llvm-svn: 21279
2005-04-13 04:50:54 +00:00
Andrew Lenharth
5cee4ef049 added s4addl matching test
llvm-svn: 21277
2005-04-13 04:41:06 +00:00
Andrew Lenharth
8eb82fb524 added all flavors of zap for anding
llvm-svn: 21276
2005-04-13 03:47:03 +00:00
Chris Lattner
0efd77eda7 Make expansion of uint->fp cast assert out instead of infinitely recurse.
llvm-svn: 21275
2005-04-13 03:42:14 +00:00
Chris Lattner
60c23bd169 Fix some mysteriously missing {}'s which cause the miscompilation of
Olden/mst, Ptrdist/bc, Obsequi, etc.

llvm-svn: 21274
2005-04-13 03:29:53 +00:00
Chris Lattner
b1f25ac188 add back the optimization that Nate added for shl X, (zext_inreg y)
llvm-svn: 21273
2005-04-13 02:58:13 +00:00
Chris Lattner
39844ac337 Oops, remove these too.
llvm-svn: 21272
2005-04-13 02:47:57 +00:00
Chris Lattner
e0efd1fa72 remove one more occurance of this that snuck in
llvm-svn: 21271
2005-04-13 02:46:17 +00:00
Chris Lattner
857624f47a Remove support for ZERO_EXTEND_INREG. This pessimizes code, genering stuff
like this:

        ldah $1,1($31)
        lda $1,-1($1)
        and $0,$1,$24

instead of this:

        zap $0,252,$24

To get this back, the selector should recognize the ISD::AND case where this
happens and emit the appropriate ZAP instruction.

llvm-svn: 21270
2005-04-13 02:43:40 +00:00
Chris Lattner
7f4c4179a6 Remove special handling of ZERO_EXTEND_INREG. This pessimizes code, causing
things like this:

       mov r9 = 65535;;
       and r8 = r8, r9;;

To be emitted instead of:

        zxt2 r8 = r8;;

To get this back, the selector for ISD::AND should recognize this case.

llvm-svn: 21269
2005-04-13 02:41:52 +00:00
Chris Lattner
83075510ee Elimate handling of ZERO_EXTEND_INREG. This causes the PPC backend to emit
andi instructions instead of rlwinm instructions for zero extend, but they
seem like they would take the same time.

llvm-svn: 21268
2005-04-13 02:40:26 +00:00
Chris Lattner
248fe6bda2 Z_E_I is gone
llvm-svn: 21267
2005-04-13 02:39:05 +00:00
Chris Lattner
0e852afb4c Instead of making ZERO_EXTEND_INREG nodes, use the helper method in
SelectionDAG to do the job with AND.  Don't legalize Z_E_I anymore as
it is gone

llvm-svn: 21266
2005-04-13 02:38:47 +00:00
Chris Lattner
2b4e3fca38 Remove all foldings of ZERO_EXTEND_INREG, moving them to work for AND nodes
instead.  OVerall, this increases the amount of folding we can do.

llvm-svn: 21265
2005-04-13 02:38:18 +00:00
Chris Lattner
50b63f7015 Add a new helper method which returns the and that is equivalent to what
ZERO_EXTEND_INREG was.

llvm-svn: 21264
2005-04-13 02:37:19 +00:00
Chris Lattner
71886d95d5 Remove the ZERO_EXTEND_INREG node which is redundant with AND
llvm-svn: 21263
2005-04-13 02:36:41 +00:00
Nate Begeman
ca916ba4a0 Fold shift x, [sz]ext(y) -> shift x, y
llvm-svn: 21262
2005-04-12 23:32:28 +00:00
Nate Begeman
af1c0f7a00 Fold shift by size larger than type size to undef
Make llvm undef values generate ISD::UNDEF nodes

llvm-svn: 21261
2005-04-12 23:12:17 +00:00
Nate Begeman
818eb6ddd2 Implement setcc op, -1 sequences
Remove dead setcc op, 0 sequences
Coming later: generalization of op, imm

llvm-svn: 21260
2005-04-12 21:22:28 +00:00
Chris Lattner
0b73a6d8bc promote extload i1 -> extload i8
llvm-svn: 21258
2005-04-12 20:30:10 +00:00
Chris Lattner
9daef352e9 add an argument to allow avoiding deleting phi nodes.
llvm-svn: 21255
2005-04-12 18:52:14 +00:00
Chris Lattner
eb958b0e45 add an argument.
llvm-svn: 21254
2005-04-12 18:51:53 +00:00
Chris Lattner
95f16a3ac4 Get rid of this for_each loop
llvm-svn: 21253
2005-04-12 18:51:33 +00:00
Duraid Madina
fd469bddac * OK, after changing to use liveIn/liveOut instead of IDEFs,
to avoid redundant mov out3=r44 type instructions, we need to
tell the register allocator the truth about out? registers.

FIXME: unfortunately, since the list of allocatable registers is immutable,
we can't simply 'delete r127' from the allocation order, say, if 'out0' is
used. The only correct thing we can do is have a linear order of regs:

out7, out6 ... out2, out1, out0, r32, r33, r34 ... r126, r127

and slide a 'window' of 96 registers along this line, depending on how many
of the out? regs a function actually uses. The only downside of this is
that the out? registers will be allocated _first_, which makes the
resulting assembly ugly. :( Note this in the README. Hope this gets fixed
soon. :) (note the 3rd person speech there)

llvm-svn: 21252
2005-04-12 18:42:59 +00:00
Andrew Lenharth
740f93ca10 Get rid of idefs for arguments (oops)
llvm-svn: 21251
2005-04-12 17:47:57 +00:00
Andrew Lenharth
10c6eb4be2 Get rid of idefs for arguments
llvm-svn: 21250
2005-04-12 17:35:16 +00:00
Chris Lattner
14f72885dd Put out* into the allocation order, allowing the register allocator to
coallesce moves into outgoing args.

llvm-svn: 21249
2005-04-12 15:12:51 +00:00
Chris Lattner
6b91767b77 Make sure to realize that calls use their argument regs
llvm-svn: 21248
2005-04-12 15:12:19 +00:00
Duraid Madina
b6dfb227b7 stop emitting IDEFs for args - change to using liveIn/liveOut
llvm-svn: 21247
2005-04-12 14:54:44 +00:00
Nate Begeman
f67f3bf627 Initial support for allocation condition registers
llvm-svn: 21246
2005-04-12 07:04:16 +00:00
Chris Lattner
6febe5ef40 Fix a crash analyzing MultiSource/Benchmarks/MallocBench/gs
llvm-svn: 21245
2005-04-12 03:59:27 +00:00
Chris Lattner
af5b25f139 Remove some redundant checks, add a couple of new ones. This allows us to
compile this:

int foo (unsigned long a, unsigned long long g) {
  return a >= g;
}

To:

foo:
        movl 8(%esp), %eax
        cmpl %eax, 4(%esp)
        setae %al
        cmpl $0, 12(%esp)
        sete %cl
        andb %al, %cl
        movzbl %cl, %eax
        ret

instead of:

foo:
        movl 8(%esp), %eax
        cmpl %eax, 4(%esp)
        setae %al
        movzbw %al, %cx
        movl 12(%esp), %edx
        cmpl $0, %edx
        sete %al
        movzbw %al, %ax
        cmpl $0, %edx
        cmove %cx, %ax
        movzbl %al, %eax
        ret

llvm-svn: 21244
2005-04-12 02:54:39 +00:00
Chris Lattner
aedcabe8db Emit comparisons against the sign bit better. Codegen this:
bool %test1(long %X) {
        %A = setlt long %X, 0
        ret bool %A
}

like this:

test1:
        cmpl $0, 8(%esp)
        setl %al
        movzbl %al, %eax
        ret

instead of:

test1:
        movl 8(%esp), %ecx
        cmpl $0, %ecx
        setl %al
        movzbw %al, %ax
        cmpl $0, 4(%esp)
        setb %dl
        movzbw %dl, %dx
        cmpl $0, %ecx
        cmove %dx, %ax
        movzbl %al, %eax
        ret

llvm-svn: 21243
2005-04-12 02:19:10 +00:00
Chris Lattner
71ff44e46c Emit long comparison against -1 better. Instead of this (x86):
test2:
        movl 8(%esp), %eax
        notl %eax
        movl 4(%esp), %ecx
        notl %ecx
        orl %eax, %ecx
        cmpl $0, %ecx
        sete %al
        movzbl %al, %eax
        ret

or this (PPC):

_test2:
        nor r2, r4, r4
        nor r3, r3, r3
        or r2, r2, r3
        cntlzw r2, r2
        srwi r3, r2, 5
        blr

Emit this:

test2:
        movl 8(%esp), %eax
        andl 4(%esp), %eax
        cmpl $-1, %eax
        sete %al
        movzbl %al, %eax
        ret

or this:

_test2:
.LBB_test2_0:   ;
        and r2, r4, r3
        cmpwi cr0, r2, -1
        li r3, 1
        li r2, 0
        beq .LBB_test2_2        ;
.LBB_test2_1:   ;
        or r3, r2, r2
.LBB_test2_2:   ;
        blr

it seems like the PPC isel could do better for R32 == -1 case.

llvm-svn: 21242
2005-04-12 01:46:05 +00:00
Chris Lattner
87bd69884a canonicalize x <u 1 -> x == 0. On this testcase:
unsigned long long g;
unsigned long foo (unsigned long a) {
  return (a >= g) ? 1 : 0;
}

It changes the ppc code from:

_foo:
.LBB_foo_0:     ; entry
        mflr r11
        stw r11, 8(r1)
        bl "L00000$pb"
"L00000$pb":
        mflr r2
        addis r2, r2, ha16(L_g$non_lazy_ptr-"L00000$pb")
        lwz r2, lo16(L_g$non_lazy_ptr-"L00000$pb")(r2)
        lwz r4, 0(r2)
        lwz r2, 4(r2)
        cmplw cr0, r3, r2
        li r2, 1
        li r3, 0
        bge .LBB_foo_2  ; entry
.LBB_foo_1:     ; entry
        or r2, r3, r3
.LBB_foo_2:     ; entry
        cmplwi cr0, r4, 1
        li r3, 1
        li r5, 0
        blt .LBB_foo_4  ; entry
.LBB_foo_3:     ; entry
        or r3, r5, r5
.LBB_foo_4:     ; entry
        cmpwi cr0, r4, 0
        beq .LBB_foo_6  ; entry
.LBB_foo_5:     ; entry
        or r2, r3, r3
.LBB_foo_6:     ; entry
        rlwinm r3, r2, 0, 31, 31
        lwz r11, 8(r1)
        mtlr r11
        blr


to:

_foo:
.LBB_foo_0:     ; entry
        mflr r11
        stw r11, 8(r1)
        bl "L00000$pb"
"L00000$pb":
        mflr r2
        addis r2, r2, ha16(L_g$non_lazy_ptr-"L00000$pb")
        lwz r2, lo16(L_g$non_lazy_ptr-"L00000$pb")(r2)
        lwz r4, 0(r2)
        lwz r2, 4(r2)
        cmplw cr0, r3, r2
        li r2, 1
        li r3, 0
        bge .LBB_foo_2  ; entry
.LBB_foo_1:     ; entry
        or r2, r3, r3
.LBB_foo_2:     ; entry
        cntlzw r3, r4
        srwi r3, r3, 5
        cmpwi cr0, r4, 0
        beq .LBB_foo_4  ; entry
.LBB_foo_3:     ; entry
        or r2, r3, r3
.LBB_foo_4:     ; entry
        rlwinm r3, r2, 0, 31, 31
        lwz r11, 8(r1)
        mtlr r11
        blr

llvm-svn: 21241
2005-04-12 00:28:49 +00:00
Nate Begeman
79a3bea4ca Implement bitfield clears
Implement divide by negative power of two

llvm-svn: 21240
2005-04-12 00:10:02 +00:00
Nate Begeman
08698cf644 Update PPC readme. Remove things that are done or aren't ppc specific
llvm-svn: 21232
2005-04-11 20:48:57 +00:00
Chris Lattner
8ffd004920 Teach the dag mechanism that this:
long long test2(unsigned A, unsigned B) {
        return ((unsigned long long)A << 32) + B;
}

is equivalent to this:

long long test1(unsigned A, unsigned B) {
        return ((unsigned long long)A << 32) | B;
}

Now they are both codegen'd to this on ppc:

_test2:
        blr

or this on x86:

test2:
        movl 4(%esp), %edx
        movl 8(%esp), %eax
        ret

llvm-svn: 21231
2005-04-11 20:29:59 +00:00
Chris Lattner
edd197062f Fix expansion of shifts by exactly NVT bits on arch's (like X86) that have
masking shifts.

This fixes the miscompilation of this:

long long test1(unsigned A, unsigned B) {
        return ((unsigned long long)A << 32) | B;
}

into this:

test1:
        movl 4(%esp), %edx
        movl %edx, %eax
        orl 8(%esp), %eax
        ret

allowing us to generate this instead:

test1:
        movl 4(%esp), %edx
        movl 8(%esp), %eax
        ret

llvm-svn: 21230
2005-04-11 20:08:52 +00:00
Chris Lattner
607bd26b38 IA64 supports this operation.
llvm-svn: 21228
2005-04-11 18:55:36 +00:00
Chris Lattner
67291ea580 ORo sets CR0
llvm-svn: 21227
2005-04-11 15:03:48 +00:00
Chris Lattner
f29cc88210 Revert the previous patch, which I didn't mean to check in.
llvm-svn: 21226
2005-04-11 15:03:41 +00:00
Chris Lattner
d3dc31009f Fix a minor bug (ORo didn't mark that it set CR0).
Refactor how . instructions are handled.  In particular, instead of passing
the RC flag all the way up the inheritance hierarchy, just make a new tblgen
class 'DOT' which can be added to an instruction definition.

For example, instead of this:

-def AND  : XForm_6<31,  28, 0, 0, 0, (ops GPRC:$rA, GPRC:$rS, GPRC:$rB),
-let Defs = [CR0] in
-def ANDo : XForm_6<31,  28, 1, 0, 0, (ops GPRC:$rA, GPRC:$rS, GPRC:$rB),
-                   "and. $rA, $rS, $rB">;

We now have this:

+def AND  : XForm_6<31,  28, 0, 0, (ops GPRC:$rA, GPRC:$rS, GPRC:$rB),
                    "and $rA, $rS, $rB">;

llvm-svn: 21225
2005-04-11 15:01:39 +00:00
Duraid Madina
8de7ac092d hmm, should probably change addImm() to take 64-bit arguments one day anyway.
llvm-svn: 21224
2005-04-11 07:16:39 +00:00
Duraid Madina
247def9c2b rename addU64Imm() to addImm64()
llvm-svn: 21223
2005-04-11 07:14:41 +00:00
Nate Begeman
bebefac791 Add recording variants of ISD::AND and ISD::OR. This kills almost 1000
(1.5%) instructions in 186.crafty

llvm-svn: 21222
2005-04-11 06:34:10 +00:00
Duraid Madina
fb43ef78c5 assorted fixes:
* clean up immediates (we use 14, 22 and 64 bit immediates now. sane.)
  * fold r0/f0/f1 registers into comparisons against 0/0.0/1.0
  * fix nasty thinko - didn't use two-address form of conditional add
    for extending bools to integers, so occasionally there would be
    garbage in the result. it's amazing how often zeros are just
    sitting around in registers ;) - this should fix a bunch of tests.

llvm-svn: 21221
2005-04-11 05:55:56 +00:00
Reid Spencer
7a763bfbc5 Ensure that the arguments passed to sys::Program::ExecuteAndWait include
the program name as the first argument. Thanks go to Markus Oberhumer for
noticing this problem.

llvm-svn: 21220
2005-04-11 05:48:04 +00:00
Jeff Cohen
a3b1458175 Eliminate tabs
llvm-svn: 21216
2005-04-11 03:44:22 +00:00
Jeff Cohen
ecbfa98ce7 Eliminate major source of VC++ "possible loss of data" warnings.
llvm-svn: 21215
2005-04-11 03:38:28 +00:00
Nate Begeman
add0c63ad2 Fix libcall code to not pass a NULL Chain to LowerCallTo
Fix libcall code to not crash or assert looking for an ADJCALLSTACKUP node
  when it is known that there is no ADJCALLSTACKDOWN to match.
Expand i64 multiply when ISD::MULHU is legal for the target.

llvm-svn: 21214
2005-04-11 03:01:51 +00:00
Chris Lattner
e2427c9afc Don't bother sign/zext_inreg'ing the result of an and operation if we know
the result does change as a result of the extend.

This improves codegen for Alpha on this testcase:

int %a(ushort* %i) {
        %tmp.1 = load ushort* %i
        %tmp.2 = cast ushort %tmp.1 to int
        %tmp.4 = and int %tmp.2, 1
        ret int %tmp.4
}

Generating:

a:
        ldgp $29, 0($27)
        ldwu $0,0($16)
        and $0,1,$0
        ret $31,($26),1

instead of:

a:
        ldgp $29, 0($27)
        ldwu $0,0($16)
        and $0,1,$0
        addl $0,0,$0
        ret $31,($26),1

btw, alpha really should switch to livein/outs for args :)

llvm-svn: 21213
2005-04-10 23:37:16 +00:00
Chris Lattner
a3b7ef05f4 Teach legalize to deal with targets that don't support some SEXTLOAD/ZEXTLOADs
llvm-svn: 21212
2005-04-10 22:54:25 +00:00
Chris Lattner
672fe7267b The first argument to ExecuteAndWait should be the program name, but pointed
out by Markus F.X.J. Oberhumer.

llvm-svn: 21211
2005-04-10 20:59:38 +00:00
Chris Lattner
751cc5f49f fix this testcase so the regex doesn't match the function name
llvm-svn: 21210
2005-04-10 20:45:35 +00:00
Chris Lattner
391a351ede don't zextload fp values!
llvm-svn: 21209
2005-04-10 17:40:35 +00:00
Duraid Madina
7b0287b78d * store immediate values as int64_t, not int. come on, we should be happy
when there are immediates, let's not worry about the memory overhead of
this :)

* add addU64Imm(uint64_t val) to machineinstrbuilder

(seriously: this seems required to support 64-bit immediates cleanly. if it
_really_ gets on your nerves, feel free to pull it out ;) )

coming up next week: "all your floating point constants are belong to us"

llvm-svn: 21208
2005-04-10 09:18:55 +00:00
Nate Begeman
492370311d Fix another fixme: factor out the constant fp generation code.
llvm-svn: 21207
2005-04-10 06:06:10 +00:00
Nate Begeman
941a01802f Fix 64 bit argument loading that straddles the args in regs / args on stack
boundary.

llvm-svn: 21206
2005-04-10 05:53:14 +00:00
Chris Lattner
c53cd501b5 Until we have a dag combiner, promote using zextload's instead of extloads.
This gives the optimizer a bit of information about the top-part of the
value.

llvm-svn: 21205
2005-04-10 04:33:47 +00:00
Chris Lattner
f74c794ccf Fold zext_inreg(zextload), likewise for sext's
llvm-svn: 21204
2005-04-10 04:33:08 +00:00
Chris Lattner
f2bff92411 add a simple xform
llvm-svn: 21203
2005-04-10 04:04:49 +00:00
Nate Begeman
b076731713 Remove unnecessary Implicit Defs. Since r0 is not in allocation, we do not
have to inform the register allocator it might be stepped on.

llvm-svn: 21202
2005-04-10 03:59:42 +00:00
Chris Lattner
2de306ba83 make this harder
llvm-svn: 21201
2005-04-10 03:18:18 +00:00
Chris Lattner
d65632a9ca oops add ~
llvm-svn: 21200
2005-04-10 03:07:25 +00:00
Chris Lattner
38b1ae75fc new testcase for previously unsupported unary complex operators
llvm-svn: 21199
2005-04-10 03:06:27 +00:00
Nate Begeman
6566e8ac06 Make sure that BRCOND branches can be converted into long branches too.
llvm-svn: 21198
2005-04-10 01:48:29 +00:00
Nate Begeman
3345eadc37 Don't hand ISD::CALL nodes off to SelectExprFP. This fixes siod.
llvm-svn: 21197
2005-04-10 01:14:13 +00:00
Chris Lattner
d8cbfe82ba Fix a thinko. If the operand is promoted, pass the promoted value into
the new zero extend, not the original operand.  This fixes cast bool -> long
on ppc.

Add an unrelated fixme

llvm-svn: 21196
2005-04-10 01:13:15 +00:00
Chris Lattner
9ff4b4190f rename getPPCOpcodeForSetCCNumber -> getPPCOpcodeForSetCCOpode to be more
correct.  Remove the EmitComparison retvalue, as it is always the first arg.

Fix a place where we incorrectly passed in the setcc opcode instead of the
setcc number, causing us to miscompile crafty.  Crafty now works!

llvm-svn: 21195
2005-04-10 01:03:31 +00:00
Nate Begeman
2121a54868 fix ISD::BRCONDTWOWAY codegen to not deference the end() iterator
llvm-svn: 21193
2005-04-09 23:35:05 +00:00
Chris Lattner
228fed92e6 Fix CodeGen/Generic/2005-05-09-GlobalInPHI.ll, which was reduced from 254.gap.
This caused the "use before a def" assertion on some programs.

With this patch, 254.gap now passes with the PPC backend.

llvm-svn: 21191
2005-04-09 22:05:17 +00:00
Chris Lattner
db32a632c9 new testcase that used to crash the ppc fe. It could effect any simpleisel
that is not careful, so I'm checking it into the generic tests.

llvm-svn: 21190
2005-04-09 22:03:10 +00:00
Chris Lattner
da504741da add a little peephole optimization. This allows us to codegen:
int a(short i) {
        return i & 1;
}

as

_a:
        andi. r3, r3, 1
        blr

instead of:

_a:
        rlwinm r2, r3, 0, 16, 31
        andi. r3, r2, 1
        blr

on ppc.  It should also help the other risc targets.

llvm-svn: 21189
2005-04-09 21:43:54 +00:00
Chris Lattner
e8e070dbfb do not set the root to null if an argument is dead
llvm-svn: 21188
2005-04-09 21:23:24 +00:00
Nate Begeman
8309a333dd Add rlwnm instruction for variable rotate
Generate rotate left/right immediate
Generate code for brcondtwoway
Use new livein/liveout functionality

llvm-svn: 21187
2005-04-09 20:09:12 +00:00
Chris Lattner
3a7f5768c5 Fix a crash on 173.applu by asking for a constant bigger than 32-bits.
llvm-svn: 21185
2005-04-09 19:47:21 +00:00
Chris Lattner
a55a5f2580 Switch this instruction selector over to using liveins and liveouts, eliminating
implicit defs on entry to the function.  yaay :)

llvm-svn: 21184
2005-04-09 16:32:30 +00:00
Chris Lattner
1a44855f8f there is no need to remove this instruction, linscan does it already as it
removes noop moves.

llvm-svn: 21183
2005-04-09 16:24:20 +00:00
Chris Lattner
0b1681bce1 Adjust live intervals to support a livein set
llvm-svn: 21182
2005-04-09 16:17:50 +00:00
Chris Lattner
b59006c4a1 Use live out sets for return values instead of imp_defs, which is cleaner and faster.
llvm-svn: 21181
2005-04-09 15:23:56 +00:00
Chris Lattner
4c6ab01a20 Consider the livein/out set for a function, allowing targets to not have to
use ugly imp_def/imp_uses for arguments and return values.

llvm-svn: 21180
2005-04-09 15:23:25 +00:00
Chris Lattner
576db37185 add routines to track the livein/out set for a function
llvm-svn: 21179
2005-04-09 15:22:53 +00:00
Duraid Madina
46aa06cfed ok, the "ia64 has a boatload of registers" joke stopped being funny today ;)
* fix overallocation of integer (stacked) registers: we can't allocate
  registers for local use if they are required as output registers

this fixes 'toast' in the test suite, and all sorts of larger programs
like bzip2 etc.

llvm-svn: 21178
2005-04-09 11:53:00 +00:00
Nate Begeman
2f64122319 Optimize FSEL a bit for fneg arguments. This fixes the recently added test
case so that we emit

_test_fneg_sel:
.LBB_test_fneg_sel_0:   ;
        fsel f1, f1, f3, f2
        blr

instead of:

_test_fneg_sel:
.LBB_test_fneg_sel_0:   ;
        fneg f0, f1
        fneg f0, f0
        fsel f1, f0, f3, f2
        blr

llvm-svn: 21177
2005-04-09 09:33:07 +00:00
Nate Begeman
7d3e44fb12 Add a testcase to make sure that we don't emit two fneg instructions back
to back for certain fsel instructions.

llvm-svn: 21176
2005-04-09 09:30:09 +00:00
Nate Begeman
968e44a900 Add cases to cover the rest of the patterns we should be matching
llvm-svn: 21175
2005-04-09 08:29:59 +00:00
Chris Lattner
888c5fdcc2 Fix CodeGen/SparcV9/2005-05-09-GEP-Crash.ll a crash on some specfp program
lets hope this doesn't break other programs with induced entropy

llvm-svn: 21174
2005-04-09 06:27:14 +00:00
Chris Lattner
3aa6ec0dda New testcase that the sparc backend crashes on
llvm-svn: 21173
2005-04-09 06:26:27 +00:00
Chris Lattner
6a31b878f8 recognize some patterns as fabs operations, so that fabs at the source level
is deconstructed then reconstructed here.  This catches 19 fabs's in 177.mesa
9 in 168.wupwise, 5 in 171.swim, 3 in 172.mgrid, and 14 in 173.applu out of
specfp2000.

This allows the X86 code generator to make MUCH better code than before for
each of these and saves one instr on ppc.

This depends on the previous CFE patch to expose these correctly.

llvm-svn: 21171
2005-04-09 05:15:53 +00:00
Chris Lattner
d9748bcae5 make this test more interesting
llvm-svn: 21170
2005-04-09 04:55:14 +00:00
Chris Lattner
ec90861662 add a test for fnabs
llvm-svn: 21169
2005-04-09 04:03:16 +00:00
Chris Lattner
b9a11b8b7f add a partial test for the fma operations that ppc supports. I'm sure I'm
missing some and not all of these match yet, but I'm sure that Nate will
clean up my mess :)

llvm-svn: 21168
2005-04-09 04:01:32 +00:00
Chris Lattner
8a98c7f337 Emit BRCONDTWOWAY when possible.
llvm-svn: 21167
2005-04-09 03:30:29 +00:00
Chris Lattner
fd98678a8a Legalize BRCONDTWOWAY into a BRCOND/BR pair if a target doesn't support it.
llvm-svn: 21166
2005-04-09 03:30:19 +00:00
Chris Lattner
b0713c74a2 print and fold BRCONDTWOWAY correctly
llvm-svn: 21165
2005-04-09 03:27:28 +00:00
Chris Lattner
a3a135a9f7 This target does not support/want ISD::BRCONDTWOWAY
llvm-svn: 21164
2005-04-09 03:22:37 +00:00
Chris Lattner
4f77badaa3 This target does not yet support ISD::BRCONDTWOWAY
llvm-svn: 21163
2005-04-09 03:22:30 +00:00
Chris Lattner
4b1323e846 Add a new node
llvm-svn: 21162
2005-04-09 03:21:50 +00:00
Nate Begeman
e8ce0cda40 64b: Expand S/UREM
32b: No longer pattern match fneg(fsub(fmul)) as fnmsub
     Pattern match fsub a, mul(b, c) as fnmsub
     Pattern match fadd a, mul(b, c) as fmadd
Those changes speed up hydro2d by 2.5%, distray by 6%, and scimark by 8%

llvm-svn: 21161
2005-04-09 03:05:51 +00:00
Chris Lattner
0ea81f9db4 canonicalize a bunch of operations involving fneg
llvm-svn: 21160
2005-04-09 03:02:46 +00:00
Nate Begeman
f50b597f67 Fix 64b shifts
llvm-svn: 21159
2005-04-08 23:45:01 +00:00
Chris Lattner
61b6f04ae9 fix this method for 64-bit constants
llvm-svn: 21158
2005-04-08 21:31:29 +00:00
Nate Begeman
705d3c18e8 Match Mac OS X 64 bit calling conventions
llvm-svn: 21157
2005-04-08 21:26:05 +00:00
Andrew Lenharth
de5aed3f12 collect a few statistics, factor constants (constant loading and mult), fix logic operation pattern matchs, supress FP div when int dividing by a constant
llvm-svn: 21156
2005-04-08 17:28:49 +00:00
Andrew Lenharth
ce9e043c78 oops
llvm-svn: 21155
2005-04-08 16:55:15 +00:00
Andrew Lenharth
2e184e2522 added some tests to check stupid pattern matching mistakes
llvm-svn: 21154
2005-04-08 16:46:44 +00:00
Duraid Madina
41ff502549 fix bogus division-by-power-of-2 (was wrong for negative input, adds extr insn)
fix hack in division (clean up frcpa instruction)

llvm-svn: 21153
2005-04-08 10:01:48 +00:00
Chris Lattner
4236261930 Fix bug: InstCombine/2005-05-07-UDivSelectCrash.ll
llvm-svn: 21152
2005-04-08 04:03:26 +00:00
Chris Lattner
9e2b5fc65a new testcase that crashes the instcombiner.
llvm-svn: 21151
2005-04-08 03:58:21 +00:00
Nate Begeman
b1f66d1af2 Optimized code sequences for setcc reg, 0
Optimized code sequence for (a < 0) ? b : 0

llvm-svn: 21150
2005-04-07 20:30:01 +00:00
Andrew Lenharth
534eebb317 Alpha zero extends setcc results
llvm-svn: 21149
2005-04-07 20:11:32 +00:00
Chris Lattner
b32d9318d2 If a target zero or sign extends the result of its setcc, allow folding of
this into sign/zero extension instructions later.

On PPC, for example, this testcase:

%G = external global sbyte
implementation
void %test(int %X, int %Y) {
  %C = setlt int %X, %Y
  %D = cast bool %C to sbyte
  store sbyte %D, sbyte* %G
  ret void
}

Now codegens to:

        cmpw cr0, r3, r4
        li r3, 1
        li r4, 0
        blt .LBB_test_2 ;
.LBB_test_1:    ;
        or r3, r4, r4
.LBB_test_2:    ;
        addis r2, r2, ha16(L_G$non_lazy_ptr-"L00000$pb")
        lwz r2, lo16(L_G$non_lazy_ptr-"L00000$pb")(r2)
        stb r3, 0(r2)

instead of:

        cmpw cr0, r3, r4
        li r3, 1
        li r4, 0
        blt .LBB_test_2 ;
.LBB_test_1:    ;
        or r3, r4, r4
.LBB_test_2:    ;
***     rlwinm r3, r3, 0, 31, 31
        addis r2, r2, ha16(L_G$non_lazy_ptr-"L00000$pb")
        lwz r2, lo16(L_G$non_lazy_ptr-"L00000$pb")(r2)
        stb r3, 0(r2)

llvm-svn: 21148
2005-04-07 19:43:53 +00:00
Chris Lattner
532ac79122 PowerPC zero extends setcc results
llvm-svn: 21147
2005-04-07 19:41:49 +00:00
Chris Lattner
38fd97084b X86 zero extends setcc results
llvm-svn: 21146
2005-04-07 19:41:46 +00:00
Chris Lattner
693e797be9 Allow targets which produce setcc results in non-MVT::i1 registers to describe
what the contents of the top bits of these registers are, in the common cases
of targets that sign and zero extend the results.

llvm-svn: 21145
2005-04-07 19:41:18 +00:00
Chris Lattner
dfed7355c9 Remove somethign I had for testing
llvm-svn: 21144
2005-04-07 18:58:54 +00:00
Andrew Lenharth
9807ac5d3c fix a small optimization opertunity and make gcc happy
llvm-svn: 21143
2005-04-07 18:15:28 +00:00
Chris Lattner
6b03a0cba1 This patch does two things. First, it canonicalizes 'X >= C' -> 'X > C-1'
(likewise for <= >=u >=u).

Second, it implements a special case hack to turn 'X gtu SINTMAX' -> 'X lt 0'

On powerpc, for example, this changes this:

        lis r2, 32767
        ori r2, r2, 65535
        cmplw cr0, r3, r2
        bgt .LBB_test_2

into:

        cmpwi cr0, r3, 0
        blt .LBB_test_2

llvm-svn: 21142
2005-04-07 18:14:58 +00:00
Andrew Lenharth
31f5e2f73f match case change in codegen
llvm-svn: 21141
2005-04-07 17:47:00 +00:00
Andrew Lenharth
6b492bec30 fixup magic constant making code. tested by thousands of random divisions.... by 10000. ok, so random divisors would be good too, but this at least fixes some things
llvm-svn: 21140
2005-04-07 17:19:16 +00:00
Andrew Lenharth
d2da7177f2 lowercase instructions, makes diff happier
llvm-svn: 21139
2005-04-07 17:17:48 +00:00
Chris Lattner
4706046e68 Implement the following xforms:
(X-Y)-X --> -Y
A + (B - A) --> B
(B - A) + A --> B

llvm-svn: 21138
2005-04-07 17:14:51 +00:00
Chris Lattner
679c1119e8 new test
llvm-svn: 21137
2005-04-07 16:41:45 +00:00
Chris Lattner
c7f3c1a00e Implement InstCombine/add.ll:test28, transforming C1-(X+C2) --> (C1-C2)-X.
This occurs several dozen times in specint2k, particularly in crafty and gcc
apparently.

llvm-svn: 21136
2005-04-07 16:28:01 +00:00
Chris Lattner
dd83183c1e new testcase
llvm-svn: 21135
2005-04-07 16:24:59 +00:00
Chris Lattner
a9be4490d8 Transform X-(X+Y) == -Y and X-(Y+X) == -Y
llvm-svn: 21134
2005-04-07 16:15:25 +00:00
Andrew Lenharth
05e51d92e0 It wasn't happy about this either
llvm-svn: 21133
2005-04-07 14:18:13 +00:00
Andrew Lenharth
85f34a5682 Yea, it wasn't happy
llvm-svn: 21132
2005-04-07 13:55:53 +00:00
Duraid Madina
a7abda3989 teach asmprinter to print s8/s14 operands
llvm-svn: 21131
2005-04-07 12:34:36 +00:00
Duraid Madina
8419da8acf codegen immediate forms of add/sub/shift
llvm-svn: 21130
2005-04-07 12:33:38 +00:00
Duraid Madina
b484f7c55e add immediate forms of add, sub, shift
llvm-svn: 21129
2005-04-07 12:32:24 +00:00
Chris Lattner
7d13eae254 Fix a really scary bug that Nate found where we weren't deleting the right
elements auto of the autoCSE maps.

llvm-svn: 21128
2005-04-07 00:30:13 +00:00
Nate Begeman
d20628ff7d Pattern match bitfield insert, which helps shift long by immediate, among
other things.

llvm-svn: 21127
2005-04-06 23:51:40 +00:00
Nate Begeman
505f6b760d Fix some shift bugs
llvm-svn: 21126
2005-04-06 22:42:08 +00:00
Alkis Evlogimenos
7ca0947274 Make these 64 bit constants so that this compiles on x86-32 as well.
llvm-svn: 21125
2005-04-06 22:09:40 +00:00
Andrew Lenharth
3ea17c6cfe added sdiv by 2^k and works for neg divisors also
llvm-svn: 21124
2005-04-06 22:03:13 +00:00
Chris Lattner
747eee2707 Don't make this require loopsimplify. It works BETTER with loop simplify
but should not require it.

llvm-svn: 21123
2005-04-06 21:45:00 +00:00
Nate Begeman
b067492535 Teach ExpandShift how to handle shifts by a constant. This allows targets
like PowerPC to codegen long shifts in many fewer instructions.

llvm-svn: 21122
2005-04-06 21:13:14 +00:00
Andrew Lenharth
df3256aa7f fix copy/paste errors, and add imm support to SxADDQ and SxSUBQ
llvm-svn: 21121
2005-04-06 20:59:59 +00:00
Chris Lattner
bd32728a98 Fix SingleSource/Regression/C/2005-05-06-LongLongSignedShift.c, we were not
properly sign extending the top of the result of a 64-bit shift right by
a constant > 32.

llvm-svn: 21120
2005-04-06 20:59:35 +00:00
Andrew Lenharth
249bf7bee4 simplified
llvm-svn: 21119
2005-04-06 20:59:03 +00:00
Andrew Lenharth
99edcfe3f8 added first alpha codegen regression test
llvm-svn: 21117
2005-04-06 20:39:17 +00:00
Andrew Lenharth
1d4747c302 Added Nate's div by constant stuff, also scaled operations!
llvm-svn: 21116
2005-04-06 20:25:34 +00:00
Chris Lattner
70b8b96d6c Fix a namespace issue, reported by Vladimir Merzliakov!
llvm-svn: 21115
2005-04-06 19:45:39 +00:00
Duraid Madina
c36b6c3b1a steal sampo's div-by-constant-power-of-2 stuff
thanks sampo!!

llvm-svn: 21113
2005-04-06 09:55:17 +00:00
Duraid Madina
03c530786c add fms instruction
llvm-svn: 21112
2005-04-06 09:54:09 +00:00
Nate Begeman
39ef2f1d43 Fixed version of optimized integer divide is now fixed. Calculate the
quotient, not the remainder.  Also, make sure to remove the old div operand
from the ExprMap and let SelectExpr insert the new one.

llvm-svn: 21111
2005-04-06 06:44:57 +00:00
Duraid Madina
c0e9adf3cc lie a bit and say that r1/r12 (GP/SP) _aren't_ callee-save, as we take
care of this ourselves

llvm-svn: 21110
2005-04-06 06:18:36 +00:00
Duraid Madina
df0ecbd4cc make sure 'special' registers don't get allocated
llvm-svn: 21109
2005-04-06 06:17:54 +00:00
Chris Lattner
9953d17a44 document these nodes, as they are nonobvious
llvm-svn: 21108
2005-04-06 04:21:29 +00:00
Chris Lattner
4fbb4af5d1 Add (untested) support for MULHS and MULHU.
llvm-svn: 21107
2005-04-06 04:21:07 +00:00
Chris Lattner
c21db6b15c add signed versions of the extra precision multiplies
llvm-svn: 21106
2005-04-06 04:19:22 +00:00
Nate Begeman
dd397119b0 Turn off the div -> mul optimization until it works correctly 100% of the
time.

llvm-svn: 21105
2005-04-06 03:36:33 +00:00
Nate Begeman
4164c4baac Add support for MULHS and MULHU nodes
Have LegalizeDAG handle SREM and UREM for us
Codegen SDIV and UDIV by constant as a multiply by magic constant instead
of integer divide, which is very slow.

llvm-svn: 21104
2005-04-06 00:25:27 +00:00
Nate Begeman
20b7d2a36f Expand SREM and UREM for targets that claim not to have them, like PowerPC
llvm-svn: 21103
2005-04-06 00:23:54 +00:00
Nate Begeman
55e8625c69 Add MULHU and MULHS nodes for the high part of an (un)signed 32x32=64b
multiply.

llvm-svn: 21102
2005-04-05 22:36:56 +00:00
Andrew Lenharth
43f78bc2da added lowerargs support for varargs
llvm-svn: 21101
2005-04-05 20:51:46 +00:00
Nate Begeman
524417357c Behold, rlwinm with certain immediate arguments is printed as the much more
readable slwi or srwi (shift left/right word immediate).

llvm-svn: 21099
2005-04-05 18:19:50 +00:00
Nate Begeman
a188b698a2 Fix cut & paste errors (32->64), and codegen float->int more optimally.
llvm-svn: 21098
2005-04-05 17:32:30 +00:00
Tanya Lattner
8d64e9a90d Updated to use dep analyzer.
llvm-svn: 21097
2005-04-05 16:36:44 +00:00
Nate Begeman
9203e169a7 Remove 64 bit simple ISel, it never worked correctly
Add initial (buggy) implementation of 64 bit pattern ISel

llvm-svn: 21096
2005-04-05 08:51:15 +00:00
Nate Begeman
4bde071216 Back out the previous change to SelectBranchCC, since there are cases it
could miscompile.  A correct solution will be found in the near future.

llvm-svn: 21095
2005-04-05 04:32:16 +00:00
Nate Begeman
9049e4beec Rename canUseAsImmediateForOpcode to getImmediateForOpcode to better
indicate that it is not a boolean function.
Properly emit the pseudo instruction for conditional branch, so that we
  can fix up conditional branches whose displacements are too large.
Reserve the right amount of opcode space for said pseudo instructions.

llvm-svn: 21094
2005-04-05 04:22:58 +00:00
Chris Lattner
7e0a534cba do not crash when using -debug
llvm-svn: 21092
2005-04-05 01:12:03 +00:00
Nate Begeman
d6933f5078 Implement SDIV by power of 2 as srawi/addze rather than load imm, divw
llvm-svn: 21091
2005-04-05 00:15:08 +00:00
Nate Begeman
1d5d767a09 Pattern match fp mul-add, mul-sub, neg-mul-add, and neg-mul-sub
llvm-svn: 21090
2005-04-04 23:40:36 +00:00
Nate Begeman
d96350095c Add support for multiply-add, multiply-sub, and their negated versions
llvm-svn: 21089
2005-04-04 23:01:51 +00:00
Chris Lattner
b919b21777 do not dereference an extra layer of pointers to determine if an external
call can modify a memory location.  This fixes
test/Regression/Analysis/Andersens/modreftest.ll

llvm-svn: 21088
2005-04-04 22:23:21 +00:00
Chris Lattner
0933766e2b new testcase
llvm-svn: 21087
2005-04-04 22:22:30 +00:00
Nate Begeman
1194531057 Make sure that arg regs used by the call instruction are marked as such, so
that regalloc doesn't cleverly reuse early arg regs loading later arg regs.
This fixes almost all outstanding failures in the pattern isel.

llvm-svn: 21086
2005-04-04 22:17:48 +00:00
Nate Begeman
c7186025de Remove unnecessary register copy now that regalloc is fixed
llvm-svn: 21085
2005-04-04 21:48:13 +00:00
Chris Lattner
6a6056e93d Make sure to notice that explicit physregs are used in the function
llvm-svn: 21084
2005-04-04 21:35:34 +00:00
Nate Begeman
d753765460 i1 loads should also be from the low byte of the argument word.
llvm-svn: 21077
2005-04-04 09:09:00 +00:00
Nate Begeman
1ce4839890 Fix i64 return, fix CopyFromReg
llvm-svn: 21076
2005-04-04 06:52:38 +00:00
Duraid Madina
9935f44fb8 fix SREM/UREM, which gave incorrect results for x%y if x was zero. This is
an ugly hack, but it seems to work. I should fix this properly and add a test
as well.

fixes multisource/obsequi (maybe others)

llvm-svn: 21075
2005-04-04 05:05:52 +00:00
Duraid Madina
dbc810022b add implicit use op
llvm-svn: 21074
2005-04-04 04:50:57 +00:00
Nate Begeman
cc00a7c42d Handle expanding arguments to ISD::TRUNCATE. This happens on PowerPC when
you have something like i16 = truncate i64.  This fixes Regression/C/casts

llvm-svn: 21073
2005-04-04 00:57:08 +00:00
Chris Lattner
4784489de2 Fix sign_extend and zero_extend of promoted value types to expanded value
types.  This occurs when casting short to long on PPC for example.

llvm-svn: 21072
2005-04-03 23:41:52 +00:00
Nate Begeman
629cdaea39 Full varargs support. All of UnitTests now passes
llvm-svn: 21070
2005-04-03 23:11:17 +00:00
Nate Begeman
7a3e929efc Pass the correct value for the chain to the store
llvm-svn: 21066
2005-04-03 22:22:56 +00:00
Nate Begeman
f6dc43bd46 Fix SHL_PARTS
Start implementation of integer varargs

llvm-svn: 21065
2005-04-03 22:13:27 +00:00
Andrew Lenharth
79e727e8a7 is this simpler? I think it is simpler.
llvm-svn: 21064
2005-04-03 20:35:21 +00:00
Andrew Lenharth
7ce5740de9 fix 101 regressions
llvm-svn: 21063
2005-04-03 18:24:50 +00:00
Duraid Madina
2f472ecb11 a wise man once said:
"!!!!!!!! IF YOU CHANGE SPACES TO TABS, YOU WILL BE KILLED!!!!!!"

llvm-svn: 21062
2005-04-03 14:57:35 +00:00
Duraid Madina
6c9afaead4 .bss is no problem here.
llvm-svn: 21061
2005-04-03 14:52:01 +00:00
Nate Begeman
34cc5b329f Keeping up with the Joneses.
Implement not, nor, nand, and eqv

llvm-svn: 21060
2005-04-03 11:20:20 +00:00
Andrew Lenharth
46897ab49e Select optimization
llvm-svn: 21051
2005-04-02 22:32:39 +00:00
Andrew Lenharth
f029d795f0 Try several things. 1) drop /i from FP ops 2) factor out FP to Int moves and provide 21264 support for those 3) match not 4) match ornot andnot xornot
llvm-svn: 21046
2005-04-02 21:06:51 +00:00
Chris Lattner
d2df8ca403 fix some VC compilation problems, thanks to Jeff C for pointing this out!
llvm-svn: 21044
2005-04-02 20:17:09 +00:00
Chris Lattner
a7913e66e1 EquivClassGraphs is now in DataStructure.h
llvm-svn: 21042
2005-04-02 20:08:17 +00:00
Chris Lattner
745c960672 merge EquivClassGraphs.h into DataStructure.h with the other DSA pass definitions.
llvm-svn: 21041
2005-04-02 20:08:06 +00:00
Chris Lattner
526cc17b55 use a callee_iterator typedef.
llvm-svn: 21038
2005-04-02 20:02:41 +00:00
Chris Lattner
63e3a262d8 add and use a callee_iterator typedef
llvm-svn: 21037
2005-04-02 20:02:32 +00:00
Chris Lattner
990ed1d201 Change the ActualCallees callgraph from hash_multimap<Instruction,Function>
to std::set<std::pair<Inst,Func>> to avoid duplicate entries.

This speeds up the CompleteBU pass from 1.99s to .15s on povray and the
eqgraph passes from 1.5s to .16s on the same.

llvm-svn: 21031
2005-04-02 19:17:18 +00:00
Chris Lattner
637e42022f Change the ActualCallees callgraph from hash_multimap<Instruction,Function>
to std::set<std::pair<Inst,Func>> to avoid duplicate entries.

llvm-svn: 21030
2005-04-02 19:15:15 +00:00
Andrew Lenharth
e7ae400bc8 FNEG/FABS/UNDEF
llvm-svn: 21029
2005-04-02 19:11:07 +00:00
Andrew Lenharth
7ad3697e1e FNEG/FABS
llvm-svn: 21028
2005-04-02 19:04:58 +00:00
Chris Lattner
04e0515937 this has now been fixed
llvm-svn: 21026
2005-04-02 16:17:57 +00:00
Duraid Madina
50b339b7fa ia64 asmprinter fixes:
- turn off assembler's autoalignment
  - set FunctionAddrPrefix/Suffix so that .data8 entries pointing to
    functions have their value wrapped in @fptr(), so that a function
    descriptor will be materialized for that function.

llvm-svn: 21025
2005-04-02 12:30:47 +00:00
Duraid Madina
73a316d712 add support for prefix/suffix strings to go around GlobalValue(s)
(which may or be function pointers) in the asmprinter. For the moment,
this changes nothing, except the IA64 backend which can use this to write:

  data8.ua  @fptr(blah__blah__mangled_function_name)

  (by setting FunctionAddrPrefix/Suffix to "@fptr(" / ")")

llvm-svn: 21024
2005-04-02 12:21:51 +00:00
Duraid Madina
c935c833d1 support IDEF, fnegabs (thanks sampo)
llvm-svn: 21023
2005-04-02 10:33:53 +00:00
Duraid Madina
0ccac38ed3 add fnegabs op
llvm-svn: 21022
2005-04-02 10:06:27 +00:00
Nate Begeman
165cf4844e Set shift amount to Extend
Implement ISD::FABS and ISD::FNEG nodes
Implement SHL_PARTS, SRL_PARTS, and SRA_PARTS
Generate PowerPC 'fneg', 'fabs', and 'fnabs' instructions

llvm-svn: 21018
2005-04-02 05:59:34 +00:00
Chris Lattner
1d7052fad5 don't forget to use the right code generator :)
llvm-svn: 21017
2005-04-02 05:40:03 +00:00
Chris Lattner
b4e122c59f new testcase
llvm-svn: 21016
2005-04-02 05:35:00 +00:00
Chris Lattner
0e0b599d29 add support for FABS and FNEG
llvm-svn: 21015
2005-04-02 05:30:17 +00:00
Chris Lattner
0c14000760 transform fabs/fabsf calls into FABS nodes.
llvm-svn: 21014
2005-04-02 05:26:53 +00:00
Chris Lattner
a0c72cf289 Expand fabs into fneg
llvm-svn: 21013
2005-04-02 05:26:37 +00:00
Duraid Madina
0720dc14ed add support FNEG and FABS
llvm-svn: 21012
2005-04-02 05:18:38 +00:00
Chris Lattner
f68fd0b533 Turn -0.0 - X -> fneg
llvm-svn: 21011
2005-04-02 05:04:50 +00:00
Chris Lattner
0b7e4cd107 This target doesn't support fabs/fneg yet.
llvm-svn: 21010
2005-04-02 05:03:24 +00:00
Chris Lattner
13fe99c807 Several changes mixed up here. First when legalizing a DAG with pcmarker,
dont' regen the whole dag if unneccesary.  Second, fix and ugly bug with
the _PARTS nodes that caused legalize to produce multiples of them.
Finally, implement initial support for FABS and FNEG.  Currently FNEG is
the only one to be trusted though.

llvm-svn: 21009
2005-04-02 05:00:07 +00:00
Chris Lattner
c4a2046a88 print fneg/fabs
llvm-svn: 21008
2005-04-02 04:58:41 +00:00
Chris Lattner
b3183de8c6 Add two happy new nodes for FABS and FNEG
llvm-svn: 21007
2005-04-02 04:58:28 +00:00
Chris Lattner
2d451658a6 add an fabs instr
llvm-svn: 21006
2005-04-02 04:31:56 +00:00
Chris Lattner
a31d4c7548 Add support for 64-bit shifts.
llvm-svn: 21005
2005-04-02 04:01:14 +00:00
Chris Lattner
4157c417a1 fix some bugs in the implementation of SHL_PARTS and friends.
llvm-svn: 21004
2005-04-02 04:00:59 +00:00
Chris Lattner
6f28fd388a fix a comment
llvm-svn: 21003
2005-04-02 03:59:45 +00:00
Chris Lattner
2e5872c671 Turn expanded shift operations into (e.g.) SHL_PARTS if the target supports it.
llvm-svn: 21002
2005-04-02 03:38:53 +00:00
Chris Lattner
5b7bb56ef8 Print some new nodes
llvm-svn: 21001
2005-04-02 03:30:42 +00:00
Chris Lattner
dbd130cf46 add some new nodes.
llvm-svn: 21000
2005-04-02 03:30:33 +00:00
Chris Lattner
07f97d5f55 Fix a bug when inserting a libcall into a function with no other calls.
llvm-svn: 20999
2005-04-02 03:22:40 +00:00
Chris Lattner
07e3f7e1ff new generic testcsae
llvm-svn: 20996
2005-04-02 02:41:55 +00:00
Nate Begeman
cfc452d088 Fix i64 returns
Generate PowerPC 'subfic' instruction when appropriate

llvm-svn: 20995
2005-04-02 00:42:16 +00:00
Nate Begeman
69d39433c4 Fix a warning about an unhandled switch case
llvm-svn: 20994
2005-04-02 00:41:14 +00:00
John Criswell
9f680da784 For Sparc, this xfails. I don't think sparc has the C99 complex data
type support.

llvm-svn: 20993
2005-04-01 23:16:23 +00:00
Chris Lattner
f4b985d1f6 Add support for ISD::UNDEF to the X86 be
llvm-svn: 20990
2005-04-01 22:46:45 +00:00
Nate Begeman
cda9aa7fa9 Add ISD::UNDEF node
Teach the SelectionDAG code how to expand and promote it
Have PPC32 LowerCallTo generate ISD::UNDEF for int arg regs used up by fp
  arguments, but not shadowing their value.  This allows us to do the right
  thing with both fixed and vararg floating point arguments.

llvm-svn: 20988
2005-04-01 22:34:39 +00:00
Chris Lattner
5053ea85fc Fix another PATypeHolder error, contributed by Bill Wendling!
llvm-svn: 20983
2005-04-01 15:41:30 +00:00
Duraid Madina
617af97040 repair mindless SELECT waste.
llvm-svn: 20982
2005-04-01 10:35:00 +00:00
Nate Begeman
1c3aea6019 Fix Olden/bh, CR0 was being set in the wrong order
LowerCallTo and ISD::CALL are going to need to be modified, regs are being
set in the wrong order.

llvm-svn: 20981
2005-04-01 08:57:43 +00:00
Nate Begeman
c9e50238c5 Also apply Chris's fix to FP select and SETCC
llvm-svn: 20979
2005-04-01 07:21:30 +00:00
Chris Lattner
9122b4c9c0 new testcase
llvm-svn: 20978
2005-04-01 07:19:06 +00:00
Chris Lattner
ffc7f243fe Move the selection of the arms of the select operation up to the conditional
part to make sure we get the side effects and to avoid confusing the CFG.

llvm-svn: 20977
2005-04-01 07:10:02 +00:00
Chris Lattner
329c14a8bc print the machine CFG in the -print-machineinstrs dump
llvm-svn: 20976
2005-04-01 06:48:38 +00:00
Nate Begeman
2095f3b06b Fix stores to global addresses
Fix calls with no arguments

llvm-svn: 20975
2005-04-01 05:57:17 +00:00
Nate Begeman
839b34c367 Support indexed loads and stores. This drops Shootout/matrix time from
18.8 to 14.8 seconds.  The Pattern ISel is now often faster than the
Simple ISel, esp. on memory intensive code.

llvm-svn: 20973
2005-04-01 04:45:11 +00:00
Nate Begeman
f4d91610ff Implement FP_TO_SINT and FP_TO_UINT
llvm-svn: 20972
2005-04-01 02:59:27 +00:00
Nate Begeman
508aac2ca8 Add support for adding 0.0 and -0.0 to the constant pool, since we lie and
say that we support them, for the purposes of generating fsel instructions.

llvm-svn: 20970
2005-04-01 01:08:07 +00:00
Nate Begeman
4f3a9860d3 Factor out common code, support FP comparison in folded SetCC
llvm-svn: 20969
2005-04-01 00:32:34 +00:00
Nate Begeman
6215b35918 fsel generation for f32 and f64 select
generate compare immediate for integer compare with constant
fold setcc into branch
fold setcc into select

Code generation quality for Shootout is now on par with the Simple ISel

llvm-svn: 20968
2005-03-31 23:55:40 +00:00
Andrew Lenharth
3bf6f80588 make fp div trick dependend on flag
llvm-svn: 20967
2005-03-31 22:02:25 +00:00
Misha Brukman
9337e4c5ab Fix spelling of `corresponds'
llvm-svn: 20966
2005-03-31 21:30:35 +00:00
Andrew Lenharth
dec53920b4 PCMarker support for DAG and Alpha
llvm-svn: 20965
2005-03-31 21:24:06 +00:00
Duraid Madina
21ce5f7a66 Assorted fixes:
* Stop being pessimistic about output register allocation
  * Start to handle function descriptors: compute target GPs and so on
  when doing indirect calls etc. Not there yet, though. For the moment,
  we try to use _indirect_ branches wherever possible, to stress test
  function descriptors.
  * FP divide-by-zero should work now
  * add varargs (it doesn't work, though)

At this point, all of SingleSource passes (modulo C++ tests that are due
to issues with the CFE, see note in the README.) Much of MultiSource also
passes although there's still a ton of bugs around. Something for me to
work on tomorrow, then. :)

llvm-svn: 20960
2005-03-31 12:31:11 +00:00
Duraid Madina
ffb9d14bb3 * declare local common symbols as such (.lcomm, not merely .common)
* begin great adventure into correct function descriptor materialization

llvm-svn: 20956
2005-03-31 07:40:24 +00:00
Duraid Madina
8106f12d33 daintyness
llvm-svn: 20955
2005-03-31 07:36:43 +00:00
Duraid Madina
73c2777a0e add what we need to fudge a 'floating point conditional move', this is
used to get FP div-by-zero working properly (shunt the right answer
depending on how frcpa sets its predicate output)

llvm-svn: 20954
2005-03-31 07:32:32 +00:00
Nate Begeman
eddfff338a Pass the correct values to the chain argument for node construction during
LowerCallTo.
Handle ISD::ADD in SelectAddr, allowing us to have nonzero immediates for
loads and stores, amazing!

llvm-svn: 20946
2005-03-31 02:05:53 +00:00
Nate Begeman
9de7ddf7d5 Rewrite LowerCallTo and Select(ISD::CALL) to properly handle float varargs
Tell the SelectionDAG ISel to expand SEXTLOAD of i1 and i8, rather than
  complicate the code in ISD::SEXTLOAD to do it by hand
Combine the FP and Int ISD::LOAD codegen
Generate better code for constant pool loads

As a result, all of Shootout, and likely many other programs are now
working.

llvm-svn: 20945
2005-03-31 00:15:26 +00:00
Nate Begeman
4c0780cf42 Fix calls whose arguments fit entirely in registers to not break the Chain.
Implement SINT_TO_FP and UINT_TO_FP
Remove some dead code from the simple ISel

llvm-svn: 20944
2005-03-30 19:38:35 +00:00
Misha Brukman
9615809383 * Put command-line switches and function names in <tt>
* Add links to mailing lists and publications

llvm-svn: 20943
2005-03-30 19:14:24 +00:00
Andrew Lenharth
e3d9f8c4f9 yea, fine Duraid
llvm-svn: 20942
2005-03-30 18:22:52 +00:00
Duraid Madina
722d514025 Add section for Itanium
llvm-svn: 20941
2005-03-30 05:33:54 +00:00
Nate Begeman
a8114a0f48 Fix frame index code to generate legal PowerPC instructions. About half of
Shootout now works.

llvm-svn: 20940
2005-03-30 02:23:08 +00:00
Nate Begeman
5851a66128 Fix external symbol printing in the AsmPrinter. Tell the ISel that we
don't support things like memcpy directly.  This allows a handful of the
Shootout programs to work, yay!

llvm-svn: 20939
2005-03-30 01:45:43 +00:00
Misha Brukman
650d1742f7 * Add section for Alpha
* Remove extraneous subsections

llvm-svn: 20938
2005-03-30 01:14:38 +00:00
Chris Lattner
5ca31d9831 Instead of setting up the CFG edges at selectiondag construction time, set
them up after the code has been emitted.  This allows targets to select one
mbb as multiple mbb's as needed.

llvm-svn: 20937
2005-03-30 01:10:47 +00:00
Chris Lattner
472a265ef6 don't depend on the cfg being set up yet
llvm-svn: 20936
2005-03-30 01:10:00 +00:00
Nate Begeman
9c40e9c61f Fix BranchCC (it's still dumb), and implement FP select (also dumb)
llvm-svn: 20935
2005-03-29 22:48:55 +00:00
Nate Begeman
28145edd30 Implement integer select and i1 sign extend
llvm-svn: 20934
2005-03-29 22:24:51 +00:00
Nate Begeman
28c5ac9ff4 Implement SetCC, fix ZERO_EXTEND_INREG
llvm-svn: 20933
2005-03-29 21:54:38 +00:00
Chris Lattner
af4d93cd39 import all of the rest of the stubs that dsa uses for direct comparison
llvm-svn: 20932
2005-03-29 20:36:05 +00:00
Tanya Lattner
91964490e2 Compare dependence analysis with llvm instructions versus machine instrutions. the problem with using machine instructions and alias analysis is that aa does not handle tmp instructions.
llvm-svn: 20931
2005-03-29 20:35:10 +00:00
Tanya Lattner
6e19b21e30 Dependence analyzer that just determines dependences within a loop for loads and stores using alias analysis.
llvm-svn: 20930
2005-03-29 20:33:42 +00:00
Chris Lattner
4dba2ee974 learn about some more functions.
llvm-svn: 20929
2005-03-29 20:04:24 +00:00
Andrew Lenharth
93d008990e Fix up some types and constants
llvm-svn: 20928
2005-03-29 19:24:04 +00:00
Chris Lattner
2e1971c19d Fix a problem where we not marking incoming arguments to functions with
external linkage as incomplete.

llvm-svn: 20927
2005-03-29 19:16:59 +00:00
Chris Lattner
db45f7d763 Fix a bug that andrew noticed where we do not correctly sign/zero extend
returned integer values all of the way to 64-bits (we only did it to 32-bits
leaving the top bits undefined).  This causes problems for targets like alpha
whose ABI's define the top bits too.

llvm-svn: 20926
2005-03-29 19:09:56 +00:00
Chris Lattner
8de8b7bf40 there is no point comparing against null pointer.
llvm-svn: 20925
2005-03-29 17:44:52 +00:00
Chris Lattner
ca85130b0a Fix a major problem with global variable initializers. This could cause
us to have stuff pointing to the null pointer, which makes no sense
(the null ptr is an ssa value, not the null object)

llvm-svn: 20922
2005-03-29 17:21:53 +00:00
Chris Lattner
1ce9aacf2e fix a warning in the optimized build
llvm-svn: 20920
2005-03-29 15:13:27 +00:00
Chris Lattner
dd94b2d01e add some more functions, ignore setcc for constraints!
llvm-svn: 20917
2005-03-29 06:52:20 +00:00
Chris Lattner
ecfa9b5810 disable this transformation in the one obscure case that really pessimizes
pointer analysis.

llvm-svn: 20916
2005-03-29 06:37:47 +00:00
Chris Lattner
2c95fac918 there is no reason to run -instcombine -instcombine!
llvm-svn: 20915
2005-03-29 06:25:11 +00:00
Chris Lattner
7617e886c1 Handle "known" external calls context sensitively, add support for realloc
and a couple of other functions that are important.

Handle aggregate undef values for gv initializers

llvm-svn: 20914
2005-03-29 06:09:07 +00:00
Nate Begeman
60956dd52f Implement div, rem, and frameindex
llvm-svn: 20907
2005-03-29 00:03:27 +00:00
Nate Begeman
731bed10c7 Pattern ISel: fix argument loading for i64s (thanks chris)
Simple  ISel: fix i64 subtract

llvm-svn: 20903
2005-03-28 23:08:54 +00:00
Nate Begeman
66acad746f Remove fake instruction 'subc' (mnemonic for subfc).
More pattern isel updates

llvm-svn: 20902
2005-03-28 22:28:37 +00:00
Chris Lattner
32e08b7c06 implement legalization of build_pair for nate
llvm-svn: 20901
2005-03-28 22:03:13 +00:00
Andrew Lenharth
b442791124 First step in adding pcmarker intrinsic. Second step (soon) is adding backend support.
llvm-svn: 20900
2005-03-28 20:05:49 +00:00
Nate Begeman
5bdfc63516 Implement proper loads and zero-extends of all types
llvm-svn: 20897
2005-03-28 19:36:43 +00:00
Duraid Madina
bdbf8ba2d0 Emit .global @function and .global @object entries so the Intel ias
assembler may be used; identify LLVM output as such.

llvm-svn: 20892
2005-03-28 15:21:43 +00:00
Chris Lattner
81b6d86a3a Teach andersens that non-escaping memory cannot be mod/ref'd by external fn calls.
llvm-svn: 20891
2005-03-28 06:21:17 +00:00
Misha Brukman
009585d2ac Fix grammar
llvm-svn: 20890
2005-03-28 04:32:12 +00:00
Chris Lattner
a8ad8b2826 Make anders-aa much more precise by not being completely pessimistic about
external functions.  Teach it about a few important ones.

llvm-svn: 20889
2005-03-28 04:03:52 +00:00
Jeff Cohen
03332ecf17 Fix VC++ build breakage
llvm-svn: 20888
2005-03-28 02:52:28 +00:00
Alkis Evlogimenos
9ead0d7b4c Rename createPromoteMemoryToRegister() to
createPromoteMemoryToRegisterPass() to be consistent with other pass
creation functions.

llvm-svn: 20885
2005-03-28 02:01:12 +00:00
Chris Lattner
147f8b789c wrap some long lines
llvm-svn: 20884
2005-03-27 22:03:46 +00:00
Chris Lattner
2db10ba297 remove ...
llvm-svn: 20883
2005-03-27 21:57:09 +00:00
Chris Lattner
f290da862d speed up steens by using spliceFrom, improve its precision by realizing that
an incomplete node cannot alias a complete node.

llvm-svn: 20882
2005-03-27 21:56:55 +00:00
Chris Lattner
ea69f1f9e8 teach andersens about undef
llvm-svn: 20881
2005-03-27 18:58:23 +00:00
Chris Lattner
82166467c3 Don't give up completely, maybe other AA can say something about this.
llvm-svn: 20873
2005-03-27 00:02:33 +00:00
Chris Lattner
3f08e7899f Factor out percentage printing into its own function. Make two changes to
the function: print more precision XX.X% instead of XX%, and cast to ULL
before scaling by 100/1000 to avoid wrap around for large numbers of queries
(such as occur for 253.perlbmk and 176.gcc)

llvm-svn: 20872
2005-03-26 23:56:33 +00:00
Chris Lattner
2ba37389c9 Cache mapping information for a call site after computing it for a mod/ref
query.  If the next mod/ref query happens to be for the same call site
(which is extremely likely), use the cache instead of recomputing the
callee/caller mapping.  This makes -aa-eval ***MUCH*** faster with
ds-aa

llvm-svn: 20871
2005-03-26 23:29:03 +00:00
Chris Lattner
139f43b340 Remove more long dead code: dsa doesn't provide must alias info
llvm-svn: 20870
2005-03-26 22:54:46 +00:00
Chris Lattner
1a02d15dab remove some unsafe code that has long been dead
llvm-svn: 20869
2005-03-26 22:48:42 +00:00
Chris Lattner
9cc932d3b3 slightly improve mod/ref for DSAA by checking the globals graph for fallback
llvm-svn: 20868
2005-03-26 22:47:03 +00:00
Chris Lattner
b3baff1830 Teach steens-aa two things about mod/ref information:
1. If memory never escapes the program, it cannot be mod/ref'd by external
     functions.
  2. If memory is global never mod/ref'd in the program, it cannot be mod/ref'd
     by any call.

llvm-svn: 20867
2005-03-26 22:43:20 +00:00
Chris Lattner
68ee8f572c Interchange this loop so that we test all pointers against one call site
before moving on to the next call site.  This will be a more efficient way
to compute the mod/ref set for AA implementations like DSA.

llvm-svn: 20866
2005-03-26 22:16:44 +00:00
Nate Begeman
518a994b7d Fix that pesky floats in integer regs problem by assigning the f32 type to
the correct register class.  Also remove the loading of float data into int
regs part of varargs; it will need to be implemented differently later.

llvm-svn: 20857
2005-03-26 08:25:22 +00:00
Nate Begeman
dcad53e7bd Get closer to having varargs working. There's still something strange
going on with copies between floating point and integer register files
being generated.  Once that is solved, varargs will be done.

llvm-svn: 20856
2005-03-26 07:46:36 +00:00
Nate Begeman
c95bf7b226 Make 64bit args and float args work correct with calls. Thanks to Chris
for explaining EXTRACT_ELEMENT to me.

llvm-svn: 20847
2005-03-26 02:17:46 +00:00
Nate Begeman
0bea1090dd Change LowerCallTo to take a boolean isVarArg argument. This is needed
by the PowerPC backend, and probably others in the future.

llvm-svn: 20843
2005-03-26 01:30:30 +00:00
Nate Begeman
f656525cb6 Change interface to LowerCallTo to take a boolean isVarArg argument.
llvm-svn: 20842
2005-03-26 01:29:23 +00:00
Nate Begeman
e70b5c79f8 Next round of pattern isel changes, mostly dealing with calls.
llvm-svn: 20841
2005-03-26 01:28:53 +00:00
Nate Begeman
5d7610de65 Correct a documention link
llvm-svn: 20840
2005-03-26 01:28:05 +00:00
Chris Lattner
d21e220035 no really, don't double count these nodes either!
llvm-svn: 20837
2005-03-25 20:54:45 +00:00
Chris Lattner
b7ffd50537 Don't count all of the nodes in the SCC once for each function in the SCC.
llvm-svn: 20836
2005-03-25 20:37:32 +00:00
Chris Lattner
5ecec08ab5 Grow the EQ classes for globals at the end of the BU pass. This shrinks
memory usage in the TD pass for 254.gap from 31.3MB to 3.9MB.

llvm-svn: 20834
2005-03-25 16:45:43 +00:00
Chris Lattner
d6e6b38918 fix the RUN line on this testcase so it passes.
llvm-svn: 20833
2005-03-25 15:36:19 +00:00
Nate Begeman
0ad33afe22 Support global addresses and fix call returns. Varargs still aren't
handled correctly for floating point arguments, or more than 8 arguemnts.
This does however, allow hello world to run.

llvm-svn: 20832
2005-03-25 08:34:25 +00:00
Chris Lattner
514e843e89 Enhance loopsimplify to preserve alias analysis instead of clobbering it.
This prevents crashes on some programs when using -ds-aa -licm.

llvm-svn: 20831
2005-03-25 06:37:22 +00:00
Chris Lattner
8d9f3735cd Treat free operations as volatile, since they cannot be moved. This fixes
Transforms/LICM/2005-03-24-LICM-Aggregate-Crash.ll

llvm-svn: 20830
2005-03-25 05:49:37 +00:00
Chris Lattner
b99c93c93b New testcase that crashes licm.
llvm-svn: 20829
2005-03-25 05:49:13 +00:00
Chris Lattner
faf7791fea Fix a bug where LICM was not updating AA information properly when sinking
a pointer value out of a loop causing it to be duplicated.

llvm-svn: 20828
2005-03-25 00:22:36 +00:00
Chris Lattner
3322e28f75 remove a debugging timer.
llvm-svn: 20827
2005-03-25 00:06:09 +00:00
Chris Lattner
278bac843c Two changes here:
1. Instead of copying Local graphs to the BU graphs to start with, use
     spliceFrom to do the job (which is constant time in this case).  On
     176.gcc, this chops off .17s from the bu pass.
  2. When building SCC graphs, simplify the logic and use spliceFrom to
     do the heavy lifting, instead of cloneInto/delete.  This slices
     another .14s off 176.gcc.

llvm-svn: 20826
2005-03-25 00:05:04 +00:00
Chris Lattner
a396eb8ae9 Make the spliceFrom case where one graph is completely empty be constant time.
llvm-svn: 20825
2005-03-25 00:02:41 +00:00
Chris Lattner
127dd12427 add a new DSGraph::spliceFrom method, which violently takes the content of
one graph and plops it into another, without breaking a sweat.

llvm-svn: 20824
2005-03-24 23:46:04 +00:00
Chris Lattner
56787258e7 add new spliceFrom methods.
llvm-svn: 20823
2005-03-24 23:45:20 +00:00
Nate Begeman
ad5151d785 Implement next round of Pattern ISel fixes
1. void returns
2. multiplies
3. calls

llvm-svn: 20822
2005-03-24 23:35:30 +00:00
Nate Begeman
3a9a2f9ec7 Fix an incorrect argument being passed to BuildMI for indirect calls.
llvm-svn: 20821
2005-03-24 23:34:38 +00:00
Chris Lattner
301764e28c This replaces the correct but slow code with a more aggressive scc-finder
based approach to find globals and call sites that need to be copied.  This
speeds up the BU pass on 176.gcc from 22s back up to 2.3s.  Not as good
as 1.5s, but at least it's correct :)

llvm-svn: 20820
2005-03-24 23:06:02 +00:00
Chris Lattner
1b5b559011 only look at successors of globals. This gets us down to "only" 22s in the
bu pass for 176.gcc

llvm-svn: 20818
2005-03-24 21:17:27 +00:00
Chris Lattner
189d7bb9ee Unfortunately, a previous patch was not safe. Revert it, reimplement
something correct. Unfortunately this takes 176.gcc's BU phase back
up to 29s from 1.5.  This fixes DSGraph/2005-03-24-Global-Arg-Alias.ll

llvm-svn: 20817
2005-03-24 21:07:47 +00:00
Nate Begeman
d73c87a424 Commit Gabor Greif's patch to use iterators in lowering intrinsics.
llvm-svn: 20816
2005-03-24 20:07:16 +00:00
Chris Lattner
923d925953 don't bother |'ing in 0's
llvm-svn: 20815
2005-03-24 18:42:51 +00:00
Chris Lattner
ba6006d84b be more aggressive about incompleteness marking
llvm-svn: 20814
2005-03-24 18:42:28 +00:00
Chris Lattner
299be4b42f new testcase that DS-AA is causing to be miscompiled.
llvm-svn: 20813
2005-03-24 17:57:43 +00:00
Chris Lattner
b15317b74a eliminate dead variables, patch contributed by Gabor Greif!
llvm-svn: 20812
2005-03-24 17:32:20 +00:00
Nate Begeman
7ec19b4d5a Implement more of the PPC32 Pattern ISel:
1) dynamic stack alloc
2) loads
3) shifts
4) subtract
5) immediate form of add, and, or, xor
6) change flag from -pattern-isel to -enable-ppc-pattern-isel

Remove dead arguments from getGlobalBaseReg in the simple ISel

llvm-svn: 20810
2005-03-24 06:28:42 +00:00
Chris Lattner
a3abb4c01a Fix silly "no newline at end of file" warning
llvm-svn: 20809
2005-03-24 06:16:18 +00:00
Chris Lattner
d6888355fa Fix compilation errors, patch contributed by the fabulous Bill Wendling!
llvm-svn: 20808
2005-03-24 05:13:53 +00:00
Chris Lattner
fed2a42895 fix a compilation error, patch contributed by Bill Wendling!
llvm-svn: 20807
2005-03-24 05:12:48 +00:00
Nate Begeman
20e7e28ee7 Addition of the PPC32 Pattern ISel. While it is far from complete, it will
be brought up to parity with the current simple ISel in the coming days.
Currently, -pattern-isel is required to trigger it.

llvm-svn: 20805
2005-03-24 04:41:43 +00:00
Nate Begeman
952105220e Remove comments that are now meaningless from the pattern ISels, at Chris's
request.

llvm-svn: 20804
2005-03-24 04:39:54 +00:00
Chris Lattner
19d7f2883d Fix a crash while promoting a value out of a loop from a global variable
when using ds-aa

llvm-svn: 20802
2005-03-24 04:22:04 +00:00
Chris Lattner
f0d919ece9 teach ds-aa about mod/ref for external function calls.
llvm-svn: 20801
2005-03-24 03:04:50 +00:00
Chris Lattner
aff85ac552 Simplify dead code into a fixme :)
llvm-svn: 20800
2005-03-24 02:41:19 +00:00
Chris Lattner
85a1d92323 fix a compiler crash in runtime/libprofile
llvm-svn: 20799
2005-03-24 01:22:52 +00:00
Chris Lattner
6a3f5fd623 wrap a long line
llvm-svn: 20797
2005-03-23 23:51:12 +00:00
Chris Lattner
2a7358064e If we are calling an external function, chain to another AA to potentially
decide, don't just immediately give up.

This implements GlobalsModRef/chaining-analysis.ll

llvm-svn: 20796
2005-03-23 23:49:47 +00:00
Chris Lattner
4baa138fad GlobalMR should be able to analyze this function.
llvm-svn: 20795
2005-03-23 23:48:56 +00:00
Chris Lattner
18ae9b911a if a function doesn't access memory at all, it definitely doesn't read it.
llvm-svn: 20794
2005-03-23 23:27:34 +00:00
Chris Lattner
8424b0f82e Make this more efficient by only making one virtual method call.
llvm-svn: 20793
2005-03-23 23:26:58 +00:00
Chris Lattner
07eac1e698 Make this a bit more aggressive
llvm-svn: 20792
2005-03-23 22:06:41 +00:00
Chris Lattner
9f9da538d6 a hack to allow count-aa to work with ds-aa :(
llvm-svn: 20791
2005-03-23 21:59:34 +00:00
Chris Lattner
ccb6faad7e Add two options to allow -count-aa to print queries either (1) all queries,
or (2) only queries that are not successful (e.g. return may alias)

llvm-svn: 20790
2005-03-23 21:59:07 +00:00
Misha Brukman
9c64d9c2b5 Fix grammar
llvm-svn: 20789
2005-03-23 21:14:33 +00:00
Chris Lattner
1c790bf656 enable -debug-only=licm
llvm-svn: 20788
2005-03-23 21:00:12 +00:00
Chris Lattner
61130216ec turn a dead conditional into an assert.
llvm-svn: 20787
2005-03-23 20:12:08 +00:00
Chris Lattner
01f0879c48 Totally gut mergeInGraph. There is absolutely no reason to be merging
global roots in from callees to callers.  The BU graphs do not have accurate
globals information and all of the clients know it.  Instead, just make sure
the GG is up-to-date, and they will be perfectly satiated.

This speeds up the BU pass on 176.gcc from 5.5s to 1.5s, and Loc+BU+TD
from 7s to 2.7s.

llvm-svn: 20786
2005-03-23 20:08:59 +00:00
Chris Lattner
048ae36b93 wrap a long line
llvm-svn: 20785
2005-03-23 16:43:11 +00:00
Andrew Lenharth
82f364515c don't lie to the register allocator
llvm-svn: 20784
2005-03-23 15:20:01 +00:00
Chris Lattner
e36d77b726 Make -steens-aa more conservative (aka correct) by making sure to obey
incompleteness flags.

Make it more aggressive by taking field sensitive information into
account.

llvm-svn: 20781
2005-03-23 01:48:09 +00:00
Tanya Lattner
13417b5be3 Added alias analysis.
Fixed many many bugs.
This now works on almost all Singlesource , and most of MultiSource.

llvm-svn: 20780
2005-03-23 01:47:20 +00:00
Chris Lattner
7d3df410ab implement Analysis/DSGraph/field-sensitive.ll
llvm-svn: 20779
2005-03-23 01:47:19 +00:00
Chris Lattner
17011d972a new testcase to verify that we have field sensitive alias analysis info. This
test cannot be satisfied without interprocedural information.

llvm-svn: 20778
2005-03-23 01:46:59 +00:00
Chris Lattner
70a402b9b8 make sure this test tests the intended target.
llvm-svn: 20777
2005-03-23 01:32:03 +00:00
Chris Lattner
dcb82f5d0a don't crash in some bad cases.
llvm-svn: 20776
2005-03-23 01:29:26 +00:00
Chris Lattner
310d1a3882 Several changes here:
1. Increase max node size from 64->256 to avoid collapsing an important
   structure in 181.mcf
2. If we have multiple calls to an indirect call node with an indirect
   callee, fold these call nodes together, to avoid DSA turning apoc into
   a flaming fireball of death when analyzing 176.gcc.
  With this change, 176.gcc now takes ~7s to analyze for loc+bu+td, with
  5.7s of that in the BU pass.

llvm-svn: 20775
2005-03-22 23:54:52 +00:00
Chris Lattner
5c971a0072 We might as well check the TD graphs as well, even though they are fine.
llvm-svn: 20774
2005-03-22 22:11:22 +00:00
Chris Lattner
ca174306f0 Mark external globals incomplete in the BU Globals graph, fixing
Analysis/DSGraph/2005-03-22-IncompleteGlobal.ll

llvm-svn: 20773
2005-03-22 22:10:22 +00:00
Chris Lattner
537dcf017c New testcase, the BU pass is marking the global complete in the globals graph.
llvm-svn: 20772
2005-03-22 22:07:15 +00:00
Tanya Lattner
8b953a1c32 Updating my entry.
llvm-svn: 20771
2005-03-22 21:33:19 +00:00
Chris Lattner
ecdc1ed631 Fix a serious bug where we didn't insert globals into the globalset when
cloning a graph.

llvm-svn: 20770
2005-03-22 19:44:11 +00:00
Andrew Lenharth
8180e87e51 hum, it is good to use real instructions
llvm-svn: 20769
2005-03-22 16:42:52 +00:00
Chris Lattner
f00684079a Directly count the number of memory instructions.
llvm-svn: 20766
2005-03-22 03:55:10 +00:00
Chris Lattner
24922c7a2b Timers SHOULD NOT record the time taken to count the bytes allocated in the heap!
llvm-svn: 20765
2005-03-22 03:20:38 +00:00
Chris Lattner
495f00946e Remove an iteration pass over the entire scalarmap for each function created
by not allowing integer constants to get into the scalar map in the first
place.

llvm-svn: 20764
2005-03-22 02:45:13 +00:00
Chris Lattner
250726ec25 When making a clone of a DSGraph from the BU pass, make sure to remember that
this clone is supposed to be used for *ALL* of the functions in the SCC.

This fixes the memory explosion problem the TD pass was having, reducing the
memory growth from 24MB -> 3.5MB on povray and 270MB ->8.3MB on perlbmk!
This obviously also speeds up the TD pass *a lot*.

llvm-svn: 20763
2005-03-22 01:50:42 +00:00
Chris Lattner
e05c633099 Don't use operator[], use the new method instead, which is faster. This speeds
up the TD pass about 30% for povray and perlbmk.  It's still not clear why
copying a 5MB set of graphs turns into a 25MB set of graphs though :(

llvm-svn: 20762
2005-03-22 01:42:59 +00:00
Chris Lattner
d0949a00be add a method
llvm-svn: 20761
2005-03-22 01:42:10 +00:00
Chris Lattner
fcae88f280 Now that the dead ctor is gone, nothing uses the old node mapping exported by
cloneInto: make it an internally used mapping.

llvm-svn: 20760
2005-03-22 00:36:51 +00:00
Chris Lattner
8016c975c9 remove a dead ctor
llvm-svn: 20759
2005-03-22 00:33:35 +00:00
Chris Lattner
ea2c02bcca now that the second argument is always this->ReturnNodes, don't bother passing it.
llvm-svn: 20758
2005-03-22 00:29:44 +00:00
Chris Lattner
571578143c instead of using a local RetValMap, just use the graph we are cloning into
for the return node map.

llvm-svn: 20757
2005-03-22 00:25:52 +00:00
Andrew Lenharth
6294dee913 two things: 1)evilness reduction patch, reduces the number of instructions hiding in the small jump CC moving code. 2)implement div of small data types by FP DIV (also reduces evilness and should speed things up)
llvm-svn: 20756
2005-03-22 00:24:07 +00:00
Chris Lattner
d05ab9cab4 now that the valuemapping is always the local scalar map, we can eliminate
this identity merge.

llvm-svn: 20755
2005-03-22 00:22:45 +00:00
Chris Lattner
19944fade3 remove the second argument to cloneInto
llvm-svn: 20754
2005-03-22 00:21:05 +00:00
Chris Lattner
d22030f8db drop the second argument to cloneInto, which is always the local scalar map.
llvm-svn: 20753
2005-03-22 00:20:56 +00:00
Chris Lattner
03b7f99338 add some timers, don't clone aux nodes
llvm-svn: 20752
2005-03-22 00:12:00 +00:00
Chris Lattner
410da35a1f move this out of line
llvm-svn: 20751
2005-03-22 00:09:45 +00:00
Chris Lattner
7b5fe1bdb6 move this stuff out of line
llvm-svn: 20750
2005-03-22 00:09:36 +00:00
Chris Lattner
5f10e6dda1 don't generate temporary scalarmaps.
llvm-svn: 20749
2005-03-22 00:04:21 +00:00
Chris Lattner
848ef879c5 allow passing clone flags down to cloneInto
llvm-svn: 20748
2005-03-21 22:49:53 +00:00
Chris Lattner
f9ef3f0bb4 allow passing clone flags into the ctor
llvm-svn: 20747
2005-03-21 22:49:43 +00:00
Chris Lattner
c1439d539f Enhance the TD pass to build composite graphs when we have indirect call
sites that target multiple callees.  If we have a function table, for
example, with N callees, and M callers call through it, we used to have
to perform O(M*N) graph inlinings.  Now we perform O(M+N) inlinings.

This speeds up the td pass on perlbmk from 36.26s to 25.75s.

llvm-svn: 20743
2005-03-21 20:31:29 +00:00
Chris Lattner
650cd59f28 add a new map
llvm-svn: 20742
2005-03-21 20:29:56 +00:00
Chris Lattner
d90f5bab82 make this const correct
llvm-svn: 20741
2005-03-21 20:28:50 +00:00
Chris Lattner
040426aee0 Fix a major problem where we didn't add call graph edges for call sites with
more than 1 callee.  This fixes Analysis/DSGraph/FunctionPointerTable-const.ll

llvm-svn: 20740
2005-03-21 20:20:49 +00:00
Chris Lattner
032b364fc4 New testcase, which is important to handle correctly.
llvm-svn: 20739
2005-03-21 20:18:51 +00:00
Misha Brukman
82ae9e1dda We may be adding functions to the Module during initialization, so
conservatively, it's modified

llvm-svn: 20735
2005-03-21 19:22:14 +00:00
Chris Lattner
bad17144d0 This error message changed.
llvm-svn: 20734
2005-03-21 17:55:41 +00:00
Chris Lattner
e8a43291cd Ugh, for some reason, I can't call this unless the reference is const!?!?!?
llvm-svn: 20732
2005-03-21 10:00:45 +00:00
Chris Lattner
13429dc5af The reachability cloner should add arguments to merged calls when the RHS of
the merge has more operands than the LHS.

llvm-svn: 20731
2005-03-21 09:39:51 +00:00
Chris Lattner
aa32b37885 Make the first operand of this method be modifiable.
llvm-svn: 20730
2005-03-21 09:39:20 +00:00
Chris Lattner
8632462267 add a method
llvm-svn: 20729
2005-03-21 09:38:39 +00:00
Chris Lattner
5204115d09 If merging two calls like: foo(A) and bar(B, C), make sure the result has two
arguments, not one.

llvm-svn: 20728
2005-03-21 09:18:39 +00:00
Chris Lattner
7269f15e8f 'note to self'
llvm-svn: 20727
2005-03-21 08:43:32 +00:00
Chris Lattner
a5f4b773d9 Remove a bunch of cruft and dead code for handling the case when types were
defined in function constant pools.  The assembler grammar has long
disallowed functions from having constant pools, so all of this stuff is
dead.

This makes it an immediate error for functions to refer to nonexisting
types, fixing Regression/Verifier/2005-03-21-UndefinedTypeReference.ll.

Before, references to non-existing types in functions would only be
detected when the subsequent function was parsed, due to the call to
"ResolveTypes".  "ResolveTypes" has not resolved any types for a long time,
instead it emitted an error message if no resolved types are left.  Since
the only caller of this method is in the module code, just inline it.

llvm-svn: 20726
2005-03-21 06:27:42 +00:00
Chris Lattner
a825b14278 New testcase that the assembler incorrectly accepts.
llvm-svn: 20725
2005-03-21 06:24:53 +00:00
Tanya Lattner
87ee2ba48d Make this method non-const. Making it const causes the const version of
getIGroup to be called instead of the non-const one.  These two methods
have (??) different behavior, so this change fixes bugs.

llvm-svn: 20724
2005-03-21 06:07:43 +00:00
Chris Lattner
98f7e1c370 Change the way that the TD pass inlines graphs. Instead of inlining each
graph into all of the functions it calls when we visit a graph, change it so
that the graph visitor inlines all of the callers of a graph into the current
graph when it visits it.

While we're at it, inline global information from the GG instead of from each
of the callers.  The GG contains a superset of the info that the callers do
anyway, and this way we only need to do it one time (not one for each caller).

This speeds up the TD pass substantially on several programs, and there is
still room for improvement.  For example, the TD pass used to take 147s
on perlbmk, it now takes 36s.  On povray, we went from about 5s to 1.97s.
134.perl is down from ~1s for Loc+BU+TD to .6s.

The TD pass needs a lot of improvement though, which will occur with later
patches.

llvm-svn: 20723
2005-03-21 04:55:35 +00:00
Chris Lattner
6a67d4a804 rename a method add a data structure.
llvm-svn: 20722
2005-03-21 04:46:35 +00:00
Chris Lattner
c8b4b7e314 Provide a guaranteed definition of intptr_t. Thansk to Evan Jones for
pointing this out!

llvm-svn: 20721
2005-03-21 01:36:35 +00:00
Chris Lattner
c5cdc2260d Don't strip modref bits when inlining down the call graph. This fixes
the DSGraph/2003-06-30-TopDownResolve.ll regression from last night.

llvm-svn: 20717
2005-03-20 18:02:56 +00:00
Chris Lattner
21ef7678d6 Remove the ability to keep track of inlined globals, which is always dead.
llvm-svn: 20716
2005-03-20 04:30:30 +00:00
Chris Lattner
6abefe7639 Remove the InlinedGlobals set which is always empty.
llvm-svn: 20715
2005-03-20 04:30:16 +00:00
Chris Lattner
571c62a008 This call is always a noop, remove it.
llvm-svn: 20714
2005-03-20 04:29:54 +00:00
Chris Lattner
b1cabb6541 remove some pointless asserts
llvm-svn: 20713
2005-03-20 04:29:39 +00:00
Chris Lattner
ded489ec3b -steens doesn't use the inlined globals facility.
llvm-svn: 20712
2005-03-20 04:23:57 +00:00
Chris Lattner
ff634f4e32 Build EC's for globals twice. The first is after constructing the initial
Globals Graph for the local pass, the second is after all of the locals
graphs have been constructed.  This allows for many additional global EC's
to be recognized that weren't before.  This speeds up analysis of programs
like 177.mesa, where it changes DSA from taking 0.712s to 0.4018s.

llvm-svn: 20711
2005-03-20 03:32:35 +00:00
Chris Lattner
36a810ac40 Add a new DSNode::removeGlobal method.
llvm-svn: 20710
2005-03-20 03:29:54 +00:00
Chris Lattner
0ebba657df add a method
llvm-svn: 20709
2005-03-20 03:29:39 +00:00
Chris Lattner
5ae215248f Transform BU pass to not use the horrible DSCallSiteIterator class.
llvm-svn: 20708
2005-03-20 02:42:07 +00:00
Chris Lattner
a550a5b173 Implement new methods for dealing with DSNode global lists, rename uses of
old methods.

llvm-svn: 20707
2005-03-20 02:41:38 +00:00
Chris Lattner
e68e808bcd use simpler methods.
llvm-svn: 20706
2005-03-20 02:41:16 +00:00
Chris Lattner
1ffdd57e0a method was renamed.
llvm-svn: 20705
2005-03-20 02:40:27 +00:00
Chris Lattner
5635a88fcb print out equiv class info.
llvm-svn: 20704
2005-03-20 02:40:11 +00:00
Chris Lattner
e7a8e8677e some methods got renamed
llvm-svn: 20703
2005-03-20 02:40:04 +00:00
Chris Lattner
711e083c26 Make use of simpler DSNode methods.
llvm-svn: 20702
2005-03-20 02:39:49 +00:00
Chris Lattner
9991eeb575 rename some methods and add some new methods for dealing with the globals list
in a DSNode.

llvm-svn: 20701
2005-03-20 02:38:39 +00:00
Chris Lattner
61f3befdc8 #ifdef out a function only used by #ifdef'd code.
llvm-svn: 20700
2005-03-20 02:14:15 +00:00
Chris Lattner
e965bd16bb comment cleanup
llvm-svn: 20699
2005-03-20 01:18:00 +00:00
Misha Brukman
42f1cfd637 Constant-propagate the value of `isL' variable and eliminate it.
llvm-svn: 20698
2005-03-19 23:39:50 +00:00
Jeff Cohen
f4ab9e5965 Silence VC++ warning about mixing intptr_t and bool, and about unused variable isL.
llvm-svn: 20697
2005-03-19 22:36:39 +00:00
Chris Lattner
9379e69af9 Create an equivalence class of global variables that DSA will never be able
to tell apart anyway, and only track the leader for of these equivalence
classes in our graphs.

This dramatically reduces the number of GlobalValue*'s that appear in scalar
maps, which A) reduces memory usage, by eliminating many many scalarmap entries
and B) reduces time for operations that need to execute an operation for each
global in the scalar map.

As an example, this reduces the memory used to analyze 176.gcc from 1GB to
511MB, which (while it's still way too much) is better because it doesn't hit
swap anymore.  On eon, this shrinks the local graphs from 14MB to 6.8MB,
shrinks the bu+td graphs of povray from 50M to 40M, shrinks the TD graphs of
130.li from 8.8M to 3.6M, etc.

This change also speeds up DSA on large programs where this makes a big
difference.  For example, 130.li goes from 1.17s -> 0.56s, 134.perl goes
from 2.14 -> 0.93s, povray goes from 15.63s->7.99s (!!!).

This also apparently either fixes the problem that caused DSA to crash on
perlbmk and gcc, or it hides it, because DSA now works on these.  These
both take entirely too much time in the TD pass (147s for perl, 538s for
gcc, vs 7.67/5.9s in the bu pass for either one), but this is a known
problem that I'll deal with later.

llvm-svn: 20696
2005-03-19 22:23:45 +00:00
Chris Lattner
4037048300 Make each scalar map contain a reference to an equivalence class of global
variables.  Do not insert a global into the scalar map unless it is the
leader of its equivalence class.

llvm-svn: 20695
2005-03-19 22:13:13 +00:00
Chris Lattner
1ce80fb008 Each DS collection now contains an equivalence class of globals values.
llvm-svn: 20694
2005-03-19 22:12:33 +00:00
Chris Lattner
6c5b90f36c add a method to clear globals from a node
llvm-svn: 20693
2005-03-19 22:12:03 +00:00
Chris Lattner
300dc0bc90 Two fixes for the copy ctor/operator=:
1. Make sure to clear() 'this' before adding elements to it
  2. Make sure that the leaders of the RHS EC are the leaders of the LHS EC.

llvm-svn: 20692
2005-03-19 21:02:12 +00:00
Chris Lattner
325f234d79 add some methods, fix a major bug in getLeader() that was causing things to
not be unified correctly.

llvm-svn: 20691
2005-03-19 20:42:43 +00:00
Chris Lattner
e6364c2702 implement a proper copy ctor, operator= and add a helper method.
llvm-svn: 20690
2005-03-19 19:26:14 +00:00
Chris Lattner
484bfc4d26 Fix the 3 regressions last night, due to my buggy patch from yesterday.
llvm-svn: 20689
2005-03-19 17:35:11 +00:00
Alkis Evlogimenos
9160d5fd8b Add new function getPtrPtrFromArrayPtr().
llvm-svn: 20684
2005-03-19 11:40:31 +00:00
Alkis Evlogimenos
1a48561432 Stop using deprecated interface.
llvm-svn: 20679
2005-03-19 09:22:17 +00:00
Chris Lattner
c1b9b56a2c Switch to use the new interface for the EquivalenceClasses class, and fix
a bug involving SCC's who have multiple members that are part of an EC.

llvm-svn: 20678
2005-03-19 05:15:27 +00:00
Chris Lattner
c3256647e7 Rewrite this class, making the following improvements:
1. It now actually uses tarjan's algorithm, so it is a efficient inverse
     ackerman's function for union operations, not linear time.
  2. It now stores one copy of the data in the set instead of two.
  3. It now works for elements other than pointers.
  4. It now has a more STL-like interface that exposes iterators instead
     of internal implementation details.

llvm-svn: 20677
2005-03-19 05:14:29 +00:00
Chris Lattner
bed1c18a44 do not bother inlining nullary functions without return values. The only
effect these calls can have is due to global variables, and these passes
all use the globals graph to capture their effect anyway.  This speeds up
the BU pass very slightly on perlbmk, reducing the number of dsnodes
allocated from 98913 to 96423.

llvm-svn: 20676
2005-03-18 23:19:47 +00:00
Chris Lattner
30525a04c1 fix a bogus assertion
llvm-svn: 20675
2005-03-18 23:18:30 +00:00
Chris Lattner
5bd948b4d7 another fastpath
llvm-svn: 20674
2005-03-18 23:18:20 +00:00
Chris Lattner
bed9657ff6 remove use of getPrev() and getNext() on ilist nodes.
llvm-svn: 20673
2005-03-18 16:12:37 +00:00
Chris Lattner
e29503a805 expose this pass to both opt and analyze
llvm-svn: 20672
2005-03-18 05:27:57 +00:00
Misha Brukman
f12594d56f We shall have IA64 as a new experimental backend released with LLVM 1.5
llvm-svn: 20671
2005-03-18 00:48:56 +00:00
Chris Lattner
a8e1a5250a remove a bogus optimization. This only works if there are no globals in the
graph, and the combination of a function that does not reference globals, takes
not arguments and returns no value is pretty rare.

llvm-svn: 20670
2005-03-18 00:23:59 +00:00
Chris Lattner
3f181d7880 Rewrite DSAA::getModRefInfo to compute the mapping between caller and callee
to determine mod/ref behavior, instead of creating a *copy* of the caller
graph and inlining the callee graph into the copy.

This speeds up aa-eval on Ptrdist/yacr2 from 109.13s to 3.98s, and gives
identical results.  The speedup is similar on other programs.

llvm-svn: 20669
2005-03-18 00:21:03 +00:00
Chris Lattner
b8d85c1a74 implement a new method.
llvm-svn: 20668
2005-03-17 23:45:54 +00:00
Chris Lattner
49ec9eeede add 3 methods
llvm-svn: 20667
2005-03-17 23:45:35 +00:00
Misha Brukman
72c27e6112 Recognize an IA64 when we see one
llvm-svn: 20666
2005-03-17 20:56:22 +00:00
Chris Lattner
488a80a292 add some possibly bogus assertions.
llvm-svn: 20665
2005-03-17 20:33:27 +00:00
Chris Lattner
9c9f68c42f Do not include the Function* for direct call/invoke instructions in the
alias evaluation.  Clients really don't care.

llvm-svn: 20664
2005-03-17 20:25:04 +00:00
Duraid Madina
8a3aa43422 typo/denial
llvm-svn: 20663
2005-03-17 20:23:27 +00:00
Chris Lattner
b5525529bd simplify this function a bit, allow DS-AA to build on/improve the mod/ref
results returned by AA, not just use one or the other.

llvm-svn: 20662
2005-03-17 20:16:58 +00:00
Chris Lattner
8dd1491e71 Clean up some code, handle null pointer specially to avoid an assertion
llvm-svn: 20660
2005-03-17 19:56:56 +00:00
Chris Lattner
ea7e6548dc Two changes:
1. Chain to the parent implementation of M/R analysis if we can't find
     any information.  It has some heuristics that often do well.
  2. Do not clear all flags, this can make invalid nodes by turning nodes
     that used to be collapsed into non-collapsed nodes (fixing crashes)

llvm-svn: 20659
2005-03-17 19:56:18 +00:00
Duraid Madina
df642ff2ae clean up warnings when building in release mode
llvm-svn: 20658
2005-03-17 19:00:40 +00:00
Duraid Madina
bf01370fc3 now the angry bug reports have somewhere to go!
llvm-svn: 20657
2005-03-17 18:57:02 +00:00
Chris Lattner
206f2ecaf2 statically link ia64 into llc
llvm-svn: 20656
2005-03-17 18:39:06 +00:00
Duraid Madina
a06265a119 OK, IA64 is statically linked into llc
llvm-svn: 20655
2005-03-17 18:37:05 +00:00
Duraid Madina
f5cc2c453d build the IA64 target as a .so for now
llvm-svn: 20654
2005-03-17 18:29:04 +00:00
Duraid Madina
e20f4cd1b0 dainty
llvm-svn: 20653
2005-03-17 18:23:22 +00:00
Duraid Madina
91ed0a11cf and so it begins...
PHASE 1: write instruction selector
PHASE 2: ???
PHASE 3: profit!

llvm-svn: 20652
2005-03-17 18:17:03 +00:00
Chris Lattner
43832b049e Don't emit two comparisons when comparing a FP value against zero!
llvm-svn: 20651
2005-03-17 16:29:26 +00:00
Chris Lattner
9fcfb35e1a spiff up the nightly tester output one more notch
llvm-svn: 20650
2005-03-17 16:07:45 +00:00
Chris Lattner
7b9020a059 Fix the missing symbols problem Bill was hitting. Patch contributed by
Bill Wendling!!

llvm-svn: 20649
2005-03-17 15:38:16 +00:00
Chris Lattner
5251047abd Do not create ridiculously huge DSNodes, as described in the comments.
This speeds up the BU pass on 172.mgrid from 62.3 -> 0.1242s.

llvm-svn: 20648
2005-03-17 05:25:34 +00:00
Chris Lattner
252f546ceb Fix a bug where we would consider " .99" and "1.0" different because of the
leading whitespace.

llvm-svn: 20647
2005-03-17 04:49:04 +00:00
Chris Lattner
6b6bdf602b remove compat_iterator, which is dead in the tree.
llvm-svn: 20644
2005-03-16 22:42:45 +00:00
Chris Lattner
62462c2314 remove use of compat_iterator.
llvm-svn: 20643
2005-03-16 22:42:19 +00:00
Chris Lattner
4559d5f5c0 remove use of compat_iterator
llvm-svn: 20642
2005-03-16 22:42:01 +00:00
Chris Lattner
267cfa042b Print out who commits and what files were modified at the bottom of the test summary log sent to llvm-commits.
llvm-svn: 20641
2005-03-16 17:09:53 +00:00
Jeff Cohen
44af33905a Do #include HashExtras.h with VC++
llvm-svn: 20640
2005-03-16 05:49:58 +00:00
Jeff Cohen
d4cc65f39d Don't provide default hash struct instantiation.
llvm-svn: 20639
2005-03-16 05:49:06 +00:00
Misha Brukman
96eb878f2a Convert tabs to spaces
llvm-svn: 20638
2005-03-16 05:42:00 +00:00
Jeff Cohen
9f15b5eb40 Add adapter class to let VC++ hash_map use GCC's hash struct.
llvm-svn: 20637
2005-03-16 05:25:09 +00:00
Jeff Cohen
2419195c1e Remove deleted files from VC++ project.
llvm-svn: 20636
2005-03-16 05:09:59 +00:00
Misha Brukman
3f922a3a37 Fix grammar wrt apostrophe's
llvm-svn: 20635
2005-03-16 03:54:50 +00:00
Misha Brukman
7fa86b98c3 Convert tabs to spaces
llvm-svn: 20634
2005-03-16 03:46:55 +00:00
Chris Lattner
018b093c79 fix some 80 column violations
Add support for programs that define main in a .a file, such as f2c'd programs.

llvm-svn: 20631
2005-03-15 23:03:34 +00:00
Chris Lattner
ebaf17875e consolidate LinkFiles into LinkItems, use lib_* iterators.
llvm-svn: 20630
2005-03-15 22:55:17 +00:00
Chris Lattner
d3d086d679 consolidate LinkLibraries into LinkItems
llvm-svn: 20629
2005-03-15 22:51:40 +00:00
Chris Lattner
f901355379 make sure to mark nodes in the globals graph incomplete after computing it
so that external globals (and whatever they point to) are marked incomplete.

llvm-svn: 20628
2005-03-15 22:47:18 +00:00
Chris Lattner
21a79edb27 fix crashes when we only have a prototype for main.
llvm-svn: 20627
2005-03-15 22:10:04 +00:00
Chris Lattner
dadf4b369e Fix a crash that happens when mapping something like this:
{ short, short }

to
  short

where the second short maps onto the second field of the first struct.  In
this case, the struct index is not aligned, so we should avoid calling
getLink(2), which asserts out.

llvm-svn: 20626
2005-03-15 21:36:50 +00:00
Andrew Lenharth
aa254d5f79 sure, I can set a flag, but if I never check it, why bother setting it? Should fix 20 programs :)
llvm-svn: 20623
2005-03-15 19:51:19 +00:00
Chris Lattner
dd3fb83f32 Make computeGGToGMapping compute an invnodemap
llvm-svn: 20622
2005-03-15 17:52:18 +00:00
Chris Lattner
6cd5d1adb6 remove warning, make computeGGToGMapping return an invnodemap.
llvm-svn: 20621
2005-03-15 17:52:07 +00:00
Chris Lattner
3918419c77 add support for hashing nodehandles.
llvm-svn: 20620
2005-03-15 17:51:51 +00:00
Chris Lattner
d31a3d0e82 Finally fix (the right way) the problem where functions like this:
void foo() {
  G = 1;
}

would have an empty DSGraph even though G (a global) is directly used
in the function.

llvm-svn: 20619
2005-03-15 17:14:09 +00:00
Chris Lattner
92d0c1c1ba Start using retnodes_* for iteration.
llvm-svn: 20618
2005-03-15 16:55:04 +00:00
Chris Lattner
f8c924bfcf add iterators for return nodes list.
llvm-svn: 20617
2005-03-15 16:46:11 +00:00
Chris Lattner
0bda00642f method renamed
llvm-svn: 20616
2005-03-15 15:48:22 +00:00
Chris Lattner
22b216a59e Replace more a*'s with arg_*'s, thanks to Gabor Greif!
llvm-svn: 20615
2005-03-15 15:48:06 +00:00
Chris Lattner
3779fd6521 add missing copyright header
llvm-svn: 20614
2005-03-15 15:46:23 +00:00
Alkis Evlogimenos
222dcd44ff Stop using abegin and aend.
llvm-svn: 20610
2005-03-15 07:20:55 +00:00
Alkis Evlogimenos
84adfd8c4f Stop using abegin.
llvm-svn: 20609
2005-03-15 07:12:30 +00:00
Alkis Evlogimenos
a67bafa568 Use arg_iterator and arg_begin and arg_end functions.
llvm-svn: 20608
2005-03-15 07:02:26 +00:00
Jeff Cohen
9bc0cc890e Add EquivClassGraphs.cpp to VC++ project.
llvm-svn: 20607
2005-03-15 06:31:46 +00:00
Chris Lattner
451fa32685 avoid varialbe name collisions
llvm-svn: 20606
2005-03-15 06:29:12 +00:00
Jeff Cohen
99c15a5d48 Do it right...
llvm-svn: 20605
2005-03-15 06:21:40 +00:00
Jeff Cohen
10be0f6f1b Fix VC++ breakage.
llvm-svn: 20604
2005-03-15 06:15:08 +00:00
Chris Lattner
6cb4559369 stop using method.
llvm-svn: 20603
2005-03-15 05:19:49 +00:00
Chris Lattner
bc18ef02ce methods removed.
llvm-svn: 20602
2005-03-15 05:19:20 +00:00
Chris Lattner
4d6b6d4d6e remove reverse BB iterators.
llvm-svn: 20601
2005-03-15 05:17:48 +00:00
Chris Lattner
57b2cd665b remove a whole bunch of dead methods. Noone should use reverse iterators anyway.
llvm-svn: 20600
2005-03-15 05:13:47 +00:00
Chris Lattner
fb972add4f stop using arg_front
llvm-svn: 20599
2005-03-15 05:03:36 +00:00
Chris Lattner
31c8a9d41a stop using arg_back
llvm-svn: 20598
2005-03-15 04:59:17 +00:00
Chris Lattner
531f9e92d4 This mega patch converts us from using Function::a{iterator|begin|end} to
using Function::arg_{iterator|begin|end}.  Likewise Module::g* -> Module::global_*.

This patch is contributed by Gabor Greif, thanks!

llvm-svn: 20597
2005-03-15 04:54:21 +00:00
Chris Lattner
5ce25cdc6d switch from a* to arg_* and g* to global_* for argument/global var iterators
llvm-svn: 20596
2005-03-15 04:48:32 +00:00
Chris Lattner
28f1caa639 Don't crash if computing a mapping to a node with zero size
llvm-svn: 20595
2005-03-15 04:40:24 +00:00
Chris Lattner
26415d7432 rename method, add counterpart
llvm-svn: 20593
2005-03-15 00:58:16 +00:00
Chris Lattner
9468d19ce9 Rename method, add counterpart.
llvm-svn: 20592
2005-03-15 00:58:09 +00:00
Chris Lattner
91e6ed6e36 Remove the reverse iterators for arguments and global vars.
Rename argument iterators arg_* instead of a*
Remove global variable iterators global_* instead of g*.

Keep the old names for temporary compatibility.

Patch contributed by Gabor Greif!

llvm-svn: 20591
2005-03-14 23:49:40 +00:00
Andrew Lenharth
0b9096bcc5 FP 0.0 setcc optimization, and generate short branch sequence for setcc(FP) rather than stack usage
llvm-svn: 20589
2005-03-14 19:23:45 +00:00
Chris Lattner
1bdb8b7e7e add a method to compute a commonly used mapping.
llvm-svn: 20588
2005-03-14 19:22:47 +00:00
Chris Lattner
40e2b71f7a Add a useful method.
llvm-svn: 20587
2005-03-14 19:22:33 +00:00
Chris Lattner
9071175625 regardless of whether or not the client things we should mark globals incomplete,
ALWAYS mark them incomplete if they are external!

llvm-svn: 20586
2005-03-13 20:36:01 +00:00
Chris Lattner
b9e2a4dec0 Make sure to remove incomplete markers before we add to them! :)
llvm-svn: 20585
2005-03-13 20:32:26 +00:00
Chris Lattner
5a6609771a The incoming arguments to main (the argv list) are not complete!
llvm-svn: 20584
2005-03-13 20:22:10 +00:00
Chris Lattner
2eff970892 After finishing BU analysis, move all global variables from the globals
graph into main and mark them complete.

llvm-svn: 20583
2005-03-13 20:15:06 +00:00
Chris Lattner
68c3caccb1 ADd support for printing eqgraphs.
llvm-svn: 20582
2005-03-13 19:51:24 +00:00
Chris Lattner
db98a9745a Add support for printing EQ graphs
llvm-svn: 20581
2005-03-13 19:50:40 +00:00
Chris Lattner
9cc2c3e9d6 Replace linear search with logrithmic one.
llvm-svn: 20580
2005-03-13 19:05:05 +00:00
Chris Lattner
3434004dce add a StructLayout::getElementContainingOffset method.
llvm-svn: 20579
2005-03-13 19:04:41 +00:00
Chris Lattner
e15f891bf0 add a helper method
llvm-svn: 20578
2005-03-13 19:04:04 +00:00
Andrew Lenharth
af9a15fe64 Should fix mesa
llvm-svn: 20577
2005-03-13 00:43:20 +00:00
Chris Lattner
97ac0a8780 make sure to mark nodes returned from functions as incomplete
llvm-svn: 20576
2005-03-12 14:58:28 +00:00
Chris Lattner
dd6bcbe820 remove this from the PA namespace, leaving it in the llvm ns
llvm-svn: 20574
2005-03-12 12:08:52 +00:00
Chris Lattner
2dd9a09837 Move this from the pool allocator project to here, where it logically belongs.
llvm-svn: 20570
2005-03-12 11:51:30 +00:00
Chris Lattner
a945923045 this doesn't fail on the suns either!
llvm-svn: 20567
2005-03-12 03:43:38 +00:00
Misha Brukman
8f3df64397 Move link to GCC prefetch info here, since it's gone from Open Projects page
llvm-svn: 20566
2005-03-11 21:18:18 +00:00
Chris Lattner
90e6ff073c this passes on darwin
llvm-svn: 20565
2005-03-11 21:18:00 +00:00
Chris Lattner
5490aae863 Fix computation of compiled objects, contributed by Vladimir Merzliakov!
llvm-svn: 20564
2005-03-11 20:17:04 +00:00
Andrew Lenharth
27a3df07a0 remove a pseudo instruction and improve inline constant generation
llvm-svn: 20563
2005-03-11 17:48:05 +00:00
Chris Lattner
db302f899a prefetch is now supported.
llvm-svn: 20562
2005-03-11 06:16:26 +00:00
Chris Lattner
c2fdf33162 new testcase for __builtin_prefetch support.
llvm-svn: 20561
2005-03-11 06:14:23 +00:00
Misha Brukman
9d72af0489 * Remove extraneous spaces
* Convert some tabs to spaces

llvm-svn: 20560
2005-03-11 04:15:18 +00:00
Nate Begeman
5f399bb2fe Add SelectionDAG library to PPC JIT so that lli will link when
PPC32ISelPattern.cpp is present.

llvm-svn: 20559
2005-03-11 03:58:53 +00:00
Chris Lattner
8227a51c10 Fix some crashes noted by John Mellor-Crummey's group.
llvm-svn: 20558
2005-03-11 00:00:56 +00:00
Misha Brukman
922bf92b08 Sprinkle code examples and command-line interaction examples with some style
llvm-svn: 20557
2005-03-11 00:00:33 +00:00
Misha Brukman
5da60ba6aa * Add directions to send output of nightly test script to llvm-testresults@cs
* Use the doc_code class to nightly test script example
* Enclose file names in <tt> tags
* Achieve compliance with HTML-4.01 Strict

llvm-svn: 20556
2005-03-10 22:51:59 +00:00
Chris Lattner
6f6ecad995 I didn't mean to check this in. :(
llvm-svn: 20555
2005-03-10 20:59:51 +00:00
Chris Lattner
85e7163947 Fix a bug where we would incorrectly do a sign ext instead of a zero ext
because we were checking the wrong thing.  Thanks to andrew for pointing
this out!

llvm-svn: 20554
2005-03-10 20:55:51 +00:00
Andrew Lenharth
7054073bb6 yay for camel_cvs diff
llvm-svn: 20552
2005-03-10 20:15:09 +00:00
Andrew Lenharth
7728eb7b80 some typoes and .bss isn't liked, at all
llvm-svn: 20542
2005-03-10 19:02:02 +00:00
Misha Brukman
df5b6d3921 Replace tabs with spaces, separate function arguments with a space
llvm-svn: 20538
2005-03-10 16:32:33 +00:00
Chris Lattner
2aade22c67 Improve formatting of the sent mail for the dj test results.
llvm-svn: 20537
2005-03-10 16:26:50 +00:00
Chris Lattner
76aa8e071b Allow the live interval analysis pass to be a bit more aggressive about
numbering values in live ranges for physical registers.

The alpha backend currently generates code that looks like this:

  vreg = preg
...
  preg = vreg
  use preg
...
  preg = vreg
  use preg

etc.  Because vreg contains the value of preg coming in, each of the
copies back into preg contain that initial value as well.

In the case of the Alpha, this allows this testcase:

void "foo"(int %blah) {
        store int 5, int *%MyVar
        store int 12, int* %MyVar2
        ret void
}

to compile to:

foo:
        ldgp $29, 0($27)
        ldiq $0,5
        stl $0,MyVar
        ldiq $0,12
        stl $0,MyVar2
        ret $31,($26),1

instead of:

foo:
        ldgp $29, 0($27)
        bis $29,$29,$0
        ldiq $1,5
        bis $0,$0,$29
        stl $1,MyVar
        ldiq $1,12
        bis $0,$0,$29
        stl $1,MyVar2
        ret $31,($26),1

This does not seem to have any noticable effect on X86 code.

This fixes PR535.

llvm-svn: 20536
2005-03-09 23:05:19 +00:00
Andrew Lenharth
8145fec740 minor correction for Register that isn't used
llvm-svn: 20535
2005-03-09 20:48:23 +00:00
Chris Lattner
7f26946709 constant fold FP_ROUND_INREG, ZERO_EXTEND_INREG, and SIGN_EXTEND_INREG
This allows the alpha backend to compile:

bool %test(uint %P) {
        %c = seteq uint %P, 0
        ret bool %c
}

into:

test:
        ldgp $29, 0($27)
        ZAP $16,240,$0
        CMPEQ $0,0,$0
        AND $0,1,$0
        ret $31,($26),1

instead of:

test:
        ldgp $29, 0($27)
        ZAP $16,240,$0
        ldiq $1,0
        ZAP $1,240,$1
        CMPEQ $0,$1,$0
        AND $0,1,$0
        ret $31,($26),1

... and fixes PR534.

llvm-svn: 20534
2005-03-09 18:37:12 +00:00
Chris Lattner
b1d901427a correct the computation of the isAbstract bit for types.
llvm-svn: 20533
2005-03-09 17:34:27 +00:00
Chris Lattner
562c180879 Fix Regression/Analysis/BasicAA/2005-03-09-BrokenBasicAA.ll, a miscompilation
that Alkis found with Java, thanks Alkis!

llvm-svn: 20531
2005-03-09 16:29:52 +00:00
Chris Lattner
623bb75d35 new testcase for a -basicaa bug that Alkis found with Java.
llvm-svn: 20530
2005-03-09 16:29:22 +00:00
Reid Spencer
f064bb2617 Fix a typo in an assertion comment.
Patch contributed by Vladimir Merzliakov.

llvm-svn: 20529
2005-03-09 15:19:41 +00:00
Chris Lattner
4dc39d447d Use static_cast and #include Instructions.h
llvm-svn: 20528
2005-03-09 05:35:16 +00:00
Chris Lattner
adb043c2d8 Export two methods for getting -X and A-B.
llvm-svn: 20527
2005-03-09 05:34:41 +00:00
Chris Lattner
bc6b18e6d3 export two methods
llvm-svn: 20526
2005-03-09 05:34:23 +00:00
Chris Lattner
b9f0cebeb5 get bugpoint working on ia64, by building .so's with -fpic. :)
llvm-svn: 20525
2005-03-09 03:31:02 +00:00
Chris Lattner
1f1462fafa Fix a crash handling 'undef bool', fixing an llc crash on 186.crafty
llvm-svn: 20523
2005-03-08 22:53:09 +00:00
Reid Spencer
00658b80fb Patch to make assembly output compatible with mingw compilation (identical
to cygwin)

llvm-svn: 20520
2005-03-08 17:02:05 +00:00
Chris Lattner
ea50620eec Make sure to remove all dead type names from the symbol table, not just
struct types.  This fixes Regression/CodeGen/CBackend/2005-03-08-RecursiveTypeCrash.ll,
a crash on Java output that Alkis reported.

llvm-svn: 20519
2005-03-08 16:19:59 +00:00
Chris Lattner
7c303235b4 new testcase that crashes the CBE.
llvm-svn: 20518
2005-03-08 16:19:02 +00:00
Jeff Cohen
e77909805b Clarify inability to generate assembly, and note that VC++ Express works.
llvm-svn: 20516
2005-03-08 03:56:50 +00:00
Misha Brukman
20238eb963 Single characters should be printed out as chars, not strings.
llvm-svn: 20515
2005-03-08 00:26:08 +00:00
Chris Lattner
455fc8c917 Various cleanups and clarifications, thanks to Gabor Greif for contributing this patch!
llvm-svn: 20514
2005-03-07 22:13:59 +00:00
Chris Lattner
4604436b29 Fix problems compiling with G++ 4.x.x with -pedantic. Thanks to
Vladimir Merzliakov for the patch!

llvm-svn: 20513
2005-03-07 20:35:45 +00:00
Chris Lattner
d3e641c2ab fix another typo
llvm-svn: 20512
2005-03-07 20:31:38 +00:00
Chris Lattner
2e6eb5f40d fix typeo that Gabor Greif noticed!
llvm-svn: 20511
2005-03-07 20:30:51 +00:00
Chris Lattner
a9beaacac6 move the reassociation pass after the LICM pass. This speeds up mgrid
from 10.27s to 9.57s with the CBE.

llvm-svn: 20508
2005-03-07 03:19:50 +00:00
Chris Lattner
e9328b319c Fix an apparent ambiguity compiling on PPC
llvm-svn: 20507
2005-03-07 02:59:36 +00:00
Chris Lattner
8c79559443 fix a bug where we thought arguments were constants :(
llvm-svn: 20506
2005-03-06 22:52:29 +00:00
Chris Lattner
2ce303b406 Fix Regression/Transforms/LoopStrengthReduce/dont_insert_redundant_ops.ll,
hopefully not breaking too many other things.

llvm-svn: 20505
2005-03-06 22:36:12 +00:00
Chris Lattner
5991cf77b2 cleanup the test
llvm-svn: 20504
2005-03-06 22:24:45 +00:00
Chris Lattner
1173c52d82 check that we only insert one phi node per loop
llvm-svn: 20503
2005-03-06 22:23:31 +00:00
Chris Lattner
392a0bba42 Add testcase for this:
(3) Do not reduce element sizes of small power of two:

  char s[10];
  for (i)
    ...s[i] ...

when the indvar is not eliminable.

llvm-svn: 20502
2005-03-06 22:15:24 +00:00
Chris Lattner
45403e5052 implement Transforms/LoopStrengthReduce/invariant_value_first_arg.ll
llvm-svn: 20501
2005-03-06 22:06:22 +00:00
Chris Lattner
656a6e37e1 testcase for A[invariant][indvar] where invariant is an instruction.
llvm-svn: 20500
2005-03-06 22:06:09 +00:00
Chris Lattner
ab00dc30df add test for this:
(1) Allow loop invariant expressions to come before the induction variable (instead of just
constants):

   int x;
   for (i)
    ...a[x][i]

llvm-svn: 20499
2005-03-06 22:04:27 +00:00
Chris Lattner
97b8cbff7c Add test for this:
Allow operands after the induction variable (no restrictions):

  int x;
  for (i)
   j = .....
   a[i][x][j]

llvm-svn: 20498
2005-03-06 22:01:42 +00:00
Chris Lattner
d3874fad44 minor simplifications of the code.
llvm-svn: 20497
2005-03-06 21:58:22 +00:00
Chris Lattner
9cd727c2ee a regtest
llvm-svn: 20496
2005-03-06 21:47:40 +00:00
Chris Lattner
78f166c6ab new directory
llvm-svn: 20495
2005-03-06 21:42:59 +00:00
Chris Lattner
dd3ec92085 trivial simplification
llvm-svn: 20494
2005-03-06 21:35:38 +00:00
Chris Lattner
238f6df546 Fix a bug where we could corrupt a parent loop's header info if we unrolled
a nested loop.  This fixes Transforms/LoopUnroll/2005-03-06-BadLoopInfoUpdate.ll
and PR532

llvm-svn: 20493
2005-03-06 20:57:32 +00:00
Chris Lattner
1c69aab68b New testcase for PR532
llvm-svn: 20492
2005-03-06 20:56:55 +00:00
Chris Lattner
6aa5f97a05 new helper method
llvm-svn: 20491
2005-03-06 20:55:34 +00:00
Chris Lattner
a93419c8df new testcase reduced from the MultiSource/Applications/d failure last night.
llvm-svn: 20490
2005-03-06 19:40:19 +00:00
Chris Lattner
5de9dec0d1 move some method declarations around to make it clear that users should
not call insert(Value *Val), remove(Value* Val), or
changeName(Value *V, const std::string &Name)

llvm-svn: 20488
2005-03-06 06:03:44 +00:00
Chris Lattner
96b7bf6244 this method is never called.
llvm-svn: 20487
2005-03-06 06:00:24 +00:00
Chris Lattner
897cc8e1ec cleanup some html
remove a statement that is no longer true
remove comment about a dead method.

llvm-svn: 20486
2005-03-06 06:00:13 +00:00
Chris Lattner
19d1c03311 the only caller of insertEntry is insert, inline it and remove insertEntry
llvm-svn: 20485
2005-03-06 05:56:02 +00:00
Chris Lattner
86fe3a1fdb rename insertEntry to insert
llvm-svn: 20484
2005-03-06 05:55:40 +00:00
Chris Lattner
533805e6da Merge SymbolTable::removeEntry into SymbolTable::remove, its only caller
llvm-svn: 20483
2005-03-06 05:51:09 +00:00
Chris Lattner
7dfb29d5cb remove this method.
llvm-svn: 20482
2005-03-06 05:50:49 +00:00
Chris Lattner
290d881f84 Delete the really inefficient method: void remove(const Type* Typ);
Speed up the symbol stripping code by avoiding a linear search of the
type table.

Get rid of removeEntry(type_iterator), since 'remove' is exactly the same
operation.

llvm-svn: 20481
2005-03-06 05:46:41 +00:00
Chris Lattner
aa4138a5da Delete the really inefficient method: void remove(const Type* Typ);
Get rid of removeEntry(type_iterator), since 'remove' is exactly the same
operation.

llvm-svn: 20480
2005-03-06 05:46:00 +00:00
Chris Lattner
1b032f59e7 Make this MUCH faster by avoiding a linear search in the symbol table code.
llvm-svn: 20479
2005-03-06 05:42:36 +00:00
Chris Lattner
bcd8393d50 InternallyInconsistent is dead!
llvm-svn: 20478
2005-03-06 05:22:05 +00:00
Chris Lattner
bad0e7e2d9 Remove some really gross and hard to understand code now that
InternallyInconsistent is always false.

llvm-svn: 20477
2005-03-06 05:21:40 +00:00
Chris Lattner
cd56f5a8e4 Simplify some code.
llvm-svn: 20476
2005-03-06 05:13:42 +00:00
Chris Lattner
6be3b418e7 remove these dead methods.
llvm-svn: 20475
2005-03-06 02:38:24 +00:00
Chris Lattner
eb9a12cbce remove these methods.
llvm-svn: 20474
2005-03-06 02:37:47 +00:00
Chris Lattner
807db03233 These methods are removed.
llvm-svn: 20473
2005-03-06 02:37:21 +00:00
Chris Lattner
8a982e10be simplify and speed up some code
llvm-svn: 20472
2005-03-06 02:32:00 +00:00
Chris Lattner
c9b0984666 simplify some code.
llvm-svn: 20471
2005-03-06 02:28:23 +00:00
Chris Lattner
8344ba0dac nuke some dead methods.
llvm-svn: 20470
2005-03-06 02:25:02 +00:00
Chris Lattner
ffb3778f87 This fixes PR531, a crash when running the CBE on a bytecode file.
The problem is that Function::renameLocalSymbols is iterating through
the symbol table planes, occasionally calling setName to rename a value
(which used to do a symbol table remove/insert pair).

The problem is that if there is only a single value in a particular type
plane that the remove will nuke the symbol table plane, and the insert
will create and insert a new one.  This hoses Function::renameLocalSymbols
because it has an iterator to the old plane, under the (very reasonable)
assumption that simply renaming a value won't cause the type plane to
disappear.

This patch fixes the bug by making the rename operation a single atomic
operation, which has a side effect of making the whole thing faster too. :)

llvm-svn: 20469
2005-03-06 02:14:28 +00:00
Chris Lattner
bb28bfdcbf Add a new method, allow symtab to poke name.
llvm-svn: 20468
2005-03-06 02:10:40 +00:00
Jeff Cohen
4abcea3a69 Reformat comments to fix 80 columns.
llvm-svn: 20467
2005-03-05 22:45:40 +00:00
Jeff Cohen
be37fa07fd Reuse induction variables created for strength-reduced GEPs by other similar GEPs.
llvm-svn: 20466
2005-03-05 22:40:34 +00:00
Chris Lattner
9d0ac507ba remove extraneous spaces from argument lists.
llvm-svn: 20465
2005-03-05 19:58:40 +00:00
Chris Lattner
cdb9bfc150 remove all of the various setName implementations, consolidating them into
Value::setName, which is no longer virtual.

llvm-svn: 20464
2005-03-05 19:51:50 +00:00
Chris Lattner
6d0a24c608 second argument to Value::setName is now gone.
llvm-svn: 20463
2005-03-05 19:05:20 +00:00
Chris Lattner
7c832fb0b2 Make sure the two arguments of a setcc instruction point to the same node.
llvm-svn: 20462
2005-03-05 19:04:31 +00:00
Chris Lattner
aa72c889a6 zap
llvm-svn: 20461
2005-03-05 19:04:07 +00:00
Chris Lattner
f66165674f 2nd arg to setName goes away.
llvm-svn: 20460
2005-03-05 19:02:15 +00:00
Chris Lattner
cc77b84fcb Constants never get names.
llvm-svn: 20459
2005-03-05 19:01:59 +00:00
Chris Lattner
ed2fb1cf93 Remove the 2nd argument to Value::setName
llvm-svn: 20458
2005-03-05 19:01:49 +00:00
Chris Lattner
f18c871b58 Remove the second argument to Value::setName, it is never needed.
llvm-svn: 20457
2005-03-05 18:59:36 +00:00
Chris Lattner
15ac102737 New testcase for PR533
llvm-svn: 20456
2005-03-05 18:47:28 +00:00
Chris Lattner
f246ef3e2f don't break the build on 32-bit hosts.
llvm-svn: 20455
2005-03-05 17:47:38 +00:00
Chris Lattner
02f0d7bcc9 This file is all commented out.
llvm-svn: 20454
2005-03-05 17:28:37 +00:00
Andrew Lenharth
7c954c6d13 fix data size stuff for architectures with bit challenged data types
llvm-svn: 20453
2005-03-05 15:30:33 +00:00
Chris Lattner
cfe2822cdf Do not compute 1ULL << 64, which is undefined. This fixes Ptrdist/ks on the
sparc, and testcase Regression/Transforms/InstCombine/2005-03-04-ShiftOverflow.ll

llvm-svn: 20445
2005-03-04 23:21:33 +00:00
Chris Lattner
6cc4ee0f24 Testcase for a bug that caused us to miscompile ptrdist/ks on sparc.
llvm-svn: 20444
2005-03-04 23:20:46 +00:00
Andrew Lenharth
f3cd1477c3 fix up stack pointer adjustments
llvm-svn: 20442
2005-03-04 21:40:02 +00:00
Chris Lattner
c01e2f76c3 Trivial cleanup patch
llvm-svn: 20436
2005-03-04 20:27:46 +00:00
Andrew Lenharth
8df62dda57 fix FCMOVxx typo, set rem and div to hardcode target reg to be the same as the one the assembler uese, update ISel to put values in regs used by assembler for rem and div
llvm-svn: 20434
2005-03-04 20:09:23 +00:00
Jeff Cohen
a2c59b7423 Add support for not strength reducing GEPs where the element size is a small
power of two.  This emphatically includes the zeroeth power of two.

llvm-svn: 20429
2005-03-04 04:04:26 +00:00
Andrew Lenharth
f0ab14aa24 turn on IEEE for compares
llvm-svn: 20425
2005-03-03 22:12:11 +00:00
Andrew Lenharth
6a5f52d15a beter Select on FP
llvm-svn: 20424
2005-03-03 21:47:53 +00:00
Chris Lattner
00ee68c612 Print -X like this:
double test(double l1_X) {
  return (-l1_X);
}

instead of like this:

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

llvm-svn: 20423
2005-03-03 21:12:04 +00:00
Andrew Lenharth
00348ce902 LSR cleanup patch
llvm-svn: 20422
2005-03-03 19:03:21 +00:00
Chris Lattner
1a678c67c9 Do not lower malloc's to pass "sizeof" expressions like this:
ltmp_0_7 = malloc(((unsigned )(&(((signed char (*)[784])/*NULL*/0)[1u]))));

Instead, just emit the literal constant, like this:

  ltmp_0_7 = malloc(784u);

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

llvm-svn: 20415
2005-03-03 01:04:50 +00:00
Chris Lattner
ef1e989e4f Add an optional argument to lower to a specific constant value instead of
to a "sizeof" expression.

llvm-svn: 20414
2005-03-03 01:03:43 +00:00
Chris Lattner
3b5667c579 Add an argument.
llvm-svn: 20413
2005-03-03 01:03:10 +00:00
Misha Brukman
f090d1b3ab Fix the spelling of the word `the'
llvm-svn: 20412
2005-03-02 23:17:31 +00:00
Chris Lattner
4d8689edcb Print the module ID as a comment.
llvm-svn: 20411
2005-03-02 23:12:40 +00:00
Chris Lattner
5b5caaf3cd cleanup the cfg after lsr
llvm-svn: 20410
2005-03-02 21:56:00 +00:00
Andrew Lenharth
180a04a4bb remove 32 sign extend after 32 sextload and handle small negative constant
llvm-svn: 20408
2005-03-02 17:23:03 +00:00
Andrew Lenharth
ed4b6488a7 Added LSR as a beta pass for alpha
llvm-svn: 20407
2005-03-02 17:21:38 +00:00
Chris Lattner
c8bb99760a Add a temporary option for llc-beta: -enable-lsr-for-ppc, which turns on
Loop Strength Reduction.

llvm-svn: 20399
2005-03-02 06:19:22 +00:00
Reid Spencer
a556669219 Be slightly more accurate in an error message.
llvm-svn: 20397
2005-03-02 05:45:56 +00:00
Chris Lattner
fe760deb75 Fix a nasty order of evaluation bug that Gabor Greif ran into. Here's an
explanation from IRC:

	|sabre|	I think it's an order of evaluation thing
	|sabre|	for me, the RHS of the assignment is evaluated first
	|sabre|	getTypeDescription checks to see if ConcreteTypeDescription[Ty] contains anything
	|sabre|	since it doesn't, it computes and returns the value
	|sabre|	this gets put into the map.
	|sabre|	For you, the LHS is evaluated first.
	|sabre|	Map[Ty] (aka ConcreteTypeDescriptions[Ty]) inserts an empty string into the map, returning a reference
	|sabre|	getTypeDesc then sees the empty string in the map
	|sabre|	and returns it
	|sabre|	bork :)

llvm-svn: 20394
2005-03-02 03:54:43 +00:00
Chris Lattner
884ebd4c79 Now that type does not derive from Value, these do not need to be virtual.
llvm-svn: 20393
2005-03-02 03:43:55 +00:00
Misha Brukman
e4fad6b70f Fix HTML-4.01 Strict compliance
llvm-svn: 20386
2005-03-01 17:19:21 +00:00
Misha Brukman
a9b8676393 Use a colon instead of a period since we're introducing a command list
llvm-svn: 20385
2005-03-01 17:15:23 +00:00
Reid Spencer
fefb9ea94d Correct a typo in Makefile.rules.
Patch idea contributed by Vladimir Merzliakov.

llvm-svn: 20384
2005-03-01 16:27:06 +00:00
Jeff Cohen
8ea6f9e821 Fixed the following LSR bugs:
* Loop invariant code does not dominate the loop header, but rather
    the end of the loop preheader.

  * The base for a reduced GEP isn't a constant unless all of its
    operands (preceding the induction variable) are constant.

  * Allow induction variable elimination for the simple case after all.

Also made changes recommended by Chris for properly deleting
instructions.

llvm-svn: 20383
2005-03-01 03:46:11 +00:00
Alkis Evlogimenos
b3846f4b06 Lower llvm.isunordered(a, b) into a != a | b != b.
llvm-svn: 20382
2005-03-01 02:07:58 +00:00
Chris Lattner
ff851073f6 cleanup my miswording
llvm-svn: 20381
2005-02-28 19:47:14 +00:00
Chris Lattner
12328e9378 Remove tabs from file.
llvm-svn: 20380
2005-02-28 19:36:15 +00:00
Chris Lattner
5d43cbc6ac Add a test for llvm.prefetch.
llvm-svn: 20379
2005-02-28 19:31:42 +00:00
Chris Lattner
811107350a Add support to the C backend for llvm.prefetch. Patch contributed by
Justin Wick!

llvm-svn: 20378
2005-02-28 19:29:46 +00:00
Chris Lattner
1772c1a672 recognize llvm.prefetch. Patch contributed by Justin Wick!
llvm-svn: 20377
2005-02-28 19:28:00 +00:00
Chris Lattner
39637ef023 Verify llvm.prefetch.
llvm-svn: 20376
2005-02-28 19:27:42 +00:00
Chris Lattner
c87e03aeea Lower prefetch to a noop, patch contributed by Justin Wick!
llvm-svn: 20375
2005-02-28 19:27:23 +00:00
Chris Lattner
816cc5e10d Add a prefetch intrinsic, patch contributed by Justin Wick!
llvm-svn: 20374
2005-02-28 19:25:57 +00:00
Chris Lattner
c8a2c22f36 Document llvm.prefetch, patch contributed by Justin Wick!
llvm-svn: 20373
2005-02-28 19:24:19 +00:00
Andrew Lenharth
76eff48195 fix integer division and stuff
llvm-svn: 20372
2005-02-28 17:22:18 +00:00
Chris Lattner
81c1dd2a06 Adam Treat implemented this :)
llvm-svn: 20371
2005-02-28 16:52:28 +00:00
Reid Spencer
9947c42037 Changes to enable creation of native executables directly from gccld and to
ensure that -L paths don't contain both bytecode and native libraries.
This patch contributed by Adam Treat.

llvm-svn: 20370
2005-02-28 08:45:35 +00:00
Reid Spencer
35cb2f49c4 A few small steps toward HTML 4.01 Strict compliance.
llvm-svn: 20369
2005-02-28 01:10:48 +00:00
Reid Spencer
da132f2fdf Add a little more detail about the configuration process for projects.
llvm-svn: 20368
2005-02-28 00:40:29 +00:00
Jeff Cohen
dcaa48b5c4 Fix crash in LSR due to attempt to remove original induction variable. However,
for reasons explained in the comments, I also deactivated this code as it needs
more thought.

llvm-svn: 20367
2005-02-28 00:08:56 +00:00
Jeff Cohen
fd63d3af0d PHI nodes were incorrectly placed when more than one GEP is reduced in a loop.
llvm-svn: 20360
2005-02-27 21:08:04 +00:00
Jeff Cohen
39751c3b7c First pass at improved Loop Strength Reduction. Still not yet ready for prime time.
llvm-svn: 20358
2005-02-27 19:37:07 +00:00
Chris Lattner
c6e3380fd7 Bug fixed
llvm-svn: 20357
2005-02-27 19:31:02 +00:00
Chris Lattner
cf1359ddf5 New testcase for PR529
llvm-svn: 20356
2005-02-27 19:28:30 +00:00
Chris Lattner
2fe7b71936 Fix this to create a recursive mutex. Patch by Evan Jones!
llvm-svn: 20355
2005-02-27 19:07:36 +00:00
Chris Lattner
7f32c4aa36 Use const iterators where possible. Patch by Evan Jones!
llvm-svn: 20354
2005-02-27 19:06:10 +00:00
Chris Lattner
eeffe8eea3 Rename include guard, patch contributed by Evan Jones!
llvm-svn: 20353
2005-02-27 19:05:24 +00:00
Chris Lattner
7561ca1d15 Teach globalopt how memset/cpy/move affect memory, to allow better optimization.
llvm-svn: 20352
2005-02-27 18:58:52 +00:00
Chris Lattner
a1079acb0a new testcase globalopt should handle.
llvm-svn: 20351
2005-02-27 18:48:19 +00:00
Chris Lattner
19d4ab642f new testcase globalopt should implement
llvm-svn: 20350
2005-02-27 18:47:17 +00:00
Chris Lattner
5042453bb8 Test that a global is marked constant when it can be.
llvm-svn: 20349
2005-02-27 18:19:26 +00:00
Alkis Evlogimenos
24340589c0 Add llc to tools.
llvm-svn: 20345
2005-02-27 10:21:37 +00:00
Chris Lattner
0ce80cd542 Fix spelling, patch contributed by Gabor Greif!
llvm-svn: 20343
2005-02-27 06:18:25 +00:00
Chris Lattner
dc166eb8f7 Fix spelling, patch contributed by Gabor Greif
llvm-svn: 20342
2005-02-27 06:15:51 +00:00
Chris Lattner
600420647f Fix misspellings, patch contributed by Gabor Greif!
llvm-svn: 20341
2005-02-27 06:14:21 +00:00
Chris Lattner
5315aa0ec6 Remove some stuff I checked in accidentally
llvm-svn: 20340
2005-02-27 04:32:35 +00:00
Chris Lattner
0b0f3520cb DCE a dead function
llvm-svn: 20339
2005-02-26 23:36:45 +00:00
Reid Spencer
709e10ed92 Implement an isBytecodeArchive method to determine if an archive contains
bytecode file members or not.
Patch Contributed By Adam Treat

llvm-svn: 20338
2005-02-26 22:00:32 +00:00
Chris Lattner
f05d2b3178 1 + 100 + 51 == 152, not 52.
If we fold three constants together (c1+c2+c3), make sure to keep
LHSC updated, instead of reusing (in this case), the 1 instead of the
partial sum.

llvm-svn: 20337
2005-02-26 18:50:19 +00:00
Chris Lattner
67bf757d0a A testcase that we miscompile, noticed from the demo page.
llvm-svn: 20336
2005-02-26 18:49:04 +00:00
Chris Lattner
435829f89b Fix a case where we incorrectly returned hasComputableLoopEvolution for
a ternary commutative expr.  Remove FIXME that does not need to be fixed
(can't happen).

llvm-svn: 20335
2005-02-26 18:40:02 +00:00
Chris Lattner
cc6d75fddf remove extraneous cast
llvm-svn: 20334
2005-02-26 18:33:28 +00:00
Andrew Lenharth
10bc4c0ff6 make BB labels be exported for debuging, add fp negation optimization, further pecimise the FP instructions
llvm-svn: 20332
2005-02-25 22:55:15 +00:00
Chris Lattner
37d554759b add an entry, add links to entries for demo page.
llvm-svn: 20328
2005-02-25 20:30:21 +00:00
Chris Lattner
e99ee2b35d Handle null a bit more carefully.
Actually teach dsa about select instructions.  This doesn't affect the
graph in any way other than not setting a spurious U marker on pointer
nodes that are selected.

llvm-svn: 20324
2005-02-25 01:27:48 +00:00
Reid Spencer
e447fce542 Use DataInstall macro instead of INSTALL.
llvm-svn: 20322
2005-02-24 21:43:43 +00:00
Reid Spencer
895e00b418 Remove a -C I forgot to remove earlier.
llvm-svn: 20321
2005-02-24 21:41:26 +00:00
Reid Spencer
dcc5375d49 Don't try to strip bytecode files!
llvm-svn: 20320
2005-02-24 21:36:32 +00:00
Reid Spencer
d77a4c0660 The install program doesn't know how to strip bytecode files so install
bytecode as data, not program.

llvm-svn: 20319
2005-02-24 21:30:37 +00:00
Reid Spencer
e6684c8c82 For PR528:
Use the DataInstall and MKDIR macros instead of using $(INSTALL) directly

llvm-svn: 20318
2005-02-24 21:28:08 +00:00
Chris Lattner
468fd33abb This instruction:
X = gep null, ...

Used to not create a scalar map entry for X, which caused clients to barf.
This is bad.

llvm-svn: 20316
2005-02-24 19:55:31 +00:00
Reid Spencer
eeedeaff99 Adjust to changes needed to more easily support projects via the new
LLVM_CONFIG_PROJECT macro.

llvm-svn: 20313
2005-02-24 19:05:19 +00:00
Reid Spencer
206bed0b97 Update to reflect various changes in the autoconf directory. THe
recommended configuration of projects is now much simplified and depends
on LLVM file presence rather than local project file presence.

llvm-svn: 20312
2005-02-24 18:53:47 +00:00
Reid Spencer
51d736301a Remove auxilliary files that are now picked up from llvm/autoconf. This
avoids version conflict problems with ltmain.sh (libtool), mkinstalldirs
and install-sh. This prevents projects from becoming stale when the LLVM
build system is upgraded or modified.

llvm-svn: 20311
2005-02-24 18:52:22 +00:00
Reid Spencer
0354a9ce35 * Move all the "standard" configuration stuff to the start of the file
* Make the auxilliary directory be llvm/autoconf not the project's
* Use the LLVM_CONFIG_PROJECT macro to get the --with-llvm{src,obj} args

llvm-svn: 20310
2005-02-24 18:50:53 +00:00
Reid Spencer
797f910736 Don't put generated files into CVS.
llvm-svn: 20309
2005-02-24 18:49:37 +00:00
Chris Lattner
d13cc49e19 Fix a bug introduced by revision 1.187 of this file.
llvm-svn: 20308
2005-02-24 18:48:07 +00:00
Reid Spencer
07068a53ab * Fix an output message
* Make aclocal look in LLVM's autoconf/m4 directory for macros
* Don't force generation of missing files

llvm-svn: 20307
2005-02-24 18:42:34 +00:00
Andrew Lenharth
904650cdd0 fix Allocas. Really. I mean it this time.
llvm-svn: 20306
2005-02-24 18:36:32 +00:00
Reid Spencer
f3102c287d Add a call to AC_CONFIG_COMMANDS to ensure that llvm_src is set properly
in the config.status script. This allows the AC_CONFIG_MAKEFILE macro to
work properly after it was changed to support sub-projects.

llvm-svn: 20305
2005-02-24 18:31:27 +00:00
Reid Spencer
28f7cd3216 This macro cannot assume that the location of install-sh and mkinstalldirs
is in ${srcdir}/autoconf because that is only true if the project is LLVM.
For other projects (e.g. sample), we don't want to have to distribute the
mkinstalldirs or install-sh programs because it opens a window of breakage
for projects. So, this change requires that the llvm_src variable be set
up via another AC_CONFIG_COMMANDS call. For LLVM this is done in the
configure.ac. For projects its done in the LLVM_CONFIG_PROJECT macro.

llvm-svn: 20304
2005-02-24 18:28:20 +00:00
Reid Spencer
76d99df157 Add a new macro for configuring projects, LLVM_CONFIG_PROJECT. This macro
takes care of the --with-llvmsrc and --with-llvmobj options for the project
It was moved here from the project's configure.ac file because there is
some tricky handling of the llvm_src variable to tell the project where the
llvm source tree is (for mkinstalldirs and install-sh commands).

llvm-svn: 20303
2005-02-24 18:25:24 +00:00
Chris Lattner
08f7d0c262 Fix some problems where the verifier would crash on invalid input instead of
reporting the problem and exiting.

llvm-svn: 20302
2005-02-24 16:58:29 +00:00
Reid Spencer
247a10e729 Fix the other half of PR528 .. don't try to strip header files!
llvm-svn: 20301
2005-02-24 07:12:43 +00:00
Chris Lattner
1cca959e5d Implement Transforms/SimplifyCFG/switch_thread.ll
This does a simple form of "jump threading", which eliminates CFG edges that
are provably dead.  This triggers 90 times in the external tests, and
eliminating CFG edges is always always a good thing! :)

llvm-svn: 20300
2005-02-24 06:17:52 +00:00
Chris Lattner
c0968c72ff new testcase for a simple optimization that simplifycfg is about to do.
All CFG edges to DEAD should be eliminated.

llvm-svn: 20299
2005-02-24 06:15:27 +00:00
Chris Lattner
47ac187c08 switch instructions only allow constantints for their values, be more specific.
llvm-svn: 20298
2005-02-24 05:32:09 +00:00
Chris Lattner
75f5b42624 use more specific cast.
llvm-svn: 20297
2005-02-24 05:26:04 +00:00
Chris Lattner
fc824c1a7e add more checking
llvm-svn: 20296
2005-02-24 05:25:17 +00:00
Chris Lattner
5f0df0c1e6 Do not read free'd memory when printing an error message.
llvm-svn: 20295
2005-02-24 04:59:49 +00:00
Reid Spencer
c43b1d403e For PR528:
* Consolidate all "install" usage to the install program/script found by
  autoconf which includes the autoconf/install-sh script if necessary
* Change Makefile.rules to not use the -D flag to install but use the
  MKDIR command as necessary.
* Change Makefile.rules to differentiate between installation of executable
  files and regular data files to get the permission modes correct.

llvm-svn: 20294
2005-02-24 03:56:32 +00:00
Chris Lattner
ce046ac9c6 add a new method.
llvm-svn: 20293
2005-02-24 02:37:26 +00:00
Tanya Lattner
ee47100d44 Only print out machine instructions before modulo scheduling if we are actually doing modulo scheduling! :)
llvm-svn: 20292
2005-02-24 02:14:44 +00:00
Chris Lattner
272f3527a3 add another testcase to make sure it gets turned into a switch (answer: yes it does)
llvm-svn: 20291
2005-02-24 02:13:50 +00:00
Andrew Lenharth
27cf4eb1c7 Ah the problems you have to fix when you stray from the One True Way (TM)
llvm-svn: 20290
2005-02-23 17:33:42 +00:00
Chris Lattner
25169caa80 make this more efficient. Scan up to 16 nodes, not the whole list.
llvm-svn: 20289
2005-02-23 16:53:04 +00:00
Chris Lattner
d36552f34f new method
llvm-svn: 20288
2005-02-23 16:51:11 +00:00
Chris Lattner
8a504447f7 Add new method.
llvm-svn: 20287
2005-02-23 16:50:59 +00:00
Chris Lattner
cf08c21f2c Reduce the amount of searching this assertion does. On a testcase of mine,
this reduces the time for -simplifycfg in a debug build from 106s to 14.82s

llvm-svn: 20286
2005-02-23 07:09:08 +00:00
Chris Lattner
5e166a5f3e Fix a bugpoint crash that JeffC noticed, looking like this:
*** Attempting to perform final cleanups: Final cleanups failed.  Sorry. :(  Ple
ase report a bug!

<llc>llc.exe: bytecode didn't read correctly.
llc.exe: bytecode didn't read correctly.
<crash>
Assertion failed: M && "You can't write a null module!!", file c:\llvm\lib\bytec
ode\writer\writer.cpp, line 1094


The fact that llc bombed (in this case) is ok, but bugpoint shouldn't crash after this.

llvm-svn: 20285
2005-02-23 06:12:11 +00:00
Chris Lattner
80c5b97046 Silence some uninit variable warnings.
llvm-svn: 20284
2005-02-23 05:57:21 +00:00
Tanya Lattner
a31ad5172e Fixed bug in findAllcircuits. Fixed branch addition to schedule. Added debug information.
llvm-svn: 20280
2005-02-23 02:01:42 +00:00
Chris Lattner
5cf3521883 remove some more dead templates and a dead macro.
llvm-svn: 20279
2005-02-22 23:36:37 +00:00
Andrew Lenharth
ccdfdd7aee oops
llvm-svn: 20278
2005-02-22 23:29:25 +00:00
Chris Lattner
3166471603 Remove use of bind_obj, deleter, and finegrainify namespacification.
llvm-svn: 20277
2005-02-22 23:27:21 +00:00
Chris Lattner
52e931b37d Remove use of bind_obj
llvm-svn: 20276
2005-02-22 23:22:58 +00:00
Chris Lattner
2c07348696 Remove a bunch of dead templates.
llvm-svn: 20275
2005-02-22 23:19:42 +00:00
Chris Lattner
06b6c4bbde C++ is not a functional programming language.
llvm-svn: 20274
2005-02-22 23:13:58 +00:00
Andrew Lenharth
7ac0143fa6 dynamic stack allocas
llvm-svn: 20273
2005-02-22 21:59:48 +00:00
Chris Lattner
a474313902 Fix a bug in the 'store fpimm, ptr' -> 'store intimm, ptr' handling code.
Changing 'op' here caused us to not enter the store into a map, causing
reemission of the code!!  In practice, a simple loop like this:

no_exit:                ; preds = %no_exit, %entry
        %indvar = phi uint [ %indvar.next, %no_exit ], [ 0, %entry ]            ; <uint> [#uses=3]
        %tmp.4 = getelementptr "complex long double"* %P, uint %indvar, uint 0          ; <double*> [#uses=1]
        store double 0.000000e+00, double* %tmp.4
        %indvar.next = add uint %indvar, 1              ; <uint> [#uses=2]
        %exitcond = seteq uint %indvar.next, %N         ; <bool> [#uses=1]
        br bool %exitcond, label %return, label %no_exit

was being code gen'd to:

.LBBtest_1:     # no_exit
        movl %edx, %esi
        shll $4, %esi
        movl $0, 4(%eax,%esi)
        movl $0, (%eax,%esi)
        incl %edx
        movl $0, (%eax,%esi)
        movl $0, 4(%eax,%esi)
        cmpl %ecx, %edx
        jne .LBBtest_1  # no_exit

Note that we are doing 4 32-bit stores instead of 2.  Now we generate:

.LBBtest_1:     # no_exit
        movl %edx, %esi
        incl %esi
        shll $4, %edx
        movl $0, (%eax,%edx)
        movl $0, 4(%eax,%edx)
        cmpl %ecx, %esi
        movl %esi, %edx
        jne .LBBtest_1  # no_exit

This is much happier, though it would be even better if the increment of ESI
was scheduled after the compare :-/

llvm-svn: 20265
2005-02-22 07:23:39 +00:00
Andrew Lenharth
5ab3986e49 no longer build as a shared library
llvm-svn: 20264
2005-02-22 04:58:26 +00:00
Chris Lattner
25170b0177 add another plausible reason
llvm-svn: 20262
2005-02-21 16:35:31 +00:00
Chris Lattner
b3dd24435f new testcase for PR523
llvm-svn: 20261
2005-02-21 04:03:32 +00:00
Chris Lattner
3a8f68e4cb Bug fixed.
llvm-svn: 20260
2005-02-20 23:31:49 +00:00
Chris Lattner
8a8f9032c3 New testcase for PR522.
llvm-svn: 20259
2005-02-20 23:29:23 +00:00
Chris Lattner
ec3f094489 Fix problems running the HowToUseJIT on powerpc, and probably problems with
ANY program that does not have all functions internalized.

llvm-svn: 20258
2005-02-20 18:43:35 +00:00
Jeff Cohen
18cf7ebcee Fix silly mistake.
llvm-svn: 20256
2005-02-20 02:48:51 +00:00
Jeff Cohen
4220bf5726 Implement standard I/O redirection in ExecuteAndWait().
llvm-svn: 20255
2005-02-20 02:43:04 +00:00
Chris Lattner
e68dae0eb6 Add support for ".so" files compiled with LLVM which contain LLVM bytecode.
llvm-svn: 20253
2005-02-19 18:30:29 +00:00
Chris Lattner
fe723a7c05 Eliminate silly warnings from the linker of the form:
WARNING: Type conflict between types named 'union.._604.'.
    Src=' %union.._604.'.
   Dest=' %union.._604.'
llvm-svn: 20252
2005-02-19 17:52:37 +00:00
Chris Lattner
3d6194f8cc typeo
llvm-svn: 20251
2005-02-19 17:17:32 +00:00
Chris Lattner
fdff9e7d0d New entry.
llvm-svn: 20250
2005-02-19 17:14:24 +00:00
Chris Lattner
6a3ae64639 Bug fixed.
llvm-svn: 20249
2005-02-19 17:13:20 +00:00
Chris Lattner
e98b480b2e Testcase for PR520
llvm-svn: 20248
2005-02-19 17:07:48 +00:00
Chris Lattner
a94f9ffd0e Adjust this test to pass after recent CFE changes. We now generate:
%XX = global int cast (int* getelementptr ([2 x int]* getelementptr (%struct.S* null, int 0, uint 0), int 0, int 1) to int)

which is the literal translation of the testcase :)

llvm-svn: 20247
2005-02-19 07:31:54 +00:00
Chris Lattner
48c23141a2 Bug fixed.
llvm-svn: 20246
2005-02-19 07:29:25 +00:00
Chris Lattner
4fec95cd4d Make this testcase harder, to test the read case as well.
llvm-svn: 20245
2005-02-19 06:56:46 +00:00
Chris Lattner
e22674c706 new testcase.
llvm-svn: 20244
2005-02-19 06:54:44 +00:00
Jeff Cohen
07e22ba2c7 Change __MINGW to __MINGW32__. Patch submitted by Henrik Bach.
llvm-svn: 20243
2005-02-19 03:01:13 +00:00
Chris Lattner
16fb0037c4 Fix a bug.
llvm-svn: 20242
2005-02-19 02:22:14 +00:00
Reid Spencer
9756aea1cb Quote the value of the PATH variable so that Cygwin and Windows can have
spaces in path names and not confuse the shell.

llvm-svn: 20241
2005-02-18 20:24:09 +00:00
Reid Spencer
75542d4e78 Allow dejagnu tests to run on Windows/Cygwin. Quote the value of the PATH
variable so that spaces don't screw it up.

llvm-svn: 20240
2005-02-18 20:17:44 +00:00
Reid Spencer
63eb0aa52a Adjust the help output so that it will fit cleanly within 80 columns.
llvm-svn: 20239
2005-02-18 20:00:05 +00:00
Misha Brukman
634b0a3b7e * llvmc does not have a -V switch
* --config-file is really --config-dir, according to `llvmc --help'

llvm-svn: 20238
2005-02-18 18:00:53 +00:00
Jeff Cohen
81549a57b8 Make PreventCoreFiles() do the right thing on Windows.
llvm-svn: 20237
2005-02-18 07:05:18 +00:00
Misha Brukman
3703685b1a Remove colloquialisms from the documentation.
llvm-svn: 20233
2005-02-17 22:22:24 +00:00
Misha Brukman
20430321c2 Fix compilation errors with VS 2005, patch contributed by Aaron Gray.
llvm-svn: 20232
2005-02-17 21:40:27 +00:00
Misha Brukman
73e929f89d Fix compilation errors with VS 2005, patch by Aaron Gray.
llvm-svn: 20231
2005-02-17 21:39:27 +00:00
Chris Lattner
381dddc90c Don't rely on doubles comparing identical to each other, which doesn't work
for 0.0 and -0.0.

llvm-svn: 20230
2005-02-17 20:17:32 +00:00
Chris Lattner
67395c2002 Map doubles from integers, not the double itself.
llvm-svn: 20229
2005-02-17 20:16:58 +00:00
Chris Lattner
0c56a548ed Don't sink argument loads into loops or other bad places. This disables folding of argument loads with instructions that are not in the entry block.
llvm-svn: 20228
2005-02-17 19:40:32 +00:00
Chris Lattner
7b5d9e2217 Do not mark obviously unreachable blocks live when processing PHI nodes,
and handle incomplete control dependences correctly.  This fixes:

Regression/Transforms/ADCE/dead-phi-edge.ll
  -> a missed optimization

Regression/Transforms/ADCE/dead-phi-edge.ll
  -> a compiler crash distilled from QT4

llvm-svn: 20227
2005-02-17 19:28:49 +00:00
Chris Lattner
854c086e0f New files, testing for a crash in ADCE compiling QT and a missed optimization.
llvm-svn: 20226
2005-02-17 19:27:44 +00:00
Chris Lattner
47555decfb Scary typo that fixes Regression/Transforms/IndVarsSimplify/2005-02-17-TruncateExprCrash.ll
and PR515.

llvm-svn: 20224
2005-02-17 16:54:16 +00:00
Chris Lattner
02fd7d1d56 new testcase for PR515
llvm-svn: 20223
2005-02-17 16:53:41 +00:00
Reid Spencer
53e86c13f6 Remove the "pax" program from the list of those needed to support LLVM.
The install target in Makefile.rules no longer uses pax but just uses find
and "install" instead.

llvm-svn: 20216
2005-02-16 16:21:00 +00:00
Reid Spencer
e386b72d21 Fix installation of configuration files.
llvm-svn: 20215
2005-02-16 16:17:11 +00:00
Reid Spencer
fe0a01ee25 * Don't flatten the directory hierarchy when installing headers
* Make it possible to have the Install program run in verbose mode when
  the TOOL_VERBOSE=1 option is set
* Ensure non-executable installed files do not install with execute perms.

llvm-svn: 20214
2005-02-16 16:13:02 +00:00
Reid Spencer
48a82f49bd Don't use pax for installing header files. Use the install program instead.
llvm-svn: 20213
2005-02-16 15:54:03 +00:00
Jeff Cohen
cce4b92601 Somehow tablegen.exe got moved... fix up tablegen invocations to match.
llvm-svn: 20212
2005-02-16 05:06:52 +00:00
Jeff Cohen
81d26d168d Get bugpoint compiling with VC++ again, not that it works anyway.
llvm-svn: 20211
2005-02-16 05:05:31 +00:00
Jeff Cohen
97a41e238e Arg list already has program name in it.
llvm-svn: 20208
2005-02-16 04:43:45 +00:00
Tanya Lattner
c28fd0db2e Fixed node deletion bug.
llvm-svn: 20207
2005-02-16 04:00:59 +00:00
Chris Lattner
3e7a193bd7 Instead of doing a manual comparison loop, just use memcmp, thanks to JohnC
for the suggestion! :)

llvm-svn: 20203
2005-02-15 22:12:10 +00:00
Chris Lattner
9d0db6f602 Make this more efficient now that we know both files are the same length.
llvm-svn: 20202
2005-02-15 22:01:43 +00:00
Misha Brukman
f232a4582d Fix spelling
llvm-svn: 20201
2005-02-15 21:59:53 +00:00
Reid Spencer
f4425b0208 Adjust DiffFilesWithTolerance to help poor cygwin's mmap facility by
handling zero length files a little more intelligently. If both files are
zero length then we return 0 (true) indicating a match. If only one of the
files is zero length then we return 1 (false) indicating that the files
differ. If the files don't agree in length then they can't match so we
skip the first loop that looks for a quick match.

llvm-svn: 20200
2005-02-15 21:47:02 +00:00
Andrew Lenharth
5f7c53599e add Alpha to llc
llvm-svn: 20198
2005-02-15 21:14:09 +00:00
Chris Lattner
915fd0de4b Fix a problem where the PPC backend lost track of the fact that it had
to save and restore the LR register on entry and exit of a leaf function
that needed to access globals or the constant pool.  This should hopefully
fix oscar from sending the PPC tester spinning out of control.

llvm-svn: 20197
2005-02-15 20:26:49 +00:00
Chris Lattner
3e708301d2 Add a sanity check.
llvm-svn: 20195
2005-02-15 18:48:48 +00:00
Chris Lattner
219002ed8f Add a new method to make it easy to update graphs.
llvm-svn: 20194
2005-02-15 18:40:55 +00:00
Chris Lattner
385a47394a Bug fixed
llvm-svn: 20193
2005-02-15 07:02:12 +00:00
Chris Lattner
3bef66fcf3 Fix volatile load/store of pointers. Consider this testcase:
void %test(int** %P) {
  %A = volatile load int** %P
  ret void
}

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

instead of emitting:

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

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

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

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

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

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

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

llvm-svn: 20191
2005-02-15 05:52:14 +00:00
Chris Lattner
1f031b20fe Bug fixed.
llvm-svn: 20190
2005-02-15 05:28:06 +00:00
Chris Lattner
1a9cbe67ed New testcase for PR510.
llvm-svn: 20189
2005-02-15 05:18:05 +00:00
Chris Lattner
be895eda63 wow, interesting typo :)
llvm-svn: 20187
2005-02-14 22:58:38 +00:00
Chris Lattner
7027143f0a execution tests shouldn't go here. This was killing the PPC nightly tester.
llvm-svn: 20186
2005-02-14 21:54:32 +00:00
Reid Spencer
e9fa5444c5 For PR496:
When llvm-gcc is not available, bypass rules for Modules and Bytecode
Libraries that require llvm-gcc and emit instead a warning that llvm-gcc
is not available. This permits "make LLVMGCC=" to build LLVM completely
without error and provides warnings about the modules and bc libs that
could not be constructed.

llvm-svn: 20185
2005-02-14 21:54:08 +00:00
Chris Lattner
6e528dce90 Fix a bug in my previous change to this, which broke the build on sparcs.
llvm-svn: 20184
2005-02-14 21:42:10 +00:00
Chris Lattner
145569b076 Print GEP offsets as signed values instead of unsigned values. On X86, this
prints:

getelementptr (int* %A, int -1)

as: "(A) - 4" instead of "(A) + 18446744073709551612", which makes the
assembler much happier.

This fixes test/Regression/CodeGen/X86/2005-02-14-IllegalAssembler.ll,
and Benchmarks/Prolangs-C/cdecl with LLC on X86.

llvm-svn: 20183
2005-02-14 21:40:26 +00:00
Chris Lattner
3d2881066b A testcase that LLC produces illegal asm on for Prolangs-C/cdecl now.
llvm-svn: 20182
2005-02-14 21:31:41 +00:00
Chris Lattner
31f3382b3b Fix the second bug attached to PR504.
llvm-svn: 20181
2005-02-14 20:11:45 +00:00
Chris Lattner
a3a55bf997 Work around GCC PR19958, which causes programs to sometimes crash after
printing help output or version info.

llvm-svn: 20180
2005-02-14 19:17:29 +00:00
Misha Brukman
2b1e10031f Write out single characters as chars, not strings.
llvm-svn: 20179
2005-02-14 18:52:35 +00:00
Chris Lattner
1c75b25546 Bugs fixed
llvm-svn: 20178
2005-02-14 16:57:55 +00:00
Chris Lattner
7afbdcad15 Implement CodeGen/CBackend/2005-02-14-VolatileOperations.ll
Volatile loads and stores need to emit volatile pointer operations in C.

llvm-svn: 20177
2005-02-14 16:47:52 +00:00
Chris Lattner
4c13ab61b3 new testcase
llvm-svn: 20176
2005-02-14 16:45:38 +00:00
Reid Spencer
9c7fbaef9b Update makefile to use PROJ_* makefile variables intead of BUILD_* as
required by changes to the Makefile.rules. Patch contributed by Vladimir
Merzliakov.

llvm-svn: 20175
2005-02-14 16:04:28 +00:00
Reid Spencer
8c47826c9f Update comments to reflect new variable names. Patch contributed by
Vladimir Merzliakov.

llvm-svn: 20174
2005-02-14 16:02:19 +00:00
Misha Brukman
e71cbb82ba Give props to Andrew for the Alpha backend
llvm-svn: 20173
2005-02-14 09:07:23 +00:00
Andrew Lenharth
cae2f21e3b fix setcc on floats, fixes singlesource:pi, perhaps others
llvm-svn: 20172
2005-02-14 05:41:43 +00:00
Chris Lattner
71ff539ed6 new testcase for PR509
llvm-svn: 20171
2005-02-14 02:54:41 +00:00
Chris Lattner
259df2bf3c Fix the llvm bootstrap
llvm-svn: 20170
2005-02-13 23:37:09 +00:00
Chris Lattner
5f429c3347 Move private helper function into the only .cpp file that uses it.
llvm-svn: 20169
2005-02-13 23:14:06 +00:00
Chris Lattner
dc01c3f058 Move helper function here.
llvm-svn: 20168
2005-02-13 23:13:47 +00:00
Chris Lattner
9db0eccc42 Conform to the documented interface by null terminating argument lists!
llvm-svn: 20167
2005-02-13 23:10:45 +00:00
Chris Lattner
61a31c9fe2 Make sure to null terminate argument lists!
llvm-svn: 20166
2005-02-13 23:02:34 +00:00
Chris Lattner
743dd2cd80 If errno is zero strerror_r does not modify the buffer, leaving it unterminated.
This causes garbage to be printed out after error messages.

llvm-svn: 20165
2005-02-13 22:46:37 +00:00
Chris Lattner
e14babd141 Add some updates
llvm-svn: 20164
2005-02-13 22:27:24 +00:00
Chris Lattner
5824762378 SuSE 3.3.3 is also borken.
llvm-svn: 20163
2005-02-13 22:20:49 +00:00
Chris Lattner
5881b91bd7 Do not replace ostream << Module*, only ostream << Module&.
llvm-svn: 20157
2005-02-13 19:15:01 +00:00
Chris Lattner
6983f5d2ed Print the module, not the pointer.
llvm-svn: 20156
2005-02-13 19:12:31 +00:00
Reid Spencer
8d0f126b74 Make the check for global variables the same as the one for functions. In
both cases they are looking for non-external variables/functions that do
not have internal linkage. Using "!isExternal()" is a little more
understandable than "hasInitializer()"

llvm-svn: 20155
2005-02-13 18:12:20 +00:00
Chris Lattner
8d54dd37c9 Nuke blank line.
llvm-svn: 20154
2005-02-13 17:54:21 +00:00
Chris Lattner
08a5eb3cf0 Minor cleanup. No need to explicitly tell the compiler the template arguments.
llvm-svn: 20153
2005-02-13 17:50:16 +00:00
Chris Lattner
147c561432 Make sure to clear the LazyFunctionLoadMap after we ParseAllFunctionBodies.
Otherwise, clients who call ParseAllFunctionBodies will attempt to parse
the function bodies twice, which is (uh) very very bad (tm).

This fixes gccld on python.

llvm-svn: 20152
2005-02-13 17:48:18 +00:00
Chris Lattner
1b9f9c5f67 Do not put internal symbols into the symbol table. This shrinks the symbol
table for archives in common cases, and prevents trying to resolve a
external reference with an internal reference.  This shrinks the libpython.a
symbol table from 126302 to 19770 bytes.

llvm-svn: 20151
2005-02-13 17:42:11 +00:00
Chris Lattner
38a3ba0234 Include local time on the web page for start/end times.
llvm-svn: 20150
2005-02-13 16:08:30 +00:00
Chris Lattner
71a44087d4 Print something useful for gccld -v with an archive.
llvm-svn: 20148
2005-02-13 15:26:14 +00:00
Reid Spencer
9f219c79aa Fix PR506:
* Use error returned from Archive::OpenAndLoad
* Make sure only std::string is thrown so it gets caught and printed.

llvm-svn: 20147
2005-02-13 07:34:17 +00:00
Chris Lattner
7b0fbe7ccf Correct the recursive PHI node handling routines in a way that CANNOT induce
infinite loops (using the new replaceSymbolicValuesWithConcrete method).

This patch reverts this patch:
http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20050131/023830.html

... which was an attempted fix for this problem.  Unfortunately, that patch
caused test/Regression/Transforms/IndVarsSimplify/exit_value_tests.llx to fail
and slightly castrated the entire analysis.  This patch fixes it right.

This patch is dedicated to jeffc, for making me deal with this.  :)

llvm-svn: 20146
2005-02-13 04:37:18 +00:00
Chris Lattner
b06944e813 Add a new replaceSymbolicValuesWithConcrete method to the SCEV class,
adjust const'ness a bit to be more correct.

llvm-svn: 20145
2005-02-13 04:34:51 +00:00
Andrew Lenharth
9a98def106 non-ieee arith crashes passes on alpha
llvm-svn: 20144
2005-02-13 03:41:10 +00:00
Andrew Lenharth
d39febfc66 try to do better match for i32 adds
llvm-svn: 20143
2005-02-12 21:11:17 +00:00
Andrew Lenharth
ab4db0522a make FP conversion more conservative (matches gcc)
llvm-svn: 20142
2005-02-12 21:10:58 +00:00
Andrew Lenharth
df5cd0868f oops, I was sure this had already gond though the nightly tester
llvm-svn: 20141
2005-02-12 20:42:09 +00:00
Chris Lattner
e254e2ffcc Add note about broken GCC
llvm-svn: 20138
2005-02-12 20:11:13 +00:00
Andrew Lenharth
76c5d97750 added sign extend for boolean
llvm-svn: 20137
2005-02-12 19:35:12 +00:00
Chris Lattner
5d5aede33b Document the newly generalized model for constant globals.
llvm-svn: 20136
2005-02-12 19:30:21 +00:00
Chris Lattner
16277c1775 Allow globals to be of different const'nesses when we link.
This finally resolves PR502, PR450,
and test/Regression/Linker/2005-02-12-ConstantGlobals{,-2}.ll correctly

llvm-svn: 20135
2005-02-12 19:20:28 +00:00
Chris Lattner
36f3eb82a1 New test, adjust other test.
llvm-svn: 20134
2005-02-12 19:19:36 +00:00
Chris Lattner
6af31478ef Reinstate this test, it is correct after all.
llvm-svn: 20133
2005-02-12 19:14:11 +00:00
Chris Lattner
3b4f6c4a73 This test is invalid
llvm-svn: 20131
2005-02-12 19:02:30 +00:00
Chris Lattner
e616fea3bc Fix for testcase Transforms/IndVarsSimplify/2005-02-11-InvokeCrash.ll
and PR504.

llvm-svn: 20129
2005-02-12 03:26:49 +00:00
Chris Lattner
4c916478e5 new testcase for PR504
llvm-svn: 20128
2005-02-12 03:26:30 +00:00
Chris Lattner
82e87e4d0c Actually, this testcase is invalid, the bug is in the C++ FE.
llvm-svn: 20123
2005-02-11 23:18:40 +00:00
Chris Lattner
1afcaf601f New testcase that manyoso found compiling QT 4.0.
llvm-svn: 20122
2005-02-11 23:08:34 +00:00
Chris Lattner
bebf14d28e Slightly expand on the instructions.
llvm-svn: 20121
2005-02-11 21:17:26 +00:00
Chris Lattner
2a38aea0a7 Bug fixed
llvm-svn: 20118
2005-02-11 19:29:52 +00:00
Chris Lattner
e6138f4240 New testcase for PR501
llvm-svn: 20117
2005-02-11 19:26:06 +00:00
Chris Lattner
72b5054afb The pool allocator is now the llvm-poolalloc module in public CVS
llvm-svn: 20116
2005-02-11 04:46:58 +00:00
Andrew Lenharth
b301af712e fix a bunch of regressions due to call behavior
llvm-svn: 20110
2005-02-10 20:10:38 +00:00
Alkis Evlogimenos
c4a44c6b3d Localize globals if they are only used in main(). This replaces the
global with an alloca, which eventually gets promoted into a
register. This enables a lot of other optimizations later on.

llvm-svn: 20109
2005-02-10 18:36:30 +00:00
Tanya Lattner
56807c6f4a Added new circuit finding alogrithm.
Fixed bug in graph so that phi ite diff edges are added.

llvm-svn: 20108
2005-02-10 17:02:58 +00:00
Tanya Lattner
1137d7c6a1 Allow modsched and local scheduling to both be run.
llvm-svn: 20107
2005-02-10 17:02:06 +00:00
Andrew Lenharth
e0b789fdf5 so, if you beat on it, you too can talk emacs into having a sane indenting policy... Also, optimize many function calls with pc-relative calls (partial prologue skipping for that case coming soon), try to fix the random jumps to strange places problem by pesimizing div et. al. register usage and fixing up GP before using, some calling convention tweaks, and make frame pointer unallocatable (not strickly necessary, but let's go for correctness first)
llvm-svn: 20106
2005-02-10 06:25:22 +00:00
Andrew Lenharth
f70ef47ee1 fix fp branch
llvm-svn: 20105
2005-02-10 05:17:38 +00:00
Misha Brukman
8d343e77f8 Give props to Brian for V8 backend
llvm-svn: 20104
2005-02-10 02:07:57 +00:00
Misha Brukman
06a1d47f96 * Fix spelling of `volatile'
* Align comments with tablegen elements

llvm-svn: 20103
2005-02-10 01:52:22 +00:00
Chris Lattner
38de952115 This will be moved elsewhere.
llvm-svn: 20101
2005-02-09 22:52:46 +00:00
Misha Brukman
b139a7dbb9 * Use doc_code style for blocks of code
* Convert < to &lt; in <pre> block
* Use doc_hilite instead of doc_red style
* Put some classes and options in <tt> blocks

llvm-svn: 20100
2005-02-09 22:49:05 +00:00
Misha Brukman
64f8d07090 Do not mention colors in style names, we might want to change styles themselves
llvm-svn: 20099
2005-02-09 22:47:47 +00:00
Misha Brukman
0c4b8b6db4 * Use an HTML list <ol> instead of custom superscripts in the platform notes
* Reorder software requirements list to show relative importance
* Use superscripts for footnotes in software list rather than "Note 1"
* Use new doc_notes class to separate footnotes from main doc text

llvm-svn: 20098
2005-02-09 22:38:47 +00:00
Misha Brukman
649b77858d Add style to display notes on a different background than the main text
llvm-svn: 20097
2005-02-09 22:36:44 +00:00
Chris Lattner
ac648f5375 Turn footnotes into links, make the page validate.
llvm-svn: 20096
2005-02-09 21:15:51 +00:00
Chris Lattner
59a486ace6 If needed, this should be in the 'how to compile the cfe' doc.
llvm-svn: 20095
2005-02-09 21:07:21 +00:00
Chris Lattner
09cc355153 this should be incorporated into the build
llvm-svn: 20094
2005-02-09 21:05:01 +00:00
Misha Brukman
7772309b70 * Separate superscript footnotes with a comma, otherwise it's a 2-digit number
* Make a URL into an HTML link using anchor tag
* Put code in fixed-width font
* Since the MinGW footnote is significantly more than the rest of the footnotes
  combined, it needs to have a border and background color to separate it from
  the regular flow of text for readability purposes.

llvm-svn: 20093
2005-02-09 21:01:26 +00:00
Chris Lattner
093ffb0a5c Add instructions for MINGW, contributed by Henrik Bach
llvm-svn: 20092
2005-02-09 20:43:48 +00:00
Chris Lattner
610ce2c678 Don't print a 'Total Execution Time' line for the 'Miscellaneous Ungrouped
Timers' section.  Since these are random timers in the program it doesn't
make sense to sum them up.

llvm-svn: 20090
2005-02-09 18:41:32 +00:00
Chris Lattner
159485ff1b Fix test/Regression/Assembler/2005-02-09-AsmWriterStoreBug.ll
llvm-svn: 20089
2005-02-09 17:45:03 +00:00
Chris Lattner
60fb167b6e New testcase that the asmwriter botches.
llvm-svn: 20088
2005-02-09 17:42:24 +00:00
Chris Lattner
5ce5a094aa Use new edge iterators to simplify some code.
llvm-svn: 20086
2005-02-09 03:20:43 +00:00
Chris Lattner
06e353c5a9 Add some iterators that should have come in long ago
llvm-svn: 20085
2005-02-09 03:14:29 +00:00
Chris Lattner
81bfc9eda8 Fix installation of configured headers when objdir != srcdir. Patch
contributed by Vladimir Merzliakov!

llvm-svn: 20084
2005-02-09 02:24:00 +00:00
Andrew Lenharth
8ec0a2b13a BranchCC, nifty
llvm-svn: 20067
2005-02-08 00:40:03 +00:00
Andrew Lenharth
d4f440de0f fix store issue and an FP conversion (segfault) issue
llvm-svn: 20066
2005-02-07 23:02:23 +00:00
Chris Lattner
863d9c9068 IndCallGraphMap is now a pointer to a new'd map.
llvm-svn: 20065
2005-02-07 16:09:15 +00:00
Chris Lattner
67aeddc423 Hopefully fix the build on Darwin with GCC 3.3
llvm-svn: 20064
2005-02-07 16:09:01 +00:00
Andrew Lenharth
9d3f7704fd copytoreg fix
llvm-svn: 20063
2005-02-07 06:31:44 +00:00
Andrew Lenharth
57047720ce copyfromreg fix
llvm-svn: 20062
2005-02-07 06:21:37 +00:00
Andrew Lenharth
351df0c2dc fix load bug
llvm-svn: 20061
2005-02-07 05:55:55 +00:00
Andrew Lenharth
5d004edc3d more FP load store fixes and Load store simplifications
llvm-svn: 20060
2005-02-07 05:33:15 +00:00
Andrew Lenharth
5fb9b53060 clean up load and stores alot
llvm-svn: 20059
2005-02-07 05:18:02 +00:00
Andrew Lenharth
a9e02156ce teach all loads and stores about the stack
llvm-svn: 20058
2005-02-07 05:07:00 +00:00
Andrew Lenharth
0021f55863 prefer FP scratch registers and more check in LowerArguments
llvm-svn: 20057
2005-02-06 21:07:31 +00:00
Andrew Lenharth
eefd410522 fix oopso
llvm-svn: 20056
2005-02-06 16:22:15 +00:00
Andrew Lenharth
6c018f77d1 smarter loads and stores. can now handle base+offset.
llvm-svn: 20055
2005-02-06 15:40:40 +00:00
Andrew Lenharth
d9bf7b81eb fix build
llvm-svn: 20053
2005-02-05 19:46:51 +00:00
Andrew Lenharth
7be9854594 clean up
llvm-svn: 20051
2005-02-05 17:41:39 +00:00
Andrew Lenharth
ea9224a69a fix f32 setcc, and fp select
llvm-svn: 20050
2005-02-05 16:41:03 +00:00
Andrew Lenharth
060d58b88f added ugly support for fp compares
llvm-svn: 20049
2005-02-05 13:19:12 +00:00
Misha Brukman
ffe9968b5a Make the rest of file header comments consistent in format and style
llvm-svn: 20048
2005-02-05 02:24:26 +00:00
Chris Lattner
423c04c75c Eliminate the explicit opcode field in ConstantExpr, using the SubclassData
field to hold it instead.  This shrinks memory usage for 176.gcc from
57628728 to 57598144 bytes, a small reduction of about 30K.

llvm-svn: 20047
2005-02-05 02:00:12 +00:00
Chris Lattner
0a9a2e734b Eliminate the explicit volatile fields in LoadInst and StoreInst. This shrinks
LoadInst from 60 -> 56 bytes and StoreInst from 76 -> 72 bytes.

Note however, that this doesn't actually save any memory on common systems
where 'malloc' returns 8-byte aligned memory, as the saved space is replaced
by useless alignment padding.  :(

llvm-svn: 20046
2005-02-05 01:44:18 +00:00
Chris Lattner
df57a02be4 Instead of initializing the volatile field, use accessors to set it.
llvm-svn: 20045
2005-02-05 01:38:38 +00:00
Chris Lattner
a29c92ffdd Initialize new field.
llvm-svn: 20044
2005-02-05 01:37:58 +00:00
Chris Lattner
9cd92de64b SubclassID is really a small field. Split it into half and let subclasses
play with the unused part.

llvm-svn: 20043
2005-02-05 01:37:44 +00:00
Chris Lattner
f60c170ea5 Add support for .cc and .hpp files. Patch contributed by Vladimir Merzliakov!
llvm-svn: 20042
2005-02-04 21:28:50 +00:00
Misha Brukman
076b9f4507 Make file header comment consistent: extend the whole 80 cols to fill the line
llvm-svn: 20039
2005-02-04 20:25:52 +00:00
Chris Lattner
4585abd549 If we have an indirect call site that calls N functions, inline the N functions
into a temporary graph, remember it for later, then inline the tmp graph into
the call site.

In the case where there are other call sites to the same set of functions, this
permits us to just inline the temporary graph instead of all of the callees.

This turns N*M inlining situations into an N+M inlining situation.

llvm-svn: 20036
2005-02-04 19:59:49 +00:00
Chris Lattner
d1000686cd Split mergeInGraph into two methods.
llvm-svn: 20035
2005-02-04 19:58:28 +00:00
Chris Lattner
377507b125 Add some new members
llvm-svn: 20034
2005-02-04 19:58:06 +00:00
Chris Lattner
28bfbb70dd add new member
llvm-svn: 20033
2005-02-04 19:57:57 +00:00
Chris Lattner
ba954f3284 Fix the Regression/Transforms/DSAnalysis/recursion.ll regression.
llvm-svn: 20031
2005-02-04 18:58:04 +00:00
Chris Lattner
0559691163 Fix a case where were incorrectly compiled cast from short to int on 64-bit
targets.

llvm-svn: 20030
2005-02-04 18:39:19 +00:00
Andrew Lenharth
5152be292a alignment
llvm-svn: 20028
2005-02-04 14:09:38 +00:00
Andrew Lenharth
202011fcc7 get alignment printing correctly and get rid of __main hack
llvm-svn: 20027
2005-02-04 14:01:21 +00:00
Andrew Lenharth
c8770aa507 fix constant pointer outputing on 64 bit machines
llvm-svn: 20026
2005-02-04 13:47:16 +00:00
Misha Brukman
20b8a65627 * Fix broken link to directions to get llvm, llvm-gcc, and llvm-test from CVS
* Remove duplicated CVS directions and refer reader to the CVS section
* Clean up directions to be brief

llvm-svn: 20023
2005-02-03 22:25:23 +00:00
Andrew Lenharth
799479138e FP fixes
llvm-svn: 20019
2005-02-03 21:01:15 +00:00
Chris Lattner
3dd3df2b55 Refactor getFunctionArgumentsForCall out of mergeInGraph.
llvm-svn: 20018
2005-02-03 18:40:25 +00:00
Chris Lattner
446b15f3a3 Add a new method.
llvm-svn: 20017
2005-02-03 18:40:05 +00:00
Misha Brukman
cd673250ba * Clearly mark LLVM_LIB_SEARCH_PATH as being optional
* llvmgcc and llvmg++ aliases are no longer needed (binaries have llvm- prefix)

llvm-svn: 20016
2005-02-03 18:28:08 +00:00
Chris Lattner
45a6a18393 This is no longer needed. Global variables with undef initializers can be
initialized to anything, including garbage.

llvm-svn: 20010
2005-02-02 20:50:50 +00:00
Misha Brukman
d4528ea031 * Instead of fixing the version numbers before every release, mark them as x.y
* Eliminate the redundant "This is the..." in released file listing
* Fix grammar

llvm-svn: 20005
2005-02-02 18:01:57 +00:00
Andrew Lenharth
75c6225f32 Store fix
llvm-svn: 20004
2005-02-02 17:32:39 +00:00
Andrew Lenharth
cf2e21e879 oops
llvm-svn: 20003
2005-02-02 17:01:31 +00:00
Andrew Lenharth
fe6e7a30c0 prevent register allocator from using the stack pointer :)
llvm-svn: 20002
2005-02-02 17:00:21 +00:00
Andrew Lenharth
c7042c2d8b fix loading of floats
llvm-svn: 19997
2005-02-02 15:05:33 +00:00
Jeff Cohen
fc9f146966 Put libraries in a common directory
llvm-svn: 19995
2005-02-02 06:33:11 +00:00
Andrew Lenharth
0f42d92ca0 marked mem* as not supported
llvm-svn: 19992
2005-02-02 05:49:42 +00:00
Jeff Cohen
d44e5dae0f Add additional source of Win32 GNU utilities.
llvm-svn: 19991
2005-02-02 05:46:20 +00:00
Alkis Evlogimenos
346bb20409 Fix crash on MallocInsts of unsized types.
llvm-svn: 19988
2005-02-02 04:43:37 +00:00
Andrew Lenharth
07c0b0d92b fix Load bug
llvm-svn: 19987
2005-02-02 04:35:44 +00:00
Chris Lattner
5aa75e4ce5 Fix yet another memset issue.
llvm-svn: 19986
2005-02-02 03:44:41 +00:00
Andrew Lenharth
c7e55f430c try to make a bug bugpointable, add yet more constant pool stuff, fixup constant loads for FP
llvm-svn: 19985
2005-02-02 03:36:35 +00:00
Andrew Lenharth
ae88b6a8a8 better constant handling, should fix many remaining cases
llvm-svn: 19984
2005-02-02 00:51:15 +00:00
Alkis Evlogimenos
7c04a3ddb6 Add variable for bugpoint.
llvm-svn: 19981
2005-02-02 00:40:15 +00:00
Chris Lattner
16a53243c6 Eliminate some duplicated debug code
llvm-svn: 19980
2005-02-01 21:55:40 +00:00
Chris Lattner
5ce51e83af Eliminate self-recursion as a special case.
llvm-svn: 19979
2005-02-01 21:49:43 +00:00
Chris Lattner
50cebc6b9b Eliminate use of DSCallSiteIterator in key loop. This is a half step to
a tasty speedup.

llvm-svn: 19978
2005-02-01 21:37:27 +00:00
Chris Lattner
eb5febea34 remove dead method
llvm-svn: 19977
2005-02-01 21:37:06 +00:00
Andrew Lenharth
9df6a764b9 fix FP arg passing bug, Add unsigned to/from int, fix SELECT, fix Constant pool
llvm-svn: 19976
2005-02-01 20:40:27 +00:00
Andrew Lenharth
20d8b2ff71 Print the Constant pool
llvm-svn: 19975
2005-02-01 20:38:53 +00:00
Andrew Lenharth
32124c0a70 Make cmov work right and loads for fp from constant pool
llvm-svn: 19974
2005-02-01 20:36:44 +00:00
Andrew Lenharth
c777d4f03d Correct stack stuff for FP
llvm-svn: 19973
2005-02-01 20:35:57 +00:00
Andrew Lenharth
8fb0d5002b try to match alpha pattern
llvm-svn: 19972
2005-02-01 20:35:11 +00:00
Andrew Lenharth
7703d1ab25 fix register names
llvm-svn: 19971
2005-02-01 20:34:29 +00:00
Chris Lattner
63a46cee87 Signficantly speed up printing by not emitting the same file twice with
different names.  Large SCC's tend to be big, so this saves a lot of time.

llvm-svn: 19970
2005-02-01 19:10:48 +00:00
Chris Lattner
4487b2e5a6 Fix some bugs andrew noticed legalizing memset for alpha
llvm-svn: 19969
2005-02-01 18:38:28 +00:00
Chris Lattner
d6106a41fe Do not revisit nodes in the SCC traversal. This speeds up the BU pass a bit.
llvm-svn: 19968
2005-02-01 17:35:52 +00:00
Jeff Cohen
c04c0dbd19 Put finishing touches on GettingStartedVS.html and link it to the index.
llvm-svn: 19967
2005-02-01 15:59:28 +00:00
Chris Lattner
085c981345 Fix test/Regression/Assembler/2005-01-31-CallingAggregateFunction.ll
llvm-svn: 19966
2005-02-01 01:47:42 +00:00
Chris Lattner
29b97d53c1 Apparently := confuses makellvm
llvm-svn: 19965
2005-02-01 01:47:12 +00:00
Chris Lattner
4298e1fea4 This bug crashes the assembler, distilled from a testcase produced by Andrew.
llvm-svn: 19964
2005-02-01 01:44:54 +00:00
Andrew Lenharth
cdc9e33ae5 pecimise loads, put indirect call addr in right register. still doesn't fix methcall
llvm-svn: 19963
2005-02-01 01:37:24 +00:00
Chris Lattner
f87e05be26 Update speedup and shrinkage info
llvm-svn: 19962
2005-02-01 01:33:52 +00:00
Chris Lattner
4947e67c4f Updates for new use list changes.
llvm-svn: 19961
2005-02-01 01:24:21 +00:00
Chris Lattner
b6c21dbb1e Update for API change.
llvm-svn: 19960
2005-02-01 01:24:01 +00:00
Chris Lattner
82b42c5d85 API change.
llvm-svn: 19959
2005-02-01 01:23:49 +00:00
Chris Lattner
d6a4492f81 Adjust to changes in APIs
llvm-svn: 19958
2005-02-01 01:23:31 +00:00
Chris Lattner
f98a7bffb3 Hacks to make this ugly ugly code work with the new use lists.
llvm-svn: 19957
2005-02-01 01:22:56 +00:00
Chris Lattner
ef55a1a775 Switch from using an ilist for uses to using a custom doubly linked list.
This list does not provide the ability to go backwards in the list (its
more of an unordered collection, stored in the shape of a list).

This change means that use iterators are now only forward iterators, not
bidirectional.

This improves the memory usage of use lists from '5 + 4*#use' per value to
'1 + 4*#use'.  While it would be better to reduce the multiplied factor,
I'm not smart enough to do so.  This list also has slightly more efficient
operators for manipulating list nodes (a few less loads/stores), due to not
needing to be able to iterate backwards through the list.

This change reduces the memory footprint required to hold 176.gcc from
66.025M -> 57.687M, a 14% reduction.  It also speeds up the compiler,
7.73% in the case of bytecode loading alone (release build loading 176.gcc).

llvm-svn: 19956
2005-02-01 01:22:06 +00:00
Chris Lattner
1230cf25ba Fix a problem where we could infinitely recurse on phi nodes.
llvm-svn: 19955
2005-02-01 00:18:30 +00:00
Misha Brukman
8dfa2e4465 Fix hyphenation in output comment
llvm-svn: 19954
2005-01-31 06:19:57 +00:00
Chris Lattner
72684fecf8 Implement InstCombine/cast.ll:test25, a case that occurs many times
in spec

llvm-svn: 19953
2005-01-31 05:51:45 +00:00
Chris Lattner
46452d4558 New testcase
llvm-svn: 19952
2005-01-31 05:51:18 +00:00
Jeff Cohen
1b0d750ade Add LLVM with Visual Studio overview
llvm-svn: 19951
2005-01-31 05:42:10 +00:00
Chris Lattner
31f486c775 Implement the trivial cases in InstCombine/store.ll
llvm-svn: 19950
2005-01-31 05:36:43 +00:00
Chris Lattner
2357f255ca New testcase
llvm-svn: 19949
2005-01-31 05:36:19 +00:00
Chris Lattner
c456eac1b9 Rename these to start with %c, as they are the only ones that are checked.
No change to the tests themselves.

llvm-svn: 19948
2005-01-31 05:17:31 +00:00
Chris Lattner
fe1b0b8b24 Implement Transforms/InstCombine/cast-load-gep.ll, which allows us to devirtualize
11 indirect calls in perlbmk.

llvm-svn: 19947
2005-01-31 04:50:46 +00:00
Chris Lattner
340ab5bbbb New testcase
llvm-svn: 19946
2005-01-31 04:49:22 +00:00
Andrew Lenharth
ae25bb1dc5 indirect call fix
llvm-svn: 19945
2005-01-31 03:19:31 +00:00
Andrew Lenharth
c40d156dc9 fp to int and back conversion sequences
llvm-svn: 19944
2005-01-31 01:44:26 +00:00
Chris Lattner
ccf22fb182 Fix the regressions my User changes introduced. Apparently some parts of
LLVM make the very reasonable assumption that constant expressions will
have at least one operand! :)

llvm-svn: 19943
2005-01-31 01:11:13 +00:00
Chris Lattner
2ca79d339e Rename variables to work with VC++'s hokey scoping rules.
llvm-svn: 19942
2005-01-31 00:10:58 +00:00
Chris Lattner
2977b857c2 Fix some scary bugs that VC++ detected.
llvm-svn: 19941
2005-01-31 00:10:45 +00:00
Chris Lattner
e9772aea47 Make things more const-correct, adjust to changes in DSA interfaces.
llvm-svn: 19940
2005-01-30 23:51:25 +00:00
Chris Lattner
a1b39fa5ad * Make some methods more const correct.
* Change the FunctionCalls and AuxFunctionCalls vectors into std::lists.
  This makes many operations on these lists much more natural, and avoids
  *exteremely* expensive copying of DSCallSites (e.g. moving nodes around
  between lists, erasing a node from not the end of the vector, etc).

With a profile build of analyze, this speeds up BU DS from 25.14s to
12.59s on 176.gcc.  I expect that it would help TD even more, but I don't
have data for it.

This effectively eliminates removeIdenticalCalls and children from the
profile, going from 6.53 to 0.27s.

llvm-svn: 19939
2005-01-30 23:51:02 +00:00
Andrew Lenharth
7141334f98 added fp extend and removed a forgotten assert in more than 6 arg support (should break somewhere else now :) ) and fix an incorrect asm sequence for indirect calls
llvm-svn: 19938
2005-01-30 20:42:36 +00:00
Jeff Cohen
391380ee97 Silence VC++ warnings about using 'this' in base member initializations.
llvm-svn: 19937
2005-01-30 17:54:12 +00:00
Chris Lattner
8e62f434cd This code is really unreachable.
llvm-svn: 19934
2005-01-30 16:33:46 +00:00
Chris Lattner
bfa060c5d2 Fix warnings.
llvm-svn: 19933
2005-01-30 16:32:48 +00:00
Andrew Lenharth
918a29fc51 support for larger calls
llvm-svn: 19932
2005-01-30 00:35:27 +00:00
Chris Lattner
79a85fada1 Improve spelling
llvm-svn: 19931
2005-01-30 00:13:34 +00:00
Chris Lattner
f6c93e36c7 Improve conformance with the Misha spelling benchmark suite
llvm-svn: 19930
2005-01-30 00:09:23 +00:00
Tanya Lattner
5ca41e2b68 Make this work on systems where size_t == unsigned and where they are not
the same.

llvm-svn: 19929
2005-01-29 23:29:55 +00:00
Tanya Lattner
238cf92000 Make this work on systems where size_t is not the same as unsigned.
llvm-svn: 19928
2005-01-29 23:08:01 +00:00
Chris Lattner
fdec565f1f Unbreak the build :(
llvm-svn: 19926
2005-01-29 19:27:28 +00:00
Chris Lattner
2f0a1108ff Adjust to ilist changes.
Based on the ilist changes avoid allocating an entire Use object for the
end of the Use chain.  This saves 8 bytes of memory for each Value allocated
in the program.  For 176.gcc, this reduces us from 69.5M -> 66.0M, a 5.3%
memory savings.

llvm-svn: 19925
2005-01-29 18:43:28 +00:00
Chris Lattner
e6074aa08b adjust to ilist changes.
llvm-svn: 19924
2005-01-29 18:41:25 +00:00
Chris Lattner
e5c7b9a215 Adjust to ilist changes.
llvm-svn: 19923
2005-01-29 18:41:12 +00:00
Chris Lattner
f84ecca5f3 Adjust to changes in ilist
llvm-svn: 19922
2005-01-29 18:41:00 +00:00
Chris Lattner
02ccc2d7a0 Rename createNode -> createSentinal.
Add a new method, destroySentinal, that is used to delete it (instead of
requiring use of delete.

llvm-svn: 19921
2005-01-29 18:40:19 +00:00
Chris Lattner
0174b52dd9 clean up comments
llvm-svn: 19920
2005-01-29 17:29:05 +00:00
Chris Lattner
e89f022ba7 This has been deprecated for long enough, nuke it.
llvm-svn: 19919
2005-01-29 17:27:26 +00:00
Chris Lattner
800b72445f This file was schizophrenic when it came to representing sizes. In some
cases it represented them as 'unsigned's, which are not enough for 64-bit
hosts.  In other cases, it represented them as uint64_t's, which are
inefficient for 32-bit hosts.

This patch unifies all of the sizes to use size_t instead.

llvm-svn: 19918
2005-01-29 17:17:18 +00:00
Chris Lattner
0701b78768 There is no reason to include ostream here, include iosfwd instead.
This file was schizophrenic when it came to representing sizes.  In some
cases it represented them as 'unsigneds', which are not enough for 64-bit
hosts.  In other cases, it represented them as uint64_t's, which are
inefficient for 32-bit hosts.

This patch unifies all of the sizes to use size_t instead.

llvm-svn: 19917
2005-01-29 17:16:07 +00:00
Chris Lattner
bb4384ba71 After reading in a bc file, trim the resultant buffer down to what we
really need.  This reduces 4M of memory consumption reading 176.gcc.

llvm-svn: 19916
2005-01-29 17:05:56 +00:00
Chris Lattner
173340640a Finegrainify namespacification
llvm-svn: 19915
2005-01-29 16:53:02 +00:00
Andrew Lenharth
41bc2c2897 first step towards a correct and complete stack. also add some forms for things that were getting stuck in the nightly tester.
llvm-svn: 19914
2005-01-29 15:42:07 +00:00
Chris Lattner
1ec230e665 Due to previous simplifications, we can simplify the data structures being
used here.

llvm-svn: 19913
2005-01-29 07:04:10 +00:00
Chris Lattner
ce0fa4c109 Properly handle volatile.
llvm-svn: 19912
2005-01-29 06:42:34 +00:00
Chris Lattner
a194357025 Remove some useless map operations. Loads/stores that are in the same
BB as the load are not included in the Cand* sets at all.

llvm-svn: 19911
2005-01-29 06:39:25 +00:00
Chris Lattner
be62e72273 Before doing expensive global analysis, check to make sure the pointer is
not invalidated on entry and on exit of the block.  This fixes some N^2
behavior in common cases, and speeds up gcc another 5% to 22.35s.

llvm-svn: 19910
2005-01-29 06:31:53 +00:00
Chris Lattner
afdbae2b55 Fix quotes.
llvm-svn: 19909
2005-01-29 06:29:45 +00:00
Jeff Cohen
b49177f017 Unbreak VC++ build
llvm-svn: 19908
2005-01-29 06:27:16 +00:00
Chris Lattner
fe7a9a242e Minor simplification/speedup. Replaces a set lookup with a pointer comparison.
This speeds up 176.gcc from 25.73s to 23.48s, which is 9.5%

llvm-svn: 19907
2005-01-29 06:20:55 +00:00
Chris Lattner
787aed675d Eliminate generality that is not buying us anything. In particular, this
will cause us to miss cases where the input pointer to a load could be value
numbered to another load.  Something like this:


  %X = load int* %P1
  %Y = load int* %P2

Those are obviously the same if P1/P2 are the same.  The code this patch
removes attempts to handle that.  However, since GCSE iterates, this doesn't
actually buy us anything: GCSE will first replace P1 or P2 with the other
one, then the load can be value numbered as equal.

Removing this code speeds up gcse a lot.  On 176.gcc in debug mode, this
speeds up gcse from 29.08s -> 25.73s, a 13% savings.

llvm-svn: 19906
2005-01-29 06:11:16 +00:00
Chris Lattner
b25abcb1fa If we see:
%A = alloca int
  %V = load int* %A

value number %V to undef, not 0.

llvm-svn: 19905
2005-01-29 05:57:01 +00:00
Chris Lattner
2295d0b7de Memory used is a delta between memuse at the start of the time and the
memuse at the end, thus it is signed.

llvm-svn: 19904
2005-01-29 05:21:16 +00:00
Jeff Cohen
a7f83cf6b3 Unbreak VC++ build
llvm-svn: 19903
2005-01-29 03:32:49 +00:00
Chris Lattner
f711f8db41 Make sure that we always grow a multiple of 2 operands.
llvm-svn: 19902
2005-01-29 01:05:12 +00:00
Chris Lattner
e9c61fbb51 noteworthy.
llvm-svn: 19901
2005-01-29 00:44:22 +00:00
Chris Lattner
d8e20188c6 Adjust to changes in instruction interfaces.
llvm-svn: 19900
2005-01-29 00:39:08 +00:00
Chris Lattner
a3f06fa2dd Switchinst takes a hint for the number of cases it will have.
llvm-svn: 19899
2005-01-29 00:38:45 +00:00
Chris Lattner
a35dfcedd3 switchinst ctor now takes a hint for the number of cases that it will have.
llvm-svn: 19898
2005-01-29 00:38:26 +00:00
Chris Lattner
84d3137da7 Adjust Valuehandle to hold its operand directly in it.
llvm-svn: 19897
2005-01-29 00:37:36 +00:00
Chris Lattner
3479f9cca8 Finegrainify namespacification.
Adjust TmpInstruction to work with the new User model.

llvm-svn: 19896
2005-01-29 00:36:59 +00:00
Chris Lattner
68afd89730 add namespace qualifier
llvm-svn: 19895
2005-01-29 00:36:38 +00:00
Chris Lattner
616b8fc630 Adjust to changes in User class and minor changes in instruction ctors.
llvm-svn: 19894
2005-01-29 00:36:19 +00:00
Chris Lattner
2c08949c62 Adjust to slight changes in instruction interfaces.
llvm-svn: 19893
2005-01-29 00:35:55 +00:00
Chris Lattner
5d1bc2c408 Adjust to changes in User class.
llvm-svn: 19892
2005-01-29 00:35:33 +00:00
Chris Lattner
afdb3de4d7 Merge InstrTypes.cpp into this file
Adjust to changes in the User class, operand handling is very different.
PHI node and switch statements must handle explicit resizing of operand
lists.

llvm-svn: 19891
2005-01-29 00:35:16 +00:00
Chris Lattner
d0df99ce86 Adjust to changes in User class. Aggregate constants now must explicitly
manage their operands.

llvm-svn: 19890
2005-01-29 00:34:39 +00:00
Chris Lattner
03adb1aa83 This file is now merged into Instructions.cpp
llvm-svn: 19889
2005-01-29 00:33:32 +00:00
Chris Lattner
00b82c25bc Adjust to changes in the User class.
llvm-svn: 19888
2005-01-29 00:33:00 +00:00
Chris Lattner
5e9de0e083 Adjust to changes in the User class. Introduce a new UnaryInstruction
class.

llvm-svn: 19887
2005-01-29 00:32:51 +00:00
Chris Lattner
9d8da6a9f4 Adjust to user changes.
llvm-svn: 19886
2005-01-29 00:32:00 +00:00
Chris Lattner
4921cdf9c0 Many changes to cope with the User.h changes. Instructions now generally
directly embed their operands.

llvm-svn: 19885
2005-01-29 00:31:36 +00:00
Chris Lattner
893314cd3a Adjust to User.h changes.
llvm-svn: 19884
2005-01-29 00:30:52 +00:00
Chris Lattner
f11ea56ef6 Instead of storing operands as std::vector<Use>, just maintain a pointer
and num operands in the User class.  this allows us to embed the operands
directly in the subclasses if possible.  For example, for binary operators
we store the two operands in the derived class.

The has several effects:
  1. it improves locality because the operands and instruction are together
  2. it makes accesses to operands faster (one less load) if you access them
     through the derived class pointer.  For example this:

Value *GetBinaryOperatorOp(BinaryOperator *I, int i) {
  return I->getOperand(i);
}

Was compiled to:

_Z19GetBinaryOperatorOpPN4llvm14BinaryOperatorEi:
        movl    4(%esp), %edx
        movl    8(%esp), %eax
        sall    $4, %eax
        movl    24(%edx), %ecx
        addl    %ecx, %eax
        movl    (%eax), %eax
        ret

and is now compiled to:

_Z19GetBinaryOperatorOpPN4llvm14BinaryOperatorEi:
        movl    8(%esp), %eax
        movl    4(%esp), %edx
        sall    $4, %eax
        addl    %edx, %eax
        movl    44(%eax), %eax
        ret

Accesses through "Instruction*" are unmodified.

   3. This reduces memory consumption (by about 3%) by eliminating 1 word of
      vector overhead and a malloc header on a seperate object.
   4. This speeds up gccas about 10% (both debug and release builds) on
      large things (such as 176.gcc).  For example, it takes a debug build
      from 172.9 -> 155.6s and a release gccas from 67.7 -> 61.8s

llvm-svn: 19883
2005-01-29 00:29:39 +00:00
Andrew Lenharth
4a0d200c13 fix ExprMap, partially teach about add long
llvm-svn: 19882
2005-01-28 23:17:54 +00:00
Chris Lattner
feaf92f7ad Fix a nasty thinko in my previous commit.
llvm-svn: 19881
2005-01-28 23:17:27 +00:00
Chris Lattner
bc7497d5f5 Alpha doesn't have a native f32 extload instruction.
llvm-svn: 19880
2005-01-28 22:58:25 +00:00
Chris Lattner
bf8c1ad313 implement legalization of truncates whose results and sources need to be
truncated, e.g. (truncate:i8 something:i16) on a 32 or 64-bit RISC.

llvm-svn: 19879
2005-01-28 22:52:50 +00:00
Chris Lattner
a4cfafe31a Get alpha working with memset/memcpy/memmove
llvm-svn: 19878
2005-01-28 22:29:18 +00:00
Reid Spencer
3a46875e54 Fix some typos in the Makefile.rules.
Patch contributed by Vladimer Merzliakov.

llvm-svn: 19877
2005-01-28 19:52:32 +00:00
Chris Lattner
cd96168c95 Hrm, who knows what 'uint' is, but it seems to work sometimes? Wierd.
llvm-svn: 19876
2005-01-28 19:37:35 +00:00
Chris Lattner
cd517ff0c7 * add some DEBUG statements
* Properly compile this:

struct a {};
int test() {
  struct a b[2];
  if (&b[0] != &b[1])
    abort ();
  return 0;
}

to 'return 0', not abort().

llvm-svn: 19875
2005-01-28 19:32:01 +00:00
Chris Lattner
60c47267a9 Fix ConstProp/2005-01-28-SetCCGEP.ll: indexing over zero sized elements does
not change the address.

llvm-svn: 19874
2005-01-28 19:09:51 +00:00
Chris Lattner
e3aa4c01d5 New testcase.
llvm-svn: 19873
2005-01-28 19:08:32 +00:00
Chris Lattner
54903b68f2 Add some initial documentation for the SelectionDAG based instruction selectors
llvm-svn: 19872
2005-01-28 17:22:53 +00:00
Chris Lattner
5d88f184e2 Do not clean up if the MappedFile was never used or if the client already
closed the file.  This unbreaks the build.

llvm-svn: 19871
2005-01-28 16:08:23 +00:00
Andrew Lenharth
579a324137 fix ExprMap and constant check in setcc
llvm-svn: 19870
2005-01-28 14:06:46 +00:00
Jeff Cohen
c723678541 Get VC++ compiling again
llvm-svn: 19869
2005-01-28 07:29:32 +00:00
Reid Spencer
adabeccd02 Convert some old C-style casts to C++ style.
llvm-svn: 19868
2005-01-28 07:22:20 +00:00
Andrew Lenharth
479bc61455 move FP into it's own select
llvm-svn: 19867
2005-01-28 06:57:18 +00:00
Chris Lattner
eb6614d719 CopyFromReg produces two values. Make sure that we remember that both are
legalized, and actually return the correct result when we legalize the chain first.

llvm-svn: 19866
2005-01-28 06:27:38 +00:00
Chris Lattner
38389b1633 These passes are no more.
llvm-svn: 19865
2005-01-28 06:13:52 +00:00
Chris Lattner
c782335e33 Remove this code as it is currently completely broken and unmaintained.
If needed, this can be resurrected from CVS.

Note that several of the interfaces (e.g. the IPModRef ones) are supersumed
by generic AliasAnalysis interfaces that have been written since this code
was developed (and they are not DSA specific).

llvm-svn: 19864
2005-01-28 06:12:46 +00:00
Jeff Cohen
971e03d74a Properly close mapped files.
llvm-svn: 19863
2005-01-28 01:17:07 +00:00
Misha Brukman
df77835166 Mark -parallel pass as `experimental'
llvm-svn: 19858
2005-01-27 17:59:51 +00:00
Andrew Lenharth
7c538a6593 stack frame fix and zero FP reg fix
llvm-svn: 19857
2005-01-27 08:31:19 +00:00
Andrew Lenharth
96515adad6 Floating point instructions like Floating point registers
llvm-svn: 19856
2005-01-27 07:58:15 +00:00
Andrew Lenharth
0cceb5165e int to float conversion and another setcc
llvm-svn: 19855
2005-01-27 07:50:35 +00:00
Misha Brukman
3852f652bf Fix grammar
llvm-svn: 19854
2005-01-27 06:46:38 +00:00
Andrew Lenharth
3c361fd6f7 teach isel about comparison with constants and zero extending bits
llvm-svn: 19853
2005-01-27 03:49:45 +00:00
Jeff Cohen
9671b213b6 Fix some Path bugs
llvm-svn: 19852
2005-01-27 03:49:03 +00:00
Andrew Lenharth
5374789198 perhaps this will let me have calls again
llvm-svn: 19851
2005-01-27 01:22:48 +00:00
Andrew Lenharth
9e27e54d70 minor bug fix
llvm-svn: 19850
2005-01-27 00:52:26 +00:00
Andrew Lenharth
9748b623a4 minor bug fix
llvm-svn: 19849
2005-01-27 00:51:05 +00:00
Andrew Lenharth
267908ad47 added instructions for fp to int to fp moves
llvm-svn: 19848
2005-01-26 23:56:48 +00:00
Andrew Lenharth
5ae5f81720 initial fp support
llvm-svn: 19847
2005-01-26 21:54:09 +00:00
Chris Lattner
651ffb1df8 xfail this.
llvm-svn: 19846
2005-01-26 07:09:44 +00:00
Chris Lattner
a710180bba XFAIL this for now.
llvm-svn: 19845
2005-01-26 07:08:42 +00:00
Andrew Lenharth
589304de7f hum, writing on one machine, testing on another...
llvm-svn: 19844
2005-01-26 02:53:56 +00:00
Andrew Lenharth
02c5459948 add some operations, fix others. should compile several more tests now
llvm-svn: 19843
2005-01-26 01:24:38 +00:00
Chris Lattner
1b20615173 We can fold promoted and non-promoted loads into divs also!
llvm-svn: 19835
2005-01-25 20:35:10 +00:00
Chris Lattner
30607ec66e Fold promoted loads into binary ops for FP, allowing us to generate m32 forms
of FP ops.

llvm-svn: 19834
2005-01-25 20:03:11 +00:00
Andrew Lenharth
ba2bcd867f problems with bools, and their work arounds
llvm-svn: 19833
2005-01-25 19:58:40 +00:00
Alkis Evlogimenos
fbd921987f Add a dependency to the trace library so that it gets pulled in
automatically.

llvm-svn: 19828
2005-01-25 16:23:57 +00:00
Reid Spencer
97f0f7646d Document the --load option.
llvm-svn: 19822
2005-01-25 05:04:49 +00:00
Andrew Lenharth
122489bcab more load choices, better add with imm
llvm-svn: 19821
2005-01-25 00:35:34 +00:00
Chris Lattner
2e2edef9c6 Make -ds-aa more useful, allowing it to be updated as xforms hack on the program.
llvm-svn: 19818
2005-01-24 20:00:14 +00:00
Chris Lattner
d64fafd937 Add some methods.
llvm-svn: 19817
2005-01-24 19:55:34 +00:00
Andrew Lenharth
2f0f845534 Clean ups, and taught the instruction selector about immediate forms
llvm-svn: 19816
2005-01-24 19:44:07 +00:00
Andrew Lenharth
6d1a96bccc Alpha JIT prune
llvm-svn: 19815
2005-01-24 18:48:22 +00:00
Andrew Lenharth
3c12772190 include prune and JIT prune
llvm-svn: 19814
2005-01-24 18:45:41 +00:00
Andrew Lenharth
4680f89526 Pruned includes
llvm-svn: 19813
2005-01-24 18:37:48 +00:00
Andrew Lenharth
f36418f618 let configure recognize Alphas
llvm-svn: 19811
2005-01-24 17:33:52 +00:00
Andrew Lenharth
3c3de91b79 let configure recognize Alphas
llvm-svn: 19810
2005-01-24 17:25:41 +00:00
Misha Brukman
454c06f5a4 Mark CVS versions different from releases
llvm-svn: 19809
2005-01-24 16:29:24 +00:00
Misha Brukman
664d251443 primitive' has no a'
llvm-svn: 19808
2005-01-24 16:28:03 +00:00
Chris Lattner
5b9c49b6f2 Do not return true from isSized for things without a size (like functions and
labels) even though they are concrete.  This fixes the DSA regressions from
last night.

llvm-svn: 19807
2005-01-24 16:00:52 +00:00
Chris Lattner
b6627702b4 This giant patch speeds up Type::isSized(). Before, this would have to search
large nested types over and over again to determine if they are sized or not.
Now, isSized() is able to make snap decisions about all concrete types, which
are a common occurance (and includes all primitives).

On 177.mesa, this speeds up DSE from 39.5s -> 21.3s and GCSE from
13.2s -> 11.3s, reducing gccas time from 80s -> 61s (this is a debug build).

DSE and GCSE are still too slow on this testcase, but this is a simple
improvement.

llvm-svn: 19800
2005-01-24 02:08:34 +00:00
Chris Lattner
39837024ae Fix a spurious warning.
llvm-svn: 19799
2005-01-24 01:40:18 +00:00
Chris Lattner
0e1de101a1 Silence a warning.
llvm-svn: 19798
2005-01-23 23:20:06 +00:00
Chris Lattner
0dfd7d3a0d Silence optimized warnings.
llvm-svn: 19797
2005-01-23 23:19:44 +00:00
Chris Lattner
debae1e3c3 Allow the FP stackifier to completely ignore functions that do not use FP at
all.  This should speed up the X86 backend fairly significantly on integer
codes.  Now if only we didn't have to compute livevar still... ;-)

llvm-svn: 19796
2005-01-23 23:13:59 +00:00
Chris Lattner
fb5614506e Simplify/speedup the PEI by not having to scan for uses of the callee saved
registers.  This information is computed directly by the register allocator
now.

llvm-svn: 19795
2005-01-23 23:13:12 +00:00
Chris Lattner
90b491f46a Add an accessor.
llvm-svn: 19794
2005-01-23 22:57:27 +00:00
Chris Lattner
3d527f7b61 Update physregsused info.
llvm-svn: 19793
2005-01-23 22:55:45 +00:00
Chris Lattner
24f0f0e28f Update this pass to set PhysRegsUsed info in MachineFunction.
llvm-svn: 19792
2005-01-23 22:51:56 +00:00
Chris Lattner
ae09d93b35 Update these register allocators to set the PhysRegUsed info in MachineFunction.
llvm-svn: 19791
2005-01-23 22:45:13 +00:00
Chris Lattner
304053c6ec Add support for the PhysRegsUsed array.
llvm-svn: 19789
2005-01-23 22:13:58 +00:00
Chris Lattner
1def519f3d Expose more information from register allocation to passes that run after
it.

llvm-svn: 19788
2005-01-23 22:13:36 +00:00
Chris Lattner
ef2de322c6 Speed this up a bit by making ModifiedRegs a vector<char> not vector<bool>
llvm-svn: 19787
2005-01-23 21:45:01 +00:00
Chris Lattner
9e2c7facb2 Get rid of a several dozen more and instructions in specint.
llvm-svn: 19786
2005-01-23 20:26:55 +00:00
Chris Lattner
6c43f5e5fe Fix crash comparing empty file against nonempty file.
llvm-svn: 19782
2005-01-23 06:02:40 +00:00
Chris Lattner
4add7e356f Adjust to changes in SelectionDAG interfaces
The first half of correct chain insertion for libcalls. This is not enough
to fix Fhourstones yet though.

llvm-svn: 19781
2005-01-23 04:42:50 +00:00
Chris Lattner
90b7c13f3a Remove the 3 HACK HACK HACKs I put in before, fixing them properly with
the new TLI that is available.

Implement support for handling out of range shifts.  This allows us to
compile this code (a 64-bit rotate):

unsigned long long f3(unsigned long long x) {
  return (x << 32) | (x >> (64-32));
}

into this:

f3:
        mov %EDX, DWORD PTR [%ESP + 4]
        mov %EAX, DWORD PTR [%ESP + 8]
        ret

GCC produces this:

$ gcc t.c -masm=intel -O3 -S -o - -fomit-frame-pointer
..
f3:
        push    %ebx
        mov     %ebx, DWORD PTR [%esp+12]
        mov     %ecx, DWORD PTR [%esp+8]
        mov     %eax, %ebx
        mov     %edx, %ecx
        pop     %ebx
        ret

The Simple ISEL produces (eww gross):

f3:
        sub %ESP, 4
        mov DWORD PTR [%ESP], %ESI
        mov %EDX, DWORD PTR [%ESP + 8]
        mov %ECX, DWORD PTR [%ESP + 12]
        mov %EAX, 0
        mov %ESI, 0
        or %EAX, %ECX
        or %EDX, %ESI
        mov %ESI, DWORD PTR [%ESP]
        add %ESP, 4
        ret

llvm-svn: 19780
2005-01-23 04:39:44 +00:00
Chris Lattner
ffcb0ae329 Adjust to changes in SelectionDAG interface.
llvm-svn: 19779
2005-01-23 04:36:26 +00:00
Chris Lattner
2877e9e826 Give SelectionDAG a TargetLowering instance instead of TM instance.
llvm-svn: 19778
2005-01-23 04:36:06 +00:00
Chris Lattner
28939a222e Build Alpha by default.
llvm-svn: 19777
2005-01-23 04:34:46 +00:00
Reid Spencer
d5d45b8d1a Fix alloca support for Cygwin. On cygwin its __alloca not __builtin_alloca
llvm-svn: 19776
2005-01-23 04:32:47 +00:00
Reid Spencer
30226da5b3 Support Cygwin assembly generation. The cygwin version of Gnu ASsembler
doesn't support certain directives and symbols on cygwin are prefixed with
an underscore. This patch makes the necessary adjustments to the output.

llvm-svn: 19775
2005-01-23 03:52:14 +00:00
Chris Lattner
ece10a420e Add support for fp tolerances
llvm-svn: 19774
2005-01-23 03:45:26 +00:00
Chris Lattner
580f5bfae3 This method takes sys::Path objects now.
llvm-svn: 19773
2005-01-23 03:32:16 +00:00
Chris Lattner
411bbeeac7 Adjust to changed interface.
llvm-svn: 19772
2005-01-23 03:31:39 +00:00
Chris Lattner
b782187b32 Make DiffFilesWithTolerance take sys::Path's instead of std::strings
Delete dead functions.

llvm-svn: 19771
2005-01-23 03:31:02 +00:00
Chris Lattner
7e264b2ec6 Remove two dead methods and improve the comments for DiffFilesWithTolerance.
Also, make DiffFilesWithTolerance take sys::Path objects instead of std::strings.

llvm-svn: 19770
2005-01-23 03:30:39 +00:00
Chris Lattner
364e8b771d Fix a bug in previous checkin
llvm-svn: 19769
2005-01-23 03:19:13 +00:00
Chris Lattner
dff29cd72e Drop dead #include
llvm-svn: 19768
2005-01-23 03:16:56 +00:00
Chris Lattner
c5a20a5dd4 The meat of this utility has been moved to FileUtilities, where it can be
used by other tools.

llvm-svn: 19767
2005-01-23 03:15:47 +00:00
Chris Lattner
16a4368c40 Add a new method, refactored out of fpcmp
llvm-svn: 19766
2005-01-23 03:13:43 +00:00
Chris Lattner
ca2bf0b67a New method.
llvm-svn: 19765
2005-01-23 03:11:38 +00:00
Andrew Lenharth
a1b5ca2b9d Let me introduce you to the early stages of the llvm backend for the alpha processor
llvm-svn: 19764
2005-01-22 23:41:55 +00:00
Chris Lattner
eccb73d57f Get this to work for 64-bit systems.
llvm-svn: 19763
2005-01-22 23:04:37 +00:00
Reid Spencer
12b25a12a6 We're working towards LLVM 1.5 now so bump the version number. This change
won't be propagated to the configure script until there's a need to change
configure.ac for some larger purpose.

llvm-svn: 19762
2005-01-22 21:29:42 +00:00
Chris Lattner
97cf8fd4a9 Minor fix.
llvm-svn: 19761
2005-01-22 20:59:38 +00:00
Chris Lattner
59a7f5c2f3 This is the final big of factoring. This shares cases in suboperand
differences, which means that identical instructions (after stripping off
the first literal string) do not run any different code at all.  On the X86,
this turns this code:

    switch (MI->getOpcode()) {
    case X86::ADC32mi: printOperand(MI, 4, MVT::i32); break;
    case X86::ADC32mi8: printOperand(MI, 4, MVT::i8); break;
    case X86::ADC32mr: printOperand(MI, 4, MVT::i32); break;
    case X86::ADD32mi: printOperand(MI, 4, MVT::i32); break;
    case X86::ADD32mi8: printOperand(MI, 4, MVT::i8); break;
    case X86::ADD32mr: printOperand(MI, 4, MVT::i32); break;
    case X86::AND32mi: printOperand(MI, 4, MVT::i32); break;
    case X86::AND32mi8: printOperand(MI, 4, MVT::i8); break;
    case X86::AND32mr: printOperand(MI, 4, MVT::i32); break;
    case X86::CMP32mi: printOperand(MI, 4, MVT::i32); break;
    case X86::CMP32mr: printOperand(MI, 4, MVT::i32); break;
    case X86::MOV32mi: printOperand(MI, 4, MVT::i32); break;
    case X86::MOV32mr: printOperand(MI, 4, MVT::i32); break;
    case X86::OR32mi: printOperand(MI, 4, MVT::i32); break;
    case X86::OR32mi8: printOperand(MI, 4, MVT::i8); break;
    case X86::OR32mr: printOperand(MI, 4, MVT::i32); break;
    case X86::ROL32mi: printOperand(MI, 4, MVT::i8); break;
    case X86::ROR32mi: printOperand(MI, 4, MVT::i8); break;
    case X86::SAR32mi: printOperand(MI, 4, MVT::i8); break;
    case X86::SBB32mi: printOperand(MI, 4, MVT::i32); break;
    case X86::SBB32mi8: printOperand(MI, 4, MVT::i8); break;
    case X86::SBB32mr: printOperand(MI, 4, MVT::i32); break;
    case X86::SHL32mi: printOperand(MI, 4, MVT::i8); break;
    case X86::SHLD32mrCL: printOperand(MI, 4, MVT::i32); break;
    case X86::SHR32mi: printOperand(MI, 4, MVT::i8); break;
    case X86::SHRD32mrCL: printOperand(MI, 4, MVT::i32); break;
    case X86::SUB32mi: printOperand(MI, 4, MVT::i32); break;
    case X86::SUB32mi8: printOperand(MI, 4, MVT::i8); break;
    case X86::SUB32mr: printOperand(MI, 4, MVT::i32); break;
    case X86::TEST32mi: printOperand(MI, 4, MVT::i32); break;
    case X86::TEST32mr: printOperand(MI, 4, MVT::i32); break;
    case X86::TEST8mi: printOperand(MI, 4, MVT::i8); break;
    case X86::XCHG32mr: printOperand(MI, 4, MVT::i32); break;
    case X86::XOR32mi: printOperand(MI, 4, MVT::i32); break;
    case X86::XOR32mi8: printOperand(MI, 4, MVT::i8); break;
    case X86::XOR32mr: printOperand(MI, 4, MVT::i32); break;
    }

into this:

    switch (MI->getOpcode()) {
    case X86::ADC32mi:
    case X86::ADC32mr:
    case X86::ADD32mi:
    case X86::ADD32mr:
    case X86::AND32mi:
    case X86::AND32mr:
    case X86::CMP32mi:
    case X86::CMP32mr:
    case X86::MOV32mi:
    case X86::MOV32mr:
    case X86::OR32mi:
    case X86::OR32mr:
    case X86::SBB32mi:
    case X86::SBB32mr:
    case X86::SHLD32mrCL:
    case X86::SHRD32mrCL:
    case X86::SUB32mi:
    case X86::SUB32mr:
    case X86::TEST32mi:
    case X86::TEST32mr:
    case X86::XCHG32mr:
    case X86::XOR32mi:
    case X86::XOR32mr: printOperand(MI, 4, MVT::i32); break;
    case X86::ADC32mi8:
    case X86::ADD32mi8:
    case X86::AND32mi8:
    case X86::OR32mi8:
    case X86::ROL32mi:
    case X86::ROR32mi:
    case X86::SAR32mi:
    case X86::SBB32mi8:
    case X86::SHL32mi:
    case X86::SHR32mi:
    case X86::SUB32mi8:
    case X86::TEST8mi:
    case X86::XOR32mi8: printOperand(MI, 4, MVT::i8); break;
    }

After this, the generated asmwriters look pretty much as though they were
generated by hand.  This shrinks the X86 asmwriter.inc files from 55101->39669
and 55429->39551 bytes each, and PPC from 16766->12859 bytes.

llvm-svn: 19760
2005-01-22 20:31:17 +00:00
Chris Lattner
92275bb6bb Implement *even more* factoring. In particular, if all of the instruction
strings starts out with a constant string, we emit the string first, using
a table lookup (instead of a switch statement).

Because this is usually the opcode portion of the asm string, the differences
between the instructions have now been greatly reduced.  This allows many
more case statements to be grouped together.

This patch also allows instruction cases to be grouped together when the
instruction patterns are exactly identical (common after the opcode string
has been ripped off), and when the differing operand is a MachineInstr
operand that needs to be formatted.

The end result of this is a mean and lean generated AsmPrinter!

llvm-svn: 19759
2005-01-22 19:22:23 +00:00
Chris Lattner
945e8655dd Refactor code for numbering instructions into CodeGenTarget.
llvm-svn: 19758
2005-01-22 18:58:51 +00:00
Jeff Cohen
da636b3783 Fix VC++ compilation error
llvm-svn: 19757
2005-01-22 18:50:10 +00:00
Chris Lattner
64d9d2b819 QOI feature implemented.
llvm-svn: 19756
2005-01-22 18:45:35 +00:00
Chris Lattner
9ceb7c8f23 Implement factoring of instruction pattern strings. In particular, instead of
emitting code like this:

  case PPC::ADD: O  << "add ";  printOperand(MI, 0, MVT::i64); O  << ", ";  prin
tOperand(MI, 1, MVT::i64); O  << ", ";  printOperand(MI, 2, MVT::i64); O  << '\n
'; break;
  case PPC::ADDC: O  << "addc ";  printOperand(MI, 0, MVT::i64); O  << ", ";  pr
intOperand(MI, 1, MVT::i64); O  << ", ";  printOperand(MI, 2, MVT::i64); O  << '
\n'; break;
  case PPC::ADDE: O  << "adde ";  printOperand(MI, 0, MVT::i64); O  << ", ";  pr
intOperand(MI, 1, MVT::i64); O  << ", ";  printOperand(MI, 2, MVT::i64); O  << '
\n'; break;
...

Emit code like this:

  case PPC::ADD:
  case PPC::ADDC:
  case PPC::ADDE:
  ...
    switch (MI->getOpcode()) {
    case PPC::ADD: O << "add "; break;
    case PPC::ADDC: O << "addc "; break;
    case PPC::ADDE: O << "adde "; break;
    ...
    }
    printOperand(MI, 0, MVT::i64);
    O << ", ";
    printOperand(MI, 1, MVT::i64);
    O << ", ";
    printOperand(MI, 2, MVT::i64);
    O << "\n";
    break;

This shrinks the PPC asm writer from 24785->15205 bytes (even though the new
asmwriter has much more whitespace than the old one), and the X86 printers shrink
quite a bit too.  The important implication of this is that GCC no longer hits swap
when building the PPC backend in optimized mode.  Thus this fixes PR448.

-Chris

llvm-svn: 19755
2005-01-22 18:38:13 +00:00
Chris Lattner
b6f5d9a82a Fix the ::: problem
llvm-svn: 19754
2005-01-22 18:18:59 +00:00
Chris Lattner
3baf682110 Minor refactoring, no functionality change.
llvm-svn: 19753
2005-01-22 17:40:38 +00:00
Jeff Cohen
ff696def84 oops
llvm-svn: 19752
2005-01-22 17:37:13 +00:00
Jeff Cohen
c8f1f4bc8e Use binary mode for reading/writing bytecode files
llvm-svn: 19751
2005-01-22 17:36:17 +00:00
Jeff Cohen
e90b0c5469 Add (non-working) project bugpoint to Visual Studio
llvm-svn: 19750
2005-01-22 17:35:30 +00:00
Chris Lattner
0c23ba5c0f Seperate asmstring parsing from emission. This allows the code to be simpler
and more understandable.  It also allows us to do simple things like fold
consequtive literal strings together.  For example, instead of emitting this
for the X86 backend:

  O  << "adc" << "l" << " ";

we now generate this:

  O << "adcl ";

*whoa* :)

This shrinks the X86 asmwriters from 62729->58267 and 65176->58644 bytes
for the intel/att asm writers respectively.

llvm-svn: 19749
2005-01-22 17:32:42 +00:00
Jeff Cohen
0e64c73e67 Don't exclude FileUtilies and ToolRunner from VC++ build
llvm-svn: 19748
2005-01-22 16:32:47 +00:00
Jeff Cohen
142b4a721f Fix VC++ complaint
llvm-svn: 19747
2005-01-22 16:30:58 +00:00
Jeff Cohen
ccbd3f0d57 Fix destroyDirectory bug
llvm-svn: 19746
2005-01-22 16:28:33 +00:00
Chris Lattner
52c97fbea9 Implicitly defined registers can clobber callee saved registers too!
This fixes the return-address-not-being-saved problem in the Alpha backend.

llvm-svn: 19741
2005-01-22 00:49:16 +00:00
Andrew Lenharth
67e2e21353 make double-dollar properly escape asmstrings
llvm-svn: 19740
2005-01-22 00:35:22 +00:00
Chris Lattner
3bc78b2e0b More bugfixes for IA64 shifts.
llvm-svn: 19739
2005-01-22 00:33:03 +00:00
Chris Lattner
ec2183713c Fix problems with non-x86 targets.
llvm-svn: 19738
2005-01-22 00:31:52 +00:00
Chris Lattner
d637c96fac Add a nasty hack to fix Alpha/IA64 multiplies by a power of two.
llvm-svn: 19737
2005-01-22 00:20:42 +00:00
Chris Lattner
d53e763f18 Remove unneeded line.
llvm-svn: 19736
2005-01-21 23:43:12 +00:00
Chris Lattner
4f987bf16d test commit
llvm-svn: 19735
2005-01-21 23:38:56 +00:00
Chris Lattner
fc4429e7c1 Handle comparisons of gep instructions that have different typed indices
as long as they are the same size.

llvm-svn: 19734
2005-01-21 23:06:49 +00:00
Chris Lattner
e70eb9da7d Speed up folding operations into loads.
llvm-svn: 19733
2005-01-21 21:43:02 +00:00
Chris Lattner
e85a8d8f92 Keep track of node depth for each node
llvm-svn: 19732
2005-01-21 21:39:38 +00:00
Chris Lattner
e1e844c416 The ever-important vanity pass name :)
llvm-svn: 19731
2005-01-21 21:35:14 +00:00
Chris Lattner
28edd69eb4 If the interpreter tries to execute an external function, kill it. Of course
since we are dirty, special case __main.  This should fix the infinite loop
horrible stuff that happens on linux-alpha when configuring llvm-gcc.  It
might also help cygwin, who knows??

llvm-svn: 19729
2005-01-21 19:59:37 +00:00
Chris Lattner
c78776d209 Fix a FIXME: realize that argument stores are all independent (don't alias)
llvm-svn: 19728
2005-01-21 19:46:38 +00:00
Chris Lattner
96e809c47d Unary token factor nodes are unneeded.
llvm-svn: 19727
2005-01-21 18:01:22 +00:00
Chris Lattner
aac464e6c0 Refactor libcall code a bit. Initial implementation of expanding int -> FP
operations for 64-bit integers.

llvm-svn: 19724
2005-01-21 06:05:23 +00:00
Chris Lattner
4105d5f249 Apparently destroyFile() now throws an exception. Since this class is
designed to be put on the stack, that's not cool.  Catch and ignore the
exception.

llvm-svn: 19723
2005-01-20 23:31:35 +00:00
Chris Lattner
ac4e5ef023 Remove this test. This test is already in PR269, so it should be
readded when the bug is fixed.

llvm-svn: 19722
2005-01-20 20:58:42 +00:00
Chris Lattner
4d25c04f94 Simplify the shift-expansion code.
llvm-svn: 19721
2005-01-20 20:29:23 +00:00
Chris Lattner
2a631fa406 Implement ADD_PARTS/SUB_PARTS so that 64-bit integer add/sub work. This
fixes most of the remaining llc-beta failures.

llvm-svn: 19716
2005-01-20 18:53:00 +00:00
Chris Lattner
b3f83b28a5 Expand add/sub into ADD_PARTS/SUB_PARTS instead of a non-existant libcall.
llvm-svn: 19715
2005-01-20 18:52:28 +00:00
Chris Lattner
1fe9b40981 implement add_parts/sub_parts.
llvm-svn: 19714
2005-01-20 18:50:55 +00:00
Chris Lattner
ad1ffcc358 Eliminate the unimplemented ADDC/SUBB operations, add ADD_PARTS/SUB_PARTS instead.
llvm-svn: 19713
2005-01-20 18:50:39 +00:00
Chris Lattner
28d15860bd Add missing entry.
llvm-svn: 19712
2005-01-20 17:32:28 +00:00
Chris Lattner
5b04f33405 Fix a crash compiling 134.perl.
llvm-svn: 19711
2005-01-20 16:50:16 +00:00
Jeff Cohen
90f0dc8fc6 Get analyze to show all analysis options when compiled with VC++
llvm-svn: 19710
2005-01-20 05:19:40 +00:00
Jeff Cohen
e1fde90bac Add analyze project to Visual Studio
llvm-svn: 19709
2005-01-20 04:52:59 +00:00
Jeff Cohen
6eaf83e172 Add project llvm-proj to Visual Studio
llvm-svn: 19708
2005-01-20 04:41:49 +00:00
Chris Lattner
96c26751ec Support targets that do not use i8 shift amounts.
llvm-svn: 19707
2005-01-19 22:31:21 +00:00
Chris Lattner
411336fe04 Add two optimizations. The first folds (X+Y)-X -> Y
The second folds operations into selects, e.g. (select C, (X+Y), (Y+Z))
-> (Y+(select C, X, Z)

This occurs a few times across spec, e.g.

         select    add/sub
mesa:    83        0
povray:  5         2
gcc      4         2
parser   0         22
perlbmk  13        30
twolf    0         3

llvm-svn: 19706
2005-01-19 21:50:18 +00:00
Chris Lattner
2547f05be8 Add some new tests
llvm-svn: 19705
2005-01-19 21:48:31 +00:00
Chris Lattner
f840289291 Add an assertion that would have made more sense to duraid
llvm-svn: 19704
2005-01-19 21:32:07 +00:00
Chris Lattner
3d95c14d94 Add support for targets that pass args in registers to calls.
llvm-svn: 19703
2005-01-19 20:24:35 +00:00
Chris Lattner
5695864a41 Add an accessor for targets that pass args in regs
llvm-svn: 19702
2005-01-19 20:19:58 +00:00
Chris Lattner
55562fa99a Fold single use token factor nodes into other token factor nodes.
llvm-svn: 19701
2005-01-19 19:10:54 +00:00
Chris Lattner
0d03eb45a8 Realize the individual pieces of an expanded copytoreg/store/load are
independent of each other.

llvm-svn: 19700
2005-01-19 18:02:17 +00:00
Chris Lattner
9b75e148fd Know some identities about tokenfactor nodes.
llvm-svn: 19699
2005-01-19 18:01:40 +00:00
Chris Lattner
32a5f02598 Know some simple identities. This improves codegen for (1LL << N).
llvm-svn: 19698
2005-01-19 17:29:49 +00:00
Chris Lattner
474aac4da9 Fix a problem where were were literally selecting for INCREASED register
pressure, not decreases register pressure.  Fix problem where we accidentally
swapped the operands of SHLD, which caused fourinarow to fail.  This fixes
fourinarow.

llvm-svn: 19697
2005-01-19 17:24:34 +00:00
Chris Lattner
1cffa73f2a Just in case, handle something that is both a use and a def.
llvm-svn: 19696
2005-01-19 17:11:51 +00:00
Chris Lattner
00c436824f When an instruction moves, make sure to update the VarInfo::Kills list as
well as all of teh other stuff in livevar. This fixes the compiler crash
on fourinarow last night.

llvm-svn: 19695
2005-01-19 17:09:15 +00:00
Chris Lattner
25be208e02 When commuting these instructions, make sure to actually swap the operands too.
llvm-svn: 19694
2005-01-19 16:55:52 +00:00
Chris Lattner
a3cc1835ad Fix 'raise' to work with packed types. Patch by Morten Ofstad.
llvm-svn: 19693
2005-01-19 16:16:35 +00:00
Chris Lattner
de87d146ab Implement Regression/CodeGen/X86/rotate.ll: emit rotate instructions (which
typically cost 1 cycle) instead of shld/shrd instruction (which are typically
6 or more cycles).  This also saves code space.

For example, instead of emitting:

rotr:
        mov %EAX, DWORD PTR [%ESP + 4]
        mov %CL, BYTE PTR [%ESP + 8]
        shrd %EAX, %EAX, %CL
        ret
rotli:
        mov %EAX, DWORD PTR [%ESP + 4]
        shrd %EAX, %EAX, 27
        ret

Emit:

rotr32:
        mov %CL, BYTE PTR [%ESP + 8]
        mov %EAX, DWORD PTR [%ESP + 4]
        ror %EAX, %CL
        ret
rotli32:
        mov %EAX, DWORD PTR [%ESP + 4]
        ror %EAX, 27
        ret

We also emit byte rotate instructions which do not have a sh[lr]d counterpart
at all.

llvm-svn: 19692
2005-01-19 08:07:05 +00:00
Chris Lattner
c4adfbbd0b New testcase for rotate instructions. Each function should codegen to a
rotate.

llvm-svn: 19691
2005-01-19 08:04:08 +00:00
Chris Lattner
0edf9535b9 Add rotate instructions.
llvm-svn: 19690
2005-01-19 07:50:03 +00:00
Chris Lattner
29f5819158 Match 16-bit shld/shrd instructions as well, implementing shift-double.llx:test5
llvm-svn: 19689
2005-01-19 07:37:26 +00:00
Chris Lattner
603677549f Add a test for 16-bit sh*d.
llvm-svn: 19688
2005-01-19 07:37:01 +00:00
Chris Lattner
d54845f530 Improve coverage of the X86 instruction set by adding 16-bit shift doubles.
llvm-svn: 19687
2005-01-19 07:31:24 +00:00
Chris Lattner
2947801735 Teach the code generator that shrd/shld is commutable if it has an immediate.
This allows us to generate this:

foo:
        mov %EAX, DWORD PTR [%ESP + 4]
        mov %EDX, DWORD PTR [%ESP + 8]
        shld %EDX, %EDX, 2
        shl %EAX, 2
        ret

instead of this:

foo:
        mov %EAX, DWORD PTR [%ESP + 4]
        mov %ECX, DWORD PTR [%ESP + 8]
        mov %EDX, %EAX
        shrd %EDX, %ECX, 30
        shl %EAX, 2
        ret

Note the magically transmogrifying immediate.

llvm-svn: 19686
2005-01-19 07:11:01 +00:00
Chris Lattner
ea42c15da9 Use the TargetInstrInfo::commuteInstruction method to commute instructions
instead of doing it manually.

llvm-svn: 19685
2005-01-19 07:08:42 +00:00
Chris Lattner
f6932b700b Finegrainify namespacification
Add default impl of commuteInstruction
Add notes about ugly V9 code.

llvm-svn: 19684
2005-01-19 06:53:34 +00:00
Chris Lattner
eadd41207d Add a new method, described in the comment.
llvm-svn: 19683
2005-01-19 06:53:02 +00:00
Chris Lattner
892336a1b5 Ensure that each these functions generates a sh[rl]d instruction.
llvm-svn: 19682
2005-01-19 06:30:36 +00:00
Chris Lattner
41fe201b61 Codegen long >> 2 to this:
foo:
        mov %EAX, DWORD PTR [%ESP + 4]
        mov %EDX, DWORD PTR [%ESP + 8]
        shrd %EAX, %EDX, 2
        sar %EDX, 2
        ret

instead of this:

test1:
        mov %ECX, DWORD PTR [%ESP + 4]
        shr %ECX, 2
        mov %EDX, DWORD PTR [%ESP + 8]
        mov %EAX, %EDX
        shl %EAX, 30
        or %EAX, %ECX
        sar %EDX, 2
        ret

and long << 2 to this:

foo:
        mov %EAX, DWORD PTR [%ESP + 4]
        mov %ECX, DWORD PTR [%ESP + 8]
***     mov %EDX, %EAX
        shrd %EDX, %ECX, 30
        shl %EAX, 2
        ret

instead of this:

foo:
        mov %EAX, DWORD PTR [%ESP + 4]
        mov %ECX, %EAX
        shr %ECX, 30
        mov %EDX, DWORD PTR [%ESP + 8]
        shl %EDX, 2
        or %EDX, %ECX
        shl %EAX, 2
        ret

The extra copy (marked ***) can be eliminated when I teach the code generator
that shrd32rri8 is really commutative.

llvm-svn: 19681
2005-01-19 06:18:43 +00:00
Jeff Cohen
7230239553 Add missing data types for VC++
llvm-svn: 19680
2005-01-19 05:08:31 +00:00
Chris Lattner
2a7f8a94f4 Implement a way of expanding shifts. This applies to targets that offer
select operations or to shifts that are by a constant.  This automatically
implements (with no special code) all of the special cases for shift by 32,
shift by < 32 and shift by > 32.

llvm-svn: 19679
2005-01-19 04:19:40 +00:00
Chris Lattner
d8d306601a X86 shifts mask the amount.
llvm-svn: 19678
2005-01-19 03:36:30 +00:00
Chris Lattner
a05cd83d2f Add a hook to find out how the target handles shift amounts that are out of
range.  Either they are undefined (the default), they mask the shift amount
to the size of the register (X86, Alpha, etc), or they extend the shift (PPC).

This defaults to undefined, which is conservatively correct.

llvm-svn: 19677
2005-01-19 03:36:14 +00:00
Chris Lattner
9aa4886283 Move all data members to the end of the class.
Add a hook to find out how the target handles shift amounts that are out of
range.  Either they are undefined (the default), they mask the shift amount
to the size of the register (X86, Alpha, etc), or they extend the shift (PPC).

This defaults to undefined, which is conservatively correct.

llvm-svn: 19676
2005-01-19 03:36:03 +00:00
Chris Lattner
42993e45b6 Zero is cheaper than sign extend.
llvm-svn: 19675
2005-01-18 21:57:59 +00:00
Chris Lattner
14947c34cc Code to handle FP_EXTEND is dead now. X86 doesn't support any data types to
FP_EXTEND from!

llvm-svn: 19674
2005-01-18 20:05:56 +00:00
Chris Lattner
c6e928cba5 Remove more dead code.
llvm-svn: 19673
2005-01-18 19:50:08 +00:00
Chris Lattner
0616fa6b9b The selection dag code handles the promotions from F32 to F64 for us, so we
don't need to even think about F32 in the X86 code anymore.

llvm-svn: 19672
2005-01-18 19:46:54 +00:00
Chris Lattner
d65c3f3118 Fix some fixmes (promoting bools for select and brcond), fix promotion
of zero and sign extends.

llvm-svn: 19671
2005-01-18 19:27:06 +00:00
Chris Lattner
a9d53f9fb9 Keep track of the retval type as well.
llvm-svn: 19670
2005-01-18 19:26:36 +00:00
Chris Lattner
8cd93be302 Keep track of the returned value type as well.
llvm-svn: 19669
2005-01-18 19:26:18 +00:00
Chris Lattner
9f2c4a5200 Teach legalize to promote copy(from|to)reg, instead of making the isel pass
do it.  This results in better code on X86 for floats (because if strict
precision is not required, we can elide some more expensive double -> float
conversions like the old isel did), and allows other targets to emit
CopyFromRegs that are not legal for arguments.

llvm-svn: 19668
2005-01-18 17:54:55 +00:00
Chris Lattner
479c7118e4 Fix 124.m88ksim.
llvm-svn: 19667
2005-01-18 17:35:28 +00:00
Jeff Cohen
cef394290f Add project llvm-ld to Visual Studio
llvm-svn: 19665
2005-01-18 05:44:50 +00:00
Jeff Cohen
18320b07d4 Add project llvm-nm to Visual Studio
llvm-svn: 19664
2005-01-18 05:44:25 +00:00
Jeff Cohen
1a6c167332 Add project llvm-ld to Visual Studio
llvm-svn: 19663
2005-01-18 05:39:37 +00:00
Jeff Cohen
c45440c72b Add llvm-bcanalyzer project to Visual Studio
llvm-svn: 19662
2005-01-18 05:31:34 +00:00
Chris Lattner
ed246ec0d2 Do not emit loads multiple times, potentially in the wrong places.
llvm-svn: 19661
2005-01-18 04:18:32 +00:00
Tanya Lattner
c227ad2640 Minor changes.
llvm-svn: 19660
2005-01-18 04:15:41 +00:00
Chris Lattner
28a205e01b Eliminate bad assertions.
llvm-svn: 19659
2005-01-18 04:00:54 +00:00
Chris Lattner
78d3028350 * Eliminate the TokenSet and just use the ExprMap for both tokens and values.
* Insert some really pedantic assertions that will notice when we emit the
  same loads more than one time, exposing bugs.  This turns a miscompilation in
  bzip2 into a compile-fail.  yaay.

llvm-svn: 19658
2005-01-18 03:51:59 +00:00
Chris Lattner
2cb338d7b5 Teach legalize to promote SetCC results.
llvm-svn: 19657
2005-01-18 02:59:52 +00:00
Chris Lattner
b07e2d2084 Allow setcc operations to have nonbool types.
llvm-svn: 19656
2005-01-18 02:52:03 +00:00
Chris Lattner
178219f913 Allow setcc operations to have non-bool types.
llvm-svn: 19655
2005-01-18 02:51:41 +00:00
Chris Lattner
d7f93950aa Rely on the code in MatchAddress to do this work. Otherwise we fail to
match (X+Y)+(Z << 1), because we match the X+Y first, consuming the index
register, then there is no place to put the Z.

llvm-svn: 19652
2005-01-18 02:25:52 +00:00
Chris Lattner
2b4b79581d Fix the completely broken FP constant folds for setcc's.
llvm-svn: 19651
2005-01-18 02:11:55 +00:00
Chris Lattner
a7acdda064 Fix a problem where probing for addressing modes caused expressions to be
emitted too early.  In particular, this fixes
Regression/CodeGen/X86/regpressure.ll:regpressure3.

This also improves the 2nd basic block in 164.gzip:flush_block, which went from

.LBBflush_block_1:      # loopentry.1.i
        movzx %EAX, WORD PTR [dyn_ltree + 20]
        movzx %ECX, WORD PTR [dyn_ltree + 16]
        mov DWORD PTR [%ESP + 32], %ECX
        movzx %ECX, WORD PTR [dyn_ltree + 12]
        movzx %EDX, WORD PTR [dyn_ltree + 8]
        movzx %EBX, WORD PTR [dyn_ltree + 4]
        mov DWORD PTR [%ESP + 36], %EBX
        movzx %EBX, WORD PTR [dyn_ltree]
        add DWORD PTR [%ESP + 36], %EBX
        add %EDX, DWORD PTR [%ESP + 36]
        add %ECX, %EDX
        add DWORD PTR [%ESP + 32], %ECX
        add %EAX, DWORD PTR [%ESP + 32]
        movzx %ECX, WORD PTR [dyn_ltree + 24]
        add %EAX, %ECX
        mov %ECX, 0
        mov %EDX, %ECX

to

.LBBflush_block_1:      # loopentry.1.i
        movzx %EAX, WORD PTR [dyn_ltree]
        movzx %ECX, WORD PTR [dyn_ltree + 4]
        add %ECX, %EAX
        movzx %EAX, WORD PTR [dyn_ltree + 8]
        add %EAX, %ECX
        movzx %ECX, WORD PTR [dyn_ltree + 12]
        add %ECX, %EAX
        movzx %EAX, WORD PTR [dyn_ltree + 16]
        add %EAX, %ECX
        movzx %ECX, WORD PTR [dyn_ltree + 20]
        add %ECX, %EAX
        movzx %EAX, WORD PTR [dyn_ltree + 24]
        add %ECX, %EAX
        mov %EAX, 0
        mov %EDX, %EAX

... which results in less spilling in the function.

This change alone speeds up 164.gzip from 37.23s to 36.24s on apoc.  The
default isel takes 37.31s.

llvm-svn: 19650
2005-01-18 01:06:26 +00:00
Chris Lattner
b93409f3e2 Fix indentation.
llvm-svn: 19649
2005-01-17 23:25:45 +00:00
Chris Lattner
81841af594 This is a carefully contrived testcase where the X86 ISel is emitting all loads
before other ops, causing it to spill like mad.  This occurs in
164.gzip:flush_block.

llvm-svn: 19648
2005-01-17 23:16:01 +00:00
Chris Lattner
a5d137f471 Don't bother using max here.
llvm-svn: 19647
2005-01-17 23:02:13 +00:00
Chris Lattner
ca318edb94 Do not give token factor nodes outrageous weights
llvm-svn: 19645
2005-01-17 22:56:09 +00:00
Chris Lattner
4d9651c760 Non-volatile loads can be freely reordered against each other. This fixes
X86/reg-pressure.ll again, and allows us to do nice things in other cases.
For example, we now codegen this sort of thing:

int %loadload(int *%X, int* %Y) {
  %Z = load int* %Y
  %Y = load int* %X      ;; load between %Z and store
  %Q = add int %Z, 1
  store int %Q, int* %Y
  ret int %Y
}

Into this:

loadload:
        mov %EAX, DWORD PTR [%ESP + 4]
        mov %EAX, DWORD PTR [%EAX]
        mov %ECX, DWORD PTR [%ESP + 8]
        inc DWORD PTR [%ECX]
        ret

where we weren't able to form the 'inc [mem]' before.  This also lets the
instruction selector emit loads in any order it wants to, which can be good
for register pressure as well.

llvm-svn: 19644
2005-01-17 22:19:26 +00:00
Chris Lattner
e86c933df7 Two changes:
1. Fold  [mem] += (1|-1) into inc [mem]/dec [mem] to save some icache space.
 2. Do not let token factor nodes prevent forming '[mem] op= val' folds.

llvm-svn: 19643
2005-01-17 22:10:42 +00:00
Chris Lattner
4108bb01cf Don't call SelectionDAG.getRoot() directly, go through a forwarding method.
llvm-svn: 19642
2005-01-17 19:43:36 +00:00
Chris Lattner
96113fd08f Refactor load/op/store folding into it's own method, no functionality changes.
llvm-svn: 19641
2005-01-17 19:25:26 +00:00
Chris Lattner
e3c2cf4854 Implement a target independent optimization to codegen arguments only into
the basic block that uses them if possible.  This is a big win on X86, as it
lets us fold the argument loads into instructions and reduce register pressure
(by not loading all of the arguments in the entry block).

For this (contrived to show the optimization) testcase:

int %argtest(int %A, int %B) {
        %X = sub int 12345, %A
        br label %L
L:
        %Y = add int %X, %B
        ret int %Y
}

we used to produce:

argtest:
        mov %ECX, DWORD PTR [%ESP + 4]
        mov %EAX, 12345
        sub %EAX, %ECX
        mov %EDX, DWORD PTR [%ESP + 8]
.LBBargtest_1:  # L
        add %EAX, %EDX
        ret


now we produce:

argtest:
        mov %EAX, 12345
        sub %EAX, DWORD PTR [%ESP + 4]
.LBBargtest_1:  # L
        add %EAX, DWORD PTR [%ESP + 8]
        ret

This also fixes the FIXME in the code.

BTW, this occurs in real code.  164.gzip shrinks from 8623 to 8608 lines of
.s file.  The stack frame in huft_build shrinks from 1644->1628 bytes,
inflate_codes shrinks from 116->108 bytes, and inflate_block from 2620->2612,
due to fewer spills.

Take that alkis. :-)

llvm-svn: 19639
2005-01-17 17:55:19 +00:00
Chris Lattner
9098879472 Fix a major regression last night that prevented us from producing [mem] op= reg
operations.

The body of the if is less indented but unmodified in this patch.

llvm-svn: 19638
2005-01-17 17:49:14 +00:00
Chris Lattner
16f64df93a Refactor code into a new method.
llvm-svn: 19635
2005-01-17 17:15:02 +00:00
Chris Lattner
b21b6b9e84 Make methods private, add a method.
llvm-svn: 19634
2005-01-17 17:14:43 +00:00
Chris Lattner
b72ea1b719 Codegen this:
int %foo(int %X) {
        %T = add int %X, 13
        %S = mul int %T, 3
        ret int %S
}

as this:

        mov %ECX, DWORD PTR [%ESP + 4]
        lea %EAX, DWORD PTR [%ECX + 2*%ECX + 39]
        ret

instead of this:

        mov %ECX, DWORD PTR [%ESP + 4]
        mov %EAX, %ECX
        add %EAX, 13
        imul %EAX, %EAX, 3
        ret

llvm-svn: 19633
2005-01-17 06:48:02 +00:00
Tanya Lattner
a8b2929f45 Added tmp instructions to preserve ssa.
llvm-svn: 19632
2005-01-17 06:47:26 +00:00
Chris Lattner
a56d29d517 Fix test/Regression/CodeGen/X86/2005-01-17-CycleInDAG.ll and 132.ijpeg.
Do not fold a load into an operation if it will induce a cycle in the DAG.

Repeat after me: dAg.

llvm-svn: 19631
2005-01-17 06:26:58 +00:00
Chris Lattner
9605c927d1 New testcase for a problem that occurred in 132.ijpeg
llvm-svn: 19630
2005-01-17 06:25:59 +00:00
Chris Lattner
715364364b Delete PHI nodes that are not dead but are locked in a cycle of single
useness.

llvm-svn: 19629
2005-01-17 05:10:15 +00:00
Chris Lattner
03f06f11aa Move code out of indentation one level to make it easier to read.
Disable the xform for < > cases.  It turns out that the following is being
miscompiled:

bool %test(sbyte %S) {
        %T = cast sbyte %S to uint
        %V = setgt uint %T, 255
        ret bool %V
}

llvm-svn: 19628
2005-01-17 03:20:02 +00:00
Chris Lattner
30d205e080 Add methods
llvm-svn: 19627
2005-01-17 02:24:59 +00:00
Chris Lattner
3be6cd57c9 Do not fold a load into a comparison that is used by more than one place.
The comparison will probably be folded, so this is not ok to do.
This fixed 197.parser.

llvm-svn: 19624
2005-01-17 01:34:14 +00:00
Reid Spencer
642de64ef9 sysconfdir -> PROJ_etcdir
llvm-svn: 19623
2005-01-17 00:42:31 +00:00
Chris Lattner
0cd6b9ae1e Do not codegen 'xor bool, true' as 'not reg'. not reg inverts the upper bits
of the bytereg.  This fixes yacr2, 300.twolf and probably others.

llvm-svn: 19622
2005-01-17 00:23:16 +00:00
Chris Lattner
f7648e7110 Fix typos noticed by Gabor Greif, thanks Gabor!
llvm-svn: 19621
2005-01-17 00:12:04 +00:00
Chris Lattner
c1f386c7b8 Set up the shift and setcc types.
If we emit a load because we followed a token chain to get to it, try to
fold it into its single user if possible.

llvm-svn: 19620
2005-01-17 00:00:33 +00:00
Chris Lattner
5f180e4645 Shift and setcc types default to the pointer type.
llvm-svn: 19619
2005-01-16 23:59:48 +00:00
Chris Lattner
12879e04cb Add comments
Add fields to hold the result type of setcc operations and shift amounts.

llvm-svn: 19618
2005-01-16 23:59:30 +00:00
Chris Lattner
5c8a85e2d8 Implement legalize of call nodes.
llvm-svn: 19617
2005-01-16 19:46:48 +00:00
Alkis Evlogimenos
a9c9f38498 Fix llvm-java project autconfiguration.
llvm-svn: 19616
2005-01-16 09:44:58 +00:00
Tanya Lattner
e4872342db Added paramters to a few functions in order to allow me to change the functions to preserve SSA
llvm-svn: 19615
2005-01-16 08:51:10 +00:00
Chris Lattner
b14a63aa1c * Adjust to changes in TargetLowering interfaces.
* Remove custom promotion for bool and byte select ops.  Legalize now
  promotes them for us.
* Allow folding ConstantPoolIndexes into EXTLOAD's, useful for float immediates.
* Declare which operations are not supported better.
* Add some hacky code for TRUNCSTORE to pretend that we have truncstore
  for i16 types.  This is useful for testing promotion code because I can
  just remove 16-bit registers all together and verify that programs work.

llvm-svn: 19614
2005-01-16 07:34:08 +00:00
Chris Lattner
3c0dd46a3b Revamp supported ops. Instead of just being supported or not, we now keep
track of how to deal with it, and provide the target with a hook that they
can use to legalize arbitrary operations in arbitrary ways.

Implement custom lowering for a couple of ops, implement promotion for select
operations (which x86 needs).

llvm-svn: 19613
2005-01-16 07:29:19 +00:00
Chris Lattner
897cd7dc0a add method stub
llvm-svn: 19612
2005-01-16 07:28:41 +00:00
Chris Lattner
2c331fbc8f Don't mash stuff together.
llvm-svn: 19611
2005-01-16 07:28:31 +00:00
Chris Lattner
6f8097951c Use enums, move virtual dtor out of line.
llvm-svn: 19610
2005-01-16 07:28:11 +00:00
Chris Lattner
328bc38c5c Revamp supported ops. Instead of just being supported or not, we now keep
track of how to deal with it, and provide the target with a hook that they
can use to legalize arbitrary operations in arbitrary ways.

llvm-svn: 19609
2005-01-16 07:27:49 +00:00
Reid Spencer
71e1e6220c * Revise the projects section and make reference to Projects.html
* the dist-clean target no longer implies a check

llvm-svn: 19608
2005-01-16 07:18:31 +00:00
Reid Spencer
12adad4b2f Don't confuse the LLVM_OBJ_DIR and the PROJ_OBJ_DIR because there might be
a symbolic link making the autoconf name for the directory (LLVM_OBJ_ROOT)
and the "make" name for the directory (PROJ_OBJ_ROOT) different.

llvm-svn: 19607
2005-01-16 06:53:48 +00:00
Chris Lattner
3ba56b3fe7 Implement some more missing promotions.
llvm-svn: 19606
2005-01-16 05:06:12 +00:00
Chris Lattner
8bdd0fc7aa Fix bugpoint
llvm-svn: 19605
2005-01-16 04:23:22 +00:00
Chris Lattner
d0a65013ab cycles_t -> CycleCount_t
llvm-svn: 19604
2005-01-16 04:20:30 +00:00
Jeff Cohen
fcd4587a75 Add some .cvsignores to the win32 hierarchy to account for generated files
llvm-svn: 19603
2005-01-16 03:18:23 +00:00
Reid Spencer
d9f4f3b141 Provide support for HP/UX aCC compiler's variant of hash_map and hash_set
(RogueWave). These are implemented in rw/stdex/hash_map.h and
rw/stdex/hash_set.h on HP/UX.

llvm-svn: 19600
2005-01-16 02:58:39 +00:00
Reid Spencer
64cee423c3 Fix locations of libraries and executables to match makefiles.
llvm-svn: 19599
2005-01-16 02:38:06 +00:00
Reid Spencer
44764d6406 BUILD_* to PROJ_*
llvm-svn: 19598
2005-01-16 02:35:47 +00:00
Chris Lattner
73b6977700 Clarify assertion.
llvm-svn: 19597
2005-01-16 02:23:34 +00:00
Chris Lattner
4e550ebb38 Add assertions.
llvm-svn: 19596
2005-01-16 02:23:22 +00:00
Chris Lattner
209f585033 Add support for promoted registers being live across blocks.
llvm-svn: 19595
2005-01-16 02:23:07 +00:00
Reid Spencer
22978217af Update per new Makefile requirements for projects
llvm-svn: 19594
2005-01-16 02:21:42 +00:00
Reid Spencer
0e48bf8a19 Rename BUILD_* to PROJ_*
llvm-svn: 19592
2005-01-16 02:21:29 +00:00
Reid Spencer
05a2e79221 Update documentation on how to set up a project
llvm-svn: 19591
2005-01-16 02:21:18 +00:00
Reid Spencer
ba6a3dbd2d Several changes:
* Rename BUILD_* to PROJ_*
* Differentiate between LLVM's Makefile.conf and the project's
* Use project specific install locations

llvm-svn: 19590
2005-01-16 02:20:54 +00:00
Reid Spencer
62ca901007 Several changes:
* Get rid of variables that are duplicates of autoconf variables.
* Rename BUILD_* to PROJ_*
* Define some project related install locations
* Don't assume LLVM's configured values are the project's

llvm-svn: 19589
2005-01-16 02:20:42 +00:00
Reid Spencer
5ee86be22b Make this file capable of being used by both LLVM and its projects
llvm-svn: 19588
2005-01-16 02:20:30 +00:00
Tanya Lattner
7462d192b8 Fixed a couple of instructions that broke SSA.
llvm-svn: 19587
2005-01-16 02:14:17 +00:00
Chris Lattner
cebb964fef Improve compatiblity with HPUX on Itanium, patch by Duraid Madina
llvm-svn: 19586
2005-01-16 01:31:31 +00:00
Chris Lattner
4fb0fa4309 Improve compatibility with aCC on HPUX. Patch by Duraid Madina
llvm-svn: 19585
2005-01-16 01:22:18 +00:00
Chris Lattner
8ec1dc5fc0 Set up identity transforms.
llvm-svn: 19584
2005-01-16 01:20:18 +00:00
Chris Lattner
87a769cbd4 Move some information into the TargetLowering object.
llvm-svn: 19583
2005-01-16 01:11:45 +00:00
Chris Lattner
d58384fca6 Use the new TLI method to get this.
llvm-svn: 19582
2005-01-16 01:11:19 +00:00
Chris Lattner
1bc93bac69 Move some information out of LegalizeDAG into the generic Target interface.
llvm-svn: 19581
2005-01-16 01:10:58 +00:00
Chris Lattner
71d7f6e86f legalize a bunch of operations that I missed.
llvm-svn: 19580
2005-01-16 00:38:00 +00:00
Chris Lattner
a8d34fb8c6 Add support for targets that require promotions.
llvm-svn: 19579
2005-01-16 00:37:38 +00:00
Chris Lattner
207a962c2c Fix some serious bugs in promotion.
llvm-svn: 19578
2005-01-16 00:17:42 +00:00
Chris Lattner
0fe7776da5 Eliminate unneeded extensions.
llvm-svn: 19577
2005-01-16 00:17:20 +00:00
Chris Lattner
4d97864e92 Implement promotion of a whole bunch more operators. I think that this is
basically everything.

llvm-svn: 19576
2005-01-15 22:16:26 +00:00
Chris Lattner
630d1937bf Print extra type for nodes with extra type info.
llvm-svn: 19575
2005-01-15 21:11:37 +00:00
Jeff Cohen
a2071f1247 Add new file to Visual Studio CodeGen project
llvm-svn: 19574
2005-01-15 07:33:52 +00:00
Chris Lattner
99222f706c Add support for legalizing FP_ROUND_INREG, SIGN_EXTEND_INREG, and
ZERO_EXTEND_INREG for targets that don't support them.

llvm-svn: 19573
2005-01-15 07:15:18 +00:00
Chris Lattner
09d1b3d01d Common code factored out.
llvm-svn: 19572
2005-01-15 07:14:32 +00:00
Chris Lattner
5d24d61ae8 implement these methods.
llvm-svn: 19571
2005-01-15 06:52:40 +00:00
Chris Lattner
efd434591d Add some helper methods.
llvm-svn: 19570
2005-01-15 06:52:18 +00:00
Chris Lattner
c6c9a5b07d Add support for promoting ADD/MUL.
Add support for new SIGN_EXTEND_INREG, ZERO_EXTEND_INREG, and FP_ROUND_INREG operators.
Realize that if we do any promotions, we need to iterate SelectionDAG
construction.

llvm-svn: 19569
2005-01-15 06:18:18 +00:00
Chris Lattner
1001c6e2cd Add new SIGN_EXTEND_INREG, ZERO_EXTEND_INREG, and FP_ROUND_INREG operators.
llvm-svn: 19568
2005-01-15 06:17:04 +00:00
Chris Lattner
9de5890211 Add a new target-independent code generator flag.
llvm-svn: 19567
2005-01-15 06:00:32 +00:00
Chris Lattner
e18a4c4c19 Add support for truncstore and *extload.
llvm-svn: 19566
2005-01-15 05:22:24 +00:00
Chris Lattner
1f2c9d82fa Add intitial support for promoting some operators.
llvm-svn: 19565
2005-01-15 05:21:40 +00:00
Chris Lattner
ea2fa46f53 Improve output precision.
llvm-svn: 19564
2005-01-15 00:07:19 +00:00
Reid Spencer
730e7cb048 We don't distribute the operating system specific directories any more.
llvm-svn: 19563
2005-01-14 22:43:01 +00:00
Chris Lattner
3b8e719d1d Adjust to CopyFromReg changes, implement deletion of truncating/extending
stores/loads.

llvm-svn: 19562
2005-01-14 22:38:01 +00:00
Chris Lattner
720a62e8c7 Adjust to CopyFromREg changes.
llvm-svn: 19561
2005-01-14 22:37:41 +00:00
Chris Lattner
868e9d79d7 Change CopyFromReg to take and produce a chain node, allowing it to be used
with physregs that are not live across the entire block.

llvm-svn: 19560
2005-01-14 22:37:20 +00:00
Chris Lattner
39c6744c9f Start implementing truncating stores and extending loads.
llvm-svn: 19559
2005-01-14 22:08:15 +00:00
Chris Lattner
4bdb582200 Start adding some new operators, give IMPLICIT_DEF a chain operand.
llvm-svn: 19558
2005-01-14 22:07:46 +00:00
Chris Lattner
d7bffad559 Fix Regression/CodeGen/PowerPC/2005-01-14-UndefLong.ll
llvm-svn: 19557
2005-01-14 20:22:02 +00:00
Chris Lattner
8025e8b9e6 New testcase, problem found by Rob.
llvm-svn: 19556
2005-01-14 20:21:51 +00:00
Chris Lattner
c3ed31f837 Fix: Regression/CodeGen/PowerPC/2005-01-14-SetSelectCrash.ll
llvm-svn: 19555
2005-01-14 19:31:00 +00:00
Chris Lattner
57fb55d750 Testcase that crashes the PPC backend. Thanks to Rob for finding this.
llvm-svn: 19554
2005-01-14 19:30:42 +00:00
Chris Lattner
51726c47fe Fix some bugs in an xform added yesterday. This fixes Prolangs-C/allroots.
llvm-svn: 19553
2005-01-14 17:35:12 +00:00
Chris Lattner
7aa41cfa88 Fix a compile crash on spiff
llvm-svn: 19552
2005-01-14 17:17:59 +00:00
Reid Spencer
b12e290f8a Allow the Echo and EchoCmd variables to be overridden.
llvm-svn: 19551
2005-01-14 16:33:36 +00:00
Reid Spencer
9dcfffd730 Fix the path from ../lib/Debug to ../Debug/lib per changes to Makefiles.
llvm-svn: 19550
2005-01-14 16:32:39 +00:00
Chris Lattner
0ad02bdd3d Improve compatibility with acc
llvm-svn: 19549
2005-01-14 15:54:24 +00:00
Chris Lattner
d3af59bec2 Make this compatible with the HP/intel compiler. Fix by Duraid, thanks!
llvm-svn: 19548
2005-01-14 15:53:26 +00:00
Alkis Evlogimenos
a938e629f6 Correctly update configure to configure the llvm-java project
llvm-svn: 19546
2005-01-14 07:52:28 +00:00
Jeff Cohen
e246cdc946 Fix and improve win32 path validation.
llvm-svn: 19545
2005-01-14 04:09:39 +00:00
Reid Spencer
cbeed3571a Make asctime_r work for HP/UX.
llvm-svn: 19544
2005-01-14 00:50:50 +00:00
Chris Lattner
144f6e3dee More testcases
llvm-svn: 19543
2005-01-14 00:26:25 +00:00
Chris Lattner
4fa89827e2 if two gep comparisons only differ by one index, compare that index directly.
This allows us to better optimize begin() -> end() comparisons in common cases.

llvm-svn: 19542
2005-01-14 00:20:05 +00:00
Chris Lattner
d35d210ea0 Do not overrun iterators. This fixes a 176.gcc crash
llvm-svn: 19541
2005-01-13 23:26:48 +00:00
Chris Lattner
8ea1e8b982 Add a method
llvm-svn: 19540
2005-01-13 23:26:28 +00:00
Chris Lattner
7db6765530 new testcase
llvm-svn: 19539
2005-01-13 23:26:14 +00:00
Chris Lattner
7d131a4b9c Add a method
llvm-svn: 19538
2005-01-13 22:58:50 +00:00
Chris Lattner
a04c904c4c Turn select C, (X+Y), (X-Y) --> (X+(select C, Y, (-Y))). This occurs in
the 'sim' program and probably elsewhere.  In sim, it comes up for cases
like this:

#define round(x) ((x)>0.0 ? (x)+0.5 : (x)-0.5)
double G;
void T(double X) { G = round(X); }

(it uses the round macro a lot).  This changes the LLVM code from:

        %tmp.1 = setgt double %X, 0.000000e+00          ; <bool> [#uses=1]
        %tmp.4 = add double %X, 5.000000e-01            ; <double> [#uses=1]
        %tmp.6 = sub double %X, 5.000000e-01            ; <double> [#uses=1]
        %mem_tmp.0 = select bool %tmp.1, double %tmp.4, double %tmp.6
        store double %mem_tmp.0, double* %G

to:

        %tmp.1 = setgt double %X, 0.000000e+00          ; <bool> [#uses=1]
        %mem_tmp.0.p = select bool %tmp.1, double 5.000000e-01, double -5.000000e-01
        %mem_tmp.0 = add double %mem_tmp.0.p, %X
        store double %mem_tmp.0, double* %G
        ret void

llvm-svn: 19537
2005-01-13 22:52:24 +00:00
Chris Lattner
81e8417614 Implement an optimization for == and != comparisons like this:
_Bool test2(int X, int Y) {
  return &arr[X][Y] == arr;
}

instead of generating this:

bool %test2(int %X, int %Y) {
        %tmp.3.idx = mul int %X, 160            ; <int> [#uses=1]
        %tmp.3.idx1 = shl int %Y, ubyte 2               ; <int> [#uses=1]
        %tmp.3.offs2 = sub int 0, %tmp.3.idx            ; <int> [#uses=1]
        %tmp.7 = seteq int %tmp.3.idx1, %tmp.3.offs2            ; <bool> [#uses=1]
        ret bool %tmp.7
}


generate this:

bool %test2(int %X, int %Y) {
        seteq int %X, 0         ; <bool>:0 [#uses=1]
        seteq int %Y, 0         ; <bool>:1 [#uses=1]
        %tmp.7 = and bool %0, %1                ; <bool> [#uses=1]
        ret bool %tmp.7
}

This idiom occurs in C++ programs when iterating from begin() to end(),
in a vector or array.  For example, we now compile this:

void test(int X, int Y) {
  for (int *i = arr; i != arr+100; ++i)
    foo(*i);
}

to this:

no_exit:                ; preds = %entry, %no_exit
	...
        %exitcond = seteq uint %indvar.next, 100                ; <bool> [#uses=1]
        br bool %exitcond, label %return, label %no_exit



instead of this:

no_exit:                ; preds = %entry, %no_exit
	...
        %inc5 = getelementptr [100 x [40 x int]]* %arr, int 0, int 0, int %inc.rec              ; <int*> [#uses=1]
        %tmp.8 = seteq int* %inc5, getelementptr ([100 x [40 x int]]* %arr, int 0, int 100, int 0)              ; <bool> [#uses=1]
        %indvar.next = add uint %indvar, 1              ; <uint> [#uses=1]
        br bool %tmp.8, label %return, label %no_exit

llvm-svn: 19536
2005-01-13 22:25:21 +00:00
Chris Lattner
e727af06c8 Add new ImplicitDef node, rename CopyRegSDNode class to RegSDNode.
llvm-svn: 19535
2005-01-13 20:50:02 +00:00
Chris Lattner
4cb9fa373b Fix some bugs in code I didn't mean to check in.
llvm-svn: 19534
2005-01-13 20:40:58 +00:00
Chris Lattner
0798af33a5 Fix a crash compiling 129.compress
llvm-svn: 19533
2005-01-13 20:14:25 +00:00
Chris Lattner
15bd19dd76 Codegen factor nodes more intelligently according to perceived register pressure.
llvm-svn: 19532
2005-01-13 19:56:00 +00:00
Chris Lattner
2451684678 Don't forget the existing root.
llvm-svn: 19531
2005-01-13 19:53:14 +00:00
Reid Spencer
74bc42304c Update the documentation about -enable-llcbeta vs. -enable-linscan
llvm-svn: 19530
2005-01-13 18:02:40 +00:00
Chris Lattner
c251fb6441 Initial trivial (but stupid) codegen for this node.
llvm-svn: 19529
2005-01-13 18:01:36 +00:00
Chris Lattner
718b5c2f82 Codegen independent ops as being independent.
llvm-svn: 19528
2005-01-13 17:59:43 +00:00
Chris Lattner
05b4e37e85 Legalize new node, add assertion.
llvm-svn: 19527
2005-01-13 17:59:25 +00:00
Chris Lattner
4b1be0dfeb Print new node.
llvm-svn: 19526
2005-01-13 17:59:10 +00:00
Chris Lattner
f510866785 Add a new node type, add comments.
llvm-svn: 19525
2005-01-13 17:58:35 +00:00
Reid Spencer
152733823e Turn on LOADABLE_MODULE so that profile.so can be loaded dynamically by
the JIT.

llvm-svn: 19524
2005-01-13 16:53:05 +00:00
Reid Spencer
9df352d469 Re-enable libprofile now that llvm-ar is working better.
llvm-svn: 19523
2005-01-13 16:51:19 +00:00
Chris Lattner
3676cd6fe2 Add some really pedantic assertions to the load folding code. Fix a bunch
of cases where we accidentally emitted a load folded once and unfolded
elsewhere.

llvm-svn: 19522
2005-01-13 05:53:16 +00:00
Chris Lattner
4dfd2cfc0c Do not fold (zero_ext (sign_ext V)) -> (sign_ext V), they are not the same.
This fixes llvm-test/SingleSource/Regression/C/casts.c

llvm-svn: 19519
2005-01-12 18:51:15 +00:00
Chris Lattner
7b1dae8032 We can only fold a load into an op if there is exactly one use of the value.
Checking to see if the load has two uses is not equivalent, as the chain
value may have zero uses.

llvm-svn: 19518
2005-01-12 18:38:26 +00:00
Chris Lattner
40e7982c2c New method
llvm-svn: 19517
2005-01-12 18:37:47 +00:00
Chris Lattner
373e8f5607 New method.
llvm-svn: 19516
2005-01-12 18:37:33 +00:00
Chris Lattner
9864b08f94 Fix sign extend to long. When coming from sbyte, we used to generate:
movsbl 4(%esp), %eax
        movl %eax, %edx
        sarl $7, %edx

Now we generate:

        movsbl 4(%esp), %eax
        movl %eax, %edx
        sarl $31, %edx

Which is right.

llvm-svn: 19515
2005-01-12 18:19:52 +00:00
Chris Lattner
1321754941 Update comments to indicate CopyFrom/ToReg take physregs as well as vregs.
llvm-svn: 19514
2005-01-12 18:11:36 +00:00
Chris Lattner
1755360db6 Try both ways to fold an add together. This allows us to generate this code
imul %EAX, %EAX, 400
        add %ECX, %EAX
        add %ESI, DWORD PTR [%ECX + 4*%EDX]
        inc %EDX
        cmp %EDX, 100

instead of this:

        imul %EAX, %EAX, 400
        add %ECX, %EAX
        mov %EAX, %EDX
        shl %EAX, 2
        add %ECX, %EAX
        add %ESI, DWORD PTR [%ECX]
        inc %EDX
        cmp %EDX, 100

llvm-svn: 19513
2005-01-12 18:08:53 +00:00
Reid Spencer
6dced92447 Shut up warnings with GCC 3.4.3 about uninitialized variables.
llvm-svn: 19512
2005-01-12 14:53:45 +00:00
Chris Lattner
42e7e98908 Fix a major miscompilation where we were overwriting the scale reg.
llvm-svn: 19511
2005-01-12 07:33:20 +00:00
Chris Lattner
db4b67c81e Do not use the type of the RHS constant to determine the type of the operation.
This fails for shifts because the constant is always 8 bits.

llvm-svn: 19508
2005-01-12 05:22:07 +00:00
Chris Lattner
bdb2e9dabc Do not lose the offset from teh global when peephole optimizing instructions.
This fixes FreeBench/pcompress

llvm-svn: 19507
2005-01-12 05:17:28 +00:00
Chris Lattner
2f8e4ad870 Silence VC++ warnings.
llvm-svn: 19506
2005-01-12 04:51:37 +00:00
Jeff Cohen
847b54101b Add new file to Visual Studio CodeGen project
llvm-svn: 19505
2005-01-12 04:32:42 +00:00
Jeff Cohen
407aa0198c Fix C++ more compilatiom errors
llvm-svn: 19504
2005-01-12 04:29:05 +00:00
Chris Lattner
efe90209ef Fix a compile error with VC++, which things that static const arrays need
to be dynamically initialized. :(

llvm-svn: 19503
2005-01-12 04:23:22 +00:00
Chris Lattner
6fba62d6ec Fix a bug that caused us to crash on povray. We weren't emitting an FP_REG_KILL into a block that had a successor with a FP PHI node.
llvm-svn: 19502
2005-01-12 04:21:28 +00:00
Chris Lattner
bb4c14f270 Print a load of a null pointer (in intel mode) like this:
mov %AX, WORD PTR [0]

instead of like this:

        mov %AX, WORD PTR []

llvm-svn: 19501
2005-01-12 04:07:11 +00:00
Chris Lattner
b372fab2be Print a load of a null pointer like this:
movw 0, %ax

instead of like this:

        movw , %ax

llvm-svn: 19500
2005-01-12 04:05:19 +00:00
Chris Lattner
f8f79c4192 Fix a crash compiling povray on UINT_TO_FP from i16.
llvm-svn: 19499
2005-01-12 04:00:00 +00:00
Chris Lattner
e05a461f1d Add an option to view the selection dags as they are generated.
llvm-svn: 19498
2005-01-12 03:41:21 +00:00
Misha Brukman
732daa5b9d Use and print out BuildStatus, we don't always have build errors.
llvm-svn: 19497
2005-01-12 03:31:38 +00:00
Chris Lattner
3278ce8871 There are no [mem] op= reg instructions for FP, so remove their entries.
llvm-svn: 19496
2005-01-12 03:16:09 +00:00
Chris Lattner
e49a335797 Fix a bug where we didn't insert FP_REG_KILL instructions into MBB's that
contain FP PHI nodes but no other FP defining instructions.  This fixes
183.equake

llvm-svn: 19495
2005-01-12 02:57:10 +00:00
Chris Lattner
b7fe57a0f1 Fold TRUNCATE (LOAD P) into a smaller load from P.
llvm-svn: 19494
2005-01-12 02:19:06 +00:00
Chris Lattner
2cfce6853b Be more careful about order of arg evalution for CopyToReg nodes. This shrinks
256.bzip2 from 7142 to 7103 lines of .s file.

Second, add initial support for folding loads into compares, though this code
is dynamically dead for now. :(

llvm-svn: 19493
2005-01-12 02:02:48 +00:00
Chris Lattner
021cfd2a80 Fold some more [mem] op= val operators. This allows us to things like this
several times in 256.bzip2:

        mov %EAX, DWORD PTR [%ESP + 204]
-       mov %EAX, DWORD PTR [%EAX]
-       or %EAX, 2097152
-       mov %ECX, DWORD PTR [%ESP + 204]
-       mov DWORD PTR [%ECX], %EAX
+       or DWORD PTR [%EAX], 2097152

llvm-svn: 19492
2005-01-12 01:28:00 +00:00
Chris Lattner
b0eef82b82 Fold loads into sign/zero extends. instead of:
mov %AL, BYTE PTR [%EDX + l18_length_code]
  movzx %EAX, %AL

Emit:

  movzx %EAX, BYTE PTR [%EDX + l18_length_code]

llvm-svn: 19489
2005-01-11 23:33:00 +00:00
Chris Lattner
75bac9f786 Comment out debug code :)
Select [mem] += Val operations.  For constants, we used to get:

  mov %ECX, -32768
  add %ECX, DWORD PTR [l4_match_start]
  mov DWORD PTR [l4_match_start], %ECX

Now we get:

  add DWORD PTR [l4_match_start], -32768

For other values we used to get:

  mov %EBP, %EDI   ;; because the add destroys the value
  add %EBP, DWORD PTR [l4_input_len]
  mov DWORD PTR [l4_input_len], %EBP

now we get:

  add DWORD PTR [l4_input_len], %EDI

Both of these use less registers than the alternative, are faster and smaller.

llvm-svn: 19488
2005-01-11 23:21:30 +00:00
Chris Lattner
d28ae12168 Handle the global address case here, not just the offset case.
llvm-svn: 19487
2005-01-11 22:58:43 +00:00
Chris Lattner
8aa10fcd1b Treat int constants as not requiring a register, since they are almost always
folded into an instruction.

llvm-svn: 19486
2005-01-11 22:29:12 +00:00
Chris Lattner
c2785562f1 Print the value types in the nodes of the graph
llvm-svn: 19485
2005-01-11 22:21:04 +00:00
Chris Lattner
613f79fcbb add an assertion, avoid creating copyfromreg/copytoreg pairs that are the
same for PHI nodes.

llvm-svn: 19484
2005-01-11 22:03:46 +00:00
Chris Lattner
62b22420be * Factor a bunch of binary operator cases into shared code.
* Fold loads into Add, sub, and, or, xor and mul when possible.
* Codegen shl X, 1 as add X, X

llvm-svn: 19483
2005-01-11 21:19:59 +00:00
Chris Lattner
4cbf1f0038 Clear the whole array, always.
llvm-svn: 19482
2005-01-11 20:25:26 +00:00
Misha Brukman
7b98f7407b No need to repeat the word build' since it's under Build status'
llvm-svn: 19481
2005-01-11 19:51:24 +00:00
Chris Lattner
8cf9cdae3d Fold multiplies by 3,5,9 into addressing modes when possible.
llvm-svn: 19480
2005-01-11 19:37:02 +00:00
Misha Brukman
870b872bfa We don't always have build errors, so call it status', not error'
llvm-svn: 19479
2005-01-11 18:27:16 +00:00
Chris Lattner
f49c27c65c Squelch optimized warning.
llvm-svn: 19475
2005-01-11 17:46:49 +00:00
Reid Spencer
792bbf02a2 Fix the documentation for executeAndWait so the argument comments are
actually attributed to the arguments by doxygen.

llvm-svn: 19473
2005-01-11 06:37:27 +00:00
Chris Lattner
b74ec4cd24 Instead of generating stuff like this:
mov %ECX, %EAX
        add %ECX, 32768
        mov %SI, WORD PTR [2*%ECX + l13_prev]

Generate this:

        mov %SI, WORD PTR [2*%ECX + l13_prev + 65536]

This occurs when you have a GEP instruction where an index is
"something + imm".

llvm-svn: 19472
2005-01-11 06:36:20 +00:00
Reid Spencer
4596db3509 Make the construction of doxygen documentation a repeatable process
llvm-svn: 19469
2005-01-11 06:26:27 +00:00
Chris Lattner
c07164e909 Implement MEMCPY natively in terms of rep movs*
llvm-svn: 19468
2005-01-11 06:19:26 +00:00
Chris Lattner
36f7848b26 Implement memset -> rep stos*
llvm-svn: 19467
2005-01-11 06:14:36 +00:00
Chris Lattner
a19f84240f Announce that we don't support mem ops yet.
llvm-svn: 19466
2005-01-11 05:57:36 +00:00
Chris Lattner
85d70c6fd5 Teach legalize to lower MEMSET/MEMCPY/MEMMOVE operations if the target
does not support them.

llvm-svn: 19465
2005-01-11 05:57:22 +00:00
Chris Lattner
844277fb1e Print new operations.
llvm-svn: 19464
2005-01-11 05:57:01 +00:00
Chris Lattner
875def9b71 Turn memset/memcpy/memmove into the corresponding operations.
llvm-svn: 19463
2005-01-11 05:56:49 +00:00
Chris Lattner
1d7b8e118b Add MEMSET/MEMCPY/MEMMOVE operations. Fix a really bad bug in the vector
SDNode ctor.

llvm-svn: 19462
2005-01-11 05:56:17 +00:00
Reid Spencer
4a1ab18fbf * Add the use of LOADABLE_MODULE=1 in the makefile example
* Change the names of the resulting module to Hello instead of libHello
* Change lib/Debug -> Debug/lib per new makefile implementation.

llvm-svn: 19459
2005-01-11 05:16:23 +00:00
Reid Spencer
1e008c200d * Describe the LOADABLE_MODULE feature
* Get rid of non-compliant <font> elements (how did that get in there?)

llvm-svn: 19458
2005-01-11 05:12:54 +00:00
Chris Lattner
378262d33b Teach the address selector to make 'reg+reg' addressing modes.
llvm-svn: 19457
2005-01-11 04:40:19 +00:00
Reid Spencer
134f02d0c7 Add the LOADABLE_MODULE=1 directive to indicate that this shared library is
intended to be a dlopenable module and not a "plain" shared library.

llvm-svn: 19456
2005-01-11 04:33:32 +00:00
Chris Lattner
9d7cf998ca Emit NOT instructions.
llvm-svn: 19455
2005-01-11 04:31:30 +00:00
Reid Spencer
87e645c5bd Implement the LOADABLE_MODULE option when building a shared library. This
passes the -module option on the libtool command line to ensure that the
shared library being built can be dlopened and dlsym can work on that
module. LOADABLE_MODULE should be sent only in conjunction with the
SHARED_LIBRARY directive. It should generally be used for any module that
is intended to be the target of an LLVM -load option. Note that loadable
modules will not have the lib prefix but otherwise look like shared
libraries. This is per the libtool recommendations and prevents these
special shared libraries from being linked in via -l option to the linker.

llvm-svn: 19454
2005-01-11 04:31:07 +00:00
Chris Lattner
a86fa4455b shift X, 0 -> X
llvm-svn: 19453
2005-01-11 04:25:13 +00:00
Chris Lattner
37ed28558f Fix a bug emitting branches that broke a lot of programs.
llvm-svn: 19452
2005-01-11 04:06:27 +00:00
Chris Lattner
e44e6d16fb Be more careful where we set ContainsFPCode. We were missing a set in the
int -> FP casting code.  Note that we don't have to set it for FP operations
that take FP values as operands: whatever produces the FP value will set the
flag.

llvm-svn: 19451
2005-01-11 03:50:45 +00:00
Chris Lattner
8fea42bd6d Fix a major bug in setcc/cmov folding, where we accidentally
inverted the sense of the comparison.

llvm-svn: 19450
2005-01-11 03:37:59 +00:00
Chris Lattner
0d1f82ac2f Take register pressure into account when we have to decide whether to
evaluate the LHS or the RHS of an operation first.  This causes good things
to happen.  For example, instead of compiling a loop to this:

.LBBstrength_result7_1: # loopentry
        movl 16(%esp), %edi
        movl (%edi), %edi             ;;; LOAD
        movl (%ecx), %ebx
        movl $2, (%eax,%ebx,4)
        movl (%edx), %ebx
        movl %esi, %ebp
        addl $21, %ebp
        addl $42, %esi
        cmpl $0, %edi                 ;;; USE
        cmovne %esi, %ebp
        cmpl %ebp, %ebx
        movl %ebp, %esi
        jg .LBBstrength_result7_1

We now compile it to this:

.LBBstrength_result7_1: # loopentry
        movl %edi, %ebx
        addl $42, %ebx
        addl $21, %edi
        movl (%ecx), %ebp              ;; LOAD
        cmpl $0, %ebp                  ;; USE
        cmovne %ebx, %edi
        movl (%edx), %ebx
        movl $2, (%eax,%ebx,4)
        movl (%esi), %ebx
        cmpl %edi, %ebx
        jg .LBBstrength_result7_1

Which reduces register pressure enough (in this case) to avoid spilling in the
loop.

As another example, consider the CodeGen/X86/regpressure.ll testcase.  We
used to generate this code for both cases:

regpressure1:
        subl $32, %esp
        movl %esi, 12(%esp)
        movl %edi, 8(%esp)
        movl %ebx, 4(%esp)
        movl %ebp, (%esp)
        movl 36(%esp), %ecx
        movl (%ecx), %eax
        movl 4(%ecx), %edx
        movl %edx, 24(%esp)
        movl 8(%ecx), %edx
        movl %edx, 16(%esp)
        movl 12(%ecx), %edx
        movl 16(%ecx), %esi
        movl 20(%ecx), %edi
        movl 24(%ecx), %ebx
        movl %ebx, 28(%esp)
        movl 28(%ecx), %ebx
        movl 32(%ecx), %ebp
        movl %ebp, 20(%esp)
        movl 36(%ecx), %ecx
        imull 24(%esp), %eax
        imull 16(%esp), %eax
        imull %edx, %eax
        imull %esi, %eax
        imull %edi, %eax
        imull 28(%esp), %eax
        imull %ebx, %eax
        imull 20(%esp), %eax
        imull %ecx, %eax
        movl (%esp), %ebp
        movl 4(%esp), %ebx
        movl 8(%esp), %edi
        movl 12(%esp), %esi
        addl $32, %esp
        ret

This code is basically trying to do all of the loads first, then execute all
of the multiplies.  Because we run out of registers, lots of spill code happens.
We now generate this code for both cases:

regpressure1:
        movl 4(%esp), %ecx
        movl (%ecx), %eax
        movl 4(%ecx), %edx
        imull %edx, %eax
        movl 8(%ecx), %edx
        imull %edx, %eax
        movl 12(%ecx), %edx
        imull %edx, %eax
        movl 16(%ecx), %edx
        imull %edx, %eax
        movl 20(%ecx), %edx
        imull %edx, %eax
        movl 24(%ecx), %edx
        imull %edx, %eax
        movl 28(%ecx), %edx
        imull %edx, %eax
        movl 32(%ecx), %edx
        imull %edx, %eax
        movl 36(%ecx), %ecx
        imull %ecx, %eax
        ret

which is much nicer (when we fold loads into the muls it will be even better).
The old instruction selector used to produce the good code for regpressure1
but not for regpressure2, as it depended on the order of operations in the
LLVM code.

llvm-svn: 19449
2005-01-11 03:11:44 +00:00
Chris Lattner
788bdba13d The pattern isel is aggressively codegen'ing all of the loads in these
functions together at the start of the basic block, causing massive spillage.
The old isel codegened the loads wherever they happened to land, so it
generated good code for the first case, but bad code for the second.

We really want the pattern isel to generate (the same) good code for both.

llvm-svn: 19448
2005-01-11 03:05:03 +00:00
Chris Lattner
1308b488ea Print SelectionDAGs bottom up, include extra info in the node labels
llvm-svn: 19447
2005-01-11 00:34:33 +00:00
Chris Lattner
39c5808fdb Add support for bottom-up graphs.
llvm-svn: 19446
2005-01-11 00:24:59 +00:00
Chris Lattner
b241b443b6 Add a marker for the graph root.
llvm-svn: 19445
2005-01-10 23:52:04 +00:00
Chris Lattner
12be02722f Put the operation name in each node, put the function name on the graph.
llvm-svn: 19444
2005-01-10 23:26:00 +00:00
Chris Lattner
9e4c76123c Split out SDNode::getOperationName into its own method.
llvm-svn: 19443
2005-01-10 23:25:25 +00:00
Chris Lattner
7fa992e976 Add a helper method.
llvm-svn: 19442
2005-01-10 23:25:04 +00:00
Chris Lattner
7f65075be3 Implement initial selectiondag printing support. This gets us a nice
graph with no labels! :)

llvm-svn: 19441
2005-01-10 23:08:40 +00:00
Chris Lattner
e32371bad6 Add support for graph operations, and add a viewGraph method to SelectionDAG.
llvm-svn: 19440
2005-01-10 23:05:53 +00:00
Chris Lattner
da7c050442 Add a helper method
llvm-svn: 19439
2005-01-10 23:05:07 +00:00
Chris Lattner
1d13a92af4 Fold setcc instructions into selects.
llvm-svn: 19438
2005-01-10 22:10:13 +00:00
Chris Lattner
5b589ec0c4 Add conditional moves for the parity flag.
llvm-svn: 19437
2005-01-10 22:09:33 +00:00
Chris Lattner
be02d430a9 Lower to the correct functions. This fixes FreeBench/fourinarow
llvm-svn: 19436
2005-01-10 21:02:37 +00:00
Chris Lattner
750d38b5b7 Implement 8-bit multiply for X86.
llvm-svn: 19435
2005-01-10 20:55:48 +00:00
Chris Lattner
5326f35715 Rework constant pool handling so that function constant pools are no longer
leaked to the system.  Now they are destroyed with the JITMemoryManager is
destroyed.

llvm-svn: 19434
2005-01-10 18:23:22 +00:00
Jeff Cohen
3e62e7c68b Apply feedback from Chris.
llvm-svn: 19432
2005-01-10 04:23:32 +00:00
Jeff Cohen
703f7db254 Apply feed back from Chris:
1. Rename createLoaderPass to CreateProfileLoaderPass
  2. Opt shouldn't use the pass registered in CodeGen.

llvm-svn: 19431
2005-01-10 03:56:27 +00:00
Chris Lattner
41b764144d Implement a couple of more simplifications. This lets us codegen:
int test2(int * P, int* Q, int A, int B) {
        return P+A == P;
}

into:

test2:
        movl 4(%esp), %eax
        movl 12(%esp), %eax
        shll $2, %eax
        cmpl $0, %eax
        sete %al
        movzbl %al, %eax
        ret

instead of:

test2:
        movl 4(%esp), %eax
        movl 12(%esp), %ecx
        leal (%eax,%ecx,4), %ecx
        cmpl %eax, %ecx
        sete %al
        movzbl %al, %eax
        ret

ICC is producing worse code:

test2:
        movl      4(%esp), %eax                                 #8.5
        movl      12(%esp), %edx                                #8.5
        lea       (%edx,%edx), %ecx                             #9.9
        addl      %ecx, %ecx                                    #9.9
        addl      %eax, %ecx                                    #9.9
        cmpl      %eax, %ecx                                    #9.16
        movl      $0, %eax                                      #9.16
        sete      %al                                           #9.16
        ret                                                     #9.16

as is GCC (looks like our old code):

test2:
        movl    4(%esp), %edx
        movl    12(%esp), %eax
        leal    (%edx,%eax,4), %ecx
        cmpl    %edx, %ecx
        sete    %al
        movzbl  %al, %eax
        ret

llvm-svn: 19430
2005-01-10 02:03:02 +00:00
Chris Lattner
00c231baa7 Fix incorrect constant folds, fixing Stepanov after the SHR patch.
llvm-svn: 19429
2005-01-10 01:16:03 +00:00
Jeff Cohen
c783e07a7c Update System project in Visual Studio to reflect renamed files.
llvm-svn: 19428
2005-01-10 00:50:11 +00:00
Chris Lattner
0966a75e76 Constant fold shifts, turning this loop:
.LBB_Z5test0PdS__3:     # no_exit.1
        fldl data(,%eax,8)
        fldl 24(%esp)
        faddp %st(1)
        fstl 24(%esp)
        incl %eax
        movl $16000, %ecx
        sarl $3, %ecx
        cmpl %eax, %ecx
        fstpl 16(%esp)
        #FP_REG_KILL
        jg .LBB_Z5test0PdS__3   # no_exit.1

into:

.LBB_Z5test0PdS__3:     # no_exit.1
        fldl data(,%eax,8)
        fldl 24(%esp)
        faddp %st(1)
        fstl 24(%esp)
        incl %eax
        cmpl $2000, %eax
        fstpl 16(%esp)
        #FP_REG_KILL
        jl .LBB_Z5test0PdS__3   # no_exit.1

llvm-svn: 19427
2005-01-10 00:07:15 +00:00
Reid Spencer
c892a0db9f Rename Unix/*.cpp and Win32/*.cpp to have a *.inc suffix so that the silly
gdb debugger doesn't get confused on which file it is reading (the one in
lib/System or the one in lib/System/{Win32,Unix})

llvm-svn: 19426
2005-01-09 23:29:00 +00:00
Chris Lattner
fde3a212e2 Add some folds for == and != comparisons. This allows us to
codegen this loop in stepanov:

no_exit.i:              ; preds = %entry, %no_exit.i, %then.i, %_Z5checkd.exit
        %i.0.0 = phi int [ 0, %entry ], [ %i.0.0, %no_exit.i ], [ %inc.0, %_Z5checkd.exit ], [ %inc.012, %then.i ]              ; <int> [#uses=3]
        %indvar = phi uint [ %indvar.next, %no_exit.i ], [ 0, %entry ], [ 0, %then.i ], [ 0, %_Z5checkd.exit ]          ; <uint> [#uses=3]
        %result_addr.i.0 = phi double [ %tmp.4.i.i, %no_exit.i ], [ 0.000000e+00, %entry ], [ 0.000000e+00, %then.i ], [ 0.000000e+00, %_Z5checkd.exit ]          ; <double> [#uses=1]
        %first_addr.0.i.2.rec = cast uint %indvar to int                ; <int> [#uses=1]
        %first_addr.0.i.2 = getelementptr [2000 x double]* %data, int 0, uint %indvar           ; <double*> [#uses=1]
        %inc.i.rec = add int %first_addr.0.i.2.rec, 1           ; <int> [#uses=1]
        %inc.i = getelementptr [2000 x double]* %data, int 0, int %inc.i.rec            ; <double*> [#uses=1]
        %tmp.3.i.i = load double* %first_addr.0.i.2             ; <double> [#uses=1]
        %tmp.4.i.i = add double %result_addr.i.0, %tmp.3.i.i            ; <double> [#uses=2]
        %tmp.2.i = seteq double* %inc.i, getelementptr ([2000 x double]* %data, int 0, int 2000)                ; <bool> [#uses=1]
        %indvar.next = add uint %indvar, 1              ; <uint> [#uses=1]
        br bool %tmp.2.i, label %_Z10accumulateIPddET0_T_S2_S1_.exit, label %no_exit.i

To this:

.LBB_Z4testIPddEvT_S1_T0__1:    # no_exit.i
        fldl data(,%eax,8)
        fldl 16(%esp)
        faddp %st(1)
        fstpl 16(%esp)
        incl %eax
        movl %eax, %ecx
        shll $3, %ecx
        cmpl $16000, %ecx
        #FP_REG_KILL
        jne .LBB_Z4testIPddEvT_S1_T0__1 # no_exit.i

instead of this:

.LBB_Z4testIPddEvT_S1_T0__1:    # no_exit.i
        fldl data(,%eax,8)
        fldl 16(%esp)
        faddp %st(1)
        fstpl 16(%esp)
        incl %eax
        leal data(,%eax,8), %ecx
        leal data+16000, %edx
        cmpl %edx, %ecx
        #FP_REG_KILL
        jne .LBB_Z4testIPddEvT_S1_T0__1 # no_exit.i

llvm-svn: 19425
2005-01-09 20:52:51 +00:00
Jeff Cohen
292845d2d9 Add last four createXxxPass functions
llvm-svn: 19424
2005-01-09 20:42:52 +00:00
Jeff Cohen
7d1670da3f Fix VC++ compilation error
llvm-svn: 19423
2005-01-09 20:41:56 +00:00
Chris Lattner
e6f7882c27 Print the DAG out more like a DAG in nested format.
llvm-svn: 19422
2005-01-09 20:38:33 +00:00
Chris Lattner
1270acc1ce Print out nodes sorted by their address to make it easier to find them in a list.
llvm-svn: 19421
2005-01-09 20:26:36 +00:00
Chris Lattner
cf8fd0c0db Codegen (Reg|imm)+&GV as an LEA, because we cannot put it into the immediate field
of an ADDri (due to current restrictions on MachineOperand :( ).  This allows
us to generate:

        leal Data+16000, %edx

instead of:

        movl $Data, %edx
        addl $16000, %edx

llvm-svn: 19420
2005-01-09 20:20:29 +00:00
Chris Lattner
3d5d5022d5 Add a simple transformation. This allows us to compile one of the inner
loops in stepanov to this:

.LBB_Z5test0PdS__2:     # no_exit.1
        fldl data(,%eax,8)
        fldl 24(%esp)
        faddp %st(1)
        fstl 24(%esp)
        incl %eax
        cmpl $2000, %eax
        fstpl 16(%esp)
        #FP_REG_KILL
        jl .LBB_Z5test0PdS__2

instead of this:

.LBB_Z5test0PdS__2:     # no_exit.1
        fldl data(,%eax,8)
        fldl 24(%esp)
        faddp %st(1)
        fstl 24(%esp)
        incl %eax
        movl $data, %ecx
        movl %ecx, %edx
        addl $16000, %edx
        subl %ecx, %edx
        movl %edx, %ecx
        sarl $2, %ecx
        shrl $29, %ecx
        addl %ecx, %edx
        sarl $3, %edx
        cmpl %edx, %eax
        fstpl 16(%esp)
        #FP_REG_KILL
        jl .LBB_Z5test0PdS__2

The old instruction selector produced:

.LBB_Z5test0PdS__2:     # no_exit.1
        fldl 24(%esp)
        faddl data(,%eax,8)
        fstl 24(%esp)
        movl %eax, %ecx
        incl %ecx
        incl %eax
        leal data+16000, %edx
        movl $data, %edi
        subl %edi, %edx
        movl %edx, %edi
        sarl $2, %edi
        shrl $29, %edi
        addl %edi, %edx
        sarl $3, %edx
        cmpl %edx, %ecx
        fstpl 16(%esp)
        #FP_REG_KILL
        jl .LBB_Z5test0PdS__2   # no_exit.1

Which is even worse!

llvm-svn: 19419
2005-01-09 20:09:57 +00:00
Chris Lattner
66d3430236 Fix copy and pasto's for FP -> Int. This fixes fldry
llvm-svn: 19418
2005-01-09 19:49:59 +00:00
Chris Lattner
9242c504da Fix a bug legalizing call instructions (make sure to remember all result
values), and eliminate some switch statements.

llvm-svn: 19417
2005-01-09 19:43:23 +00:00
Chris Lattner
02f5ce2077 Fix a minor bug legalizing dynamic_stackalloc. This allows us to compile
std::__pad<wchar_t, std::char_traits<wchar_t> >::_S_pad(std::ios_base&, wchar_t, wchar_t*, wchar_t const*, int, int, bool)

from libstdc++

llvm-svn: 19416
2005-01-09 19:07:54 +00:00
Chris Lattner
ec26b48d61 Teach legalize to deal with DYNAMIC_STACKALLOC (aka a dynamic llvm alloca)
llvm-svn: 19415
2005-01-09 19:03:49 +00:00
Chris Lattner
282781c797 Initial implementation of FP->INT and INT->FP casts
Also, fix zero_extend from bool to i8, which fixes Shootout/objinst.

llvm-svn: 19414
2005-01-09 18:52:44 +00:00
Jeff Cohen
14903e0148 Get lib/Analysis/DataStructure to compile with VC++
llvm-svn: 19412
2005-01-09 04:18:28 +00:00
Jeff Cohen
39b0644b42 Workaround a VC++ bug. Microsoft puts the hash_map class in namespace stdext, but
this classes uses a utility function in namespace std.  But Microsoft apparently
assumes everyone will "using namespace std;".  As LLVM doesn't....  Add a
"use std::_Distance;" to get it working.

llvm-svn: 19411
2005-01-09 04:13:09 +00:00
Chris Lattner
fb217c6b94 Fix a subtle bug involving constant expr casts from int to fp
llvm-svn: 19410
2005-01-09 01:49:29 +00:00
Chris Lattner
a2c5d9168c Handle static alloca arguments to PHI nodes.
llvm-svn: 19409
2005-01-09 01:16:24 +00:00
Chris Lattner
9f59d28d67 Implement varargs and returnaddress/frameaddress intrinsics. With this
patch, all of SingleSource/UnitTests passes.

llvm-svn: 19408
2005-01-09 00:01:27 +00:00
Chris Lattner
58cfd7945d Use new interfaces to correctly lower varargs and return/frame address intrinsics.
llvm-svn: 19407
2005-01-09 00:00:49 +00:00
Chris Lattner
ccab396d01 Add interfaces to lower varargs and return/frame address intrinsics.
llvm-svn: 19406
2005-01-09 00:00:31 +00:00
Jeff Cohen
529d0068c8 Test fails on all platforms, not just linux
llvm-svn: 19405
2005-01-08 23:44:03 +00:00
Chris Lattner
18d2b34637 Add support for llvm.setjmp and longjmp. Only 3 SingleSource/UnitTests fail now.
llvm-svn: 19404
2005-01-08 22:48:57 +00:00
Jeff Cohen
a1c2df7ae6 Fix VC++ compilation error
llvm-svn: 19403
2005-01-08 22:44:06 +00:00
Jeff Cohen
cede1ce95a Add even more missing createXxxPass functions.
llvm-svn: 19402
2005-01-08 22:01:16 +00:00
Chris Lattner
d7a3ee6d20 rename linscan -> LLCBETA as it should be
llvm-svn: 19401
2005-01-08 21:03:58 +00:00
Chris Lattner
313ddb59c9 Okay 15th time is the charm. Looking at the vector size is useless as it
gets clobbered by a previous statement.  This fixes all calls finally.

llvm-svn: 19399
2005-01-08 20:51:36 +00:00
Chris Lattner
f5bbe85879 Okay, my off by one was actually off by two. This fixes Generic/2003-07-07-BadLongConst.ll
llvm-svn: 19398
2005-01-08 20:39:31 +00:00
Chris Lattner
c0f31c5e96 Tighten up assertions.
llvm-svn: 19397
2005-01-08 20:35:13 +00:00
Chris Lattner
a183eb75eb Fix off by one error
llvm-svn: 19396
2005-01-08 20:31:34 +00:00
Chris Lattner
f806d9f2d0 Allow arrays to have more than 4G elements.
llvm-svn: 19395
2005-01-08 20:19:51 +00:00
Chris Lattner
d662b785ef Allow array types to have 64-bit size.
llvm-svn: 19394
2005-01-08 20:19:27 +00:00
Jeff Cohen
1a26d15c80 Use size_t instead of long to represent memory usage. long is 32 bits
on 64-bit Windows.

llvm-svn: 19393
2005-01-08 20:15:57 +00:00
Chris Lattner
4588542d39 Silence warnings
llvm-svn: 19392
2005-01-08 20:13:44 +00:00
Chris Lattner
df1f152420 Silence VS warnings.
llvm-svn: 19391
2005-01-08 20:13:19 +00:00
Chris Lattner
fa66dc7852 Silence VS warnings.
llvm-svn: 19390
2005-01-08 20:07:03 +00:00
Chris Lattner
feeab9f753 Silence VS warnings
llvm-svn: 19389
2005-01-08 20:05:34 +00:00
Chris Lattner
0b955fd2d5 Silence VS warnings
llvm-svn: 19388
2005-01-08 19:59:10 +00:00
Chris Lattner
a136c3b054 Adjust prototype
llvm-svn: 19387
2005-01-08 19:57:49 +00:00
Chris Lattner
e64ff1c4b2 Silence warnings from VS
llvm-svn: 19386
2005-01-08 19:55:00 +00:00
Chris Lattner
78100c41ca Silence VS warnings
llvm-svn: 19385
2005-01-08 19:53:50 +00:00
Chris Lattner
d006195517 Silence VS warnings.
llvm-svn: 19384
2005-01-08 19:52:31 +00:00
Chris Lattner
798e84f59e Fix VS warnings
llvm-svn: 19383
2005-01-08 19:48:40 +00:00
Chris Lattner
46fa04b531 Fix VS warnings.
llvm-svn: 19382
2005-01-08 19:45:31 +00:00
Chris Lattner
fdfe3e49fe Fix uint64_t -> unsigned VS warnings.
llvm-svn: 19381
2005-01-08 19:42:22 +00:00
Chris Lattner
47f395cd85 Silence VS warnings.
llvm-svn: 19380
2005-01-08 19:37:20 +00:00
Chris Lattner
ce274ce93d Silence warnings
llvm-svn: 19379
2005-01-08 19:34:41 +00:00
Chris Lattner
867158cefd Do not throw away bits for no reason
llvm-svn: 19378
2005-01-08 19:32:59 +00:00
Chris Lattner
2c5e4ed8f9 Silence a VS warning.
llvm-svn: 19377
2005-01-08 19:31:31 +00:00
Chris Lattner
b52e041c80 Adjust to changes in LowerCallTo interface
Minor bugfixes

llvm-svn: 19376
2005-01-08 19:28:19 +00:00
Chris Lattner
7e6eeba6c5 Implement handling of most long operators through libcalls.
Fix a bug legalizing "ret (Val,Val)"

llvm-svn: 19375
2005-01-08 19:27:05 +00:00
Chris Lattner
1f45cd7418 Adjust to changes in LowerCAllTo interfaces
llvm-svn: 19374
2005-01-08 19:26:18 +00:00
Chris Lattner
9660014f8c Make LowerCallTo more generic and useful.
llvm-svn: 19373
2005-01-08 19:25:39 +00:00
John Criswell
24a5692973 Another year, another copyright update.
llvm-svn: 19372
2005-01-08 19:10:44 +00:00
Jeff Cohen
a2c16d2555 Add a few more passes to LinkAllPasses.h
llvm-svn: 19371
2005-01-08 18:15:23 +00:00
Jeff Cohen
677babc4d4 Add more missing createXxxPass functions.
llvm-svn: 19370
2005-01-08 17:21:40 +00:00
Chris Lattner
2a6db3c351 Add support for FP->INT conversions and back.
llvm-svn: 19369
2005-01-08 08:08:56 +00:00
Chris Lattner
6209f1d294 Add operators for FP -> INT conversions and back.
llvm-svn: 19368
2005-01-08 08:08:49 +00:00
Chris Lattner
8da67af979 Wrap long line.
llvm-svn: 19367
2005-01-08 06:59:50 +00:00
Chris Lattner
e69daaf71d Implement the 'store FPIMM, Ptr' -> 'store INTIMM, Ptr' optimization for
all targets.

llvm-svn: 19366
2005-01-08 06:25:56 +00:00
Chris Lattner
9a97e4d5b6 1ULL << 64 is undefined, don't do it.
llvm-svn: 19365
2005-01-08 06:24:30 +00:00
Chris Lattner
b923438fe6 The X86 instruction selector already handles codegen of:
store float 123.45, float* %P

as an integer store.  This adds handling of float immediate stores as integers
for arguments passed function calls.

This is now tested by CodeGen/X86/store-fp-constant.ll

llvm-svn: 19364
2005-01-08 05:45:24 +00:00
Chris Lattner
e80eca3d1d New testcase.
llvm-svn: 19363
2005-01-08 05:44:07 +00:00
Misha Brukman
6cd5f89778 Eliminate empty sub-list
llvm-svn: 19362
2005-01-08 01:11:15 +00:00
Chris Lattner
e0f1fe181a Fix a pointer invalidation problem. This fixes Generic/badarg6.ll
llvm-svn: 19361
2005-01-07 23:32:00 +00:00
Chris Lattner
5c66e45b92 Fold conditional branches on constants away.
llvm-svn: 19360
2005-01-07 22:49:57 +00:00
Chris Lattner
cda3efa6e5 Fix a thinko in the reassociation code, fixing Generic/badlive.ll
llvm-svn: 19359
2005-01-07 22:44:09 +00:00
Chris Lattner
a65a2f0c36 Add support for truncating integer casts from long.
llvm-svn: 19358
2005-01-07 22:37:48 +00:00
Chris Lattner
ea4ca94cae Fix a bug in load expansion legalization and ret legalization. This fixes
CodeGen/Generic/select.ll:castconst.

llvm-svn: 19357
2005-01-07 22:28:47 +00:00
Chris Lattner
68a12140c0 Legalize unconditional branches too
llvm-svn: 19356
2005-01-07 22:12:08 +00:00
Chris Lattner
924d100bd1 Cleanup a bunch of tests. In particular do not allow target directives in
the .ll file or it forces the V9 backend.  This is the CodeGen/Generic dir,
so there is no use in doing that.

llvm-svn: 19355
2005-01-07 22:05:31 +00:00
Chris Lattner
19a83990e1 Implement support for long GEP indices on 32-bit archs and support for
int GEP indices on 64-bit archs.

llvm-svn: 19354
2005-01-07 21:56:57 +00:00
Chris Lattner
4d5ba99283 Simplify: truncate ({zero|sign}_extend (X))
llvm-svn: 19353
2005-01-07 21:56:24 +00:00
Chris Lattner
32f20bfa93 implement legalization of a bunch more operators.
llvm-svn: 19352
2005-01-07 21:45:56 +00:00
Chris Lattner
e3f06e9945 Make this test a bit more interesting by making there actually be a use of the
PHI node.

llvm-svn: 19351
2005-01-07 21:37:13 +00:00
Chris Lattner
fa854eb012 Fix another bug legalizing calls!
llvm-svn: 19350
2005-01-07 21:35:32 +00:00
Chris Lattner
8ea875fb05 Fix handling of dead PHI nodes.
llvm-svn: 19349
2005-01-07 21:34:19 +00:00
Chris Lattner
f025d6788c Fix a bug legalizing calls
llvm-svn: 19348
2005-01-07 21:34:13 +00:00
Chris Lattner
44b30c9abb modernize and clean up this test.
llvm-svn: 19347
2005-01-07 21:15:58 +00:00
Chris Lattner
473825ccec After legalizing a DAG, delete dead nodes to save space.
llvm-svn: 19346
2005-01-07 21:09:37 +00:00
Chris Lattner
9c667933c1 Implement RemoveDeadNodes
llvm-svn: 19345
2005-01-07 21:09:16 +00:00
Chris Lattner
49811fcab6 Add a new SelectionDAG::RemoveDeadNodes method
llvm-svn: 19344
2005-01-07 21:08:55 +00:00
Jeff Cohen
86bbb1c56b Fix include. Too easy to make mistakes like this on Windows :(
llvm-svn: 19343
2005-01-07 19:21:49 +00:00
Chris Lattner
6edb4d7b71 Remove the open projects page from the docs directory.
llvm-svn: 19342
2005-01-07 18:57:33 +00:00
Misha Brukman
a9ade831b6 Capitalize Bugpoint.
llvm-svn: 19341
2005-01-07 17:00:44 +00:00
Jeff Cohen
39c14e7bca Get new SelectionDAG stuff building with Visual Studio.
llvm-svn: 19340
2005-01-07 15:52:36 +00:00
Chris Lattner
ec3fe7c4a8 Teach legalize how to handle condbranches
llvm-svn: 19339
2005-01-07 08:19:42 +00:00
Chris Lattner
001467a08c Add a testcase I forgot to commit earlier.
llvm-svn: 19338
2005-01-07 07:56:08 +00:00
Chris Lattner
1ef74d6135 X86 BE requires SelectionDAG
llvm-svn: 19337
2005-01-07 07:51:25 +00:00
Chris Lattner
28ce94ce85 X86 JIT requires the selection dag library.
llvm-svn: 19336
2005-01-07 07:51:11 +00:00
Chris Lattner
ca4ca5520b Allow the selection-dag based selector to be diabled with -disable-pattern-isel.
For now, this is the default, as the current selector is missing some big pieces.
To enable the new selector, pass -disable-pattern-isel=false to llc or lli.

llvm-svn: 19335
2005-01-07 07:50:50 +00:00
Chris Lattner
88c8a23891 Reimplementation of the X86 pattern isel. This is still missing many large
pieces, but can already do amazing things in some cases.

llvm-svn: 19334
2005-01-07 07:49:41 +00:00
Chris Lattner
ce413c8c9f This file is now dead.
llvm-svn: 19333
2005-01-07 07:49:05 +00:00
Chris Lattner
ff9e21c8d3 Add a new prototype
llvm-svn: 19332
2005-01-07 07:48:33 +00:00
Chris Lattner
7a60d91953 Initial implementation of the SelectionDAGISel class. This contains most
of the code for lowering from LLVM code to a SelectionDAG.

llvm-svn: 19331
2005-01-07 07:47:53 +00:00
Chris Lattner
f8ba6987a4 This file is obsolete
llvm-svn: 19330
2005-01-07 07:47:23 +00:00
Chris Lattner
dc75059005 Initial implementation of the DAG legalization. This still has a long way
to go, but it does work for some non-trivial cases now.

llvm-svn: 19329
2005-01-07 07:47:09 +00:00
Jeff Cohen
510fa4bbf8 But not the identation of THAT line
llvm-svn: 19328
2005-01-07 07:46:40 +00:00
Chris Lattner
061a1ea9e3 Complete rewrite of the SelectionDAG class.
llvm-svn: 19327
2005-01-07 07:46:32 +00:00
Chris Lattner
56cc54f416 Common base class for SelectionDAG-based instruction selectors.
llvm-svn: 19326
2005-01-07 07:46:03 +00:00
Chris Lattner
78551084ef Initial implementation of the nodes in a SelectionDAG.
llvm-svn: 19325
2005-01-07 07:45:27 +00:00
Chris Lattner
3a4d1b2721 First draft of new Target interface
llvm-svn: 19324
2005-01-07 07:44:53 +00:00
Chris Lattner
09b37583a4 First draft of a new Target interface
llvm-svn: 19323
2005-01-07 07:44:22 +00:00
Jeff Cohen
70e3e10aa4 Correct indentation levels
llvm-svn: 19322
2005-01-07 07:44:02 +00:00
Chris Lattner
07b522d106 Add convenience method.
llvm-svn: 19321
2005-01-07 07:40:32 +00:00
Misha Brukman
417ca179a9 Convert tabs to spaces
llvm-svn: 19320
2005-01-07 07:05:34 +00:00
Jeff Cohen
9a7ac16214 Add missing createXxxPass functions
llvm-svn: 19319
2005-01-07 06:57:28 +00:00
Jeff Cohen
d97ad08ef8 Remove bogus project folder
llvm-svn: 19318
2005-01-07 06:54:58 +00:00
Misha Brukman
28e210a8f2 Fix spelling.
llvm-svn: 19317
2005-01-07 06:45:07 +00:00
Jeff Cohen
e48bd7fcd4 Update list of passes
llvm-svn: 19316
2005-01-07 06:12:41 +00:00
Jeff Cohen
844410b48e Add missing include
llvm-svn: 19315
2005-01-07 05:42:13 +00:00
Jeff Cohen
e15ae04fb3 Fix return type
llvm-svn: 19314
2005-01-07 05:41:39 +00:00
Chris Lattner
ae15482076 Codegen -1 and -0.0 more efficiently. This implements CodeGen/X86/negatize_zero.ll
llvm-svn: 19313
2005-01-06 21:19:16 +00:00
Chris Lattner
9eef99ef43 New testcase
llvm-svn: 19312
2005-01-06 21:18:53 +00:00
Chris Lattner
cd4003e228 No need to pessimize current code for future possibilities.
llvm-svn: 19311
2005-01-06 16:26:38 +00:00
Jeff Cohen
72f8f4cc3d Get the #ifdef right on LinkAllPasses.h.
llvm-svn: 19310
2005-01-06 07:01:08 +00:00
Jeff Cohen
13932fb27f Fix minor mistakes
llvm-svn: 19309
2005-01-06 06:29:42 +00:00
Jeff Cohen
11dca28b79 Get rid of those pesky tabs...
llvm-svn: 19308
2005-01-06 06:06:35 +00:00
Jeff Cohen
00d5508496 Add project opt to Visual Studio.
llvm-svn: 19307
2005-01-06 06:02:53 +00:00
Jeff Cohen
eca0d0f2da Put createLoopUnswitchPass() into proper namespace
llvm-svn: 19306
2005-01-06 05:47:18 +00:00
Jeff Cohen
27595a4aec Add missing include
llvm-svn: 19305
2005-01-06 05:46:44 +00:00
Jeff Cohen
56d649f574 Fix incorrect return type.
llvm-svn: 19304
2005-01-06 05:45:45 +00:00
Jeff Cohen
b56965be08 Fix CBE code so that it compiles with VC++.
llvm-svn: 19303
2005-01-06 04:21:49 +00:00
Chris Lattner
2812f0880b Add required #include
llvm-svn: 19302
2005-01-06 03:25:27 +00:00
Chris Lattner
a930a9ab5e Add a useful method
llvm-svn: 19301
2005-01-06 03:23:59 +00:00
Chris Lattner
770c354f7d Add a list end sentinal
llvm-svn: 19299
2005-01-05 22:14:14 +00:00
Reid Spencer
1d183c4ab8 Add the SystemLibrary.html document now that its done.
llvm-svn: 19298
2005-01-05 19:01:20 +00:00
Reid Spencer
9d4d097dd1 Add a missing <div>
llvm-svn: 19297
2005-01-05 18:21:39 +00:00
Reid Spencer
6b9542b338 Bulk upgrade of this document. Cruft removed, new stuff added, general
reorganization of the content. This is now "done".

llvm-svn: 19296
2005-01-05 18:17:10 +00:00
Alkis Evlogimenos
eccb209b6e The Java project now lives under projects/llvm-java.
llvm-svn: 19295
2005-01-05 17:57:28 +00:00
Reid Spencer
1fbccbe786 Make opt honor the quiet option when printing the bytecode warning.
llvm-svn: 19294
2005-01-05 17:31:55 +00:00
Reid Spencer
e153fb3523 1. Make sure that "dot" can be found in the path
2. Fix a bug where the lib directory specified also had to be cwd
3. Weight the output so archive->archive edges are shorter
4. Generate two different graphs: one for libraries, one for objects.
5. Adjust the properties of the graphs till it looks nice.

llvm-svn: 19293
2005-01-05 17:29:29 +00:00
Reid Spencer
c770a0f243 Ignore autoconf/aclocal generated stuff.
llvm-svn: 19292
2005-01-05 17:26:00 +00:00
Chris Lattner
1ee6dfa501 1. If a double FP constant must be put into a constant pool, but it can be
precisely represented as a float, put it into the constant pool as a
   float.
2. Use the cbw/cwd/cdq instructions instead of an explicit SAR for signed
   division.

llvm-svn: 19291
2005-01-05 16:30:14 +00:00
Chris Lattner
a0d572707a add an assertion
llvm-svn: 19290
2005-01-05 16:27:34 +00:00
Chris Lattner
0f7e786a6b Minor optimization to allocate R8 registers in a better order.
llvm-svn: 19289
2005-01-05 16:09:16 +00:00
Chris Lattner
132e400d73 ignore generated file
llvm-svn: 19288
2005-01-05 16:01:00 +00:00
Chris Lattner
05788f97f4 Ignore generated file
llvm-svn: 19287
2005-01-05 16:00:42 +00:00
Chris Lattner
3c6909423d Ignore .dir
llvm-svn: 19286
2005-01-05 16:00:00 +00:00
Chris Lattner
f0698314cd Update this test to pass.
llvm-svn: 19285
2005-01-05 15:23:06 +00:00
Reid Spencer
6a0c6f6bf1 Cleanup configuration for Cygwin
llvm-svn: 19284
2005-01-05 06:41:10 +00:00
Jeff Cohen
05af8cfbd5 Make bison/flex build steps output the same message in Visual Studio as
on Unix.

llvm-svn: 19283
2005-01-04 06:18:10 +00:00
Jeff Cohen
a272e9a839 Add C backend to llc in Visual Studio.
llvm-svn: 19282
2005-01-04 06:01:55 +00:00
Chris Lattner
9742ac8c7c Test that trivial constants are not printed in hex notation.
llvm-svn: 19281
2005-01-04 01:58:26 +00:00
Chris Lattner
472cc1062d To not break TBAA rules, use a union.
llvm-svn: 19280
2005-01-04 01:56:57 +00:00
Chris Lattner
623bacf418 Do not let 'ftostr' return a string that starts with spaces. This allows
the AsmWriter to emit FP constants like 1.0 in normal exponential notation
instead of hex notation.

llvm-svn: 19279
2005-01-04 01:56:28 +00:00
Chris Lattner
91197b0b6a Add a testcase to check that initializer that CAN be evaluated statically ARE.
These used to result in dynamic initializations.

llvm-svn: 19278
2005-01-03 22:27:58 +00:00
Chris Lattner
5dfdadde04 Fix this script to work with hyphenated llvm-gcc and friend.
llvm-svn: 19277
2005-01-03 22:26:38 +00:00
John Criswell
dc6650136a Quote the paths and not the assignment of the PATH variable.
This seems to make things happier.

llvm-svn: 19276
2005-01-03 17:42:57 +00:00
John Criswell
34f603fcd7 Joining the quote fray...
Reverting the quote patch.  For some reason, this breaks the building of
llvm/runtime (the shell doesn't like it for some reason).  I might play
with it to see if I can get the quotes done in such a way that the shell
like it, but no promises.

llvm-svn: 19275
2005-01-03 17:41:56 +00:00
Jeff Cohen
f544d36614 Add additional header file to VS project. Patch submitted by Morten.
llvm-svn: 19274
2005-01-03 16:37:16 +00:00
Jeff Cohen
68f28730b7 Revert elimination of global variable hack... still needed.
llvm-svn: 19273
2005-01-03 16:34:19 +00:00
Reid Spencer
f309b441dc Integrate dependency graphs.
Make it HTML 4.01 Strict compliant
Provide better explanations of the dependency information.

llvm-svn: 19272
2005-01-03 05:46:46 +00:00
Reid Spencer
1d3db42acf Add library dependency and object dependency graphs.
llvm-svn: 19271
2005-01-03 05:30:57 +00:00
Chris Lattner
588d9471f3 new testcase for PR481
llvm-svn: 19270
2005-01-03 04:39:16 +00:00
Chris Lattner
e1329f4472 Bug fixed
llvm-svn: 19269
2005-01-03 04:20:21 +00:00
Chris Lattner
1859e90a1e New testcase for PR487
llvm-svn: 19268
2005-01-03 04:15:11 +00:00
Reid Spencer
2f61775ee1 Make sure the path is properly set in the llvmgcc and llvmgxx variables.
llvm-svn: 19267
2005-01-03 04:05:32 +00:00
Reid Spencer
5041bdba19 Re-apply last (reverted) patch. Reverting doesn't solve the actual problem
and creates issues on other platforms like Cygwin and MingW.

llvm-svn: 19266
2005-01-03 04:04:54 +00:00
Jeff Cohen
c3d0ae2e48 Don't quote the PATH variable value just in case it has spaces in it, as
it breaks "gmake check".

llvm-svn: 19265
2005-01-03 02:44:54 +00:00
Chris Lattner
d4bb2bbce1 ADC and IMUL are also commutable.
llvm-svn: 19264
2005-01-03 01:27:59 +00:00
Chris Lattner
82787e90f3 This hunk:
-  unsigned TrueValue = getReg(TrueVal, BB, BB->begin());
+  unsigned TrueValue = getReg(TrueVal);

Fixes the PPC regressions from last night.

The other hunk is just a clarity improvement.

llvm-svn: 19263
2005-01-02 23:07:31 +00:00
Chris Lattner
73bb15ed9a Remove dead directories
llvm-svn: 19262
2005-01-02 22:55:16 +00:00
Chris Lattner
373f7faeca This lib is dead
llvm-svn: 19261
2005-01-02 22:53:52 +00:00
Chris Lattner
196715cfb4 Remove a bunch of useless empty libraries
llvm-svn: 19260
2005-01-02 22:52:28 +00:00
Chris Lattner
bb2840b272 This is no longer needed.
llvm-svn: 19259
2005-01-02 22:50:00 +00:00
Chris Lattner
0982708a11 Testcase for PR494
llvm-svn: 19258
2005-01-02 21:11:11 +00:00
Chris Lattner
179457f062 xfail these tests, whcih require more info in the code generator to implement
correctly.

llvm-svn: 19257
2005-01-02 19:01:33 +00:00
Reid Spencer
34982d8dc8 Avoid use of -fomit-frame-pointer on FreeBSD platforms. It causes thrown
exceptions to abort() in cases where it should not.

Many thanks to Duraid Madina for doing the heavy lifting on the analysis
of this problem.

llvm-svn: 19256
2005-01-02 17:43:20 +00:00
Reid Spencer
74100aba4a Quote the PATH variable value just in case it has spaces in it (like on
Cygwin).

llvm-svn: 19255
2005-01-02 09:45:54 +00:00
Reid Spencer
862ebf5277 Correct the case of a #include directory name, just in case.
llvm-svn: 19254
2005-01-02 09:45:04 +00:00
Jeff Cohen
70d13a979c Cleanup some Visual Studio project dependencies.
llvm-svn: 19253
2005-01-02 04:44:36 +00:00
Jeff Cohen
2cf40e142c Eliminate the use of the global variable hack in the X86 target that was used
to get Visual Studio to link in X86.lib to the executables that need it.  There
is another way of doing it.

llvm-svn: 19252
2005-01-02 04:23:12 +00:00
Chris Lattner
733aac1270 Disable 2->3 address promotion of add and inc instructions to LEA's. In
addition to being three address, LEA's don't set the flags.

This fixes 186.crafty.

llvm-svn: 19251
2005-01-02 04:18:17 +00:00
Chris Lattner
252b68cfc8 Check in an old test that never made it into CVS
llvm-svn: 19250
2005-01-02 02:46:29 +00:00
Chris Lattner
e7228736e0 Add a new method.
llvm-svn: 19249
2005-01-02 02:38:18 +00:00
Chris Lattner
b62b45b3fc Add support for SETNPr to lower to memory form.
llvm-svn: 19248
2005-01-02 02:37:46 +00:00
Chris Lattner
b7782d77c1 Implement the convertToThreeAddress method, add support for inverting JP/JNP
branches.

llvm-svn: 19247
2005-01-02 02:37:07 +00:00
Chris Lattner
295e45e60e Two changes here:
1. Add new instructions for checking parity flags: JP, JNP, SETP, SETNP.
2. Set the isCommutable and isPromotableTo3Address bits on several
   instructions.

llvm-svn: 19246
2005-01-02 02:35:46 +00:00
Chris Lattner
9590870a0d Make the 2-address instruction lowering pass smarter in two ways:
1. If we are two-addressing a commutable instruction and the LHS is not the
   last use of the variable, see if the instruction is the last use of the
   RHS.  If so, commute the instruction, allowing us to avoid a
   register-register copy in many cases for common instructions like ADD, OR,
   AND, etc on X86.
2. If #1 doesn't hold, and if this is an instruction that also existing in
   3-address form, promote the instruction to a 3-address instruction to
   avoid the register-register copy.  We can do this for several common
   instructions in X86, including ADDrr, INC, DEC, etc.

This patch implements test/Regression/CodeGen/X86/commute-two-addr.ll,
overlap-add.ll, and overlap-shift.ll when I check in the X86 support for it.

llvm-svn: 19245
2005-01-02 02:34:12 +00:00
Chris Lattner
835ae42300 Add several testcases for new optimizations in the code generator.
llvm-svn: 19244
2005-01-02 02:30:04 +00:00
Chris Lattner
733c82bfbf Expose isConvertibleToThreeAddress and isCommutable bits to the code generator.
llvm-svn: 19243
2005-01-02 02:29:04 +00:00
Chris Lattner
a1a6be7e6e Add some bits that can be set on instructions. Renumber existing bits so
they are dense.  Add a virtual method that targets can choose to implement.

llvm-svn: 19242
2005-01-02 02:28:31 +00:00
Chris Lattner
182db0cac0 Add some bits that can be set for instructions.
llvm-svn: 19241
2005-01-02 02:27:48 +00:00
Reid Spencer
4e8dd44733 Make printing a warning message optional in CheckBytecodeOutputToConsole.
llvm-svn: 19240
2005-01-02 00:10:03 +00:00
Reid Spencer
742af2f2eb Prevent output of bytecode to std::cout unless the --force flag is given.
This prevents bytecode splats with usage like: cat file.ll | llvm-as -

llvm-svn: 19239
2005-01-02 00:08:46 +00:00
Reid Spencer
c967184a50 Move the code for printing out a warning about bytecode output to a console
into lib/Support so it can be used with other tools.

llvm-svn: 19238
2005-01-01 23:57:01 +00:00
Reid Spencer
1263cfd14f Implement a function to print a warning if bytecode output is to be sent to
a terminal/console.

llvm-svn: 19237
2005-01-01 23:56:20 +00:00
Jeff Cohen
b90c31fb49 Add functions for determining if the stdin/out/err is connected to a
console or not.

llvm-svn: 19236
2005-01-01 22:54:05 +00:00
Jeff Cohen
e98c7b6f26 Add llvm-link, Linker projects to Visual Studio.
llvm-svn: 19235
2005-01-01 22:32:26 +00:00
Jeff Cohen
8db20fe964 Add missing header files to projects.
llvm-svn: 19234
2005-01-01 22:30:19 +00:00
Reid Spencer
6f802ba876 Add functions for determining if the stdin/out/err is connected to a
console or not.

llvm-svn: 19233
2005-01-01 22:29:26 +00:00
Jeff Cohen
ca7d19e2af Fix typo 'ompress' => 'compress'.
llvm-svn: 19232
2005-01-01 22:10:32 +00:00
Jeff Cohen
b06a83e285 Add llvm-ranlib project to Visual Studio.
llvm-svn: 19231
2005-01-01 22:05:56 +00:00
Jeff Cohen
5c3261e5f2 Add llvm-ar project to Visual Studio.
llvm-svn: 19230
2005-01-01 22:00:28 +00:00
Jeff Cohen
16034813e6 Add -v option to bison.
llvm-svn: 19229
2005-01-01 21:35:39 +00:00
Jeff Cohen
49123973f8 Add missing file SystemUtils.cpp to Support project.
llvm-svn: 19228
2005-01-01 21:34:18 +00:00
Jeff Cohen
1d2912470a Add llvm-as project to Visual Studio
llvm-svn: 19227
2005-01-01 20:51:41 +00:00
Jeff Cohen
980d6098b6 Add llvm-dis project to Visual Studio
llvm-svn: 19226
2005-01-01 20:18:03 +00:00
Jeff Cohen
08f30c0c33 Put executables into a single directory
llvm-svn: 19225
2005-01-01 19:37:14 +00:00
Jeff Cohen
4560c21dd2 Fix bountiful sources of VC++ 'possible loss of data' warnings
llvm-svn: 19224
2005-01-01 18:58:23 +00:00
Jeff Cohen
031c3d891c Improve TableGen dependencies
Move TableGen generated files out of the src tree
Add descriptions to the custom build steps

llvm-svn: 19223
2005-01-01 18:17:40 +00:00
Reid Spencer
3b8faf995d Add HAVE_SBRK
llvm-svn: 19222
2005-01-01 18:16:16 +00:00
Reid Spencer
9f0ce1772c Ignore some files
llvm-svn: 19221
2005-01-01 18:14:18 +00:00
Chris Lattner
86102b8ad5 This is a bulk commit that implements the following primary improvements:
* We can now fold cast instructions into select instructions that
    have at least one constant operand.
  * We now optimize expressions more aggressively based on bits that are
    known to be zero.  These optimizations occur a lot in code that uses
    bitfields even in simple ways.
  * We now turn more cast-cast sequences into AND instructions.  Before we
    would only do this if it if all types were unsigned.  Now only the
    middle type needs to be unsigned (guaranteeing a zero extend).
  * We transform sign extensions into zero extensions in several cases.

This corresponds to these test/Regression/Transforms/InstCombine testcases:
  2004-11-22-Missed-and-fold.ll
  and.ll: test28-29
  cast.ll: test21-24
  and-or-and.ll
  cast-cast-to-and.ll
  zeroext-and-reduce.ll

llvm-svn: 19220
2005-01-01 16:22:27 +00:00
Chris Lattner
da15d4ba49 New testcases that we should combine.
llvm-svn: 19219
2005-01-01 16:14:46 +00:00
Chris Lattner
584e38313b New testcase for common bitfield manipulation instruction sequences.
llvm-svn: 19218
2005-01-01 16:14:18 +00:00
Chris Lattner
421477885f Add a bunch of tests for cases that should be eliminated.
llvm-svn: 19217
2005-01-01 16:13:43 +00:00
Chris Lattner
329d0255ae Add a bunch of tests for ANDs that should be eliminated.
llvm-svn: 19216
2005-01-01 16:13:19 +00:00
Chris Lattner
ea4c66a083 This now works.
llvm-svn: 19215
2005-01-01 16:12:52 +00:00
Chris Lattner
83df5d25b7 Fix a FIXME: Select instructions on longs were miscompiled.
While we're at it, improve codegen of select instructions.  For this
testcase:

int %test(bool %C, int %A, int %B) {
  %D = select bool %C, int %A, int %B
  ret int %D
}

We used to generate this code:

_test:
        cmpwi cr0, r3, 0
        bne .LBB_test_2 ;
.LBB_test_1:    ;
        b .LBB_test_3   ;
.LBB_test_2:    ;
        or r5, r4, r4
.LBB_test_3:    ;
        or r3, r5, r5
        blr

Now we emit:

_test:
        cmpwi cr0, r3, 0
        bne .LBB_test_2 ;
.LBB_test_1:    ;
        or r4, r5, r5
.LBB_test_2:    ;
        or r3, r4, r4
        blr

-Chris

llvm-svn: 19214
2005-01-01 16:10:12 +00:00
Chris Lattner
78394258ae Substantially improve the code generated by non-folded setcc instructions.
In particular, instead of compiling this:

bool %test(int %A, int %B) {
  %C = setlt int %A, %B
  ret bool %C
}

to this:

test:
        save %sp, -96, %sp
        subcc %i0, %i1, %g0
        bl .LBBtest_1   !
        nop
        ba .LBBtest_2   !
        nop
.LBBtest_1:     !
        or %g0, 1, %i0
        ba .LBBtest_3   !
        nop
.LBBtest_2:     !
        or %g0, 0, %i0
        ba .LBBtest_3   !
        nop
.LBBtest_3:     !
        restore %g0, %g0, %g0
        retl
        nop

We now compile it to this:

test:
        save %sp, -96, %sp
        subcc %i0, %i1, %g0
        or %g0, 1, %i0
        bl .LBBtest_2   !
        nop
.LBBtest_1:     !
        or %g0, %g0, %i0
.LBBtest_2:     !
        restore %g0, %g0, %g0
        retl
        nop

llvm-svn: 19213
2005-01-01 16:06:57 +00:00
Chris Lattner
3215bb6049 Implement SimplifyCFG/DeadSetCC.ll
SimplifyCFG is one of those passes that we use for final cleanup: it should
not rely on other passes to clean up its garbage.  This fixes the "why are
trivially dead setcc's in the output of gccas" problem.

llvm-svn: 19212
2005-01-01 16:02:12 +00:00
Chris Lattner
21adf7d36e Add new test to make sure simplifycfg doesn't leave around trivially
dead instructions.

llvm-svn: 19211
2005-01-01 16:00:56 +00:00
Chris Lattner
1ece6f83ba Allow getZeroExtend and getSignExtend to work with boolean inputs.
llvm-svn: 19210
2005-01-01 15:59:57 +00:00
Chris Lattner
3196de7663 Add a useful accessor
llvm-svn: 19209
2005-01-01 15:58:55 +00:00
Chris Lattner
094e8b660b Add two helper functions.
llvm-svn: 19208
2005-01-01 15:58:41 +00:00
Reid Spencer
97d6cf262f Update to autoconf 2.59 standards.
llvm-svn: 19207
2005-01-01 09:26:55 +00:00
Reid Spencer
948499e820 Correct the conditional test for non-portable tools so that it will
correctly omit them for non-Unix operating systems.

llvm-svn: 19206
2004-12-31 22:56:14 +00:00
Reid Spencer
d7287e05e3 For PR351:
Make LLVM_ON_UNIX and LLVM_ON_WIN32 available in the makefiles

llvm-svn: 19205
2004-12-31 22:54:28 +00:00
Reid Spencer
cdf4d46551 Describe both objdir==srcdir and objdir!=srcdir methods of building LLVM
libraries and tools. Thanks to Henrik Bach for this suggestion.

llvm-svn: 19204
2004-12-31 19:48:59 +00:00
Jeff Cohen
b6ecaa2d1c Where do these tabs keep coming from???
llvm-svn: 19203
2004-12-31 19:03:31 +00:00
Jeff Cohen
25dcdcc973 Mostly cleanup, but also some bug fixes, for win32/Path.cpp
llvm-svn: 19202
2004-12-31 19:01:08 +00:00
Reid Spencer
0f371a1637 Fix a compilation error for the case where mallinfo() is not available.
llvm-svn: 19201
2004-12-31 05:53:27 +00:00
Reid Spencer
0fcca1262b For PR351:
* lib/System depends on sbrk(3), make sure we check for it.

llvm-svn: 19200
2004-12-31 05:49:15 +00:00
Jeff Cohen
63f13c4cbc Get rid of those nasty tabs...
llvm-svn: 19199
2004-12-31 05:07:26 +00:00
Jeff Cohen
98aff88c9b Bring win32/Path.cpp up to date with respect to Unix/Path.cpp
llvm-svn: 19198
2004-12-31 04:39:07 +00:00
Reid Spencer
234dc34c77 * Add missing libraries: Linker, Archive, SparcV8
* Make library descriptions consistently lower case.

llvm-svn: 19197
2004-12-31 00:13:14 +00:00
Reid Spencer
266325e6d8 * Don't include weak definitions as a definition
* Make subordinate libraries presented with a vertical list instead of all
  listed on a single line.

llvm-svn: 19196
2004-12-30 23:13:12 +00:00
Reid Spencer
72767f611c Add a section on library dependencies now that GenLibDeps.html is written.
llvm-svn: 19195
2004-12-30 23:12:04 +00:00
Reid Spencer
271ed74132 A Perl script to generate an HTML definition list containing the LLVM
library dependencies, for documentation purposes.

llvm-svn: 19194
2004-12-30 23:07:56 +00:00
Reid Spencer
e97198a38e Fix the help documentation to not imply multiple archive files can be
processed.

llvm-svn: 19193
2004-12-30 17:51:57 +00:00
Reid Spencer
996ec72d48 For PR351:
* Place a try/catch block around the entire tool to Make sure std::string
  exceptions are caught and printed before exiting the tool.
* Make sure we catch unhandled exceptions at the top level so that we don't
  abort with a useless message but indicate than an unhandled exception was
  generated.

llvm-svn: 19192
2004-12-30 05:36:08 +00:00
Jeff Cohen
a6d9c1415c Fix MINGW compilation errors
llvm-svn: 19190
2004-12-30 03:02:31 +00:00
Reid Spencer
3d745d4378 * Fix a bug in an m4 macro that used an incorrect test operator
* Add CAN_DLOPEN_SELF so we can determine if dlopen(0) will open the
  program or not.
* Correct a warning messages to be a little more specific on what it checks

llvm-svn: 19184
2004-12-29 07:07:57 +00:00
Reid Spencer
42eaef40d8 Fix a Bourne Shell syntax error in a test
llvm-svn: 19183
2004-12-29 06:59:36 +00:00
Reid Spencer
5309e843d3 Fix one of the names to not have a . in front of it.
llvm-svn: 19182
2004-12-29 05:47:04 +00:00
Chris Lattner
b5c253a58b Bug fixed
llvm-svn: 19181
2004-12-29 04:39:50 +00:00
Chris Lattner
13516fe2e7 Fix PR491 and testcase Transforms/DeadStoreElimination/2004-12-28-PartialStore.ll
llvm-svn: 19180
2004-12-29 04:36:02 +00:00
Chris Lattner
f2a5963737 Add a comment, add a new testcase
llvm-svn: 19179
2004-12-29 04:35:30 +00:00
Chris Lattner
44b225d4d4 New testcase for PR491
llvm-svn: 19178
2004-12-29 04:27:26 +00:00
Chris Lattner
c6141111a5 Bug fixed
llvm-svn: 19177
2004-12-29 04:03:23 +00:00
Chris Lattner
93feeb18f1 Fix PR490
Fix testcase CodeGen/CBackend/2004-12-28-LogicalConstantExprs.ll

llvm-svn: 19176
2004-12-29 04:00:09 +00:00
Chris Lattner
5c87df3b7b new testcase for PR490
llvm-svn: 19175
2004-12-29 03:57:25 +00:00
Reid Spencer
46f8f24f15 XFAIL this test everywhere.
llvm-svn: 19174
2004-12-29 03:17:30 +00:00
Reid Spencer
28d2ad3396 XFAIL this everywhere, the CFE doesn't support bitfield initialization.
llvm-svn: 19173
2004-12-29 03:16:40 +00:00
Reid Spencer
9f4bb585f5 Remove potential platform portability issue with size of "int".
llvm-svn: 19172
2004-12-29 01:20:24 +00:00
Reid Spencer
b9f8de6efe Correct the name of the variable for the LLVM examples directory so that
parallel builds don't attempt to create it twice.

llvm-svn: 19171
2004-12-28 07:59:22 +00:00
Reid Spencer
78d9e8763d Make the x86_64 target names match between def and use. Thanks Misha.
llvm-svn: 19170
2004-12-28 07:56:14 +00:00
Reid Spencer
307435c2ae Make the 64-bit x86 target named "x86_64" instead of "AMD64".
llvm-svn: 19169
2004-12-28 06:34:11 +00:00
Misha Brukman
c57b9eb581 Add a note about registering the backend so it's available in LLC and LLI
llvm-svn: 19168
2004-12-27 19:05:16 +00:00
Jeff Cohen
bb3d4a1b64 Bring VS projects up to date with respect to recent changes
llvm-svn: 19167
2004-12-27 16:49:34 +00:00
Reid Spencer
cf8f341c36 Don't create symbolic links for lib/System any more. It doesn't need them.
llvm-svn: 19166
2004-12-27 09:33:46 +00:00
Reid Spencer
c7f0a4733d Clean up some autoconf cruft
* Make the source detection use a file unique to Stacker
* Configure Makefile.common.in with AC_CONFIG_FILES not AC_CONFIG_MAKEFILE
* Use new autoconf format for invoking AC_OUTPUT

llvm-svn: 19165
2004-12-27 08:51:55 +00:00
Reid Spencer
c4f0c739c9 Make it possible to reconfigure a project as well as just LLVM main dir.
llvm-svn: 19164
2004-12-27 08:50:27 +00:00
Reid Spencer
ad7bdf7400 Fix a bug that made the nightly tester *really* slow. During changes for
portability, the --track-space option was inadvertently ignored. This patch
fixes that so that sys::Process::GetMallocUsage() is only invoked if the
--track-spaces option is given. Apparently the mallinfo() call that
GetMallocUsage() uses is *very* slow, especially when processing very large
modules like projects/llvm-test/MultiSource/Applications/kimwitu++.

llvm-svn: 19163
2004-12-27 08:03:04 +00:00
Reid Spencer
a079b69981 For PR351:
* sys::PreventCoreFiles -> sys::Process::PreventCoreFiles

llvm-svn: 19162
2004-12-27 06:18:02 +00:00
Reid Spencer
e925d8b8b2 For PR351:
* Ensure #includes are wrapped with appropriate HAVE_ guards
* Account for variations in time.h and sys/time.h inclusion.
* Add macros for getting wait(2) exit status correctly (per autoconf sugg.)
* Implement ThrowErrno in terms of strerror_r, strerror or none based on
  what is available on the platform.

llvm-svn: 19161
2004-12-27 06:17:50 +00:00
Reid Spencer
efda887fe2 For PR351:
* Remove redundant #includes that are now in Unix.h

llvm-svn: 19160
2004-12-27 06:17:39 +00:00
Reid Spencer
cf15b874e8 For PR351:
* Move implementation of sys::PreventCoreFiles function to this file from
  the now defunct SysConfig abstraction.

llvm-svn: 19159
2004-12-27 06:17:27 +00:00
Reid Spencer
d103e0851c For PR351:
* Ensure #includes are wrapped with appropriate HAVE_ guards
* Ensure variations in "dirent" structure are accounted for.

llvm-svn: 19158
2004-12-27 06:17:15 +00:00
Reid Spencer
47cd653411 For PR351:
* Ensure #includes are wrapped with appropriate HAVE_ guards
* Consolidate implementation from operating system specific directory.

llvm-svn: 19157
2004-12-27 06:17:03 +00:00
Reid Spencer
d554bbcefd For PR351:
* Ensure #includes are wrapped with appropriate HAVE_ guards

llvm-svn: 19156
2004-12-27 06:16:52 +00:00
Reid Spencer
af6d3d5c8f For PR351:
* Consolidate implementation for Unix systems into Unix/TimeValue.cpp
* Avoid use of symbolic link to #include platform-specific implementation.

llvm-svn: 19155
2004-12-27 06:16:38 +00:00
Reid Spencer
51ea06abf8 For PR351:
* Consolidate implementation for Unix systems into Unix/Program.cpp
* Avoid use of symbolic link to #include platform-specific implementation.

llvm-svn: 19154
2004-12-27 06:16:25 +00:00
Reid Spencer
844f3fec49 For PR351:
* Consolidate implementation for Unix systems into Unix/Signals.cpp
* Avoid use of symbolic link to #include platform-specific implementation.

llvm-svn: 19153
2004-12-27 06:16:11 +00:00
Reid Spencer
71383fb646 For PR351:
* Consolidate implementation for Unix systems into Unix/Memory.cpp
* Avoid use of symbolic link to #include platform-specific implementation.

llvm-svn: 19152
2004-12-27 06:15:57 +00:00
Reid Spencer
1a7a435b49 For PR351:
* Consolidate implementation for Unix systems into Unix/MappedFile.cpp
* Avoid use of symbolic link to #include platform-specific implementation.

llvm-svn: 19151
2004-12-27 06:15:43 +00:00
Reid Spencer
97d4a17f04 For PR351:
* Consolidate implementation for Unix systems into Unix/Process.cpp
* Avoid use of symbolic link to #include platform-specific implementation.

llvm-svn: 19150
2004-12-27 06:15:29 +00:00
Reid Spencer
0d1ad6ac34 For PR351:
SysConf abstraction was pointless because it had a single function in it that
pertained only to the current process. So merge it into the Process abstraction
and remove the files completely.

llvm-svn: 19149
2004-12-27 06:15:14 +00:00
Reid Spencer
b668158b7c For PR351:
* Add checks for sterror and strerror_r functions
* Add check to determine if /dev/zero is needed for allocating RWX memory.

llvm-svn: 19148
2004-12-27 06:15:02 +00:00
Reid Spencer
826da2a721 For PR351:
Provide a check to determine if /dev/zero is needed for AllocateRWX function.

llvm-svn: 19147
2004-12-27 06:14:48 +00:00
Reid Spencer
189c677549 Oops, reverse the logic on a test for WITH_LLVMGCCDIR to make it define
the path names correctly.

llvm-svn: 19146
2004-12-27 03:15:28 +00:00
Reid Spencer
474a09ca20 Provide a value for HAVE_MMAP_ANONYMOUS variable, for consistency with
other #define's.

llvm-svn: 19145
2004-12-27 03:14:43 +00:00
Reid Spencer
6bfa7a4f7b Describe the --with-llvmgccdir option to configure.
llvm-svn: 19144
2004-12-26 05:47:26 +00:00
Reid Spencer
d2020acea0 Revert the last patch so that the LLVMGCCDIR environment variable is
still viable and will make use of the resurrected --with-llvmgccdir
configure option.

llvm-svn: 19143
2004-12-26 05:21:13 +00:00
Reid Spencer
8bc110c097 For PR351:
* Make sure all headers used by lib/System have checks
* Use "standard" autoconf checks for certain problematic headers
For PR432:
* Resurrect --with-llvmgccdir so a specific llvm-gcc/llvm-g++ installation
  can be specified.

llvm-svn: 19142
2004-12-25 07:31:29 +00:00
Jeff Cohen
f365c33b62 mingw doesn't support the official debug API.
Old versions of the C runtime somehow get loaded into the process.  Make
sure they aren't searched for symbols.

llvm-svn: 19141
2004-12-25 04:50:17 +00:00
Jeff Cohen
683b1a5e3c Get VC++ building again
llvm-svn: 19140
2004-12-24 16:26:47 +00:00
Reid Spencer
d06d026715 Ignore the autom4te.cache directoy.
llvm-svn: 19139
2004-12-24 15:11:23 +00:00
Reid Spencer
c005fba17b Make sure llvm-g++ gets the right path for the llvm tools.
llvm-svn: 19138
2004-12-24 14:47:34 +00:00
Jeff Cohen
039b4abf6c Eliminate use of ltdl.c when doing a VC++ build. Because libtool isn't used,
ltdl's LGPL license would infect all of LLVM.

llvm-svn: 19137
2004-12-24 07:57:09 +00:00
Reid Spencer
c81ccb488a Make the symbolic link using the correct variable!
llvm-svn: 19136
2004-12-24 06:49:16 +00:00
Reid Spencer
920b83d709 Remove references to LLVMGCCDIR because it was only used to provide a
value for the --with-llvmgccdir configure option which is no longer
supported.

llvm-svn: 19135
2004-12-24 06:32:54 +00:00
Reid Spencer
20540311e1 For PR351:
Merge implementations of isValid and GetTemporaryDirectory into this file. There
is not any point having the operating system specific files for such little
variation between the Unix family of systems.

llvm-svn: 19134
2004-12-24 06:29:42 +00:00
Reid Spencer
e7c870364f For PR351:
This implementation is no longer needed, its been merged to Unix/Path.cpp since
there is such little variation between the platforms.

llvm-svn: 19133
2004-12-24 06:29:28 +00:00
Reid Spencer
328ee53573 For PR351:
Use the LLVM_ON_UNIX and LLVM_ON_WIN32 #defines to include the implementation
instead of relying upon the "platform" link

llvm-svn: 19132
2004-12-24 06:29:17 +00:00
Reid Spencer
d3d6d9d691 For PR351:
Create new variables LLVM_ON_UNIX and LLVM_ON_WIN32 so we can start getting
rid of reliance upon a symbolic link to switch implementations in lib/System

llvm-svn: 19131
2004-12-24 06:29:05 +00:00
Reid Spencer
4befbf3f14 Resurrect this file.
llvm-svn: 19130
2004-12-24 06:03:31 +00:00
Reid Spencer
265b02ed3a Remove these files as they are not being included any more. DynamicLibrary
is now implemented via ltdl.cpp which has its own way of dealing with
the different platforms.

llvm-svn: 19129
2004-12-24 03:59:46 +00:00
Reid Spencer
0f996fe02c Make sure LLVMGCCWITHPATH is used instead of just LLVMGCC so that the
CFE tools can find the correct LLVM tools to invoke.

llvm-svn: 19128
2004-12-24 03:44:24 +00:00
Reid Spencer
69d897cc22 The dejagnu scripts need a path for llvm-gcc/llvm-g++ as well so use the
correct variable to get a "set the path first" invocation of those tools.

llvm-svn: 19127
2004-12-24 03:38:01 +00:00
Reid Spencer
35655d69b5 Two corrections:
* When reconfiguring, make sure the config.cache file is blown away so that
  its (old) values don't short-circuit doing the tests. When a reconfigure
  is done, it should be done from scratch, without the cache.
* For dist-check, don't pass --with-llvmgccdir any more because configure
  doesn't have this option any more.

llvm-svn: 19126
2004-12-24 03:36:31 +00:00
Reid Spencer
b608aebc6c Change llvmgcc/llvmg++ to llvm-gcc and llvm-g++ respectively.
llvm-svn: 19125
2004-12-24 03:34:31 +00:00
Jeff Cohen
d567bb6af6 Fix VC++ compilation error
llvm-svn: 19124
2004-12-24 02:38:34 +00:00
Reid Spencer
657b7343f3 Fix a bug in libtool's ltmain.sh. On Cygwin the "$output.exp" expression
expands to a full path name. Substitute $outputname.exp" instead and it
makes a viable temporary file name. This gets around the problem with lli
on Cygwin linking but not having any "C" library functions linked into it.

llvm-svn: 19123
2004-12-24 00:15:20 +00:00
Reid Spencer
c84ee1aee0 Put CopyFile in the sys namespace.
llvm-svn: 19122
2004-12-23 22:14:32 +00:00
Misha Brukman
e50986b39f Wrap at 80 cols
llvm-svn: 19121
2004-12-23 21:17:41 +00:00
Reid Spencer
dee41307dc Correct the comments and file header.
llvm-svn: 19120
2004-12-23 21:16:46 +00:00
Reid Spencer
454a8afc6d Try to speed up gccld hot spot in BasicVN::getEqualNumberNodes by making
a function call at the core of the loop inline and removing unused
stack variables from an often called function. This doesn't improve things
much, the real saving will be by reducing the number of calls to this
function (100K+ when linking kimwitu++).

llvm-svn: 19119
2004-12-23 21:13:26 +00:00
Reid Spencer
0a54a58c63 Update the amd64 target detection checks.
Patch contributed by Markus F.X.J. Oberhumer.

llvm-svn: 19118
2004-12-23 21:08:52 +00:00
Reid Spencer
1097f7df5f Add a caution about using experimental versions of gnu binutils when
building Cygwin.

llvm-svn: 19117
2004-12-23 19:49:54 +00:00
Reid Spencer
a8acd82275 Be specific about version of GCC and binutils on Cygwin since it matters.
llvm-svn: 19116
2004-12-23 19:39:54 +00:00
Misha Brukman
5ac308f43a LLVM now builds and runs on Linux/amd64, but we don't have 64-bit codegen yet
llvm-svn: 19115
2004-12-23 07:14:56 +00:00
Jeff Cohen
cd80438755 Allow llc to recognize -march=x86. As it was, it didn't recognize any
architecture at all.

llvm-svn: 19114
2004-12-23 06:45:32 +00:00
Reid Spencer
864cee3355 Added support for detection of amd64 targets.
llvm-svn: 19113
2004-12-23 06:22:33 +00:00
Jeff Cohen
53fbecce6e Patch to fix mingw compilation problem contributed by Henrik.
llvm-svn: 19112
2004-12-23 03:44:40 +00:00
Brian Gaeke
737d3e8794 Fix the build on PowerPC/Darwin - it thought we were declaring a new
function or something. Since FileRemover takes a const reference to
sys::Path, we need to pass an actual sys::Path variable.

llvm-svn: 19111
2004-12-22 22:33:33 +00:00
Reid Spencer
e0699f7466 * Remove an unnecessary step.
* Correct a path.

llvm-svn: 19110
2004-12-22 16:19:05 +00:00
Reid Spencer
d94c5f8cc9 Correct compilation for Cygwin. FindExecutable now returns a sys::Path.
llvm-svn: 19109
2004-12-22 13:50:17 +00:00
Reid Spencer
3b21e3539a For PR351:
Include local FDHandle.h file now that FDHandle is local to this library
and not in lib/System/FileUtilities.

llvm-svn: 19108
2004-12-22 10:25:06 +00:00
Reid Spencer
756d023539 For PR351:
FDHandle class (non-portable) moved here from lib/Support/FileUtilities

llvm-svn: 19107
2004-12-22 10:24:55 +00:00
Reid Spencer
5260b5b46d For PR351:
Move non-portable FDHandle class to its only user: lib/Debugger

llvm-svn: 19106
2004-12-22 10:24:43 +00:00
Reid Spencer
3e41cd50b4 Add a blurb about using the GCC 3.4.3 compiler on Cygwin (which works) for
the CFE instead of the default GCC 3.3.3 compiler that comes with Cygwin.

llvm-svn: 19104
2004-12-22 09:52:30 +00:00
Reid Spencer
c5f858ca52 For PR432:
* Remove the idiotic windows environment setting, its not needed.
* Remove an extraneous "mkdir" instruction.

llvm-svn: 19103
2004-12-22 09:07:51 +00:00
Reid Spencer
296cf274fd Hopefully fix a link.
llvm-svn: 19102
2004-12-22 06:48:03 +00:00
Reid Spencer
85a38ded31 Fix the names of these executables now that they've been somewhat cast in
stone.

llvm-svn: 19101
2004-12-22 06:47:25 +00:00
Reid Spencer
31bf9a0371 Correct the name of the executables to which llvmgcc and llvmgxx variables
point to.

llvm-svn: 19100
2004-12-22 06:45:24 +00:00
Reid Spencer
c659a4b140 For PR432:
Rework the CFE build details to include the directions for using the
option --program-prefix=llvm- to the CFE's configure script. This ensures
that the CFE builds unique executable names and makes it possible to put
the $CFEINSTALL/bin directory into one's path.

llvm-svn: 19099
2004-12-22 06:40:29 +00:00
Reid Spencer
788b0fdab7 For PR432:
* llvmgcc -> llvm-gcc
* llvmg++ -> llvm-g++
* remove references to --with-llvmgccdir configure option

llvm-svn: 19098
2004-12-22 06:29:07 +00:00
Reid Spencer
c4de911191 For PR432:
* Use LLVMGCC and LLVMGXX variables instead of computing the name

llvm-svn: 19097
2004-12-22 05:57:50 +00:00
Reid Spencer
e301401118 For PR432:
* Variable name change: cferuntime_libdir -> CFERuntimeLibDir

llvm-svn: 19096
2004-12-22 05:57:33 +00:00
Reid Spencer
2bba41c760 For PR432:
* Cleanup LLVMGCXX and LLVMGCC by providing LLVMGXXWITHPATH and LLVMGCCWITHPATH
  variables that add the $(LLVMToolDir) to the path so the CFE tools can find
  the right LLVM tools they depend on.
* Standardize the name of a variable: cferuntime_libdir -> CFERuntimeLibDir

llvm-svn: 19095
2004-12-22 05:57:21 +00:00
Reid Spencer
0921255067 For PR432:
* Use new configuration variables to compute LLVMGCC and LLVMGXX variables.

llvm-svn: 19094
2004-12-22 05:57:09 +00:00
Reid Spencer
fd144e8655 For PR432:
* Remove --with-llvmgccdir, not needed any more
* Search path for llvm-gcc and llvm-gxx
* Compute LLVMGCCDIR based on install path of llvm-gcc

llvm-svn: 19093
2004-12-22 05:56:56 +00:00
Reid Spencer
2ac471060e Get rid of old automake stuff
llvm-svn: 19092
2004-12-22 05:56:41 +00:00
Reid Spencer
e2b14e52c7 Support the gas option --traditional-format which, for some reason, gets
passed to gccas when the --program-prefix option is used to configure CFE.

llvm-svn: 19091
2004-12-22 02:58:43 +00:00
Misha Brukman
2261bff1a5 Ignore generated files
llvm-svn: 19090
2004-12-22 01:49:53 +00:00
Reid Spencer
5fb7160b0e Revert last patch until we can figure out how to build executables named
llvmgcc and llvmg++ correctly.

llvm-svn: 19089
2004-12-22 01:37:47 +00:00
Misha Brukman
8295ac7098 Fix the Win32 build
llvm-svn: 19088
2004-12-22 01:37:33 +00:00
Reid Spencer
5d2d5db1b0 Revert last changes as they introduce CFE build problems.
llvm-svn: 19087
2004-12-22 01:36:27 +00:00
Reid Spencer
fc195422a5 Make parameters to CopyFile use explicit instantiation of sys::Path.
llvm-svn: 19086
2004-12-22 01:26:48 +00:00
Jeff Cohen
248192ac04 Add project Bytecode to Visual Studio
llvm-svn: 19085
2004-12-22 00:27:14 +00:00
Reid Spencer
0953cfc002 Remove instructions to make aliases for llvmgcc and llvmg++ as the CFE
Build instructions now direct the user to have the CFE generate executables
with those names via the --program-prefix=llvm configure option.

llvm-svn: 19084
2004-12-21 18:52:08 +00:00
Reid Spencer
7bb9d35be2 For PR432:
Add instructions for using the --program-prefix=llvm so that the CFE build
produces llvmgcc instead of gcc.

llvm-svn: 19083
2004-12-21 18:50:54 +00:00
Jeff Cohen
6486fab16d Fix VC++ compilation error
llvm-svn: 19082
2004-12-21 15:40:41 +00:00
Reid Spencer
9e7acd465e For PR351:
Remove unix specific code (use of errno and read) from the reader.
Thanks to Jeff Cohen for pointing this out.

llvm-svn: 19081
2004-12-21 07:51:33 +00:00
Jeff Cohen
fd0e3542f9 Visual Studio project Configure should place the configured header files
in the win32 subtree instead of the src subtree.

llvm-svn: 19080
2004-12-21 06:49:13 +00:00
Reid Spencer
107410613b Put the CopyFile function explicitly in the sys namespace.
llvm-svn: 19079
2004-12-21 03:27:08 +00:00
Reid Spencer
4acff4056f Use explicit construction of sys::Path from std::string because the
constructor is "explicit".

llvm-svn: 19078
2004-12-21 03:24:02 +00:00
Reid Spencer
fbad5d7d65 Include <cassert> for Cygwin.
llvm-svn: 19077
2004-12-21 00:22:51 +00:00
Reid Spencer
22dd8b15c0 Cygwin doesn't like .. through a link, so drop the ..
llvm-svn: 19076
2004-12-20 22:21:41 +00:00
Reid Spencer
92e8a5a0ea Fix a bug where system time always equals user time
llvm-svn: 19075
2004-12-20 21:44:27 +00:00
Reid Spencer
d4c6988809 Implement GetTimeUsage correctly.
llvm-svn: 19074
2004-12-20 21:43:33 +00:00
Reid Spencer
08b4bd7496 Allow compilers that can't distinguish between a class instantiation and
the declaration of a function to compile this.

llvm-svn: 19073
2004-12-20 19:16:12 +00:00
Reid Spencer
8005e66f0a Provide a getrusage based implementation of GetTotalMemoryUsage and use
the ru_maxrss field as an approximation.

llvm-svn: 19072
2004-12-20 16:33:37 +00:00
Reid Spencer
1cf74cee21 Consistently use the same #if style. Also, fix a bug testing for sbrk(3)
llvm-svn: 19071
2004-12-20 16:06:44 +00:00
Reid Spencer
1e10203375 Remove unnecessary #includes.
llvm-svn: 19070
2004-12-20 06:38:12 +00:00
Reid Spencer
cbd791c5e7 Be double sure about including sys/stat.h by wrapping the inclusion in
an "#if defined(HAVE_SYS_STAT_H)".

llvm-svn: 19069
2004-12-20 06:34:02 +00:00
Misha Brukman
db1fca91af llvm/Config/unistd.h has gone away, far, far away
llvm-svn: 19068
2004-12-20 05:36:57 +00:00
Reid Spencer
b5e10bb05d Remove the #include of llvm/Config/unistd.h as it is no longer needed.
llvm-svn: 19067
2004-12-20 04:52:04 +00:00
Reid Spencer
f3f9f4339f Remove this file as there are no LLVM users of it any more.
llvm-svn: 19066
2004-12-20 04:35:20 +00:00
Reid Spencer
a2ff4f4634 Incorporate the contents of include/llvm/Config/unistd.h as this is the
last file in LLVM to require the header. After ths commmit, our unistd.h
will go away.

llvm-svn: 19065
2004-12-20 04:34:36 +00:00
Reid Spencer
beece98d9d Remove this file as its not used by anything in LLVM any more. System
dependent behavior is now made through the lib/System interface.

llvm-svn: 19064
2004-12-20 04:25:53 +00:00
Reid Spencer
5e3a6d29bc Remove these files as they are included by nothing in LLVM any more. The
system dependent functionality has been moved to lib/System.

llvm-svn: 19063
2004-12-20 04:24:32 +00:00
Reid Spencer
e4bd5e577a Remove these headers. The files that used to #include them don't any more
as most system dependent behavior has been moved to lib/System.

llvm-svn: 19062
2004-12-20 04:20:37 +00:00
Reid Spencer
6b853b22cb Remove un-needed #includes.
llvm-svn: 19061
2004-12-20 04:15:44 +00:00
Reid Spencer
f3b99a9c02 Add HAVE_SYSCONF
llvm-svn: 19060
2004-12-20 04:08:58 +00:00
Brian Gaeke
fe4e48e14b Use Config/alloca.h instead of alloca.h - pointed out by Duraid and Misha
llvm-svn: 19059
2004-12-20 04:02:01 +00:00
Reid Spencer
ee556dd431 Put some header files back that Win32 needs.
llvm-svn: 19058
2004-12-20 03:59:23 +00:00
Jeff Cohen
7ae0bc7111 Keep up with lib/System changes
llvm-svn: 19057
2004-12-20 03:24:56 +00:00
Jeff Cohen
be92640355 Fix problems uncovered by VC++ (first time compiled by VC++)
llvm-svn: 19056
2004-12-20 03:23:46 +00:00
Reid Spencer
ac38f3a028 For PR351:
* Implement GetMallocUsage to get usage of malloc heap
* Implement GetMemoryUsage to get total memory usage of process
* Implement GetTimeUsage to get elapsed/user/system time

llvm-svn: 19055
2004-12-20 00:59:28 +00:00
Reid Spencer
27fa6c6d49 For PR351:
No need for Unix/SUS/Process.cpp any more, just ifdef it.

llvm-svn: 19054
2004-12-20 00:59:16 +00:00
Reid Spencer
2708881067 For PR351:
* Move system dependent implementation out of this file.
* Make implementation use sys::Process::GetMallocUsage where necessary.
* Make implementation use sys::Process::GetTimeUsage where necessary.

llvm-svn: 19053
2004-12-20 00:59:04 +00:00
Reid Spencer
8b44f87ef9 For PR351:
* Add checks for sbrk and getpagesize functions
* Alphebetize the checks for functions

llvm-svn: 19052
2004-12-20 00:59:04 +00:00
Reid Spencer
554368e4d9 For PR351:
* Add GetMallocUsage as a wrapper around mallinfo()
* Add GetTotalMemoryUsage to get approximate RSS size
* Add GetTimeUsage to get elapsed/system/user time

llvm-svn: 19051
2004-12-20 00:58:53 +00:00
Reid Spencer
47dff91dc2 Wrap long lines
llvm-svn: 19050
2004-12-20 00:58:41 +00:00
Reid Spencer
d816f9e935 For PR351:
This file is no longer needed as system dependent functions have been
encapsulated into lib/System.

llvm-svn: 19049
2004-12-20 00:58:25 +00:00
Misha Brukman
f06cb1db24 * Use "" for LLVM include files, not <>
* llvm/Config/alloca.h already #includes config.h
* Minor readability/stylistic changes

llvm-svn: 19048
2004-12-20 00:16:38 +00:00
Brian Gaeke
cb1b1e74eb Make this compile on Solaris.
llvm-svn: 19047
2004-12-19 21:08:07 +00:00
Misha Brukman
0eb431c04c Use <> for system #include files
llvm-svn: 19046
2004-12-19 19:27:11 +00:00
Brian Gaeke
8062bde121 Make references to 'struct sigaction' compile under Solaris.
llvm-svn: 19045
2004-12-19 18:58:11 +00:00
Reid Spencer
766ad0b77f For PR351:
* Support changes in sys::Program::ExecuteAndWait interface

llvm-svn: 19044
2004-12-19 18:00:56 +00:00
Reid Spencer
6cb551b279 For PR351:
Move the functionality of RunProgramWithTimeout into the ExecuteAndWait
function: support a timeout and I/O redirects

llvm-svn: 19043
2004-12-19 18:00:44 +00:00
Reid Spencer
72d1627d16 For PR351:
Add a needed include.

llvm-svn: 19042
2004-12-19 18:00:32 +00:00
Reid Spencer
2d76ff5c85 For PR351:
* Pass sys::Path instead of std::string for paths
* Correct the types of arguments passed to RunProgramWithTimeout due to its
  interface using sys::Path instead of std::string
* Replace "/dev/null" (not portable) with empty string which
  sys::Program::ExecuteAndWait recognizes as "redirect to bit bucket"

llvm-svn: 19041
2004-12-19 18:00:21 +00:00
Reid Spencer
d44f845213 For PR351:
* Remove unneeded header files.
* Move RedirectFD static function to lib/System/Unix/Program.cpp
* Delete RunProgramWithTimeout, now implemented by
  sys::Program::ExecuteAndWait. RunProgramWithTimeout is now a convenience func.

llvm-svn: 19040
2004-12-19 18:00:09 +00:00
Reid Spencer
4fea306f5e For PR351:
Incorporate the abilities of RunPRogramWithTimeout into
sys::Program::ExecuteAndWait so that redirection and a timeout are optionally
supported.

llvm-svn: 19039
2004-12-19 17:59:57 +00:00
Reid Spencer
8d3bdca1b4 For PR351:
Turn path instance variables into sys::Path instead of std::string

llvm-svn: 19038
2004-12-19 17:59:45 +00:00
Reid Spencer
fb741b2700 For PR351:
Replace RunProgramWithTimeout with an inline function that calls
sys::Program::ExecuteAndWait. This is now just a convenience function.

llvm-svn: 19037
2004-12-19 17:59:33 +00:00
Jeff Cohen
033fed0205 Add llc project to Visual Studio
llvm-svn: 19036
2004-12-19 17:53:47 +00:00
Jeff Cohen
e14dc8bb79 Add lli project to Visual Studio
llvm-svn: 19035
2004-12-19 06:40:39 +00:00
Jeff Cohen
b49205c550 Enable browse information in Visual Studio
llvm-svn: 19034
2004-12-19 02:29:00 +00:00
Jeff Cohen
45efd8df99 Improve dependency management for lib/system/win32/* files. Instead of copying the
files from win32/* to platform/*, create one line files in platform that include the
corresponding file in win32.  This makes life much more enjoyable!

The cruel irony is that NTFS has hard links just like Unix, but there's no way to
get to them from the DOS prompt!

llvm-svn: 19033
2004-12-18 08:01:43 +00:00
Jeff Cohen
ca9b7e66d0 Don't forget about release configuration...
llvm-svn: 19032
2004-12-18 07:05:59 +00:00
Jeff Cohen
c3ba60ece6 Rationalize warning suppression. First, 64-bit portability warnings are disabled. The
specific warnings they produced were being suppressed anyway.  The truncation warnings
that were suppressed are now enabled, and the few that still occur ought to be fixed.
The only warnings suppressed now are the "negating an unsigned is still unsigned", the
validity of which Chris does not accept, and the "implicit conversion of <type> to bool
performance warning".  Making the conversion explicit won't make it run any faster and
this is an easier way to shut the compiler up.

llvm-svn: 19031
2004-12-18 06:55:41 +00:00
Reid Spencer
5ababc6f33 sys::CopyFile returns void and throws an exception on error which will be
caught by llvm-ld's main function.

llvm-svn: 19030
2004-12-18 06:54:21 +00:00
Reid Spencer
8b086e3871 sys::CopyString throws an exception on error which will be caught by gccld
main function.

llvm-svn: 19029
2004-12-18 06:53:10 +00:00
Jeff Cohen
81184bb528 Fix win32 breakage
llvm-svn: 19028
2004-12-18 06:42:15 +00:00
Reid Spencer
16ce83c3a6 The CopyFile function got moved into the sys namespace.
llvm-svn: 19026
2004-12-18 00:19:32 +00:00
Reid Spencer
b3d3f1b579 Correct the name of the method. CopyFiles -> CopyFile.
llvm-svn: 19025
2004-12-18 00:14:24 +00:00
Chris Lattner
45382d34cc Remove unused enum value
llvm-svn: 19024
2004-12-17 22:41:46 +00:00
Tanya Lattner
96f6909ae1 Always print out DejagnuTest results to stdout so that it gets emailed to the nightly test manager. Eventually Dejagnu should be merged into the added/removed tests.
llvm-svn: 19023
2004-12-17 20:58:34 +00:00
Reid Spencer
181cf4ce17 Move the #include of sys/stat.h inside the linux "hack" for the stat
family of functions so it gets noticed if we ever remove this.

llvm-svn: 19022
2004-12-17 19:09:16 +00:00
Chris Lattner
227010bb31 Remove unused #include
llvm-svn: 19021
2004-12-17 19:07:04 +00:00
Reid Spencer
0575a63578 Only #include sys/stat.h if we're on linux where we have the PR274 problem.
llvm-svn: 19020
2004-12-17 18:56:29 +00:00
Chris Lattner
5e5e3f4409 Make this testcase a bit more challanging
llvm-svn: 19019
2004-12-17 17:14:00 +00:00
Chris Lattner
a12b5df616 Actually overload the virtual method. This fixes
Regression/Analysis/GlobalsModRef/purecse.ll.  Isn't this what the
-Woverload-whatever flag would warn about :)

llvm-svn: 19018
2004-12-17 17:12:24 +00:00
Chris Lattner
493cc12415 Change the test to check to see that CSE happens not dead call elim
llvm-svn: 19017
2004-12-17 17:11:41 +00:00
Chris Lattner
f953b24f4e Make code fit in 80 cols
llvm-svn: 19016
2004-12-17 17:02:54 +00:00
Reid Spencer
1abfe0d655 Reverse the logic for Win32 to ensure that bugpoint and llvm-db are NOT
built on this platform.

llvm-svn: 19015
2004-12-17 08:00:40 +00:00
Reid Spencer
120aa08e1c Fix this file to actually work. ifneq was incorrectly used. Subtract out
llvm-db and bugpoint for Win32 rather than add them in
subtr

llvm-svn: 19014
2004-12-17 07:59:53 +00:00
Reid Spencer
801643d737 Describe the new "reconfigure" and "spotless" targets.
llvm-svn: 19013
2004-12-17 07:46:45 +00:00
Reid Spencer
7ef8e66e50 Complete the implementation of the spotless rule and make it not depend on
the .. directory.

llvm-svn: 19012
2004-12-17 07:45:03 +00:00
Reid Spencer
19dd542a31 Makefile.JIT doesn't exist any more so it doesn't need to be distributed.
llvm-svn: 19009
2004-12-17 02:06:36 +00:00
Reid Spencer
0306c68c1f Disable bugpoint and llvm-db tools for Win32. They can't be supported on
that platform without a lot of work because they depend on process image
copy behavior of fork(2).

llvm-svn: 19008
2004-12-17 01:46:41 +00:00
Chris Lattner
db0bf10e4a Change the sentinal
llvm-svn: 19007
2004-12-17 00:46:51 +00:00
Chris Lattner
979b903916 Create a stack slot for the return address lazily instead of eagerly. This
save small amounts of time for functions that don't call llvm.returnaddress
or llvm.frameaddress (which is almost all functions).

llvm-svn: 19006
2004-12-17 00:07:46 +00:00
Tanya Lattner
991b5e9457 Chris is a pain ;) Removing reassociate.
llvm-svn: 19005
2004-12-16 23:16:16 +00:00
Tanya Lattner
a5528e89fd Removing commented out lines.
llvm-svn: 19004
2004-12-16 23:13:16 +00:00
Tanya Lattner
08e19bb412 Removed LICM and GCSE.
llvm-svn: 19003
2004-12-16 23:07:36 +00:00
Tanya Lattner
c3a7bd7d0c Linking in all of ScalarOpts.
llvm-svn: 19002
2004-12-16 23:07:13 +00:00
Reid Spencer
584cb0a8c1 For PR351:
* removeFile() -> sys::Path::destroyFile()
* remove extraneous toString() calls
* convert local variables representing path names from std::string to
  sys::Path
* Use sys::Path objects with FileRemove instead of std::string
* Use sys::Path methods for construction of path names

llvm-svn: 19001
2004-12-16 23:04:20 +00:00
Reid Spencer
beb9946af8 For PR351:
* Make the OutputC and OutputAsm functions work with sys::Path for the output
  file name instead of using std::string.
* Get rid of extraneous "toString" calls.
* Change "removeFile" to sys::Path::destroyFile()

llvm-svn: 19000
2004-12-16 23:01:34 +00:00
Reid Spencer
ea71e3c89b For PR351:
* Remove the "removeFile" function, now implemented by the
  sys::Path::destroyFile method.
* Make the FileRemove work with a sys::Path instead of a std::string

llvm-svn: 18999
2004-12-16 23:00:05 +00:00
Chris Lattner
867783adc4 X86 doesn't actually use SelectionDAG yet.
llvm-svn: 18996
2004-12-16 19:40:10 +00:00
Chris Lattner
eb5a2cf32b No targets actually use this library
llvm-svn: 18995
2004-12-16 19:39:45 +00:00
Chris Lattner
5a4c66cfe9 Remove dead #include
llvm-svn: 18994
2004-12-16 19:32:38 +00:00
Reid Spencer
b193ec5a13 Fix a compile error. config.h is now needed because DataTypes.h doesn't
include it any more.

llvm-svn: 18993
2004-12-16 19:19:24 +00:00
Reid Spencer
6b9c46de92 Get rid of inclusion of config.h because this file is autoconf'd.
llvm-svn: 18992
2004-12-16 18:47:17 +00:00
Reid Spencer
afdc82c259 Some minor upgrades
* Convert "cmp" usage to $(CMP)
* Convert "cp" usage to $(CP)
* Fix some build messages to reflect what's actually going on
* Add a "reconfigure" target for forcing a reconfigure. Helps with testing
  things like Chris's recent changes.

llvm-svn: 18991
2004-12-16 18:26:53 +00:00
Reid Spencer
d42d5d433f Add CMP and CP configuration variables for the unix cmp and cp programs.
llvm-svn: 18990
2004-12-16 17:48:14 +00:00
Chris Lattner
f86914daae Factor all of the .inc : .inc.tmp rules into one.
llvm-svn: 18989
2004-12-16 17:38:56 +00:00
Chris Lattner
22f937ae52 Add spaces between rule groups to make it more obvious which ones pair
Remove instrselector generation, remove Intel/ATT specifics from Makefile.rules.

llvm-svn: 18988
2004-12-16 17:34:04 +00:00
Chris Lattner
20d74fd986 Adjust to changes in asmwriter filenames
llvm-svn: 18987
2004-12-16 17:33:24 +00:00
Chris Lattner
2a02390beb When tblgen changes, regenerate all .inc files, but do not rebuild any .o
files that USE the .inc file unless the contents of the .inc file changes.

This should fix the problem where reconfiguring causes all targets to be
completely rebuilt (because config.h is usually modified, causing libsystem
to be rebuilt, causing tblgen to be rebuilt, causing .inc files to be
rebuilt, causing .o files to be rebuilt).

This patch also checks in a gross hack where .o files now explicitly depend
on $(BUILT_SOURCES), to avoid problems where the .inc files are not completely
generated before the .o files start to compile.

llvm-svn: 18986
2004-12-16 17:28:50 +00:00
Chris Lattner
a38954dd64 Specify all of the targets built.
llvm-svn: 18985
2004-12-16 17:26:44 +00:00
Chris Lattner
03227509c0 Use the rules in Makefile.rules to build SparcV9GenCodeEmitter.inc instead
of custom rules.

llvm-svn: 18984
2004-12-16 16:47:56 +00:00
Chris Lattner
0bc3333ff4 Fix header
llvm-svn: 18983
2004-12-16 16:47:03 +00:00
Chris Lattner
0782e27d85 Factor out common .td file chunks.
llvm-svn: 18982
2004-12-16 16:31:57 +00:00
Reid Spencer
5581437308 Add a "make spotless" rule for environments with BUILD_OBJ_ROOT not equal
to BUILD_OBJ_SRC. This will save the config.status and mklib files, then
wipe out the BUILD_OBJ_ROOT, copy back config.status and mklib, and then
run config.status to regenerate the makefiles. This target gives you a
completely clean/fresh BUILD_OBJ_ROOT.

llvm-svn: 18981
2004-12-16 08:00:46 +00:00
Reid Spencer
aeea3cf764 Get rid of extraneous dependencies on $(BUILT_SOURCES) now that we've fixed
the bug with BUILT_SOURCES being dependencies of the user targets.

llvm-svn: 18980
2004-12-16 07:36:08 +00:00
Reid Spencer
97e40f1eb6 Fix a major bug with BUILT_SOURCES. You actually have to dereference a
variable before you can filter its value. Duh!

llvm-svn: 18979
2004-12-16 07:15:16 +00:00
Reid Spencer
3c90f0e3ed Revert last patch which breaks PowerPC target because it fails to build
the 32bit and 64bit variants.

llvm-svn: 18978
2004-12-16 07:14:19 +00:00
Chris Lattner
56a874b0d6 Portability fix, thanks to Markus F.X.J. Oberhumer.
llvm-svn: 18977
2004-12-16 04:56:34 +00:00
Jeff Cohen
fc6ebc9cb7 Expository comment submitted by Henrik Bach
llvm-svn: 18976
2004-12-16 04:06:56 +00:00
Chris Lattner
b63ff380f1 Make %'s a bit more explicit
llvm-svn: 18975
2004-12-15 23:38:13 +00:00
Chris Lattner
298a7f8d8b Fix PR485, instead of emitting zero sized arrays, emit arrays of size 1.
llvm-svn: 18974
2004-12-15 23:13:15 +00:00
Reid Spencer
e56242780c Change the signatures of the destroyFile and destroyDirectory methods to
const because they affect the file system, not the Path object.

llvm-svn: 18973
2004-12-15 23:02:10 +00:00
Reid Spencer
e13f84b186 Adjust documentation of GetBytecodeLibraryPaths after removing LLVMGCCDIR
support from it.

llvm-svn: 18972
2004-12-15 22:49:18 +00:00
Reid Spencer
0fb34f9c12 Remove LLVMGCCDIR.
llvm-svn: 18971
2004-12-15 22:28:35 +00:00
Reid Spencer
0f6abe6b90 Remove LLVMGCCDIR from the set of defines.
llvm-svn: 18970
2004-12-15 22:27:51 +00:00
Reid Spencer
35d15bdf52 Remove the CFE's lib directory from the bytecode path because LLVM should
be agnostic to the needs of any specific FE.

llvm-svn: 18969
2004-12-15 22:22:51 +00:00
Reid Spencer
879f11df3d Remove automatic insertion of CFE's lib directory into the bytecode path
because LLVM should be agnostic to the needs of specific front ends.

llvm-svn: 18968
2004-12-15 22:21:42 +00:00
Reid Spencer
8240a916db Unbreak all archive reading operations introduced by the last patch which
always exited the program with exit code 1 in these cases, regardless of
whether an error occurred or not.

llvm-svn: 18966
2004-12-15 21:58:03 +00:00
Chris Lattner
e340065558 Add a verifier assertion
llvm-svn: 18965
2004-12-15 20:23:49 +00:00
Chris Lattner
aefd5fa18a Eliminate a virtual method call
llvm-svn: 18964
2004-12-15 18:14:04 +00:00
Chris Lattner
c0bd4b19b8 Make archive rules properly depend on llvm-ar.
llvm-svn: 18963
2004-12-15 17:14:06 +00:00
Chris Lattner
869d6a40a9 Fix a bug in -no-aa that caused two DSGraph tests to XPASS.
llvm-svn: 18962
2004-12-15 17:13:24 +00:00
Reid Spencer
98ce23ffb0 Fix a file overwrite bug in llvm-ar introduced by changes to
createTemporaryFile semantics where it doesn't create a fully unique name
if the basename doesn't exist. This functionality is now optionally
provided by the boolean reuse_current parameter to createTemporaryFile and
makeUnique. The default values differ because of the way these functions
are used in LLVM.

llvm-svn: 18961
2004-12-15 08:32:45 +00:00
Chris Lattner
5b489416c9 Disable libprofile as llvm-ar bus errors on it, and I don't want to break
the nightly testers.

llvm-svn: 18960
2004-12-15 08:15:48 +00:00
Chris Lattner
160a8a9725 Do not fail an assertion on a broken archive
llvm-svn: 18959
2004-12-15 07:44:15 +00:00
Chris Lattner
b17f3e13ec Adjust to new interfaces
llvm-svn: 18958
2004-12-15 07:22:25 +00:00
Chris Lattner
71d04bce55 Adjust to new alias analysis interfaces
llvm-svn: 18957
2004-12-15 07:22:13 +00:00
Chris Lattner
fac211f5c4 Make the AliasAnalysis interface more precise for common cases.
llvm-svn: 18956
2004-12-15 07:21:39 +00:00
Chris Lattner
e09dbe2732 Move virtual method call out of loop
llvm-svn: 18955
2004-12-15 07:04:32 +00:00
Jeff Cohen
92e02d40cb Make Win32 TimeValue::toString() re-entrant and work with mingw
llvm-svn: 18954
2004-12-15 04:28:44 +00:00
Jeff Cohen
e408341854 Fix VC++ compilation errors
llvm-svn: 18953
2004-12-15 04:08:15 +00:00
Reid Spencer
527ac0a1c7 Don't put newlines in AC macros that can't handle them!
llvm-svn: 18952
2004-12-15 04:01:48 +00:00
Reid Spencer
86960adfa3 Change LLVMGCCDIR/bytecode-libs -> LLVMGCCDIR/lib
llvm-svn: 18951
2004-12-15 01:54:37 +00:00
Reid Spencer
d8c5b71bd4 For PR351:
Remove #inclusion of Support/FileUtilities.h which isn't needed any more.

llvm-svn: 18950
2004-12-15 01:53:50 +00:00
Reid Spencer
30067f1eac For PR351:
* Convert use of getUniqueFilename to sys::Path::makeUnique();

llvm-svn: 18949
2004-12-15 01:53:08 +00:00
Reid Spencer
9329172767 For PR351:
* Remove #inclusion of FileUtilities.h, not needed any more.
* Convert getUniqueFilename -> sys::Pat::makeUnique()

llvm-svn: 18948
2004-12-15 01:51:56 +00:00
Reid Spencer
f66d93239e For PR351:
* Fix implementation and documentation about LLVMGCCDIR/bytecode-libs
* Add the makeUnique method, replacement for getUniqueFilename in Support.
* Add the sys::CopyFile function, replacement for CopyFile in Support.
* Move GetLLVMConfigDir() into generic code area since its generic.

llvm-svn: 18947
2004-12-15 01:50:13 +00:00
Reid Spencer
320a20ac45 For PR351:
Remove getUniqueFilename and CopyFile. These are now implemented by
sys::Path::makeUnique and sys::CopyFile, respectively.

llvm-svn: 18946
2004-12-15 01:46:54 +00:00
Reid Spencer
1b916e1ced Add some system specific functions we use
llvm-svn: 18945
2004-12-15 01:41:56 +00:00
Reid Spencer
360d6b71a3 Remove most references to LLVM_LIB_SEARCH_PATH. It now only exists in the
GettingStarted.html document in the environment section and only as an
optional feature.

llvm-svn: 18944
2004-12-15 00:14:01 +00:00
Reid Spencer
05d4d6026c Fix the default install directory of modules from / to $(libdir) !
Many thanks to Vladimir Merzliakov for pointing this out!

llvm-svn: 18942
2004-12-14 22:44:05 +00:00
Chris Lattner
2617b5033b Use user time, not wall time, for optimizer time.
llvm-svn: 18941
2004-12-14 22:42:59 +00:00
Reid Spencer
79e49cffb5 Correct documentation to reflect the change in location of the CFE runtime
libraries. They are now in $CFEINSTALL/lib not $CFEINSTALL/bytecode-lib.

llvm-svn: 18939
2004-12-14 22:07:29 +00:00
Chris Lattner
9ad0d55025 Constant exprs are not efficiently negatable in practice. This disables
turning X - (constantexpr) into X + (-constantexpr) among other things.

llvm-svn: 18935
2004-12-14 20:08:06 +00:00
Reid Spencer
c936ad1208 Add the getMagicNumber method.
Patch contributed by Henrik Bach. Thanks Henrik!

llvm-svn: 18933
2004-12-14 18:42:13 +00:00
Brian Gaeke
4bc39bef79 The mystery of Olden/tsp solved, and more opportunities for speedup.
llvm-svn: 18932
2004-12-14 09:10:10 +00:00
Brian Gaeke
36c14da84f Get rid of shifts by zero in most cases.
llvm-svn: 18931
2004-12-14 08:21:02 +00:00
Jeff Cohen
2b60d39499 Implement Win32 Path::getStatusInfo(), TimeValue::toString()
llvm-svn: 18930
2004-12-14 05:26:43 +00:00
Reid Spencer
eedafda7bb For PR351:
* Change ExecWait calls to sys::Program::ExecuteAndWait
* Convert to use sys::Path where it makes sense

llvm-svn: 18929
2004-12-14 04:20:08 +00:00
Reid Spencer
cdefe0aebc For PR351:
Implement the new environment pointer for ExecuteAndWait

llvm-svn: 18928
2004-12-14 04:18:51 +00:00
Reid Spencer
c2e22fea42 For PR351:
* Remove the ExecWait function. This is now in sys::Program::ExecuteAndWait

llvm-svn: 18927
2004-12-14 04:18:15 +00:00
Reid Spencer
a84c82f3bb For PR351:
* Fix commentary, wrap lines, etc.
* Add an environment pointer to the ExecuteAndWait function.

llvm-svn: 18926
2004-12-14 04:17:12 +00:00
Reid Spencer
87ad666bb3 Revert the last patch as it causes a static destruction ordering problem.
llvm-svn: 18925
2004-12-14 03:55:21 +00:00
Reid Spencer
79dc8b79bb For PR351:
Adjust to interface change for FindExecutable.

llvm-svn: 18920
2004-12-13 23:44:23 +00:00
Reid Spencer
d89ff0a5e1 For PR351:
Adjust to changes in the interface of FindExecutable, getting ToolRunner
ready for bigger things to come.

llvm-svn: 18919
2004-12-13 23:43:44 +00:00
Reid Spencer
dc49d865a1 For PR351:
* Remove isExecutable as its now implemented by sys::Path::executable
* Make FindExecutable a thin veneer over sys::Program::FindProgramByName.

llvm-svn: 18918
2004-12-13 23:41:37 +00:00
Reid Spencer
febc20eda1 For PR351:
* isExecutable -> sys::Path::executable()
* Adjust interface of FindExecutable to return a sys::Path

llvm-svn: 18917
2004-12-13 23:40:08 +00:00
Reid Spencer
b7c56070ca For PR351:
llee was a nice hack, but it wasn't portable so its gone, with Misha's
approval.  Operating systems have facilities available for making bytecode
directly executable without this utility.

llvm-svn: 18916
2004-12-13 23:15:32 +00:00
Chris Lattner
b3b1c279a2 When generating code for X86 targets, make sure the fp control word is set
to 64-bit precision, not 80 bits.

llvm-svn: 18915
2004-12-13 21:52:52 +00:00
Misha Brukman
318a44d867 Minor cleanups
llvm-svn: 18914
2004-12-13 21:42:16 +00:00
Brian Gaeke
f9639d2a74 Fix link error in PPC optimized build of 'opt'.
llvm-svn: 18913
2004-12-13 21:28:39 +00:00
Reid Spencer
e42f222d36 For PR351:
Remove AllocateRWXMemory as it is not used any more in LLVM. The function
has been replaced with sys::Memory::AllocateRWX several months ago.

llvm-svn: 18912
2004-12-13 20:14:30 +00:00
Chris Lattner
951e94e867 Add some notes
llvm-svn: 18911
2004-12-13 20:13:10 +00:00
Reid Spencer
6b8632850b For PR351:
Remove the MakeFileReadable and MakeFileExecutable functions which are no
longer present in LLVM. They have been replaced with the sys::Path methods
makeReadable and makeExecutable, respectively.

llvm-svn: 18910
2004-12-13 20:08:14 +00:00
Reid Spencer
249eb144d9 For PR351:
Replace MakeFileReadable and MakeFileExecutable (from FileUtilities) with
sys::Path::makeReadable and sys::Path:makeExecutable, respectively.

llvm-svn: 18909
2004-12-13 20:03:02 +00:00
Chris Lattner
8f430a3b59 Get rid of getSizeOf, using ConstantExpr::getSizeOf instead.
do not insert a prototype for malloc of: void* malloc(uint): on 64-bit u
targets this is not correct.  Instead of prototype it as void *malloc(...),
and pass the correct intptr_t through the "...".

Finally, fix Regression/CodeGen/SparcV9/2004-12-13-MallocCrash.ll, by not
forming constantexpr casts from pointer to uint.

llvm-svn: 18908
2004-12-13 20:00:02 +00:00
Reid Spencer
94bf2265df For PR351:
Implement three new functions to allow setting access/permission bits on
the file referenced by a path. The makeReadable and makeExecutable methods
replace the FileUtilities MakeFileReadable and MakeFileExecutable
functions. The makeWritable function is new and provided for consistency
since Path has a writable() method.

llvm-svn: 18907
2004-12-13 19:59:50 +00:00
Chris Lattner
acc4e54552 Change this method to return ulong, not uint, for 64-bit targets.
llvm-svn: 18906
2004-12-13 19:48:51 +00:00
Chris Lattner
5417117a8f New testcase that crashes the V9 backend.
llvm-svn: 18905
2004-12-13 19:10:32 +00:00
Reid Spencer
e05ab4a1ec Genericize implementation of GetDLLSuffix now that we have LTDL_SHLIB_EXT
available.

llvm-svn: 18904
2004-12-13 18:41:28 +00:00
Reid Spencer
73fc525557 For PR351:
The ReadFileIntoAddressSpace and UnmapFileFromAddressSpace functions are no
longer used by LLVM. Remove them. Replacement functionality for both
functions is now encapsulated in the sys::MappedFile class.

llvm-svn: 18903
2004-12-13 18:28:59 +00:00
Reid Spencer
cd89ca3040 For PR351:
Use sys::MappedFile instead of ReadFileIntoAddressSpace and
UnmapFileFromAddressSpace. sys::MappedFile has the nice property that it
cleans up after itself so exception handling can be removed.

llvm-svn: 18902
2004-12-13 18:25:27 +00:00
Alkis Evlogimenos
7c7705d108 Fix typo.
llvm-svn: 18901
2004-12-13 18:08:29 +00:00
Chris Lattner
2f65416429 Fix this test
llvm-svn: 18900
2004-12-13 17:53:11 +00:00
Alkis Evlogimenos
a20de02919 Add llvm tool variables.
llvm-svn: 18897
2004-12-13 17:44:14 +00:00
Reid Spencer
1a14e28ade For PR351:
* Change use of ReadFileIntoAddressSpace to sys::MappedFile use.
* Shorten a line > 80 chars.

llvm-svn: 18896
2004-12-13 17:41:13 +00:00
Chris Lattner
c97cac3d32 Set the rounding mode for the X86 FPU to 64-bits instead of 80-bits. We
don't support long double anyway, and this gives us FP results closer to
other targets.

This also speeds up 179.art from 41.4s to 18.32s, by eliminating a problem
with extra precision that causes an FP == comparison to fail (leading to
extra loop iterations).

llvm-svn: 18895
2004-12-13 17:23:11 +00:00
Reid Spencer
0afe178f21 Make the loop termination condition clear when building the set of items to
pass to the Linker::LinkInItems function.

llvm-svn: 18894
2004-12-13 17:18:19 +00:00
Reid Spencer
f51f490b7b For PR351: libLLVMSupport now depends on libLLVMSystem
llvm-svn: 18893
2004-12-13 17:02:08 +00:00
Reid Spencer
aa95684acd For PR351: \
The getFileTimestamp and getFileSize functions have been removed from  \
FileUtilities.{h,cpp}. They are replaced by Path::getTimestamp and  \
Path::getSize,respectively.

llvm-svn: 18892
2004-12-13 17:01:53 +00:00
Reid Spencer
0b4a4bf96a Added a size_type typedef to LLVM containers to make Visual Studio shut up
(and possibly to make LLVM more x86 64bit friendly).

llvm-svn: 18891
2004-12-13 16:28:53 +00:00
Reid Spencer
eb21d18b36 Add a convenience function for clearing the two global areas.
Patch contributed by Morten Ofsted.

llvm-svn: 18890
2004-12-13 16:22:32 +00:00
Reid Spencer
53bd3d0b1a Get rid of some leaks found by VC leak detector.
Patch contributed by Morten Ofsted.

llvm-svn: 18889
2004-12-13 16:04:04 +00:00
Reid Spencer
a125162bb0 Minor syntactical change to make this a little easier to comprehend.
llvm-svn: 18888
2004-12-13 09:37:41 +00:00
Reid Spencer
ff17d0439d Make use of the new Path inserter function.
llvm-svn: 18887
2004-12-13 08:53:36 +00:00
Reid Spencer
790100674a Fix a bug where "." or any single character file name doesn't get the
terminating / when setDirectory is called.

llvm-svn: 18886
2004-12-13 07:51:52 +00:00
Reid Spencer
a85abc23d5 Remove an always false clause from an if statement.
llvm-svn: 18885
2004-12-13 07:51:07 +00:00
Alkis Evlogimenos
5b1a05fb7c Fix a bug where directory names of length one or less where not set
properly (examples: "", ".", "a").

llvm-svn: 18883
2004-12-13 07:41:35 +00:00
Reid Spencer
c6de5b56a3 Use the new BYTECODE_DESTINATION to override the default bytecode install
destination for this library so that it goes to $(cferuntime_libdir) rather
than just $(libdir). Normal bytecode libraries should be installed in the
$(libdir), but these ones are "special" because they're part of the the
C/C++ front end.

llvm-svn: 18882
2004-12-13 07:40:50 +00:00
Reid Spencer
5ae8c5e5d6 More properly name bytecode_libdir cferuntime_libdir. This is only the
libdir for the CFE runtime libraries, not "all bytecode".

llvm-svn: 18881
2004-12-13 07:38:55 +00:00
Reid Spencer
efe3a82813 Finish the implementation of the BYTECODE_DESTINATION feature for modules
too and getting rid of the last remnants of bytecode_libdir.

llvm-svn: 18880
2004-12-13 07:38:07 +00:00
Reid Spencer
65086be55f Implement a new feature, BYTECODE_DESTINATION, to allow a user makefile to
specify where the bytecode library is to be installed. This allows the
default location ($prefix/lib) to be overridden, for special case runtime
libraries like the cfe runtime libs.

llvm-svn: 18879
2004-12-13 07:28:21 +00:00
Reid Spencer
0230a5eead * Add a std::ostream inserter for sys::Path
* Correct the std::string constructor to take a const reference.

llvm-svn: 18877
2004-12-13 06:57:15 +00:00
Jeff Cohen
ccd99b9b61 Fix recent breakage of win32 build
llvm-svn: 18876
2004-12-13 06:26:35 +00:00
Reid Spencer
85d55ad803 Make sure the archive doesn't have to exist before we remove it.
llvm-svn: 18873
2004-12-13 03:59:35 +00:00
Reid Spencer
72bf78d9f5 Always remove bytecode archives so that path mismatches don't cause the
contents to not be updated.

llvm-svn: 18872
2004-12-13 03:56:42 +00:00
Reid Spencer
92e97620be * Fix header block.
* Fix loop style per standards
* Don't create a new Module when the Linker's module is released.
* Add/fix function comments.

llvm-svn: 18871
2004-12-13 03:50:50 +00:00
Reid Spencer
bf63444a41 Add missing space in a comment.
llvm-svn: 18870
2004-12-13 03:23:13 +00:00
Reid Spencer
ac9fe82875 Make sure the Archive gets deleted if there's an error.
llvm-svn: 18869
2004-12-13 03:22:31 +00:00
Reid Spencer
22b7eac855 Remove commented out functions that have been replaced with lib/System
functionality.

llvm-svn: 18868
2004-12-13 03:15:47 +00:00
Reid Spencer
0005214558 Fix header and function comments.
llvm-svn: 18867
2004-12-13 03:13:18 +00:00
Reid Spencer
0a0d582719 Implement new functions per new interface
llvm-svn: 18866
2004-12-13 03:03:42 +00:00
Reid Spencer
17e7444a61 PR351: \
Use sys::Path not FileUtilities to check file types

llvm-svn: 18865
2004-12-13 03:01:26 +00:00
Reid Spencer
8d206908d8 Convert to use new Linker class interface
llvm-svn: 18864
2004-12-13 03:01:14 +00:00
Reid Spencer
0ebb926c0a LinkModules is now in the Linker class
llvm-svn: 18863
2004-12-13 03:01:03 +00:00
Reid Spencer
9b155dc4c0 For PR351: \
* Remove IsLibrary and GetLibraryPath, replaced by FindLibrary in ../Path.cpp \
* Implement GetSystemLibraryPaths and GetBytecodeLibraryPaths, instead of the \
  GetSystemLibraryPath1 and GetSystemLibraryPath2 methods

llvm-svn: 18862
2004-12-13 03:00:51 +00:00
Reid Spencer
66b8182866 For PR351: \
* Move generic isArchive method here from Unix/Path.cpp \
* Implement isDynamicLibrary \
* Implement FindLibrary for Linker

llvm-svn: 18861
2004-12-13 03:00:39 +00:00
Reid Spencer
4a23d3f8e5 This file contains basic Linker facilities needed by all tools
llvm-svn: 18860
2004-12-13 03:00:28 +00:00
Reid Spencer
c4e3153455 Make LinkModules a static member function
llvm-svn: 18859
2004-12-13 03:00:16 +00:00
Reid Spencer
9a5613962f This file contains only the Linker's library linking support
llvm-svn: 18858
2004-12-13 03:00:04 +00:00
Reid Spencer
ebd3d9f8fc For PR351: \
* Remove redundant static function LinkOneLibrary. \
* Remove unneded #includes \
* Convert FileSupport usage to sys::Path instead

llvm-svn: 18857
2004-12-13 02:59:52 +00:00
Reid Spencer
9ce11c3929 This file contains only the Linker's file linking support
llvm-svn: 18856
2004-12-13 02:59:41 +00:00
Reid Spencer
fe73bfcfdb For PR351: \
* Convert functions to Linker:: methods. \
* Remove unneeded #includes \
* Utilize sys::Path utilities not FileSupport utilities \
* Move File & Library linking functions to other source files

llvm-svn: 18855
2004-12-13 02:59:29 +00:00
Reid Spencer
3aa1f3ca4f For PR351: \
* Get file information from a MappedFile instance \
* Convert file type tests to sys::Path form

llvm-svn: 18854
2004-12-13 02:59:15 +00:00
Reid Spencer
a204547e32 Implement error handling in OpenAndLoad* functions so the Linker can handle it.
llvm-svn: 18853
2004-12-13 02:59:03 +00:00
Reid Spencer
35f16dd40b Make the size() method const
llvm-svn: 18852
2004-12-13 02:58:51 +00:00
Reid Spencer
15681d988e For PR351:\
* Modify file reading to use sys::MappedFile \
* Use sys::Path instead of std::string

llvm-svn: 18851
2004-12-13 02:58:40 +00:00
Reid Spencer
75bf03389f Add LLVMGCCDIR for path lookup
llvm-svn: 18850
2004-12-13 02:58:28 +00:00
Reid Spencer
1caba396c4 Make the OpenAndLoad functions have an ErrorMessage argument.
llvm-svn: 18849
2004-12-13 02:58:16 +00:00
Reid Spencer
2ba6854903 Completely rewrite the interface to be class based
llvm-svn: 18848
2004-12-13 02:58:05 +00:00
Reid Spencer
35105469c5 For PR351:\
* Consolidate path retrieval into just two methods. \
* Add FindLibrary as a convenience function. \
* Add isDynamicLibrary for testing for dynamic libs. \
* Make toString constant and reference clean.

llvm-svn: 18847
2004-12-13 02:57:53 +00:00
Reid Spencer
21d9ef9e82 For PR351:Remove the file type checking methods (now in sys::Path)
llvm-svn: 18846
2004-12-13 02:57:41 +00:00
Reid Spencer
ec8bc9157d Get LLVMGCCDIR into the #defines
llvm-svn: 18845
2004-12-13 02:16:51 +00:00
Brian Gaeke
cf2c1866cb Add V8 SPEC status.
llvm-svn: 18844
2004-12-13 00:27:35 +00:00
Chris Lattner
a199e3c1e2 Change indentation of a whole bunch of code, no real changes here.
llvm-svn: 18843
2004-12-12 23:49:37 +00:00
Chris Lattner
14d07db44d More substantial simplifications and speedups. This makes ADCE about 20% faster
in some cases.

llvm-svn: 18842
2004-12-12 23:40:17 +00:00
Chris Lattner
9115eb3024 More minor microoptimizations
llvm-svn: 18841
2004-12-12 22:44:30 +00:00
Chris Lattner
d4298781c1 Remove some more set operations
llvm-svn: 18840
2004-12-12 22:22:18 +00:00
Chris Lattner
a538439bf0 Reduce number of set operations.
llvm-svn: 18839
2004-12-12 22:16:13 +00:00
Chris Lattner
bf5b7cf638 Optimize div/rem + select combinations more.
In particular, implement div.ll:test10 and rem.ll:test4.

llvm-svn: 18838
2004-12-12 21:48:58 +00:00
Chris Lattner
9803a0a575 Add testcases for simple things we can handle that occur now in vortex.
llvm-svn: 18837
2004-12-12 21:40:22 +00:00
Chris Lattner
360cda5ffd Dejagnu doesn't work if you do TESTSUITE=.../
You can't pass the trailing / into Dejagnu, so make the makefile strip it off

llvm-svn: 18836
2004-12-12 21:39:49 +00:00
Chris Lattner
cbd47631ea Fix Regression/CodeGen/PowerPC/2004-12-12-ZeroSizeCommon.ll, and all programs
when compiled with debug information.

llvm-svn: 18835
2004-12-12 20:36:19 +00:00
Chris Lattner
a0dffecfbc New testcase that the PPC backend miscompiles. It is emitting
.comm _X,0

For X, which makes the linker thing that X is never defined.

llvm-svn: 18834
2004-12-12 20:34:06 +00:00
Chris Lattner
10b637eade CSE calls to getTypeSize.
llvm-svn: 18833
2004-12-12 20:31:00 +00:00
Chris Lattner
745196a5fc Properly implement copying of a global, fixing the 255.vortex & povray
failures from last night.

llvm-svn: 18832
2004-12-12 19:34:41 +00:00
Chris Lattner
88deefa303 Simplify code and do not invalidate iterators.
This fixes a crash compiling TimberWolfMC that was exposed due to recent
optimizer changes.

llvm-svn: 18831
2004-12-12 18:23:20 +00:00
Chris Lattner
17550c456c Use the target triple to pick this target.
llvm-svn: 18830
2004-12-12 17:40:28 +00:00
Chris Lattner
1adea147ba Get rid of subbullets for all of the "known problems" section. None of the
other sections have subbullets, and it make the TOC look like the whole
document is known problems!

llvm-svn: 18829
2004-12-12 17:20:23 +00:00
Brian Gaeke
23b2bc54b0 Complete the list of MultiSource failures.
llvm-svn: 18826
2004-12-12 08:22:11 +00:00
Chris Lattner
b92fd6006c Do not internalize a module if -link-as-library is passed.
llvm-svn: 18825
2004-12-12 07:53:51 +00:00
Brian Gaeke
ed9346820d hbd should be working now.
llvm-svn: 18824
2004-12-12 07:42:59 +00:00
Brian Gaeke
27358a44d1 Finally enable the setcc-branch folding code.
Also, fix a bug where ubyte 255 would sometimes be output as -1. This
was afflicting hbd.

llvm-svn: 18823
2004-12-12 07:42:58 +00:00
Brian Gaeke
e5351ad5f0 Add (currently disabled) code for canFoldSetCC
llvm-svn: 18820
2004-12-12 06:22:30 +00:00
Chris Lattner
1cbd5be7a1 Though the previous xform applies to literally dozens (hundreds?) of variables
in SPEC, the subsequent optimziations that we are after don't play with
with FP values, so disable this xform for them.  Really we just don't want
stuff like:

double G;   (always 0 or 412312.312)
  = G;

turning into:

bool G_b;
  = G_b ? 412312.312 : 0;

We'd rather just do the load.

-Chris

llvm-svn: 18819
2004-12-12 06:03:06 +00:00
Brian Gaeke
aa40b7d080 Add stubs for setcc-branch folding support.
llvm-svn: 18818
2004-12-12 06:01:26 +00:00
Chris Lattner
40e4cec9ee If a variable can only hold two values, and is not already a bool, shrink it
down to actually BE a bool.  This allows simple value range propagation
stuff work harder, deleting comparisons in bzip2 in some hot loops.

This implements GlobalOpt/integer-bool.ll, which is the essence of the
loop condition distilled into a testcase.

llvm-svn: 18817
2004-12-12 05:53:50 +00:00
Chris Lattner
17fbc80f31 New testcase. Shrinking the variable to a bool allows instcombine to delete
the condition.

llvm-svn: 18816
2004-12-12 05:52:12 +00:00
Chris Lattner
cbc0161d1f If one side of and/or is known to be 0/-1, it doesn't matter
if the other side is overdefined.

This allows us to fold conditions like:  if (X < Y || Y > Z) in some cases.

llvm-svn: 18807
2004-12-11 23:15:19 +00:00
Chris Lattner
2c14b32e2b New testcase. If one side of and/or is known to be 0/-1, it doesn't matter
if the other side is overdefined.

llvm-svn: 18806
2004-12-11 23:14:40 +00:00
Brian Gaeke
25ac83565e Print llvm code one function at a time.
llvm-svn: 18805
2004-12-11 22:17:07 +00:00
Chris Lattner
8d0b1b2a82 Check in the file I forgot last night, to solve all of the crashes in every
test in the suite.  :(

llvm-svn: 18804
2004-12-11 22:10:29 +00:00
Brian Gaeke
72daaa46eb JIT should print LLVM each function before selecting instructions for it.
llvm-svn: 18803
2004-12-11 18:41:09 +00:00
Reid Spencer
5625dec232 Rename Path::get -> Path::toString
llvm-svn: 18802
2004-12-11 17:37:01 +00:00
Chris Lattner
cc6037f8e6 Update test
llvm-svn: 18801
2004-12-11 17:13:19 +00:00
Chris Lattner
263b0a1669 Only cound if we actually made a change.
llvm-svn: 18800
2004-12-11 17:00:14 +00:00
Chris Lattner
ffefea0772 The split bb is really the exit of the old function
llvm-svn: 18799
2004-12-11 16:59:54 +00:00
Reid Spencer
8f72ce0fd2 A little cleanup on this file.
llvm-svn: 18798
2004-12-11 07:16:54 +00:00
Chris Lattner
7bf2e54dc2 New feature
llvm-svn: 18797
2004-12-11 06:10:52 +00:00
Chris Lattner
2f687fd9d6 Two bug fixes:
1. Actually increment the Statistic for the GV elim optzn
 2. When resolving undef branches, only resolve branches in executable blocks,
    avoiding marking a bunch of completely dead blocks live.  This has a big
    impact on the quality of the generated code.

With this patch, we positively rip up vortex, compiling Ut_MoveBytes to a
single memcpy call. In vortex we get this:

     12 ipsccp           - Number of globals found to be constant
    986 ipsccp           - Number of arguments constant propagated
   1378 ipsccp           - Number of basic blocks unreachable
   8919 ipsccp           - Number of instructions removed

llvm-svn: 18796
2004-12-11 06:05:53 +00:00
Chris Lattner
8525ebe465 Do not delete the entry block to a function.
llvm-svn: 18795
2004-12-11 05:32:19 +00:00
Brian Gaeke
b3095dd88f Bools are *also* not ints. Sigh. Furthermore, most of the TargetMachine
ctor parameters can be defaulted.

Print the transformed llvm code input to the instruction selector
when -print-machineinstrs is on, just like V9.

llvm-svn: 18794
2004-12-11 05:19:04 +00:00
Brian Gaeke
ba5e9f107c Look for many more moves to fold (previously, we only
*or g0, x      add g0, x          recognized * as a move)
 or  x, g0     add  x, g0
 or  0, x      add  0, x
 or  x, 0      add  x, 0

llvm-svn: 18793
2004-12-11 05:19:03 +00:00
Brian Gaeke
52a9ed63b5 Make GEPs not suck so much:
* Don't emit the Index * ElementSize multiply if Index is a constant.
* Use a shift, not a multiply, if ElementSize is 1/2/4/8.
* If ElementSize fits in the immediate field of SMUL, then put it there.

Fix a bug where struct offsets might be truncated (ConstantSInt::get is
now used instead of ConstantInt::get).

llvm-svn: 18792
2004-12-11 05:19:02 +00:00
Brian Gaeke
cba3135ba8 Update lists of failing benchmarks, including info on which
ones are failing in cbe.

llvm-svn: 18791
2004-12-11 05:19:01 +00:00
Chris Lattner
91dbae6fee Implement Transforms/SCCP/ipsccp-gvar.ll, by tracking values stored to
non-address-taken global variables.

llvm-svn: 18790
2004-12-11 05:15:59 +00:00
Chris Lattner
01bd4624c4 New testcase that ipsccp should handle.
llvm-svn: 18789
2004-12-11 05:14:55 +00:00
Reid Spencer
a179968c4e Fix some minor spellos and grammaros.
llvm-svn: 18788
2004-12-11 05:12:57 +00:00
Reid Spencer
d58e09a275 Revert the last patch. We really do need SimplyCFG.
llvm-svn: 18787
2004-12-11 03:03:54 +00:00
Chris Lattner
99e1295645 Fix a bug where we could delete dead invoke instructions with uses.
In functions where we fully constant prop the return value, replace all
ret instructions with 'ret undef'.

llvm-svn: 18786
2004-12-11 02:53:57 +00:00
Reid Spencer
5ccfd5a48b Path::get -> Path::toString
llvm-svn: 18785
2004-12-11 00:14:15 +00:00
Reid Spencer
eef4420578 Remove this pass as its no longer needed.
llvm-svn: 18783
2004-12-10 22:55:35 +00:00
Chris Lattner
dea2bde08f This pass is no longer needed.
llvm-svn: 18782
2004-12-10 22:30:32 +00:00
Chris Lattner
bae4b64553 Implement SCCP/ipsccp-conditional.ll, by totally deleting dead blocks.
llvm-svn: 18781
2004-12-10 22:29:08 +00:00
Chris Lattner
f92cc45975 New testcase
llvm-svn: 18780
2004-12-10 22:28:49 +00:00
Reid Spencer
2da81ceb3d Get rid of warning from flex.
llvm-svn: 18779
2004-12-10 21:59:47 +00:00
Chris Lattner
7285f43836 Fix SCCP/2004-12-10-UndefBranchBug.ll
llvm-svn: 18776
2004-12-10 20:41:50 +00:00
Chris Lattner
45c6251140 Add missing accessor.
llvm-svn: 18775
2004-12-10 20:35:47 +00:00
Chris Lattner
b7f5916e01 Make sure to link the target-triple as well, so it ends up in the .llvm.bc file
llvm-svn: 18774
2004-12-10 20:26:15 +00:00
Chris Lattner
9e8141fb3e New testcase that SCCP miscompiles. Luckily this is extremely unlikely to
happen in practice, but IP-SCCP can trigger it.

llvm-svn: 18773
2004-12-10 20:10:23 +00:00
Reid Spencer
993b95e796 Fix output for Flexing to not print full path of source.
llvm-svn: 18769
2004-12-10 19:44:16 +00:00
Chris Lattner
f13b7ee8aa Check in the right test
llvm-svn: 18767
2004-12-10 17:43:43 +00:00
Chris Lattner
4fc998da2e Fix Regression/Transforms/SimplifyCFG/2004-12-10-SimplifyCFGCrash.ll,
and the failure on make_dparser last night.

llvm-svn: 18766
2004-12-10 17:42:31 +00:00
Chris Lattner
88bd77c73d New testcase for a bug exposed by the ipsccp pass, causing dparser to fail
last night.

llvm-svn: 18765
2004-12-10 17:41:43 +00:00
Chris Lattner
7c0241ce9b Fix typo
llvm-svn: 18764
2004-12-10 16:27:34 +00:00
John Criswell
dfe6a86b0b Merged in RELEASE_14 changes.
llvm-svn: 18763
2004-12-10 15:51:16 +00:00
Brian Gaeke
2e2f3e26ba Move -lowerselect later in the chain; some select instructions were
slipping through into the instruction selector, which can't deal with
them yet.

llvm-svn: 18758
2004-12-10 08:39:30 +00:00
Brian Gaeke
2ccff7c256 Add the rest of the multiply instructions.
llvm-svn: 18757
2004-12-10 08:39:29 +00:00
Brian Gaeke
4bfd3f7c98 Support binary operations with immediates for <= cInt.
llvm-svn: 18756
2004-12-10 08:39:28 +00:00
Brian Gaeke
428037be05 Update lists of failing benchmarks (except C++...something is the
matter with my sparcv8 libstdc++.a) and to-do list.

llvm-svn: 18755
2004-12-10 08:39:27 +00:00
Chris Lattner
4a03a2d433 Turn on ipsccp by default instead of simple IPCP
llvm-svn: 18753
2004-12-10 08:03:43 +00:00
Chris Lattner
b439464c61 This is the initial implementation of IPSCCP, as requested by Brian.
This implements SCCP/ipsccp-basic.ll, rips apart Olden/mst (as described in
PR415), and does other nice things.

There is still more to come with this, but it's a start.

llvm-svn: 18752
2004-12-10 08:02:06 +00:00
Chris Lattner
3b33c7a3c6 New prototype
llvm-svn: 18751
2004-12-10 07:55:01 +00:00
Chris Lattner
c2965a6d0e New testcase
llvm-svn: 18750
2004-12-10 07:54:51 +00:00
Brian Gaeke
81c7fd2fce Emit correct prototype for __builtin_alloca on V8.
llvm-svn: 18745
2004-12-10 05:44:45 +00:00
Alkis Evlogimenos
991d6ad208 Fix writer to properly quote label names when they don't contain
simple characters.

llvm-svn: 18744
2004-12-10 05:41:10 +00:00
Alkis Evlogimenos
a93b4520a7 Do not allow empty label names.
llvm-svn: 18743
2004-12-10 05:40:19 +00:00
Alkis Evlogimenos
5b9754bd48 Update testcase
llvm-svn: 18742
2004-12-10 05:39:57 +00:00
Chris Lattner
fcec9d6dec Implement test/Feature/escaped_label.ll
llvm-svn: 18741
2004-12-10 05:27:29 +00:00
Chris Lattner
dfabbb29f2 Simple testcase for quoted label.
llvm-svn: 18740
2004-12-10 05:27:14 +00:00
Brian Gaeke
af10b76b6c Link V8 backend into llc.
llvm-svn: 18739
2004-12-10 05:04:13 +00:00
Brian Gaeke
836727ea84 Add SparcV8 target back into the build
llvm-svn: 18738
2004-12-10 04:54:21 +00:00
Brian Gaeke
1d0fe16906 Adjust paths: Sparc/V8 --> SparcV8
llvm-svn: 18737
2004-12-10 04:48:57 +00:00
Brian Gaeke
a14476c9bf Make this file self-contained.
llvm-svn: 18736
2004-12-10 04:46:30 +00:00
Brian Gaeke
cb3b98586d Update list of failing MultiSource benchmarks. It works out to +5 -5, but I
think some of these might be the CFE's fault; a rebuild should come soon.

llvm-svn: 18735
2004-12-10 04:42:46 +00:00
Brian Gaeke
5183f22a64 When FpMOVDs appeared in pairs, we were mistakenly skipping over the latter of
each pair. I think this fixes that.

One of these days, I swear I'm going to get the hang of C++ iterators.
Really.

llvm-svn: 18734
2004-12-10 04:42:45 +00:00
Misha Brukman
61cf9c8811 Missed moving bugpoint link over to CommandGuide/html/
llvm-svn: 18732
2004-12-09 23:28:09 +00:00
Misha Brukman
4f1f92e323 Generated HTML documentation is now back in CommandGuide/html/
llvm-svn: 18731
2004-12-09 23:25:59 +00:00
Chris Lattner
f3a7c24617 Rip out the guts of this document to prepare it for LLVM 1.5 progress
llvm-svn: 18726
2004-12-09 22:22:58 +00:00
Chris Lattner
0793bfc457 Clean up this man page
llvm-svn: 18724
2004-12-09 21:16:40 +00:00
Chris Lattner
6e8183063f Add new pseudo target
llvm-svn: 18723
2004-12-09 21:06:32 +00:00
Misha Brukman
32f139a169 The textual description is gone from this manpage, only the options and a quick
summary remain.  The manpage references Bugpoint.html as the repository for more
detailed info.

llvm-svn: 18722
2004-12-09 20:28:42 +00:00
Misha Brukman
cda6a9b9eb * Straighten a comment to a single line
* Block off the section correctly with <!-- ***** -->

llvm-svn: 18721
2004-12-09 20:27:37 +00:00
Misha Brukman
f4315374aa We now have a real Bugpoint doc, not just a huge man page.
llvm-svn: 18720
2004-12-09 20:26:53 +00:00
Misha Brukman
a078d57848 Convert from being a copy of the man page to a full-fledged document.
This doc keeps all the descriptive info from the man page, but not the options.

llvm-svn: 18719
2004-12-09 20:26:20 +00:00
Brian Gaeke
34f7c3d37a We're continuing to make progress on MultiSource.
llvm-svn: 18714
2004-12-09 18:54:31 +00:00
Brian Gaeke
847c05deef Bytes and shorts are aligned differently from words.
llvm-svn: 18713
2004-12-09 18:51:02 +00:00
Brian Gaeke
bac69b7df9 Fix asm-printing directives (how did we not see this before...apparently,
everything was an int!)

llvm-svn: 18712
2004-12-09 18:51:01 +00:00
Reid Spencer
641f5c9878 More grammaro's fixed.
llvm-svn: 18708
2004-12-09 18:13:12 +00:00
Reid Spencer
8f08d805d4 Clean up some grammaro's.
llvm-svn: 18705
2004-12-09 18:02:53 +00:00
Reid Spencer
098fce4727 Correct the version numbers for automake, Perl, and CVS.
llvm-svn: 18703
2004-12-09 17:55:37 +00:00
Chris Lattner
74d3f82b6e Fully document the LLVM constants. This should go into LLVM 1.4
llvm-svn: 18701
2004-12-09 17:30:23 +00:00
Chris Lattner
d79749a110 Reflow and clean up some of the HTML in the initial section, split linkage
types into its own section.

llvm-svn: 18697
2004-12-09 16:36:40 +00:00
Chris Lattner
6af02f3961 Move the "High Level Structure" to before "Type System"
llvm-svn: 18695
2004-12-09 16:11:40 +00:00
Reid Spencer
09e39d17d1 More QMTest cruft gone!
llvm-svn: 18694
2004-12-09 07:43:06 +00:00
Chris Lattner
36d39cecb4 note to self: Do not check in debugging code!
llvm-svn: 18693
2004-12-09 07:15:52 +00:00
Chris Lattner
f17a2fb849 Implement trivial sinking for load instructions. This causes us to sink 567 loads in spec
llvm-svn: 18692
2004-12-09 07:14:34 +00:00
Chris Lattner
6225146f20 Remove a dead field, make the map go to integer type ID to hash better and
avoid a getType.

llvm-svn: 18691
2004-12-09 06:19:44 +00:00
Jeff Cohen
07a900f0b7 Fix residual Visual Studio build problems
llvm-svn: 18688
2004-12-09 05:51:11 +00:00
Test Commit
ecf3c41054 Test commit
llvm-svn: 18687
2004-12-09 05:46:48 +00:00
Chris Lattner
2cdf54c0f0 Remove #include inadvertently added
llvm-svn: 18686
2004-12-09 04:53:17 +00:00
Chris Lattner
e44907012a Eliminate this ugly hack. This was put back in when replaceAllUsesOf used
a different algorithm that was extremely inefficient for instructions with
many operands.

This reduces the time of this code snippet from .23s for 176.gcc to 0.03s
in a debug build, which speeds up total llvm-dis time just barely.

It's more of a code cleanup than a speedup.

llvm-svn: 18685
2004-12-09 04:51:50 +00:00
Alkis Evlogimenos
346ee4c9fb Add testcase and fix for yet another case where we query the size an
abstract type.

llvm-svn: 18678
2004-12-08 23:56:15 +00:00
Chris Lattner
39c98bb31c Do extremely simple sinking of instructions when they are only used in a
successor block.  This turns cases like this:

x = a op b
if (c) {
  use x
}

into:

if (c) {
  x = a op b
  use x
}

This triggers 3965 times in spec, and is tested by
Regression/Transforms/InstCombine/sink_instruction.ll

This appears to expose a bug in the X86 backend for 177.mesa, which I'm
looking in to.

llvm-svn: 18677
2004-12-08 23:43:58 +00:00
Alkis Evlogimenos
b1ff6d7921 Add testcase and fix for another case where we query the size an
abstract type.

llvm-svn: 18676
2004-12-08 23:42:11 +00:00
Chris Lattner
8665367885 new testcase
llvm-svn: 18675
2004-12-08 23:41:16 +00:00
Alkis Evlogimenos
a1291a0679 Fix this regression and remove the XFAIL from this test.
llvm-svn: 18674
2004-12-08 23:10:30 +00:00
Reid Spencer
ca06c8e851 Remove last remnants of Python/QMTest support
llvm-svn: 18672
2004-12-08 23:07:27 +00:00
Reid Spencer
4e197480e1 Implement the LLVM_DO_NOT_BUILD feature. If a file of that name is
present in a directory that LLVM normally builds, it will skip building
the directory entirely. This is useful for allowing a bunch of projects to
live in the source tree but not be compiled from time to time.

llvm-svn: 18671
2004-12-08 22:58:34 +00:00
Chris Lattner
8f30caf549 Fix Transforms/InstCombine/2004-12-08-RemInfiniteLoop.ll
llvm-svn: 18670
2004-12-08 22:20:34 +00:00
Chris Lattner
ace35e9be6 This testcase causes the instruction combiner to go spiraling into
an infinite loop.

llvm-svn: 18669
2004-12-08 22:18:35 +00:00
Chris Lattner
f14c40dc57 Move method out of line
llvm-svn: 18666
2004-12-08 21:04:10 +00:00
Chris Lattner
5a0680245f Move method out of line for better ICC support
Add some ifdefs for some stuff I like to be able to toggle easily

llvm-svn: 18665
2004-12-08 21:03:56 +00:00
Chris Lattner
8351112192 Properly extern this.
llvm-svn: 18664
2004-12-08 21:00:59 +00:00
Chris Lattner
3e4445cd03 Define the pointer hash struct before the string one, to improve compatibility
with ICC.  Patch contributed by Bjørn Wennberg.

llvm-svn: 18663
2004-12-08 20:59:18 +00:00
John Criswell
6430772035 The noreturn GCC extension is now supported.
Fixed some minor typos.

llvm-svn: 18658
2004-12-08 20:35:47 +00:00
Chris Lattner
630729c97e Turn this error back into a warning, fixing the povray regression
llvm-svn: 18655
2004-12-08 20:01:10 +00:00
Chris Lattner
292e6602ac Test commit
llvm-svn: 18654
2004-12-08 19:05:44 +00:00
Reid Spencer
0601d01f43 Build the man and ps versions of the command guide as well when
BUILD_FOR_WEBSITE is set.

llvm-svn: 18653
2004-12-08 19:01:01 +00:00
Chris Lattner
923737fcff ignore generated file
llvm-svn: 18652
2004-12-08 19:00:45 +00:00
Alkis Evlogimenos
84d060ae7a Mark this as an XFAIL until a fix is worked out.
llvm-svn: 18651
2004-12-08 18:43:39 +00:00
Tanya Lattner
0e6622157a Fixed broken link to Bruce Eckle's book.
llvm-svn: 18650
2004-12-08 18:34:56 +00:00
Tanya Lattner
7591b82df6 Fixed a broken link to gcc manual.
llvm-svn: 18649
2004-12-08 18:29:38 +00:00
Tanya Lattner
6337134822 Fixed broken link.
llvm-svn: 18648
2004-12-08 18:25:34 +00:00
Tanya Lattner
9d2df71d38 Fixed broken links.
llvm-svn: 18647
2004-12-08 18:13:51 +00:00
John Criswell
945f80273f Mention in the exposition that lli can JIT on PowerPC now.
llvm-svn: 18646
2004-12-08 18:04:14 +00:00
John Criswell
ba739a8e56 We don't have python test classes anymore.
llvm-svn: 18645
2004-12-08 18:01:27 +00:00
Reid Spencer
92815e5483 Add llvm-ld tool
Note that both llvmc and llvm-ld are experimental in 1.4

llvm-svn: 18644
2004-12-08 18:00:30 +00:00
John Criswell
6ab273c032 Minor fixups.
llvm-svn: 18643
2004-12-08 17:53:54 +00:00
Tanya Lattner
d8697049e3 Fixed typo in Dejagnu section.
llvm-svn: 18642
2004-12-08 17:37:21 +00:00
Tanya Lattner
9a1b8935d6 Removed QMTest reference.
llvm-svn: 18641
2004-12-08 17:35:31 +00:00
Tanya Lattner
e6ebbd70ca Removed QMTest reference.
llvm-svn: 18640
2004-12-08 17:25:46 +00:00
Tanya Lattner
c31724bfe2 Removed QMTest referrences. Updated ordering of notes.
llvm-svn: 18639
2004-12-08 17:12:52 +00:00
John Criswell
33e0f06258 Fix spell'os.
llvm-svn: 18638
2004-12-08 16:55:27 +00:00
Reid Spencer
cce6755360 Move documentation for various configuration options applicabe only to the
llvm-test directory into this document from GettingStarted.html.

llvm-svn: 18637
2004-12-08 16:52:51 +00:00
Reid Spencer
dfcf790d28 Various 1.4ish corrections and additions.
llvm-svn: 18636
2004-12-08 16:51:31 +00:00
John Criswell
c8808f57dc Update the version numbers of the pre-built LLVM GCC frontends.
llvm-svn: 18635
2004-12-08 16:47:14 +00:00
John Criswell
241011e6b0 Fix llvmgcc to use the TestRunner substition mechanism.
llvm-svn: 18634
2004-12-08 16:41:34 +00:00
John Criswell
02fa673e6f xfail this across all platforms.
llvm-svn: 18633
2004-12-08 16:31:06 +00:00
Reid Spencer
3991dce79e * Change version numbers of tarballs from 1.3 to 1.4
* Add llvm-test-1.4.tar.gz as the tarball for the llvm-test module
* Highlight the tarball name a little.

llvm-svn: 18632
2004-12-08 16:25:25 +00:00
Chris Lattner
1c539a86c9 Work correctly with MSVC and ICC, patch contributed by Bjørn Wennberg
llvm-svn: 18631
2004-12-08 16:22:48 +00:00
Chris Lattner
d349d4a49c Work correctly with ICC, Patch contributed by Bjørn Wennberg
llvm-svn: 18630
2004-12-08 16:22:26 +00:00
Reid Spencer
5be4f0490f Add descriptions of missing top level directories.
llvm-svn: 18629
2004-12-08 16:18:26 +00:00
Chris Lattner
4270bcbab7 Add support for compilers with arg dependent name lookup, contributed by
Bjørn Wennberg

llvm-svn: 18628
2004-12-08 16:13:53 +00:00
Chris Lattner
674ce86cd0 Add support for compilers without argument dependent name lookup, contributed
by Bjørn Wennberg

llvm-svn: 18627
2004-12-08 16:12:20 +00:00
Chris Lattner
6ef473f53c Make this work with the ICC compiler, contributed by Bjørn Wennberg
llvm-svn: 18626
2004-12-08 16:10:52 +00:00
Chris Lattner
407000c497 Remove unneeded class qualifier, contributed by Bjørn Wennberg
llvm-svn: 18625
2004-12-08 16:05:02 +00:00
Alkis Evlogimenos
148215f758 Add regression
llvm-svn: 18624
2004-12-08 07:25:10 +00:00
Reid Spencer
359df30f3d When -link-as-library, add -l options to Module's deplibs
llvm-svn: 18617
2004-12-08 05:17:40 +00:00
Reid Spencer
8f59e90cef Make an alternate version of this Makefile that can be used in an
unconfigured tree for rebuilding the html files from POD sources for the
website update on cvs commit.

llvm-svn: 18616
2004-12-08 04:43:40 +00:00
Reid Spencer
cd7d6cf6a6 Remove -Woverloaded-virtual usage that was committed by accident.
llvm-svn: 18615
2004-12-08 04:34:51 +00:00
Reid Spencer
cc52c2ce8a Remove variables that are not used by any of the LLVM makefiles
llvm-svn: 18614
2004-12-08 04:26:23 +00:00
Reid Spencer
6838b3c245 Remove useless -L switch now that gccld -link-as-library bug is fixed.
llvm-svn: 18613
2004-12-08 04:22:47 +00:00
Alkis Evlogimenos
ca6a649c9d Use getOperand() and remove getElementAt() function.
llvm-svn: 18612
2004-12-08 03:45:20 +00:00
Chris Lattner
db38fe94ae Revert this disgusting hack, John has a much nicer solution
llvm-svn: 18611
2004-12-08 03:31:14 +00:00
Chris Lattner
79a993ea0d Add a disgusting hack to work around a libstdc++ issue. This code should
be removed when PR400 is resolved.

llvm-svn: 18610
2004-12-08 03:28:51 +00:00
Chris Lattner
040c3868b3 This test is xfail right now, to keep DJ clean, also mention the PR# in testcases.
llvm-svn: 18609
2004-12-08 02:25:32 +00:00
Reid Spencer
55684c3b26 * Eliminate redundancies
* Fix grammaro's
* HTML 4.01 Strict compliance

llvm-svn: 18604
2004-12-07 08:39:08 +00:00
Reid Spencer
9273d480ad For PR387:\
Add doInitialization method to avoid overloaded virtuals

llvm-svn: 18602
2004-12-07 08:11:36 +00:00
Reid Spencer
5c132bc3af For PR387:\
Add getModRefInfo method to avoid overloaded virtuals

llvm-svn: 18601
2004-12-07 08:11:24 +00:00
Reid Spencer
c332610d52 For PR387:\
Add runPass methods to remove -Woverloaded-virtual warnings are not \
present and circumvent possible inheritance bugs.

llvm-svn: 18600
2004-12-07 08:11:11 +00:00
Chris Lattner
b5bb597405 Commit the cleanup of the LLVM 1.4 release notes. This should clearly go
into the release :)

llvm-svn: 18599
2004-12-07 08:04:13 +00:00
Reid Spencer
b95f8ab3ef Revert the recent patches to "fix" ConstantFP::isValueValidForType. None
of them seem to work everywhere.

llvm-svn: 18598
2004-12-07 07:38:08 +00:00
Reid Spencer
ae056bdd36 Provide a missing header file.
llvm-svn: 18597
2004-12-07 07:08:08 +00:00
Reid Spencer
744d95e8c7 Fix some comments.
llvm-svn: 18596
2004-12-07 07:06:47 +00:00
Alkis Evlogimenos
2b91842092 Fix check for valid floats. Also use and HUGE_VALF instead
of std::numeric_limits, because they work in more platforms.

llvm-svn: 18593
2004-12-07 06:46:50 +00:00
Nate Begeman
784a0dcbd0 Move virtual function call out of loop to speed up getFreePhysReg by about
20%, shaving 0.1s off hbd compile time on my g5.  Yay.

llvm-svn: 18592
2004-12-07 05:25:53 +00:00
Reid Spencer
9083936835 For PR387:\
Make only one print method to avoid overloaded virtual warnings when \
compiled with -Woverloaded-virtual

llvm-svn: 18589
2004-12-07 04:03:45 +00:00
Reid Spencer
1c48c2deee For PR387:
Make this compile without warning when -Woverloaded-virtual is used.

llvm-svn: 18588
2004-12-06 23:42:37 +00:00
Reid Spencer
2ea2100e9d PR409 fixed.
llvm-svn: 18586
2004-12-06 22:32:33 +00:00
Reid Spencer
a8288d93ae For PR409: \
Test the range of float constants to ensure we are not attempting to create a \
float constant using a double value that is out of range for a float

llvm-svn: 18585
2004-12-06 22:18:37 +00:00
Reid Spencer
95044d0071 For PR409: \
Make sure to check isValueValidForType on floating point constants and give \
an error if the value is not valid, otherwise it would assert in the VMCore

llvm-svn: 18584
2004-12-06 22:18:25 +00:00
John Criswell
ff845b4f96 This test still fails on Darwin and Sparc/Solaris.
llvm-svn: 18583
2004-12-06 22:05:02 +00:00
Reid Spencer
10afebddcc Test case for PR409:
Make sure that floating point constant values outside the range of a float
cannot be assigned to a constant.

llvm-svn: 18582
2004-12-06 21:57:59 +00:00
John Criswell
b2249635ae Remove the last pieces of QMTest.
llvm-svn: 18581
2004-12-06 21:35:32 +00:00
Reid Spencer
46f5c4f214 Revert previous changes to remove -enable-linscan and the *BETA columns of
the nightly test. These are still needed for iterative linear scan testing.

llvm-svn: 18577
2004-12-06 20:14:45 +00:00
Reid Spencer
ecec7939bc Rather than break all the nightly test invocations, permit -enable-linscan
option to be specified, but do nothing with it.

llvm-svn: 18575
2004-12-06 18:33:54 +00:00
Reid Spencer
1443c4f039 Remove LLC-BETA and linear scan options as they are no longer reported.
llvm-svn: 18574
2004-12-06 18:29:14 +00:00
Reid Spencer
ca1baad120 Change check to check-local per Makefile.rules changes.
llvm-svn: 18568
2004-12-06 05:35:38 +00:00
Reid Spencer
3f5ed7b1f7 Upgrade documentation to reflect Makefile.rules changes.
llvm-svn: 18567
2004-12-06 05:35:25 +00:00
Reid Spencer
8b5ebe561e Add the check target so all projects can have this
functionality.

llvm-svn: 18566
2004-12-06 05:35:13 +00:00
Reid Spencer
876ae54f63 Remove the check target. Its now in Makefile.rules
llvm-svn: 18565
2004-12-06 05:35:00 +00:00
Tanya Lattner
4d69018fe9 Added DejaGNU information to the testing guide. This should go into the 1.4 release.
I left the QMTest stuff in place but made it appear to be optional.

llvm-svn: 18564
2004-12-06 02:11:52 +00:00
Reid Spencer
ffcf42329a PR139 fixed.
llvm-svn: 18551
2004-12-05 20:19:45 +00:00
Alkis Evlogimenos
75a93f23b3 Add accessors for Constants in a ConstantStruct.
llvm-svn: 18550
2004-12-05 20:09:18 +00:00
Reid Spencer
ef96665753 Fix PR139:\
When not linking as a library, use LinkItems to retain command line order of \
linking, otherwise use LinkFiles

llvm-svn: 18549
2004-12-05 19:15:29 +00:00
Reid Spencer
9f1cf33a54 Make use of the LLVMGCCStdCXXLibDir variable to link objects
llvm-svn: 18548
2004-12-05 19:15:06 +00:00
Reid Spencer
1014afc7ea Fix PR139: \
Implement LinkItems and BuildLinkItems interfaces.

llvm-svn: 18547
2004-12-05 19:14:55 +00:00
Reid Spencer
a3df351820 Fix PR139: \
Add support for ordered linking with the LinkItems function

llvm-svn: 18546
2004-12-05 19:14:43 +00:00
Reid Spencer
e96b620570 Describe the MODULE_NAME control variable
llvm-svn: 18545
2004-12-05 19:14:31 +00:00
Reid Spencer
6d6503a9b3 Provide a variable to compute where the libstdc++.a is
llvm-svn: 18544
2004-12-05 19:14:19 +00:00
Chris Lattner
db332473fa Suggest people run cvs up -P -d after checking out the tree so they don't
get empty directories

llvm-svn: 18543
2004-12-05 17:48:03 +00:00
Chris Lattner
a34f9da4b4 Properly implement a fix for PR475
llvm-svn: 18537
2004-12-05 07:19:16 +00:00
Chris Lattner
cc6d1928d2 Make this test actually capable of passing.
llvm-svn: 18536
2004-12-05 07:15:21 +00:00
Chris Lattner
1a0117f641 Revert this patch, it broke a ton of programs.
llvm-svn: 18535
2004-12-05 06:59:59 +00:00
Chris Lattner
f878f75d46 Move lower intrinsics before FP constant emission, in case
intrinsic lowering ever introduces constants.

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

llvm-svn: 18534
2004-12-05 06:49:44 +00:00
Chris Lattner
fa171f11b8 Change this test to not require execution of the program.
llvm-svn: 18533
2004-12-05 06:45:30 +00:00
Chris Lattner
97e36f211b When printing out a function, make sure that local and global symbols
don't conflict.  This fixes Assembler/2004-12-05-LocalGlobalSymtabConflict.ll

llvm-svn: 18532
2004-12-05 06:44:09 +00:00
Chris Lattner
b392d30761 Add a new method
llvm-svn: 18531
2004-12-05 06:43:27 +00:00
Chris Lattner
0ba8f4e191 Fix typeo
llvm-svn: 18530
2004-12-05 06:33:15 +00:00
Chris Lattner
a6086ef48d New testcase for the bug affecting 255.vortex in CBE mode.
llvm-svn: 18529
2004-12-05 06:18:35 +00:00
Reid Spencer
cceae4217f Correct build script for stkr_runtime module
llvm-svn: 18526
2004-12-05 05:18:28 +00:00
Reid Spencer
d8d9fb325f Build a module instead of a library so main() is not missed
llvm-svn: 18525
2004-12-05 05:18:16 +00:00
Reid Spencer
107f576732 Make a const method const
llvm-svn: 18524
2004-12-05 05:17:34 +00:00
Reid Spencer
d78077dd13 Add ability to make a single bytecode module from others
llvm-svn: 18523
2004-12-05 05:17:22 +00:00
Alkis Evlogimenos
7527cd53fa Remove unneeded code
llvm-svn: 18516
2004-12-05 02:03:16 +00:00
Alkis Evlogimenos
8c5affedd1 Fix PR475.
llvm-svn: 18515
2004-12-05 01:51:20 +00:00
Alkis Evlogimenos
a90f19621b Match codegen string better
llvm-svn: 18514
2004-12-05 01:50:32 +00:00
Alkis Evlogimenos
58355ab372 Add testcast for bug475
llvm-svn: 18513
2004-12-05 01:44:46 +00:00
Chris Lattner
d9791b0007 Darwin and solaris don't support echo -e. This should get the test passing
for them.

llvm-svn: 18511
2004-12-04 23:44:42 +00:00
Chris Lattner
59ed56e232 This fails due to the sun headers.
llvm-svn: 18510
2004-12-04 23:24:30 +00:00
Chris Lattner
02d5676936 This test passes on all platforms
llvm-svn: 18509
2004-12-04 23:21:41 +00:00
Chris Lattner
b5fd4a2f85 These tests pass on darwin now that the __ thing is fixed.
llvm-svn: 18508
2004-12-04 23:20:14 +00:00
Reid Spencer
20275c1d5d Failing Feature/Regression test should fail the build
llvm-svn: 18507
2004-12-04 22:34:47 +00:00
Reid Spencer
895ad73daa Use the FAKE_SOURCES feature for proper distribution of contents
llvm-svn: 18506
2004-12-04 22:34:33 +00:00
Reid Spencer
ca49210f65 Distribute headers and license files too
llvm-svn: 18505
2004-12-04 22:34:21 +00:00
Reid Spencer
81546587d5 Getting dist-check to work:\
* Implement the FAKE_SOURCES feature for GCCLibraries/crtend \
* Search for distribution files >first< in srcdir and >second< in objdir \
* Make dist-hook only run in top level directory. \
* Make dist-check run correctly in parallel builds \
* Wrap lines to 80 cols \
* Standardize variable names

llvm-svn: 18504
2004-12-04 22:34:09 +00:00
Reid Spencer
b16e4b7ca5 CVS directory elimination moved to Makefile.rules
llvm-svn: 18503
2004-12-04 22:33:58 +00:00
Reid Spencer
ef510c0279 Provide more information in the error message that occurs when there are
unresolved constants remaining.

llvm-svn: 18502
2004-12-04 22:19:53 +00:00
Reid Spencer
5ae9a04e40 Print out something useful instead of a blank table when the external tests
are skipped by user option.

llvm-svn: 18501
2004-12-04 22:18:28 +00:00
Chris Lattner
8145bd5006 Check in some patches for better assertions
llvm-svn: 18500
2004-12-04 21:28:47 +00:00
Chris Lattner
a27dd47e7a This patch prevents an infinite recursion while compiling 103.su2cor.
All SPEC CFP 95 programs now work, though the JIT isn't loading -lf2c right
so they aren't testing correctly.

llvm-svn: 18499
2004-12-04 20:54:32 +00:00
Chris Lattner
77e8f43c72 Move the dejagnu section to immediately before the 'trends' section.
llvm-svn: 18497
2004-12-04 20:18:21 +00:00
Chris Lattner
af045fa120 Remove last remnants of qmtest stuff
llvm-svn: 18496
2004-12-04 19:57:27 +00:00
Chris Lattner
5b87507304 Update the win32 project files, contributed by Morton Ofstad!
llvm-svn: 18495
2004-12-04 19:14:38 +00:00
Chris Lattner
a57c105687 Fix linkage of mismatched weak globals. This unbreaks 300.twolf
llvm-svn: 18494
2004-12-04 18:54:48 +00:00
Reid Spencer
9cb0f7097c Use the install-bytecode target to install just the bytecode libs into
the CFE's install/bytecode-libs directory.

llvm-svn: 18493
2004-12-04 08:13:20 +00:00
Chris Lattner
144924cbaa Clean feature also
llvm-svn: 18491
2004-12-04 06:47:07 +00:00
Tanya Lattner
03dfe165e1 Run dejagnu by default.
llvm-svn: 18490
2004-12-04 06:35:14 +00:00
Tanya Lattner
24726f9a5d Removed QMTest functions. The nightly tester no longer runs qmtest. It now runs dejagnu by default and you must turn it off using -nodejagnu.
llvm-svn: 18489
2004-12-04 06:25:50 +00:00
Tanya Lattner
26a1367d8a Made it default to check instead of check-dejagnu.
llvm-svn: 18488
2004-12-04 06:25:08 +00:00
Chris Lattner
8f97278c49 Do not allow bytecode files with unresolved references to be read. Doing
so lets wierd ConstantPlaceholder objects sneak into the system which
confuses it greatly.

llvm-svn: 18487
2004-12-04 05:28:27 +00:00
Chris Lattner
73a1914131 Fix compilation error on Darwin.
llvm-svn: 18485
2004-12-04 04:17:20 +00:00
Alkis Evlogimenos
be526cfba4 Check if a block has a terminator first before calling front() on
it. If a block has a terminator then it is certainly non-empty so the
verifier will not crash on it.

llvm-svn: 18484
2004-12-04 02:30:42 +00:00
Alkis Evlogimenos
b92de19116 Make error msg reflect what exactly went wrong.
llvm-svn: 18478
2004-12-04 01:25:06 +00:00
Chris Lattner
5684f4817f Prevent accessing past the end of the intervals vector, this fixes
Prolang-C/bison in the JIT

llvm-svn: 18477
2004-12-04 01:22:09 +00:00
Misha Brukman
68ef9a9a4d Use the standard PR### notation for referencing bugs in bugzilla
llvm-svn: 18476
2004-12-04 00:45:09 +00:00
Misha Brukman
47d186cf55 Remove more smileys. I kept the one in WritingAnLLVMPass because it is actually
funny.

llvm-svn: 18475
2004-12-04 00:33:34 +00:00
Misha Brukman
6d1686c18b Documentation which contains smileys won't be taken seriously by some people.
llvm-svn: 18474
2004-12-04 00:32:12 +00:00
Chris Lattner
997153df35 Update for changes to check targets.
llvm-svn: 18473
2004-12-04 00:04:48 +00:00
Misha Brukman
8d9a83a908 * Link to the license file from release 1.3 (should we link to CVS version
instead?)
* Encapsulate code and header file names with <tt> and </tt>
* Arrange <p> and </p> tags to be inline with the text they contain

llvm-svn: 18472
2004-12-03 23:58:18 +00:00
Chris Lattner
e175aa5cc1 check is now a single colon rule. Also make it default to running dejagnu instead of qmtest
llvm-svn: 18471
2004-12-03 23:57:00 +00:00
Chris Lattner
1701409c9a Remove all recursive check support from Makefile.rules
llvm-svn: 18470
2004-12-03 23:56:41 +00:00
Misha Brukman
9976d3486f Remove extraneous space in link
llvm-svn: 18468
2004-12-03 23:26:23 +00:00
Chris Lattner
87a756f09f Remove darwin specific majik
llvm-svn: 18467
2004-12-03 23:02:55 +00:00
Chris Lattner
4cf8b36469 Move darwin-specific majik here.
llvm-svn: 18466
2004-12-03 23:02:42 +00:00
Chris Lattner
fc61de3902 Significantly rework linker support for global variables, allowing it to
correctly link globals whose LLVM types do not match.

This fixes several of the F2C SPEC FP benchmarks, which were failing this
due to the implementation of common blocks used by f2c.

llvm-svn: 18465
2004-12-03 22:18:41 +00:00
John Criswell
8e18e88392 Removed QMTests as I will be zapping them soon.
I've done some testing, and this seems to work, but if people who use
the nightly tester regularly could spot check these changes, I'd be
appreciative.

llvm-svn: 18464
2004-12-03 21:56:30 +00:00
Chris Lattner
661a714d2c 'make check' at the top level shouldn't recurse through the sourcedirs
llvm-svn: 18463
2004-12-03 21:05:57 +00:00
Reid Spencer
d4bd375d37 Resurrect the install-bytecode target for installing just the bytecode
libraries to the CFE.

llvm-svn: 18462
2004-12-03 20:08:48 +00:00
Chris Lattner
2434bb968c Do not multiply define symbol
llvm-svn: 18461
2004-12-03 19:48:10 +00:00
Chris Lattner
b3d140deaa Bug fixed
llvm-svn: 18460
2004-12-03 17:21:33 +00:00
Chris Lattner
26d9c22832 Fix test/Regression/CodeGen/CBackend/2004-12-03-ExternStatics.ll and
PR472

llvm-svn: 18459
2004-12-03 17:19:10 +00:00
Chris Lattner
1cc226eba1 new testcase for PR472
llvm-svn: 18458
2004-12-03 17:18:42 +00:00
Chris Lattner
9019e5cfa0 Implement stripping of debug symbols, making the --strip-debug options in
gccas/gccld more than just a noop.

llvm-svn: 18456
2004-12-03 16:22:08 +00:00
John Criswell
ebaef2c0d9 Fixed typo.
llvm-svn: 18455
2004-12-03 15:59:26 +00:00
Chris Lattner
5a4dc8ca5a Do not look here for elegance.
This fixes the ugly darwin "cannot find symbols starting with __" issue.

Thanks for Owen/resistor for testing this out for me.

llvm-svn: 18454
2004-12-03 07:16:51 +00:00
Brian Gaeke
608a6dae43 This code rotted - change it to call abort() until someone wants
to rewrite this to use relocations.

llvm-svn: 18453
2004-12-03 06:57:14 +00:00
Reid Spencer
2b1b83a520 Pass -strip-debug to gccas when bytecode libraries are being built.
llvm-svn: 18452
2004-12-03 06:04:35 +00:00
Chris Lattner
0558e23872 Add -strip-debug option
remove the temporary -disable-dse option

llvm-svn: 18451
2004-12-03 05:45:58 +00:00
Tanya Lattner
c0d9dcdfac When writing kernel, save the branches til the end. They are still put in the "right place" in the schedule, but sometimes when folding to make a kernel instructions are added between branches. This is wrong. To avoid this, we handle branches special.
llvm-svn: 18450
2004-12-03 05:25:22 +00:00
Chris Lattner
9d76c236f7 Fix a regression caused by the previous patch
llvm-svn: 18449
2004-12-03 05:13:15 +00:00
John Criswell
f29f760354 These lookup symbols with leading underscores, which currently fails in
the PowerPC JIT.
Hence, they are XFAILs.

llvm-svn: 18443
2004-12-02 21:28:37 +00:00
Chris Lattner
99a7c3d26f Adjust to change in pass name
llvm-svn: 18442
2004-12-02 21:27:35 +00:00
Chris Lattner
4913b65616 Recognize --strip-all as a synonym for -s.
Add -S and --strip-debug option support.

llvm-svn: 18441
2004-12-02 21:26:10 +00:00
Chris Lattner
e8ebcb3300 Initial reimplementation of the -strip pass, with a stub for implementing
-S

llvm-svn: 18440
2004-12-02 21:25:03 +00:00
Chris Lattner
a4c9808603 This pass is moving to lib IPO
llvm-svn: 18439
2004-12-02 21:24:40 +00:00
Chris Lattner
4459cb260a Move the strip pass from Scalar to IPO lib
llvm-svn: 18438
2004-12-02 21:24:19 +00:00
Chris Lattner
e3d98f1fd8 Quiet!
llvm-svn: 18437
2004-12-02 21:23:43 +00:00
Chris Lattner
7651614c4d The stripping pass as we know it is about to disappear
llvm-svn: 18436
2004-12-02 21:05:01 +00:00
John Criswell
335c342440 Reverting revision 1.209.
Including alloca.h on Solaris brings in the prototype of strftime(), which
breaks compilation of CBE generated code.

llvm-svn: 18435
2004-12-02 19:02:49 +00:00
Chris Lattner
420847f879 Add a note
llvm-svn: 18434
2004-12-02 18:21:45 +00:00
Chris Lattner
33660426a5 Spill/restore X86 floating point stack registers with 64-bits of precision
instead of 80-bits of precision.  This fixes PR467.

This change speeds up fldry on X86 with LLC from 7.32s on apoc to 4.68s.

llvm-svn: 18433
2004-12-02 18:17:31 +00:00
Chris Lattner
96b14e18bb Consider 64-bit registers to be FP as well.
llvm-svn: 18432
2004-12-02 17:57:21 +00:00
Chris Lattner
fa83510f94 Document beta pass
llvm-svn: 18431
2004-12-02 17:20:17 +00:00
Reid Spencer
53c59689d1 Standardize the makefiles with space around = to match the rest of LLVM.
llvm-svn: 18429
2004-12-02 09:58:09 +00:00
Reid Spencer
f78508b25e PR466:
* Make the linker find lib*.bca files now instead of lib*.bc since those
  are what the makefiles now generate for bytecode archives.
* Make sure the linker only links archives when LinkLibraries is called.
  Previously if it found a lib*.bc file and that file was a bytecode file,
  it would link in the entire bytecode. This could make -lc -lc fail with
  duplicate symbols error but it shouldn't as searching multiple libraries,
  even the same one more than once, is permitted.
* Now that the above problems are corrected, implement the dependent libs
  feature. After the module is linked with all specified libraries, the
  LinkLibraries function will obtain the set of dependent libraries from
  the linked modules and attemp to find and link against those libraries.

llvm-svn: 18428
2004-12-02 09:52:10 +00:00
Reid Spencer
d6dcad7745 Standardize the format of the runtime libraries makefiles.
* Don't have lines longer than 80 cols
* Blank line after the header
* Reduce spaces in var definitions.

llvm-svn: 18427
2004-12-02 09:31:40 +00:00
Reid Spencer
dbaac1ff17 For PR466:
Much of what this Makefile did to make a libcrtend.a file is now supported
by Makefile.rules when BYTECODE_LIBRARY=1 is specified. So, we've
simplified the make rules for building this library.

llvm-svn: 18426
2004-12-02 09:29:49 +00:00
Reid Spencer
32f7e42744 For PR466:
Change construction of bytecode libraries from producing a single bytecode
file to producing a library containing bytecode files. This gets around the
problem of multiple symbol definitions in the linker if something like
-lc -lc is attempted on the command line. Previously this happened because
the linker would find libc.bc as a "library". It will now find libc.a which
it can simply search for missing symbols instead of linking in wholesale.

llvm-svn: 18425
2004-12-02 09:28:21 +00:00
Reid Spencer
59d89f598c Remove this left-over crud from the automake experiment.
llvm-svn: 18424
2004-12-02 09:23:51 +00:00
Reid Spencer
295a3bbb18 Implement file replacement correctly even with the f (TruncateNames) flag
set. The member name comparison was failing for truncated names. This patch
fixes that. Truncated names are now properly replaced.

llvm-svn: 18423
2004-12-02 09:21:55 +00:00
Reid Spencer
f473185cbc Fix seriously broken implementation of GetMagicNumber.
llvm-svn: 18422
2004-12-02 09:09:48 +00:00
Reid Spencer
1c8a34ff77 Search for tclsh last so we don't find the FreeBSD warning script too early
llvm-svn: 18421
2004-12-02 07:31:22 +00:00
Reid Spencer
188a22fc14 Search for tclsh last so we don't find the FreeBSD warning script.
llvm-svn: 18420
2004-12-02 07:29:17 +00:00
Tanya Lattner
201e972dc4 Reworked branch adding in prologue. Added check for infinite loops which are not modulo scheduled.
llvm-svn: 18419
2004-12-02 07:22:15 +00:00
Chris Lattner
c0677c081d Implement a FIXME by checking to make sure that a malloc is not being used
in scary and unknown ways before we promote it.  This fixes the miscompilation
of 188.ammp that has been plauging us since a globalopt patch went in.

Thanks a ton to Tanya for helping me diagnose the problem!

llvm-svn: 18418
2004-12-02 07:11:07 +00:00
Chris Lattner
3b18139b3c Fix a minor bug where we set a var to initialized on malloc, not on store.
This doesn't fix anything that I'm aware of, just noticed it by inspection

llvm-svn: 18417
2004-12-02 06:25:58 +00:00
Reid Spencer
7784c2f12e Fix the tclsh test to find tclsh8.[34] and tclsh8.[34].X as well.
llvm-svn: 18415
2004-12-02 04:17:20 +00:00
Reid Spencer
8d61104f97 * Make sure the cache variable gets cached
* Don't search a bunch of .. directories for something we'd never find,
  because we don't imbed tclsh into LLVM.
* Look for various tclsh versions because some platforms don't install the
  tclsh link but just have tclsh8.3 or tclsh8.4 or some such.

llvm-svn: 18414
2004-12-02 04:15:24 +00:00
Chris Lattner
434f90ff2d Remove dead field
llvm-svn: 18412
2004-12-02 02:35:38 +00:00
Chris Lattner
9cf32444bb This program doesn't break anything anymore.
llvm-svn: 18411
2004-12-02 02:26:18 +00:00
Misha Brukman
3ae96e3727 Reid has implemented llvm-ranlib. Thanks, Reid!
llvm-svn: 18410
2004-12-01 21:07:40 +00:00
Misha Brukman
d0bb8bebc8 * Hyphenate ``constant-propagate''
* Add testing notes to the instruction section similar as for intrinsics
* Mention adding codegen support for new instructions

llvm-svn: 18409
2004-12-01 20:58:54 +00:00
Misha Brukman
e070ae69fc Remove duplicated link to "Machine backend"
llvm-svn: 18408
2004-12-01 19:12:27 +00:00
Tanya Lattner
e94b466a8e Reverting this patch:
http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20041122/021428.html

It broke Mutlisource/Applications/obsequi

llvm-svn: 18407
2004-12-01 18:27:03 +00:00
Chris Lattner
e58bf09138 Initial support for packed types, contributed by Morten Ofstad
llvm-svn: 18406
2004-12-01 17:14:28 +00:00
Chris Lattner
9a43d294b9 Remove unneeded cast.
llvm-svn: 18405
2004-12-01 17:13:05 +00:00
Chris Lattner
cf2e128758 Get GEP's working with packed types. Contributed by Morten Ofstad!
llvm-svn: 18404
2004-12-01 17:12:16 +00:00
Chris Lattner
9812dbcc76 Add line # info
llvm-svn: 18403
2004-12-01 17:10:36 +00:00
John Criswell
51f8ded5e7 Fixed pathname to LLVM tools.
Thanks to Vladimir Merzliakov for finding this.

llvm-svn: 18402
2004-12-01 14:12:30 +00:00
Reid Spencer
f6a10fa333 Be a little more explicit about how to configure LLVM with the --prefix
option so that permissions errors don't occur if the default, /usr/local,
is taken.

llvm-svn: 18401
2004-12-01 05:15:44 +00:00
Chris Lattner
2a2ebd1829 Fix typeo, thanks to Duraid for pointing it out
llvm-svn: 18400
2004-12-01 04:16:29 +00:00
Reid Spencer
3f2352e23e Revert version 1.39. It breaks the ordering of the library processing.
llvm-svn: 18399
2004-11-30 22:54:48 +00:00
Chris Lattner
798e0349c0 Do not let GCC emit a warning for INT64_MIN
llvm-svn: 18398
2004-11-30 21:33:58 +00:00
Brian Gaeke
86deaf2211 Sparcs behave better if we use <alloca.h> and avoid messing with __builtin_alloca.
llvm-svn: 18397
2004-11-30 21:27:01 +00:00
Tanya Lattner
33f621acf8 Added TCLSH var to site.exp.
llvm-svn: 18396
2004-11-30 19:13:06 +00:00
Chris Lattner
a6992ae74f Move this from the C test suite
llvm-svn: 18395
2004-11-30 18:25:12 +00:00
Chris Lattner
bf3a546a5b This is a c++ test
llvm-svn: 18394
2004-11-30 18:25:05 +00:00
Chris Lattner
3f9b831041 Add back -e, which apparently works in sh's echo but not tcsh's, which does
not need it.  Also, grep some output so we know that this command does something.

llvm-svn: 18393
2004-11-30 17:47:13 +00:00
Chris Lattner
4114c7d87c If TESTSUITE is set, we obviously want to run dejagnu
llvm-svn: 18392
2004-11-30 17:45:08 +00:00
Chris Lattner
56bac30683 Fix the JIT when being used from llvm-db
llvm-svn: 18391
2004-11-30 17:41:49 +00:00
Chris Lattner
f4b262a3ec do not pass -e into llvm-db as a command.
llvm-svn: 18390
2004-11-30 17:13:13 +00:00
Chris Lattner
c7edfa52a4 Put the output in the temporary location
llvm-svn: 18389
2004-11-30 17:12:00 +00:00
Chris Lattner
3f6419949c This is a cross platform fail, failing on freebsd as well
llvm-svn: 18388
2004-11-30 17:10:47 +00:00
Chris Lattner
951673a94c This pass is completely broken.
llvm-svn: 18387
2004-11-30 17:09:06 +00:00
Chris Lattner
37a14496c5 RevisionNum is read by error(), initialize it early.
llvm-svn: 18386
2004-11-30 16:58:18 +00:00
Chris Lattner
d7f028e4e3 This was fixed with the recent tester changes.
llvm-svn: 18385
2004-11-30 16:48:26 +00:00
Brian Gaeke
5c9fa5bcee Update list of failing benchmarks.
llvm-svn: 18384
2004-11-30 08:15:44 +00:00
Brian Gaeke
1d6b926ab6 If we're about to emit something like:
%f0 = fmovs %f0
  %f1 = fmovs %f1

then just delete the FpMOVD pseudo-instruction instead.  Also, add
statistics and debug printouts.

llvm-svn: 18383
2004-11-30 08:15:15 +00:00
Reid Spencer
105d4152d7 Add a check for the tclsh program needed by dejagnu. This can have weird
names that have version numbers in it so this macro, DJ_AC_PATH_TCLSH will
make the necessary checks. The makefile variable TCLSH is set to the path
found.

llvm-svn: 18382
2004-11-30 08:11:54 +00:00
Chris Lattner
019445715e Squelch warning
llvm-svn: 18381
2004-11-30 07:47:34 +00:00
Chris Lattner
b15064a776 This passes on darwin now
llvm-svn: 18380
2004-11-30 07:38:41 +00:00
Chris Lattner
bd11625469 Fix several bugs in 'op x, imm' handling. Foremost is that we now emit
addi r3, r3, -1
instead of
   addi r3, r3, 1

for 'sub int X, 1'.

Secondarily, this fixes several cases where we could crash given an unsigned
constant.  And fixes a couple of minor missed optimization cases, such as
xor X, ~0U -> not X

llvm-svn: 18379
2004-11-30 07:30:20 +00:00
Reid Spencer
95729469cc Up the compression threshold to 64K so we avoid it for all but the largest
bytecode files. This should help linking substantially.

llvm-svn: 18378
2004-11-30 07:13:34 +00:00
Chris Lattner
868ae13dc0 Fix test/Regression/Transforms/LICM/2004-09-14-AliasAnalysisInvalidate.llx
This only fails on darwin or on X86 under valgrind.

llvm-svn: 18377
2004-11-30 07:01:15 +00:00
Chris Lattner
7562a05735 Fix CodeGen/PowerPC/2004-11-30-shr-var-crash.ll
llvm-svn: 18376
2004-11-30 06:40:04 +00:00
Chris Lattner
16c07fdd15 New testcase that crashes the PPC BE
llvm-svn: 18375
2004-11-30 06:39:45 +00:00
Chris Lattner
ce350cbd3a Fix test/Regression/CodeGen/PowerPC/2004-11-29-ShrCrash.ll
llvm-svn: 18374
2004-11-30 06:36:11 +00:00
Chris Lattner
c45bdadaf8 New testcase
llvm-svn: 18373
2004-11-30 06:35:52 +00:00
Tanya Lattner
97b21a06a3 Adding timeout for a test.
llvm-svn: 18372
2004-11-30 06:29:45 +00:00
Chris Lattner
9eeb2033ff Fix test/Regression/CodeGen/PowerPC/2004-11-30-shift-crash.ll
llvm-svn: 18371
2004-11-30 06:29:10 +00:00
Chris Lattner
90e62de4e9 New testcase that crashes the PPC backend
llvm-svn: 18370
2004-11-30 06:28:53 +00:00
Chris Lattner
fd8cbc257e Alkis noticed that this variable is dead. Thanks!
llvm-svn: 18369
2004-11-30 04:01:44 +00:00
Chris Lattner
0b6ebd8d10 Add method
llvm-svn: 18368
2004-11-30 02:51:53 +00:00
Chris Lattner
889e91d58d New testcase for simplifycfg
llvm-svn: 18367
2004-11-30 00:31:16 +00:00
Chris Lattner
389cfac0d1 If we have something like this:
if (x) {
    code
    ...
  } else {
    code
    ...
  }

Turn it into:

  code
  if (x) {
    ...
  } else {
    ...
  }

This reduces code size and in some common cases allows us to completely
eliminate the conditional.  This turns several if/then/else blocks in loops
into straightline code in 179.art, turning the loops into single basic blocks
(good for modsched even!).

Maybe now brg will leave me alone ;-)

llvm-svn: 18366
2004-11-30 00:29:14 +00:00
Chris Lattner
e0c207d2d3 Remove extraneous namespacification. In particular, don't define llvm::llvm::createInternalGlobalMapperPass
llvm-svn: 18365
2004-11-30 00:22:59 +00:00
John Criswell
fc1a1dd203 Fix a typo.
Corrected a potential grammary issue.

llvm-svn: 18364
2004-11-29 21:46:29 +00:00
Chris Lattner
6e455608e2 Allow hoisting loads of globals and alloca's in conditionals.
llvm-svn: 18363
2004-11-29 21:26:12 +00:00
Chris Lattner
0ea40c935f Make built bytecode libraries depend on gccas/gccld as appropriate. This
should fix the stale runtime libraries problem.

llvm-svn: 18361
2004-11-29 19:47:58 +00:00
Reid Spencer
e1cb6b9e2e Fix two bugs:
1. Nothing should happen on "make all". Doc generation is quick, but we
   don't want to do it unless we're installing.
2. Correct a dependency for the *.ps files .. didn't notice this before
   because of cruft in my directory. It failed on a clean build.

llvm-svn: 18359
2004-11-29 14:46:29 +00:00
Reid Spencer
4f44c95967 Functionality moved to portable lib/System/DynamicLibrary.cpp
implementation

llvm-svn: 18358
2004-11-29 14:11:41 +00:00
Reid Spencer
70e37278cb Use System/DynamicLibrary instead of Support/DynamicLinker
llvm-svn: 18357
2004-11-29 14:11:29 +00:00
Reid Spencer
9ec2761bb7 Use System/DynamicLibrary instead of Support/DynamicLinker to implement.
llvm-svn: 18356
2004-11-29 14:07:46 +00:00
Reid Spencer
0e6a4fc448 Implement two new functions: LoadLibraryPermanently and
SearchForAddressOfSymbol.

llvm-svn: 18355
2004-11-29 13:33:28 +00:00
Reid Spencer
c4c3f5a980 Add in some methods for use by the JIT. LoadLibraryPermanently brings the
library into the address space permanently. SearchForAddressOfSymbol looks
in all previously permanently loaded libraries and any currently open
libraries for a symbol, instead of just one library like GetAddressOfSymbol

llvm-svn: 18354
2004-11-29 13:27:56 +00:00
Reid Spencer
d1697bf2f7 Shared library extension is now in LTDL_SHLIB_EXT
llvm-svn: 18353
2004-11-29 12:40:21 +00:00
Reid Spencer
3468ae1a87 We just use ltdl's implementation for this abstraction now. Its portable to
more platforms than LLVM supports.

llvm-svn: 18352
2004-11-29 12:39:10 +00:00
Reid Spencer
50f3487fad Allow reconfig from any directory, not just the top build directory, by
changing directory first. Also make sure that we don't attempt to run
config.status if the recheck didn't work.

llvm-svn: 18351
2004-11-29 12:37:44 +00:00
Reid Spencer
c680f05aeb Changes resulting from AC_LIB_LTDL usage.
llvm-svn: 18350
2004-11-29 12:36:16 +00:00
Reid Spencer
a40c687fe8 * Implement embedding libltdl into LLVM which required some rearranging.
llvm-svn: 18349
2004-11-29 12:29:58 +00:00
Reid Spencer
7905a70840 * Update instructions about upgrading libtool
* Add instructions about upgrading autoconf

llvm-svn: 18348
2004-11-29 12:28:47 +00:00
Reid Spencer
54f36c677f Don't include ltdl.h any more. Its nested in lib/System now.
llvm-svn: 18347
2004-11-29 12:12:11 +00:00
Reid Spencer
47430cf2a5 Mods for compilation with llvm.
llvm-svn: 18346
2004-11-29 12:04:27 +00:00
Reid Spencer
11ba920d55 Original version of ltdl.h from libtool 1.5.10
llvm-svn: 18345
2004-11-29 12:02:48 +00:00
Reid Spencer
6717b80ba2 Original version of ltdl.c from libtool 1.5.10
llvm-svn: 18344
2004-11-29 12:02:25 +00:00
Reid Spencer
2c7c2a0774 Converted with autoupdate for autoconf 2.50 -> 2.59 differences.
llvm-svn: 18343
2004-11-29 11:27:12 +00:00
Reid Spencer
8b3fd7639e This file contains macros that allow us to incorporate the ltdl source into
our own library so that it is magically hidden and we don't have to depend
on linking with -lltdl option.

llvm-svn: 18342
2004-11-29 10:56:45 +00:00
Reid Spencer
72a7457a90 Implement the default constructor which causes the current program to be
opened as if it was a dynamic library so its symbols can be searched too.

llvm-svn: 18341
2004-11-29 10:39:46 +00:00
Reid Spencer
073173568d Make the default constructor cause the program's symbols to be loaded as
if it was a dynamic library.

llvm-svn: 18340
2004-11-29 10:38:54 +00:00
Reid Spencer
1a8b379d84 Make it HTML 4.01 Strict compliant.
llvm-svn: 18339
2004-11-29 07:47:16 +00:00
Reid Spencer
6bc24e4e65 * Document how to turn on doxygen documentation generation
* Document the new "LLVMLIBS=JIT" feature to make building JIT programs
  super easy.

llvm-svn: 18338
2004-11-29 07:44:51 +00:00
Reid Spencer
5686dc714d No longer necessary, moved Makefile.rules
llvm-svn: 18337
2004-11-29 07:17:31 +00:00
Reid Spencer
bb9932c96a Use LLVMLIBS=JIT to get JIT libraries
llvm-svn: 18333
2004-11-29 07:17:18 +00:00
Reid Spencer
af4495a8c4 Incorporate tools/Makefile.JIT
llvm-svn: 18332
2004-11-29 07:17:07 +00:00
Reid Spencer
3ec3fc9870 Make sure the program's symbols can be dlsym'd as well.
llvm-svn: 18331
2004-11-29 06:23:19 +00:00
Chris Lattner
f9c5dc9fb4 Revamp long/ulong comparisons to use a much more efficient sequence (thanks
to Brian and the Sun compiler for pointing out that the obvious works :)

This also enables folding all long comparisons into setcc and branch
instructions: before we could only do == and !=

For example, for:
void test(unsigned long long A, unsigned long long B) {
   if (A < B) foo();
 }

We now generate:

test:
        subl $4, %esp
        movl %esi, (%esp)
        movl 8(%esp), %eax
        movl 12(%esp), %ecx
        movl 16(%esp), %edx
        movl 20(%esp), %esi
        subl %edx, %eax
        sbbl %esi, %ecx
        jae .LBBtest_2  # UnifiedReturnBlock
.LBBtest_1:     # then
        call foo
        movl (%esp), %esi
        addl $4, %esp
        ret
.LBBtest_2:     # UnifiedReturnBlock
        movl (%esp), %esi
        addl $4, %esp
        ret

Instead of:

test:
        subl $12, %esp
        movl %esi, 8(%esp)
        movl %ebx, 4(%esp)
        movl 16(%esp), %eax
        movl 20(%esp), %ecx
        movl 24(%esp), %edx
        movl 28(%esp), %esi
        cmpl %edx, %eax
        setb %al
        cmpl %esi, %ecx
        setb %bl
        cmove %ax, %bx
        testb %bl, %bl
        je .LBBtest_2   # UnifiedReturnBlock
.LBBtest_1:     # then
        call foo
        movl 4(%esp), %ebx
        movl 8(%esp), %esi
        addl $12, %esp
        ret
.LBBtest_2:     # UnifiedReturnBlock
        movl 4(%esp), %ebx
        movl 8(%esp), %esi
        addl $12, %esp
        ret

llvm-svn: 18330
2004-11-29 05:55:24 +00:00
Reid Spencer
fc66af4476 * Allow date command to be printed in verbose mode
* Get rid of appending -lbz2 and -lz to ExtraLibs now that we don't need
  them any more.
* Fix the dist-check target so that EXTRA_DIST can be defined AFTER the
  include of Makefile.common. This is needed because Makefile.common
  provides variable definitions that may need to be used in computing the
  value of EXTRA_DIST.
* Clean up some "distdir" target output.

llvm-svn: 18329
2004-11-29 05:00:33 +00:00
Reid Spencer
51877c95d3 Add "docs" as a descendable directory (at the end)
llvm-svn: 18328
2004-11-29 04:57:55 +00:00
Reid Spencer
0194c9a64c * allow doxygen documentation to be enabled/disabled (default off)
* organize programs we test for properly
* add new programs needed for documentation generation
* Adjust install paths so llvm stuff doesn't muck up /usr/local or /usr if
  $prefix is set to those.

llvm-svn: 18327
2004-11-29 04:56:35 +00:00
Reid Spencer
2c22f50c38 * Get additional configured values into the makefiles
* Provide support for ENABLE_DOXYGEN
* New tools that documentation generation requires

llvm-svn: 18326
2004-11-29 04:53:50 +00:00
Reid Spencer
da2a9e6b0c Make the check a little quieter.
llvm-svn: 18325
2004-11-29 04:51:58 +00:00
Reid Spencer
1c2aaab680 * Make this makefile compliant with LLVM makefile standards
* Implement optional doxygen doc generation
* Implement HTML and doxygen installation

llvm-svn: 18324
2004-11-29 04:47:35 +00:00
Reid Spencer
dc8f4286c6 Moved --> doxygen.cfg.in
llvm-svn: 18323
2004-11-29 04:46:12 +00:00
Tanya Lattner
d8cc4facd0 Reworked branching so we don't handle BAs specially. It just updates the branchTO regardless of what type of branch it is.
llvm-svn: 18322
2004-11-29 04:39:47 +00:00
Reid Spencer
9d3b50038d * Get rid of extraneous directories
* Ensure things installed to same place are all getting there by using a
  variable to name that place.
* Make sure missing index.html, images and *.css files get installed.

llvm-svn: 18321
2004-11-29 04:34:05 +00:00
Reid Spencer
f8685399eb * add llvmc and llvm-ld
* fix the links to not be in an html subdir as that's not how this gets
  installed (anymore).

llvm-svn: 18320
2004-11-29 04:32:37 +00:00
Reid Spencer
3776794cc5 Adjust this so that doxygen doesn't barf on it.
llvm-svn: 18319
2004-11-29 03:47:37 +00:00
Reid Spencer
94ade72d66 * Adjust so this falls in line with LLVM Makefile standards.
* Implement installation of doxygen and html documentation
* Fix it so it works with objdir != srcdir.

llvm-svn: 18318
2004-11-29 03:45:02 +00:00
Reid Spencer
7d42417cc5 * Fix an item list.
* Add an ENVIRONMENT section to describe LLVM_LIB_SEARCH_PATH

llvm-svn: 18317
2004-11-29 03:43:29 +00:00
Reid Spencer
0f9dabd0f8 Add a link.
llvm-svn: 18316
2004-11-29 03:37:54 +00:00
Reid Spencer
ad60af2874 For PR393:
This file was originally doxygen.cfg, but it needs to be configured to get
the right srcdir/objdir paths for things. This is needed because building
the doxygen will now be part of the install and dist-check targets.

llvm-svn: 18315
2004-11-29 03:33:22 +00:00
Tanya Lattner
341828ee64 Fixed bug where instructions in the kernel were not ordered right to preserve dependencies in a cycle.
llvm-svn: 18314
2004-11-28 23:36:15 +00:00
Reid Spencer
f8085812d9 Update the test to match the optimization. The optimization can let some
casts through, but they will only be sbyte -> ubyte in this test case so
make sure we don't let any other kinds through.

llvm-svn: 18313
2004-11-28 21:36:52 +00:00
Reid Spencer
279fa256a2 Fix for PR454:
* Make sure we handle signed to unsigned conversion correctly
* Move this visitSetCondInst case to its own method.

llvm-svn: 18312
2004-11-28 21:31:15 +00:00
Chris Lattner
c0f8a1c721 The LLVM bool type shall have 1 byte alignment on PPC.
llvm-svn: 18311
2004-11-28 21:16:45 +00:00
Chris Lattner
6ea2888832 Make DSE potentially more aggressive by being more specific about alloca sizes.
llvm-svn: 18309
2004-11-28 20:44:37 +00:00
Chris Lattner
1b784b117d Fix DeadStoreElimination/2004-11-28-LiveStoreDeleted.ll
llvm-svn: 18308
2004-11-28 20:30:15 +00:00
Chris Lattner
1222964f2a New testcase. The store is not dead here.
llvm-svn: 18307
2004-11-28 19:54:02 +00:00
Chris Lattner
ebb54c55e1 Fix SingleSource/UnitTests/2004-11-28-GlobalBoolLayout.c, and hopefully
PR449

llvm-svn: 18306
2004-11-28 17:56:47 +00:00
Chris Lattner
9d313cfa1c new testcase for PR463
llvm-svn: 18304
2004-11-28 16:47:46 +00:00
Chris Lattner
aef74b55de Fix PR463
llvm-svn: 18303
2004-11-28 16:45:45 +00:00
Reid Spencer
ad3016a273 Correct the RUN line to remove unneeded parameters and make sure the test
case is testing the right thing.

llvm-svn: 18302
2004-11-28 08:15:33 +00:00
Reid Spencer
2530e82275 Test case for PR454
llvm-svn: 18301
2004-11-28 04:29:29 +00:00
Reid Spencer
8a3312cab3 Compute the firstFileOffset correctly after reading the LLVM symbol table.
llvm-svn: 18300
2004-11-28 03:13:02 +00:00
Chris Lattner
e8d482e76d Bug fixed
llvm-svn: 18299
2004-11-28 01:25:20 +00:00
Chris Lattner
296f82b6cc New testcase for PR447
llvm-svn: 18298
2004-11-28 01:22:49 +00:00
Chris Lattner
c1f5d47b95 Bug fixed
llvm-svn: 18297
2004-11-28 00:43:59 +00:00
Chris Lattner
7a887d7c6c New testcase for PR360
llvm-svn: 18296
2004-11-28 00:39:58 +00:00
Chris Lattner
d997b02b6f Bug fixed
llvm-svn: 18295
2004-11-28 00:09:38 +00:00
Chris Lattner
fc19d3f070 New testcase for PR244
llvm-svn: 18294
2004-11-28 00:06:07 +00:00
Chris Lattner
83c1780d73 Bug fixed
llvm-svn: 18293
2004-11-27 23:27:26 +00:00
Chris Lattner
f377ca43b3 New testcase for PR397
llvm-svn: 18292
2004-11-27 23:24:23 +00:00
Chris Lattner
dcc1599599 Bug fixed
llvm-svn: 18291
2004-11-27 22:47:08 +00:00
Chris Lattner
212ade1830 new testcase
llvm-svn: 18290
2004-11-27 22:43:51 +00:00
Reid Spencer
8de460528b Remove a dead check at the end of the configure script that was a left over
from the bzip2 support. This dead check produced the error:
test: -ne: unary operator expected

llvm-svn: 18289
2004-11-27 22:01:43 +00:00
Reid Spencer
ff6110ebff Get the cache variable name right.
llvm-svn: 18288
2004-11-27 21:59:57 +00:00
Chris Lattner
3229b565c3 Move this to the QOI section
llvm-svn: 18287
2004-11-27 21:33:28 +00:00
Chris Lattner
4d09fff8bd Mention dj
llvm-svn: 18286
2004-11-27 21:29:43 +00:00
Chris Lattner
c57da980b3 Bug fixed
llvm-svn: 18285
2004-11-27 20:34:25 +00:00
Chris Lattner
94336bd4c7 New testcase
llvm-svn: 18284
2004-11-27 20:31:59 +00:00
Chris Lattner
d2c3a1a8d4 Pass in llvmgxx
llvm-svn: 18283
2004-11-27 20:31:14 +00:00
Chris Lattner
b3d2adea45 Add notes
llvm-svn: 18282
2004-11-27 19:50:58 +00:00
Chris Lattner
9d63271caa New testcase for PR424
llvm-svn: 18281
2004-11-27 19:44:07 +00:00
Chris Lattner
e026714f53 Add some notes
llvm-svn: 18280
2004-11-27 19:24:06 +00:00
Chris Lattner
e792a74cd0 Add bzip2
llvm-svn: 18279
2004-11-27 19:20:23 +00:00
Chris Lattner
12b1b42bea These have been removed
llvm-svn: 18278
2004-11-27 19:19:44 +00:00
Chris Lattner
b9a052eb7f Remove zlib from the llvm tarball. This is only used (in theory by povray-31
which is part of llvm-test).  If anyone is interested in adding it to llvm-test,
feel free to go for it.

This is part of PR417

llvm-svn: 18277
2004-11-27 19:18:35 +00:00
Chris Lattner
0957123d03 Remove zlib from the llvm tarball. This is only used (in theory by povray-31
which is part of llvm-test).  If anyone is interested in adding it to llvm-test,
feel free to go for it.

llvm-svn: 18276
2004-11-27 19:18:05 +00:00
Chris Lattner
24bba4d237 When merging to alias sets, if they are both must alias, the result is not
a must alias set unless all of the pointers in the resultant set are must
aliased together.

llvm-svn: 18275
2004-11-27 18:37:42 +00:00
Chris Lattner
3e511dd739 Change interface to this method a bit
llvm-svn: 18274
2004-11-27 18:37:04 +00:00
Chris Lattner
14f3cdc227 Implement Regression/Transforms/InstCombine/getelementptr_cast.ll, which
occurs many times in crafty

llvm-svn: 18273
2004-11-27 17:55:46 +00:00
Chris Lattner
7c4026ae24 New testcase
llvm-svn: 18272
2004-11-27 17:55:20 +00:00
Reid Spencer
a7c28bcd6d Don't depend on grep or sed to be portable at all. Just compare against
static test files.

llvm-svn: 18271
2004-11-27 06:44:10 +00:00
Reid Spencer
79d941f784 Put the expected tables of contents of the test archives into separate
files so we don't have to process them at test time at all.

llvm-svn: 18270
2004-11-27 06:43:03 +00:00
Reid Spencer
4f102dd7fa Use grep instead of sed because on Solaris sed doesn't copy null bytes and
it needs to in order for the bug in MacOSX archives to be tested correctly.

llvm-svn: 18269
2004-11-27 06:27:30 +00:00
Reid Spencer
532a662c80 Accommodate the braindead Solaris "diff" that doesn't understand the -q
option.

llvm-svn: 18268
2004-11-27 06:00:36 +00:00
Nate Begeman
43123c9f7a Remove the ISel->AsmPrinter link via the TargetMachine that was put in
place to help bring up the PowerPC back end on Darwin.  This code is no
longer serves any purpose now that the AsmPrinter does the right thing
all the time printing GlobalValues.  --Cruft.

llvm-svn: 18267
2004-11-27 04:45:11 +00:00
Chris Lattner
eeaa29c377 Add a new interface
llvm-svn: 18266
2004-11-26 21:36:25 +00:00
Chris Lattner
b137409926 Provide size information when checking to see if we can LICM a load, this
allows us to hoist more loads in some cases.

llvm-svn: 18265
2004-11-26 21:20:09 +00:00
Chris Lattner
f30656b437 When evaluating an AA, pass in size info
llvm-svn: 18264
2004-11-26 21:05:39 +00:00
Chris Lattner
b50fd9262d There is no reason to store <x,x>, just store <x>.
llvm-svn: 18263
2004-11-26 20:25:17 +00:00
Chris Lattner
63b45b4768 The trick with globals actually works with allocas and malloc too
llvm-svn: 18262
2004-11-26 20:01:48 +00:00
Chris Lattner
75819a81b2 A store or load cannot alias a global if the accessed amount is larger then
the global.

This implements Regression/Analysis/BasicAA/global-size.ll

llvm-svn: 18261
2004-11-26 19:20:01 +00:00
Chris Lattner
bfee2ccd5b new testcase basicaa should handle
llvm-svn: 18260
2004-11-26 19:19:28 +00:00
Reid Spencer
6caee97dc2 Indicate that PR427 won't be fixed.
llvm-svn: 18259
2004-11-25 22:43:58 +00:00
Reid Spencer
493d9c242b * Add features I implemented this release.
* Wrap long lines at 80 cols
* Indent lists so structure of document is a little more clear
* Make the page HTML 4.01 Strict compliant.

llvm-svn: 18258
2004-11-25 22:38:30 +00:00
Reid Spencer
d3f2e95e6c Add LLVMbzip2 library, now required.
llvm-svn: 18255
2004-11-25 20:22:06 +00:00
Reid Spencer
550df1bbef Remove HAVE_BZLIB and HAVE_BZIP2. We always have bzip2 now.
llvm-svn: 18254
2004-11-25 20:21:53 +00:00
Reid Spencer
cf5ca279ec Always pass -D_GNU_SOURCE to cc1plus
llvm-svn: 18253
2004-11-25 19:38:51 +00:00
Reid Spencer
d7390bbd27 Always pass -D_GNU_SOURCE to cc1
llvm-svn: 18252
2004-11-25 19:38:39 +00:00
Reid Spencer
d49013f0b8 Add bzip2 subdirectory
llvm-svn: 18251
2004-11-25 19:38:28 +00:00
Reid Spencer
fa8d2e0b27 Remove zlib support in favor of our own bzip2 library
llvm-svn: 18250
2004-11-25 19:38:16 +00:00
Reid Spencer
af6fd29a08 Adjust to Compressor interface change
llvm-svn: 18249
2004-11-25 19:38:05 +00:00
Reid Spencer
969f0bd44c Restrict the interface to not allow algorithm selection
llvm-svn: 18248
2004-11-25 19:37:42 +00:00
Reid Spencer
02c571be96 Add some instructions about ranlib'ing the CFE runtime libraries so that
they link faster. This should eventually be codified into the CFE's
makefile.

llvm-svn: 18247
2004-11-25 17:13:17 +00:00
Reid Spencer
c51e80a09f Revise to LLVM makefile standards.
llvm-svn: 18246
2004-11-25 16:12:25 +00:00
Reid Spencer
a01ef71032 Initial Version from bzip2 Release 1.0.2.
llvm-svn: 18245
2004-11-25 16:11:36 +00:00
Reid Spencer
953e80db76 Correct the configuration variable used to find the bin directory.
llvm-svn: 18244
2004-11-25 09:36:28 +00:00
Reid Spencer
8bb258d1ea Implement dependent library linking. It is no longer required that -lstdc++
-lstdsup++ no -lc be passed on the command line to llvm linkers if the
progam being linked was compiled with the C/C++ Front End or Stacker.

llvm-svn: 18243
2004-11-25 09:32:08 +00:00
Reid Spencer
2c4f9a484c Remove blank comment lines for uniformity.
Make sure lines don't exceed 80 cols.

llvm-svn: 18242
2004-11-25 09:29:44 +00:00
Reid Spencer
334782733f Add a convenience target to build all three modes: Debug, Release, Profile
llvm-svn: 18241
2004-11-25 09:08:54 +00:00
Reid Spencer
9dc4ba54dc Gack. Actually use the correct variable name in setting the JIT support.
llvm-svn: 18240
2004-11-25 07:28:19 +00:00
Nate Begeman
3f76eb69f6 Enable optimization suggested by Chris Lattner to not emit reloc stubs for
static global variables whose addresses are taken.  This allows us to
convert the following code for taking the address of a static function foo

        addis r2, r30, ha16(Ll1__2E_foo_2$non_lazy_ptr-"L00001$pb")
        lwz r3, lo16(Ll1__2E_foo_2$non_lazy_ptr-"L00001$pb")(r2)

which also includes linker stub code emitted at the end of the .s file not
shown here, and replace it with this:

        addis r2, r30, ha16(l1__2E_foo_2-"L00001$pb")
        la r3, lo16(l1__2E_foo_2-"L00001$pb")(r2)

which in addition to not needing linker help, also has no load instruction.
For those not up on PowerPC mnemonics, la is shorthand for add immediate.

llvm-svn: 18239
2004-11-25 07:09:01 +00:00
Chris Lattner
d0af8e24b5 The PPC backend is basically stable, and has a JIT now.
llvm-svn: 18238
2004-11-25 06:33:10 +00:00
Chris Lattner
6345ee29b3 Bug fixed
llvm-svn: 18237
2004-11-25 06:31:42 +00:00
Chris Lattner
d0b3983275 New testcase for PR451
llvm-svn: 18236
2004-11-25 06:25:13 +00:00
Chris Lattner
8cbad8efcf Fix the build on non ppc machines
llvm-svn: 18235
2004-11-25 06:14:45 +00:00
Reid Spencer
2686464378 PR256 fixed.
llvm-svn: 18234
2004-11-25 06:07:42 +00:00
Reid Spencer
3d50017178 Fix the lib/System/platform link by using proper cached variable name.
llvm-svn: 18233
2004-11-25 06:03:14 +00:00
Reid Spencer
0241e38ef7 For PR256:
* cache more values
* standardize cache value names
* organize configure script per autoconf recommendations (10 sections)
* Eliminate some redundancies and complexities in the script
* Provide better documentation in the script.

llvm-svn: 18232
2004-11-25 04:51:04 +00:00
Reid Spencer
7c93739bc5 Cache the value of this test.
llvm-svn: 18231
2004-11-25 04:44:46 +00:00
Reid Spencer
0388846f25 Tidy up the indentation. Give the cache variable a proper name.
llvm-svn: 18230
2004-11-25 04:43:54 +00:00
Reid Spencer
026eda3ec8 Eliminate duplicate "checking" message.
llvm-svn: 18229
2004-11-25 04:42:25 +00:00
Chris Lattner
497a622376 The JIT works enough
llvm-svn: 18228
2004-11-25 04:14:54 +00:00
Chris Lattner
da76c16ba4 Fix encoding of fsel, fixing olden/power, McCat/bisort and several others.
All of Olden passes now! :)

llvm-svn: 18227
2004-11-25 04:11:07 +00:00
Chris Lattner
305f78f646 Fix encoding of fneg instruction
llvm-svn: 18226
2004-11-25 03:53:44 +00:00
Chris Lattner
191e525bae Fix encoding of swari, fixing several programs, including Olden/mst
llvm-svn: 18225
2004-11-25 03:40:20 +00:00
Reid Spencer
58a9fe55fa Make the check print something, give the cache var an llvm specific name.
llvm-svn: 18224
2004-11-25 03:33:03 +00:00
Chris Lattner
5d8ae54267 There is not a 1-1 mappign between llvm blocks and PPC blocks, do not use
LLVM blocks as the keys for the branch rewriter.  This fixes treeadd and
many other programs with the JIT.

llvm-svn: 18223
2004-11-25 00:33:57 +00:00
Chris Lattner
dd516799d7 * Rename existing relocations to be more specific
* Add relocations for refernces to non-lazy darwin stubs and implement
  them correctly.

With this change, we can correctly references external globals, and now
all but two UnitTests and all but 1 Regression/C tests pass.

More importantly, bugpoint-jit will start giving us useful testcases,
instead of always telling us that references to external globals don't
work :)

llvm-svn: 18222
2004-11-24 22:30:08 +00:00
Nate Begeman
e49936af54 Add the same optimization that we do loading from fixed alloca slots to
storing to fixed alloca slots.

llvm-svn: 18221
2004-11-24 21:53:14 +00:00
Chris Lattner
078b6f2b62 Write CompilationCallback as an explicit assembly stub to avoid getting GCC's
prolog.

llvm-svn: 18220
2004-11-24 21:01:46 +00:00
Chris Lattner
659d72e319 When rewriting the original call instruction, make sure to rewrite it to
call the right address.

llvm-svn: 18213
2004-11-24 18:00:02 +00:00
Chris Lattner
cb9af557e7 Force the intregs ptr into R2 and the FPregs ptr into R3. This fixes a really
obscure problem where we were doing:

lmw     r3,0(r9)

which is undefined on PPC.  Now we do:

lmw     r3,0(r2)

by force, not relying on the GCC register allocator for luck :)

llvm-svn: 18212
2004-11-24 17:42:55 +00:00
Reid Spencer
80bb693109 Implement and document prefix options with arbitrary values including an
= sign. This needed to support -DNAME=value options as pass-through in
llvmc.

llvm-svn: 18203
2004-11-24 06:13:42 +00:00
Brian Gaeke
7217642438 Update list of failing benchmarks.
llvm-svn: 18202
2004-11-24 04:07:42 +00:00
Brian Gaeke
1139802b98 Fix bug in emitGEPOperation with large struct-member offsets.
llvm-svn: 18201
2004-11-24 04:07:33 +00:00
Chris Lattner
130888ad37 Fix a few more tests by encoding the extsb and other XForm11 instructions
correctly.

llvm-svn: 18200
2004-11-24 03:52:02 +00:00
Chris Lattner
022e271db5 Fix the encoding of ORi and other DForm4 instructions. This brings us to
36/42 SingleSource/UnitTests passing!

llvm-svn: 18199
2004-11-24 02:15:41 +00:00
Chris Lattner
57542fcfc2 Loads are relocatable too
llvm-svn: 18198
2004-11-24 02:03:44 +00:00
Chris Lattner
7b1cf0d6c6 Calls do not need a MovPCtoLR instruction
llvm-svn: 18197
2004-11-24 02:00:06 +00:00
Chris Lattner
6a7ebe034e Get constant pools working. This fixes even more programs, allowing us to
pass 24/42 in UnitTests (up from 20).

llvm-svn: 18196
2004-11-24 01:56:12 +00:00
Tanya Lattner
13c71ca7b6 Forced branches to be first to be scheduled.
llvm-svn: 18195
2004-11-24 01:49:10 +00:00
Chris Lattner
193b6f3281 Rewrite branches more closely to correct. This makes more stuff pass, and
stops the infinite loops!

llvm-svn: 18194
2004-11-24 01:35:12 +00:00
Chris Lattner
b55f748b1a Branch instructions explicitly represent CRx in them. bEcause of this, encode
them explicitly as well.

llvm-svn: 18193
2004-11-24 01:15:19 +00:00
Nate Begeman
674fe0bb60 Fix encoding of bctrl, and remove some unused instructions
llvm-svn: 18192
2004-11-24 00:16:37 +00:00
Reid Spencer
67386ceacc Make sure additional C++ suffixes are recognized by llvmc.
llvm-svn: 18191
2004-11-24 00:01:57 +00:00
Reid Spencer
a61edd8e92 Add the configurable configuration files for llvmc.
llvm-svn: 18190
2004-11-23 23:48:45 +00:00
Reid Spencer
cfa51ff82b * Adjust the options to make them either accept multiple occurrences or be
optional so that compatibility with GCC is accomplished.
* Implement the -print-file-name option in an attempt to provide the same
  functionality as GCC. Unfortunately, without loading the cpp or c config
  files, this option won't help much.

llvm-svn: 18189
2004-11-23 23:47:58 +00:00
Reid Spencer
cd893a9c50 * Don't pass empty arguments to ExecuteAndWait because it can cause the
sub-tool to start reading its standard input instead of the specified
  input.
* Clean up ouput of path names on error.
* Extend GetPathForLinkageItem to always search the LibraryPaths and thus
  make it suitable for an interface function (required by llvmc.cpp).
* Implement support for language-specific default library paths.

llvm-svn: 18188
2004-11-23 23:45:49 +00:00
Reid Spencer
5e1e6b9f82 Configuration data now supports a vector of library paths.
Add the GetPathForLinkageItem method to the interface so full paths can
be generated for a given linkage item.

llvm-svn: 18187
2004-11-23 23:40:06 +00:00
Reid Spencer
fe6dd9da55 Add the c and cpp configuration files.
llvm-svn: 18186
2004-11-23 23:38:46 +00:00
Reid Spencer
e1ae9d7c00 Removed in favor of configurable (*.in) versions.
llvm-svn: 18185
2004-11-23 23:38:07 +00:00
Reid Spencer
d51dfe3946 Make various adjustments to parsing so that the separator character doesn't
terminate options or paths, so that SPACE tokens legally separate options
on a command line, and so that the lang.libs paths are parsed properly.

llvm-svn: 18184
2004-11-23 23:37:26 +00:00
Reid Spencer
513587fbe6 SPACE is a legitimate token now, to separate option words.
llvm-svn: 18183
2004-11-23 23:35:50 +00:00
Reid Spencer
6a0d9b99df Handle space, separators, bad substitutions, and library search path better
than before.

llvm-svn: 18182
2004-11-23 23:35:16 +00:00
Reid Spencer
c14e53efb8 Configurable language configuration files.
llvm-svn: 18181
2004-11-23 23:33:08 +00:00
Reid Spencer
a193f3cdbf Allow reading of member names that begin with an _ character.
llvm-svn: 18179
2004-11-23 22:35:39 +00:00
Chris Lattner
c7eeae4661 Fix encoding of blr and bctr
llvm-svn: 18178
2004-11-23 22:06:24 +00:00
John Criswell
fd769457b8 Added remark about GCC 3.2.2. Someone with more knowledge of the problem
can elaborate.

llvm-svn: 18177
2004-11-23 22:06:24 +00:00
Nate Begeman
c5fc6f5717 Use the correct register class as a constaint to gcc's inline assembly, so
that we don't end up trying to use r0 as a base register.

llvm-svn: 18176
2004-11-23 21:37:22 +00:00
Nate Begeman
617760687a Save/Restore arg regs and nonvolatile regs the compiler might use during
CompilationCallback

llvm-svn: 18175
2004-11-23 21:34:18 +00:00
Chris Lattner
578dfd5e42 Fix the encoding of OR, AND and many other instructions
llvm-svn: 18174
2004-11-23 21:17:35 +00:00
Brian Gaeke
94c58dc877 Support shr long/ulong.
llvm-svn: 18173
2004-11-23 21:10:50 +00:00
Brian Gaeke
8d4a5ad55c Support printing ConstantAggregateZeros.
llvm-svn: 18172
2004-11-23 21:10:49 +00:00
Brian Gaeke
2e7f71863f Update failing SingleSource test-case list.
llvm-svn: 18171
2004-11-23 21:10:48 +00:00
Chris Lattner
a630adebc7 Remove argtype and argcount magic, which was used by the old asmprinter.
llvm-svn: 18170
2004-11-23 20:41:34 +00:00
Chris Lattner
be39b8f541 Get rid of flags that are dead
llvm-svn: 18169
2004-11-23 20:37:41 +00:00
Misha Brukman
c3184445de We also provide a source distribution of the GCC front-end
llvm-svn: 18166
2004-11-23 19:26:24 +00:00
Chris Lattner
5f4b0e1bf7 Fix encoding of rlwinm?
llvm-svn: 18165
2004-11-23 19:23:32 +00:00
Chris Lattner
1238cca6df Fix encodings
llvm-svn: 18164
2004-11-23 19:23:18 +00:00
Chris Lattner
431e0132ef Enumerate CR registers
llvm-svn: 18162
2004-11-23 18:59:59 +00:00
Chris Lattner
a8936af13e Initial implementation of exiting CompilationCallback
This should save all argument registers on entry and restore on exit, despite
that, simple things seem to work!!!

llvm-svn: 18161
2004-11-23 18:49:46 +00:00
Chris Lattner
febc3eb8fa This method is dead
llvm-svn: 18160
2004-11-23 18:47:55 +00:00
Chris Lattner
24ad93f55c Remove this method.
llvm-svn: 18159
2004-11-23 18:47:42 +00:00
Reid Spencer
f675b49722 Make sure the timing output is also sent to the log file for dejagnu, not
the log file of the NightlyTest.pl script.

llvm-svn: 18158
2004-11-23 16:23:50 +00:00
Chris Lattner
cccd49f1b7 Squelch a bogus warning
llvm-svn: 18157
2004-11-23 15:57:01 +00:00
Chris Lattner
b1fd07a862 Squelch a bogus warning.
llvm-svn: 18156
2004-11-23 15:56:38 +00:00
Nate Begeman
7e7a08dba5 Don't return value from void function. This is only temporary anyway while
the JIT is made to work!

llvm-svn: 18155
2004-11-23 10:04:49 +00:00
Brian Gaeke
bde370eb58 pseudocode for 64-bit lshr.
llvm-svn: 18154
2004-11-23 08:14:09 +00:00
Chris Lattner
40ff89c212 Fix a minor bug
llvm-svn: 18153
2004-11-23 06:56:31 +00:00
Chris Lattner
5369ab3e24 Be really paranoid about not breaking stuff yet
llvm-svn: 18152
2004-11-23 06:56:18 +00:00
Chris Lattner
4ff117585d Implement the first hunk of CompilationCallback. The pieces missing are the
ones noted, which require funny PPC specific inline assembly.

If some angel felt the desire to help me, I think this is that last bit missing
for JIT support (however, generic code emitter might night work right with
the constant pool yet).

llvm-svn: 18151
2004-11-23 06:55:05 +00:00
Chris Lattner
96826dbaf3 Change formats, as suggested by Duraid
llvm-svn: 18150
2004-11-23 06:51:14 +00:00
Brian Gaeke
d3311665cc Add more known-failing tests.
llvm-svn: 18149
2004-11-23 06:39:50 +00:00
Brian Gaeke
2491727b5d Add the rest of the logical instructions.
llvm-svn: 18148
2004-11-23 06:39:37 +00:00
Chris Lattner
7445c5eadc Implement the stub needed to get into compilation callback.
llvm-svn: 18147
2004-11-23 06:27:02 +00:00
Chris Lattner
e1187d46a1 Simplify code a bit
llvm-svn: 18146
2004-11-23 06:05:44 +00:00
Chris Lattner
8296c4c323 Initial implementation of the JIT interfaces. Relocation is done and stubs
for external functions work.  CompilationCallback has not been written, and
stubs for internal functions are not generated yet.  This means you can call
printf and exit, and use global variables, but cannot call functions local to
a module yet.

llvm-svn: 18145
2004-11-23 06:02:06 +00:00
Chris Lattner
743a43424f Emit relocations for the global variable using instructions. This gets us
LA, LOADHiAddr, CALLpcrel, and MovePCtoLR working, though the constant pool
probably is not right.

llvm-svn: 18144
2004-11-23 05:59:53 +00:00
Reid Spencer
39d6a6116a Allow configuration files to be themselves configured and found in the
OBJ dir instead of only in the SRC dir.

llvm-svn: 18143
2004-11-23 05:59:53 +00:00
Chris Lattner
1c95751676 Implement all of the methods
llvm-svn: 18142
2004-11-23 05:57:57 +00:00
Chris Lattner
0b4eb3f806 Initial checkin of the 32-bit PPC relocation types
llvm-svn: 18141
2004-11-23 05:57:38 +00:00
Chris Lattner
f5363dc789 Move JITInfo from PPCTM to PPC32TM
llvm-svn: 18140
2004-11-23 05:56:40 +00:00
Chris Lattner
ae670d5895 Do not provide the non-specialized PowerPCJITInfo object, it is pretty useless.
Instead, let derived classes provide specialized ones.

llvm-svn: 18139
2004-11-23 05:55:38 +00:00
Chris Lattner
6500c6d332 LA is really addi. Be consistent with operand ordering to avoid confusing the code emitter
llvm-svn: 18138
2004-11-23 05:54:25 +00:00
Tanya Lattner
c3a7394291 Changed the CreateCodeToLoadConst function to preserve SSA form. This basically means adding extra tmp instructions for intermediate values.
llvm-svn: 18137
2004-11-23 04:22:29 +00:00
Chris Lattner
69e4cc55ef Remove some dead code
llvm-svn: 18136
2004-11-22 23:07:22 +00:00
Chris Lattner
40565d72d4 Comment out a couple of unused instructions.
llvm-svn: 18135
2004-11-22 23:07:01 +00:00
Chris Lattner
a76f09d0d3 Do not push two return addresses on the stack when we call external functions who have their addresses taken. This fixes test-call.ll
llvm-svn: 18134
2004-11-22 22:25:30 +00:00
Chris Lattner
b769690ab3 Add a note about the JIT changes.
llvm-svn: 18133
2004-11-22 22:09:58 +00:00
Chris Lattner
c5753055ea Rename Emitter.cpp -> JITEmitter.cpp
llvm-svn: 18132
2004-11-22 22:00:25 +00:00
Chris Lattner
88dc917c72 Fix the FIXME, nuke the JIT specific forceCompilationOf method.
llvm-svn: 18131
2004-11-22 21:54:35 +00:00
Chris Lattner
0e7faedde7 Disable this.
llvm-svn: 18130
2004-11-22 21:51:40 +00:00
Chris Lattner
213e39ee7c These methods are obsolete
llvm-svn: 18129
2004-11-22 21:48:33 +00:00
Chris Lattner
ad3840a2cc These methods are now obsolete
llvm-svn: 18128
2004-11-22 21:48:01 +00:00
Chris Lattner
8e9ed2747c This chunk of code needs to be rewritten
llvm-svn: 18127
2004-11-22 21:45:54 +00:00
Chris Lattner
54e1b22ea3 Remove some dead vars and some useless namespacification
llvm-svn: 18126
2004-11-22 21:42:40 +00:00
Chris Lattner
80ad8871e7 Implement a disgusting hack to work around broken machine code emission of
the RDCCR instruction.  This fixes a bunch of programs with the JIT.

llvm-svn: 18124
2004-11-22 21:25:10 +00:00
Tanya Lattner
ab9cf27cd0 Fixed a bug where I was trying to ModuloSchedule a loop with no instructions but a terminator.
Fixed a bug in the schedule generation that was always using the start cycle.

llvm-svn: 18123
2004-11-22 20:41:24 +00:00
Chris Lattner
c15c120342 Remove JIT-specific code from the code emitter.
llvm-svn: 18122
2004-11-22 20:25:10 +00:00
Chris Lattner
8edcdaa6eb New methods implemented
llvm-svn: 18121
2004-11-22 20:24:42 +00:00
Chris Lattner
b098ce7c8e Implement the Sparc JIT interfaces, including relocation support.
llvm-svn: 18120
2004-11-22 20:24:27 +00:00
Chris Lattner
f251eec757 Exit only with a value from 0-255.
llvm-svn: 18119
2004-11-22 19:50:41 +00:00
Chris Lattner
53e86c4bac %p is expanded by dejagnu, avoid it in the test.
llvm-svn: 18118
2004-11-22 19:25:45 +00:00
Chris Lattner
2bcd603149 Pull out failing test into a seperate file, which is xfailed
llvm-svn: 18117
2004-11-22 19:24:11 +00:00
Chris Lattner
a6b1e0e787 This was fixed
llvm-svn: 18116
2004-11-22 19:19:11 +00:00
Chris Lattner
9e90720658 Fix test/Regression/CFrontend/2003-11-01-EmptyStructCrash.c
llvm-svn: 18115
2004-11-22 19:15:27 +00:00
Chris Lattner
0157ac2de4 These tests really are failing, do not let them accidentally be XPASS.
Note that apparently 'failing command | succeeding command' is a fail on
csh but not on sh.  :(

llvm-svn: 18114
2004-11-22 19:11:40 +00:00
Chris Lattner
ee59b6bf22 Don't stop make if there are XFAIL or XPASSes
llvm-svn: 18113
2004-11-22 19:06:22 +00:00
Reid Spencer
b4e3ec8509 Add a note about the name change of libraries.
llvm-svn: 18112
2004-11-22 18:40:51 +00:00
Tanya Lattner
69ecc03683 Moved dejagnu log link to the template.
llvm-svn: 18111
2004-11-22 18:36:12 +00:00
Chris Lattner
540e5f92b4 Do not count debugger intrinsics in size estimation.
llvm-svn: 18110
2004-11-22 17:23:57 +00:00
Chris Lattner
79e87e39eb Ignore debugger intrinsics when doing inlining size computations.
llvm-svn: 18109
2004-11-22 17:21:44 +00:00
Chris Lattner
6d048a0d32 Do not consider debug intrinsics in the size computations for loop unrolling.
Patch contributed by Michael McCracken!

llvm-svn: 18108
2004-11-22 17:18:36 +00:00
Chris Lattner
a343a36713 Add a new debug intrinsic parent class. Patch contributed by Michael
McCracken, thanks!

llvm-svn: 18107
2004-11-22 17:18:05 +00:00
John Criswell
3249e3ef8c Fixed typo.
llvm-svn: 18106
2004-11-22 17:16:26 +00:00
Tanya Lattner
94556b33eb Changed to catch stderror of dejagnu and fixed missing quote.
llvm-svn: 18105
2004-11-22 17:16:01 +00:00
Chris Lattner
22ce929332 This is the proper code for this method, thanks to Reid for getting CVS working
again.

llvm-svn: 18103
2004-11-22 16:54:54 +00:00
John Criswell
41509625a0 Moved into the poolalloc tree.
llvm-svn: 18102
2004-11-22 16:32:35 +00:00
Reid Spencer
3c51c6c533 Implement a missing function called by JIT/Emitter.cpp but never defined.
NOTE: Its not clear that this implementation is correct.
CHRIS: Please review this!
llvm-svn: 18101
2004-11-22 12:38:36 +00:00
Brian Gaeke
dd10ba214e Add stub method for long shift codegen.
llvm-svn: 18100
2004-11-22 08:02:06 +00:00
Brian Gaeke
d1502c5c5d Update to-do list.
llvm-svn: 18099
2004-11-22 08:02:05 +00:00
Chris Lattner
50c2e117b3 Support targets that require stubs for external functions better
llvm-svn: 18098
2004-11-22 07:24:43 +00:00
Reid Spencer
db372c707b Fix a comment to imply the correct semantics.
llvm-svn: 18097
2004-11-22 02:58:47 +00:00
Reid Spencer
4aa5f67a2e Make sure output goes in the temporary/output directory.
llvm-svn: 18096
2004-11-22 02:46:31 +00:00
Chris Lattner
96304f816f Initial checkin of the V9 relocation types
llvm-svn: 18095
2004-11-22 00:40:51 +00:00
Reid Spencer
d0572b45b1 * Undo previous commit that breaks the test.
* Correct the test to work when srcdir == objdir.

NOTE: Since multiple tests run from the same source archive and llvm-ranlib
changes the archive, these tests MUST work on a copy of the archive or else
this test corrupts the archive file subsequent tests or subsequent runs of
the test suite.

llvm-svn: 18094
2004-11-21 21:28:56 +00:00
Reid Spencer
687b0fa8fb * Undo previous commit that breaks the test.
* Correct the test to work when srcdir == objdir.

NOTE: Since multiple tests run from the same source archive and llvm-ranlib
changes the archive, these tests MUST work on a copy of the archive or else
this test corrupts the archive file subsequent tests or subsequent runs of
the test suite.

llvm-svn: 18093
2004-11-21 21:22:56 +00:00
Reid Spencer
3f4f1e3511 First version of manual page for llvm-ld.
llvm-svn: 18092
2004-11-21 18:20:16 +00:00
John Criswell
e965bcd10e Fixed another typo.
llvm-svn: 18091
2004-11-21 15:11:37 +00:00
John Criswell
8f002b6b50 Corrected spelling mistakes.
llvm-svn: 18090
2004-11-21 14:58:12 +00:00
John Criswell
a9f34caf42 It looks like I'm fixing a spelling mistake, but I'm really trying to
replicate the CVS performance problems that Reid is seeing.

llvm-svn: 18089
2004-11-21 14:34:34 +00:00
Brian Gaeke
29a4b354a3 Implement setcc on longs.
llvm-svn: 18088
2004-11-21 08:11:28 +00:00
Brian Gaeke
8ab27507fd Add all the rest of the ADD and SUB variants, some of which are important for
64-bit support.

llvm-svn: 18087
2004-11-21 07:13:17 +00:00
Brian Gaeke
46cdc9e043 Support add, sub, mul, div, rem on longs/ulongs (latter 3 by emitting libcalls).
Add a big comment containing my notes on how to do setcc for longs/ulongs.

llvm-svn: 18086
2004-11-21 07:13:16 +00:00
Brian Gaeke
07ef7e0ae1 Update to-do list.
llvm-svn: 18085
2004-11-21 07:13:15 +00:00
Nate Begeman
6c9375b20c Fix Shootout-C++/wc, which was broken by my recent changes to emit fewer
reg-reg copies.  The necessary conditions for this bug are a GEP that is
used outside the basic block in which it is defined, whose components
other than the pointer are all constant zero, and where the use is
selected before the definition (backwards branch to successsor block).

llvm-svn: 18084
2004-11-21 05:14:06 +00:00
Chris Lattner
f530831f84 Fix a warning
llvm-svn: 18083
2004-11-21 04:42:32 +00:00
Chris Lattner
d68ebaacc0 There is no reason to emit function stubs for direct calls.
llvm-svn: 18082
2004-11-21 03:46:06 +00:00
Chris Lattner
9de8e2225f Clean up DEBUG output
llvm-svn: 18081
2004-11-21 03:44:32 +00:00
Chris Lattner
65f6638822 Allow targets to avoid emitting a stub for EVERY lazily resolved call. In
most cases (e.g. direct calls) no stub is needed.

llvm-svn: 18080
2004-11-21 03:37:42 +00:00
Brian Gaeke
016bd3ba11 Fix extraStack calculation -- I think in fact it might be getting a bit *too*
much stack, but that's better than not enough, which leads to miscompilations.

Fix FP vaarg.

llvm-svn: 18079
2004-11-21 03:35:22 +00:00
Brian Gaeke
83189cdff3 Update list of failing benchmarks & to-do list.
llvm-svn: 18078
2004-11-21 03:35:21 +00:00
Chris Lattner
75178bfaea Add another bit, to make the JIT a bit more efficient.
llvm-svn: 18077
2004-11-21 03:27:13 +00:00
Reid Spencer
19bea847bc Test archive built with GNU ar(1).
llvm-svn: 18076
2004-11-21 01:36:59 +00:00
Tanya Lattner
72aca859c2 Made dejagnu option lower case.
llvm-svn: 18075
2004-11-21 00:10:12 +00:00
Tanya Lattner
c3d696fe04 Added the ability to run Dejagnu tests.
llvm-svn: 18074
2004-11-21 00:02:40 +00:00
Chris Lattner
894bf8eed0 ignore generated files
llvm-svn: 18073
2004-11-21 00:01:54 +00:00
Chris Lattner
aee9a76f52 ignore generated files.
llvm-svn: 18072
2004-11-21 00:00:54 +00:00
Chris Lattner
5c8c75fbe5 Ignore generated files
llvm-svn: 18071
2004-11-21 00:00:04 +00:00
Chris Lattner
fed24b6b04 Ignore files
llvm-svn: 18070
2004-11-20 23:58:43 +00:00
Chris Lattner
60d815a18b Implement relocation support by adding a target independent resolver interface.
llvm-svn: 18069
2004-11-20 23:57:07 +00:00
Chris Lattner
d02c9eb697 Remove all JIT specific code and switch the code generator over to emitting
relocations for global references.

llvm-svn: 18068
2004-11-20 23:55:15 +00:00
Chris Lattner
b7e72cba22 Implement the X86 JIT interfaces
llvm-svn: 18067
2004-11-20 23:54:33 +00:00
Chris Lattner
8f2ed923ea Describe the X86 target-specific relocations.
llvm-svn: 18066
2004-11-20 23:54:19 +00:00
Chris Lattner
8c645ec0d3 We implement these interfaces
llvm-svn: 18065
2004-11-20 23:53:56 +00:00
Chris Lattner
5f3d274f5f Adjust to changed interfaces
llvm-svn: 18064
2004-11-20 23:53:26 +00:00
Chris Lattner
292bb60053 Change this interface a bit
llvm-svn: 18063
2004-11-20 23:52:43 +00:00
Tanya Lattner
f3c3ba6b7a Adding missing dg file.
llvm-svn: 18062
2004-11-20 23:51:38 +00:00
Chris Lattner
374301ecb9 This method does not exist any longer.
llvm-svn: 18061
2004-11-20 23:51:03 +00:00
Chris Lattner
e7322e2ee9 Add new methods that a target should implement
llvm-svn: 18060
2004-11-20 23:50:02 +00:00
Tanya Lattner
017b0ec39b Removing unnecessary copies. Use %p to reference them.
llvm-svn: 18059
2004-11-20 23:47:23 +00:00
Chris Lattner
858d87b907 Add missing #include
llvm-svn: 18058
2004-11-20 23:40:54 +00:00
Tanya Lattner
d27b014459 Fixed assertion from triggering. We need to check if the commandline map is empty before checking if an arg exists.
llvm-svn: 18057
2004-11-20 23:35:20 +00:00
Reid Spencer
9afecaf4ff Cast the void* handle data member to HMODULE* to keep the VC++ compiler
happy. Thanks to Henrik Bach for pointing this out.

llvm-svn: 18056
2004-11-20 23:30:55 +00:00
Brian Gaeke
a8ea7d9cdb Support most cases of vaarg (except double).
llvm-svn: 18055
2004-11-20 22:50:42 +00:00
Brian Gaeke
a45e7c40d4 Update failing test cases & to-do list.
llvm-svn: 18054
2004-11-20 22:50:41 +00:00
Reid Spencer
db7249e609 Use llvmc to compile test cases
llvm-svn: 18053
2004-11-20 21:03:34 +00:00
Reid Spencer
66c2d807a3 Get the -o option right
llvm-svn: 18052
2004-11-20 20:45:33 +00:00
Reid Spencer
835060938c Get the -o option right
llvm-svn: 18051
2004-11-20 20:39:33 +00:00
Reid Spencer
27962c7997 Not needed any more.
llvm-svn: 18050
2004-11-20 20:27:20 +00:00
Reid Spencer
72f75bc3b7 Content moved to llvm-ld.cpp
llvm-svn: 18049
2004-11-20 20:15:08 +00:00
Reid Spencer
0c66f97ae6 Incorporate GenerateCode.cpp. Make static things static.
llvm-svn: 18048
2004-11-20 20:02:56 +00:00
Reid Spencer
dac73aa00a First cut at implementing generic link-time Optimization
llvm-svn: 18047
2004-11-20 19:43:28 +00:00
Reid Spencer
0e8c76ed90 The Archive class now has differentiation for BSD4.4 and SVR4 style archive
symbol tables. Adjust our usage to compensate.

llvm-svn: 18046
2004-11-20 18:01:22 +00:00
Reid Spencer
ab8bf46913 Test floating point constants
llvm-svn: 18045
2004-11-20 07:29:51 +00:00
Reid Spencer
7a32486483 Distinguish between BSD4.4 and SVR4 symbol tables
llvm-svn: 18044
2004-11-20 07:29:40 +00:00
Reid Spencer
e1b2aabf10 An llvm-ar test.
llvm-svn: 18043
2004-11-20 07:25:41 +00:00
Reid Spencer
ead62081ea Provide the srcdir variable.
llvm-svn: 18042
2004-11-20 07:25:10 +00:00
Reid Spencer
b4dd52ae4a Describe the Archive test suite.
llvm-svn: 18041
2004-11-20 07:24:28 +00:00
Reid Spencer
374df50e95 Contents separated into individual tests.
llvm-svn: 18040
2004-11-20 07:23:56 +00:00
Chris Lattner
233e9bb546 This method was never implemented
llvm-svn: 18039
2004-11-20 04:19:47 +00:00
Chris Lattner
6f01b4cf1f Remove this method, it's not clear how it could be implemented indep of 32 or 64-bit mode
llvm-svn: 18038
2004-11-20 04:17:17 +00:00
Chris Lattner
ae5ac03c1d getJITStubForFunction is optional and unimplemented, just remove it for now.
llvm-svn: 18037
2004-11-20 04:15:38 +00:00
Chris Lattner
f0c6aff268 getJITStubForFunction is optional and unimplemented, just remove it.
llvm-svn: 18036
2004-11-20 04:14:44 +00:00
Chris Lattner
6cf7a43603 Add getCurrentPCOffset() and addRelocation() methods.
Add stub support for relocations to finishFunction

llvm-svn: 18035
2004-11-20 03:46:14 +00:00
Chris Lattner
f6fcf39aed Add getCurrentPCOffset() and addRelocation() methods.
llvm-svn: 18034
2004-11-20 03:44:39 +00:00
Chris Lattner
50e498fac6 Add the getRelocationType method that I forgot
llvm-svn: 18033
2004-11-20 03:43:50 +00:00
Chris Lattner
6ee028a42a Allow targets to implement relocation support.
llvm-svn: 18032
2004-11-20 03:43:27 +00:00
Brian Gaeke
774e978e0d Implement vacopy and vanext.
llvm-svn: 18031
2004-11-20 03:32:12 +00:00
Chris Lattner
b7b78508a8 Add accessor
llvm-svn: 18030
2004-11-20 03:11:07 +00:00
Chris Lattner
1caf0161f2 New file
llvm-svn: 18029
2004-11-20 03:05:50 +00:00
Misha Brukman
72a57c3259 Allow constructor parameter to override aggregating args; fix spacing
llvm-svn: 18028
2004-11-20 02:20:27 +00:00
Chris Lattner
91a88ae6d1 Remove dead #include
llvm-svn: 18027
2004-11-20 02:17:03 +00:00
Misha Brukman
29d3d46c36 If we're going to mention mv and cp, clearly, we also need `rm'
llvm-svn: 18026
2004-11-20 01:27:40 +00:00
Misha Brukman
4bf11e1618 Revert the patch that adds Function* for each 64-bit libc div/mul/rem that we
want to do; instead, we can use MachineInstr::addExternalSymbol(char*, bool) and
thus we don't have to modify the Module as we are code generating for it

llvm-svn: 18025
2004-11-20 00:10:20 +00:00
Tanya Lattner
2e4f222045 Made modsched hidden and changed so it matches the style of other options.
llvm-svn: 18024
2004-11-19 23:34:33 +00:00
Misha Brukman
f1ccebba3d Fix grammar
llvm-svn: 18023
2004-11-19 23:09:40 +00:00
Tanya Lattner
5615a28d13 Forgot to join srcdir and subdir for complete path for input files.
llvm-svn: 18022
2004-11-19 23:00:19 +00:00
Tanya Lattner
8287d24dd3 Adding srcdir arg. Added ability to specify the path to an input file. This is needed for when srcdir != objdir.
llvm-svn: 18021
2004-11-19 22:46:23 +00:00
Tanya Lattner
f1e4bf5b66 Adding srcdir arg
llvm-svn: 18020
2004-11-19 22:45:25 +00:00
Misha Brukman
ce75b2c2cf Add protoypes for 64-bit long/ulong div, mul, and rem functions
llvm-svn: 18019
2004-11-19 22:14:35 +00:00
Misha Brukman
dbe04afcb9 Fix file comment header
llvm-svn: 18018
2004-11-19 22:09:21 +00:00
Misha Brukman
a559eee32f Ignore files generated by pod2html
llvm-svn: 18017
2004-11-19 21:54:43 +00:00
Misha Brukman
1ed0fa5cdf * Remove disk space requirements, they vary wildly, depend on the number of
tools built, the build type, and we don't keep them up-to-date on all
  platforms
* AIX, Linux on PowerPC aren't fully-supported systems

llvm-svn: 18016
2004-11-19 21:53:22 +00:00
Misha Brukman
cb178bd478 Handle GhostLinkage case for completeness (should not be seen by the asm writer)
llvm-svn: 18015
2004-11-19 21:49:19 +00:00
Reid Spencer
7ac3426f3b Test case for reading MacOSX archives.
llvm-svn: 18014
2004-11-19 21:30:15 +00:00
Reid Spencer
23790aded8 MacOSX test archive (buggy).
llvm-svn: 18013
2004-11-19 21:29:45 +00:00
Brian Gaeke
1db83f7b73 Add VANext and VAArg stubs.
llvm-svn: 18012
2004-11-19 21:08:18 +00:00
Brian Gaeke
1c014df436 Implement va_start.
llvm-svn: 18011
2004-11-19 20:57:24 +00:00
Chris Lattner
4cd9def8b7 Dont' forget to switch back to decimal output
llvm-svn: 18010
2004-11-19 20:57:07 +00:00
Chris Lattner
c27389815d Match change in MachineCodeEmitter prototype.
llvm-svn: 18009
2004-11-19 20:56:46 +00:00
Chris Lattner
2d1c4962f3 External symbols are const char*'s now, change this to match.
llvm-svn: 18008
2004-11-19 20:56:22 +00:00
Chris Lattner
b3e3840e5c Instead of storing std::string's for ExternalSymbol references, rely on the
fact that all ExternalSymbols are actually string literals with static storage.
Thus we don't have to do anything special to hold them and we certainly don't
have to copy string data around.

llvm-svn: 18007
2004-11-19 20:46:15 +00:00
Brian Gaeke
3db46bd0e1 First part of varargs support: getting all varargs which could possibly
be in registers into memory.

llvm-svn: 18006
2004-11-19 20:31:08 +00:00
Chris Lattner
e404d724ea Fix a bug that caused stuff like this:
main at ./eh.cpp:1414 ->          printf("a\n");

to be printed, instead of this:

main at ./eh.cpp:14
14 ->          printf("a\n");

llvm-svn: 18005
2004-11-19 19:45:44 +00:00
Brian Gaeke
8bb29bf3f6 va_end can safely be codegen'd to nothing on v8.
llvm-svn: 18004
2004-11-19 19:21:34 +00:00
Brian Gaeke
201535d102 A very sorry stub implementation of varargs intrinsics...
llvm-svn: 18003
2004-11-19 18:53:59 +00:00
Brian Gaeke
1810073046 Update list of expected test failures.
llvm-svn: 18002
2004-11-19 18:48:29 +00:00
Brian Gaeke
3effd0d769 Fix bug in casting to long/ulong.
llvm-svn: 18001
2004-11-19 18:48:10 +00:00
Reid Spencer
b8930d72ae Make sure we can read an archive after it has been ranlib'd
llvm-svn: 18000
2004-11-19 18:44:31 +00:00
Chris Lattner
a8a8a03a85 Fix memory leaks, patch contributed by Morten Ofstad!
llvm-svn: 17999
2004-11-19 17:09:48 +00:00
Chris Lattner
37bcd99622 Patches to avoid "leaking" memory on process exit. Patch contributed by
Morten Ofstad!

llvm-svn: 17998
2004-11-19 17:08:15 +00:00
Reid Spencer
78e12c73e5 Correct the computation of when to add the padding. It is not based on the
member's size. It is based on the oddness/evenness of the file pointer.
This fixes a bug with llvm-ar not being able to read archives produced by
llvm-ranlib when there are members with odd long file name lengths.

llvm-svn: 17997
2004-11-19 17:08:00 +00:00
Chris Lattner
446948e094 Fix the exposed prototype for the lower packed pass, thanks to
Morten Ofstad.

llvm-svn: 17996
2004-11-19 16:49:34 +00:00
Chris Lattner
99a669b110 Add hooks to free all memory allocated by the singleton factories in these
files.  Patch contributed by Morten Ofstad!

llvm-svn: 17995
2004-11-19 16:39:44 +00:00
Chris Lattner
083ce459c7 Add static functions to clear singleton maps. Patch contributed by
Morten Ofstad!

llvm-svn: 17994
2004-11-19 16:39:04 +00:00
Chris Lattner
8943604aeb These methods are long gone, ConstantPointerRef is dead.
llvm-svn: 17993
2004-11-19 16:25:42 +00:00
Chris Lattner
d137be2d0d CPR is dead.
llvm-svn: 17992
2004-11-19 16:24:57 +00:00
Chris Lattner
ddf3b7997f Add note that this is for old bytecode files.
llvm-svn: 17991
2004-11-19 16:24:05 +00:00
Chris Lattner
1b4e78d9e6 Mission accomplished!
llvm-svn: 17990
2004-11-19 16:22:24 +00:00
Reid Spencer
dc23fe9ded Allow this to compile even on machines that HAVE the bzlib library but do
NOT have the bzlib.h header file. Go figure.

llvm-svn: 17989
2004-11-19 15:56:28 +00:00
Chris Lattner
d215992b35 This is a horrible hack to work around libstdc++ bugs :(
llvm-svn: 17988
2004-11-19 08:44:07 +00:00
Nate Begeman
488f4a4352 Eliminate another 6k register copies that the register allocator would just
coalesce out of hbd.  Speeds up compilation by 2% (0.6s)

llvm-svn: 17987
2004-11-19 08:01:16 +00:00
Chris Lattner
dad1823703 Fix a bug in the checkin where I adjusted this code to work when
LinkModules nukes the second module argument.

llvm-svn: 17986
2004-11-19 07:09:40 +00:00
Reid Spencer
0bcf9e4da6 Undo last change as its unnecessary.
llvm-svn: 17985
2004-11-19 04:59:07 +00:00
Reid Spencer
33fe653a94 Test case for xpg4 style archive files.
llvm-svn: 17984
2004-11-19 04:46:10 +00:00
Reid Spencer
866b586851 Test reading of SVR4 style archives with llvm-ar
llvm-svn: 17983
2004-11-19 04:45:19 +00:00
Reid Spencer
a8f3ed701a Test case for reading SVR4 style archives.
llvm-svn: 17982
2004-11-19 04:33:13 +00:00
Reid Spencer
fc9f779039 Don't save an iterator, just use post-increment.
llvm-svn: 17981
2004-11-19 03:44:10 +00:00
Reid Spencer
6abd4457e7 Solaris built archives in SVR4 and XPG4 styles.
llvm-svn: 17980
2004-11-19 03:41:57 +00:00
Reid Spencer
3356325996 Eliminate unsightly ;;
llvm-svn: 17979
2004-11-19 03:27:05 +00:00
Reid Spencer
9aa7a2b468 A test file that goes into the test archive.
llvm-svn: 17978
2004-11-19 03:24:02 +00:00
Reid Spencer
5d76fa0a3c Make a cast explicit.
llvm-svn: 17977
2004-11-19 03:20:09 +00:00
Reid Spencer
39a0347b79 Make findModulesDefiningSymbols modify its symbols argument so we can \
eliminate symbols defined by the archive efficiently

llvm-svn: 17976
2004-11-19 03:18:22 +00:00
Reid Spencer
c2455ca7b7 Reduce the amount of work in LinkInArchive by not searching the archive for
symbols it has already identified as not defining.

llvm-svn: 17975
2004-11-19 03:13:25 +00:00
Reid Spencer
519a247cf1 Obligatory DejaGnu/expect file.
llvm-svn: 17974
2004-11-19 02:26:35 +00:00
Nate Begeman
f4fd759f9e Generate fewer reg-reg copies for the register allocator to deal with.
This eliminates over 2000 in hbd alone.

llvm-svn: 17973
2004-11-19 02:06:40 +00:00
Tanya Lattner
0b40ee68e2 Fixed a typo.
llvm-svn: 17972
2004-11-19 01:26:37 +00:00
Tanya Lattner
fb966bac52 Added link to information on Statistic which is in the Programmers Manual.
llvm-svn: 17971
2004-11-19 01:25:14 +00:00
Chris Lattner
953075442d Delete stoppoints that occur for the same source line.
llvm-svn: 17970
2004-11-18 21:41:39 +00:00
Chris Lattner
4c9c99bda8 Add support for llvm.dbg.stoppoint
llvm-svn: 17969
2004-11-18 21:41:16 +00:00
Chris Lattner
2487431dee Line numbers are go for 1.4! :)
llvm-svn: 17967
2004-11-18 21:25:11 +00:00
Chris Lattner
af87e2c2b8 libpng is not even used by povray3.1 in the current configuration, just
drop it completely.

llvm-svn: 17966
2004-11-18 21:21:54 +00:00
Chris Lattner
ee21a973a1 Add MMC
llvm-svn: 17965
2004-11-18 21:04:21 +00:00
Reid Spencer
0dbf101c90 Duh, put tools in *bin* directory, not *tools* directory as per
PR456.

llvm-svn: 17964
2004-11-18 20:04:39 +00:00
Chris Lattner
7fd27e2c35 Remove debugging code, unneuter this functionality
llvm-svn: 17963
2004-11-18 19:42:50 +00:00
Chris Lattner
8cb483b335 remove debugging code
llvm-svn: 17962
2004-11-18 19:40:13 +00:00
Tanya Lattner
cb0da4f1b7 Fixed to fit in 80 columns.
llvm-svn: 17961
2004-11-18 18:47:29 +00:00
Reid Spencer
e4190faa0c Add notes about makefile changes and llvm-ar.
llvm-svn: 17960
2004-11-18 18:38:58 +00:00
Tanya Lattner
21590db8fd Adding option to llc for ModuloScheduling. By default it is turned off.
llvm-svn: 17959
2004-11-18 18:38:01 +00:00
Chris Lattner
de5626cd40 These methods are inlined
llvm-svn: 17958
2004-11-18 17:47:13 +00:00
Chris Lattner
8a8e988766 Update comments, now that CPR's are gone, inline the methods
llvm-svn: 17957
2004-11-18 17:46:57 +00:00
Chris Lattner
c08ac110df Check in hook that I forgot
llvm-svn: 17956
2004-11-18 17:24:20 +00:00
Reid Spencer
7e9e0b0c82 Fix PR456:\
Tools and libraries will be built into $(BUILD_OBJ_ROOT)/$(BuildMode)/bin and \
$(BUILD_OBJ_ROOT)/$(BuildMode)/lib, respectively. Furthermore, the example \
programs will go in $(BUILD_OBJ_ROOT)/$(BuildMode)/examples to keep them \
separate from the tools and hopefully out of the PATH. Install targets \
have not changed.

llvm-svn: 17953
2004-11-18 10:03:46 +00:00
Reid Spencer
231e4d7772 Include ltdl.h if we have it.
llvm-svn: 17952
2004-11-18 09:50:00 +00:00
Reid Spencer
6d854b0b07 Add checks for HAVE_LTDL_H and HAVE_LT_DLOPEN
llvm-svn: 17951
2004-11-18 09:49:13 +00:00
Reid Spencer
c4b5cfc602 Changes for testing presence of ltdl.h and lt_dlopen(), libtool functions
for cross-platform dynamic loading of shared objects.

llvm-svn: 17950
2004-11-18 09:47:37 +00:00
Brian Gaeke
de6e536849 Rewrite LoadArgumentsToVirtualRegs, making it match almost exactly how
visitCallInst works.  Support cast of byte/short/int to long.

llvm-svn: 17949
2004-11-18 07:43:33 +00:00
Brian Gaeke
2c6b9c914b Update current expected failures list - expand it to include all of
SingleSource. Update to-do list (open-coding refers to binary operations on
longs, not to passing them into functions, which we already support.)

llvm-svn: 17948
2004-11-18 07:43:32 +00:00
Nate Begeman
2b575bec80 Eliminate another common source of moves that the register allocator
shouldn't be forced to coalesce for us: folded GEP operations.  This too
fires thousands of times across the testsuite.

llvm-svn: 17947
2004-11-18 07:22:46 +00:00
Nate Begeman
5d9c292e7f When accessing the base register for global variables, use the register
directly rather than making a copy for the register allocator to coalesce.
This kills thousands of live intervals across the testsuite.

llvm-svn: 17946
2004-11-18 06:51:29 +00:00
Chris Lattner
b75e790a2b * There is no reason for SpillWeights to be an instance var
* Do not put fixed registers into the unhandled set.  This means they will
  never find their way into the inactive, active, or handled sets, so we
  can simplify a bunch of code.

llvm-svn: 17945
2004-11-18 06:01:45 +00:00
Chris Lattner
e3b9cb9959 There is no need to check to see if j overflowed in this loop as we're only
incrementing i.

llvm-svn: 17944
2004-11-18 05:28:21 +00:00
Chris Lattner
6e0c3f44ba Moderate head scratching reveals that this conditional is not needed. If
i->start == j->start, then certainly i->end > j->start.

llvm-svn: 17943
2004-11-18 05:19:02 +00:00
Nate Begeman
51f6635e42 Clean up and fix cast codegen by removing cases that are handled elsewhere,
and properly emitting signed short to unsigned int.  This fixes the last
regression vs. the CBE, MultiSource/Applications/hbd.

llvm-svn: 17942
2004-11-18 04:56:53 +00:00
Reid Spencer
dfa81ff3ff Dynamic Library abstraction. This makes the abstraction of a single dynamic
library (shared library/shared object) whose symbols can be looked up
dynamically. Used for plug-ins.

llvm-svn: 17941
2004-11-18 04:33:40 +00:00
Reid Spencer
4a763ca854 Dynamic Library abstraction. This makes the abstraction of a single dynamic
library (shared library/shared object) whose symbols can be looked up
dynamically. Used for plug-ins.

llvm-svn: 17940
2004-11-18 04:33:39 +00:00
Chris Lattner
08ec603bb0 Fix a couple of bugs where we considered physregs past their range as possibly
intersecting an interval.

llvm-svn: 17939
2004-11-18 04:33:31 +00:00
Chris Lattner
cf972ff7cb Fix typeo
llvm-svn: 17938
2004-11-18 04:31:10 +00:00
Chris Lattner
49ff5f0477 Start using the iterators in the fixed_ intervals to avoid having to binary
search physreg intervals every time we access it.  This takes another
half second off of linscan.

llvm-svn: 17937
2004-11-18 04:13:02 +00:00
Chris Lattner
7598c316e5 Take another .7 seconds off of linear scan time.
llvm-svn: 17936
2004-11-18 04:02:11 +00:00
Chris Lattner
850852c789 Add a counter for the number of times linscan has to backtrack. Start using
the iterator hints we have to speed up overlaps().  This speeds linscan up
by about .2s (out of 8.7) on 175.vpr for PPC.

llvm-svn: 17935
2004-11-18 03:49:30 +00:00
Chris Lattner
cb0c9655bf Add ability to give hints to the overlaps routines.
llvm-svn: 17934
2004-11-18 03:47:34 +00:00
Chris Lattner
a1f7779876 * Improve comments/documentation substantially
* Eliminate the releaseMemory method, this is not an analysis
* Change the fixed, active, and inactive lists of intervals to maintain an
  iterator for the current position in the interval.  This allows us to do
  constant time increments of the iterator instead of having to do a binary
  search to find our liverange in our liveinterval all of the time, which
  substantially speeds up cases where LiveIntervals have many LiveRanges
  - which is very common for physical registers.  On targets with many
  physregs, this can make a noticable difference.

  With a release build of LLC for PPC, this halves the time in
  processInactiveIntervals and processActiveIntervals, from 1.5s to .75s.

  This also lays the ground for more to come.

llvm-svn: 17933
2004-11-18 02:42:27 +00:00
Chris Lattner
0624f95175 Add new advanceTo method
llvm-svn: 17932
2004-11-18 02:37:31 +00:00
Chris Lattner
7d92fc7e89 Fix a minor bug in expiredAt. endNumber() is the first number that is not valid.
llvm-svn: 17931
2004-11-18 01:34:44 +00:00
Chris Lattner
a51f5eeac1 Rename some methods, use 'begin' instead of 'start', add new LiveInterval
iterator/begin/end members.

llvm-svn: 17930
2004-11-18 01:29:39 +00:00
Brian Gaeke
1553b58f39 Allocate fewer registers and tighten up alignment restrictions.
llvm-svn: 17929
2004-11-18 00:25:20 +00:00
Brian Gaeke
2a3e8a7268 Update to-do list.
llvm-svn: 17927
2004-11-17 22:33:55 +00:00
Brian Gaeke
3b10744e0f Update list of failing SingleSource Benchmarks
llvm-svn: 17926
2004-11-17 22:33:28 +00:00
Brian Gaeke
f1233fb84f We were (somehow) getting the wrong branch opcode for setcc float instrs.
llvm-svn: 17925
2004-11-17 22:06:56 +00:00
Alkis Evlogimenos
531e901deb Make ReturnInst accept a value of type void as the return value. The
ReturnInst constructed is the same as if NULL was passed instead of
the void value.

llvm-svn: 17923
2004-11-17 21:02:25 +00:00
Reid Spencer
f8d6f7e973 Add a standards section.
llvm-svn: 17921
2004-11-17 20:19:18 +00:00
Reid Spencer
91234ff57a Fix PR458:
* Don't include Makefile.rules in set of preconditions, it never has to be
  copied to objdir.
* Enable the "update makefile first before executing targets" feature in
  gnu make by *not* using a full path to the Makefile in the rule.

llvm-svn: 17920
2004-11-17 19:08:44 +00:00
Reid Spencer
67c46c8d70 Fix some things for Mac OSX archives:
* ensure trailing spaces are eliminated so they don't factor into the
  length of a member's name.
* make sure all the bytes of a name are written even if the name ends in
  multiple null characters (bug in OSX ar)
* make sure we provide the full member name when searching for symbols so
  the module name is not accidentally duplicated.

llvm-svn: 17918
2004-11-17 18:28:29 +00:00
Reid Spencer
b58bf5fa28 Make sure we parse bytecode with a module identifier that reflects the full
name of the module: "Archive.a(object.o)"

llvm-svn: 17917
2004-11-17 18:25:21 +00:00
Chris Lattner
d5f5288066 Make this more accurate
llvm-svn: 17916
2004-11-17 18:19:32 +00:00
Chris Lattner
1c18011de6 New prototype for lowerpacked pass.
llvm-svn: 17915
2004-11-17 18:01:49 +00:00
Chris Lattner
ba18b9a0da Generalize this code to turn any cast-to-first-element-of into a gep constexpr
llvm-svn: 17914
2004-11-17 17:59:35 +00:00
Chris Lattner
c368b63515 Simplify conditional and fix LICM/2004-11-17-UndefIndexCrash.ll
by saying what we mean

llvm-svn: 17913
2004-11-17 17:39:39 +00:00
Chris Lattner
9d339a75ae New testcase that crashes licm
llvm-svn: 17912
2004-11-17 17:39:19 +00:00
Chris Lattner
7a3767521d -disable-opt is not -O0, it's okay for it to disable internalize.
llvm-svn: 17911
2004-11-17 16:41:19 +00:00
Reid Spencer
1154bb6b43 Adjust long file name writing to match BSD 4.4 and Mac OSX style archives.
llvm-svn: 17910
2004-11-17 16:14:21 +00:00
Reid Spencer
0dea46fe67 Despite documentation to the contrary, Mac OSX and BSD 4.4 archive formats
*do* include the length of the long file in the length of the member and
they are *not* null terminated.

llvm-svn: 17909
2004-11-17 16:13:11 +00:00
Tanya Lattner
7beb51cd29 Added my own defMap. Only saving values that are not loop invariant. Fixed a couple of assertions that were triggered due to registers not being allocated. These both had to do with PHINodes.
llvm-svn: 17907
2004-11-16 21:31:37 +00:00
Chris Lattner
6d7c8d6801 Minor cleanup and speedup. This reduces link-time for 252.eon from 35.5s
to 34.7s with a profile build.

llvm-svn: 17906
2004-11-16 20:39:04 +00:00
Chris Lattner
b38dd7cf54 Make this function work with non-abstract types.
llvm-svn: 17905
2004-11-16 20:30:53 +00:00
Chris Lattner
f27514df9d Don't increment a dead iterator
llvm-svn: 17904
2004-11-16 19:04:40 +00:00
Chris Lattner
05fe0244e1 Even with -disable-opt we should still internalize and strip if requested.
llvm-svn: 17903
2004-11-16 18:59:20 +00:00
Chris Lattner
2004d90f97 Fix a major bug in the signed shr code, which apparently only breaks 134.perl!
llvm-svn: 17902
2004-11-16 18:40:52 +00:00
Reid Spencer
1b13a7cdb8 * Use low-level unix I/O interface since we're on Unix.
* Don't use variable length arrays (replaced with alloca)

llvm-svn: 17901
2004-11-16 17:14:08 +00:00
Chris Lattner
7391dde138 Simplify the remapper by only needing one map, since the body of the functions
being linked do not need to be remapped any longer.

llvm-svn: 17900
2004-11-16 17:12:38 +00:00
Reid Spencer
be01508f75 Make the comment for LinkFiles a bit more precise and easily understood.
llvm-svn: 17899
2004-11-16 16:46:22 +00:00
Chris Lattner
6e7336cc81 New testcase for recent patch to SCCP, thanks to Nate Begeman for pointing
out this recent regression

llvm-svn: 17898
2004-11-16 16:39:20 +00:00
Chris Lattner
27af257ea0 Do not delete dead invoke instructions!
llvm-svn: 17897
2004-11-16 16:32:28 +00:00
Misha Brukman
c356686749 Erase non-applicable Unix comment, this is Win32
llvm-svn: 17896
2004-11-16 07:35:32 +00:00
Brian Gaeke
b21ea3cb41 Update list of failing benchmarks
llvm-svn: 17895
2004-11-16 07:32:58 +00:00
Brian Gaeke
97f8adffff Correct the implicit-defs information for indirect and direct calls.
You can't have implicit defs that overlap explicit defs, or implicit
defs that alias one another.

llvm-svn: 17894
2004-11-16 07:32:09 +00:00
Chris Lattner
2f0557d0e4 Take advantage of the fact that we are allowed to clobber the input module
by splicing function bodies from the src module to the destination module.

This speeds up linking quite a bit, e.g. gccld time on 176.gcc from 26s -> 20s
when forming the .rbc file, with a profile build.  One of the really strange
but cool effects of this patch is that it speeds up the optimizers as well,
from 12s -> 10.7s, presumably because of better locality???

In any case, this is just a first step.  We can trivially get rid of the
LocalMap now and do other simplifications.

llvm-svn: 17893
2004-11-16 07:31:51 +00:00
Reid Spencer
4c66d89b33 Fix typeo in comment.
llvm-svn: 17892
2004-11-16 07:05:16 +00:00
Reid Spencer
7cdcb2b0cb Remove useless #include.
Patch contributed by Jeff Cohen.

llvm-svn: 17891
2004-11-16 07:00:23 +00:00
Reid Spencer
f070b6c4ac Simplify code.
Patch contributed by Jeff Cohen.

llvm-svn: 17890
2004-11-16 06:59:53 +00:00
Reid Spencer
f5e3cfe6d6 Standardize on 'class' instead of 'struct'. Gets rid of warnings in VC++
Patch contributed by Jeff Cohen.

llvm-svn: 17889
2004-11-16 06:58:55 +00:00
Reid Spencer
2732be9e52 Remove dupliate buid of Signals.cpp
Patch contributed by Jeff Cohen.

llvm-svn: 17888
2004-11-16 06:57:30 +00:00
Brian Gaeke
a057cd2401 Give a better message for a common assertion failure.
llvm-svn: 17887
2004-11-16 06:52:35 +00:00
Reid Spencer
f0173e0c48 Add a comment to some code that at first glance just doesn't look right.
llvm-svn: 17886
2004-11-16 06:50:36 +00:00
Reid Spencer
5208a11440 Per code review:\
* Adjust indentation\
* Ensure memory do not leak if exceptions happen (std::auto_ptr use)

llvm-svn: 17885
2004-11-16 06:47:41 +00:00
Reid Spencer
8d784fbd3f Per code review:\
* Make the numVbrBytes function more efficient and better documented \
* Fix a bug in name truncation \
* Add comments before functions \
* Get rid of functions that are now inlined into the header \
* Do not have Archive doing symbol table printing \
* Put assert comments into the assert so they print out \
* Make sure foreign symbol tables are written

llvm-svn: 17884
2004-11-16 06:47:30 +00:00
Reid Spencer
4abd79e8ea Per code review:\
* Make sure we write out the foreign symbol table if we read one \
* Make the padding calculation more efficiently and avoid Solaris warnings

llvm-svn: 17883
2004-11-16 06:47:19 +00:00
Reid Spencer
40878f35de Per code review:\
* Make sure all members are initialized upon construction

llvm-svn: 17882
2004-11-16 06:47:07 +00:00
Reid Spencer
6d737f5d24 Per code review:\
* Use STL names for STL operations \
* Do not have Archive doing symbol table printing \
* Avoid compiler warnings about only having private constructors.

llvm-svn: 17881
2004-11-16 06:46:55 +00:00
Chris Lattner
f2e808449d The second arg may be clobbered by this function
llvm-svn: 17880
2004-11-16 06:41:36 +00:00
Chris Lattner
5d6c23606d Document this as clobbering the second arg, make the second arg be non-const
llvm-svn: 17879
2004-11-16 06:41:21 +00:00
Reid Spencer
66dc515ed6 Per code review: \
* Make static things static \
* Get rid of unused TmpArchive variable \
* Implement symbol table printing \
* Adjust to changes in llvm::Archive interface \
* Make sure we destruct objects even if exceptions occur. \
* Fix a typo in an output string.

llvm-svn: 17878
2004-11-16 06:41:20 +00:00
Reid Spencer
9fc38b1712 Per code review: \
* hide the compatibility option \
* Make static things static \
* Use cl::extrahelp instead of cl::MoreHelp (defunct) \
* Use cl::PrintHelpMessage instead of our own printUse function \
* Use a std::set<sys::Path> for the path list because its now required by \
  the sys::Path class and also ensues directories are traversed in sorted \
  order.\
* Implement symbol table printing locally instead of in libLLVMArchive \
* Adjust to changes in llvm::Archive interface \
* Make sure we destruct objects even if exceptions occur. \
* Fix a typo in an output string.

llvm-svn: 17877
2004-11-16 06:41:09 +00:00
Reid Spencer
2df70a7e2f Per code review:\
* Get rid of memory leaks on exception \
* Provide better comments of how the memory handling works

llvm-svn: 17876
2004-11-16 06:41:05 +00:00
Chris Lattner
2981914302 use an autoptr
llvm-svn: 17875
2004-11-16 06:40:54 +00:00
Chris Lattner
d308797cae Make this code not depend on LinkModules leaving the second argument unmolested.
llvm-svn: 17874
2004-11-16 06:31:38 +00:00
Reid Spencer
09e9f2a37b Per code review:
* get rid of (void) construct in function declarations
* make toString a const member
* add a default implementation of toString for Win32

llvm-svn: 17873
2004-11-16 06:22:17 +00:00
Reid Spencer
91f505eae9 Per code review:
* Clean up the StatusInfo constructor to construct all members and give
  them reasonable values.
* Get rid of the Vector typedef and make the interface to
  getDirectoryContent use a std::set instead of a std::vector so the dir
  content is sorted.
* Make the getStatusInfo method const and not return a useless boolean.

llvm-svn: 17872
2004-11-16 06:15:19 +00:00
Reid Spencer
5e5547045b Per code review:
*Implement/Document the cl::extrahelp feature instead of the MoreHelp ptr.

llvm-svn: 17871
2004-11-16 06:11:52 +00:00
Chris Lattner
f242979cd0 Simplify namespaces
llvm-svn: 17870
2004-11-16 04:47:33 +00:00
Chris Lattner
6b7652fae5 Remove a dead function, which died when we got GAS emission working (phwew,
hold your nose!)

llvm-svn: 17869
2004-11-16 04:34:29 +00:00
Chris Lattner
c927072b50 Implement a simple FIXME: if we are emitting a basic block address that has
already been emitted, we don't have to remember it and deal with it later,
just emit it directly.

llvm-svn: 17868
2004-11-16 04:30:51 +00:00
Chris Lattner
2e182fc39b * Merge some win32 ifdefs together
* Get rid of "emitMaybePCRelativeValue", either we want to emit a PC relative
  value or not: drop the maybe BS.  As it turns out, the only places where
  the bool was a variable coming in, the bool was a dynamic constant.

llvm-svn: 17867
2004-11-16 04:21:18 +00:00
Misha Brukman
b4bd8de9a4 * Change test/projects => projects/llvm-test
* Add link to complete Command Guide in the "brief intro to major tools" section

llvm-svn: 17866
2004-11-15 23:20:51 +00:00
Chris Lattner
58d5b2a9bb Add an accessor
llvm-svn: 17865
2004-11-15 23:20:19 +00:00
Chris Lattner
1edd79a1bc Now that we have ghost linkage, we can force resolution of external symbols
immediately instead of lazily.

In this program, for example:

int main() {
  printf("hello world\n");
  printf("hello world\n");
  printf("hello world\n");
  printf("hello world\n");
}

We used to have to go through compilation callback 4 times (once for each
call to printf), now we don't go to it at all.

Thanks to Misha for noticing this, and for adding the initial ghost linkage
patches.

llvm-svn: 17864
2004-11-15 23:20:04 +00:00
Chris Lattner
b264f7f428 There is no reason to try to materialize the function from bytecode if it
already has been.  This may be a small speedup.

llvm-svn: 17863
2004-11-15 23:18:09 +00:00
Chris Lattner
9cc2dac7c1 Add debug-only=jit printout, so we see when lazily resolved symbols are
set up.

llvm-svn: 17862
2004-11-15 23:16:55 +00:00
Chris Lattner
34b754d99b Simplify and rearrange long shift code
llvm-svn: 17861
2004-11-15 23:16:34 +00:00
Chris Lattner
97f5c0e5df Update to reflect recent change
llvm-svn: 17860
2004-11-15 22:54:50 +00:00
Chris Lattner
3b6bb48c16 Do not emit FunctionBlock blocks for external functions. This shrinks
bytecode files by about 8 bytes per external function

llvm-svn: 17859
2004-11-15 22:39:49 +00:00
Chris Lattner
642f8c5ed4 Use a per-function flag bit to indicate whether or not there is a function
body for the function.

llvm-svn: 17858
2004-11-15 22:38:52 +00:00
Chris Lattner
9b457e1c73 Disable this change, it was premature
llvm-svn: 17857
2004-11-15 21:56:33 +00:00
Chris Lattner
7d04cdab77 Make *SURE* to null out the pointer before throwing an exception, otherwise
the dtor for the BytecodeReader class will try to free it again!

llvm-svn: 17856
2004-11-15 21:55:33 +00:00
Chris Lattner
36c95e38b0 Cleanups. Null out pointer after freeing it for paranoia
llvm-svn: 17855
2004-11-15 21:55:06 +00:00
Chris Lattner
94bd315c3f If a function is external, do not output a FunctionBlock for the function
AT ALL.  This saves 11 bytes per external function from the bytecode file,
and is also required to make GhostLinkage work.

llvm-svn: 17854
2004-11-15 21:46:40 +00:00
Chris Lattner
55d85402f6 Make functions default to having external linkage if they have no
FunctionBlock.

llvm-svn: 17853
2004-11-15 21:43:03 +00:00
Reid Spencer
16d3f968ba Remove useless/confusing namespace qualifier.
llvm-svn: 17852
2004-11-15 21:27:05 +00:00
Misha Brukman
a8c99d4daf Add BCTR and LWZU instruction opcodes
llvm-svn: 17851
2004-11-15 21:20:09 +00:00
Reid Spencer
38fcf309fc Merge content of RequiredSoftware.html into GettingStarted.html
Remove now defunct RequiredSoftware.html.

llvm-svn: 17850
2004-11-15 21:15:12 +00:00
Misha Brukman
dca7238d56 * Add entry for Linux/PowerPC
* Mark MacOS X/PPC support as 32-bit-only
* Fix FreeBSD space usage -- it's in MB, not GB

llvm-svn: 17848
2004-11-15 21:05:08 +00:00
Misha Brukman
ef8d601a53 Be less verbose when The' and command' just aren't necessary
llvm-svn: 17846
2004-11-15 20:39:30 +00:00
Misha Brukman
6c668c4fba No need for the verbose the llvm-link command' when simply llvm-link' will do
llvm-svn: 17845
2004-11-15 20:36:39 +00:00
Misha Brukman
16c9176043 Force a short link to gccld's man page
llvm-svn: 17844
2004-11-15 20:32:58 +00:00
Misha Brukman
da25907381 Fix syntax within a B<> tag
llvm-svn: 17843
2004-11-15 20:30:19 +00:00
Reid Spencer
e51e5724b7 Remove personal email address.
llvm-svn: 17842
2004-11-15 20:25:08 +00:00
Misha Brukman
4055d31868 Add the PowerPC 32-bit ABI output option
llvm-svn: 17840
2004-11-15 20:22:49 +00:00
Chris Lattner
cc93ee5b45 Bump version. Shouldn't this come from somewhere else??
llvm-svn: 17839
2004-11-15 20:06:11 +00:00
Misha Brukman
a8e1718932 * Add an entry for llvm-ranlib
* Add missing dashes

llvm-svn: 17838
2004-11-15 19:53:43 +00:00
Misha Brukman
774a6be462 This is llvm-ar, not llvm-as.
llvm-svn: 17837
2004-11-15 19:50:15 +00:00
Reid Spencer
d4d25bdb2b Remove reference to llvm-ld.
llvm-svn: 17836
2004-11-15 19:47:20 +00:00
Reid Spencer
38f5a1c6c4 Terminate a list.
Remove reference to llvm-ld

llvm-svn: 17835
2004-11-15 19:45:29 +00:00
Misha Brukman
d92f54ae6e Remove extra space char
llvm-svn: 17834
2004-11-15 19:30:05 +00:00
Tanya Lattner
8213dae317 This file was originally developed by the LLVM research group so this comment should stay. I also do NOT want my name explicity listed on src files. I am already mentioned in the credits.
llvm-svn: 17833
2004-11-15 19:21:49 +00:00
Reid Spencer
bfa25440e7 Changes/corrections suggested from Chris Lattner's review.
llvm-svn: 17832
2004-11-15 19:12:06 +00:00
Chris Lattner
a2b02a8b05 Warning fixes for VC++, contributed by Morten Ofstad!
llvm-svn: 17831
2004-11-15 19:02:35 +00:00
Reid Spencer
9339638e9c Remove unused variable for compilation by VC++.
Patch contributed by Morten Ofstad.

llvm-svn: 17830
2004-11-15 17:29:41 +00:00
Reid Spencer
b40098e334 Updates to Visual C++ project files for building on win32.
Patch contributed by Morten Ofstad.

llvm-svn: 17829
2004-11-15 17:28:08 +00:00
Reid Spencer
6e886d051c Update relative files.
Patch contributed by Morten Ofstad.

llvm-svn: 17828
2004-11-15 17:27:00 +00:00
Reid Spencer
1ae1656363 Provide the ThrowErrno utility.
Patch contributed by Morten Ofstad

llvm-svn: 17827
2004-11-15 17:21:57 +00:00
Reid Spencer
b96afe4b7e Adjust implementation to match new interface.
Patch provided by Morten Ofstad

llvm-svn: 17826
2004-11-15 17:20:28 +00:00
Chris Lattner
1890f94413 Minor cleanups. There is no reason for SCCP to derive from instvisitor anymore.
llvm-svn: 17825
2004-11-15 07:15:04 +00:00
Chris Lattner
9a038a3a5e Count more accurately
llvm-svn: 17824
2004-11-15 07:02:42 +00:00
Brian Gaeke
55157f0865 Update list of failing Benchmarks.
llvm-svn: 17823
2004-11-15 05:57:26 +00:00
Brian Gaeke
9dcb2fe161 Expand Defs to encompass all the possibly-call-clobbered regs.
llvm-svn: 17822
2004-11-15 05:56:53 +00:00
Chris Lattner
97013636cd Quiet warnings on the persephone tester
llvm-svn: 17821
2004-11-15 05:54:07 +00:00
Chris Lattner
d18c16b842 Two minor improvements:
1. Speedup getValueState by having it not consider Arguments.  It's better
    to just add them before we start SCCP'ing.
 2. SCCP can delete the contents of dead blocks.  No really, it's ok!  This
    reduces the size of the IR for subsequent passes, even though
    simplifycfg would do the same job.  In practice, simplifycfg does not
    run until much later than sccp in gccas

llvm-svn: 17820
2004-11-15 05:45:33 +00:00
Misha Brukman
b068167941 Replace the textual description with table specifying disk space requirements
llvm-svn: 17819
2004-11-15 05:19:53 +00:00
Chris Lattner
4f0316229c rename InstValue to LatticeValue, as it holds for more than instructions.
llvm-svn: 17818
2004-11-15 05:03:30 +00:00
Reid Spencer
dacbf466c8 Actually get the #include correct so it compiles .. duh.
llvm-svn: 17817
2004-11-15 04:47:22 +00:00
Chris Lattner
074be1f6e4 Substantially refactor the SCCP class into an SCCP pass and an SCCPSolver
class.  The only changes are minor:

 * Do not try to SCCP instructions that return void in the rewrite loop.
   This is silly and fool hardy, wasting a map lookup and adding an entry
   to the map which is never used.
 * If we decide something has an undefined value, rewrite it to undef,
   potentially leading to further simplications.

llvm-svn: 17816
2004-11-15 04:44:20 +00:00
Reid Spencer
315efa1a84 Make it actually compile on Solaris.
llvm-svn: 17815
2004-11-15 04:42:44 +00:00
Reid Spencer
9b3a69175d Consolidate the implementation of TimeValue::now() for Unix to use the
seemingly ubiquitous gettimeofday(3) call.

llvm-svn: 17814
2004-11-15 04:36:36 +00:00
Reid Spencer
bfb7b3eb68 Consolidate the implementation of TimeValue::now() for Unix to use the
seemingly ubiquitous gettimeofday(3) call.

llvm-svn: 17813
2004-11-15 04:36:35 +00:00
Reid Spencer
cbd9aeb587 * Make sure the string table gets read even if there isn't a foreign
symbol table.
* Make sure we update the file pointer for each member when rebuilding the
  symbol table.

llvm-svn: 17812
2004-11-15 01:40:20 +00:00
Reid Spencer
fcf5ef7a4a Changes necessary to enable linking of archives without LLVM symbol tables.
llvm-svn: 17811
2004-11-15 01:20:11 +00:00
Reid Spencer
a67b6e1874 Remove a forgotten debug output line.
llvm-svn: 17810
2004-11-14 23:49:55 +00:00
Reid Spencer
7705ec231c Implement functionality suggested from code review: getStatusInfo should
returnn false if the file doesn't exist rather than throw ane exception.

llvm-svn: 17809
2004-11-14 23:30:38 +00:00
Reid Spencer
e554760178 Changes per code review:
* Document StatusInfo fields better
* No lines > 80 cols
* Have getStatusInfo return bool if file doesn't exist
* Don't document in detail how temporary file name should be created.

llvm-svn: 17808
2004-11-14 23:29:00 +00:00
Reid Spencer
9b0ddbbe2c Linker.h moved to include/llvm from include/llvm/Support.
llvm-svn: 17807
2004-11-14 23:27:04 +00:00
Reid Spencer
6881623775 Make sure IdentifyFileType is in the sys namespace.
llvm-svn: 17806
2004-11-14 23:26:18 +00:00
Reid Spencer
4cee8e3365 Linker.h moved to include/llvm.
llvm-svn: 17805
2004-11-14 23:25:32 +00:00
Reid Spencer
aede779b1c bugpoint needs LLVMLinker.a now.
llvm-svn: 17804
2004-11-14 23:23:18 +00:00
Reid Spencer
b3eaba688d Correct call of methods whose names have changed.
llvm-svn: 17803
2004-11-14 23:17:41 +00:00
Reid Spencer
36c3a58557 This program needs libLLVMLinker.a now
llvm-svn: 17802
2004-11-14 23:12:22 +00:00
Reid Spencer
16c3bb3198 Linker.h has a new home.
llvm-svn: 17801
2004-11-14 23:00:08 +00:00
Reid Spencer
6456d2f26d Moved to lib/Bytecode/Archive.
llvm-svn: 17800
2004-11-14 22:38:32 +00:00
Alkis Evlogimenos
55117fa471 Add missing include.
llvm-svn: 17799
2004-11-14 22:37:42 +00:00
Reid Spencer
b2d0fa0823 Fix usage of changed function prototype
llvm-svn: 17798
2004-11-14 22:30:54 +00:00
Reid Spencer
34fae46c87 A tool for adding a symbol table to LLVM Archives
llvm-svn: 17797
2004-11-14 22:29:21 +00:00
Reid Spencer
30227fde87 Makefile for llvm-ranlib tool
llvm-svn: 17796
2004-11-14 22:28:33 +00:00
Reid Spencer
54a20f2009 *Fix usage of changed function prototype*Use Archive interface to symbol table for archives
llvm-svn: 17795
2004-11-14 22:27:46 +00:00
Reid Spencer
c762abe046 This tool needs libLLVMArchive now
llvm-svn: 17794
2004-11-14 22:27:00 +00:00
Reid Spencer
0cb8c8c2af Remove linking declarations (in Linker.h now)
llvm-svn: 17793
2004-11-14 22:25:26 +00:00
Reid Spencer
e7814f62b9 We need the libLLVMArchive library now
llvm-svn: 17792
2004-11-14 22:23:31 +00:00
Reid Spencer
8d3f9038c1 Moved to lib/Linker (common with gccld)
llvm-svn: 17791
2004-11-14 22:22:45 +00:00
Reid Spencer
84a12bfbd0 Total rewrite using Archive library & new functionality
llvm-svn: 17790
2004-11-14 22:20:07 +00:00
Reid Spencer
23dcddf47f This tool needs the libLLVMArchive library now.
llvm-svn: 17789
2004-11-14 22:19:21 +00:00
Reid Spencer
5f7d9675d4 Remove linking declarations (in Linker.h now)
llvm-svn: 17788
2004-11-14 22:17:49 +00:00
Reid Spencer
5ccfd9aea1 Provide exception handling
llvm-svn: 17787
2004-11-14 22:17:03 +00:00
Reid Spencer
3afabd441b Moved to lib/Linker
llvm-svn: 17786
2004-11-14 22:15:31 +00:00
Reid Spencer
22f42243cc Add the llvm-ranlib tool
llvm-svn: 17785
2004-11-14 22:13:59 +00:00
Reid Spencer
e37b2fbcd4 Use llvm-ar not ar for constructing archive. Wrap at 80 cols.
llvm-svn: 17784
2004-11-14 22:13:13 +00:00
Reid Spencer
2dd5e71836 Forget strerror_r, it causes problems. Fix later when threading matters
llvm-svn: 17783
2004-11-14 22:10:54 +00:00
Reid Spencer
0d455997f8 Implement the toString method
llvm-svn: 17782
2004-11-14 22:10:08 +00:00
Reid Spencer
26e2bd44f2 Update for prototype changes
llvm-svn: 17781
2004-11-14 22:09:22 +00:00
Reid Spencer
c1d474f069 * Implement getDirectoryContents * Implement getStatusInfo * Implement setStatusInfo * Implement renameFile
llvm-svn: 17780
2004-11-14 22:08:36 +00:00
Reid Spencer
60c72a339b Fix bugs in class invariant
llvm-svn: 17779
2004-11-14 22:07:50 +00:00
Reid Spencer
8b89b8333e Include the correct implementation file
llvm-svn: 17778
2004-11-14 22:07:04 +00:00
Reid Spencer
05be57b518 Don't exceed 80 columns.
llvm-svn: 17777
2004-11-14 22:06:18 +00:00
Reid Spencer
0d0d07e0f0 Implement IdentifyFileType function
llvm-svn: 17776
2004-11-14 22:05:32 +00:00
Reid Spencer
cf602a8e67 Implement the high level interface to make (de)compression easier.
llvm-svn: 17775
2004-11-14 22:04:46 +00:00
Reid Spencer
1f4ab8b449 Implement the MoreHelp utility that calls a function to printmore help information if the MoreHelp global is not null.
llvm-svn: 17774
2004-11-14 22:04:00 +00:00
Reid Spencer
c470261d27 Don't bother with a re-linked library, ensure archive library is built.
llvm-svn: 17773
2004-11-14 22:03:14 +00:00
Reid Spencer
9db61d9e3a *Adjust prototypes for public interface. *Rewrite LinkInArchive to use symbol tables.
llvm-svn: 17772
2004-11-14 22:02:27 +00:00
Reid Spencer
71f51e603c Simplify compression code by using the high level interface to the Compressor
llvm-svn: 17771
2004-11-14 22:01:41 +00:00
Reid Spencer
0ce0d938b1 Add wrappers to get defined symbols from bytecode
llvm-svn: 17770
2004-11-14 22:00:48 +00:00
Reid Spencer
f01fc688ba Simplify handling of decompression
llvm-svn: 17769
2004-11-14 22:00:09 +00:00
Reid Spencer
0e36b8afb9 Simplify decompression code by using the high level interface to the Compressor
llvm-svn: 17768
2004-11-14 21:59:21 +00:00
Reid Spencer
f0c201b34d Completely rewritten to allow reading of archives and symbol table lookup in a more efficient manner.
llvm-svn: 17767
2004-11-14 21:58:33 +00:00
Reid Spencer
948ff3d628 Implementation declarations for Archive
llvm-svn: 17766
2004-11-14 21:57:46 +00:00
Reid Spencer
ba09b3bf28 First working version
llvm-svn: 17765
2004-11-14 21:56:59 +00:00
Reid Spencer
044adab53a Add the Archive library
llvm-svn: 17764
2004-11-14 21:55:27 +00:00
Reid Spencer
c9e91ee004 Add the Linker library
llvm-svn: 17763
2004-11-14 21:54:41 +00:00
Reid Spencer
cbbc7dc9a4 *Make naming convention consistent.*Add convertion to/from Unix Epoch time.*Add ability to convert to readable string.
llvm-svn: 17762
2004-11-14 21:53:55 +00:00
Reid Spencer
95eecc880c Make the remove*OnSignal functions deal with Paths not strings
llvm-svn: 17761
2004-11-14 21:53:09 +00:00
Reid Spencer
21488afc70 *Put the StatusInfo type in the right section. *Provide the ability to rename a file.*Provide the ability to get/set stat(2) information.*Provide the ability to identify LLVM file types.
llvm-svn: 17760
2004-11-14 21:52:22 +00:00
Reid Spencer
c9e20eac69 Allow explicit closing of the MappedFile, before destruction
llvm-svn: 17759
2004-11-14 21:51:36 +00:00
Reid Spencer
b457a6bcbc Linker is its own module now. Moved to include/llvm/Linker.h
llvm-svn: 17758
2004-11-14 21:50:50 +00:00
Reid Spencer
01d36a4cc1 Add higher level interface to simplify use of Compressor
llvm-svn: 17757
2004-11-14 21:50:00 +00:00
Reid Spencer
8a09893f02 Add the MoreHelp function pointer. If non-null, this specifies a function to be called to print out additional help information
llvm-svn: 17756
2004-11-14 21:49:13 +00:00
Reid Spencer
04fbc475ef Remove ReadArchiveFile (functionality moved to Archive.h). Add an alternate form for GetBytecodeSymbols.
llvm-svn: 17755
2004-11-14 21:48:27 +00:00
Reid Spencer
791ad3829a Complete rewrite to get first working version.
llvm-svn: 17754
2004-11-14 21:47:41 +00:00
Reid Spencer
ec7a80bad2 Add a command for using llvm-ar correctly.
llvm-svn: 17753
2004-11-14 21:46:55 +00:00
Reid Spencer
c1bb479c54 Interface to Linker (revised/expanded from Support/Linker.h)
llvm-svn: 17752
2004-11-14 21:46:08 +00:00
Misha Brukman
704576301f GhostLinkage not allowed in LLVM AsmWriter, either
llvm-svn: 17751
2004-11-14 21:04:34 +00:00
Misha Brukman
7f245d47c5 GhostLinkage should not reach asm printing stage
llvm-svn: 17750
2004-11-14 21:03:49 +00:00
Misha Brukman
e225fa12ab Handle GhostLinkage (should not ever reach the assembly printing stage!)
llvm-svn: 17749
2004-11-14 21:03:30 +00:00
Misha Brukman
b2e062c9d5 Mark an unmaterialized function as having GhostLinkage
llvm-svn: 17748
2004-11-14 21:02:55 +00:00
Misha Brukman
f236e784f0 Add GhostLinkage for marking functions before they're fully materialized
llvm-svn: 17747
2004-11-14 21:02:28 +00:00
Chris Lattner
28eeb73f2f If a global is just loaded and restored, realize that it is not changing
value.  This allows us to turn more globals into constants and eliminate them.
This patch implements GlobalOpt/load-store-global.llx.

Note that this patch speeds up 255.vortex from:

Output/255.vortex.out-cbe.time:program 7.640000
Output/255.vortex.out-llc.time:program 9.810000

to:

Output/255.vortex.out-cbe.time:program 7.250000
Output/255.vortex.out-llc.time:program 9.490000

Which isn't bad at all!

llvm-svn: 17746
2004-11-14 20:50:30 +00:00
Chris Lattner
78d31c13ff New testcase. Believe it or not, this happens a LOT in vortex
llvm-svn: 17745
2004-11-14 20:41:39 +00:00
Misha Brukman
8b8ba9fcf7 Fix build on Linux/PowerPC64 using SuSE GCC (#undef PPC)
llvm-svn: 17744
2004-11-14 20:34:01 +00:00
Reid Spencer
b75e2d9224 Moved from include/llvm/Support/Linker.h
llvm-svn: 17743
2004-11-14 20:21:58 +00:00
Reid Spencer
b9e561e90c Moved to lib/Bytecode/Archive in preparation for re-write.
llvm-svn: 17742
2004-11-14 19:59:40 +00:00
Chris Lattner
46dd5a6304 This optimization makes MANY phi nodes that all have the same incoming value.
If this happens, detect it early instead of relying on instcombine to notice
it later.  This can be a big speedup, because PHI nodes can have many
incoming values.

llvm-svn: 17741
2004-11-14 19:29:34 +00:00
Chris Lattner
7515cabe2a Implement instcombine/phi.ll:test6 - pulling operations through PHI nodes.
This exposes subsequent optimization possiblities and reduces code size.
This triggers 1423 times in spec.

llvm-svn: 17740
2004-11-14 19:13:23 +00:00
Chris Lattner
fd6a717b95 New testcase: the phi can be eliminated if the casts are sucked into it.
Note that this reduces code size anyway (as well as making further
optimizations simpler) so it's always a win.

llvm-svn: 17739
2004-11-14 19:12:17 +00:00
Chris Lattner
2d6843c2f7 Fix typo
llvm-svn: 17738
2004-11-14 17:54:58 +00:00
Chris Lattner
8875ae91a4 add a testcase, which we already handle
llvm-svn: 17737
2004-11-14 17:54:27 +00:00
Chris Lattner
15ff1e1885 Transform this:
%X = alloca ...
  %Y = alloca ...
    X == Y

into false.  This allows us to simplify some stuff in eon (and probably
many other C++ programs) where operator= was checking for self assignment.
Folding this allows us to SROA several additional structs.

llvm-svn: 17735
2004-11-14 07:33:16 +00:00
Chris Lattner
5a8b003a09 Remove note to self
llvm-svn: 17734
2004-11-14 06:57:47 +00:00
Brian Gaeke
e13c960415 Fix problem with insertion point for ADJCALLSTACKDOWN.
llvm-svn: 17733
2004-11-14 06:32:08 +00:00
Brian Gaeke
a281ebc490 Update lists of failing unit tests.
Exclude bigfib, so that we effectively exclude all C++ benchmarks.
Update to-do list: mention va_start.

llvm-svn: 17732
2004-11-14 06:32:07 +00:00
Chris Lattner
a86e8783e8 Oops, make this test the right thing.
llvm-svn: 17731
2004-11-14 06:11:41 +00:00
Chris Lattner
af555adc15 If a function always returns a constant, replace all calls sites with that
constant value.  This makes the return value dead and allows for
simplification in the caller.

This implements IPConstantProp/return-constant.ll

This triggers several dozen times throughout SPEC.

llvm-svn: 17730
2004-11-14 06:10:11 +00:00
Chris Lattner
37d2cd7cd6 New testcase
llvm-svn: 17729
2004-11-14 06:02:46 +00:00
Brian Gaeke
347a000be6 Fix NotTest - round up extraStack to the nearest doubleword, if it is
not zero.

llvm-svn: 17728
2004-11-14 05:19:00 +00:00
Chris Lattner
fe3f4e6ebd Teach SROA how to promote an array index that is variable, if the dimension
of the array is just two.  This occurs 8 times in gcc, 6 times in crafty, and
12 times in 099.go.

This implements ScalarRepl/sroa_two.ll

llvm-svn: 17727
2004-11-14 05:00:19 +00:00
Chris Lattner
8076a5de30 New testcase, SROA with variable array index
llvm-svn: 17726
2004-11-14 04:58:40 +00:00
Brian Gaeke
e90176e171 Update failing Benchmarks; point out that I'm skipping Shootout-C++.
llvm-svn: 17725
2004-11-14 04:43:12 +00:00
Chris Lattner
8881912d71 Rearrange some code, no functionality changes.
llvm-svn: 17724
2004-11-14 04:24:28 +00:00
Brian Gaeke
18b6015b11 Update expected UnitTests failures.
llvm-svn: 17723
2004-11-14 03:22:08 +00:00
Brian Gaeke
e6b47514a3 Rewrite outgoing arg handling to handle more weird corner cases.
llvm-svn: 17722
2004-11-14 03:22:07 +00:00
Brian Gaeke
07097e12d5 Support UndefValue emission.
llvm-svn: 17721
2004-11-14 03:22:05 +00:00
Tanya Lattner
0fbc9c8350 setting path to prcontext.tcl script. Right now it searches for tclsh in your path, but this should be obtained from configure.
llvm-svn: 17720
2004-11-13 23:36:18 +00:00
Chris Lattner
9fa7f0ae0a Remove debugging code
llvm-svn: 17719
2004-11-13 23:32:53 +00:00
Chris Lattner
244031d306 Argument promotion transforms functions to unconditionally load their
argument pointers.  This is only valid to do if the function already
unconditionally loaded an argument or if the pointer passed in is known
to be valid.  Make sure to do the required checks.

This fixed ArgumentPromotion/control-flow.ll and the Burg program.

llvm-svn: 17718
2004-11-13 23:31:34 +00:00
Chris Lattner
0a205ead8b Add a testcase we should continue to argpromote
llvm-svn: 17717
2004-11-13 23:30:22 +00:00
Chris Lattner
70496c1728 Add a testcase for a function we cannot legally promote the argument of.
llvm-svn: 17716
2004-11-13 23:28:39 +00:00
Chris Lattner
7024d6b23e Add useful method, minor cleanups
llvm-svn: 17715
2004-11-13 23:28:10 +00:00
Chris Lattner
56c4c99cca Don't print unneeded labels
llvm-svn: 17714
2004-11-13 23:27:11 +00:00
Tanya Lattner
79d046ba70 Run prcontext.tcl with tclsh and let it be found in the path. This should be found by configure.
llvm-svn: 17713
2004-11-13 23:16:17 +00:00
Tanya Lattner
4afaf40a28 Adding subdirectory dg.exp files in order to be able to use dejagnu to only run specific tests (located in some subdirectory of Regression)
llvm-svn: 17712
2004-11-13 23:00:45 +00:00
Tanya Lattner
bb05cd7f85 Changed to use tcl script.
llvm-svn: 17711
2004-11-13 22:55:51 +00:00
Chris Lattner
073f6ca344 Hack around stupidity in GCC, fixing Burg with the CBE and
CBackend/2004-11-13-FunctionPointerCast.llx

llvm-svn: 17710
2004-11-13 22:21:56 +00:00
Chris Lattner
a259bd9d67 New testcase
llvm-svn: 17709
2004-11-13 22:21:15 +00:00
Tanya Lattner
b947fb3e95 Rewrote prcontext.py in tcl.
llvm-svn: 17708
2004-11-13 21:03:22 +00:00
Chris Lattner
049d33a717 shld is a very high latency operation. Instead of emitting it for shifts of
two or three, open code the equivalent operation which is faster on athlon
and P4 (by a substantial margin).

For example, instead of compiling this:

long long X2(long long Y) { return Y << 2; }

to:

X3_2:
        movl 4(%esp), %eax
        movl 8(%esp), %edx
        shldl $2, %eax, %edx
        shll $2, %eax
        ret

Compile it to:

X2:
        movl 4(%esp), %eax
        movl 8(%esp), %ecx
        movl %eax, %edx
        shrl $30, %edx
        leal (%edx,%ecx,4), %edx
        shll $2, %eax
        ret

Likewise, for << 3, compile to:

X3:
        movl 4(%esp), %eax
        movl 8(%esp), %ecx
        movl %eax, %edx
        shrl $29, %edx
        leal (%edx,%ecx,8), %edx
        shll $3, %eax
        ret

This matches icc, except that icc open codes the shifts as adds on the P4.

llvm-svn: 17707
2004-11-13 20:48:57 +00:00
Chris Lattner
ef6bd92a8c Add missing check
llvm-svn: 17706
2004-11-13 20:04:38 +00:00
Chris Lattner
8d521bb16e Compile:
long long X3_2(long long Y) { return Y+Y; }
int X(int Y) { return Y+Y; }

into:

X3_2:
        movl 4(%esp), %eax
        movl 8(%esp), %edx
        addl %eax, %eax
        adcl %edx, %edx
        ret
X:
        movl 4(%esp), %eax
        addl %eax, %eax
        ret

instead of:

X3_2:
        movl 4(%esp), %eax
        movl 8(%esp), %edx
        shldl $1, %eax, %edx
        shll $1, %eax
        ret

X:
        movl 4(%esp), %eax
        shll $1, %eax
        ret

llvm-svn: 17705
2004-11-13 20:03:48 +00:00
Chris Lattner
8c3e7b92af Simplify handling of shifts to be the same as we do for adds. Add support
for (X * C1) + (X * C2) (where * can be mul or shl), allowing us to fold:

   Y+Y+Y+Y+Y+Y+Y+Y

into
         %tmp.8 = shl long %Y, ubyte 3           ; <long> [#uses=1]

instead of

        %tmp.4 = shl long %Y, ubyte 2           ; <long> [#uses=1]
        %tmp.12 = shl long %Y, ubyte 2          ; <long> [#uses=1]
        %tmp.8 = add long %tmp.4, %tmp.12               ; <long> [#uses=1]

This implements add.ll:test25

Also add support for (X*C1)-(X*C2) -> X*(C1-C2), implementing sub.ll:test18

llvm-svn: 17704
2004-11-13 19:50:12 +00:00
Chris Lattner
f6392b4616 New testcase
llvm-svn: 17703
2004-11-13 19:49:39 +00:00
Chris Lattner
6912370a78 Add support for shifts
llvm-svn: 17702
2004-11-13 19:32:45 +00:00
Chris Lattner
4efe20a103 Fold:
(X + (X << C2)) --> X * ((1 << C2) + 1)
   ((X << C2) + X) --> X * ((1 << C2) + 1)

This means that we now canonicalize "Y+Y+Y" into:

        %tmp.2 = mul long %Y, 3         ; <long> [#uses=1]

instead of:

        %tmp.10 = shl long %Y, ubyte 1          ; <long> [#uses=1]
        %tmp.6 = add long %Y, %tmp.10               ; <long> [#uses=1]

llvm-svn: 17701
2004-11-13 19:31:40 +00:00
Chris Lattner
2858e17538 Lazily create the abort message, so only translation units that use unwind
will actually get it.

llvm-svn: 17700
2004-11-13 19:07:32 +00:00
Chris Lattner
9b0291b18d Fix: CodeExtractor/2004-11-12-InvokeExtract.ll
llvm-svn: 17699
2004-11-13 00:06:45 +00:00
Chris Lattner
8cc98850f9 New testcase
llvm-svn: 17698
2004-11-13 00:06:32 +00:00
Chris Lattner
5bcca6058a Fix a bug where the code extractor would get a bit confused handling invoke
instructions, setting DefBlock to a block it did not have dom info for.

llvm-svn: 17697
2004-11-12 23:50:44 +00:00
Chris Lattner
5c1d84c769 Simplify handling of constant initializers
llvm-svn: 17696
2004-11-12 22:42:57 +00:00
Reid Spencer
a81f8197eb Makefile for lib/Linker
llvm-svn: 17695
2004-11-12 20:38:45 +00:00
Reid Spencer
361e513db0 This file originated in lib/VMCore/Linker.cpp but now lives in
lib/Linker/LinkModules.cpp

llvm-svn: 17694
2004-11-12 20:37:43 +00:00
Reid Spencer
1cfa8d60f8 This file originated in tools/gccld/Linker.cpp but now lives in
lib/Linker/LinkArchives.cpp

llvm-svn: 17693
2004-11-12 20:34:32 +00:00
Reid Spencer
aee67e6547 * Clean up all the shared library output on uninstall
* Provide the correct set of input directories to the TAGS target
* Provide a CTAGS target for building Vi style ctags files.

llvm-svn: 17688
2004-11-12 02:27:36 +00:00
Reid Spencer
2ea5ae618c Document the new llvm-ranlib command.
llvm-svn: 17687
2004-11-12 00:18:35 +00:00
Reid Spencer
ffb9f06135 Correctly terminate a list.
llvm-svn: 17686
2004-11-12 00:16:51 +00:00
Reid Spencer
2e34034d80 Document the modifiers and the file format.
llvm-svn: 17685
2004-11-12 00:15:43 +00:00
Chris Lattner
738c89ecec Make this build in release mode
llvm-svn: 17684
2004-11-11 22:11:17 +00:00
Reid Spencer
e448500e6d Add llvm-ar to the index.
llvm-svn: 17682
2004-11-11 09:30:00 +00:00
Reid Spencer
8beeb49594 First attempt at llvm-ar documentation. Modifiers need a little more
explanation.

llvm-svn: 17681
2004-11-11 09:21:18 +00:00
Chris Lattner
9621dfab3f Actually, leave the check in. This prevents us from counting dead arguments
as IPCP opportunities.

llvm-svn: 17680
2004-11-11 07:47:54 +00:00
Chris Lattner
5fa696f8e4 Fix bug: IPConstantProp/deadarg.ll
llvm-svn: 17679
2004-11-11 07:46:29 +00:00
Chris Lattner
ba582f0d11 new testcase
llvm-svn: 17678
2004-11-11 07:46:11 +00:00
Reid Spencer
45dc1394cd Fix documentation for Makefile target name change. install-bytecode is now
just "install" in the runtime directory.

llvm-svn: 17677
2004-11-11 07:30:27 +00:00
Chris Lattner
c1d24cd859 Make IP Constant prop more aggressive about handling self recursive calls.
This implements IPConstantProp/recursion.ll

llvm-svn: 17666
2004-11-10 19:43:59 +00:00
Chris Lattner
59e5462557 New testcase
llvm-svn: 17665
2004-11-10 19:43:31 +00:00
John Criswell
04570265a5 Correct the name of stosd for the AT&T syntax:
It's stosl (l for long == 32 bit).

llvm-svn: 17658
2004-11-10 04:48:15 +00:00
Chris Lattner
0d3773d8b1 Do not let dead constant expressions hanging off of functions prevent IPCP.
This allows to elimination of a bunch of global pool descriptor args from
programs being pool allocated (and is also generally useful!)

llvm-svn: 17657
2004-11-09 20:47:30 +00:00
Reid Spencer
e5142be411 Provide conversion from posix time.
llvm-svn: 17656
2004-11-09 20:29:10 +00:00
Reid Spencer
202eaeb272 Fix isBytecodeFile to correctly recognized compressed bytecode too.
llvm-svn: 17655
2004-11-09 20:27:23 +00:00
Reid Spencer
fb1f7357c2 * Implement getStatusInfo for getting stat(2) like information
* Implement createTemporaryFile for mkstemp(3) functionality
* Fix isBytecodeFile to accept llvc magic # (compressed) as bytecode.

llvm-svn: 17654
2004-11-09 20:26:31 +00:00
Reid Spencer
abbefecf8e Make sure llee can deal with compressed bytecode too.
llvm-svn: 17652
2004-11-09 20:21:25 +00:00
John Criswell
623dc9c5c0 Recognize compressed LLVM bytecode files.
This should fix the problem of not being able to link compressed LLVM
bytecode files from LLVM libraries.

llvm-svn: 17648
2004-11-09 19:37:07 +00:00
Reid Spencer
6a1a10aa54 Tune compression:
bzip2: block size 9 -> 5, reduces memory by 400Kbytes, doesn't affect speed
       or compression ratio on all but the largest bytecode files (>1MB)
zip:   level 9 -> 6, this speeds up compression time by ~30% but only
       degrades the compressed size by a few bytes per megabyte. Those few
       bytes aren't worth the effort.

llvm-svn: 17647
2004-11-09 17:58:09 +00:00
Chris Lattner
436285e75d Change this back so that I get stable numbers to reflect the change from the
nightly testers

llvm-svn: 17646
2004-11-09 08:05:23 +00:00
Reid Spencer
981afd7c1c Document quick-test target.
llvm-svn: 17644
2004-11-09 06:32:58 +00:00
Reid Spencer
3006081612 Add a quick-test target that uses QUICKTEST variable to quickly run a
portion of the test suite. e.g.:

make quck-test QUICKTEST=Regression/Bytecode

llvm-svn: 17643
2004-11-09 06:28:32 +00:00
Chris Lattner
1f0a97c6cb Fix bug: 2004-11-08-FreeUseCrash.ll
llvm-svn: 17642
2004-11-09 05:10:56 +00:00
Chris Lattner
1276fbe8ba Name file properly
llvm-svn: 17641
2004-11-09 05:07:01 +00:00
Chris Lattner
5a1e9bf72f Hrm, don't ask how I ran into this bug
llvm-svn: 17640
2004-11-09 05:06:23 +00:00
Misha Brukman
3e5dd6d34c * Convert tabs to spaces
* Order #includes according to style guide
* Remove extraneous blank lines

llvm-svn: 17639
2004-11-09 04:27:19 +00:00
Misha Brukman
8d5c13c3e3 Output the program name (in this case, gccld) with warning about invalid files
llvm-svn: 17638
2004-11-09 04:24:59 +00:00
Nate Begeman
1164955bf1 Allow hbd to be bugpointable on darwin by fixing common and linkonce codegen
llvm-svn: 17637
2004-11-09 04:01:18 +00:00
Misha Brukman
1df8148b01 Handle headers for compressed bytecode files
llvm-svn: 17634
2004-11-08 22:03:32 +00:00
Misha Brukman
465e7fb8ef Don't silently ignore invalid files: tell the user!
llvm-svn: 17633
2004-11-08 22:03:10 +00:00
Chris Lattner
068c0cf56a Fix a bug that was preventing povray and namd from pool allocating correctly.
llvm-svn: 17632
2004-11-08 21:08:46 +00:00
Chris Lattner
1feea5ffc9 Handle assert_fail special
llvm-svn: 17631
2004-11-08 21:08:28 +00:00
Misha Brukman
e97fc87e61 Remove extra spaces
llvm-svn: 17629
2004-11-08 19:01:03 +00:00
Chris Lattner
bb65a7f10e This file is gone
llvm-svn: 17627
2004-11-08 18:46:09 +00:00
Reid Spencer
05d033159d Add a --disable-compression option to gccas so the default compression of
bytecode can be defeated.

llvm-svn: 17626
2004-11-08 17:37:04 +00:00
Reid Spencer
4d910edf39 Make writing compressed bytecode the default.
llvm-svn: 17625
2004-11-08 17:35:34 +00:00
Reid Spencer
f8b4a8e988 Implement and document the TOOL_VERBOSE option that asks each tool invoked
to be verbose about its actions too.

llvm-svn: 17624
2004-11-08 17:32:12 +00:00
Reid Spencer
1619c72a92 Fix typo.
llvm-svn: 17623
2004-11-08 09:10:50 +00:00
Reid Spencer
812aa2ba19 Document compressed bytecode details.
llvm-svn: 17622
2004-11-08 08:55:21 +00:00
Reid Spencer
e7d98cccd9 Fix a typo: isvalid -> isValid
llvm-svn: 17621
2004-11-08 08:27:51 +00:00
Alkis Evlogimenos
eb4dbfd4e2 Move path override in test/Makefile.
llvm-svn: 17613
2004-11-08 05:44:05 +00:00
Alkis Evlogimenos
d91bca6941 Override PATH to submake so that all tools are found if the PATH is
not set up properly (it also avoids using different tools that happen
to be in the path).

llvm-svn: 17612
2004-11-08 05:35:03 +00:00
Misha Brukman
c350bd2056 * Add support for f2c and the -f2c switch to enable Fortran benchmarks
* Remove spurious spaces between variable names and `=' (they're not lined up
  anyway and there's no hope of doing that)

llvm-svn: 17611
2004-11-08 03:28:27 +00:00
Tanya Lattner
8fabe17ced Now using path to python found by configure.
llvm-svn: 17610
2004-11-08 03:26:59 +00:00
Misha Brukman
043ad9ec12 First draft of compendium of documents relevant to writers of LLVM machine
target backends

llvm-svn: 17609
2004-11-08 02:47:08 +00:00
Nate Begeman
0822032c95 Put int the getReg cast optimization from x86 so that we generate fewer
move instructions for the register allocator to coalesce.

llvm-svn: 17608
2004-11-08 02:25:40 +00:00
Reid Spencer
3fbf26aebe Recommend that new users read the documentation before they get started,
with a little twist of humor. This more than anything else will help
people get started with LLVM.

llvm-svn: 17605
2004-11-08 00:29:22 +00:00
Reid Spencer
47e49e1269 Correct and Explain the first rule of thumb better.
llvm-svn: 17604
2004-11-08 00:26:32 +00:00
Reid Spencer
60ee2a2519 Fix typo.
llvm-svn: 17603
2004-11-08 00:24:43 +00:00
Misha Brukman
26ecf23a74 Fix grammar: use commas in a list of entities
llvm-svn: 17602
2004-11-08 00:22:22 +00:00
Misha Brukman
624685d9a1 Implement ExecutionEngine::freeMachineCodeForFunction()
llvm-svn: 17601
2004-11-07 23:58:46 +00:00
Misha Brukman
0dcaaafa0b Add method to delete machine code generated for a Function
llvm-svn: 17600
2004-11-07 23:58:02 +00:00
Reid Spencer
6bf36bdefb Add the RUNTEST autoconf onfiguration variable for Deja-gnu support. This
tool runs Deja-gnu test suites. The 'make' variable RUNTEST is now set
automatically in the Makefile.config file.

llvm-svn: 17599
2004-11-07 23:29:39 +00:00
Tanya Lattner
d8f25acec4 Changed TEST to TESTSUITE
llvm-svn: 17598
2004-11-07 23:26:13 +00:00
Tanya Lattner
5f06ac1762 Fix for objdir != srcdir.
llvm-svn: 17597
2004-11-07 23:24:21 +00:00
Tanya Lattner
7095a68e49 More srcdir != objdir changes.
llvm-svn: 17596
2004-11-07 23:21:50 +00:00
Misha Brukman
35c91c2740 * Fix file-relative links: they need '#' prepended to the target name
* Balance an open parenthesis

llvm-svn: 17595
2004-11-07 22:42:37 +00:00
Misha Brukman
fb279f652e Use LLVMToolDir instead of ToolDir because the latter is no longer set (?)
llvm-svn: 17594
2004-11-07 22:26:43 +00:00
Tanya Lattner
c7392e0662 Made changes to support objdir!=srcdir.
llvm-svn: 17590
2004-11-07 22:04:21 +00:00
Chris Lattner
49fa1ecd04 VERY large functions that are only called from one place are not really
exciting to inline.  Only inline medium or small sized functions with a
single call site.

llvm-svn: 17588
2004-11-07 21:46:47 +00:00
Tanya Lattner
dd157e31fd Removed passing TARGET.
llvm-svn: 17587
2004-11-07 21:43:57 +00:00
Tanya Lattner
71a3368fdd Changed check-dejagnu to take TESTSUITE as its args instead of TEST in order to not conflict with other stuff. Added path for test/Scripts. Also added a check to deal with TESTSUITE and runtest flags.
llvm-svn: 17586
2004-11-07 21:39:41 +00:00
Nate Begeman
f5f0b6b6b0 Disable bogus cast elimination when the cast is used by a setcc instruction.
llvm-svn: 17583
2004-11-07 20:23:42 +00:00
Reid Spencer
f45ec621cc Add TARGET_TRIPLE
llvm-svn: 17581
2004-11-07 19:12:53 +00:00
Reid Spencer
9caa76c982 First version of this document listing the required software. Might need
to be made platform specific. Contents reflect my Linux build environment.

llvm-svn: 17580
2004-11-07 19:07:06 +00:00
Reid Spencer
796e531721 * Comments & cleanup per CL code review.
* Accept 'llvc' as signature for compressed bytecode

llvm-svn: 17579
2004-11-07 18:20:55 +00:00
Reid Spencer
899ad356f5 Add comments per CL code review.
llvm-svn: 17578
2004-11-07 18:19:00 +00:00
Reid Spencer
37041670c0 Make compression the default on writing.
llvm-svn: 17577
2004-11-07 18:18:11 +00:00
Reid Spencer
f3e639fc6a * Add comments and cleanup per CL code review
* Make signature for compressed bytecode llvc instead of unreadable
* Make the CompressionContext have a constructor and destructor.

llvm-svn: 17576
2004-11-07 18:17:38 +00:00
Tanya Lattner
9119b9cff5 Minor error.
llvm-svn: 17573
2004-11-07 08:29:03 +00:00
Tanya Lattner
7aad4fef81 Added support to specify which test suite dejagnu should run (Feature or Regression). Use TEST=suite
llvm-svn: 17572
2004-11-07 08:24:59 +00:00
Chris Lattner
db83a85dbf Revert back to r1.1, I'm just thoroughly confused :)
llvm-svn: 17571
2004-11-07 07:46:15 +00:00
Chris Lattner
1126abf1e9 Add new (old) testcase
llvm-svn: 17570
2004-11-07 07:41:32 +00:00
Tanya Lattner
84f7fda32f Added RUN lines and dejagnu support for Feature dir.
llvm-svn: 17568
2004-11-07 06:08:43 +00:00
Reid Spencer
505b225e82 Rename the option for defeating compression to be a little more specific.
llvm-svn: 17567
2004-11-07 05:50:16 +00:00
Reid Spencer
f0adf68dfa Enable compression by default.
llvm-svn: 17566
2004-11-07 05:43:51 +00:00
Reid Spencer
7b05ef63f1 * Enable bytecode compression by default
* Provide a -no-compress option to defeat compression.

llvm-svn: 17565
2004-11-07 05:41:32 +00:00
Reid Spencer
feb3d5097f Turn on compression by default.
Change --compress to --no-compress so compression can be turned off.

llvm-svn: 17564
2004-11-07 05:37:27 +00:00
Reid Spencer
1f9e18e7c5 * Provide option for specifying bytecode compression
* Enabled bytecode compression by default.

llvm-svn: 17563
2004-11-07 05:30:43 +00:00
Chris Lattner
fbb15f39b8 Add missing file header
Add some comments
Switch to use 'find' to do the clean instead of globbing

llvm-svn: 17559
2004-11-07 05:05:37 +00:00
Tanya Lattner
90b172ea93 Removing old Modulosched tests since that version of modulosched does not exist anymore and llc does not support modulosched by default.
llvm-svn: 17558
2004-11-07 05:04:58 +00:00
Tanya Lattner
3b71027e18 With the changes to these files, the Regression test suite should be tested by dejagnu without anyproblem.
Some variables could be made global.

llvm-svn: 17557
2004-11-07 05:02:56 +00:00
Tanya Lattner
62f096877f Added RUN line.
llvm-svn: 17556
2004-11-07 05:01:34 +00:00
Tanya Lattner
9082d7a6fd Added rough support for dejagnu testing. Changes need to be made to autoconf to provide the target_triplet and to check for 'grep -C' which would be used instead of the python script we have now. Eventually the python script should be converted to bash.
The dejagnu-clean needs to be fixed to use find.

llvm-svn: 17555
2004-11-07 04:59:52 +00:00
Tanya Lattner
902d8d58f6 Changed to XFAIL
llvm-svn: 17554
2004-11-07 04:37:08 +00:00
Chris Lattner
df925ce4cd Add a section for PPC, though it's empty for now
llvm-svn: 17553
2004-11-07 01:55:32 +00:00
Chris Lattner
4c5a8055c9 Update this to expect AT&T syntax
llvm-svn: 17552
2004-11-07 01:46:16 +00:00
Misha Brukman
68dbbe46b8 * Add note about benchmarking programs and submitting reduced test cases
* Replace llvm.org with llvm.cs.uiuc.edu

llvm-svn: 17551
2004-11-07 01:03:59 +00:00
Misha Brukman
aeee58fc16 Replace llvm.org => llvm.cs.uiuc.edu
llvm-svn: 17550
2004-11-07 00:59:58 +00:00
Misha Brukman
8a75d2e73b Replace uses of llvm.org with llvm.cs.uiuc.edu
llvm-svn: 17549
2004-11-07 00:58:38 +00:00
Misha Brukman
7ee6c5525e Consistently use llvm.cs.uiuc.edu instead of llvm.org
llvm-svn: 17548
2004-11-07 00:58:20 +00:00
Chris Lattner
b3ba9319f1 Decompose* is V9 specific, make it internal
llvm-svn: 17547
2004-11-07 00:43:24 +00:00
Chris Lattner
bf5d39fe3e This is V9 specific stuff
llvm-svn: 17546
2004-11-07 00:42:29 +00:00
Chris Lattner
595016d090 This is V9 specific, move it there.
llvm-svn: 17545
2004-11-07 00:39:26 +00:00
Chris Lattner
3dadadc837 Move this file from lib/Transforms/Scalar
llvm-svn: 17544
2004-11-07 00:39:09 +00:00
Chris Lattner
f32f1ce8ab Tests for this xforms should be .ll files, and they should have run lines.
llvm-svn: 17543
2004-11-07 00:38:16 +00:00
Chris Lattner
b3841e5234 Remove dead tests
llvm-svn: 17542
2004-11-07 00:36:30 +00:00
Chris Lattner
7b81822fc0 This is not part of the test
llvm-svn: 17541
2004-11-07 00:34:45 +00:00
Chris Lattner
f4d3fb930e Fix a test.
These other tests should be in test/Programs/SingleSource/UnitTests if anyone
cares enough to save them

llvm-svn: 17540
2004-11-07 00:33:14 +00:00
Chris Lattner
f02a1137f9 Nuke useless testcases
llvm-svn: 17539
2004-11-07 00:30:51 +00:00
Chris Lattner
5993ea5da2 These files are all moved to test/Regression/CodeGen/Generic
llvm-svn: 17538
2004-11-07 00:24:14 +00:00
Chris Lattner
0624d4fd2f This test is obsolete and incorrect
llvm-svn: 17537
2004-11-06 23:42:32 +00:00
Tanya Lattner
2acf9b07fa Adding RUN lines.
llvm-svn: 17536
2004-11-06 23:32:43 +00:00
Reid Spencer
2e49204e0f Add support for compressed bytecode
llvm-svn: 17535
2004-11-06 23:17:23 +00:00
Tanya Lattner
6b01c01171 Adding RUN line.
llvm-svn: 17534
2004-11-06 23:16:51 +00:00
Tanya Lattner
16b222c6fd Adding RUN lines.
llvm-svn: 17533
2004-11-06 23:08:26 +00:00
Tanya Lattner
ca21187847 Adding RUN lines.
llvm-svn: 17532
2004-11-06 22:41:00 +00:00
Tanya Lattner
d9a3cebc49 Adding RUN lines.
llvm-svn: 17529
2004-11-06 22:29:57 +00:00
Tanya Lattner
32f81a5f58 Adding RUN lines.
llvm-svn: 17528
2004-11-06 22:07:09 +00:00
Tanya Lattner
f14e76db43 Adding RUN lines.
llvm-svn: 17527
2004-11-06 21:40:51 +00:00
Chris Lattner
0ff1828349 Adjust to printing user+system times instead of wall times. Run the olden
numbers in 'stable' mode so that the numbers are more stable.

llvm-svn: 17525
2004-11-06 21:35:40 +00:00
Chris Lattner
1f0758cb95 Add missing run line
llvm-svn: 17522
2004-11-06 21:11:04 +00:00
Tanya Lattner
b2b06fa405 First crack at support to run tests using dejagnu. This file contains a procedure to run a test like TestRunner.sh does.
llvm-svn: 17521
2004-11-06 21:07:41 +00:00
Chris Lattner
726ecb840b Add a run line
llvm-svn: 17520
2004-11-06 21:07:31 +00:00
Chris Lattner
cddf99256e Add a missing run line
llvm-svn: 17519
2004-11-06 21:03:41 +00:00
Chris Lattner
ca8e39d91f This pass has been removed from LLVM
llvm-svn: 17518
2004-11-06 21:02:30 +00:00
Chris Lattner
7ffc0d97aa Add missing run line
llvm-svn: 17517
2004-11-06 21:01:45 +00:00
Tanya Lattner
1d28bdac94 Adding XFAIL lines for dejagnu support.
llvm-svn: 17514
2004-11-06 20:38:27 +00:00
Chris Lattner
331854d283 From Jeff Cohen:
I checked out from cvs directly on Windows and I ran into another
problem with the project files.  Evidently, the files were initially
checked in on Unix, and the files were transfered to Unix without
converting the CR/LF line endings first.  When checked out on Windows,
cvs converts the files to DOS format, resulting in two CRs for each LF.

llvm-svn: 17504
2004-11-06 17:07:36 +00:00
Reid Spencer
c686a2b64b Implement the GetBytecodeSymbols interface function to extract just the
externally visible defined symbols from a bytecode file.

llvm-svn: 17503
2004-11-06 08:56:40 +00:00
Reid Spencer
20f6dc0156 Provide an interface for getting just the external symbols from a
Bytecode file.

llvm-svn: 17502
2004-11-06 08:54:47 +00:00
Reid Spencer
ef24b9139a Deprecate constructors we don't want users to use.
Temporarily comment out two interface methods we might not implement.

llvm-svn: 17501
2004-11-06 08:53:59 +00:00
Reid Spencer
0f8359b061 Makefile for the LLVMArchive library.
llvm-svn: 17500
2004-11-06 08:52:36 +00:00
Reid Spencer
0cc653e59b First kinda/sorta working version of the Archive library. Reading is not
yet supported but writing works. Way too early to review this. More to come

llvm-svn: 17499
2004-11-06 08:51:45 +00:00
Reid Spencer
0c6a283b2a Stop propagating method names that violate the coding standard
llvm-svn: 17498
2004-11-05 22:15:36 +00:00
Reid Spencer
ed3f95892d Go ahead and trust the client not to mess with the ModuleProvider* returned
by the findModuleContainingSymbol method.

llvm-svn: 17491
2004-11-05 18:48:02 +00:00
Reid Spencer
6d2c0efec5 * Documentation corrections (thanks to Chris for nit-picking)
* Remove dead typedefs.
* Redefine how getAllPaths treats its argument.

llvm-svn: 17489
2004-11-05 17:44:26 +00:00
John Criswell
ab79288e37 Fix compilation problem; make the cast and the LHS be the same type.
llvm-svn: 17488
2004-11-05 16:17:06 +00:00
Reid Spencer
50b78a6342 First version of the interface to Archive files. This introduces the
llvm::Archive class to provide for reading, writing, indexing and search
functions on standard ar(1) format files that contain bytecode modules.

Implementation to follow.

llvm-svn: 17487
2004-11-05 09:19:17 +00:00
Chris Lattner
303bdd1e4b Remove dead var
llvm-svn: 17485
2004-11-05 04:52:08 +00:00
Chris Lattner
429aaa5855 Quiet VC++ warnings
llvm-svn: 17484
2004-11-05 04:50:59 +00:00
Chris Lattner
c22ffc26b0 Do not make i have bigger scope that we need
llvm-svn: 17483
2004-11-05 04:47:37 +00:00
Chris Lattner
3c670cb65a Remove dead vars
llvm-svn: 17482
2004-11-05 04:46:22 +00:00
Chris Lattner
33eb909939 Fix some warnings on VC++
llvm-svn: 17481
2004-11-05 04:45:43 +00:00
Chris Lattner
6f38d28817 Remove this file as suggested by Jeff Cohen
llvm-svn: 17480
2004-11-05 04:17:19 +00:00
Chris Lattner
7d7f23b7db Fix project file, patch contributed by Jeff Cohen
llvm-svn: 17479
2004-11-05 04:15:30 +00:00
Misha Brukman
a73e7cae72 Clean up code layout, delete extra blank line, say fibonacci' instead of foo'
llvm-svn: 17478
2004-11-05 04:11:40 +00:00
Nate Begeman
bff3d4abf0 Thanks to sabre for pointing out that we were incorrectly codegen'ing
int test(int x) { return 32768 - x; }

Fixed by teaching the function that checks a constant's validity to be used
as an immediate argument about subtract-from instructions.

llvm-svn: 17476
2004-11-04 19:43:18 +00:00
Chris Lattner
adb5342ae8 Fix typeo
llvm-svn: 17466
2004-11-04 05:00:18 +00:00
Brian Gaeke
0da246f535 Handle "call" operands of type long/ulong passed in registers.
llvm-svn: 17464
2004-11-04 00:27:04 +00:00
Chris Lattner
bd2886d1f0 Cleanup this example, simplifying it and making it conform to LLVM coding
standards

llvm-svn: 17459
2004-11-03 21:43:03 +00:00
Chris Lattner
a67a030d9d Don't call Constant::getNullValue when the argument could be VoidTy
llvm-svn: 17457
2004-11-03 18:51:26 +00:00
Chris Lattner
f305b0ae1b defining __STDC_LIMIT_MACROS on the command line is not really necessary
for Visual Studio, and is a bit of a pain when you want to include the
LLVM headers from your own project, so I moved the check a bit down into
the Unix case to avoid the hassle... Here is a patch

Patch by Morten Ofstad!

llvm-svn: 17450
2004-11-03 17:15:45 +00:00
Brian Gaeke
1845e9b4c7 CONFIGURATION isn't spelled Configuration, it's spelled BuildMode.
Due to qmtest's or llvm.py's lousy error checking, this single error
causes qmtest to fork-bomb the machine, filling the process table with
python processes that do nothing.  Clearly, better error checking is
needed.

llvm-svn: 17449
2004-11-03 17:11:23 +00:00
Reid Spencer
7206bf9e9f Top level files for building natively on win32
llvm-svn: 17447
2004-11-03 16:14:40 +00:00
Reid Spencer
67b62fbaa7 MS Visual Studio files for building LLVM on Win32 platforms.
llvm-svn: 17446
2004-11-03 16:13:14 +00:00
Chris Lattner
cff3b41e95 Fix this function to not say that longs have 8-byte alignment on X86/PPC.
This method is really a gross hack, but at least we can make it work on
the targets we support right now.

This bug fix stops a crash in a testcase reduced from 176.gcc

llvm-svn: 17443
2004-11-02 22:18:18 +00:00
Tanya Lattner
444be61ea6 Added gross hacks such as creating my own def-use map, and picking on Instruction that I can add all my TmpInstructions to its MCFI.
llvm-svn: 17441
2004-11-02 21:04:56 +00:00
Chris Lattner
de7a85895c Graphs that are part of equivalence sets can be multi-function SCC's
themselves.  Make sure to update DSInfo correctly.  This fixes a testcase
reduced from Prolangs-C++/objects

llvm-svn: 17439
2004-11-02 20:31:06 +00:00
Chris Lattner
661b8552bb Correctly handle new SCC's found as a result of merging EQ graphs do to
function pointer equivalences.  This fixes many problems, including a testcase
reduced Prolangs-C++/objects.

llvm-svn: 17437
2004-11-02 19:29:59 +00:00
Chris Lattner
ddb4d2a524 Substantially cleanup/speedup the eq graphs pass by walking the callgraph
a DSGraph at a time instead of a function at a time.  This is also more
correct, though it doesn't seem to fix any programs.

llvm-svn: 17435
2004-11-02 17:51:11 +00:00
Chris Lattner
32b01c3143 Fix typo, contributed by Henrik Bach!
llvm-svn: 17434
2004-11-02 17:31:02 +00:00
Reid Spencer
651dd3ad5a * New Recursive Target: clean-all. This target will recursively descend the
$(ObjDir) and clean out all build modes (Debug, Release, Profile) in
  addition to the normal "clean" rules.
* Fix "clean" problems with Lex/Yacc so all files are remove properly.
* Ensure errors from "rm" don't thwart the uninstall and clean targets.

llvm-svn: 17433
2004-11-02 16:56:15 +00:00
Reid Spencer
9d0c1e0de6 * New Recursive Target: clean-all
llvm-svn: 17432
2004-11-02 16:36:03 +00:00
Chris Lattner
99d7bb3378 Fix a warning
llvm-svn: 17431
2004-11-02 15:27:57 +00:00
Chris Lattner
e5370f56ae Minor cleanups
llvm-svn: 17428
2004-11-02 06:38:58 +00:00
Chris Lattner
96f6616479 * Rearrange code slightly
* Disable broken transforms for simplifying (setcc (cast X to larger), CI)
  where CC is not != or ==

llvm-svn: 17422
2004-11-02 03:50:32 +00:00
Reid Spencer
9df63b4e52 List the individual tools for easier reference.
Make the bugpoint link reference the man page in the CommandGuide until
the Bugpoint.html file can describe bugpoint in a little more of a tutorial
style instead of just being a man page.

llvm-svn: 17416
2004-11-01 21:57:35 +00:00
Reid Spencer
2ed33b46d5 Add compliant header.
NOTE: This doc needs to describe the bugpoint "subsystem" not the tool.

llvm-svn: 17415
2004-11-01 21:55:46 +00:00
Reid Spencer
10c6d3f372 Add missing tag.
llvm-svn: 17414
2004-11-01 21:31:39 +00:00
Chris Lattner
b93914d06c Remove more dead methods
llvm-svn: 17413
2004-11-01 21:07:05 +00:00
Chris Lattner
76a5a2eb2a Delete a dead method
llvm-svn: 17412
2004-11-01 21:04:47 +00:00
Chris Lattner
773ca922a7 Rename FoldedGraph -> DSInfo to be consistent with other passes
delete some dead methods

llvm-svn: 17410
2004-11-01 21:02:23 +00:00
Reid Spencer
6b6557c5eb Update table to llvm.css standards.
llvm-svn: 17409
2004-11-01 20:47:22 +00:00
Reid Spencer
a4e9b54222 Get rid of bogus entity references.
llvm-svn: 17408
2004-11-01 20:41:01 +00:00
Chris Lattner
5e9b3540d1 Get rid of the EquivClassGraphArgsInfo class, and the map that held it.
We only need one instance of the vector that it contains at a time.

llvm-svn: 17407
2004-11-01 20:37:00 +00:00
Chris Lattner
720eb217a7 Add placeholder variable to make Win32 work, applied for Morten Ofstad
llvm-svn: 17406
2004-11-01 20:10:20 +00:00
Chris Lattner
ef41cbb97d Eliminate the cloneGraph method
llvm-svn: 17405
2004-11-01 19:54:06 +00:00
Reid Spencer
1e64cad5ff Attempt CSS 2 compliance.
llvm-svn: 17404
2004-11-01 09:26:57 +00:00
Reid Spencer
4ffe4a7733 Attempt CSS 2 validation.
llvm-svn: 17403
2004-11-01 09:25:03 +00:00
Reid Spencer
7336a6c337 HTML 4.01 Strict compliance.
llvm-svn: 17402
2004-11-01 09:22:49 +00:00
Reid Spencer
271fe88b3f Correct the document type declaration.
llvm-svn: 17401
2004-11-01 09:21:32 +00:00
Reid Spencer
fea14b5599 Add the HTML 4.01 and CSS icons with links to validators.
llvm-svn: 17400
2004-11-01 09:19:53 +00:00
Reid Spencer
0777321b8f Attempt HTML 4.01 Strict compliance.
llvm-svn: 17399
2004-11-01 09:16:30 +00:00
Reid Spencer
f0714dd617 Cleanup the constants section.
llvm-svn: 17398
2004-11-01 09:02:53 +00:00
Reid Spencer
49fb40c6d9 Remove spurious end tag, fix indentation.
llvm-svn: 17397
2004-11-01 08:30:14 +00:00
Reid Spencer
9f16cad663 Make HTML 4.01 Strict compliant.
llvm-svn: 17396
2004-11-01 08:26:25 +00:00
Reid Spencer
4d21242e66 Fix tag placement to make HTML 4.01 Strict compliant.
llvm-svn: 17395
2004-11-01 08:24:13 +00:00
Reid Spencer
c3c4c4f843 Minor format tweask for tables.
llvm-svn: 17394
2004-11-01 08:19:36 +00:00
Reid Spencer
ad44f5c0be Add layout classes for table elements so tables can be used for layouts.
This is easier than attempting to figure out dual purpose columnar layouts
for multiple browser types. All browsers understand tables.

llvm-svn: 17393
2004-11-01 08:18:06 +00:00
Reid Spencer
0be901556b Configuration -> BuildMode
llvm-svn: 17392
2004-11-01 07:53:17 +00:00
Reid Spencer
b5b92fbaf6 Eliminate redundant variable definition. Rename Configuration -> BuildMode
Make lex/yacc output cleaned only if in a directory that has those sources.

llvm-svn: 17391
2004-11-01 07:50:27 +00:00
Chris Lattner
8af7424920 Speed up the tail duplication pass on the testcase below from 68.2s to 1.23s:
#define CL0(a) case a: f(); goto c;
 #define CL1(a) CL0(a##0) CL0(a##1) CL0(a##2) CL0(a##3) CL0(a##4) CL0(a##5) \
 CL0(a##6) CL0(a##7) CL0(a##8) CL0(a##9)
 #define CL2(a) CL1(a##0) CL1(a##1) CL1(a##2) CL1(a##3) CL1(a##4) CL1(a##5) \
 CL1(a##6) CL1(a##7) CL1(a##8) CL1(a##9)
 #define CL3(a) CL2(a##0) CL2(a##1) CL2(a##2) CL2(a##3) CL2(a##4) CL2(a##5) \
 CL2(a##6) CL2(a##7) CL2(a##8) CL2(a##9)
 #define CL4(a) CL3(a##0) CL3(a##1) CL3(a##2) CL3(a##3) CL3(a##4) CL3(a##5) \
 CL3(a##6) CL3(a##7) CL3(a##8) CL3(a##9)

 void f();

 void a() {
     int b;
  c: switch (b) {
         CL4(1)
     }
 }

This comes from GCC PR 15524

llvm-svn: 17390
2004-11-01 07:05:07 +00:00
Chris Lattner
93d1e39f3e Do not compute the predecessor list for a block unless we need it.
This speeds up simplifycfg on this program, from 44.87s to 0.29s (with
a profiled build):

 #define CL0(a) case a: goto c;
 #define CL1(a) CL0(a##0) CL0(a##1) CL0(a##2) CL0(a##3) CL0(a##4) CL0(a##5) \
 CL0(a##6) CL0(a##7) CL0(a##8) CL0(a##9)
 #define CL2(a) CL1(a##0) CL1(a##1) CL1(a##2) CL1(a##3) CL1(a##4) CL1(a##5) \
 CL1(a##6) CL1(a##7) CL1(a##8) CL1(a##9)
 #define CL3(a) CL2(a##0) CL2(a##1) CL2(a##2) CL2(a##3) CL2(a##4) CL2(a##5) \
 CL2(a##6) CL2(a##7) CL2(a##8) CL2(a##9)
 #define CL4(a) CL3(a##0) CL3(a##1) CL3(a##2) CL3(a##3) CL3(a##4) CL3(a##5) \
 CL3(a##6) CL3(a##7) CL3(a##8) CL3(a##9)

 void f();

 void a() {
     int b;
  c: switch (b) {
         CL4(1)
     }
 }

This testcase is contrived to expose N^2 behavior, but this patch should speedup
simplifycfg on any programs that use large switch statements.  This testcase
comes from GCC PR17895.

llvm-svn: 17389
2004-11-01 06:53:58 +00:00
Chris Lattner
615e7fbcf3 When compiling a file, indicate what build it is for
llvm-svn: 17388
2004-11-01 06:14:59 +00:00
Chris Lattner
01f2381c72 * Do not refer to ActualCallees in CBU, when we can do it locally.
* *DO NOT* print CBU graphs when asked to print our own.  This is just
  FREAKING confusing and misleading: it's better to not print anything.
* Simplify and clean up some code
* Add some more paranoia assertion checking code that I found to track
  down this bug:
* Fix a nasty bug that was causing us to crash on Prolangs-C++/objects,
  where we were missing processing some graphs.  This hunk is the bugfix:

-    if (!I->isExternal() && !FoldedGraphsMap.count(I))
+    if (!I->isExternal() && !ValMap.count(I))

  urg!

llvm-svn: 17386
2004-10-31 23:41:26 +00:00
Reid Spencer
b1454879b3 Wrap to 80 cols
llvm-svn: 17385
2004-10-31 23:24:31 +00:00
Reid Spencer
0b40fdb0ad Add UsingLibraries.html link.
llvm-svn: 17384
2004-10-31 23:02:38 +00:00
Chris Lattner
aeb2b16c45 Simplify graph traversal, improve grammar
llvm-svn: 17383
2004-10-31 23:01:34 +00:00
Reid Spencer
1e3586ee1d Give table headers the striped background.
llvm-svn: 17382
2004-10-31 23:01:02 +00:00
Reid Spencer
0d6d8d0af5 * Moved from ObjectFiles.html
* Changed names of libraries to reflect new naming scheme
* Added some more introductory material
* Added a rule of thumb.

llvm-svn: 17381
2004-10-31 23:00:25 +00:00
Reid Spencer
67fe9440e6 Renamed UsingLibraries.html
llvm-svn: 17380
2004-10-31 22:59:06 +00:00
Reid Spencer
737424ced3 Get the shared library extension right on all platforms, regardless of what
Chris wants on his platform.

llvm-svn: 17379
2004-10-31 22:53:06 +00:00
Chris Lattner
d49bd175f0 Do not do horrible things to the CBU graphs. In particular, we do NOT own
the CBU graphs, copy them instead of hacking on the CBU graphs.

Also, instead of forwarding request from ECGraphs clients to the CBU graphs
clients, service them ourselves.

Finally, remove a broken "optimization"

llvm-svn: 17378
2004-10-31 21:56:11 +00:00
Chris Lattner
e3c00e9eee Fix comment
llvm-svn: 17377
2004-10-31 21:54:51 +00:00
Reid Spencer
68172d44c2 Fix output for building shared libraries per Chris' requirements
llvm-svn: 17376
2004-10-31 21:07:34 +00:00
Chris Lattner
70fdac83e3 Improve comment
llvm-svn: 17375
2004-10-31 19:57:43 +00:00
Reid Spencer
991f66abc1 Actually use the correct variable name for building bytecode files.
llvm-svn: 17374
2004-10-31 18:52:15 +00:00
Reid Spencer
8adaaf474a Add the preconditions target per suggestion by Henrik Bach.
llvm-svn: 17373
2004-10-31 18:50:34 +00:00
Chris Lattner
d3d23f8aa0 Fix another bug in Prolangs-C++/objects
llvm-svn: 17372
2004-10-31 18:13:19 +00:00
Reid Spencer
bbc642ee5e One more missing end tag.
llvm-svn: 17371
2004-10-31 17:58:58 +00:00
Reid Spencer
301f20a824 Correct tag usage for HTML 4.01 Strict compliance
llvm-svn: 17370
2004-10-31 17:56:50 +00:00
Reid Spencer
f4215f71d3 Add a tutorial and some more general concepts.
llvm-svn: 17369
2004-10-31 17:51:38 +00:00
Chris Lattner
7ca10b1faf Only call getNodeForValue on pointer arguments! this fixes a problem running
on Prolangs-C++/objects

llvm-svn: 17368
2004-10-31 17:47:48 +00:00
Chris Lattner
3f7dbfc898 Add more paranoid assertions :)
llvm-svn: 17367
2004-10-31 17:45:40 +00:00
Misha Brukman
619a24c4d9 No, really, the library name is `LLVMexecve'
llvm-svn: 17366
2004-10-31 17:30:52 +00:00
Vikram S. Adve
254afc4614 Fix patterns to match only one-char words.
llvm-svn: 17365
2004-10-30 23:11:26 +00:00
Reid Spencer
965ff465eb Add a few more terms.
llvm-svn: 17364
2004-10-30 21:40:28 +00:00
Reid Spencer
1fdc95c239 Complete the description of public variables. Internal variables are listed
but not described. It might just stay that way.

llvm-svn: 17363
2004-10-30 21:39:42 +00:00
Reid Spencer
a537198f2c Change macro names per naming standard in Makefile.rules.
llvm-svn: 17361
2004-10-30 09:26:22 +00:00
Reid Spencer
f22aa469c9 Correct macro names per naming standard in Makefile.rules
llvm-svn: 17360
2004-10-30 09:25:27 +00:00
Reid Spencer
f88808ae43 Internalize variable names to prevent recursive assignment. Cleanup docs.
llvm-svn: 17359
2004-10-30 09:19:36 +00:00
Chris Lattner
c76fef1248 Fix some more problems where we called getOffset before getNode()
llvm-svn: 17358
2004-10-30 07:21:19 +00:00
Chris Lattner
8aa0bafe1a Fix three bugs:
1. Calls to external global VARIABLES should not be treated as a call to an
    external function
 2. Efficiently deleting an element from a vector by using std::swap with
    the back, then pop_back is NOT a good way to keep the vector sorted.
 3. Our hope of having stuff get deleted by making them redundant just won't
    work.  In particular, if we have three calls in sequence that should be
    merged: A, B, C   first we unify B into A.  To be sure that they appeared
    identical (so B would be erased) we set B = A.  On the next step, we
    unified C into A and set C = A.  Unfortunately, this is no guarantee that
    C = B, so we would fail to delete the dead call.  Switch to a more
    explicit scheme.

llvm-svn: 17357
2004-10-30 05:41:23 +00:00
Chris Lattner
bc740090a9 Fix more undefined behavior
llvm-svn: 17356
2004-10-30 04:22:45 +00:00
Chris Lattner
ba96f0fd83 * Add a method
* change some uses of NH.getNode() in a bool context to use !NH.isNull()
* Fix a bunch of places where we depended on the (undefined) order of
  evaluation of arguments to function calls to ensure that getNode() was
  called before getOffset().  In practice, this was NOT happening.

llvm-svn: 17354
2004-10-30 04:05:01 +00:00
Chris Lattner
334df0463d Add an assertion and a method
llvm-svn: 17353
2004-10-30 04:03:47 +00:00
Chris Lattner
b508b00e6b No really, this is LLVM!
llvm-svn: 17352
2004-10-30 00:57:52 +00:00
Tanya Lattner
ddebd1eeaa Fixed bug with infinite epilogues.
Fixed issue with generating the partial order. It now adds the nodes not in recurrences in sets for each connected component.

llvm-svn: 17351
2004-10-30 00:39:07 +00:00
Misha Brukman
b56287dfd2 Fix file header comment
llvm-svn: 17350
2004-10-29 23:26:09 +00:00
Misha Brukman
c7c8d88804 * Fix compilation on AIX: GCC's fixincludes eliminates isinf() declaration
* Move file comment to the top of the header where it belongs

llvm-svn: 17349
2004-10-29 23:17:45 +00:00
Reid Spencer
bd44bbdc0e Don't modify user vars because they will get passed down (modified) to
sub-makes and recursively append causing huge command lines and incorrect
compilation results.

Also, fix the printvars target to align its output and ensure that the
contents of variables can't get interpreted by the shell.

llvm-svn: 17348
2004-10-29 22:14:56 +00:00
Brian Gaeke
b87e08e0ef Change name of target lib to conform to new naming scheme.
llvm-svn: 17347
2004-10-29 21:57:16 +00:00
Brian Gaeke
6254a798ca Remove dependency on MRegisterInfo::getRegClass
llvm-svn: 17346
2004-10-29 21:42:27 +00:00
Misha Brukman
3415c77f59 Fix grammar (i.e.)
llvm-svn: 17343
2004-10-29 19:20:42 +00:00
Reid Spencer
e6b944f2f5 Disable the build in the samples directory so that llvmc dependencies don't
mess up the build.

llvm-svn: 17342
2004-10-29 18:43:49 +00:00
Misha Brukman
a8816d3fe2 The Alpha (tm) intrinsics aren't even being used
llvm-svn: 17341
2004-10-29 18:43:43 +00:00
Misha Brukman
8d8fc6529e The Alpha (tm) intrinsics have never been used anywhere
llvm-svn: 17340
2004-10-29 18:43:17 +00:00
Misha Brukman
8600a7ac84 LLEE execve() wrapper library has changed its name and location
llvm-svn: 17339
2004-10-29 18:36:51 +00:00
Brian Gaeke
9a51b8ca7c When emitting debug msgs for function stubs, don't truncate the
printed pointer value if sizeof(unsigned) != pointer size.  Instead,
use uintptr_t.

llvm-svn: 17338
2004-10-29 18:22:45 +00:00
Vikram S. Adve
089ade78fd Print P and [AR] files on update.
llvm-svn: 17337
2004-10-29 17:43:19 +00:00
Reid Spencer
8b091689db Make sure the LLVM_CONFIG_DIR environment variable is set so we don't get
error messages from the compiler.

llvm-svn: 17335
2004-10-29 06:42:38 +00:00
Reid Spencer
da86a3778a Make the list of automatic Makefile* files updated explicit instead of
generally wildcarded.

llvm-svn: 17334
2004-10-29 04:47:33 +00:00
Misha Brukman
ad279bfe07 * Add spaces between function names for readability
* Separate paragraphs, flush HTML text to left margin for ease of editing

llvm-svn: 17333
2004-10-29 04:33:19 +00:00
Chris Lattner
124ea873ca This line breaks FreeBSD and apparently isn't useful anymore.
llvm-svn: 17332
2004-10-29 03:46:38 +00:00
John Criswell
98b355b6b2 Commented out the _Alloc_traits specialization entirely, as it is only
supported by specific versions of GCC.

It is left in place in case anyone wants to updated it for GCC 3.4 or
re-use it for earlier versions of GCC where it works.

llvm-svn: 17324
2004-10-28 18:21:41 +00:00
John Criswell
158737a76c Only add the _Alloc_traits specialization in if we're compiling for
Linux and not compiling for Sparc.
This is still probably not correct, or portable, but it'll do for now.

llvm-svn: 17321
2004-10-28 17:31:46 +00:00
Reid Spencer
4b04c85125 Fix the dependency of lex.o on gram.tab.h
llvm-svn: 17320
2004-10-28 16:48:13 +00:00
John Criswell
033d215ccb Added the poolalloc module to the list of projects to configure, if present.
llvm-svn: 17319
2004-10-28 13:35:00 +00:00
Reid Spencer
9c7bfc96e0 Bug Fixes:
* Move rules that build directories earlier in the file so that they are
  always built before the things that depend on them. This enables a
  parallel "dist-check" target.
* Fix use of TOOLLINKOPTS and TOOLLINKOPTSB (thanks to Henrik Bach)
* Standardize the output - some scripts using plain echo instead of $(ECHO)

llvm-svn: 17318
2004-10-28 09:15:28 +00:00
Reid Spencer
be6a4e9b7f Make parallel "install" and "uninstall" targets not step on itself.
llvm-svn: 17315
2004-10-28 07:57:28 +00:00
Alkis Evlogimenos
23e565484a Gep indices must be of int, uint, long or ulong type.
llvm-svn: 17313
2004-10-28 06:43:38 +00:00
Reid Spencer
8eb04a7713 Make sure the sources get distributed (use EXTRA_DIST)
Add the goof.st sample.

llvm-svn: 17312
2004-10-28 06:42:34 +00:00
Brian Gaeke
56dbc4ca15 Fix library names for sparc
llvm-svn: 17311
2004-10-28 06:39:10 +00:00
Reid Spencer
c833eddfe6 Fix library name.
llvm-svn: 17307
2004-10-28 05:37:24 +00:00
Alkis Evlogimenos
6bbc57ec12 Fix library name.
llvm-svn: 17306
2004-10-28 05:36:48 +00:00
Reid Spencer
49cc2cf279 Fix library name.
llvm-svn: 17305
2004-10-28 05:32:01 +00:00
Reid Spencer
37d45f6934 Fix name of library
llvm-svn: 17304
2004-10-28 05:30:54 +00:00
Brian Gaeke
ae050e0b65 Regenerated after fixing typo.
llvm-svn: 17303
2004-10-28 05:06:45 +00:00
Reid Spencer
cae2d8a951 Make sure we test the right variable for the AC_DEFINE
llvm-svn: 17302
2004-10-28 05:04:20 +00:00
Brian Gaeke
591f5d6622 It's spelled IEEEFP
llvm-svn: 17301
2004-10-28 04:17:05 +00:00
Reid Spencer
47fcbef63e Use llvmc to compile the Stacker programs
llvm-svn: 17300
2004-10-28 04:08:05 +00:00
Reid Spencer
0ac18e0385 Add the samples directory to the build
llvm-svn: 17299
2004-10-28 04:07:54 +00:00
Reid Spencer
f828c812bd Remove the FORCE token, rename VERSION to VERSION_TOK so it doesn't
conflict with configuration variables and #defines.

llvm-svn: 17298
2004-10-28 04:06:15 +00:00
Reid Spencer
aec50b98e0 Implement linking.
llvm-svn: 17297
2004-10-28 04:05:06 +00:00
Reid Spencer
04b92192ec Eliminate the force flag, configuration item, and related support
llvm-svn: 17296
2004-10-28 04:04:38 +00:00
Reid Spencer
ffe5f97f17 Pass -f to stkrc to ensure the output file is always written.
llvm-svn: 17295
2004-10-28 03:57:49 +00:00
Reid Spencer
1002e454cb Eliminate the -F option (for forcing output) .. not needed
Create GCC compatible -Wx, aliases for the existing -T options.

llvm-svn: 17294
2004-10-28 03:56:16 +00:00
Reid Spencer
e8ee9b2432 Add llvm-ld to the subdirs to be built
llvm-svn: 17293
2004-10-28 03:53:02 +00:00
Reid Spencer
548e1c2a03 Convert to new library names.
llvm-svn: 17292
2004-10-28 03:50:43 +00:00
Reid Spencer
4bc9b0ff4a Get rid of drivel.
Ensure the lex/yacc output are specified as BUILT_SOURCES so they get
built first.

llvm-svn: 17290
2004-10-28 01:25:28 +00:00
Reid Spencer
c9bbb35c6f Make sure that the yacc and lex output are specified as BUILT_SOURCES.
Correct the dependency of the Lexer.o file on the constructed
llvmAsmParser.h header file. It is not the Lexer.cpp file that depends on
the header, its the output of compiling Lexer.cpp, Lexer.o

llvm-svn: 17289
2004-10-28 00:43:24 +00:00
Reid Spencer
b7f710ae7b Bug Fixes:
* Ensure that BUILT_SOURCES depends on OBJ_DIR/Makefile so that they do not
  get built before the Makefile is updated.
* Fix build script for yacc & lex files by stopping it from thwarting the
  dependencies on the file. If the .y file changes, it needs to be rebuilt.
  This also cleans up the problem with llvmAsmParser ALWAYS rebuilding its
  Yacc files just to throw them away because there's no change.

llvm-svn: 17288
2004-10-28 00:41:43 +00:00
Reid Spencer
34bb03c61b Update for library name change.
llvm-svn: 17287
2004-10-28 00:11:43 +00:00
Reid Spencer
57cbe39d1e Change Library Names Not To Conflict With Others When Installed
llvm-svn: 17286
2004-10-27 23:18:45 +00:00
Reid Spencer
9f337bf96f Add the HAVE_RAND48 define.
llvm-svn: 17285
2004-10-27 23:09:31 +00:00
Reid Spencer
f9676539bb Changes to support rand48 tests
llvm-svn: 17284
2004-10-27 23:03:44 +00:00
Reid Spencer
c8c272ffb1 Fix auto-reconfigure bug: make sure we actually reconfigure not just
regenerate the config.status script.

llvm-svn: 17283
2004-10-27 22:48:58 +00:00
Chris Lattner
e721eb007c Add a couple of new features
llvm-svn: 17282
2004-10-27 16:28:17 +00:00
Chris Lattner
7dfc2d29ac Convert 'struct' to 'class' in various places to adhere to the coding standards
and work better with VC++.  Patch contributed by Morten Ofstad!

llvm-svn: 17281
2004-10-27 16:14:51 +00:00
Chris Lattner
cebf2bbe9e Give sumant credit too!
llvm-svn: 17280
2004-10-27 15:54:23 +00:00
Nate Begeman
a2b117c68a Move destructor out of line to avoid vtable emission in every file that includes the header. Thanks to sabre.
llvm-svn: 17278
2004-10-27 06:00:53 +00:00
Chris Lattner
70c2039b39 Hrm, this code was severely botched. As it turns out, this patch:
http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20041018/019708.html

exposed ANOTHER latent bug in this xform, which caused Prolangs-C/bison to fill
the zion nightly tester disk up and make the tester barf.

This is obviously not a good thing, so lets fix this bug shall we? :)

llvm-svn: 17276
2004-10-27 05:57:15 +00:00
Nate Begeman
c193790dbb Fix the build by eliminating some more dead code. That'll learn me not to listen to Reid
llvm-svn: 17275
2004-10-27 05:44:23 +00:00
Nate Begeman
5e8cce5313 Remove dead data member in MRegisterInfo class. Thanks sabre!
llvm-svn: 17274
2004-10-27 04:51:58 +00:00
Reid Spencer
94105c7b19 Get the *.inc files to depend on tblgen so if tblgen gets fixed, all the
*.inc files get regenerated.

llvm-svn: 17273
2004-10-27 04:34:35 +00:00
Chris Lattner
845afe9b20 Initialize with the correct constant type
llvm-svn: 17270
2004-10-27 03:55:24 +00:00
Reid Spencer
d94bb33911 Make sure that Makefile.rules and Makefile.config.in are not candidates for
automatic makefile update.

llvm-svn: 17269
2004-10-26 23:10:00 +00:00
Reid Spencer
77a46d25a5 Cleanup/Fixes:
* Force preconditions to be met FIRST
* Fix dist-check dependency
* Add some variables to the printvars target
* Automatically update Makefile.* as well as just Makefile

llvm-svn: 17268
2004-10-26 22:26:33 +00:00
Reid Spencer
938aa3e4af * Make the libcrtend.a installation depend on the bytecode-libs directory
* Conform output to standard.

llvm-svn: 17267
2004-10-26 21:30:31 +00:00
Chris Lattner
e43c9c2db2 Unless someone seriously objects, I don't think we really need this. Sorry
resistor :(

llvm-svn: 17265
2004-10-26 20:02:50 +00:00
Chris Lattner
6ee2c57128 Plug a memory leak in the asmparser. It turns out that we were leaking
the strings for basic block labels in some cases.  This amounted to about
120K of memory for namd, a medium sized program.

llvm-svn: 17262
2004-10-26 18:26:14 +00:00
Misha Brukman
75e5700227 Wrap comments at 80 cols
llvm-svn: 17261
2004-10-26 18:00:03 +00:00
Chris Lattner
fda51a5933 add support for UndefValue
llvm-svn: 17260
2004-10-26 16:23:03 +00:00
Chris Lattner
e9e73bd3b1 Fix header
llvm-svn: 17259
2004-10-26 16:19:57 +00:00
Misha Brukman
03f87d527d Use <tt> around "#include" and "std::endl"
llvm-svn: 17258
2004-10-26 16:18:43 +00:00
Misha Brukman
4f056d55d5 * DataTypesFix.h moved to AIXDataTypesFix.h
* Condition #inclusion of AIXDataTypes.h on the _AIX preprocessor symbol to
  prevent extra I/O on non-AIX systems.  Thus, no #ifdef in AIXDataTypes.h

llvm-svn: 17257
2004-10-26 16:15:18 +00:00
Misha Brukman
d73c8428f1 Use <tt> around header names
llvm-svn: 17256
2004-10-26 16:07:46 +00:00
Misha Brukman
0c7e1420c1 * Thanks to Morten Ofstad for the Visual C++ compatibility fixes
* Added Paolo's email address

llvm-svn: 17255
2004-10-26 15:55:12 +00:00
Misha Brukman
f2499137d7 * Fix spelling and grammar errors
* Close <p> tags properly
* Break up paragraphs with blank lines, clean up text alignment
* Delete unbalanced "

llvm-svn: 17254
2004-10-26 15:45:13 +00:00
Chris Lattner
4336b87f2c Move method bodies that depend on <algorithm> from MBB.h to MBB.cpp
llvm-svn: 17253
2004-10-26 15:43:42 +00:00
Chris Lattner
29f1999571 Remove the unused MachineBasicBlock2IndexFunctor class.
Move method bodies that depend on <algorithm> out of line to
MachineBasicBlock.cpp.  Patch contributed by Morten Ofstad!

llvm-svn: 17252
2004-10-26 15:41:13 +00:00
Chris Lattner
c8b07dd339 Clean up the MachineBasicBlock.h file, percolating #includes into this file.
Patch contributed by Morten Ofstad

llvm-svn: 17251
2004-10-26 15:35:58 +00:00
Reid Spencer
8da1b5df59 * Implement the "dist-check" target that verifies the contents of a zipped
tarball.
* Fix bugs in the "dist" target (a precursor to dist-check).
* Correct the implementation of the "install" targets so that they ensure
  the installation directories are created before attmpting to install
  directories in them.
* Reduce the verbosity of the output of the makefile system
* Ensure output includes the configuration whenever libraries or tools are
  built, installed, or uninstalled.

llvm-svn: 17250
2004-10-26 07:09:33 +00:00
Reid Spencer
4a9b5ff536 Reduce the number of EXTRA_DIST files since Makefile.rules now handles the
autoconf directory automagically.

llvm-svn: 17249
2004-10-26 07:05:09 +00:00
Reid Spencer
7e8825fc62 Make sure the samples and test directories get distributed.
llvm-svn: 17248
2004-10-26 07:04:18 +00:00
Reid Spencer
c6c87c1378 Make sure the include files get distributed.
llvm-svn: 17247
2004-10-26 07:03:39 +00:00
Reid Spencer
9b7a83838a Add the export symbols list files as extra distribution files.
llvm-svn: 17246
2004-10-26 07:02:58 +00:00
Nate Begeman
7fed324ffc Remove include of MRegisterInfo.h, since it is already included by
SkeletonGenRegisterInfo.h.inc

llvm-svn: 17245
2004-10-26 06:04:23 +00:00
Nate Begeman
dd8f1d8b77 Remove file that is no longer used, and move include of MRegisterInfo.h
from PowerPCFrameInfo.h to PowerPCAsmPrinter.cpp where it is actually
needed.

llvm-svn: 17244
2004-10-26 06:02:38 +00:00
Nate Begeman
f94bedc26a Remove method getRegClass from MRegisterInfo, as it is no longer used.
llvm-svn: 17243
2004-10-26 06:00:31 +00:00
Reid Spencer
e7d8dff1f7 Really get mkinstalldirs to shut up about what its doing .. who cares?
llvm-svn: 17242
2004-10-26 05:49:38 +00:00
Chris Lattner
3939800123 Improve help output from llvm-db 'info' command. Patch contributed by
Michael McCracken!

llvm-svn: 17241
2004-10-26 05:46:17 +00:00
Nate Begeman
47b9d33f5b Eliminate usage of MRegisterInfo::getRegClass(physreg)
llvm-svn: 17240
2004-10-26 05:40:45 +00:00
Chris Lattner
d7a7a3f42f Fix the interpreter crash that Michael McCracken found
llvm-svn: 17239
2004-10-26 05:35:14 +00:00
Chris Lattner
b56cb729bd Reduce usage of MRegisterInfo::getRegClass
llvm-svn: 17238
2004-10-26 05:29:18 +00:00
Nate Begeman
4c6e1d694c Update to-do list
llvm-svn: 17235
2004-10-26 04:10:53 +00:00
Nate Begeman
26feb4f6d8 Fix treecc. Also fix a latent bug in emitBinaryConstOperation that would
allow and const, 0 to be incorrectly codegen'd into a rlwinm instruction.

llvm-svn: 17234
2004-10-26 03:48:25 +00:00
Reid Spencer
aa4887b482 Add EXTRA_DIST for additional files to be distributed.
llvm-svn: 17233
2004-10-26 03:12:11 +00:00
Chris Lattner
a47b641a85 Give a useful hint
llvm-svn: 17232
2004-10-26 02:58:10 +00:00
Chris Lattner
bff6472b39 Bug fixed
llvm-svn: 17231
2004-10-25 22:13:02 +00:00
Chris Lattner
ff43ef3cc5 Disable the JIT until it can sorta kinda work.
llvm-svn: 17230
2004-10-25 20:53:41 +00:00
Chris Lattner
024627bc94 add a link to the makefile guide, eliminate redundant link to coding stds
llvm-svn: 17226
2004-10-25 19:39:46 +00:00
Chris Lattner
a555183507 Make a sentence easier to parse
llvm-svn: 17225
2004-10-25 19:37:46 +00:00
Chris Lattner
5b7c967b54 Fix spellos
llvm-svn: 17224
2004-10-25 19:28:03 +00:00
Chris Lattner
3fe79addf7 Remove template args that are the same as the default
llvm-svn: 17223
2004-10-25 19:09:41 +00:00
Chris Lattner
574fecb59e Remove a dead class. Thanks to Morten Ofstad for pointing this out.
llvm-svn: 17222
2004-10-25 19:07:43 +00:00
Chris Lattner
21c6c41dcc Remove dead assert
llvm-svn: 17221
2004-10-25 19:04:01 +00:00
Chris Lattner
d3642d720c Patch to support MSVC, contributed by Morten Ofstad
llvm-svn: 17220
2004-10-25 18:47:10 +00:00
Chris Lattner
2e493d9e75 Patch to support MSVC, contributed by Morten Ofstad
llvm-svn: 17219
2004-10-25 18:46:05 +00:00
Chris Lattner
d57638c4a7 Fix compatibility with MSVC, patch by Morten Ofstad
llvm-svn: 17218
2004-10-25 18:45:16 +00:00
Chris Lattner
6180881673 Do not use variable sized arrays in C++, they are non-portable. Patch
contributed by Morten Ofstad

llvm-svn: 17217
2004-10-25 18:44:14 +00:00
John Criswell
7eeed938bf Removed dead method, printPHICopiesForSuccessors().
llvm-svn: 17216
2004-10-25 18:41:50 +00:00
Chris Lattner
111c3e827e Patch to support MSVC better, contributed by Morten Ofstad
llvm-svn: 17215
2004-10-25 18:40:47 +00:00
Chris Lattner
43df507fef Patch to support MSVC, contributed by Morten Ofstad
llvm-svn: 17214
2004-10-25 18:40:08 +00:00
Chris Lattner
778963766c Patch to support MSVC correctly, contributed by Morten Ofstad!
llvm-svn: 17213
2004-10-25 18:38:05 +00:00
John Criswell
a564e9e0ba Modified switch generation so that only the phi values associated with the
destination basic block are copied.

llvm-svn: 17212
2004-10-25 18:30:09 +00:00
Reid Spencer
100080cc38 New Makefile Features:
* "dist" target now builds tar.gz, tar.bz2, and zip files suitable for
  distribution. "dist" can only be run from $(BUILD_OBJ_ROOT) and implies
  a "check".

* made the preconditions not do a recursive make and ensured that they are
  executed sequentially.

* made the messages output by the makefile be prefixed with "llvm" and the
  make level (e.g. llvm[1]: ) in the same way that make does so that the
  messages are uniform and more readable.

* Fixed the tags target so that tags depends on TAGS which contains the
  rules to build a file named TAGS

* Implemented the EXTRA_DIST feature in a few directories to make sure it
  works.

llvm-svn: 17210
2004-10-25 08:27:37 +00:00
Reid Spencer
65cb53fe2f Teach mkinstalldirs how to shut up about making directories.
llvm-svn: 17209
2004-10-25 08:21:09 +00:00
Reid Spencer
8d0d005998 Add a check for the tar program.
llvm-svn: 17208
2004-10-25 08:18:47 +00:00
Nate Begeman
74b7c1f3e0 Implement more complete and correct codegen for bitfield inserts, as tested
by the recently committed rlwimi.ll test file.  Also commit initial code
for bitfield extract, although it is turned off until fully debugged.

llvm-svn: 17207
2004-10-24 10:33:30 +00:00
Nate Begeman
30e30c76ae Initial checkin of regression test for generating the PowerPC rlwimi
instruction, which performs bitfield inserts.  All tests should compile
to one rlwimi instruction.

llvm-svn: 17206
2004-10-24 10:30:22 +00:00
Reid Spencer
4fe72ed44f First draft. More to come.
llvm-svn: 17205
2004-10-24 08:48:59 +00:00
Reid Spencer
dcba778871 Fix uninstall from rebuilding everything (wrong dependency)
llvm-svn: 17204
2004-10-24 08:21:04 +00:00
Reid Spencer
70969c005b Move top level rules for tags and installing headers to Makefile.rules
llvm-svn: 17203
2004-10-24 08:20:10 +00:00
Reid Spencer
12a3a0553d Implemented New Features:
* Fixed the install target to install files correctly
* Implemented the uninstall target to remove files from install dirs
* Isolated the top level targets (dist, dist-check, dist-clean, tags) so
  they only run/exist from the top level directory
* Put if/endif gaurds around potentially dangerous $(RM) commands.
* Implemented place-holder rules for distribution targets to just say that
  they aren't implemented yet.
* Implemented tags target in Makefile.rules so all projects can use it
* Made a pony for resistor

llvm-svn: 17202
2004-10-24 07:53:21 +00:00
Chris Lattner
3ff9289476 Fix the previous bug the correct way. This fixes ptrdist/bc
llvm-svn: 17201
2004-10-24 04:27:59 +00:00
Misha Brukman
fa2f3010c1 Fix grammar in comments to getSizeOf()
llvm-svn: 17200
2004-10-24 03:18:30 +00:00
Alkis Evlogimenos
ba28dc8c54 Make this actually work.
llvm-svn: 17199
2004-10-24 03:02:16 +00:00
Alkis Evlogimenos
ed962e31e2 Improve comments and wrap to 80 columns.
llvm-svn: 17198
2004-10-24 03:01:32 +00:00
Reid Spencer
e057811423 Make the $(OBJDIR) go away on clean-local.
llvm-svn: 17197
2004-10-24 02:26:09 +00:00
Alkis Evlogimenos
da5de05b9b Add ConstantExpr::getSizeOf(Type*).
llvm-svn: 17196
2004-10-24 01:41:10 +00:00
Misha Brukman
9ce0da9e90 * Correctly handle the MovePCtoLR pseudo-instr with a bl to next instr
* Stop the confusion of using rv and Addr for global addresses: just use rv

llvm-svn: 17195
2004-10-23 23:47:34 +00:00
Misha Brukman
f1f6270708 Add BA, BL, and BLA opcodes
llvm-svn: 17193
2004-10-23 20:29:24 +00:00
Reid Spencer
81cd049e8c Several Changes:
* Fix parallel build problem on generated dependency files
* Fix rule confusion between .a and .la libraries so that parallel builds
  don't get confused on who is building which .o and which library it is
  going into.
* Fix dependency inclusion to only include C/C++ dependency files because
  other types of sources won't have dependencies auto generated.
* Change "Source" to "SOURCES" for naming consistency
* Update parallel build rules for new recursive targets
* Implement EXPERIMENTAL_DIRS (failure allowed) feature
* Implement -local version of targets (all-local, clean-local, etc)
* Implement recursive targets in terms of their local counterparts
* Clarify names of some internal variables
* Move documentation to docs/MakefileGuide.html
* Clean up commentary

llvm-svn: 17192
2004-10-23 20:04:14 +00:00
Reid Spencer
eebdfe5896 Make clean quieter.
llvm-svn: 17191
2004-10-23 19:49:20 +00:00
Misha Brukman
421c3c1ec4 * Do not emit IMPLICIT_DEF pseudo-instructions
* Convert register numbers from their opcode value to the real value, e.g.
  PPC::R1 => 1 and PPC::F1 => 1
* Add correct handling of loading of global values which are PC-relative --
  implement ha16() and lo16()

llvm-svn: 17190
2004-10-23 18:28:01 +00:00
Reid Spencer
83e5e2801f Fix nightly build by avoiding shared library construction.
llvm-svn: 17187
2004-10-23 15:30:30 +00:00
Reid Spencer
282e13c942 * Actually ignore build errors in optional directories
* Use LLVM_SRC_ROOT as the anchor for the Target.td file
* Use MFLAGS instead of MAKEFLAGS for recursive makes so we don't try
  to build a target "w" or "s" mysteriously.

llvm-svn: 17186
2004-10-23 08:19:37 +00:00
Reid Spencer
70b3e231a7 Remove the clean target.
llvm-svn: 17185
2004-10-23 08:01:27 +00:00
Reid Spencer
72ba9da52d First cut at the LLVM Makefile Guide. There's lots to correct and lots more
to write, but this is all my brain can muster for tonight.

llvm-svn: 17184
2004-10-23 07:57:22 +00:00
Misha Brukman
15b0fb5678 DForm_1, particularly used by store instructions, needs the immediate operand to
be listed second as that is how the instructions are usually created (and is the
correct asm syntax) so that it's assembled correctly from its constituents

llvm-svn: 17183
2004-10-23 06:08:38 +00:00
Misha Brukman
e882d30aa1 Fix the SPR field for MTLR, MFLR, MTCTR, and MFCTR instructions.
The decimal value given in the manual (8 or 9) really needs to be multiplied by
a factor of 32 because of the group of 5 zero bits after the register code.

llvm-svn: 17182
2004-10-23 06:05:49 +00:00
Misha Brukman
55a3ccd035 The value of the XO field for MFLR and MFCTR is 339, not 399
llvm-svn: 17181
2004-10-23 05:38:55 +00:00
Misha Brukman
101d5d62d5 Remove extraneous blank line
llvm-svn: 17180
2004-10-23 04:59:22 +00:00
Chris Lattner
87a1061559 Make VC happier, patch contributed by Morten Ofstad
llvm-svn: 17179
2004-10-23 04:58:50 +00:00
Misha Brukman
cea2e46821 Align function arguments in function headers
llvm-svn: 17178
2004-10-23 04:58:32 +00:00
Chris Lattner
46131bd16f Fix a bug that Brian brought to my attention. This corrects:
Assembler/2004-10-22-BCWriterUndefBug.llx

llvm-svn: 17177
2004-10-23 03:10:23 +00:00
Chris Lattner
8e97254431 New testcase
llvm-svn: 17176
2004-10-23 03:10:01 +00:00
Nate Begeman
6cadac8f43 Kill casts from integer types to unsigned byte, when the cast was only used
as the shift amount operand to a shift instruction.  This was causing us to
emit unnecessary clear operations for code such as:
int foo(int x) { return 1 << x; }

llvm-svn: 17175
2004-10-23 00:50:23 +00:00
Misha Brukman
37a7102ccb Use cleaner quoting and eliminate blank space
llvm-svn: 17174
2004-10-22 23:35:57 +00:00
Reid Spencer
4755617619 Clean up the output from this makefile so its not verbose.
llvm-svn: 17173
2004-10-22 23:24:39 +00:00
Reid Spencer
23a703706c Make sure that we don't set up a circular dependency if OBJDIR == SRCDIR
llvm-svn: 17172
2004-10-22 23:06:30 +00:00
Reid Spencer
49d6d1eb9f Remove double colon rule for gram.tab.h so it doesn't conflict with the
auto-generated dependency rule.

llvm-svn: 17171
2004-10-22 23:05:46 +00:00
Misha Brukman
0de42869bf Pull in Target.td using absolute path from source root instead of relative path;
this allows us to have sub-targets whose depth in the tree is not the same as it
is for the standard X86/PowerPC/Sparc.

llvm-svn: 17170
2004-10-22 22:18:27 +00:00
Misha Brukman
e60a3fb063 Adjust rules for building .inc files due to Reid's changes of Makefile.rules
llvm-svn: 17169
2004-10-22 22:16:24 +00:00
Reid Spencer
5fd95ce095 We're not doing automake any more
llvm-svn: 17168
2004-10-22 21:02:23 +00:00
Reid Spencer
30d8baea8d Adjust to changes in Makefile.rules
llvm-svn: 17167
2004-10-22 21:02:08 +00:00
Reid Spencer
f206bd761f Shorten the rules, speed it up, correct library contruction, add *.td rules
llvm-svn: 17166
2004-10-22 21:01:56 +00:00
Reid Spencer
357f771b1a Remove the unused SourceDir variable (use BUILD_SRC_DIR)
llvm-svn: 17165
2004-10-22 21:01:44 +00:00
Reid Spencer
fa70bb9042 One more file to remove now that we're not doing automake.
llvm-svn: 17164
2004-10-22 19:33:22 +00:00
Reid Spencer
fad217c847 Eliminate compilation warning on uninitialized variable.
llvm-svn: 17163
2004-10-22 16:10:39 +00:00
Chris Lattner
fe9abf92de *** empty log message ***
llvm-svn: 17161
2004-10-22 06:43:28 +00:00
Chris Lattner
96502da2c0 New testcase. Check for the ability to promote a malloc whose initialzed state is checked by the program
llvm-svn: 17160
2004-10-22 06:43:07 +00:00
Chris Lattner
5c3c21e10a Fix a bug Nate noticed, where we miscompiled a simple testcase
llvm-svn: 17157
2004-10-22 04:53:16 +00:00
Reid Spencer
35572eb6f9 Remove automake support.
llvm-svn: 17156
2004-10-22 03:39:08 +00:00
Reid Spencer
c1c320c335 We won't use automake
llvm-svn: 17155
2004-10-22 03:35:04 +00:00
Misha Brukman
a6ecf271db Remove debug code emitter from the JIT
llvm-svn: 17151
2004-10-21 03:07:38 +00:00
Alkis Evlogimenos
757cc0e84c Make this compile.
llvm-svn: 17150
2004-10-21 02:44:16 +00:00
Misha Brukman
2beb63a65a * Added basic support for JITing functions, basic blocks, instruction encoding,
including registers, constants, and partial support for global addresses
* The JIT is disabled by default to allow building llvm-gcc, which wants to test
  running programs during configure

llvm-svn: 17149
2004-10-21 01:42:02 +00:00
Nate Begeman
86b5f8075c Don't clear or sign extend bool->int. This fires a few dozen times on the test suite
llvm-svn: 17147
2004-10-20 21:55:41 +00:00
Brian Gaeke
c9d8b4d45c Explain what this pass does.
llvm-svn: 17146
2004-10-20 19:38:58 +00:00
John Criswell
85b380582e Small performance improvement in generated C code:
Instead of unconditionally copying all phi node values into temporaries for
all successor blocks, generate code that will determine what successor
block will be called and then copy only those phi node values needed by
the successor block.

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

llvm-svn: 17144
2004-10-20 14:38:39 +00:00
Misha Brukman
e2ada0413e * Add baseline structural JIT code, but disable the JIT to allow llvm-gcc builds
- Support added for functions, basic blocks, constant pool, constants,
    registers, and some basic support for globals, all untested
* Turn assert()s into abort()s so that unimplemented functions fail in release

llvm-svn: 17143
2004-10-19 19:49:42 +00:00
Chris Lattner
257b284038 Hrm, some people complain when the compiler cheerfully tells them what it's
doing... I guess they're right.

llvm-svn: 17142
2004-10-19 06:33:16 +00:00
Misha Brukman
648ad57b85 Fix some grammar
llvm-svn: 17141
2004-10-19 05:55:54 +00:00
Misha Brukman
65af14766f If we're going to make the braces of functions line up for ease of readability
and aesthetic reasons, might as well finish the job

llvm-svn: 17140
2004-10-19 05:50:34 +00:00
Misha Brukman
471400c09b Remove unnecessary spaces in function signature
llvm-svn: 17139
2004-10-19 05:49:46 +00:00
Brian Gaeke
f3499acc16 Simplify mapping info generation. In particular, the LLVM-to-MachineInstr map
is no longer emitted, and we do not reference any MachineCodeForInstruction
information.

llvm-svn: 17138
2004-10-19 05:15:21 +00:00
Misha Brukman
fc62cd1a85 * Fit constructor initializer on a single line
* Delete blank chars at end of line to fit into 80 cols

llvm-svn: 17137
2004-10-19 00:29:16 +00:00
Reid Spencer
6a11a75f31 Initial automake generated Makefile template
llvm-svn: 17136
2004-10-18 23:55:41 +00:00
Misha Brukman
9cba8b39be Move code to redefine INT64_{MIN,MAX} on AIX/PowerPC to a separate header,
because #undef becomes commented out in DataTypes.h.in due to autoheader

llvm-svn: 17135
2004-10-18 22:14:48 +00:00
Nate Begeman
b18121e6a9 Initial implementation of the strength reduction for GEP instructions in
loops.  This optimization is not turned on by default yet, but may be run
with the opt tool's -loop-reduce flag.  There are many FIXMEs listed in the
code that will make it far more applicable to a wide range of code, but you
have to start somewhere :)

This limited version currently triggers on the following tests in the
MultiSource directory:
pcompress2: 7 times
cfrac: 5 times
anagram: 2 times
ks: 6 times
yacr2: 2 times

llvm-svn: 17134
2004-10-18 21:08:22 +00:00
Misha Brukman
947cd4569f * AIX on Power defines INT64_MIN and INT64_MAX in ways that annoy GCC, so
special-case those definitions
* Add comments in #ifdef/#else/#endif clauses for ease of reading

llvm-svn: 17132
2004-10-18 18:35:21 +00:00
Misha Brukman
22cf52374e AIX does not have mkdtemp() so emulate its behavior using mktemp() and mkdir()
llvm-svn: 17131
2004-10-18 17:39:45 +00:00
Chris Lattner
c1f91b5e11 Fix miscompilations in the SparcV9 backend that were induced by this patch:
http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20041011/019311.html

llvm-svn: 17130
2004-10-18 17:19:20 +00:00
Chris Lattner
fbc070bfdc Improve compatibility with VC++, patch contributed by Morten Ofstad!
llvm-svn: 17126
2004-10-18 15:54:17 +00:00
Chris Lattner
88a8a329c3 Get this file compiling with VC++, patch contributed by Morten Ofstad. Thanks Morten!
llvm-svn: 17125
2004-10-18 15:43:46 +00:00
Reid Spencer
69274ad96a Declare a function in the correct namespace.
Patch contributed by Morten Ofstad. Thanks Morten!

llvm-svn: 17124
2004-10-18 14:43:45 +00:00
Reid Spencer
ce0783318b Correction to allow compilation with Visual C++.
Patch contributed by Morten Ofstad. Thanks Morten!

llvm-svn: 17123
2004-10-18 14:38:48 +00:00
Chris Lattner
5edb2f32d0 Simplify code by deleting instructions that preceed unreachable instructions.
Simplify code by simplifying terminators that branch to blocks that start
with an unreachable instruction.

llvm-svn: 17116
2004-10-18 04:07:22 +00:00
Chris Lattner
033e156b54 New testcase
llvm-svn: 17115
2004-10-18 04:06:41 +00:00
Reid Spencer
1be07bb526 Actually link all the analysis passes and their dependencies.
llvm-svn: 17114
2004-10-18 03:32:12 +00:00
Reid Spencer
e5068ed336 Remove extra comma.
llvm-svn: 17113
2004-10-18 03:26:21 +00:00
Reid Spencer
2097b94c8b Actually link in all the analysis passes.
llvm-svn: 17112
2004-10-18 03:22:48 +00:00
Chris Lattner
a67dd32004 Turn store -> null/undef into the LLVM unreachable instruction! This simple
change hacks off 10K of bytecode from perlbmk (.5%) even though the front-end
is not generating them yet and we are not optimizing the resultant code.
This isn't too bad.

llvm-svn: 17111
2004-10-18 03:00:50 +00:00
Chris Lattner
8ba9ec9bbb Turn things with obviously undefined semantics into 'store -> null'
llvm-svn: 17110
2004-10-18 02:59:09 +00:00
Chris Lattner
3b92f17165 My friend the invoke instruction does not dominate all basic blocks if it
occurs in the entry node of a function

llvm-svn: 17109
2004-10-18 01:48:31 +00:00
Chris Lattner
34ae670706 Fix a bug that occurs when the constant value is the result of an invoke. In
particular, invoke ret values are only live in the normal dest of the invoke
not in the unwind dest.

llvm-svn: 17108
2004-10-18 01:21:17 +00:00
Chris Lattner
53058663aa Print a semicolon for the unreacahble instruction. This fixes problems
where C requires semicolons in some cases to indicate null statements.

llvm-svn: 17107
2004-10-17 23:49:11 +00:00
Chris Lattner
6a792feb02 Getting ADCE to interact well with unreachable instructions seems like a nontrivial
exercise that I'm not interested in tackling right now.  Just punt and treat them
like unwind's.

This 'fixes' test/Regression/Transforms/ADCE/unreachable-function.ll

llvm-svn: 17106
2004-10-17 23:45:06 +00:00
Chris Lattner
61011accfd New testcase that ADCE shouldn't crash on
llvm-svn: 17105
2004-10-17 23:44:02 +00:00
Chris Lattner
6e79e55aea Fix Regression/Transforms/Inline/2004-10-17-InlineFunctionWithoutReturn.ll
If a function had no return instruction in it, and the result of the inlined
call instruction was used, we would crash.

llvm-svn: 17104
2004-10-17 23:21:07 +00:00
Chris Lattner
5f8becb224 New testcase that crashes the inliner
llvm-svn: 17103
2004-10-17 23:20:29 +00:00
Nate Begeman
e5e5b37b79 Pass -single_module option to gcc when linking dynamic libraries for use with bugpoint, so that we can bugpoint multiple .cp files
llvm-svn: 17102
2004-10-17 23:03:32 +00:00
Nate Begeman
844186b8b4 Generate correct stubs for weak-linked symbols
llvm-svn: 17101
2004-10-17 23:01:34 +00:00
Chris Lattner
f60137501f fold gep undef, ... -> undef
This comes up many times in perlbmk and probably others.

llvm-svn: 17100
2004-10-17 21:54:55 +00:00
Chris Lattner
107c15c33d Remove printout, realize that instructions in the entry block dominate all
other blocks.

llvm-svn: 17099
2004-10-17 21:31:34 +00:00
Chris Lattner
215c7ebaa6 When inserting PHI nodes, don't insert any phi nodes that are obviously
unneccesary.  This allows us to delete several hundred phi nodes of the
form PHI(x,x,x,undef) from 253.perlbmk and probably other programs as well.

This implements Mem2Reg/UndefValuesMerge.ll

llvm-svn: 17098
2004-10-17 21:25:56 +00:00
Chris Lattner
d047673192 New testcase, no PHI should be inserted.
llvm-svn: 17097
2004-10-17 21:25:32 +00:00
Chris Lattner
96db59e48a Enhance hasConstantValue to ignore undef values in phi nodes. This allows it
to think that PHI[4, undef] == 4.

llvm-svn: 17096
2004-10-17 21:23:26 +00:00
Chris Lattner
e29d634a94 hasConstantValue will soon return instructions that don't dominate the PHI node,
so prepare for this.

llvm-svn: 17095
2004-10-17 21:22:38 +00:00
Chris Lattner
621c413a1b The first hunk corrects a bug when printing undef null values. We would print
0->field, which is illegal.  Now we print ((foo*)0)->field.

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

llvm-svn: 17094
2004-10-17 17:48:59 +00:00
Chris Lattner
068555314b Don't print stuff out from the code generator. This broke the JIT horribly
last night. :)  bork!

llvm-svn: 17093
2004-10-17 17:40:50 +00:00
Reid Spencer
cb13f6e51f Add HAVE_BZLIB_H and HAVE_ZLIB_H tests.
llvm-svn: 17092
2004-10-17 17:07:29 +00:00
Reid Spencer
c1f295a66c Update to reflect building zlib for LLVM
llvm-svn: 17091
2004-10-17 15:02:47 +00:00
Reid Spencer
6889cc2d74 Add missing targets for install/clean
llvm-svn: 17090
2004-10-17 15:01:59 +00:00
Reid Spencer
f476d84b69 Make the library name SparcV9 specific
llvm-svn: 17089
2004-10-17 15:01:12 +00:00
Reid Spencer
b7c9d5444b Consolidate the definitions
llvm-svn: 17088
2004-10-17 15:00:26 +00:00
Reid Spencer
de028a4a69 PPC32GenCodeEmitter instead of PowerPCGenCodeEmitter
llvm-svn: 17087
2004-10-17 14:59:38 +00:00
Reid Spencer
85f1cd7893 Add runtime directories
llvm-svn: 17086
2004-10-17 14:58:49 +00:00
Reid Spencer
60be648481 Support bytecode generation, GenCodeEmitter, etc.
llvm-svn: 17085
2004-10-17 14:57:12 +00:00
Reid Spencer
c833b76f00 Add runtime directory, include Makefile_rules
llvm-svn: 17084
2004-10-17 14:56:15 +00:00
Chris Lattner
839abf57a6 Rewrite support for cast uint -> FP. In particular, we used to compile this:
double %test(uint %X) {
        %tmp.1 = cast uint %X to double         ; <double> [#uses=1]
        ret double %tmp.1
}

into:

test:
        sub %ESP, 8
        mov %EAX, DWORD PTR [%ESP + 12]
        mov %ECX, 0
        mov DWORD PTR [%ESP], %EAX
        mov DWORD PTR [%ESP + 4], %ECX
        fild QWORD PTR [%ESP]
        add %ESP, 8
        ret

... which basically zero extends to 8 bytes, then does an fild for an
8-byte signed int.

Now we generate this:


test:
        sub %ESP, 4
        mov %EAX, DWORD PTR [%ESP + 8]
        mov DWORD PTR [%ESP], %EAX
        fild DWORD PTR [%ESP]
        shr %EAX, 31
        fadd DWORD PTR [.CPItest_0 + 4*%EAX]
        add %ESP, 4
        ret

        .section .rodata
        .align  4
.CPItest_0:
        .quad   5728578726015270912

This does a 32-bit signed integer load, then adds in an offset if the sign
bit of the integer was set.

It turns out that this is substantially faster than the preceeding sequence.
Consider this testcase:

unsigned a[2]={1,2};
volatile double G;

void main() {
    int i;
    for (i=0; i<100000000; ++i )
        G += a[i&1];
}

On zion (a P4 Xeon, 3Ghz), this patch speeds up the testcase from 2.140s
to 0.94s.

On apoc, an athlon MP 2100+, this patch speeds up the testcase from 1.72s
to 1.34s.

Note that the program takes 2.5s/1.97s on zion/apoc with GCC 3.3 -O3
-fomit-frame-pointer.

llvm-svn: 17083
2004-10-17 08:01:28 +00:00
Chris Lattner
112fd88a05 Unify handling of constant pool indexes with the other code paths, allowing
us to use index registers for CPI's

llvm-svn: 17082
2004-10-17 07:49:45 +00:00
Chris Lattner
af19d396ac Give the asmprinter the ability to print memrefs with a constant pool index,
index reg and scale

llvm-svn: 17081
2004-10-17 07:16:32 +00:00
Chris Lattner
653d8663fe fold:
%X = and Y, constantint
  %Z = setcc %X, 0

instead of emitting:

        and %EAX, 3
        test %EAX, %EAX
        je .LBBfoo2_2   # UnifiedReturnBlock

We now emit:

        test %EAX, 3
        je .LBBfoo2_2   # UnifiedReturnBlock

This triggers 581 times on 176.gcc for example.

llvm-svn: 17080
2004-10-17 06:10:40 +00:00
Chris Lattner
e234a21488 All of these labels are off by one now that the unreachable instruction exists
llvm-svn: 17079
2004-10-17 05:37:47 +00:00
Nate Begeman
2c873ca365 Implement bitfield insert by recognizing the following pattern:
1. optional shift left
2. and x, immX
3. and y, immY
4. or z, x, y
==> rlwimi z, x, y, shift, mask begin, mask end

where immX == ~immY and immX is a run of set bits. This transformation
fires 32 times on voronoi, once on espresso, and probably several
dozen times on external benchmarks such as gcc.

To put this in terms of actual code generated for
struct B { unsigned a : 3; unsigned b : 2; };
void storeA (struct B *b, int v) { b->a = v;}
void storeB (struct B *b, int v) { b->b = v;}

Old:
_storeA:
        rlwinm r2, r4, 0, 29, 31
        lwz r4, 0(r3)
        rlwinm r4, r4, 0, 0, 28
        or r2, r4, r2
        stw r2, 0(r3)
        blr

_storeB:
        rlwinm r2, r4, 3, 0, 28
        rlwinm r2, r2, 0, 27, 28
        lwz r4, 0(r3)
        rlwinm r4, r4, 0, 29, 26
        or r2, r2, r4
        stw r2, 0(r3)
        blr

New:
_storeA:
        lwz r2, 0(r3)
        rlwimi r2, r4, 0, 29, 31
        stw r2, 0(r3)
        blr

_storeB:
        lwz r2, 0(r3)
        rlwimi r2, r4, 3, 27, 28
        stw r2, 0(r3)
        blr

llvm-svn: 17078
2004-10-17 05:19:20 +00:00
Chris Lattner
192eaccc1a Fix constant folding relational operators with undef operands.
llvm-svn: 17077
2004-10-17 04:01:51 +00:00
Chris Lattner
0e4818c99a Reid added --version to the CommandLine lib. Don't conflict with it.
llvm-svn: 17076
2004-10-17 02:49:08 +00:00
Chris Lattner
f6666db032 I forgot that sparc no longer uses the shared asmwriter. Give it support
for undef.

llvm-svn: 17075
2004-10-17 02:44:45 +00:00
Chris Lattner
37b138a00b Add support for unreachable and undef
llvm-svn: 17074
2004-10-17 02:42:42 +00:00
Reid Spencer
94ffa656eb Initial Makefile.am for building with automake
llvm-svn: 17073
2004-10-17 00:24:24 +00:00
Reid Spencer
3d99608cc4 Initial Makefile.am for building with automake.
llvm-svn: 17072
2004-10-17 00:20:42 +00:00
Reid Spencer
c0ec7a65a6 Make sure that for systems where the string functions are actually macros
that we undefine the macro before using its name in the definition. This
can happen on Linux if _GNU_SOURCE is defined.

llvm-svn: 17071
2004-10-17 00:17:54 +00:00
Chris Lattner
fd7bf724d3 Implement constant folding of undef values.
llvm-svn: 17070
2004-10-16 23:31:32 +00:00
Chris Lattner
67f0545daf Fix a type violation
llvm-svn: 17069
2004-10-16 23:28:04 +00:00
Nate Begeman
29dc5f2a3e Finally fix one of the oldest FIXMEs in the PowerPC backend: correctly
flag rotate left word immediate then mask insert (rlwimi) as a two-address
instruction, and update the ISel usage of the instruction accordingly.

This will allow us to properly schedule rlwimi, and use it to efficiently
codegen bitfield operations.

llvm-svn: 17068
2004-10-16 20:43:38 +00:00
Chris Lattner
684c5c6587 Kill the bogon that slipped into my buffer before I committed.
llvm-svn: 17067
2004-10-16 19:46:33 +00:00
Chris Lattner
6580e09fef Implement InstCombine/getelementptr.ll:test9, which is the source of many
ugly and giant constnat exprs in some programs.

llvm-svn: 17066
2004-10-16 19:44:59 +00:00
Chris Lattner
d2c8ed1170 New testcase, rework testcases to fail if there are any gep's other than those
involving %B instead of allowing any geps except %A's.

llvm-svn: 17065
2004-10-16 19:44:23 +00:00
Misha Brukman
bbd150eaa7 * Add a space between words
* Wrap at 80 cols

llvm-svn: 17064
2004-10-16 19:13:58 +00:00
Chris Lattner
eba3f46b2f Do not erroneously accept revision 6 bytecode files when the format hasn't
been defined yet!

llvm-svn: 17063
2004-10-16 18:56:02 +00:00
Chris Lattner
552663387b Update release notes
llvm-svn: 17062
2004-10-16 18:35:57 +00:00
Chris Lattner
17ce82f71d New testcase
llvm-svn: 17061
2004-10-16 18:28:01 +00:00
Chris Lattner
5a02a3e963 Add support for undef and unreachable
llvm-svn: 17059
2004-10-16 18:24:35 +00:00
Chris Lattner
aef20fbbb9 testcases for undefined and unreachable
llvm-svn: 17058
2004-10-16 18:24:11 +00:00
Chris Lattner
fcfe78eaf8 Fix fix fix
llvm-svn: 17057
2004-10-16 18:21:50 +00:00
Chris Lattner
98e541457b Add support for unreachable
llvm-svn: 17056
2004-10-16 18:21:33 +00:00
Chris Lattner
61753bf847 Add support for undef
llvm-svn: 17055
2004-10-16 18:19:26 +00:00
Chris Lattner
770709befe Add support for undef, unreachable, and function flags
llvm-svn: 17054
2004-10-16 18:18:16 +00:00
Chris Lattner
4ff314968e Parse undef and unreachable
llvm-svn: 17053
2004-10-16 18:17:13 +00:00
Chris Lattner
2978437b76 Add support
llvm-svn: 17052
2004-10-16 18:16:19 +00:00
Chris Lattner
ea9a85abe4 Add support for undef and unreachable
llvm-svn: 17051
2004-10-16 18:14:10 +00:00
Chris Lattner
a3f3c8a1ad ADd support for undef and unreachable
llvm-svn: 17050
2004-10-16 18:13:47 +00:00
Chris Lattner
e4bea062c7 Teach the X86 backend about unreachable and undef. Among other things, we
now compile:

'foo() {}' into "ret" instead of "mov EAX, 0; ret"

llvm-svn: 17049
2004-10-16 18:13:05 +00:00
Chris Lattner
583dfdcf86 Add support for unreachable and undef
llvm-svn: 17048
2004-10-16 18:12:13 +00:00
Chris Lattner
81a7a23494 Optimize instructions involving undef values. For example X+undef == undef.
llvm-svn: 17047
2004-10-16 18:11:37 +00:00
Chris Lattner
7e6d4a12b5 Add support for UndefValue
llvm-svn: 17046
2004-10-16 18:10:31 +00:00
Chris Lattner
c0e2e82477 When promoting mem2reg, make uninitialized values become undef isntead of 0.
llvm-svn: 17045
2004-10-16 18:10:06 +00:00
Chris Lattner
646354bae1 Handle undef values as undefined on the constant lattice
ignore unreachable instructions

llvm-svn: 17044
2004-10-16 18:09:41 +00:00
Chris Lattner
6ac3ef950d Add note
llvm-svn: 17043
2004-10-16 18:09:25 +00:00
Chris Lattner
8e71c6a33d Add support for the undef value. Implement a new optimization based on globals
that are initialized with undef.  When promoting malloc to a global, start out
initialized to undef

llvm-svn: 17042
2004-10-16 18:09:00 +00:00
Chris Lattner
5e0b9f2eec Add support for undef and unreachable
llvm-svn: 17041
2004-10-16 18:08:06 +00:00
Chris Lattner
d5f67d8ca6 Implement UndefValue class
llvm-svn: 17040
2004-10-16 18:07:16 +00:00
Chris Lattner
38a6969894 Add support for the unreachable instruction
llvm-svn: 17039
2004-10-16 18:06:43 +00:00
Chris Lattner
bcf508cf6f Add new UndefValueVal type
llvm-svn: 17038
2004-10-16 18:06:07 +00:00
Chris Lattner
3384f9ad40 Add new UnreachableInst class
llvm-svn: 17037
2004-10-16 18:05:54 +00:00
Chris Lattner
278e1dab8e Add new unreachable instruction
llvm-svn: 17036
2004-10-16 18:05:37 +00:00
Chris Lattner
9d4d20b71c Add new UndefValue class
llvm-svn: 17035
2004-10-16 18:05:25 +00:00
Chris Lattner
d57b37d1fa UndefValue's are constants
llvm-svn: 17034
2004-10-16 18:05:10 +00:00
Chris Lattner
08b7d5b032 Document unreachable instruction
llvm-svn: 17033
2004-10-16 18:04:13 +00:00
Chris Lattner
cd196a9444 Add missing 'Instruction Opcodes' bullet to TOC
Update for changes in LLVM 1.4 bytecode format.

llvm-svn: 17032
2004-10-16 18:03:55 +00:00
Chris Lattner
1a709646e7 Add a missing dependency
llvm-svn: 17031
2004-10-16 17:12:55 +00:00
Chris Lattner
947ecace14 Fix file header
llvm-svn: 17030
2004-10-16 16:37:42 +00:00
Chris Lattner
3c3e058406 Be more careful about looking for constants when we really want constantint's.
llvm-svn: 17029
2004-10-16 16:07:10 +00:00
Chris Lattner
db6a9fdf38 None of these have actually been implemented yet.
llvm-svn: 17027
2004-10-16 00:29:30 +00:00
Chris Lattner
f22be93428 Move the implementation of the instructions clone methods to this file so
that the vtables for these classes are only instantiated in this translation
unit, not in every xlation unit they are used.

llvm-svn: 17026
2004-10-15 23:52:53 +00:00
Chris Lattner
a47839f165 Move the implementation of the clone method for these classes to
Instructions.cpp, so that a vtable is not emitted into every translation unit
that uses the classes.

llvm-svn: 17025
2004-10-15 23:52:05 +00:00
Misha Brukman
b889b2ad97 Fix hyphenation and quoting style for great justice
llvm-svn: 17024
2004-10-15 23:22:48 +00:00
Chris Lattner
c4f93ac159 There is no reason not to build these in parallel
llvm-svn: 17023
2004-10-15 23:22:15 +00:00
Misha Brukman
65c23ee5d3 Add a space between the type and name of value when printing error message
llvm-svn: 17022
2004-10-15 23:08:50 +00:00
Chris Lattner
0bc0f1d8de Don't print a bunch of metrics that are meaningless for external functions
llvm-svn: 17017
2004-10-15 19:40:31 +00:00
Chris Lattner
cf809786dc Fix broken links
llvm-svn: 17016
2004-10-15 17:04:28 +00:00
Chris Lattner
15914416ec Instruction select globals with offsets better. For example, on this test
case:

int C[100];
int foo() {
  return C[4];
}

We now codegen:

foo:
        mov %EAX, DWORD PTR [C + 16]
        ret

instead of:

foo:
        mov %EAX, OFFSET C
        mov %EAX, DWORD PTR [%EAX + 16]
        ret

Other impressive features may be coming later.

This patch is contributed by Jeff Cohen!

llvm-svn: 17011
2004-10-15 05:05:29 +00:00
Chris Lattner
3b78938b9e Give the X86 JIT the ability to encode global+disp constants. Patch
contributed by Jeff Cohen!

llvm-svn: 17010
2004-10-15 04:53:13 +00:00
Chris Lattner
19025d5ad0 Give the X86 asm printer the ability to print out addressing modes that have
constant displacements from global variables.  Patch by Jeff Cohen!

llvm-svn: 17009
2004-10-15 04:44:53 +00:00
Chris Lattner
df7b984f5a Allow X86 addressing modes to represent globals with offsets. Patch contributed
by Jeff Cohen!

llvm-svn: 17008
2004-10-15 04:43:20 +00:00
Chris Lattner
3065220deb Allow machine operands to represent global variables with offsets. This is
useful when you have a reference like:

int A[100];

void foo() { A[10] = 1; }

In this case, &A[10] is a single constant and should be treated as such.

Only MO_GlobalAddress and MO_ExternalSymbol are allowed to use this field, no
other operand type is.

This is another fine patch contributed by Jeff Cohen!!

llvm-svn: 17007
2004-10-15 04:38:41 +00:00
Chris Lattner
2152236351 This patch fixes the nasty bug that caused 175.vpr to fail for X86 last night.
The problem occurred when trying to reload this instruction:

MOV32mr %reg2326, 8, %reg2297, 4, %reg2295

The value of reg2326 was available in EBX, so it was reused from there, instead
of reloading it into EDX.

The value of reg2297 was available in EDX, so it was reused from there, instead
of reloading it into EDI.

The value of reg2295 was not available, so we tried reloading it into EBX, its
assigned register.  However, we checked and saw that we already reloaded
something into EBX, so we chose what reg2326 was assigned to (EDX) and reloaded
into that register instead.

Unfortunately EDX had already been used by reg2297, so reloading into EDX
clobbered the value used by the reg2326 operand, breaking the program.

The fix for this is to check that the newly picked register is ok.  In this
case we now find that EDX is already used and try using EDI, which succeeds.

llvm-svn: 17006
2004-10-15 03:19:31 +00:00
Chris Lattner
9af0572a37 This patch adds and improves debugging output. No functionality changes.
llvm-svn: 17005
2004-10-15 03:16:29 +00:00
Nate Begeman
a15c246af9 Better codegen of binary integer ops with 32 bit immediate operands.
This transformation fires a few dozen times across the testsuite.

For example, int test2(int X) { return X ^ 0x0FF00FF0; }
Old:
_test2:
        lis r2, 4080
        ori r2, r2, 4080
        xor r3, r3, r2
        blr

New:
_test2:
        xoris r3, r3, 4080
        xori r3, r3, 4080
        blr

llvm-svn: 17004
2004-10-15 00:50:19 +00:00
Misha Brukman
aa8f87c83c The field is called imm22', not simply imm'
llvm-svn: 17003
2004-10-14 22:33:32 +00:00
Misha Brukman
b03f27c96c Synthetic instructions RET and RETL need to have all 3 parameters specified
llvm-svn: 17002
2004-10-14 22:32:49 +00:00
Misha Brukman
b34fcdaa46 Class F2_1 already inherits the imm22 field from class F2
llvm-svn: 17001
2004-10-14 22:32:24 +00:00
Misha Brukman
7183fc3a84 Generate the SparcV8 code emitter from .td files
llvm-svn: 17000
2004-10-14 21:57:19 +00:00
Misha Brukman
98ebcd88f2 * In the F3_1 class, default asi to 0 because it's not currently used
* In the F3_3 class, remove mention of asi because it's not part of the format

llvm-svn: 16999
2004-10-14 21:53:39 +00:00
Misha Brukman
692979c1e2 * We don't use the ENABLE_*_JIT flags in the source base anymore
* Convert references to Sparc to SparcV9 to clearly identify CPU type

llvm-svn: 16998
2004-10-14 20:06:36 +00:00
Chris Lattner
5d33e8e73a Fix a bug John tracked down in libstdc++ where we were incorrectly deleting
weak functions.  Thanks for finding this John!

llvm-svn: 16997
2004-10-14 19:53:50 +00:00
Brian Gaeke
1f864b5583 Add FSTOI, FDTOI (fp to integer cast) instructions.
llvm-svn: 16996
2004-10-14 19:39:35 +00:00
Brian Gaeke
1519c24cff Rewrite emitCastOperation, refactoring parts of it into emitIntegerCast, and
adding emitFPToIntegerCast.

llvm-svn: 16995
2004-10-14 19:39:34 +00:00
Brian Gaeke
38a4dd3d15 Add list of libc procedures we'll use, at some point.
Update list of currently failing tests.
ADJCALLSTACK* support is done.

llvm-svn: 16994
2004-10-14 19:39:33 +00:00
Misha Brukman
f9898d7189 Use the shared Makefile.JIT for JIT-enablement, which also enables the examples
to have the JIT functioning on more platforms than just x86

llvm-svn: 16993
2004-10-14 19:02:13 +00:00
Misha Brukman
7c169be339 Use the shared Makefile.JIT for JIT-enablement
llvm-svn: 16992
2004-10-14 19:01:25 +00:00
Misha Brukman
c04ade7c4f Add Makefile.JIT to the list of Makefiles transferred to the build dir to give
tools and examples a simple way to JIT-enable themselves

llvm-svn: 16991
2004-10-14 18:59:42 +00:00
Misha Brukman
e62f4dd7b9 Transfer Makefile.JIT into the build tree for JIT-enabling tools and examples
llvm-svn: 16990
2004-10-14 18:59:09 +00:00
Misha Brukman
68baa6a7a9 Since several tools and examples want JIT support, factor out the process of
adding the right libs for any given architecture's JIT into a single place

llvm-svn: 16989
2004-10-14 18:58:19 +00:00
Misha Brukman
9372c95fde Convert tabs to spaces
llvm-svn: 16988
2004-10-14 18:47:56 +00:00
Chris Lattner
eb6b8e5772 Make sure any client of Dominators.h links in Dominators.cpp
Patch by Morten Ofstad

llvm-svn: 16987
2004-10-14 15:47:16 +00:00
Chris Lattner
36e629a3ea Make sure any client of Dominators.h links in Dominators.cpp
llvm-svn: 16986
2004-10-14 15:46:59 +00:00
Chris Lattner
52a126cb3e Do not use the same variable name for two different variables in the
same scope.  This confused VC++ (and probably people too!).  Patch by
Morten Ofstad!

llvm-svn: 16985
2004-10-14 14:59:16 +00:00
Chris Lattner
645d8c2863 Remove unneeded typedef, patch by Morten Ofstad
llvm-svn: 16984
2004-10-14 14:51:09 +00:00
Misha Brukman
1f596c3358 * Claim to support machine code emission - return false from
addPassesToEmitMachineCode()
* Add support for registers and constants in getMachineOpValue()

This enables running "int main() { ret 0 }" via the PowerPC JIT.

llvm-svn: 16983
2004-10-14 06:39:56 +00:00
Misha Brukman
789587f128 Enable the PowerPC JIT by compiling powerpc.o library into lli
llvm-svn: 16982
2004-10-14 06:35:11 +00:00
Misha Brukman
8b1bf4323f * Include the real (generated) version of getBinaryCodeForInstr()
* Add implementation of getMachineOpValue() for generated code emitter
* Convert assert()s in unimplemented functions to abort()s so that non-debug
  builds fail predictably
* Add file header comments

llvm-svn: 16981
2004-10-14 06:07:25 +00:00
Misha Brukman
c2d6aaeaa0 * Make a PPC32-specific code emitter because we have separate classes for 32-
and 64-bit code emitters that cannot share code unless we use virtual
  functions
* Identify components being built by tablegen with more detail by assigning them
  to PowerPC, PPC32, or PPC64 more specifically; also avoids seeing 'building
  PowerPC XYZ' messages twice, where one is for PPC32 and one for PPC64

llvm-svn: 16980
2004-10-14 06:04:56 +00:00
Tanya Lattner
d38a7605d8 Checking in code that works on my simple test case. However, there is still a bug with branches that I need to fix.
llvm-svn: 16979
2004-10-14 06:04:28 +00:00
Misha Brukman
189f3dc8d2 There is only one field in an instruction, and that is `Inst', the final view of
the instruction binary format, all others are simply operands and should not
have the `field' label

llvm-svn: 16978
2004-10-14 05:55:37 +00:00
Misha Brukman
d6ac8f5e5a PowerPC instruction definitions use LittleEndian-style encoding [0..31]
llvm-svn: 16977
2004-10-14 05:54:38 +00:00
Misha Brukman
dba1f62eb8 Add isLittleEndianEncoding to InstrInfo class, defaults to `off'
llvm-svn: 16976
2004-10-14 05:53:40 +00:00
Misha Brukman
8393c15b28 * Factor out (into new fn) a loop emitting operand shifts into the instruction
* Reverse instruction bit components for a LittleEndian-style encoding
* Fix some comments and spacing

llvm-svn: 16975
2004-10-14 05:53:01 +00:00
Misha Brukman
243ded5e1a * Add option to read isLittleEndianEncoding for InstrInfo classes
* Doxygen-ify some function comments

llvm-svn: 16974
2004-10-14 05:50:43 +00:00
Chris Lattner
45c35b1d1f When converting phi nodes into select instructions, we shouldn't promote PHI
nodes unless we KNOW that we are able to promote all of them.

This fixes: test/Regression/Transforms/SimplifyCFG/PhiNoEliminate.ll

llvm-svn: 16973
2004-10-14 05:13:36 +00:00
Chris Lattner
6299141c4e When converting phi nodes into select instructions, we shouldn't promote PHI
nodes unless we KNOW that we are able to promote all of them.  In this case
promoting the phi to a select is silly because we will always have to do the
call conditionally.  As such, select promotion is actually a pessimization.

llvm-svn: 16972
2004-10-14 05:12:50 +00:00
Reid Spencer
69812714cd Allow this file to compile on Darwin.
llvm-svn: 16971
2004-10-14 03:33:25 +00:00
Reid Spencer
37d4d6b2a2 Use __MINGW instead of __MING. Patch contributed by Henrik Bach.
llvm-svn: 16970
2004-10-14 03:09:02 +00:00
Reid Spencer
2f5fd88036 Get proper BSD #includes for MappedFile implementation.
llvm-svn: 16969
2004-10-14 03:06:59 +00:00
Reid Spencer
9cb9354d17 Implementation of MappedFile for Win32. Patch provided by Jeff Cohen.
llvm-svn: 16968
2004-10-14 03:05:59 +00:00
Chris Lattner
9a0e2546a0 Today is not my day. Fix broken #
llvm-svn: 16967
2004-10-14 02:31:35 +00:00
Chris Lattner
bff972d453 unbreak previous checkin :(
llvm-svn: 16966
2004-10-14 02:06:48 +00:00
Chris Lattner
e8fe2c2418 Add back a missing paren
llvm-svn: 16965
2004-10-14 01:57:28 +00:00
Chris Lattner
315157df62 Fit to 80 cols
llvm-svn: 16964
2004-10-14 01:49:34 +00:00
Chris Lattner
3d98008553 Wrap to 80 cols, delete some seriously old debugging printouts
llvm-svn: 16963
2004-10-14 01:46:07 +00:00
Chris Lattner
da6a885076 Fit in 80 columns
llvm-svn: 16962
2004-10-14 01:39:18 +00:00
Chris Lattner
eddbc20e2e Minor cleanups
llvm-svn: 16961
2004-10-14 01:35:17 +00:00
Chris Lattner
ac1a547a38 Patch to make VS happier, thanks to Morten Ofstad for pointing this out.
llvm-svn: 16956
2004-10-13 15:25:46 +00:00
Chris Lattner
6017d47064 Use explicit std:: qualification to avoid relying on Koenig lookup, which
VC++ does not do properly.  Thanks to Morten Ofstad for the patch!

llvm-svn: 16955
2004-10-13 15:11:23 +00:00
Chris Lattner
36fca705b1 Get rid of template templates that were preventing VC from compiling the
set_intersect template.  Thanks to Morten Ofstad and Jeff Cohen for the
patch!

llvm-svn: 16954
2004-10-13 15:09:21 +00:00
Reid Spencer
def9848a6c Changes for automake.
llvm-svn: 16953
2004-10-13 11:56:07 +00:00
Reid Spencer
d385a67c44 Set up BUILD_MODE based on the configuration so the default build mode
is established from configuration. Also, don't make the ENABLE_ options
AM_CONDITIONALs.

llvm-svn: 16952
2004-10-13 11:53:12 +00:00
Reid Spencer
26bfe011f8 Updates for changes in Makefile rules.
llvm-svn: 16951
2004-10-13 11:48:50 +00:00
Reid Spencer
ace94df71f Update to reflect changes in Makefile rules.
llvm-svn: 16950
2004-10-13 11:46:52 +00:00
Reid Spencer
5b240ad1d9 Get rid of the horrendous FIND_PATH macro, have libs and progs linked into
a common directory for simplicity. Provide an easy way to relink some
objects

llvm-svn: 16949
2004-10-13 11:39:51 +00:00
Chris Lattner
b15f04623b Update doco, make doxygen more, use standard dividers.
llvm-svn: 16948
2004-10-13 04:44:53 +00:00
Misha Brukman
ac00eb4eb6 Save Reid's notes from bugzilla on the proper procedure to upgrade libtool
llvm-svn: 16947
2004-10-13 01:07:55 +00:00
Reid Spencer
946085840c Resolution to PR451.
llvm-svn: 16946
2004-10-13 01:01:03 +00:00
Reid Spencer
5fcd5c70ca Changes for libtool 1.5.10
llvm-svn: 16945
2004-10-13 00:51:45 +00:00
Reid Spencer
2c1c1c46a9 Update for libtool 1.5.10
llvm-svn: 16944
2004-10-13 00:19:25 +00:00
Reid Spencer
d65d4d0b14 Harden the version requirements to the set that actually works after three
days of trying to figure it out. Despite some developer's penchant for
relaxing the tool versions, this just isn't possible. Only certain versions
work with certain other versions.

llvm-svn: 16943
2004-10-13 00:18:58 +00:00
Misha Brukman
89f77bce58 Fix file comment header
llvm-svn: 16942
2004-10-12 21:48:02 +00:00
Misha Brukman
bf24de0939 On second thought, OpaqueType is not really a good first-class type.
llvm-svn: 16941
2004-10-12 20:35:04 +00:00
Misha Brukman
dfd7ada4a2 No space allowed between \ and end-of-line
llvm-svn: 16940
2004-10-12 19:17:11 +00:00
Misha Brukman
25754a7703 Wrap lines at 80 cols
llvm-svn: 16939
2004-10-12 18:35:57 +00:00
Chris Lattner
92e37e092c Add comment
llvm-svn: 16937
2004-10-12 17:08:44 +00:00
Misha Brukman
0338401147 Opaque types are considered to be first-class.
llvm-svn: 16936
2004-10-12 17:06:17 +00:00
Chris Lattner
76a9758cf1 Minor cleanups:
* fit in 80 lines
 * Eliminate extra namespaces
 * Drop llvm::

llvm-svn: 16935
2004-10-12 16:52:09 +00:00
Chris Lattner
5499551206 Don't emit the method into the llvm namespace, let the #includer decide where it goes
llvm-svn: 16934
2004-10-12 16:21:18 +00:00
Chris Lattner
cfa7268e20 Add std:: prefix for compilers without correct koenig lookup implemented.
Patch contributed by Paolo Invernizzi

llvm-svn: 16933
2004-10-12 16:10:39 +00:00
Chris Lattner
00648e1f86 Transform memmove -> memcpy when the source is obviously constant memory.
llvm-svn: 16932
2004-10-12 04:52:52 +00:00
Chris Lattner
c14504c92c New testcase for memmove -> memcpy transform
llvm-svn: 16931
2004-10-12 04:51:55 +00:00
Chris Lattner
db6ddca8d2 Right, calls have Operand#0 == the called function, don't forget this.
llvm-svn: 16930
2004-10-12 04:45:20 +00:00
Chris Lattner
1ccab843e2 Minor tweaks
llvm-svn: 16929
2004-10-12 04:32:37 +00:00
Chris Lattner
2b33e70e7f New header. Classes can be added as needed.
llvm-svn: 16928
2004-10-12 04:20:46 +00:00
Chris Lattner
89046ca244 Implement a new method
llvm-svn: 16927
2004-10-12 04:20:25 +00:00
Chris Lattner
ec901cc6cd This nutty patch has been in my tree since before 1.3 went out, and it needs
to go in.  This patch allows us to compute the trip count of loops controlled
by values loaded from constant arrays.  The cannonnical example of this is
strlen when passed a constant argument:

for (int i = 0; "constantstring"[i]; ++i) ;
return i;

In this case, it will compute that the loop executes 14 times, which means
that the exit value of i is 14.  Because of this, the loop gets DCE'd and
we are happy.  This also applies to anything that does similar things, e.g.
loops like this:

  const float Array[] = { 0.1, 2.1, 3.2, 23.21 };
  for (int i = 0; Array[i] < 20; ++i)

and is actually fairly general.

The problem with this is that it almost never triggers.  The reason is that
we run indvars and the loop optimizer only at compile time, which is before
things like strlen and strcpy have been inlined into the program from libc.
Because of this, it almost never is used (it triggers twice in specint2k).

I'm committing it because it DOES work, may be useful in the future, and
doesn't slow us down at all.  If/when we start running the loop optimizer
at link-time (-O4?) this will be very nice indeed :)

llvm-svn: 16926
2004-10-12 01:49:27 +00:00
Chris Lattner
7cabf6f87a Fix a REALLY obscure bug in my previous checkin, which was splicing the END
marker from one ilist into the middle of another basic block!

llvm-svn: 16925
2004-10-12 01:02:29 +00:00
Chris Lattner
9776f7259b Handle a common case more carefully. In particular, instead of transforming
pointer recurrences into expressions from this:

  %P_addr.0.i.0 = phi sbyte* [ getelementptr ([8 x sbyte]* %.str_1, int 0, int 0), %entry ], [ %inc.0.i, %no_exit.i ]
  %inc.0.i = getelementptr sbyte* %P_addr.0.i.0, int 1            ; <sbyte*> [#uses=2]

into this:

  %inc.0.i = getelementptr sbyte* getelementptr ([8 x sbyte]* %.str_1, int 0, int 0), int %inc.0.i.rec

Actually create something nice, like this:

  %inc.0.i = getelementptr [8 x sbyte]* %.str_1, int 0, int %inc.0.i.rec

llvm-svn: 16924
2004-10-11 23:06:50 +00:00
Chris Lattner
13128ab8fb Allow creation of GEP constantexprs with a vector of value* operands as
well as a vector of constant*'s.  It turns out that this is more efficient
and all of the clients want to do that, so we should cater to them.

llvm-svn: 16923
2004-10-11 22:52:25 +00:00
Chris Lattner
02a71e7748 Implement remove/eraseFromParent methods
llvm-svn: 16922
2004-10-11 22:21:39 +00:00
Chris Lattner
273207f32f Add long overdue methods
llvm-svn: 16921
2004-10-11 22:21:13 +00:00
Chris Lattner
be29306939 Make this build
llvm-svn: 16919
2004-10-11 20:53:28 +00:00
Chris Lattner
a92af96c56 Reenable the transform, turning X/-10 < 1 into X > -10
llvm-svn: 16918
2004-10-11 19:40:04 +00:00
Chris Lattner
58043a1473 Fix a warning that is emitted on the suns
llvm-svn: 16917
2004-10-11 15:50:40 +00:00
Chris Lattner
004e250cd2 This patch implements two things (sorry).
First, it allows SRA of globals that have embedded arrays, implementing
GlobalOpt/globalsra-partial.llx.  This comes up infrequently, but does allow,
for example, deleting several stores to dead parts of globals in dhrystone.

Second, this implements GlobalOpt/malloc-promote-*.llx, which is the
following nifty transformation:

Basically if a global pointer is initialized with malloc, and we can tell
that the program won't notice, we transform this:

struct foo *FooPtr;
...
  FooPtr = malloc(sizeof(struct foo));
...
  FooPtr->A   FooPtr->B

Into:

struct foo FooPtrBody;
...
   FooPtrBody.A  FooPtrBody.B

This comes up occasionally, for example, the 'disp' global in 183.equake (where
the xform speeds the CBE version of the program up from 56.16s to 52.40s (7%)
on apoc), and the 'desired_accept', 'fixLRBT', 'macroArray', & 'key_queue'
globals in 300.twolf (speeding it up from 22.29s to 21.55s (3.4%)).

The nice thing about this xform is that it exposes the resulting global to
global variable optimization and makes alias analysis easier in addition to
eliminating a few loads.

llvm-svn: 16916
2004-10-11 05:54:41 +00:00
Chris Lattner
615bd303d1 This testcase ensures that we can SRA a global even if part of the global
cannot be SRA'd

llvm-svn: 16915
2004-10-11 05:00:30 +00:00
Chris Lattner
214956dd9d These testcases check to see if we can promote malloc's to globals in some
cases.

llvm-svn: 16914
2004-10-11 05:00:12 +00:00
Chris Lattner
155cfd237b Don't miss global optimizations because we run before the inliner
llvm-svn: 16913
2004-10-11 04:47:18 +00:00
Chris Lattner
6faf3949f6 Fix SingleSource/Benchmarks/McGill/chomp
llvm-svn: 16912
2004-10-11 04:07:27 +00:00
Chris Lattner
b2b7f90caf If we are trying to create a ConstantExpr cast that is really a GEP to the
first element of an array, return a GEP instead of a cast.  This allows us
to transparently fold this:

int* getelementptr (int* cast ([100 x int]* %Gbody to int*), int 40)

into this:

int* getelementptr ([100 x int]* %Gbody, int 0, int 40)

llvm-svn: 16911
2004-10-11 03:57:30 +00:00
Misha Brukman
8c8cbb8b71 Fix grammar
llvm-svn: 16910
2004-10-11 02:06:40 +00:00
Misha Brukman
8da107a68f Remove exhuberant-style comments which remained from copying file from `sample'
llvm-svn: 16909
2004-10-11 00:56:41 +00:00
Misha Brukman
6e200dedd7 Fix file header comment; remove sample project (extra-verbose) comments
llvm-svn: 16908
2004-10-11 00:55:47 +00:00
Misha Brukman
e67286641e Fix file header comment
llvm-svn: 16907
2004-10-11 00:54:59 +00:00
Misha Brukman
1df01504c6 ModuloScheduling has moved to lib/Target/SparcV9
llvm-svn: 16906
2004-10-10 23:37:40 +00:00
Misha Brukman
b4cb9fc7c9 Add ModuloScheduling to the recursive build tree
llvm-svn: 16905
2004-10-10 23:36:09 +00:00
Misha Brukman
9da1134bfb Adjust header file inclusion due to move
llvm-svn: 16904
2004-10-10 23:34:50 +00:00
Misha Brukman
c70014bea3 Adjust comment header and paths to refect move
llvm-svn: 16903
2004-10-10 23:34:36 +00:00
Misha Brukman
4a4af7e20c ModuloScheduling moved to lib/Target/SparcV9 as it is SparcV9-specific
llvm-svn: 16902
2004-10-10 23:33:20 +00:00
Chris Lattner
e42eb31f7d Just because we cannot completely eliminate all uses of a global, we can
still optimize away all of the indirect calls and loads, etc from it.
This turns code like this:

  if (G != 0)
    G();

into
   if (G != 0)
     ActualCallee();

This triggers a couple of times in gcc and libstdc++.

llvm-svn: 16901
2004-10-10 23:14:11 +00:00
Chris Lattner
cd1e756469 Another testcase. We should be able to devirtualize the call even though
we cannot completely eliminate the global.

llvm-svn: 16900
2004-10-10 23:12:33 +00:00
Reid Spencer
98e600b587 Reorganize FINDLIBS to make most comment libs searched first.
llvm-svn: 16899
2004-10-10 22:54:46 +00:00
Reid Spencer
823f302ff9 Initial version of automake Makefile.am file.
llvm-svn: 16898
2004-10-10 22:52:14 +00:00
Reid Spencer
ef6ba8db70 Add the new InstrSched directory.
llvm-svn: 16897
2004-10-10 22:51:03 +00:00
Reid Spencer
681a192eb3 Fix named of a library.
llvm-svn: 16896
2004-10-10 22:50:31 +00:00
Tanya Lattner
dbac0cb21e Added debug information. Fixed several bugs in the reconstruct loop function.
llvm-svn: 16895
2004-10-10 22:44:35 +00:00
Reid Spencer
f6d9ceebc6 Initial version of automake Makefile.am file.
llvm-svn: 16894
2004-10-10 22:36:40 +00:00
Reid Spencer
97327f05fc Initial version of automake Makefile.am file.
llvm-svn: 16893
2004-10-10 22:20:40 +00:00
Reid Spencer
e2d1af8be0 Build both archive and relinked objects
llvm-svn: 16892
2004-10-10 22:17:39 +00:00
Reid Spencer
42ea4fcb35 Directory changes
llvm-svn: 16891
2004-10-10 22:17:02 +00:00
Reid Spencer
105b441d5a A configure script to configure LLVM for compilation with automake
llvm-svn: 16890
2004-10-10 22:16:50 +00:00
Reid Spencer
2f13a83e77 Initial version of common automake Rules for LLVM
llvm-svn: 16889
2004-10-10 22:16:37 +00:00
Reid Spencer
f5dcbd7ba5 Initial version of automake Makefile.am file.
llvm-svn: 16888
2004-10-10 22:07:57 +00:00
Reid Spencer
f92cbf5bb8 Remove the InstrSched directory (moved to SparcV9)
llvm-svn: 16887
2004-10-10 21:19:41 +00:00
Reid Spencer
e975e4534c Directory no long exists (moved to Targets/SparcV9).
llvm-svn: 16886
2004-10-10 21:18:31 +00:00
Reid Spencer
b84cbf2725 Initial version of automake Makefile.am file.
llvm-svn: 16885
2004-10-10 20:43:57 +00:00
Brian Gaeke
4a69c9d667 Fix assertion failure when calling or returning from a function which
returns 'bool' type.

llvm-svn: 16884
2004-10-10 20:34:17 +00:00
Brian Gaeke
7be91b34b8 Implement eliminateCallFramePseudoInstr().
Wrap a long comment line.

llvm-svn: 16883
2004-10-10 19:57:21 +00:00
Brian Gaeke
9770e416c5 Model calls as *both* using *and* killing O0..O5, because callees use the
argument values passed in (so they're not dead until *after* the call),
and callees are free to modify those registers.

llvm-svn: 16882
2004-10-10 19:57:20 +00:00
Brian Gaeke
8a4d5caa76 Fix whitespace and wrap some long lines.
Deal with allocating stack space for outgoing args and copying them into the
correct stack slots (at least, we can copy <=32-bit int args).
We now correctly generate ADJCALLSTACK* instructions.

llvm-svn: 16881
2004-10-10 19:57:18 +00:00
Reid Spencer
4f9650fc71 Top level makefile for building LLVM with automake.
llvm-svn: 16880
2004-10-10 19:13:03 +00:00
Reid Spencer
1d98d2c4b7 Ensure timestamp on saved contents of configure.ac is not changed.
Use correct options to automake.

llvm-svn: 16879
2004-10-10 19:09:33 +00:00
Chris Lattner
604ed7aae8 Fix 2004-10-10-CastStoreOnce.llx, by adjusting types back if we strip off a cast
llvm-svn: 16878
2004-10-10 17:07:12 +00:00
Chris Lattner
89e0b39fe5 New testcase that crashes -globalopt. I found this through inspection, not
actually in the wild :)

llvm-svn: 16877
2004-10-10 17:06:09 +00:00
Chris Lattner
a0e769cc81 Implement GlobalOpt/deadglobal-2.llx, deletion of globals that are only
stored to, but are stored at variable indexes.  This occurs at least in
176.gcc, but probably others, and we should handle it for completeness.

llvm-svn: 16876
2004-10-10 16:47:33 +00:00
Chris Lattner
924ce79136 New testcase we were not handling before.
llvm-svn: 16875
2004-10-10 16:46:48 +00:00
Chris Lattner
cb9f152d8c Avoid calling use_size() which could (in theory) be expensive if the global
has a large number of users.  Instead, just keep track of whether we're
making changes as we do so.

This patch has no functionlity changes.

llvm-svn: 16874
2004-10-10 16:43:46 +00:00
Chris Lattner
3acdb7fa1b bling bling!
llvm-svn: 16873
2004-10-10 16:26:13 +00:00
Chris Lattner
ed8d767883 A testcase that globalopt now handles
llvm-svn: 16872
2004-10-09 21:50:05 +00:00
Chris Lattner
09a527290d Eliminate global pointers that are only stored a single value and null if
we know that all uses of the global will trap if the pointer contained is
null.  In this case, we forward substitute the stored value to any uses.

This has the effect of devirtualizing trivial globals in trivial cases.  For
example, 164.gzip contains this:

gzip.h:extern   int (*read_buf) OF((char *buf, unsigned size));
bits.c: read_buf  = file_read;
deflate.c:    lookahead = read_buf((char*)window,
deflate.c:        n = read_buf((char*)window+strstart+lookahead, more);

Since read_buf has to point to file_read at every use, we just replace
the calls through read_buf with a direct call to file_read.

This occurs in several benchmarks, including 176.gcc and 164.gzip.  Direct
calls are good and stuff.

llvm-svn: 16871
2004-10-09 21:48:45 +00:00
Chris Lattner
f9ae6db749 Instead of silently breaking, print notification of why this doesn't work.
llvm-svn: 16870
2004-10-09 21:13:51 +00:00
Chris Lattner
b84e1c527f Fix grammaro
llvm-svn: 16869
2004-10-09 19:37:02 +00:00
Chris Lattner
5c91c8f18b Use DEBUG instead of DebugFlag directly, as DebugFlag does not respect
-debug-only!

llvm-svn: 16868
2004-10-09 19:30:36 +00:00
Chris Lattner
99e4111d33 It looks like we're not releasing 1.4 with llvm.org as the official domain
llvm-svn: 16867
2004-10-09 19:19:57 +00:00
Brian Gaeke
74584cd842 update according to tonight's info
llvm-svn: 16866
2004-10-09 05:58:27 +00:00
Brian Gaeke
9c0710781d Implement getModuleMatchQuality and getJITMatchQuality so that v8 will be the
default 32/BE target on sparc hosts, and ppc will continue to be the default
on other hosts.

llvm-svn: 16865
2004-10-09 05:57:01 +00:00
Chris Lattner
f369b38d55 Fix infinite loop due to iteration
llvm-svn: 16864
2004-10-09 03:32:52 +00:00
Chris Lattner
4ad08352b4 Implement sub.ll:test17, -X/C -> X/-C
llvm-svn: 16863
2004-10-09 02:50:40 +00:00
Chris Lattner
cdc19d6a0e New testcase
llvm-svn: 16862
2004-10-09 02:50:01 +00:00
Chris Lattner
1f4739cd08 Add a check to avoid an assertion on malformed input
llvm-svn: 16861
2004-10-09 02:18:58 +00:00
Chris Lattner
23c8d0b65a The person who was planning to add SSE support isn't anymore, so disable
the -sse* options (to avoid misleading people).

Also, the stack alignment of the target doesn't depend on whether SSE is
eventually implemented, so remove a comment.

llvm-svn: 16860
2004-10-08 22:41:46 +00:00
Chris Lattner
97ea4206f7 Fix a major regression from the bugfix for 2004-10-08-SelectSetCCFold.llx,
which prevented setcc's from being folded into branches.  It appears that
conditional branchinst's CC operand is actually operand(2), not operand(0)
as we might expect. :(

llvm-svn: 16859
2004-10-08 22:24:31 +00:00
Chris Lattner
1b8d2957d3 If we found a dead global, we should at least delete it...
llvm-svn: 16858
2004-10-08 22:05:31 +00:00
Chris Lattner
1c4bddc50d * Pull out the meat of runOnModule into another function for clarity.
* Do not lead dangling dead constants prevent optimization
* Iterate global optimization while we're making progress.

These changes allow us to be more aggressive, handling cases like
GlobalOpt/iterate.llx without a problem (turning it into 'ret int 0').

llvm-svn: 16857
2004-10-08 20:59:28 +00:00
Chris Lattner
8f9a697431 New testcase
llvm-svn: 16856
2004-10-08 20:57:46 +00:00
Chris Lattner
73ad73e2d8 We might as well delete the known-dead global sooner rather than later since
we know it is dead.

llvm-svn: 16855
2004-10-08 20:25:55 +00:00
Misha Brukman
84e5ff7605 Hyphenate target-(in)dependent for more tasty grammar goodness (tm)
llvm-svn: 16854
2004-10-08 19:43:31 +00:00
Chris Lattner
0b41e861b6 Temporarily disable a buggy transformation until it can be fixed. This fixes
254.gap.

llvm-svn: 16853
2004-10-08 19:15:44 +00:00
Misha Brukman
e4e1360eab Adjust paths due to moving InstrSched to lib/Target/SparcV9
llvm-svn: 16852
2004-10-08 18:30:22 +00:00
Misha Brukman
70da50f095 Use the SparcV9-marked instr scheduling library
llvm-svn: 16851
2004-10-08 18:14:56 +00:00
Misha Brukman
cb54d5dfae InstrSched has been moved to lib/Target/SparcV9
llvm-svn: 16850
2004-10-08 18:12:53 +00:00
Misha Brukman
24eb38af7c InstrSched is SparcV9-specific and so has been moved to lib/Target/SparcV9/
llvm-svn: 16849
2004-10-08 18:12:14 +00:00
Misha Brukman
5a9976ac29 Single-space instead of double-spacing in the Makefile
llvm-svn: 16848
2004-10-08 18:11:14 +00:00
Misha Brukman
e75c26687c Build InstrSched as well, and all three subdirs can be built independently
llvm-svn: 16847
2004-10-08 18:10:48 +00:00
Misha Brukman
66cf7b641c * Adjust for the move to lib/Target/SparcV9/InstrSched
* Rename library to mark it SparcV9-specific

llvm-svn: 16846
2004-10-08 18:10:01 +00:00
Misha Brukman
73dce3a6bf Single-space instead of double-spacing in the Makefile
llvm-svn: 16845
2004-10-08 18:05:25 +00:00
Reid Spencer
d90857e144 Remove unused variable.
llvm-svn: 16844
2004-10-08 18:01:31 +00:00
Reid Spencer
6b9ba4a980 Make it so that positional parameters can have spaces in them.
llvm-svn: 16843
2004-10-08 17:59:29 +00:00
Chris Lattner
abab0719af Implement SRA for global variables. This allows the other global variable
optimizations to trigger much more often.  This allows the elimination of
several dozen more global variables in Programs/External.  Note that we only
do this for non-constant globals: constant globals will already be optimized
out if the accesses to them permit it.

This implements Transforms/GlobalOpt/globalsra.llx

llvm-svn: 16842
2004-10-08 17:32:09 +00:00
Chris Lattner
6935f560a5 New testcase
llvm-svn: 16841
2004-10-08 17:29:47 +00:00
Chris Lattner
0be2f50401 Fix bug: 2004-10-08-SelectSetCCFold.llx. Normally this is hidden by the
instcombine xform, which is why we didn't notice it before.

llvm-svn: 16840
2004-10-08 16:34:13 +00:00
Chris Lattner
fc95027b7a New testcase. The setcc is only used by a select, but not as a condition:
it cannot be folded in.

llvm-svn: 16839
2004-10-08 16:33:40 +00:00
Misha Brukman
41f9f29996 Properly `quote' names, and don't forget to add the ending quote!
llvm-svn: 16838
2004-10-08 14:59:05 +00:00
Reid Spencer
f9fdfa7aa5 Add the --with-automake option to AutoRegen.sh and provide the automake
version of the configure script. This is an early commit of the automake
support so that automake support can be tested on multiple platforms. Many
additional Makefile.am need to be added to LLVM before this is of any use.
Please wait until automake support is announced on llvmdev list before
using the --with-automake option.

llvm-svn: 16837
2004-10-08 05:33:35 +00:00
Chris Lattner
bff91d9a2e Instcombine (X & FF00) + xx00 -> (X+xx00) & FF00, implementing and.ll:test27
This comes up when doing adds to bitfield elements.

llvm-svn: 16836
2004-10-08 05:07:56 +00:00
Chris Lattner
9467062bcf New testcase
llvm-svn: 16835
2004-10-08 05:03:25 +00:00
Chris Lattner
44bd392cbf Little patch to turn (shl (add X, 123), 4) -> (add (shl X, 4), 123 << 4)
This triggers in cases of bitfield additions, opening opportunities for
future improvements.

llvm-svn: 16834
2004-10-08 03:46:20 +00:00
Chris Lattner
7bfe4032fc New testcase
llvm-svn: 16833
2004-10-08 03:41:59 +00:00
Nate Begeman
b58dd6799f Implement logical and with an immediate that consists of a contiguous block
of one or more 1 bits (may wrap from least significant bit to most
significant bit) as the rlwinm rather than andi., andis., or some longer
instructons sequence.

int andn4(int z) { return z & -4; }
int clearhi(int z) { return z & 0x0000FFFF; }
int clearlo(int z) { return z & 0xFFFF0000; }
int clearmid(int z) { return z & 0x00FFFF00; }
int clearwrap(int z) { return z & 0xFF0000FF; }

_andn4:
        rlwinm r3, r3, 0, 0, 29
        blr

_clearhi:
        rlwinm r3, r3, 0, 16, 31
        blr

_clearlo:
        rlwinm r3, r3, 0, 0, 15
        blr

_clearmid:
        rlwinm r3, r3, 0, 8, 23
        blr

_clearwrap:
        rlwinm r3, r3, 0, 24, 7
        blr

llvm-svn: 16832
2004-10-08 02:49:24 +00:00
Misha Brukman
3e0a20ebb8 Fix usage description typo
llvm-svn: 16831
2004-10-08 01:11:15 +00:00
Misha Brukman
f5a92bda7b Make comment header span the entire line
llvm-svn: 16830
2004-10-08 01:10:52 +00:00
Misha Brukman
ed3dc439e1 Describe how to configure tests to work with f2c
llvm-svn: 16829
2004-10-08 00:55:43 +00:00
Misha Brukman
8d08d36199 * Reformat to fit 80 cols
* Add missing <li> tags

llvm-svn: 16828
2004-10-08 00:41:27 +00:00
Nate Begeman
6e6514c47e Several fixes and enhancements to the PPC32 backend.
1. Fix an illegal argument to getClassB when deciding whether or not to
   sign extend a byte load.

2. Initial addition of isLoad and isStore flags to the instruction .td file
   for eventual use in a scheduler.

3. Rewrite of how constants are handled in emitSimpleBinaryOperation so
   that we can emit the PowerPC shifted immediate instructions far more
   often.  This allows us to emit the following code:

int foo(int x) { return x | 0x00F0000; }

_foo:
.LBB_foo_0:     ; entry
        ; IMPLICIT_DEF
        oris r3, r3, 15
        blr

llvm-svn: 16826
2004-10-07 22:30:03 +00:00
Nate Begeman
c6b63cd2ed Add ori reg, reg, 0 as a move instruction. This can be generated from
loading a 32bit constant into a register whose low halfword is all zeroes.

We now omit the ori after the lis for the following C code:

int bar(int y) { return y * 0x00F0000; }

_bar:
.LBB_bar_0:     ; entry
        ; IMPLICIT_DEF
        lis r2, 15
        mullw r3, r3, r2
        blr

llvm-svn: 16825
2004-10-07 22:26:12 +00:00
Nate Begeman
70a9d9c0b1 Remove unnecessary header include
llvm-svn: 16824
2004-10-07 22:24:32 +00:00
Chris Lattner
617f1a34f1 Improve comments, no functionality changes
llvm-svn: 16814
2004-10-07 21:30:30 +00:00
Chris Lattner
3ae7bb6b7c Fix a nasty dangling pointer problem, due to a free'd pointer being left in
a map.  This caused problems if a later object happened to be allocated at
the free'd object's address.

llvm-svn: 16813
2004-10-07 20:01:31 +00:00
Chris Lattner
b0b1cb2182 Get friendly with Type
llvm-svn: 16812
2004-10-07 19:21:43 +00:00
Chris Lattner
251093ca5d Unfortunately the fix for the previous bug introduced the previous
exponential behavior (bork!).  This patch processes stuff with an
explicit SCC finder, allowing the algorithm to be more clear,
efficient, and also (as a bonus) correct!  This gets us back to taking
0.6s to disassemble my horrible .bc file that previously took something
> 30 mins.

llvm-svn: 16811
2004-10-07 19:20:48 +00:00
Chris Lattner
d299ffee01 Change signature of this method again
llvm-svn: 16810
2004-10-07 19:19:12 +00:00
Chris Lattner
31d9e6f922 These files now live in Transforms/GlobalOpt
llvm-svn: 16809
2004-10-07 19:16:43 +00:00
Chris Lattner
5860106954 Move these files from Transforms/GlobalConstifier
llvm-svn: 16808
2004-10-07 19:16:26 +00:00
Chris Lattner
cef3c06027 Fix a bug in my previous change. Unfortunately this reverts most of the
speedup, but has the advantage of not breaking a bunch of programs!

llvm-svn: 16806
2004-10-07 16:19:40 +00:00
Reid Spencer
50a425a56d Make these scripts work on SunOS too.
llvm-svn: 16805
2004-10-07 16:03:21 +00:00
Chris Lattner
02b6c918b7 Fix a bug in the safety analysis routine
llvm-svn: 16804
2004-10-07 06:01:25 +00:00
Chris Lattner
f64799683e Comment cleanups
llvm-svn: 16803
2004-10-07 06:00:24 +00:00
Chris Lattner
25db58032d * Rename pass to globalopt, since we do more than just constify
* Instead of handling dead functions specially, just nuke them.
* Be more aggressive about cleaning up after constification, in
  particular, handle getelementptr instructions and constantexprs.
* Be a little bit more structured about how we process globals.

*** Delete globals that are only stored to, and never read.  These are
    clearly not useful, so they should go.  This implements deadglobal.llx

This last one triggers quite a few times.  In particular, 2208 in the
external tests, 1865 of which are in 252.eon.  This shrinks eon from
1995094 to 1732341 bytes of bytecode.

llvm-svn: 16802
2004-10-07 04:16:33 +00:00
Chris Lattner
fa3cfd3955 Rename pass
llvm-svn: 16801
2004-10-07 04:12:02 +00:00
Chris Lattner
b0c8aab038 This pass is not needed, as there is only ever one global: the stack
llvm-svn: 16800
2004-10-07 04:10:36 +00:00
Chris Lattner
381fbf1616 Add new testcase, rename pass
llvm-svn: 16799
2004-10-07 04:07:08 +00:00
Chris Lattner
fc303099c9 Don't add libz or libbz2 to the USEDLIBS lists, those are for LLVM libraries.
llvm-svn: 16798
2004-10-07 00:03:11 +00:00
Chris Lattner
76319a83bd Don't call memset if malloc returns a null pointer
llvm-svn: 16797
2004-10-06 23:08:03 +00:00
Chris Lattner
1f849a08a3 Implement GlobalConstifier/trivialstore.llx, and also do some
simplifications of the resultant program to avoid making later passes
do it all.

This allows us to constify globals that just have the same constant that
they are initialized stored into them.

Suprisingly this comes up ALL of the freaking time, dozens of times in
SPEC, 30 times in vortex alone.

For example, on 256.bzip2, it allows us to constify these two globals:

%smallMode = internal global ubyte 0             ; <ubyte*> [#uses=8]
%verbosity = internal global int 0               ; <int*> [#uses=49]

Which (with later optimizations) results in the bytecode file shrinking
from 82286 to 69686 bytes!  Lets hear it for IPO :)

For the record, it's nuking lots of "if (verbosity > 2) { do lots of stuff }"
code.

llvm-svn: 16793
2004-10-06 20:57:02 +00:00
Chris Lattner
645bcf6c5d New testcase
llvm-svn: 16791
2004-10-06 20:42:51 +00:00
Chris Lattner
af88fcd4c9 Dont' let null nodes sneak past cast instructions
llvm-svn: 16779
2004-10-06 19:29:13 +00:00
Misha Brukman
fe643e314f Undoxyfy internal method.
llvm-svn: 16774
2004-10-06 17:19:58 +00:00
Misha Brukman
74a1195bd6 Doxygen-ify comments
llvm-svn: 16773
2004-10-06 16:56:16 +00:00
Chris Lattner
43e03c9cdf Change Type::isAbstract to have better comments, a more correct name
(PromoteAbstractToConcrete), and to use a set to avoid recomputation.
In particular, this set eliminates the potentially exponential cases
from this little recursive algorithm.

On a particularly nasty testcase, llvm-dis on the .bc file went from 34
minutes (which is when I killed it, it still hadn't finished) to 0.57s.
Remember kids, exponential algorithms are bad.

llvm-svn: 16772
2004-10-06 16:36:46 +00:00
Chris Lattner
f29560783a Rename method, change comment, add argument
llvm-svn: 16771
2004-10-06 16:34:23 +00:00
Chris Lattner
f94f985bbd Correct some typeos
llvm-svn: 16770
2004-10-06 16:28:24 +00:00
Chris Lattner
0aee4b7947 Instcombine: -(X sdiv C) -> (X sdiv -C), tested by sub.ll:test16
llvm-svn: 16769
2004-10-06 15:08:25 +00:00
Chris Lattner
52783ab1d8 New testcase
llvm-svn: 16768
2004-10-06 15:07:56 +00:00
Chris Lattner
93867e516a Remove debugging code, fix encoding problem. This fixes the problems
the JIT had last night.

llvm-svn: 16766
2004-10-06 14:31:50 +00:00
Nate Begeman
9a1fbaf1e9 Turning on fsel code gen now that we can do so would be good.
llvm-svn: 16765
2004-10-06 11:03:30 +00:00
Nate Begeman
fac8529df8 Implement floating point select for lt, gt, le, ge using the powerpc fsel
instruction.

Now, rather than emitting the following loop out of bisect:
.LBB_main_19:	; no_exit.0.i
	rlwinm r3, r2, 3, 0, 28
	lfdx f1, r3, r27
	addis r3, r30, ha16(.CPI_main_1-"L00000$pb")
	lfd f2, lo16(.CPI_main_1-"L00000$pb")(r3)
	fsub f2, f2, f1
	addis r3, r30, ha16(.CPI_main_1-"L00000$pb")
	lfd f4, lo16(.CPI_main_1-"L00000$pb")(r3)
	fcmpu cr0, f1, f4
	bge .LBB_main_64	; no_exit.0.i
.LBB_main_63:	; no_exit.0.i
	b .LBB_main_65	; no_exit.0.i
.LBB_main_64:	; no_exit.0.i
	fmr f2, f1
.LBB_main_65:	; no_exit.0.i
	addi r3, r2, 1
	rlwinm r3, r3, 3, 0, 28
	lfdx f1, r3, r27
	addis r3, r30, ha16(.CPI_main_1-"L00000$pb")
	lfd f4, lo16(.CPI_main_1-"L00000$pb")(r3)
	fsub f4, f4, f1
	addis r3, r30, ha16(.CPI_main_1-"L00000$pb")
	lfd f5, lo16(.CPI_main_1-"L00000$pb")(r3)
	fcmpu cr0, f1, f5
	bge .LBB_main_67	; no_exit.0.i
.LBB_main_66:	; no_exit.0.i
	b .LBB_main_68	; no_exit.0.i
.LBB_main_67:	; no_exit.0.i
	fmr f4, f1
.LBB_main_68:	; no_exit.0.i
	fadd f1, f2, f4
	addis r3, r30, ha16(.CPI_main_2-"L00000$pb")
	lfd f2, lo16(.CPI_main_2-"L00000$pb")(r3)
	fmul f1, f1, f2
	rlwinm r3, r2, 3, 0, 28
	lfdx f2, r3, r28
	fadd f4, f2, f1
	fcmpu cr0, f4, f0
	bgt .LBB_main_70	; no_exit.0.i
.LBB_main_69:	; no_exit.0.i
	b .LBB_main_71	; no_exit.0.i
.LBB_main_70:	; no_exit.0.i
	fmr f0, f4
.LBB_main_71:	; no_exit.0.i
	fsub f1, f2, f1
	addi r2, r2, -1
	fcmpu cr0, f1, f3
	blt .LBB_main_73	; no_exit.0.i
.LBB_main_72:	; no_exit.0.i
	b .LBB_main_74	; no_exit.0.i
.LBB_main_73:	; no_exit.0.i
	fmr f3, f1
.LBB_main_74:	; no_exit.0.i
	cmpwi cr0, r2, -1
	fmr f16, f0
	fmr f17, f3
	bgt .LBB_main_19	; no_exit.0.i

We emit this instead:
.LBB_main_19:	; no_exit.0.i
	rlwinm r3, r2, 3, 0, 28
	lfdx f1, r3, r27
	addis r3, r30, ha16(.CPI_main_1-"L00000$pb")
	lfd f2, lo16(.CPI_main_1-"L00000$pb")(r3)
	fsub f2, f2, f1
	fsel f1, f1, f1, f2
	addi r3, r2, 1
	rlwinm r3, r3, 3, 0, 28
	lfdx f2, r3, r27
	addis r3, r30, ha16(.CPI_main_1-"L00000$pb")
	lfd f4, lo16(.CPI_main_1-"L00000$pb")(r3)
	fsub f4, f4, f2
	fsel f2, f2, f2, f4
	fadd f1, f1, f2
	addis r3, r30, ha16(.CPI_main_2-"L00000$pb")
	lfd f2, lo16(.CPI_main_2-"L00000$pb")(r3)
	fmul f1, f1, f2
	rlwinm r3, r2, 3, 0, 28
	lfdx f2, r3, r28
	fadd f4, f2, f1
	fsub f5, f0, f4
	fsel f0, f5, f0, f4
	fsub f1, f2, f1
	addi r2, r2, -1
	fsub f2, f1, f3
	fsel f3, f2, f3, f1
	cmpwi cr0, r2, -1
	fmr f16, f0
	fmr f17, f3
	bgt .LBB_main_19	; no_exit.0.i

llvm-svn: 16764
2004-10-06 09:53:04 +00:00
Chris Lattner
6835dedb5b Codegen signed mod by 2 or -2 more efficiently. Instead of generating:
t:
        mov %EDX, DWORD PTR [%ESP + 4]
        mov %ECX, 2
        mov %EAX, %EDX
        sar %EDX, 31
        idiv %ECX
        mov %EAX, %EDX
        ret

Generate:
t:
        mov %ECX, DWORD PTR [%ESP + 4]
***     mov %EAX, %ECX
        cdq
        and %ECX, 1
        xor %ECX, %EDX
        sub %ECX, %EDX
***     mov %EAX, %ECX
        ret

Note that the two marked moves are redundant, and should be eliminated by the
register allocator, but aren't.

Compare this to GCC, which generates:

t:
        mov     %eax, DWORD PTR [%esp+4]
        mov     %edx, %eax
        shr     %edx, 31
        lea     %ecx, [%edx+%eax]
        and     %ecx, -2
        sub     %eax, %ecx
        ret

or ICC 8.0, which generates:

t:
        movl      4(%esp), %ecx                                 #3.5
        movl      $-2147483647, %eax                            #3.25
        imull     %ecx                                          #3.25
        movl      %ecx, %eax                                    #3.25
        sarl      $31, %eax                                     #3.25
        addl      %ecx, %edx                                    #3.25
        subl      %edx, %eax                                    #3.25
        addl      %eax, %eax                                    #3.25
        negl      %eax                                          #3.25
        subl      %eax, %ecx                                    #3.25
        movl      %ecx, %eax                                    #3.25
        ret                                                     #3.25

We would be in great shape if not for the moves.

llvm-svn: 16763
2004-10-06 05:01:07 +00:00
Chris Lattner
e4c60eb704 Really fix FreeBSD, which apparently doesn't tolerate the extern.
Thanks to Jeff Cohen for pointing out my goof.

llvm-svn: 16762
2004-10-06 04:21:52 +00:00
Chris Lattner
7bd8f1332d Fix a scary bug with signed division by a power of two. We used to generate:
s:   ;; X / 4
        mov %EAX, DWORD PTR [%ESP + 4]
        mov %ECX, %EAX
        sar %ECX, 1
        shr %ECX, 30
        mov %EDX, %EAX
        add %EDX, %ECX
        sar %EAX, 2
        ret

When we really meant:

s:
        mov %EAX, DWORD PTR [%ESP + 4]
        mov %ECX, %EAX
        sar %ECX, 1
        shr %ECX, 30
        add %EAX, %ECX
        sar %EAX, 2
        ret

Hey, this also reduces register pressure too :)

llvm-svn: 16761
2004-10-06 04:19:43 +00:00
Chris Lattner
147edd2f7e Codegen signed divides by 2 and -2 more efficiently. In particular
instead of:

s:   ;; X / 2
        movl 4(%esp), %eax
        movl %eax, %ecx
        shrl $31, %ecx
        movl %eax, %edx
        addl %ecx, %edx
        sarl $1, %eax
        ret

t:   ;; X / -2
        movl 4(%esp), %eax
        movl %eax, %ecx
        shrl $31, %ecx
        movl %eax, %edx
        addl %ecx, %edx
        sarl $1, %eax
        negl %eax
        ret

Emit:

s:
        movl 4(%esp), %eax
        cmpl $-2147483648, %eax
        sbbl $-1, %eax
        sarl $1, %eax
        ret

t:
        movl 4(%esp), %eax
        cmpl $-2147483648, %eax
        sbbl $-1, %eax
        sarl $1, %eax
        negl %eax
        ret

llvm-svn: 16760
2004-10-06 04:02:39 +00:00
Chris Lattner
e9bfa5a2a4 Add some new instructions. Fix the asm string for sbb32rr
llvm-svn: 16759
2004-10-06 04:01:02 +00:00
Chris Lattner
2ce32df8b0 Reduce code growth implied by the tail duplication pass by not duplicating
an instruction if it can be hoisted to a common dominator of the block.
This implements: test/Regression/Transforms/TailDup/MergeTest.ll

llvm-svn: 16758
2004-10-06 03:27:37 +00:00
Chris Lattner
7d83efbc0b When tail duplicating these functions, the add instruction should not be
duplicated, even though the block it is in is duplicated.

llvm-svn: 16757
2004-10-06 03:26:38 +00:00
Chris Lattner
32ed828f46 FreeBSD uses GCC. Patch contributed by Jeff Cohen!
llvm-svn: 16756
2004-10-06 03:15:44 +00:00
Chris Lattner
18b88f71ad Fix the path to the fixinc'd headers. Patch contributed by Jeff Cohen!
llvm-svn: 16755
2004-10-06 03:13:47 +00:00
Brian Gaeke
c5a630bd3c Must include sys/stat.h before declaring a 'struct stat'
llvm-svn: 16728
2004-10-05 18:46:59 +00:00
Brian Gaeke
a3d1b776b9 Build BFtoLLVM example front-end by default
llvm-svn: 16719
2004-10-05 18:05:53 +00:00
Brian Gaeke
ca70a78b71 Add BFtoLLVM example front end
llvm-svn: 16714
2004-10-05 18:05:25 +00:00
Chris Lattner
9b38ead89a Make sure the const bit gets inherited correctly when linking declarations
of disagreeing constness.  This fixes
test/Regression/Linker/ConstantGlobals[123].ll

llvm-svn: 16692
2004-10-05 02:28:11 +00:00
Chris Lattner
07d1d7ede5 Another testcase for constness linkage
llvm-svn: 16691
2004-10-05 02:16:01 +00:00
Chris Lattner
e0d464bda2 Testcase to ensure that the 'constant' flag follows the definition when there
is a question.

llvm-svn: 16690
2004-10-05 02:12:20 +00:00
Reid Spencer
abb04cfc79 Adjust sys/stat.h inclusion so its only for SunOS.
llvm-svn: 16686
2004-10-05 00:56:46 +00:00
Tanya Lattner
c3ef3cc7e5 Added a couple of includes to get this to compile on Sparc.
llvm-svn: 16685
2004-10-05 00:51:26 +00:00
Chris Lattner
9895937618 Solaris doesn't have MAP_FILE.
llvm-svn: 16682
2004-10-05 00:46:21 +00:00
Chris Lattner
2426ff991c Bug fixed
llvm-svn: 16671
2004-10-05 00:23:02 +00:00
Chris Lattner
db76a3db91 New testcase for PR450
llvm-svn: 16670
2004-10-05 00:18:21 +00:00
Reid Spencer
defd9699e6 Add checks for the ZLIB and BZIP2 header files, not just the libraries.
llvm-svn: 16669
2004-10-04 22:05:53 +00:00
Chris Lattner
69aa178674 Fix #include flavor
llvm-svn: 16658
2004-10-04 18:10:18 +00:00
Reid Spencer
38b846c8e1 Move the warning about no compression library down to the bottom, away
from the fray, so it gets noticed. This commit is made without the
corresponding configure script commit because it doesn't affect
functionality and we don't want to force everyone into another reconfigure

llvm-svn: 16657
2004-10-04 18:02:55 +00:00
Reid Spencer
266cd00360 Fix typo in makefile variable name that prevents zlib from being recognized
llvm-svn: 16656
2004-10-04 17:49:19 +00:00
Reid Spencer
1bd6da2293 Add HAVE_BZIP2 and HAVE_ZLIB
llvm-svn: 16655
2004-10-04 17:48:37 +00:00
Reid Spencer
04f1e90657 Excise the ill-advised RLCOMP compression algorithm and simply leave the
previously temporary NULLCOMP implementation that merely copies the data
verbatim without compression. Also, don't warn if there's no compression
library as that is taken care of during configuration time.

llvm-svn: 16654
2004-10-04 17:45:44 +00:00
Misha Brukman
c2fdea6d8f Add example 'abstract' architectures for LLI: MIX, MMIX, and DLX
llvm-svn: 16653
2004-10-04 17:36:35 +00:00
Reid Spencer
2e3cc54e42 Add a context for the callback so different compression scenarios can be
distinguished. Tidy up documentation.  Thanks, Chris.

llvm-svn: 16652
2004-10-04 17:29:25 +00:00
Reid Spencer
34637df55f Minor corrections suggested by Chris' ever-watchful eye.
llvm-svn: 16651
2004-10-04 17:26:26 +00:00
Chris Lattner
b4abe320bf Fix build if not HAVE_BZIP2
llvm-svn: 16650
2004-10-04 16:33:25 +00:00
Reid Spencer
161a459d42 First version of the MappedFile abstraction for operating system idependent
mapping of files. This first version uses mmap where its available. The
class needs to implement an alternate mechanism based on malloc'd memory
and file reading/writing for platforms without virtual memory.

llvm-svn: 16649
2004-10-04 11:08:32 +00:00
Reid Spencer
c89503753c First version of a support utility to provide generalized compression in
LLVM that handles availability and unavailability of bzip2 and zlib.

llvm-svn: 16648
2004-10-04 10:49:41 +00:00
Chris Lattner
d1ab378be5 * Prune #includes
* Update comments
* Rearrange code a bit
* Finally ELIMINATE the GAS workaround emitter for Intel mode.  woot!

llvm-svn: 16647
2004-10-04 07:31:08 +00:00
Chris Lattner
68ab0beb1b Add support for emitting AT&T style .s files, and make it the default. Users
may now choose their output format with the -x86-asm-syntax={intel|att} flag.

llvm-svn: 16646
2004-10-04 07:24:48 +00:00
Chris Lattner
8bbde2fb33 Convert some missed patterns to support AT&T style
llvm-svn: 16645
2004-10-04 07:23:07 +00:00
Chris Lattner
2e99778aad Apparently the GNU assembler has a HUGE hack to be compatible with really
old and broken AT&T syntax assemblers.  The problem with this hack is that
*SOME* forms of the fdiv and fsub instructions have the 'r' bit inverted.
This was a real pain to figure out, but is trivially easy to support: thus
we are now bug compatible with gas and gcc.

llvm-svn: 16644
2004-10-04 07:08:46 +00:00
Reid Spencer
4e181e731a Provide support for auto-detection and use of compression libraries.
llvm-svn: 16643
2004-10-04 07:05:07 +00:00
Chris Lattner
af69503332 Fix incorrect suffix
llvm-svn: 16642
2004-10-04 05:20:16 +00:00
Chris Lattner
e1a2826d51 Fix some more missed suffixes and swapped operands
llvm-svn: 16641
2004-10-04 01:38:10 +00:00
Chris Lattner
a488f04f3e Add missing suffixes to FP instructions for AT&T mode
llvm-svn: 16640
2004-10-04 00:43:31 +00:00
Chris Lattner
5683260187 Add support for the -x86-asm-syntax flag, which can be used to choose between
Intel and AT&T style assembly language.  The ultimate goal of this is to
eliminate the GasBugWorkaroundEmitter class, but for now AT&T style emission
is not fully operational.

llvm-svn: 16639
2004-10-03 20:36:57 +00:00
Chris Lattner
4e59a14909 Add support to the instruction patterns for AT&T style output, which will
hopefully lead to the death of the 'GasBugWorkaroundEmitter'.  This also
includes changes to wrap the whole file to 80 columns! Woot! :)

Note that the AT&T style output has not been tested at all.

llvm-svn: 16638
2004-10-03 20:35:00 +00:00
Chris Lattner
72770f5877 Correctly parse variant notation
llvm-svn: 16637
2004-10-03 20:19:02 +00:00
Chris Lattner
91c538f2a1 Add initial support for variants. This just parses the new format, no
functionality is added

llvm-svn: 16636
2004-10-03 19:34:31 +00:00
Chris Lattner
42c43b2cb3 Add initial support for variants
llvm-svn: 16635
2004-10-03 19:34:18 +00:00
Reid Spencer
4874120154 Add checks for bzip2 and libz for use with the Compression concept for
lib/System and the compressing llvm archiver.

llvm-svn: 16634
2004-10-02 08:50:58 +00:00
Chris Lattner
00db230c7c Do not repeat the map lookup
llvm-svn: 16633
2004-10-01 23:16:43 +00:00
Chris Lattner
1905ae69c1 When a virtual register is folded into an instruction, keep track of whether
it was a use, def, or both.  This allows us to be less pessimistic in our
analysis of them.  In practice, this doesn't make a big difference, but it
doesn't hurt either.

llvm-svn: 16632
2004-10-01 23:15:36 +00:00
Chris Lattner
79bb240345 Add project
llvm-svn: 16631
2004-10-01 22:25:28 +00:00
Chris Lattner
04f52079d7 Add a simple little improvement to the local spiller to keep track of stores
and delete them if they turn out to be dead.  This is a useful little hack
that even speeds up some programs.  For example, it speeds up Ptrdist/ks
from 17.53s to 15.59s, and 188.ammp from 149s to 146s.

This also speeds up llc :)

llvm-svn: 16630
2004-10-01 19:47:12 +00:00
Chris Lattner
d3b1f6c703 Substantially revamp the local spiller, causing it to actually improve the
generated code over the simple spiller.  The new local spiller generates
substantially better code than the simple one in some cases, by reusing
values that are loaded out of stack slots and kept available in registers.

This primarily helps programs that are spilling a lot, and there is still
stuff that can be done to improve it.  This patch makes the local spiller
the default, as it's only a tiny bit slower than the simple spiller (it
increases the runtime of llc by < 1%).

Here are some numbers with speedups.

Program    #reuse  old(s)    new(s)  Speedup

Povray:     3452,  16.87 ->  15.93   (5.5%)
177.mesa:   2176,   2.77 ->   2.76   (0%)
179.art:      35,  28.43 ->  28.01   (1.5%)
183.equake:   55,  61.44 ->  61.41   (0%)
188.ammp:    869, 174    -> 149      (15%)

164.gzip:     43,  40.73 ->  40.71   (0%)
175.vpr:     351,  18.54 ->  17.34   (6.5%)
176.gcc:    2471,   5.01 ->   4.92   (1.8%)
181.mcf       42,  79.30 ->  75.20   (5.2%)
186.crafty:  484,  29.73 ->  30.04   (-1%)
197.parser:  251,  10.47 ->  10.67   (-1%)
252.eon:    1501,   1.98 ->   1.75   (12%)
253.perlbm: 1183,  14.83 ->  14.42   (2.8%)
254.gap:     825,   7.46 ->   7.29   (2.3%)
255.vortex:  285,  10.51 ->  10.27   (2.3%)
256.bzip2:    63,  55.70 ->  55.20   (0.9%)
300.twolf:   830,  21.63 ->  22.00   (-1%)

PtrDist/ks    14,  32.75 -> 17.53    (46.5%)
Olden/tsp     46,   8.71 ->  8.24    (5.4%)
Free/distray  70,   1.09 ->  0.99    (9.2%)

llvm-svn: 16629
2004-10-01 19:04:51 +00:00
Chris Lattner
f06f4a7c68 Pretty print a bit nicer :)
llvm-svn: 16628
2004-10-01 19:01:39 +00:00
Misha Brukman
e0cce9945d Add note about converting Skeleton to a useful backend and using it in the
Interpreter.

llvm-svn: 16627
2004-10-01 18:36:22 +00:00
Alkis Evlogimenos
cc37da1bcc Document this class a bit :-)
llvm-svn: 16626
2004-10-01 00:35:07 +00:00
Alkis Evlogimenos
94d5a1ceda Add const version of getLastBlock() member function.
llvm-svn: 16625
2004-09-30 21:42:02 +00:00
Alkis Evlogimenos
aba8cf29ce Remove whitespace from the end of the line.
llvm-svn: 16624
2004-09-30 21:39:47 +00:00
Brian Gaeke
dd9bb500ad Make EmitMappingInfo into an "external location" option, so that it can be set
or cleared externally.

llvm-svn: 16623
2004-09-30 20:20:01 +00:00
Brian Gaeke
33e834ebb0 Add accessor function.
llvm-svn: 16622
2004-09-30 20:14:29 +00:00
Brian Gaeke
5a89bde564 Correct type of accessor functions.
llvm-svn: 16621
2004-09-30 20:14:18 +00:00
Brian Gaeke
e80d4cd66b Namespacify. Add accessor function.
llvm-svn: 16620
2004-09-30 20:14:07 +00:00
Brian Gaeke
d2f7bc029b Add accessor function prototypes for reoptimizer support passes.
Make accessors return FunctionPass* as appropriate.

llvm-svn: 16619
2004-09-30 20:13:55 +00:00
Brian Gaeke
a1640d2427 I think this will handle double args.
llvm-svn: 16618
2004-09-30 19:44:32 +00:00
Misha Brukman
a468200286 That should actually be __MING, not __MINGW.
llvm-svn: 16617
2004-09-30 18:28:07 +00:00
Misha Brukman
46cee7da73 #include DataTypes.h to compile on MinGW, patch by Henrik Bach.
llvm-svn: 16616
2004-09-30 18:27:39 +00:00
Misha Brukman
ba94e672c3 Check for __MINGW define instead of __MINGW_H, patch by Henrik Bach.
llvm-svn: 16615
2004-09-30 18:24:58 +00:00
Chris Lattner
b5b4a2f76b Use more efficient map operations. Fix a bug that would affect hypothetical
targets that supported multiple memory operands.

llvm-svn: 16614
2004-09-30 16:35:08 +00:00
Chris Lattner
55c1402f25 There is no need to call MachineInstr::print directly, just send the MI& to an ostream.
llvm-svn: 16613
2004-09-30 16:10:45 +00:00
Chris Lattner
b0b707fc75 * Wrap some comments to 80 cols
* Add const_iterator stuff
* Add a print method, which means that I can now call dump() from the
  debugger.

llvm-svn: 16612
2004-09-30 15:59:17 +00:00
Brian Gaeke
7efd5fcb3a Mark the instructions that have delay slots with the hasDelaySlot flag.
Add some comments.

llvm-svn: 16611
2004-09-30 04:04:48 +00:00
Brian Gaeke
1f48ef2a9a Use TargetMachine::hasDelaySlot() instead of our old switch statement
to find instrs that have delay slots.

llvm-svn: 16610
2004-09-30 04:04:47 +00:00
Chris Lattner
c2812121cd Simplify the logic in the simple spiller and capitalize some variables
llvm-svn: 16609
2004-09-30 02:59:33 +00:00
Chris Lattner
1c5942fee9 Switch from defaulting to the 'local' spiller to the 'simple' spiller. The
two spillers produce perfectly identical code (at least on povray and eon),
but the simple spiller is substantially faster than the local spiller. Once
the local spiller is improved, we can switch back.

Switching cuts 5.2% off of the llc time for povray (about 1.3s).

llvm-svn: 16608
2004-09-30 02:40:06 +00:00
Chris Lattner
28bc753cac Don't use a densemap for keeping track of which vregs are already loaded, just
use a simple vector.  This speeds up -spiller=simple from taking 22s to taking
.1s on povray (debug build).  This change does not modify the generated code.

llvm-svn: 16607
2004-09-30 02:33:48 +00:00
Chris Lattner
39fef8df03 Use longer and more explicit names for instance vars (particularly important
data structures).  Fix the print method to send to the right ostream, not
always cerr.  Delete typedefs that are only used once.

llvm-svn: 16606
2004-09-30 02:15:18 +00:00
Chris Lattner
ddd5229f3b Free the VirtRegMap at the end of MachineFunction processing instead of at
the beginning of processing the next one.

llvm-svn: 16605
2004-09-30 02:02:33 +00:00
Chris Lattner
e2b77d57c0 Reindent code, improve comments, move huge nested methods out of classes,
prune #includes, add print/dump methods, etc.  No functionality changes.

llvm-svn: 16604
2004-09-30 01:54:45 +00:00
Chris Lattner
9af8efddd3 Disable the 'WARNING: Found global types that are not compatible' warning
that always prints when linking programs to libstdc++ :(

llvm-svn: 16603
2004-09-30 00:12:29 +00:00
Misha Brukman
4592f86ef1 Change the #ifdefs to allow compilation with a V8 compiler, but the JIT still
won't work if not compiled in V9 mode, currently by GCC only, because Sun's
system compiler does not tell us if it's a V8 or V9 system.

llvm-svn: 16602
2004-09-29 23:01:17 +00:00
Chris Lattner
abae776b18 Hrm, debugging printouts do not need to be in here
llvm-svn: 16598
2004-09-29 21:21:14 +00:00
Chris Lattner
cde15fb187 Make sure to check select instructions for generic instruction properties
llvm-svn: 16597
2004-09-29 21:19:28 +00:00
Brian Gaeke
fb1fd0cb5f Update list of shootout programs that should be working.
llvm-svn: 16595
2004-09-29 20:45:06 +00:00
Brian Gaeke
ede068a8d3 Tell the target description that calls clobber registers O0...O5.
llvm-svn: 16594
2004-09-29 20:45:05 +00:00
Chris Lattner
c9e79d005b Don't use DominatorSet::dominates for intra-block instruction dom checks.
This method is linear time in the size of the basic block, which is very
bad for large basic blocks.  On the Assembler/2004-09-29-VerifierIsReallySlow.llx
testcase, the verifier changes from taking 50s to 0.23s with this patch.

llvm-svn: 16593
2004-09-29 20:07:45 +00:00
Chris Lattner
f27b48f187 The verifier takes 50s on this testcase, that is not good n stuff
llvm-svn: 16592
2004-09-29 20:07:25 +00:00
Brian Gaeke
3a340dd7cd FITOD is spelled "fitod", not "fitos". Ouch.
llvm-svn: 16591
2004-09-29 19:59:07 +00:00
Brian Gaeke
47095da661 Don't use .quad to output double constants. The assembler must have a bug or
something, because the wrong bit patterns get output.

llvm-svn: 16590
2004-09-29 19:59:06 +00:00
Chris Lattner
6862fbd2cf * Pull range optimization code out into new InsertRangeTest function.
* SubOne/AddOne functions always return ConstantInt, declare them as such
* Pull code for handling setcc X, cst, where cst is at the end of the range,
  or cc is LE or GE up earlier in visitSetCondInst.  This reduces #iterations
  in some cases.
* Fold: (div X, C1) op C2 -> range check, implementing div.ll:test6 - test9.

llvm-svn: 16588
2004-09-29 17:40:11 +00:00
Chris Lattner
d9d8538995 New testcasses for divides that can be eliminated.
llvm-svn: 16587
2004-09-29 17:37:07 +00:00
Brian Gaeke
81f5e08573 Recognize FpMOVD as a move.
llvm-svn: 16586
2004-09-29 16:45:47 +00:00
Chris Lattner
879ce7894c Do not insert trivially dead select instructions, which allows us to
potentially fold more in one pass.

llvm-svn: 16583
2004-09-29 05:43:32 +00:00
Chris Lattner
6a4adcda4c Fold binary expressions and casts into PHI nodes that have all constant inputs.
This takes something like this:

%A = phi int [ 3, %cond_false.0 ], [ 2, %endif.0.i ], [ 2, %endif.1.i ]
%B = div int %tmp.243, 4

and turns it into:

%A = phi int [ 3/4, %cond_false.0 ], [ 2/4, %endif.0.i ], [ 2/4, %endif.1.i ]

which is later simplified (in this case) into %A = 0.

This triggers thousands of times in spec, for example, 269 times in 176.gcc.

This is tested by InstCombine/add.ll:test23 and set.ll:test18.

llvm-svn: 16582
2004-09-29 05:07:12 +00:00
Chris Lattner
5e0ab5c5d8 New testcases
llvm-svn: 16581
2004-09-29 05:06:12 +00:00
Nate Begeman
2f1d0ae95e Generate better code by being far less clever when it comes to the select instruction. Don't create overlapping register lifetimes
llvm-svn: 16580
2004-09-29 05:00:31 +00:00
Brian Gaeke
c44da15813 add results
llvm-svn: 16579
2004-09-29 03:48:55 +00:00
Nate Begeman
7b6df6def2 improve Type::BoolTy codegen by eliminating unnecessary clears and sign extends
llvm-svn: 16578
2004-09-29 03:45:33 +00:00
Brian Gaeke
4023d4e191 Simplify copyConstantToRegister() for longs, using a pair of recursive calls.
Copy constant-pool entries' addresses into registers before loading out of them,
to avoid errors from the assembler.
Handle loading call args past the 6th one off the stack.
Add IMPLICIT_DEF pseudo-instrs for double and long arguments passed in register
pairs.
Use FpMOVD to copy doubles around instead of the horrible store-load thing we
were doing before.
Handle 'ret double' and 'ret long'.
Fix a bug in handling 'and/or/xor long'.

llvm-svn: 16577
2004-09-29 03:34:41 +00:00
Brian Gaeke
eae5b17dba Fix bug recognizing moves: isMoveInstr should only treat ORs with %g0 as
moves, not all ORs.

llvm-svn: 16576
2004-09-29 03:28:15 +00:00
Brian Gaeke
069bb989e4 Use FpMOVD pseudo-instruction to move doubles around.
llvm-svn: 16575
2004-09-29 03:27:30 +00:00
Brian Gaeke
da371d9cf3 Add new FpMOVD pseudo-instruction, used to move doubles around.
llvm-svn: 16574
2004-09-29 03:27:29 +00:00
Brian Gaeke
7f11dd4825 Fix double and long alignment.
Call the FPMover pass after register allocation.

llvm-svn: 16573
2004-09-29 03:26:27 +00:00
Brian Gaeke
ead8e39832 Put quotes around argument to .section directive.
llvm-svn: 16572
2004-09-29 03:25:40 +00:00
Brian Gaeke
457180c597 Add createSparcV8FPMoverPass().
llvm-svn: 16571
2004-09-29 03:25:39 +00:00
Brian Gaeke
ce0ba4857b Pass which converts FpMOVD (double move pseudoinstructions) to pairs
of FMOVS instrs.

llvm-svn: 16570
2004-09-29 03:24:34 +00:00
Chris Lattner
5933e997d8 More testcases for recent instcombine patches
llvm-svn: 16569
2004-09-29 03:18:20 +00:00
Chris Lattner
c949128b2f Hrm, really, all tests passed without this, but it is scary to think how...
llvm-svn: 16568
2004-09-29 03:16:24 +00:00
Chris Lattner
be7a69ebd8 Remove debugging printout
Instcombine (setcc (truncate X), C1).

This occurs THOUSANDS of times in many benchmarks.  Particularlly common
seem to be things like (seteq (cast bool X to int), int 0)

This turns it into (seteq bool %X, false), which then becomes (not %X).

llvm-svn: 16567
2004-09-29 03:09:18 +00:00
Nate Begeman
26566f0b68 To go along with sabre's improved InstCombining, improve recognition of
integers that we can use as immediate values in instructions.

Example from yacr2:
-       lis r10, -1
-       ori r10, r10, 65535
-       add r28, r28, r10
+       addi r28, r28, -1
        addi r7, r7, 1
        addi r9, r9, 1
        b .LBB_main_9   ; loopentry.1.i214

llvm-svn: 16566
2004-09-29 02:35:05 +00:00
Reid Spencer
7aed44892c Improve validity checking of windows path names and fix file creation
problems.

Patch contributed by Jeff Cohen. Thanks Jeff!

llvm-svn: 16565
2004-09-29 00:01:17 +00:00
Reid Spencer
70b6835853 Use llvm::sys::Path to destroy the file.
Patch contributed by Jeff Cohen. Thanks Jeff!

llvm-svn: 16564
2004-09-28 23:58:03 +00:00
Reid Spencer
364cce404a Win32 implementation of TimeValue::now().
Patch contributed by Jeff Cohen. Thanks Jeff!

llvm-svn: 16563
2004-09-28 23:56:20 +00:00
Reid Spencer
5d98fe9ef8 FreeBSD implementation of the TimeValue::now() method.
Patch kindly contributed by Jeff Cohen. Thanks Jeff!

llvm-svn: 16562
2004-09-28 23:54:12 +00:00
Chris Lattner
dcf756ec22 Fold (X setcc C1) | (X setcc C2)
This implements or.ll:test1[89]

llvm-svn: 16561
2004-09-28 22:33:08 +00:00
Chris Lattner
efc0614cd6 New testcase
llvm-svn: 16560
2004-09-28 22:31:49 +00:00
Chris Lattner
623826c888 Fold (and (setcc X, C1), (setcc X, C2))
This is important for several reasons:

1. Benchmarks have lots of code that looks like this (perlbmk in particular):

  %tmp.2.i = setne int %tmp.0.i, 128              ; <bool> [#uses=1]
  %tmp.6343 = seteq int %tmp.0.i, 1               ; <bool> [#uses=1]
  %tmp.63 = and bool %tmp.2.i, %tmp.6343          ; <bool> [#uses=1]

   we now fold away the setne, a clear improvement.

2. In the more important cases, such as (X >= 10) & (X < 20), we now produce
   smaller code: (X-10) < 10.

3. Perhaps the nicest effect of this patch is that it really helps out the
   code generators.  In particular, for a 'range test' like the above,
   instead of generating this on X86 (the difference on PPC is even more
   pronounced):

        cmp %EAX, 50
        setge %CL
        cmp %EAX, 100
        setl %AL
        and %CL, %AL
        cmp %CL, 0

   we now generate this:

        add %EAX, -50
        cmp %EAX, 50

   Furthermore, this causes setcc's to be folded into branches more often.

These combinations trigger dozens of times in the spec benchmarks, particularly
in 176.gcc, 186.crafty, 253.perlbmk, 254.gap, & 099.go.

llvm-svn: 16559
2004-09-28 21:48:02 +00:00
Misha Brukman
e06653ff76 * Add `deplibs' keyword for specifying a list of dependent libraries
* Convert tabs to spaces

llvm-svn: 16558
2004-09-28 21:46:18 +00:00
Misha Brukman
04f0b5b7cd Add `deplibs' keyword for specifying a list of dependent libraries
llvm-svn: 16557
2004-09-28 21:45:54 +00:00
Chris Lattner
3cbcd25596 New testcases
llvm-svn: 16556
2004-09-28 21:39:35 +00:00
Nate Begeman
c762ab723b Add support for the isLoad and isStore flags, needed by the instruction scheduler
llvm-svn: 16555
2004-09-28 21:29:00 +00:00
Nate Begeman
996ddbc98e Add support for the isLoad and isStore flags, needed by the instruction scheduler
llvm-svn: 16554
2004-09-28 21:01:45 +00:00
Chris Lattner
9b0dfa3c0d Turn the hasDelaySlot flag into the M_DELAY_SLOT_FLAG
llvm-svn: 16553
2004-09-28 18:38:01 +00:00
Chris Lattner
547b4d4a29 Be consistent with our naming
llvm-svn: 16552
2004-09-28 18:37:00 +00:00
Chris Lattner
6652223bd6 Capture delay slot info
llvm-svn: 16551
2004-09-28 18:34:14 +00:00
Chris Lattner
f9fa7cad4b Capture information about whether the target instructions have delay slots
llvm-svn: 16550
2004-09-28 18:33:50 +00:00
Chris Lattner
272d5ca9e0 Implement X / C1 / C2 folding
Implement (setcc (shl X, C1), C2) folding.

The second one occurs several dozen times in spec.  The first was added
just in case.  :)

These are tested by shift.ll:test2[12], and div.ll:test5

llvm-svn: 16549
2004-09-28 18:22:15 +00:00
Chris Lattner
cbd7a98cb8 New testcase
llvm-svn: 16548
2004-09-28 18:21:01 +00:00
Chris Lattner
3dd0ae64a9 New testcases
llvm-svn: 16547
2004-09-28 18:18:35 +00:00
Chris Lattner
6afc02f816 shl is always zero extending, so always use a zero extending shift right.
This latent bug was exposed by recent changes, and is tested as:
llvm/test/Regression/Transforms/InstCombine/2004-09-28-BadShiftAndSetCC.llx

llvm-svn: 16546
2004-09-28 17:54:07 +00:00
Chris Lattner
64ee11511f New testcase for a latent bug in instcombine that I have been chasing for
1.5 days :(

llvm-svn: 16545
2004-09-28 17:50:05 +00:00
Misha Brukman
5753883dc0 * InstructionReader.cpp was absorbed into Reader.cpp
* Wrap at 80 cols

llvm-svn: 16543
2004-09-28 16:58:12 +00:00
Misha Brukman
349717934a Fix doxygen comment
llvm-svn: 16542
2004-09-28 16:57:46 +00:00
Brian Gaeke
99d3deee1c Touch output files before reading or writing them, so that they are
always guaranteed to exist. This fixes PR444. Thanks to Alkis
for reporting the bug and testing the patch.
AddRecord used to return a big list, but that return value was never
used. So now it doesn't return anything.
Create the WebDir if it does not exist.
Fix a typo in a comment.

llvm-svn: 16541
2004-09-28 16:04:00 +00:00
John Criswell
68146eb40a Corrected spelling of Makefile variable, thereby re-enabling profile
builds for projects.

llvm-svn: 16540
2004-09-28 14:52:58 +00:00
Alkis Evlogimenos
20f1b0bafb Add includes and use std:: for standard library calls to make code
compile on windows. This patch was contributed by Paolo Invernizzi.

llvm-svn: 16539
2004-09-28 14:42:44 +00:00
Chris Lattner
a2bb624e35 Bug fixed
llvm-svn: 16538
2004-09-28 03:45:22 +00:00
Chris Lattner
7b30f27695 Testcase for LLVM PR445
llvm-svn: 16537
2004-09-28 03:36:39 +00:00
Alkis Evlogimenos
6280a7b716 Since we use alloca now make sure we include the proper headers for it.
llvm-svn: 16536
2004-09-28 02:53:15 +00:00
Alkis Evlogimenos
edbb20cf7f Use alloca instead of a C99 style array. This should fix the
compilation problem in windows.

llvm-svn: 16535
2004-09-28 02:47:38 +00:00
Alkis Evlogimenos
3ce42ec7ee Pull assignment out of for loop conditional in order for this to
compile under windows. Patch contributed by Paolo Invernizzi!

llvm-svn: 16534
2004-09-28 02:40:37 +00:00
Alkis Evlogimenos
fc59e0e8a3 Fix includes. Patch contributed by Paolo Invernizzi!
llvm-svn: 16533
2004-09-28 02:38:58 +00:00
Chris Lattner
02060ae68e New testcase that crashes the C++ FE, encountered while working on PR445
llvm-svn: 16532
2004-09-28 02:29:40 +00:00
Alkis Evlogimenos
b1da2050a5 Use class instead of struct for defining classes. This unbreaks the
build on windows. Patch contributed by Paolo Invernizzi!

llvm-svn: 16531
2004-09-28 01:59:17 +00:00
Chris Lattner
6a4a0492f8 Patch contributed by Patrick Meredith:
added notes on the fact that the current implementation uses
sbyte* for va_list.  Updated all occurances of valist to va_list (it was
inconsistant and find/replace is so easy ;-) ).  Added <...> around all
occurances of va_list in the intrinsic functions to match the vaarg and
vanext instructions and to further show that va_list is a variable type.

llvm-svn: 16530
2004-09-27 21:51:25 +00:00
Misha Brukman
23f7ad07dc Fix grammar.
llvm-svn: 16529
2004-09-27 20:35:59 +00:00
Chris Lattner
bfff18a869 Fix two bugs: one where a condition was mistakenly swapped, and another
where we folded (X & 254) -> X < 1 instead of X < 2.  These problems were
latent problems exposed by the latest patch.

llvm-svn: 16528
2004-09-27 19:29:18 +00:00
Chris Lattner
5f9319a789 New testcase
llvm-svn: 16527
2004-09-27 19:25:20 +00:00
Misha Brukman
d409d38151 SparcV8 int regs are not only 32-bits in width, but they are 32-bit aligned!
llvm-svn: 16526
2004-09-27 18:22:18 +00:00
Chris Lattner
d7dc1ecd42 The system ranlib on darwin occasionally adds two extra newlines to the
end of files, breaking the CFE build.  As a gross hack around this,
ignore any trailing garbage on bytecode files.  Thanks to Brian for digging
in and identifying the problem.

llvm-svn: 16525
2004-09-27 16:59:06 +00:00
Chris Lattner
dbf0a56597 Hrm, if there is an error loading a file, try printing a message so the
user knows that...

llvm-svn: 16524
2004-09-27 16:41:01 +00:00
Chris Lattner
fbfb4d43c4 Testcases for rev 250 of InstructionCombining.cpp
llvm-svn: 16522
2004-09-27 16:21:26 +00:00
Chris Lattner
1023b8726e Fold: (setcc (shr X, ShAmt), CI), where 'cc' is eq or ne. This xform
triggers often, for example:

6x in povray, 1x in gzip, 279x in gcc, 1x in crafty, 8x in eon, 11x in perlbmk,
362x in gap, 4x in vortex, 14 in m88ksim, 211x in 126.gcc, 1x in compress,
11x in ijpeg, and 4x in 147.vortex.

llvm-svn: 16521
2004-09-27 16:18:50 +00:00
Alkis Evlogimenos
2622728248 Improve warning
llvm-svn: 16520
2004-09-27 07:35:19 +00:00
Nate Begeman
8656a156cf Correct some BuildMI arguments for the upcoming simple scheduler
llvm-svn: 16519
2004-09-27 05:08:17 +00:00
Misha Brukman
a68d76ebfa Fix the copy-pasto that Brian noticed: V8 int regs are 32-bits wide, not 64.
llvm-svn: 16518
2004-09-26 21:07:43 +00:00
Reid Spencer
58ab77db8e Add some missing #includes
llvm-svn: 16517
2004-09-25 16:00:07 +00:00
Reid Spencer
6c0c9424f6 Qualify Path with sys:: namespace so this file compiles.
llvm-svn: 16516
2004-09-25 15:59:41 +00:00
Reid Spencer
f71143c3e5 Updated to reflect changes in the interface of TimeValue::now().
llvm-svn: 16515
2004-09-25 08:32:37 +00:00
Reid Spencer
004ef2847b Clean up the interface of TimeValue:
- get rid of unneeded constructors
- get rid of duplicate methods/constructors/operators
- normalize to LLVM coding standards
- wrap to 80 columns.

Many thanks to Alkis Evlogimenos for his suggestions.

llvm-svn: 16514
2004-09-25 08:29:54 +00:00
Reid Spencer
1cc1994edf Added stub implementations of TimeValue concept for remaining platforms.
llvm-svn: 16513
2004-09-25 05:03:54 +00:00
Reid Spencer
8b2f9a298d Wrap to 80 cols.
llvm-svn: 16512
2004-09-25 05:03:22 +00:00
Reid Spencer
ca141a5b28 Initial implementation of the TimeValue abstraction.
llvm-svn: 16511
2004-09-24 23:25:19 +00:00
John Criswell
71c8d5eae9 Updated the last two header files so that they are configured with
AC_CONFIG_HEADERS.  This should prevent LLVM from needlessly re-compiling
on a re-configure.

llvm-svn: 16510
2004-09-24 21:19:06 +00:00
John Criswell
08e722647a Modified hash_map and hash_set configuration so that they are not
regenerated on every run of configure.

llvm-svn: 16509
2004-09-24 18:28:00 +00:00
Chris Lattner
7e794273f5 Implement shift-and combinations, implementing InstCombine/and.ll:test19-21
These combinations trigger 4 times in povray, 7x in gcc, 4x in gap, and 2x in bzip2.

llvm-svn: 16508
2004-09-24 15:21:34 +00:00
Chris Lattner
8c1c691755 Add some tests for shr-and folding
llvm-svn: 16507
2004-09-24 15:18:43 +00:00
John Criswell
3ed86d7540 Configure Datatypes.h.in with AC_CONFIG_HEADERS. This should prevent it
from being re-generated if the new version is identical to the old version.
Hence, it should save us some recompiling after re-configures.

llvm-svn: 16506
2004-09-24 13:28:51 +00:00
Chris Lattner
e1b4d2a470 Move LHSI->hasOneUse() into the arms of the conditional, reindenting code.
No functionality changes here.

llvm-svn: 16505
2004-09-23 21:52:49 +00:00
Chris Lattner
8fc5af4da9 Implement Transforms/InstCombine/and.ll:test18, a case that occurs 20 times
in perlbmk

llvm-svn: 16504
2004-09-23 21:46:38 +00:00
Chris Lattner
45a5ace32e New testcase for a pattern that occurs 20 times in perlbmk
llvm-svn: 16503
2004-09-23 21:42:49 +00:00
Reid Spencer
bf6439fd27 Add a blurb about the use of class vs. struct keyword in class decls.
llvm-svn: 16500
2004-09-23 16:03:48 +00:00
Chris Lattner
bdcf41a8a2 Implement select.ll:test16: fold load (select C, X, null) -> load X
llvm-svn: 16499
2004-09-23 15:46:00 +00:00
Chris Lattner
fb4735980b load null is undefined behavior, this should fold
llvm-svn: 16498
2004-09-23 15:45:20 +00:00
Reid Spencer
3e95e7c99c Change Value from a "struct" to a "class" so that VC 7.1 doesn't generate
missing symbols when its referenced as a class.

llvm-svn: 16496
2004-09-23 14:49:45 +00:00
Reid Spencer
9904928ea3 Patch for MINGW. Patch provided by Henrik Bach.
llvm-svn: 16495
2004-09-23 14:47:10 +00:00
Reid Spencer
898eca3260 Missed one $*.a -> $@ conversion for the Release build.
llvm-svn: 16494
2004-09-23 06:07:24 +00:00
Nate Begeman
49cf74b26c Fix the last of the major PPC GEP folding deficiencies. This will allow
the ISel to use indexed and non-zero immediate offsets for GEPs that have
more than one use.  This is common for instruction sequences such as a load
followed by a modify and store to the same address.

llvm-svn: 16493
2004-09-23 05:31:33 +00:00
Alkis Evlogimenos
04da4252c0 Update email address
llvm-svn: 16492
2004-09-23 04:39:30 +00:00
Chris Lattner
29cf9a32e2 Grrr... I shouldn't have to do this one :)
llvm-svn: 16491
2004-09-23 04:36:01 +00:00
Chris Lattner
9544766cd3 Update credits
llvm-svn: 16490
2004-09-23 04:30:05 +00:00
Reid Spencer
ef18cc48db Correct the rules for making shared libraries per libtool 1.5.10
llvm-svn: 16489
2004-09-23 00:58:06 +00:00
Misha Brukman
379a05b52a Use the V8/V9 shared register file description
llvm-svn: 16485
2004-09-22 21:48:50 +00:00
Misha Brukman
3c08658d56 Combine the F2 and F3 instruction classes into one file for simplicity
llvm-svn: 16484
2004-09-22 21:38:42 +00:00
Misha Brukman
efce1ef9c3 Fix file header path
llvm-svn: 16483
2004-09-22 21:29:12 +00:00
Misha Brukman
009aaf9968 Prettify formatting of the file, adjust paths to making V8 a subdir of Sparc
llvm-svn: 16482
2004-09-22 20:09:29 +00:00
Misha Brukman
d55f854a5d V8 is now a subdirectory of Sparc; adjust paths accordingly
llvm-svn: 16481
2004-09-22 20:08:52 +00:00
Reid Spencer
3c20f4b59f Update to add the HAVE_UINT64_T test and the STACK_DIRECTION indicator.
llvm-svn: 16480
2004-09-22 15:32:08 +00:00
Reid Spencer
c4eb57c525 The alloca function, strangely enough, is found in the malloc.h header file
on MINGW platform. Provide an #elseif case to #include malloc.h for this
platform if malloc.h is found.

Patch provided by Henrik Bach. Thanks Henrik!

llvm-svn: 16479
2004-09-22 15:28:32 +00:00
Nate Begeman
033b816171 add optimized code sequences for setcc x, 0
llvm-svn: 16478
2004-09-22 04:40:25 +00:00
Chris Lattner
b121ae1cec Do not fold (X + C1 != C2) if there are other users of the add. Doing
this transformation used to take a loop like this:

int Array[1000];
void test(int X) {
  int i;
  for (i = 0; i < 1000; ++i)
    Array[i] += X;
}

Compiled to LLVM is:

no_exit:                ; preds = %entry, %no_exit
        %indvar = phi uint [ 0, %entry ], [ %indvar.next, %no_exit ]            ; <uint> [#uses=2]
        %tmp.4 = getelementptr [1000 x int]* %Array, int 0, uint %indvar                ; <int*> [#uses=2]
        %tmp.7 = load int* %tmp.4               ; <int> [#uses=1]
        %tmp.9 = add int %tmp.7, %X             ; <int> [#uses=1]
        store int %tmp.9, int* %tmp.4
***     %indvar.next = add uint %indvar, 1              ; <uint> [#uses=2]
***     %exitcond = seteq uint %indvar.next, 1000               ; <bool> [#uses=1]
        br bool %exitcond, label %return, label %no_exit

and turn it into a loop like this:

no_exit:                ; preds = %entry, %no_exit
        %indvar = phi uint [ 0, %entry ], [ %indvar.next, %no_exit ]            ; <uint> [#uses=3]
        %tmp.4 = getelementptr [1000 x int]* %Array, int 0, uint %indvar                ; <int*> [#uses=2]
        %tmp.7 = load int* %tmp.4               ; <int> [#uses=1]
        %tmp.9 = add int %tmp.7, %X             ; <int> [#uses=1]
        store int %tmp.9, int* %tmp.4
***     %indvar.next = add uint %indvar, 1              ; <uint> [#uses=1]
***     %exitcond = seteq uint %indvar, 999             ; <bool> [#uses=1]
        br bool %exitcond, label %return, label %no_exit

Note that indvar.next and indvar can no longer be coallesced.  In machine
code terms, this patch changes this code:

.LBBtest_1:     # no_exit
        mov %EDX, OFFSET Array
        mov %ESI, %EAX
        add %ESI, DWORD PTR [%EDX + 4*%ECX]
        mov %EDX, OFFSET Array
        mov DWORD PTR [%EDX + 4*%ECX], %ESI
        mov %EDX, %ECX
        inc %EDX
        cmp %ECX, 999
        mov %ECX, %EDX
        jne .LBBtest_1  # no_exit

into this:

.LBBtest_1:     # no_exit
        mov %EDX, OFFSET Array
        mov %ESI, %EAX
        add %ESI, DWORD PTR [%EDX + 4*%ECX]
        mov %EDX, OFFSET Array
        mov DWORD PTR [%EDX + 4*%ECX], %ESI
        inc %ECX
        cmp %ECX, 1000
        jne .LBBtest_1  # no_exit

We need better instruction selection to get this:

.LBBtest_1:     # no_exit
        add DWORD PTR [Array + 4*%ECX], EAX
        inc %ECX
        cmp %ECX, 1000
        jne .LBBtest_1  # no_exit

... but at least there is less register juggling

llvm-svn: 16473
2004-09-21 21:35:23 +00:00
Alkis Evlogimenos
89dd63733a The real x87 floating point registers should not be allocatable. They
are only used by the stackifier when transforming FPn register
allocations to the real stack file x87 registers.

llvm-svn: 16472
2004-09-21 21:22:11 +00:00
Misha Brukman
6b17bf7193 s/ISel/PPC64ISel/ to have unique class names for debugging via gdb because the
C++ front-end in gcc does not mangle classes in anonymous namespaces correctly.

llvm-svn: 16471
2004-09-21 18:22:33 +00:00
Misha Brukman
87201ce8f9 s/ISel/PPC32ISel/ to have unique class names for debugging via gdb because the
C++ front-end in gcc does not mangle classes in anonymous namespaces correctly.

llvm-svn: 16470
2004-09-21 18:22:19 +00:00
Misha Brukman
43bd39e04e s/ISel/X86ISel/ to have unique class names for debugging via gdb because the C++
front-end in gcc does not mangle classes in anonymous namespaces correctly.

llvm-svn: 16469
2004-09-21 18:21:21 +00:00
Chris Lattner
0f28cce60c Make sure to set the operand list
llvm-svn: 16466
2004-09-21 17:30:54 +00:00
Reid Spencer
5a6815d332 Fix a problem where the mmap_file test was generating an incorrect test
program that always failed (wouldn't compile).

llvm-svn: 16465
2004-09-21 17:14:44 +00:00
Reid Spencer
d057f2bc56 Change the warning text so that NO warnings are permitted. This is now the
case since the AC_CONFIG_SUBDIRS problem has been fixed.

llvm-svn: 16464
2004-09-21 17:13:23 +00:00
Reid Spencer
c6f9e0f512 Don't attempt to (illegally) configure a subdir if we don't recognize it.
Instead just create a warning message that says the directory cannot be
configured because it isn't recognized. This also gets rid of a bunch of
warning messages from the auto* tools.

llvm-svn: 16463
2004-09-21 17:12:35 +00:00
Reid Spencer
7c3d8c0af8 Fix the program passed to AC_LANG_PROGRAM to be only the BODY of the main
function, not the whole main function. This problem resulted during
conversion of scripts to the new autoconf standard. The effect was that
the mmap_file test would fail and if it does there is currently an
#ifdef'd #error that causes compilation to fail. Bad, bad, bad.

llvm-svn: 16462
2004-09-21 17:10:52 +00:00
Misha Brukman
62041800ed Thanks to Brad Jones for packed type support!
llvm-svn: 16461
2004-09-21 16:54:37 +00:00
Misha Brukman
ca9062016e Thanks to Brad for documentation on adding a DerivedType
llvm-svn: 16460
2004-09-21 16:53:29 +00:00
Chris Lattner
13d909c401 This is an empty directory
llvm-svn: 16459
2004-09-21 16:26:13 +00:00
Chris Lattner
6a229fcaca This is a dead directory now
llvm-svn: 16458
2004-09-21 16:25:41 +00:00
Reid Spencer
efbe0ce909 Change the name of the "known" module for Java from llvm-java to Java.
llvm-svn: 16453
2004-09-20 22:14:56 +00:00
Alkis Evlogimenos
dc62cada7d Use the right directory for the Java frontend
llvm-svn: 16448
2004-09-20 15:45:36 +00:00
Chris Lattner
42618551d5 Fix potential miscompilations: InstCombine/2004-09-20-BadLoadCombine*.llx
llvm-svn: 16447
2004-09-20 10:15:10 +00:00
Chris Lattner
803fb3c2c3 Two testcases for invalid transformations that instcombine is doing
llvm-svn: 16446
2004-09-20 10:14:27 +00:00
Reid Spencer
5ef171a5b1 Documentation upgrade.
llvm-svn: 16445
2004-09-20 08:09:36 +00:00
Reid Spencer
e380f931db Finish the documentation.
llvm-svn: 16444
2004-09-20 08:04:13 +00:00
Reid Spencer
0889f95c02 Tighten up the specification of what counts as a code file. The previous
specification was too liberal in some areas and missing things in others.
This specification is based on the actual extensions found in the source
tree.

llvm-svn: 16443
2004-09-20 08:00:09 +00:00
Reid Spencer
08941821f3 Base the implementation on the llvmdo script so that we only have to
maintain the logic for "what counts as a source file" in one place.

llvm-svn: 16442
2004-09-20 07:22:23 +00:00
Reid Spencer
6707342ff6 Fixed to actually work correctly and be the basis for other tools by
allowing the set of directories searched to be specified either by the
LLVMDO_DIRS env var or by the -dirs "dirs..." command line option.

llvm-svn: 16441
2004-09-20 07:21:19 +00:00
Alkis Evlogimenos
d59cebf87a Fix loop condition so that we don't decrement off the beginning of the
list.

llvm-svn: 16440
2004-09-20 06:42:58 +00:00
Chris Lattner
91006d8e2c Don't count .lo files :)
llvm-svn: 16439
2004-09-20 05:01:04 +00:00
Chris Lattner
4f2cf030e8 'Pass' should now not be derived from by clients. Instead, they should derive
from ModulePass.  Instead of implementing Pass::run, then should implement
ModulePass::runOnModule.

llvm-svn: 16436
2004-09-20 04:48:05 +00:00
Chris Lattner
79e523de04 'Pass' should now not be derived from by clients. Instead, they should derive
from ModulePass.  Instead of implementing Pass::run, then should implement
ModulePass::runOnModule.

Also, fix some undefined behavior, expecting | on booleans to evaluate
left-to-right.

llvm-svn: 16435
2004-09-20 04:47:19 +00:00
Chris Lattner
135419193e Finegrainify namespacification
'Pass' should now not be derived from by clients.  Instead, they should derive
from ModulePass.  Instead of implementing Pass::run, then should implement
ModulePass::runOnModule.

llvm-svn: 16434
2004-09-20 04:44:31 +00:00
Chris Lattner
cd671065be Prototype more accurately
llvm-svn: 16433
2004-09-20 04:43:57 +00:00
Chris Lattner
3e86084641 Prototype these functions more accurately
llvm-svn: 16432
2004-09-20 04:43:15 +00:00
Chris Lattner
1556b2722d Do not prototype any of these passes as returning Pass*. Instead, be specific
llvm-svn: 16431
2004-09-20 04:41:39 +00:00
Chris Lattner
3c11c04d43 'Pass' should now not be derived from by clients. Instead, they should derive
from ModulePass.  Instead of implementing Pass::run, then should implement
ModulePass::runOnModule.

llvm-svn: 16430
2004-09-20 04:36:29 +00:00
Chris Lattner
cd93da1939 Adjust to API changes
llvm-svn: 16429
2004-09-20 04:35:27 +00:00
Reid Spencer
45101043ef Put in a #error in the event that we don't have an mmap that can map a file
into memor. This is just a reminder that the ReadFileIntoAddressSpace
function needs to be properly converted to lib/System and implemented via
read/write if there's no mmap of file support.

llvm-svn: 16428
2004-09-20 04:13:43 +00:00
Reid Spencer
ac16ea98de Fix problems with AC_FUNC_MMAP_FILE and AC_LINK_USE_R that caused problems
with correctly recognizing mmap of files and the linker's support of -r.

llvm-svn: 16427
2004-09-20 04:09:56 +00:00
Reid Spencer
57f1c0e0a6 Correct the use AC_RUN_IFELSE to ensure it builds programs correctly by
using the AC_LANG_PROGRAM macro.

llvm-svn: 16426
2004-09-20 04:08:22 +00:00
Reid Spencer
ef538ef635 Allow the suffix for shared libraries to be obtained correctly so we can
build them again.

llvm-svn: 16425
2004-09-20 03:06:28 +00:00
Reid Spencer
a9317d68b6 The problem with depending on the internal implementation of third party
tools is that you break when they change. This is a case in point.

llvm-svn: 16424
2004-09-20 03:05:46 +00:00
Reid Spencer
3f2f555690 libtool's name is now back to mklib.
llvm-svn: 16423
2004-09-20 01:43:00 +00:00
Reid Spencer
7bf145cb95 Change to support creation of "mklib" instead of "libtool" in builddir.
llvm-svn: 16422
2004-09-20 01:42:32 +00:00
Reid Spencer
3ed4d9f7e9 Update the script to generate mklib instead of libtool.
llvm-svn: 16421
2004-09-20 01:41:24 +00:00
Reid Spencer
f184a86f05 Adjust the libtool macros so that libtool's name is "mklib". Also, tidy up
the use of obsolete macros, hopefully making us more compliant on more sys.

llvm-svn: 16420
2004-09-19 23:53:36 +00:00
Reid Spencer
2024d0ed5a Various minor cleanups and replacement of obsoleted macro names.
llvm-svn: 16419
2004-09-19 23:43:52 +00:00
Reid Spencer
200dcd9e68 Numerous fixes to convert ~ into ; that (probably) occurred during data
transmission.

llvm-svn: 16418
2004-09-19 23:42:55 +00:00
Chris Lattner
85927a6730 The lexicon doc is more of a user guide than programming dox
llvm-svn: 16417
2004-09-19 23:15:47 +00:00
Reid Spencer
70eca35170 Bring the script out of the dark ages and into modern autoconfness.
llvm-svn: 16415
2004-09-19 22:31:49 +00:00
Reid Spencer
eb61eb2e32 Make the "Warning" notice a LOT more prominent.
llvm-svn: 16414
2004-09-19 22:30:53 +00:00
Reid Spencer
2aeccd0f1c Add in version dependency checks on all the tools we depend on. This is
necessary to ensure that a consistent configuration is created on each
platform. Certain definitions we use (like m4/libtool.m4) require certain
versions of the tools and we can no longer be slack about this or we'll
have problems with mis-configured builds.

llvm-svn: 16412
2004-09-19 22:14:24 +00:00
Reid Spencer
dc6f5680f3 Add our own version of libtool.m4 instead of relying on the installed one.
This is a potential version mismatch problem because this file came from
libtool 1.5.10. If you're running a different version of libtool, the
checks in this file may not be quite right. Having our own version of this
file violates the spirit of libtool and is only provided to change the name
of "libtool" to "mklib". This is done so that the name "libtool" does not
conflict with the "lib" directory when doing tab completion and your
$objdir == $srcdir.

llvm-svn: 16411
2004-09-19 21:47:47 +00:00
Chris Lattner
2249dd1c41 better code
Move other things to the right sections

llvm-svn: 16410
2004-09-19 19:21:26 +00:00
Chris Lattner
e6f13093e6 Make isSafeToLoadUnconditionally a bit smarter, implementing PR362 and
Regression/Transforms/InstCombine/CPP_min_max.llx

llvm-svn: 16409
2004-09-19 19:18:10 +00:00
Chris Lattner
75cf9f08cc New testcase for PR362: Icky code generated for std::min/std::max
llvm-svn: 16408
2004-09-19 19:17:10 +00:00
Chris Lattner
d6d99dfa3f Fix a nasty iterator invalidation problem I introduced yesterday. This
unfortunately is the cause of a bunch of failures from tonight, and the
reason the tester is running so slow :(

llvm-svn: 16407
2004-09-19 19:01:06 +00:00
Chris Lattner
855a4ff4dd Remove a whole bunch of horrible hacky code that was used to promote allocas
whose addresses where used by trivial phi nodes and select instructions.  This
is now performed by the instcombine pass, which is more powerful, is much
simpler, and is faster.  This allows the deletion of a bunch of code, two
FIXME's and two gotos.

llvm-svn: 16406
2004-09-19 18:51:51 +00:00
Chris Lattner
2f7bb1be42 Instcombine now helps out with these
llvm-svn: 16405
2004-09-19 18:45:45 +00:00
Chris Lattner
f62ea8ef4b Make instruction combining a bit more aggressive in the face of volatile
loads, and implement two new transforms: InstCombine/load.ll:test[56].

llvm-svn: 16404
2004-09-19 18:43:46 +00:00
Chris Lattner
29dd824a10 Add two new testcases that instcombine should handle
llvm-svn: 16403
2004-09-19 18:43:01 +00:00
Reid Spencer
1bdd0f0a08 Minor correction to Signals implementation.
Patch submitted by Jeff Cohen. Thanks Jeff!

llvm-svn: 16401
2004-09-19 05:37:39 +00:00
Chris Lattner
9864df96ba Add comment
llvm-svn: 16400
2004-09-19 01:05:16 +00:00
Chris Lattner
6455c51ab6 Fix the inliner to always delete any edges from the external call node to
a function being deleted.  Due to optimizations done while inlining, there
can be edges from the external call node to a function node that were not
apparent any longer.

This fixes the compiler crash while compiling 175.vpr

llvm-svn: 16399
2004-09-18 21:37:03 +00:00
Chris Lattner
824a21868b Add CallGraphNode::removeAnyCallEdgeTo method
llvm-svn: 16398
2004-09-18 21:34:34 +00:00
Reid Spencer
91e6f5e975 Use the /dev/zero device as the device on which the pages are mapped.
Patch contributed by Henrik Bach. Thanks Henrik!

llvm-svn: 16397
2004-09-18 19:34:09 +00:00
Reid Spencer
0e86336edc Porting of Unix implementation to Win32.
Patch contributed by Jeff Cohen. Thanks Jeff!

llvm-svn: 16396
2004-09-18 19:29:16 +00:00
Reid Spencer
36e3cbfd3b Get rid of file descriptor leak in create_file.
llvm-svn: 16395
2004-09-18 19:25:11 +00:00
Chris Lattner
9fb88200c4 Misha implemented the ModuleProvider interface back in 9/18/2003.
llvm-svn: 16394
2004-09-18 16:16:28 +00:00
Chris Lattner
9e4be6faed Provide initial docs for CallGraphSCCPass's, and fix several grammar-o's and
other problems.

llvm-svn: 16393
2004-09-18 06:39:35 +00:00
Chris Lattner
a94619ddef Make this HTML 4.01 strict
Update to reflect changes to the 'Register' tblgen class.

llvm-svn: 16392
2004-09-18 06:28:07 +00:00
Chris Lattner
24ba604c98 Don't include libtool "object" files
llvm-svn: 16391
2004-09-18 04:40:46 +00:00
Chris Lattner
37b6c4f2d2 Convert this pass to be a CallGraphSCCPass instead of a Pass, which eliminates
the worklist and makes it more efficient.  This does not change functionality
at all.

llvm-svn: 16390
2004-09-18 00:34:13 +00:00
Chris Lattner
475dc2c93d Make sure to remove the Select instruction as well
llvm-svn: 16389
2004-09-18 00:32:40 +00:00
Chris Lattner
85d5ccc006 When changing a function, make sure to update the CallGraphNode for the
function, not just the CallGraph.

llvm-svn: 16388
2004-09-18 00:27:20 +00:00
Chris Lattner
d4f3238c12 Implement new changeFunction method, nuke a never implemented one.
Add comments and doxygenify others.

llvm-svn: 16387
2004-09-18 00:22:43 +00:00
Chris Lattner
e81c2aa42a Implement new changeFunction method, nuke a never implemented one.
llvm-svn: 16386
2004-09-18 00:22:13 +00:00
John Criswell
db981ab5cc Changed the distclean target to handle the new location of config.h.
llvm-svn: 16385
2004-09-17 15:08:25 +00:00
Chris Lattner
5065b240c8 Fix typo in comment
llvm-svn: 16384
2004-09-17 03:58:39 +00:00
Reid Spencer
90debc5e2e Make sure critical sections are entered before trying to leave them.
Add some additional commentary about the workings of this module.

Patch contributed by Jeff Cohen. Thanks Jeff!

llvm-svn: 16383
2004-09-17 03:02:27 +00:00
Reid Spencer
7cd7aeee9a Adjust the license files based on the actual content of llvm and llvm-test
after llvm-test was split out of llvm.

llvm-svn: 16382
2004-09-16 16:41:31 +00:00
Reid Spencer
16b7bad55e Allow "bc" as suffix for bytecode files.
llvm-svn: 16381
2004-09-16 16:36:10 +00:00
Reid Spencer
4aff78acbb Implement the signals interface for Win32.
Patch provided by Jeff Cohen. Thanks Jeff!

llvm-svn: 16380
2004-09-16 15:53:16 +00:00
John Criswell
30a0c10269 Add dependencies so that project tools are recompiled if LLVM libraries
are updated.

llvm-svn: 16378
2004-09-16 14:11:25 +00:00
Chris Lattner
9face5eb1f Add a newline
llvm-svn: 16369
2004-09-15 17:53:52 +00:00
Reid Spencer
6614946443 Convert code to compile with vc7.1.
Patch contributed by Paolo Invernizzi. Thanks Paolo!

llvm-svn: 16368
2004-09-15 17:06:42 +00:00
Chris Lattner
f38ee63423 Make sure to update the list end when an element is removed from it. This
fixes a crash in LICM when processing povray.

llvm-svn: 16367
2004-09-15 17:00:41 +00:00
Chris Lattner
6fa9665095 Add some assertions
llvm-svn: 16366
2004-09-15 16:59:47 +00:00
Reid Spencer
d684790778 Stacker compiler library doesn't need to be shared and it can cause
problems on some platforms (like Solaris).

llvm-svn: 16365
2004-09-15 06:22:54 +00:00
Reid Spencer
90a3303af7 Attempt to solve the libtool problem on Solaris.
llvm-svn: 16364
2004-09-15 06:19:53 +00:00
Reid Spencer
b88212ee1b Patches to make this file actually compile under windows.
Patches submitted by Jeff Cohen. Thanks Jeff!

llvm-svn: 16362
2004-09-15 05:49:50 +00:00
Reid Spencer
7e2c236fcd Initial version of the SysConfig abstraction for Win32.
llvm-svn: 16361
2004-09-15 05:48:49 +00:00
Reid Spencer
0f0c5cfb19 First version of a common header file for Win32 implementations.
llvm-svn: 16360
2004-09-15 05:48:11 +00:00
Reid Spencer
91886b791f Initial implementation of the Process abstraction for Win32.
llvm-svn: 16359
2004-09-15 05:47:40 +00:00
Reid Spencer
0de7bc1c3d Fix the interface to ReleaseRWX to take MemoryBlock& not Memory&
llvm-svn: 16356
2004-09-15 03:55:45 +00:00
Chris Lattner
f11216d24f Fix a bug in the previous checkin that broke 255.vortex
llvm-svn: 16355
2004-09-15 02:34:40 +00:00
Alkis Evlogimenos
0507ffebb1 When creating constant arrays check that the initializer vector is the
same size as the one in the array type.

llvm-svn: 16354
2004-09-15 02:32:15 +00:00
Misha Brukman
4bf01357e1 Fit long lines into 80 cols via creative space elimination
llvm-svn: 16353
2004-09-15 01:40:18 +00:00
Misha Brukman
9511910e11 Wrap long line
llvm-svn: 16352
2004-09-15 01:34:42 +00:00
Misha Brukman
2d01db846b Targets are independent of each other, so compile them in parallel
llvm-svn: 16351
2004-09-15 01:34:25 +00:00
Chris Lattner
59d448f15e Bug fixed
llvm-svn: 16349
2004-09-15 01:09:25 +00:00
Chris Lattner
a346578d92 Make sure to update alias analysis information as we transform the function.
This fixes PR420 and Regression/Transforms/LICM/2004-09-14-AliasAnalysisInvalidate.llx

llvm-svn: 16348
2004-09-15 01:04:07 +00:00
Chris Lattner
9b9932bd94 If given an AliasSetTracker object to update, update it.
llvm-svn: 16347
2004-09-15 01:02:54 +00:00
Chris Lattner
38be945b54 Add an optional argument to PromoteMemToReg
llvm-svn: 16346
2004-09-15 01:02:30 +00:00
Chris Lattner
b69831d8dd New testcase for PR420
llvm-svn: 16345
2004-09-15 00:58:49 +00:00
Chris Lattner
ab64481f1d Implement an AliasSetTracker::copyValue method
llvm-svn: 16344
2004-09-14 19:15:32 +00:00
Chris Lattner
8a40b8d8e0 Add an AliasSetTracker::copyValue method
llvm-svn: 16343
2004-09-14 19:15:12 +00:00
Misha Brukman
c1f7bb0238 The Sparc linking .so problem extends to the sample project as well
llvm-svn: 16342
2004-09-14 18:21:03 +00:00
Chris Lattner
09f3ac9297 Add notes about some buggy passes
llvm-svn: 16339
2004-09-14 16:43:13 +00:00
Chris Lattner
dd457079fa Remove unused pass
llvm-svn: 16338
2004-09-14 16:34:08 +00:00
Chris Lattner
f41b80a05f Remove a long-dead pass. Actually, this pass was never used at all.
llvm-svn: 16337
2004-09-14 16:33:01 +00:00
Reid Spencer
4bc165e9c1 Fix compilation warning.
llvm-svn: 16336
2004-09-14 15:46:13 +00:00
Reid Spencer
853d250b0a Fix a compilation error.
llvm-svn: 16335
2004-09-14 15:42:11 +00:00
Reid Spencer
f27c4cde06 Okay, the list of link-time passes wasn't such a hot idea. Its prone to
error. We'll strategize on this when we have multiple front ends to deal
with. For now llvm-ld just runs a standard set of transforms.

llvm-svn: 16333
2004-09-14 05:43:23 +00:00
Chris Lattner
2cdd49de2a Don't print newlines between passes in the pass list.
Note to self: sentences end with ".", not "...".
Note to reid: sentences end with ".", not "".   :)

llvm-svn: 16332
2004-09-14 05:06:58 +00:00
Chris Lattner
730cfe431a Don't print newlines between each library in the deplibs list.
llvm-svn: 16331
2004-09-14 04:51:44 +00:00
Chris Lattner
e8e81a2941 Revamp the Register class, and allow the use of the RegisterGroup class to
specify aliases directly in register definitions.

Patch contributed by Jason Eckhardt!

llvm-svn: 16330
2004-09-14 04:17:02 +00:00
Chris Lattner
db9a8be0b2 Adjust to #include movage
llvm-svn: 16329
2004-09-14 04:08:41 +00:00
Reid Spencer
b8dcf1cb7c Update to reflect stkrc's new optimization capabilities.
llvm-svn: 16327
2004-09-14 02:00:24 +00:00
Reid Spencer
86343e43dc Support substitution options for the W, M, and f options.
llvm-svn: 16326
2004-09-14 01:59:31 +00:00
Reid Spencer
4de872f623 Support the -WX, -f -M options as pass throughs
Change force option from -f to -F
Support the -strip option
Make changes to reflect different interface in sys::Program

llvm-svn: 16325
2004-09-14 01:58:45 +00:00
Reid Spencer
df05ec7e0d Implement the GetLibraryPath function.
llvm-svn: 16323
2004-09-14 00:16:39 +00:00
Reid Spencer
41c5e9f2fc Add the GetLibraryPath method.
llvm-svn: 16322
2004-09-13 23:46:23 +00:00
Reid Spencer
b9e0877223 Add support for the link-time pass list to Modules.
llvm-svn: 16321
2004-09-13 23:44:23 +00:00
Misha Brukman
77aedd18c7 Sparc cannot link shared objects (libtool issue) which affects Stacker.
llvm-svn: 16320
2004-09-13 22:42:54 +00:00
Reid Spencer
1f164a6e09 Simplify the sys::Memory interface per Chris' request.
llvm-svn: 16319
2004-09-13 22:38:12 +00:00
Reid Spencer
f7948483d2 Simplify the sys::Memory interface per Chris' request.
llvm-svn: 16318
2004-09-13 22:38:11 +00:00
Reid Spencer
07369430c4 Clean up the interface and implementation of sys::Program so that it is
cleanly dissociated from the sys::Path class.

llvm-svn: 16315
2004-09-13 21:48:44 +00:00
Chris Lattner
247c29e4b0 Changes to make this work with Jason's patch. I checked this by hand, but
would appreciate if others would also look at this to make sure I didn't
botch something obvious

llvm-svn: 16312
2004-09-13 21:32:03 +00:00
Reid Spencer
cdbb9d246c Change banner name to reflect actual program this Makefile is for.
llvm-svn: 16311
2004-09-13 21:15:19 +00:00
Reid Spencer
eafdda000c Get rid of compile warning by having llvmExecve return the result of its
call to executeProgram.

llvm-svn: 16306
2004-09-13 15:37:33 +00:00
Reid Spencer
56d4b17288 Initial implementation of llvm-ld: stolen from gccld.
llvm-svn: 16305
2004-09-13 01:27:53 +00:00
Misha Brukman
01592c2a53 Add LLEE into compilation, but not for Sparc
llvm-svn: 16304
2004-09-13 01:18:30 +00:00
Reid Spencer
b956fc1138 Excise the -L option since llvm-link should not do library searches. It
just links bytecode files together.

llvm-svn: 16303
2004-09-12 23:39:42 +00:00
Reid Spencer
1a8e15e356 Excise dependent library linking at Chris' request. llvm-link is intended
to provide only the simplest linking of LLVM modules without trying to be
complete. Dependent library linking will be added to gccld or its successor

llvm-svn: 16302
2004-09-12 23:08:29 +00:00
Misha Brukman
c3ba6e2f4b Squelch compilation warnings on Sparc
llvm-svn: 16301
2004-09-12 23:01:24 +00:00
Misha Brukman
afab5f9091 * Fix grammar
* Convert tabs to spaces

llvm-svn: 16300
2004-09-12 22:40:40 +00:00
Misha Brukman
72be9ae024 Fix filename: Printer.cpp has become X86AsmPrinter.cpp
llvm-svn: 16299
2004-09-12 21:26:04 +00:00
Misha Brukman
14756e8e1c Unbreak doxygen, according to Reid.
llvm-svn: 16298
2004-09-12 20:56:38 +00:00
Misha Brukman
dbcd4fda49 Fix code spacing/alignment
llvm-svn: 16297
2004-09-12 20:47:33 +00:00
Reid Spencer
746dbfebc8 Fix the replace method to assert if an item was erased from the set but not
found in the vector. Previously, it just ignored this condition.

llvm-svn: 16296
2004-09-11 20:38:25 +00:00
Reid Spencer
987319d3a7 Correct the file header to reflect the new "examples" home for the file.
llvm-svn: 16295
2004-09-11 20:30:11 +00:00
Reid Spencer
55a96ee8f5 Fix typo: sterror -> strerror
llvm-svn: 16294
2004-09-11 20:18:08 +00:00
Reid Spencer
fda2fe9f1e Correct the dynamic lib suffix on Darwin.
llvm-svn: 16293
2004-09-11 07:35:01 +00:00
Reid Spencer
566ac28f35 Provide initial implementations of Memory and Process concepts for various
platforms.
Implement GetLLVMSuffix function for the Path concept.

llvm-svn: 16292
2004-09-11 04:59:30 +00:00
Reid Spencer
2896c95bca Provide a generic Unix implementation of the Memory concept.
llvm-svn: 16291
2004-09-11 04:57:25 +00:00
Reid Spencer
33b9d77b89 Provide a generic unix implementation of the Process abstraction.
llvm-svn: 16290
2004-09-11 04:56:56 +00:00
Reid Spencer
ae9bbda50a Implemented support for detecting file types by magic number, stripping
path and suffix to leave basename, and getting the DLL suffix.

llvm-svn: 16289
2004-09-11 04:55:08 +00:00
Reid Spencer
2d20d765d8 Implementation of Process concept for SUSv2 platforms.
llvm-svn: 16288
2004-09-11 04:54:06 +00:00
Reid Spencer
fe020a38bc Implement dependent library processing and search paths for them.
llvm-svn: 16287
2004-09-11 04:32:42 +00:00
Reid Spencer
96019262ca Convert the Emitter to use the lib/System "Memory" interface instead of the
old SystemUtils.h interface to allocate RWX blocks of memory.

llvm-svn: 16286
2004-09-11 04:31:03 +00:00
Reid Spencer
0bb062e55d Add library LLVMsystem.a because the JIT now needs it.
llvm-svn: 16285
2004-09-11 04:29:44 +00:00
Reid Spencer
92475489e7 Correct the interface of a function to use the correct typedef for an
argument so that it will always compile.

llvm-svn: 16284
2004-09-11 04:29:13 +00:00
Reid Spencer
9cfa81662f Implement the remove method for deleting entries from the SetVector.
llvm-svn: 16283
2004-09-11 04:25:58 +00:00
Reid Spencer
1b34fde1cc Implement support for dependent libraries. The "source" module's dependent
libraries list is merged into the "destination" module's list. Also, if the
source module is one of the dependent libraries, it is removed from the
list.

llvm-svn: 16282
2004-09-11 04:25:17 +00:00
Reid Spencer
14072a3f54 Change interface to use correct typedef so it will always compile.
llvm-svn: 16281
2004-09-11 04:22:58 +00:00
Reid Spencer
a529d4eaa7 Make the dependent libraries list use a SetVector instead of a regular
vector so that duplicate libraries never occur within a module.

llvm-svn: 16280
2004-09-11 04:22:14 +00:00
Reid Spencer
886fc070d5 Initial commit of a file to declare the interface for platform independent
support for various memory allocation operations.

llvm-svn: 16279
2004-09-11 04:20:58 +00:00
Reid Spencer
e88d949c1e Add methods for detecting file types by magic number, getting the file name
suffix for shared objects, and stripping a path down to its base name.

llvm-svn: 16278
2004-09-11 04:19:17 +00:00
Reid Spencer
cf40b4a423 Add methods for detecting different kinds of files by their magic number,
getting the suffix for shared objects, and extracting the basename from a
path.

llvm-svn: 16277
2004-09-11 04:18:05 +00:00
Reid Spencer
07e7a5ec18 Use llvm-link to link the .bc with testing.bc. This helps test the new
llvm-link dependent libraries feature.

llvm-svn: 16276
2004-09-11 04:15:09 +00:00
Reid Spencer
c90a765368 Print the dependent libraries when dumping bytecode.
llvm-svn: 16275
2004-09-11 04:14:07 +00:00
Brian Gaeke
c722311fb5 Update to latest versions of config.guess and config.sub from
http://savannah.gnu.org/projects/config

llvm-svn: 16268
2004-09-10 19:20:06 +00:00
Misha Brukman
04bbe6fa25 Renamed file to SparcV8ISelSimple.cpp
llvm-svn: 16267
2004-09-10 18:51:12 +00:00
Brian Gaeke
86584749b6 Roll back constant printing changes until the problems with larger
programs and C++ can be looked at in detail.

llvm-svn: 16266
2004-09-10 18:01:45 +00:00
Alkis Evlogimenos
cb031d9518 Add assertion descriptiosn on type mismatches when creating
ConstantArray and ConstantPacked objects.

llvm-svn: 16261
2004-09-10 04:16:59 +00:00
Misha Brukman
0bc8b12734 Fix broken internal links (one found by seventwentyfour.com spider)
llvm-svn: 16260
2004-09-09 20:34:13 +00:00
Alkis Evlogimenos
213e6db9ce Grow the map on entry so that we don't crash if joinIntervals never
runs (if coalescing is disabled for example).

llvm-svn: 16259
2004-09-09 19:24:38 +00:00
Misha Brukman
4657235e36 If updating from CVS gives error "No rule to make target", it's faster to just
delete .d files than to rebuild from scratch.

llvm-svn: 16258
2004-09-09 16:36:47 +00:00
Misha Brukman
6e8f860fee Fix broken link to the 2004 CGO paper.
llvm-svn: 16257
2004-09-09 16:18:40 +00:00
Chris Lattner
c8f1d71f1b Add missing #include
llvm-svn: 16256
2004-09-09 02:37:56 +00:00
Brian Gaeke
ee83ff191f Regenerated, to recognize mingw.
llvm-svn: 16255
2004-09-08 20:38:05 +00:00
Brian Gaeke
f8d86008c5 recognize MinGW
llvm-svn: 16254
2004-09-08 20:32:11 +00:00
Misha Brukman
17e894523a Disable libprofile as it breaks the build on Sparc (autoconf issues).
llvm-svn: 16253
2004-09-08 20:30:26 +00:00
Misha Brukman
6ea13f679b Make file comment span the entire line
llvm-svn: 16249
2004-09-08 19:48:15 +00:00
Alkis Evlogimenos
371403193c Use a shorter form to express implicit use/defs in FpGETRESULT and
FpSETRESULT.

llvm-svn: 16247
2004-09-08 18:29:31 +00:00
Alkis Evlogimenos
8b700215ed A call instruction should implicitely define ST0 since the return
value is returned in that register. The pseudo instructions
FpGETRESULT and FpSETRESULT shold also have an implicity use and def
of ST0 repsecitvely.

llvm-svn: 16246
2004-09-08 16:54:54 +00:00
Brian Gaeke
acafb39cc3 This file does not need <iostream>, I think.
llvm-svn: 16245
2004-09-08 04:10:52 +00:00
Alkis Evlogimenos
adb2ce2962 Use a DenseMap for mapping reg->reg. This improves the LiveInterval
analysis running time from 2.7869secs to 2.5226secs on 176.gcc.

llvm-svn: 16244
2004-09-08 03:01:50 +00:00
Brian Gaeke
52a4e667e8 Use libtool, not mklib (which somehow doesn't get generated anymore)
llvm-svn: 16243
2004-09-07 19:03:35 +00:00
Reid Spencer
1a2f0432d5 Remove PAPIDIR, per brg
llvm-svn: 16240
2004-09-07 18:04:45 +00:00
Reid Spencer
05b9b53b79 bug 352 fixed
bug 257 fixed

llvm-svn: 16238
2004-09-07 17:52:38 +00:00
Brian Gaeke
64a0630d72 PAPI check has been moved to projects/reopt.
llvm-svn: 16237
2004-09-07 17:35:16 +00:00
Brian Gaeke
6e07318a38 PAPI is not used here.
llvm-svn: 16236
2004-09-07 17:34:34 +00:00
Reid Spencer
edd0b5b653 Removed this file as its contents are now in the m4 directory.
llvm-svn: 16234
2004-09-07 16:50:22 +00:00
Reid Spencer
ee0a2bee10 Remove variables and tests that were specific to the now defunct
test/Programs. These have been moved to llvm-test/autoconf/configure.ac and
llvm-test/Makefile.config.in

llvm-svn: 16231
2004-09-07 16:35:45 +00:00
Reid Spencer
90de7fbb3e - Handle AC_CONFIG_SUBDIRS properly for existing "well known" projects
while still retaining the ability to configure unknown ones.
- Excise crud left over from when test/Projects was still part of the main
  LLVM module. These removed tests are now all in
  llvm-test/autoconf/configure.ac

llvm-svn: 16230
2004-09-07 16:26:18 +00:00
Reid Spencer
d7eeb3ae28 - Perform all validity checks before doing anything.
- Use the -I parameter to aclocal to tell it where the autoconf/m4
  directory is located so it can find needed autoconf functions

llvm-svn: 16225
2004-09-07 16:00:48 +00:00
Reid Spencer
8118dba3e6 move AC_FUNC_ISINF and AC_FUNC_ISNAN to their own files.
llvm-svn: 16224
2004-09-07 14:23:53 +00:00
Reid Spencer
b15e69a09b Individual autoconf function broken out of acincludes.m4. This change
per the recommended style guide for autoconf and so that individual
autoconf functions can more easily be shared across projects.

llvm-svn: 16223
2004-09-07 06:56:14 +00:00
Misha Brukman
33427efbe6 This is the documentation style sheet, not the one for the website.
llvm-svn: 16222
2004-09-07 05:09:22 +00:00
Misha Brukman
125255b9f6 Remove extraneous blank lines.
llvm-svn: 16205
2004-09-06 23:00:30 +00:00
Misha Brukman
a0194211d7 Add link to new howto on writing backends.
llvm-svn: 16204
2004-09-06 23:00:01 +00:00
Misha Brukman
25e6361939 How to write an LLVM backend, first draft.
llvm-svn: 16203
2004-09-06 22:58:13 +00:00
Misha Brukman
d48f54417f * Profile-guided needs a hyphen
* Dead store elimination has been implemented

llvm-svn: 16202
2004-09-06 22:35:43 +00:00
Misha Brukman
a196c6859e Reword to not use a link text `click here'.
llvm-svn: 16201
2004-09-06 20:58:44 +00:00
Reid Spencer
ec0c48e0f9 Modify the lines of code counting mechanism to use the new "countloc.sh"
utility. This avoids some problems with long line lengths and counting the
wrong things.

llvm-svn: 16200
2004-09-06 19:32:55 +00:00
Reid Spencer
2a91e7f660 Added a tool to more accurately count the lines of code. The previous
utility, getsrcs.sh suffered from two problems: (1) it generated command
lines too long for some platforms and (2) it searched the projects diretory
which now contains the llvm-test module (in nightly tester) but we don't
want to include the test code in our LOC calculation. This script should
be maintained as LLVM adds new top level directories that contain source
code.

llvm-svn: 16199
2004-09-06 19:06:27 +00:00
Nate Begeman
54bcf2db01 Add 64 bit divide instructions, and use them
llvm-svn: 16198
2004-09-06 18:46:59 +00:00
Reid Spencer
d5de72cd6b Remove double paren use in system() function so that the command line can
be correctly interpreted by non-bash shells.

llvm-svn: 16194
2004-09-05 20:57:22 +00:00
Reid Spencer
075de23a3d HTML 4.01 STRICT compliance.
Added missing definitions
Noted the difference between llvm/test and llvm-test

llvm-svn: 16193
2004-09-05 20:50:22 +00:00
Reid Spencer
ae21b0b836 Make section separator comments 80 chars, not 70.
Revise descriptions to account for llvm/test/Programs being moved to
the new CVS module llvm-test.
Incoporate an example of how to run the NightlyTest.pl script from a
shell script.

llvm-svn: 16192
2004-09-05 20:07:26 +00:00
Alkis Evlogimenos
58350a7435 Indent to 2 spaces and cleanup excess whitespace.
llvm-svn: 16188
2004-09-05 18:41:35 +00:00
Alkis Evlogimenos
fcb3f5197e Indent to 2 spaces.
llvm-svn: 16187
2004-09-05 18:39:20 +00:00
Reid Spencer
7433dcdc0f Remove configuration of test/Programs/* Makefiles.
llvm-svn: 16186
2004-09-05 17:48:32 +00:00
Reid Spencer
20f712853f Added the configuration of the test/Makefile.
llvm-svn: 16185
2004-09-05 16:42:30 +00:00
Reid Spencer
fe4c30ec5b Add HAS_U_INT64_T
llvm-svn: 16184
2004-09-05 16:41:11 +00:00
Reid Spencer
7650c06a45 Add LLVMC as a supported tool.
llvm-svn: 16183
2004-09-05 16:39:01 +00:00
Reid Spencer
ebb2334fa5 Per Bug 257
The "Programs" directory no longer lives here. It have been moved to its
own cvs module. Check it out into llvm/projects and configure/build it
there.

llvm-svn: 16182
2004-09-05 08:18:23 +00:00
Reid Spencer
2263203a94 Make the NightlyTest run tests out of projects/llvm-test instead of
llvm/test/Programs

llvm-svn: 16181
2004-09-05 07:58:10 +00:00
Misha Brukman
0d68e4cde6 Put a space between Data' and Structure' of DSA.
llvm-svn: 16179
2004-09-05 03:57:23 +00:00
Misha Brukman
3541004158 Remove the bit about this document being my `notes', it has matured since then.
llvm-svn: 16178
2004-09-05 03:24:34 +00:00
Misha Brukman
68d6f7fa22 Fix object/library filenames that have changed, clarify descriptions.
llvm-svn: 16177
2004-09-05 03:20:18 +00:00
Misha Brukman
adfa8b8ab4 Add DSA.
llvm-svn: 16176
2004-09-05 03:00:20 +00:00
Misha Brukman
73b6e9679b * CSS was created to reduce re-specifying design styles: specify table cell
color once at the top, and do not repeat it 82 times
* Replace bright blue table border with gray, which is easier on the eyes and
  matches the gray LLVM documentation color scheme

llvm-svn: 16175
2004-09-05 02:56:39 +00:00
Misha Brukman
175fdd4678 * Change PPC32AsmPrinter => PowerPCAsmPrinter since it is now shared between
Darwin and AIX and is not 32- or 64-bit specific
* Bring back PowerPC.td as a result, to make it use the `PowerPC' class name
* Adjust Makefile accordingly

llvm-svn: 16174
2004-09-05 02:42:44 +00:00
Misha Brukman
4acadb3af7 Renamed PPC32AsmPrinter.cpp => PowerPCAsmPrinter.cpp as the Darwin and AIX asm
printers are now unified into one file.

llvm-svn: 16173
2004-09-05 02:27:37 +00:00
Reid Spencer
738122ce2c Make sure llvm-test doesn't build automatically so the nightly test can
finish its build phase without building and running all the tests.

llvm-svn: 16172
2004-09-04 23:07:57 +00:00
Reid Spencer
ab4df83228 Take one item off the "to do" list: implemented -O1 .. -O5 options for
optimization in stkrc instead of depending on "opt"

llvm-svn: 16169
2004-09-04 20:30:01 +00:00
Reid Spencer
8ea6e94df9 Convert makefile to use standard LLVM macros for tool names
Utilize new stkrc -O4 option for optimization during translation.

llvm-svn: 16168
2004-09-04 20:13:54 +00:00
Reid Spencer
950d604ef9 Make Stacker into a complete project with its own configuration.
llvm-svn: 16167
2004-09-04 19:48:50 +00:00
Reid Spencer
fbd716d621 Make the StackerCompiler and optimizing translator by running specific
optimizations after construction of the Module. The OptLevel argument
to the compile function controls the level of optimization.

llvm-svn: 16166
2004-09-04 19:07:32 +00:00
Reid Spencer
4771383e47 Make the Stacker compiler handle -O1 .. -O5 options so it is compliant with
the compiler driver interface as an optimizing translator. Also clean up
error message handling.

llvm-svn: 16165
2004-09-04 19:05:53 +00:00
Nate Begeman
4d847047a0 Include MathExtras.h to fix build breakage, thanks to Vladimir
llvm-svn: 16164
2004-09-04 14:51:26 +00:00
Nate Begeman
4bfceb1ed5 All PPC instructions are now auto-printed
32 and 64 bit AsmWriters unified
Darwin and AIX specific features of AsmWriter split out

llvm-svn: 16163
2004-09-04 05:00:00 +00:00
Reid Spencer
b9c90a2b02 Get rid of an un-needed and un-used GCCism. ATTR_DEPRECATED is used nowhere
in the LLVM source base.

llvm-svn: 16162
2004-09-03 23:38:25 +00:00
Reid Spencer
0ded30aec4 Clean up some "clean:" targets so they use $(VERB) and don't print anything
by default, like every other "clean" target in LLVM.

llvm-svn: 16161
2004-09-03 23:19:53 +00:00
Reid Spencer
c8ec13388b Make tblgen's exception handling a little more robust by printing the
program name and also catching ...

llvm-svn: 16160
2004-09-03 23:17:54 +00:00
Reid Spencer
f68090d67f Don't re-instantiate the std::string in catch block.
llvm-svn: 16159
2004-09-03 22:59:32 +00:00
Reid Spencer
3f4bdc96fe Uh, changing in build dir and committing in src dir doesn't lead to correct
commits. Fix it so it actually works.

llvm-svn: 16158
2004-09-03 22:28:24 +00:00
Reid Spencer
6d28a14133 Correct the specification of the DIRS variable to not include the source
directory prefix, just the name of the subdirectory. This prevents the
makefile from trying to find makefiles (like Makefile.common) in the wrong
place.

llvm-svn: 16157
2004-09-03 22:25:40 +00:00
Misha Brukman
1a45021535 I was actually wrong in my "simplification".
llvm-svn: 16156
2004-09-03 19:46:43 +00:00
Misha Brukman
247b22c56d Simplify check for uint64_t and u_int64_t
llvm-svn: 16155
2004-09-03 19:44:28 +00:00
Reid Spencer
6f21308b16 Provide correct definition of uint64_t for platforms that have only
u_int64_t defined.

llvm-svn: 16154
2004-09-03 19:37:39 +00:00
Misha Brukman
14a2b4628d Order #includes alphabetically, local .h files first.
llvm-svn: 16153
2004-09-03 18:25:53 +00:00
Alkis Evlogimenos
a5c04ee50f Fixes to make LLVM compile with vc7.1.
Patch contributed by Paolo Invernizzi!

llvm-svn: 16152
2004-09-03 18:19:51 +00:00
Misha Brukman
cb46e66983 Regenerated after Reid's change for uint64_t/u_int64_t (patch by Bill Wendling)
llvm-svn: 16151
2004-09-02 23:02:30 +00:00
Reid Spencer
109524cae3 Make the text of this file a little more useful.
llvm-svn: 16150
2004-09-02 22:49:27 +00:00
Reid Spencer
ab2228ad7e Don't just assume that either uint64_t or u_int64_t is available. Instead,
give preference to uint64_t if it exists. If not, check for u_int64_t. If
that doesn't exist either, then error out.

llvm-svn: 16149
2004-09-02 21:38:24 +00:00
Alkis Evlogimenos
9f82237f4e Change the way we choose a free register: instead of picking the first
free allocatable register, we prefer the a free one with the most uses
of inactive intervals.

llvm-svn: 16148
2004-09-02 21:24:33 +00:00
Alkis Evlogimenos
095c3a80f3 Change the way we choose a free register: instead of picking the first
free allocatable register, we prefer the a free one with the most uses
of inactive intervals. This causes less spills and performes a bit
better compared to gcc:

Program                 | GCC/LLC (Before)| GCC/LLC (After)
164.gzip/164.gzip       | 0.59            | 0.60
175.vpr/175.vpr         | 0.57            | 0.58
176.gcc/176.gcc         | 0.59            | 0.61
181.mcf/181.mcf         | 0.94            | 0.95
186.crafty/186.crafty   | 0.62            | 0.62
197.parser/197.parser   | 0.89            | 0.88
252.eon/252.eon         | 0.61            | 0.66
253.perlbmk/253.perlbmk | 0.79            | 0.84
254.gap/254.gap         | 0.81            | 0.81
255.vortex/255.vortex   | 0.92            | 0.93
256.bzip2/256.bzip2     | 0.69            | 0.69
300.twolf/300.twolf     | 0.91            | 0.90

llvm-svn: 16147
2004-09-02 21:23:32 +00:00
John Criswell
d672a3dbe3 Added a check for u_int64_t, which is used by Interix.
llvm-svn: 16145
2004-09-02 18:44:44 +00:00
John Criswell
4fcd5c30fa Added u_int64_t because some systems use that instead of uint64_t.
llvm-svn: 16144
2004-09-02 18:41:30 +00:00
Alkis Evlogimenos
dcbf893095 We don't need to sort the added vector as unhandled intervals are
stored in a binary heap.

llvm-svn: 16143
2004-09-02 18:00:38 +00:00
Nate Begeman
6173878304 Convert remaining X-Form and Pseudo instructions over to asm writer
llvm-svn: 16142
2004-09-02 08:13:00 +00:00
Alkis Evlogimenos
7063868e2a Pull in definition of std::unary_function.
llvm-svn: 16140
2004-09-02 03:24:45 +00:00
Brian Gaeke
45fb84d68d Unbreak build
llvm-svn: 16139
2004-09-02 03:24:08 +00:00
Brian Gaeke
c6e81f0fde Back to compiling land for v8
llvm-svn: 16138
2004-09-02 02:37:43 +00:00
Reid Spencer
7c16caa336 Changes For Bug 352
Move include/Config and include/Support into include/llvm/Config,
include/llvm/ADT and include/llvm/Support. From here on out, all LLVM
public header files must be under include/llvm/.

llvm-svn: 16137
2004-09-01 22:55:40 +00:00
Alkis Evlogimenos
fae8f6a4fb Be a bit more efficient when processing the active and inactive
lists. Instead of scanning the vector backwards, scan it forward and
swap each element we want to erase. Then at the end erase all removed
intervals at once. This doesn't save much: 0.08s out of 4s when
compiling 176.gcc.

llvm-svn: 16136
2004-09-01 22:52:29 +00:00
Alkis Evlogimenos
6a099d439e Give a better assertion if we see a use before a def.
llvm-svn: 16135
2004-09-01 22:34:52 +00:00
Reid Spencer
a50cb6c8b9 Make sure <cassert> is included for platforms that don't include it via
other header files.

llvm-svn: 16134
2004-09-01 20:36:15 +00:00
Reid Spencer
f4e546b7aa mkdtemp doesn't exist on Cygwin. Use tempnam & mkdir instead.
llvm-svn: 16133
2004-09-01 20:29:35 +00:00
Reid Spencer
9501b9b82b Make CommandLine prefix error output with the name of the program.
llvm-svn: 16129
2004-09-01 04:41:28 +00:00
Reid Spencer
67c06d7df0 Initial commit for platform independent system configuration support.
llvm-svn: 16128
2004-08-31 18:13:52 +00:00
Reid Spencer
8c73e0041a Add support for FreeBSD
llvm-svn: 16127
2004-08-31 18:09:35 +00:00
Reid Spencer
f2531a1568 Add support for Interix and FreeBSD
llvm-svn: 16126
2004-08-31 18:03:23 +00:00
Reid Spencer
b14809c51d Actually define PreventCoreFiles in the sys namespace.
llvm-svn: 16125
2004-08-31 17:53:41 +00:00
Reid Spencer
4f48470d84 Add a new abstraction, SysConfig for platform independent system
configuration calls. Right now this just contains PreventCoreFiles so that
bugpoint can by platform independent.

llvm-svn: 16124
2004-08-31 17:43:29 +00:00
Alkis Evlogimenos
b84f0be5b1 Minor code clarity changes.
llvm-svn: 16123
2004-08-31 17:39:15 +00:00
Reid Spencer
67be17afbe Fix a "test" botch.
Alphabetize the platform list
Install some AC_MSG_CHECKING/AC_MSG_RESULT pairs.

llvm-svn: 16122
2004-08-31 14:20:36 +00:00
Nate Begeman
a113d74e4c convert M and MD form instructions to generated asm writer
llvm-svn: 16121
2004-08-31 02:28:08 +00:00
Reid Spencer
1daffa57c1 Recognize Interix systems as if they were SunOS and make sure we don't
attempt to configure for "Unknown" system types.

llvm-svn: 16120
2004-08-31 01:34:10 +00:00
Reid Spencer
79d4c3d5db Move the GetTemporaryDirectory function from "generic Unix" to platform
specific.

llvm-svn: 16119
2004-08-30 21:46:55 +00:00
Reid Spencer
f98fff36ef Add inclusion of assert.h
llvm-svn: 16118
2004-08-30 16:03:54 +00:00
Reid Spencer
47fc279160 Initial commit of a configuration file for compiling C++ programs with
the file name pattern *.cpp

llvm-svn: 16117
2004-08-30 06:32:24 +00:00
Reid Spencer
a681845e69 Implement the "setIncludePaths" and "setSymbolDefines" interface methods.
Revise token substitution to be a little faster.
Clean up exception throwing, make sure its always a std::string.

llvm-svn: 16116
2004-08-30 06:29:06 +00:00
Reid Spencer
1b389f09b4 Pass lists of -I and -D options through to the Compiler Driver.
Handle -g and -Wxxx for GCC compatibility

llvm-svn: 16115
2004-08-30 06:27:32 +00:00
Reid Spencer
cf2bc3d767 Add a blurb about exploiting the use of external storage.
llvm-svn: 16114
2004-08-30 05:56:51 +00:00
Nate Begeman
143cf94f92 Move yet more instructions over to being printed by the generated asm writer
llvm-svn: 16112
2004-08-30 02:28:06 +00:00
Reid Spencer
b55c0cbaee Abbreviate the long descriptions which are now in docs/SystemLibrary.html.
llvm-svn: 16111
2004-08-30 02:03:51 +00:00
Reid Spencer
8aca0b494d Reduce the number of arguments in the instruction builder and make some
improvements on instruction selection that account for register and frame
index bases.

Patch contributed by Jeff Cohen. Thanks Jeff!

llvm-svn: 16110
2004-08-30 00:13:26 +00:00
Reid Spencer
9f64b91e27 Need to throw std::string not const char* if we want error messages to be
caught.

llvm-svn: 16109
2004-08-30 00:06:52 +00:00
Reid Spencer
94596c2102 Synchronize documentation of configuration items and substitutions with
current reality of llvmc implementation.

llvm-svn: 16108
2004-08-29 23:20:42 +00:00
Nate Begeman
6cdbd22245 Convert A-Form instructions to auto-generated asm writer
llvm-svn: 16107
2004-08-29 22:45:13 +00:00
Nate Begeman
434234f6d1 Register sizes should be specified in bits
llvm-svn: 16106
2004-08-29 22:03:40 +00:00
Nate Begeman
8cb6bd5f3c Improvements to int->float cast code for PPC-64
llvm-svn: 16105
2004-08-29 22:02:43 +00:00
Nate Begeman
50d140ee3d Must link against new LLVMsystem library
llvm-svn: 16104
2004-08-29 22:01:44 +00:00
Nate Begeman
a094704ff9 RemoveFileOnSignal is now in sys:: namespace
llvm-svn: 16103
2004-08-29 22:01:17 +00:00
Nate Begeman
c9dec3ae70 Put this change back in after testing from Reid proved its innocence. getSpillSize now returns value in bits
llvm-svn: 16102
2004-08-29 22:00:24 +00:00
Nate Begeman
168be7e43f Update doxygen comment now that getSpillSize is supposed to return value in bits
llvm-svn: 16101
2004-08-29 21:59:26 +00:00
Reid Spencer
023637eb38 Add a declaration of environ global for Darwin
llvm-svn: 16100
2004-08-29 20:10:07 +00:00
Reid Spencer
a62e5a837f Add a missing header file
llvm-svn: 16099
2004-08-29 20:02:28 +00:00
Reid Spencer
3311669903 Add an assert to cature null Operands. It is better to catch it here than
to SIGSEGV in the bowels of isa<...> later.

llvm-svn: 16098
2004-08-29 19:37:59 +00:00
Reid Spencer
6fca37236d Signals support has been moved to lib/System
llvm-svn: 16097
2004-08-29 19:36:34 +00:00
Reid Spencer
efc94f5e72 Updated to create a link needed for correct lib/System compilation.
llvm-svn: 16096
2004-08-29 19:35:28 +00:00
Reid Spencer
90f56ee8b4 Add lib/System ahead of lib/Support in case there are operating system
issues.

llvm-svn: 16095
2004-08-29 19:33:21 +00:00
Reid Spencer
811c3c0edb Link with LLVMsystem.a for operating system independence.
llvm-svn: 16094
2004-08-29 19:31:19 +00:00
Reid Spencer
9b129bea2e RemoveFileOnErrorSignal is now in the llvm::sys namespace. Adjust
accordingly.

llvm-svn: 16093
2004-08-29 19:30:41 +00:00
Reid Spencer
74c3dc6927 Add the LLVMsystem.a library as it is now used for operating system
independence of the tool.

llvm-svn: 16092
2004-08-29 19:29:38 +00:00
Reid Spencer
e3263ecaf0 The functions in Signal.h are now in the llvm::sys namespace - adjust
llvm-svn: 16091
2004-08-29 19:28:55 +00:00
Reid Spencer
5b43fc9b53 add llvmc
llvm-svn: 16090
2004-08-29 19:27:34 +00:00
Reid Spencer
1b5b24f9fb Convert llvmc to use the lib/System interface instead of directly
using Unix operating system calls.

llvm-svn: 16089
2004-08-29 19:26:56 +00:00
Reid Spencer
b8c572df56 Move a warning comment to where it should have been in the first place.
llvm-svn: 16088
2004-08-29 19:25:54 +00:00
Reid Spencer
bb5301eebf Correct the vim: specification
llvm-svn: 16087
2004-08-29 19:24:53 +00:00
Reid Spencer
2f209c4452 Include some additional header files.
Fix the banner length.

llvm-svn: 16086
2004-08-29 19:24:20 +00:00
Reid Spencer
3d7a614ec7 Initial platform independent implementation of operating system concept
of "Signals" (cleanup after fatal errors).

llvm-svn: 16085
2004-08-29 19:22:48 +00:00
Reid Spencer
76b83a1869 Initial commit of an platform-indepdendent implementation for the
"Program" operating system concept (find and execute programs).

llvm-svn: 16084
2004-08-29 19:20:41 +00:00
Reid Spencer
21087b0f7e Put the lib/System interface functions in llvm::sys namespace.
llvm-svn: 16083
2004-08-29 19:19:07 +00:00
Reid Spencer
a872cbe3bd Create a link from $BUILD_OBJ_ROOT/lib/System/platform to
$BUILD_SRC_ROOT/lib/System/$build which gives us the ability to
configure the lib/System for the current type of operating system.
Also cleaned up some indentation.

llvm-svn: 16082
2004-08-29 19:18:05 +00:00
Nate Begeman
4483df8b63 Implement the following missing functionality in the PPC backend:
cast fp->bool
cast ulong->fp
algebraic right shift long by non-constant value
These changes tested across most of the test suite.  Fixes Regression/casts

llvm-svn: 16081
2004-08-29 08:19:32 +00:00
Reid Spencer
023ff63545 Initial commit of the platform agnostic interface to finding and executing
programs.

llvm-svn: 16080
2004-08-29 05:29:35 +00:00
Reid Spencer
319b136522 Add a function to remove whole directorys on fatal signal.
Doxygenify function comments.

llvm-svn: 16079
2004-08-29 05:27:15 +00:00
Reid Spencer
6df221d50a Revise the design of the Path concept per peer review. Too many changes to
note individually but these essence of it is to not derive from
std::string, clarify the interface, and provide better documentation.
There is now also (untested) implementations for AIX, Darwin, and SunOS.

llvm-svn: 16078
2004-08-29 05:24:01 +00:00
Alkis Evlogimenos
c227d73e5f Remove dead code.
llvm-svn: 16077
2004-08-28 22:43:31 +00:00
Alkis Evlogimenos
e2d962e0fd Now that LiveIntervals::addIntervalsForSpills is fixed, do not require
LiveVariables.

llvm-svn: 16076
2004-08-27 19:00:29 +00:00
Alkis Evlogimenos
8c67a3003e Only update LiveVariables if it is available. addIntervalsForSpills
runs after the initial run of the live interval analysis.

llvm-svn: 16075
2004-08-27 18:59:22 +00:00
Alkis Evlogimenos
efd40bce75 Back out this change as it broke the build last night. This should be
investicated further as the linearscan variants don't really need
LiveVariables...

llvm-svn: 16074
2004-08-27 18:01:21 +00:00
Nate Begeman
c561fc3731 Back out change to divide getSpillSize by 8 until I figure out why it breaks x86, which has register sizes in bits.
llvm-svn: 16073
2004-08-27 16:48:24 +00:00
Nate Begeman
0c1e6804a1 Fix a typo in the bytecode format documentation
llvm-svn: 16072
2004-08-27 07:59:37 +00:00
Alkis Evlogimenos
11f0fc8eda The linear scan variants do not require the LiveVariables analysis.
llvm-svn: 16071
2004-08-27 04:51:13 +00:00
Nate Begeman
fa2bf42539 Register sizes are in bits, not bytes
llvm-svn: 16070
2004-08-27 04:28:10 +00:00
Alkis Evlogimenos
7ebfde2be6 Add getLastBlock member. This is useful when growing a densemap keyed
on MachineBasicBlocks.

llvm-svn: 16069
2004-08-27 04:02:35 +00:00
Alkis Evlogimenos
390c820a82 Add MachineBasicBlock2IndexFunctor. This is useful for densemaps from
MachineBasicBlocks to an arbitrary type.

llvm-svn: 16068
2004-08-27 04:00:26 +00:00
Alkis Evlogimenos
60f33d4d66 Add size member function.
llvm-svn: 16067
2004-08-27 03:58:31 +00:00
Reid Spencer
6e8ffc3831 Add more content.
This isn't in reviewable shape yet, unless you're curious.

llvm-svn: 16066
2004-08-27 02:08:04 +00:00
Reid Spencer
7d0a123c3e Bug 430 Fixed.
llvm-svn: 16065
2004-08-27 00:48:26 +00:00
Reid Spencer
366c457e08 Correctly compute the number of compaction tables.
llvm-svn: 16064
2004-08-27 00:43:51 +00:00
Reid Spencer
248c06dcea Prevent an empty compaction table from being written to the bytecode file.
llvm-svn: 16063
2004-08-27 00:38:44 +00:00
Reid Spencer
3b789ad2b8 Add the CompactionTableIsEmpty function so that we can determine if a
CompactionTable really needs to be emitted. This is not a straight forward
computation, hence the need for a member function here.

llvm-svn: 16062
2004-08-26 22:32:00 +00:00
Alkis Evlogimenos
2c69803b61 Use newly added API in MRegisterInfo and don't expose the allocatable
register set anymore. Its users now use the MRegisterInfo API.

llvm-svn: 16061
2004-08-26 22:23:32 +00:00
Alkis Evlogimenos
542ac1cba7 Use newly added API in MRegisterInfo.
llvm-svn: 16060
2004-08-26 22:22:38 +00:00
Alkis Evlogimenos
8b5b3fdb50 Add getAllocatableSet() function.
llvm-svn: 16059
2004-08-26 22:21:04 +00:00
Reid Spencer
cb84e4351d Provide some meta tags for this document.
llvm-svn: 16058
2004-08-26 20:44:00 +00:00
Reid Spencer
1d9e29bdc0 Add the default table related styles
llvm-svn: 16057
2004-08-26 20:43:21 +00:00
Reid Spencer
c948f9d9e9 Document the rational for the #include hierarchy.
llvm-svn: 16056
2004-08-26 18:52:52 +00:00
Reid Spencer
30e25f33f7 Fix a typo.
llvm-svn: 16055
2004-08-26 07:43:33 +00:00
Reid Spencer
3f3d1666ff First cut at a README for lib/System explaining the #inclusion rules and
design criteria.

llvm-svn: 16054
2004-08-26 07:41:41 +00:00
Reid Spencer
b3f342c877 Add a README explaining the intended content of this directory.
llvm-svn: 16053
2004-08-26 05:58:20 +00:00
Alkis Evlogimenos
127c2aa7b2 Add default index functor (an identity functor). You could use a
vector directly to get the same functionality but using a DenseMap
makes the code more readable IMO.

llvm-svn: 16052
2004-08-26 03:37:28 +00:00
Brian Gaeke
7f00753f70 Previous checkin broke printf(%a) support for fp constants-- re-fix it.
llvm-svn: 16051
2004-08-25 19:37:26 +00:00
Brian Gaeke
35eb7aeae3 New version of Bill Wendling's PR33 patch.
llvm-svn: 16050
2004-08-25 19:00:42 +00:00
Reid Spencer
ebb91dcfe7 Fix documentation.
Make the library name LLVMsystem instead of just system so as to not
to be confused with other "system" libraries.

llvm-svn: 16049
2004-08-25 06:23:45 +00:00
Reid Spencer
814ba578ba Initial implementation of the Path operating system concept.
llvm-svn: 16048
2004-08-25 06:20:07 +00:00
Reid Spencer
13ebda70ea License for this library.
llvm-svn: 16047
2004-08-25 00:48:02 +00:00
Reid Spencer
135006cab1 Update to include tools/llvmc and lib/System as having additional copyright
licenses.

llvm-svn: 16046
2004-08-25 00:45:35 +00:00
Reid Spencer
6275eee949 License file for llvmc.
llvm-svn: 16045
2004-08-25 00:41:06 +00:00
Reid Spencer
01b22282fc Document definitions and computations provided by llvm-bcanalyzer.
llvm-svn: 16044
2004-08-25 00:35:20 +00:00
Reid Spencer
44bc15064c Insert declarations for two new functions that support the dependent
libraries feature.

llvm-svn: 16043
2004-08-24 22:55:34 +00:00
Reid Spencer
7a0348b163 Run the compilation actions before we attempt linking work.
Correctly implement the dependent libraries feature so that linked bytecode
files automatically include any dependent libraries they specify.

llvm-svn: 16042
2004-08-24 22:54:32 +00:00
Reid Spencer
3aac4f7d88 Add the directory specified by LLVM_LIB_SEARCH_PATH to the list of
directories to be searched during linking.

llvm-svn: 16041
2004-08-24 22:53:13 +00:00
Reid Spencer
f20d76d71e Add dependent library support for Stacker. It now inserts "stkr_runtime" as
a dependent library.

llvm-svn: 16040
2004-08-24 22:52:01 +00:00
Reid Spencer
db0bdd69f5 Add a function that gets just the dependent libraries from a bytecode file.
Doxygenify comments.

llvm-svn: 16039
2004-08-24 22:49:07 +00:00
Reid Spencer
ce9b84a6af Provide a method for wholesale extraction of the dependent libraries.
llvm-svn: 16038
2004-08-24 22:47:39 +00:00
Reid Spencer
79725deeb0 Add a wrapper for extraction of the dependent libraries from a bytecode
file.

llvm-svn: 16037
2004-08-24 22:46:20 +00:00
Reid Spencer
f341d29514 Rearrange output a little to make it nicer.
llvm-svn: 16036
2004-08-24 22:45:32 +00:00
Chris Lattner
7bf499c040 Add some details
llvm-svn: 16035
2004-08-24 18:53:39 +00:00
Reid Spencer
7c8d658efc Added BURS.
llvm-svn: 16034
2004-08-24 18:34:10 +00:00
Reid Spencer
8d86dd6453 Get rid of error messages from CommandLine because -time-passes was
defined twice. We make use of the new TimePassesIsEnabled global boolean
value from Pass.h to access the value.

llvm-svn: 16033
2004-08-24 17:54:26 +00:00
Reid Spencer
2e4bfff37c Give the -time-passes tool option a global storage location so that its
value can be discovered by the various LLVM tools.

llvm-svn: 16032
2004-08-24 17:52:35 +00:00
Chris Lattner
d8b5be4726 Fix a bug in a previous checkin of mine, correcting
Regression.CodeGen.Generic.2004-04-09-SameValueCoalescing.llx and the
code size problem.

This bug prevented us from doing most register coallesces.

llvm-svn: 16031
2004-08-24 17:48:29 +00:00
Reid Spencer
ad4c8e330f Add the examples directory to these scripts.
llvm-svn: 16030
2004-08-24 17:42:33 +00:00
Chris Lattner
57a2c3bad9 Modify testcase to merit a warning, though no warning is still printed!
llvm-svn: 16029
2004-08-24 17:40:02 +00:00
Reid Spencer
b1a014f786 Include the "examples" directory as optional.
Update configure script to configure the examples/Makefile

llvm-svn: 16028
2004-08-24 16:32:21 +00:00
Reid Spencer
a407007e07 Ensure that the examples get built.
llvm-svn: 16027
2004-08-24 16:31:01 +00:00
Reid Spencer
b26202f10c Adjustments for changes in the configuration language.
llvm-svn: 16026
2004-08-24 14:24:14 +00:00
Reid Spencer
a86672b929 - Unify format of output messages
- All errors throw std::string
- Default output file name to a.out (if we're linking)

llvm-svn: 16025
2004-08-24 14:05:30 +00:00
Reid Spencer
5b902eba71 Link with bcreader and vmcore.
llvm-svn: 16024
2004-08-24 14:04:07 +00:00
Reid Spencer
a1049043d7 - Implement the %args% substitution
- Implement parsing of the .output={bytecode|assembly} item.
- Drop parsing support for translator.optimizes, translator.groks_dash_O,
  optimizer.groks_dash_O, translator.output_is_asm, optimizer.output_is_asm
- Add parsing support for translator.output and optimizer.output
- Add optimizer.required parsing support
- Add linker.libs and linker.libpaths parsing support
- Fix error messages to list correct set of tokens expected.
- Rename FileReadable -> FileIsReadable (changed in CompilerDriver.cpp)

llvm-svn: 16023
2004-08-24 14:03:23 +00:00
Reid Spencer
ed9b3c4c20 - Alphabetize the list of token enumerators.
- Drop old tokens, insert new tokens

llvm-svn: 16022
2004-08-24 13:59:35 +00:00
Reid Spencer
20db3234bc - Rename and rearrange for clarity
- Drop name tokens not used any more (GROKS_DASH_O)
- Rename OUTPUT_IS_ASM as OUTPUT and allow "bytecode" and "assembly" as
  values of it.
- Simplify handleContext (now handleNameContext) arguments and ensure that
  it returns OPTION tokens exactly as scanned.

llvm-svn: 16021
2004-08-24 13:58:37 +00:00
Reid Spencer
f62f89b3eb - Remove unused GetSuffix function
- Renamed FileReadable -> FileIsReadable
- Remove support for GROKS_DASH_O; deferr it to %opts% substitution
- Require a -o option except in case of linking where it defaults to a.out
- Fix problem processing *.o and *.bc files.
- Ignore optimization phase if -emit-raw-code
- Correct the assembly generation phase to support -emit-native-code
- Implement dependent library lookup

llvm-svn: 16020
2004-08-24 13:55:17 +00:00
Reid Spencer
6ad2030f7a Remove unneeded flags.
llvm-svn: 16019
2004-08-24 13:49:57 +00:00
Chris Lattner
dfa9dbceaa Add -sse[,2,3] arguments to LLC
llvm-svn: 16018
2004-08-24 08:18:44 +00:00
Chris Lattner
61e6dbc761 Nuke commented out stuff
llvm-svn: 16017
2004-08-24 08:18:27 +00:00
Brian Gaeke
730d8d6259 bug fixed
llvm-svn: 16016
2004-08-24 07:43:48 +00:00
Brian Gaeke
1bd0804f6d note pr#
llvm-svn: 16015
2004-08-24 07:28:45 +00:00
Brian Gaeke
75dca84c7f This code is dodgy, but the guaranteed assertion failure doesn't help anything.
llvm-svn: 16014
2004-08-24 06:41:40 +00:00
Brian Gaeke
98aa7797c3 Fix bug in PhyRegAlloc::setCallInterferences() handling call through a
null pointer.

llvm-svn: 16013
2004-08-24 06:41:39 +00:00
Brian Gaeke
d315f43587 Revise head-of-file comment.
Eliminate some excess whitespace.
Fix bug in CallArgsDescriptor::get() handling call through a null pointer.

llvm-svn: 16012
2004-08-24 06:41:38 +00:00
Reid Spencer
be36a8cd2a Actually get the URL to my notes page correct.
llvm-svn: 16011
2004-08-24 05:40:25 +00:00
Reid Spencer
ea6ad243e9 Correct my home page. Shorten my entry. Reference home page in description.
llvm-svn: 16010
2004-08-24 05:21:49 +00:00
Misha Brukman
2ace8cbb17 Change LVN -> Load-VN since that's the name of the cmdline switch
llvm-svn: 16009
2004-08-24 04:13:17 +00:00
Misha Brukman
4c70105c4c Fix some grammar.
llvm-svn: 16008
2004-08-24 02:23:58 +00:00
Misha Brukman
00b21aef7b Added DSE, LICM, LVN, PRE, SCCP, and SSA
llvm-svn: 16007
2004-08-24 01:57:02 +00:00
Chris Lattner
a88d667487 Do not use .xword and friends to emit zeros on V9. Apparently there are issues
with emitting .xwords when not on an 8-byte boundary (.xword 0 is not the
same as 8 .byte 0's).  Because we do not know when or when we are not aligned,
just emit bytes like the old V9 asmprinter did.

llvm-svn: 16006
2004-08-24 00:26:11 +00:00
Brian Gaeke
adc0b83eec A PR60 test case
llvm-svn: 16005
2004-08-23 20:49:33 +00:00
Misha Brukman
62a2c1fd7a Document 'gmake install' vs. 'install-bytecode' (used for bytecode libs)
llvm-svn: 16004
2004-08-23 20:25:33 +00:00
Reid Spencer
5b81eea7a5 Moved small examples from /projects/SmallExamples to /examples.
Made the "ModuleMaker" into an example since its just one source file.

llvm-svn: 16003
2004-08-23 19:29:54 +00:00
Reid Spencer
b987b7cede Moved the "SmallExamples" out of the /projects directory and into a new
/examples directory. History was maintained. These programs do not need to
be configured but things in /projects must be.

llvm-svn: 16002
2004-08-23 19:28:39 +00:00
Reid Spencer
300396971c Fix Title line
Make the "DIRS" option descend any directory with a Makefile.

llvm-svn: 16001
2004-08-23 18:06:31 +00:00
Misha Brukman
39efd01983 Note: do not use GNU binutils under AIX, they're not stable.
llvm-svn: 16000
2004-08-23 17:54:45 +00:00
Reid Spencer
06afee6ede Change the makefile back so it descends any directory with a Makefile.
llvm-svn: 15999
2004-08-23 17:47:16 +00:00
Reid Spencer
a628856d1e Many useful corrections resulting from Chris Lattner's review. Thanks Chris!
Misha: you're next. :)

llvm-svn: 15996
2004-08-22 18:06:59 +00:00
Reid Spencer
f222ee6546 Provide support for retaining the version number found in a config file.
llvm-svn: 15995
2004-08-22 18:03:25 +00:00
Reid Spencer
3820372162 Add the VERSION token.
llvm-svn: 15994
2004-08-22 18:02:41 +00:00
Reid Spencer
a318822db2 Add support for version numbers.
Allow CRLF as a line terminator (as well as plain LF)

llvm-svn: 15993
2004-08-22 18:02:13 +00:00
Reid Spencer
ed09afc536 Shorten lines so this file can be used as the documentation example
directly. Remove -pre (experimental pass).

llvm-svn: 15992
2004-08-22 18:01:19 +00:00
Nate Begeman
1c57b4fa32 Kill a majority of unnecessary sign extensions for byte loads
llvm-svn: 15991
2004-08-22 08:10:15 +00:00
Nate Begeman
64ef0262bd Don't hard code the offset of the saved R31 in functions with frame pointers
llvm-svn: 15990
2004-08-22 08:09:17 +00:00
Misha Brukman
5d41391185 Bytecode libraries are installed with `make install-bytecode'
llvm-svn: 15989
2004-08-21 23:40:49 +00:00
Reid Spencer
5a2dfbae3d First complete version. The details of configuration are now correctly
stated. PLEASE REVIEW THIS DOCUMENT NOW! :)

llvm-svn: 15988
2004-08-21 22:37:42 +00:00
Reid Spencer
f39f66e3ef Initial checkin of a pass to lower packed operations to scalars operations.
This also registers the pass with opt with a -lower-packed command line
option.

Patch contributed by Brad Jones.

llvm-svn: 15987
2004-08-21 21:39:24 +00:00
Reid Spencer
d6dd465326 Correct to change interface of the analyzer.
llvm-svn: 15986
2004-08-21 21:00:24 +00:00
Reid Spencer
2807accdc5 Bytecode Analyzer Cleanup:
- Rearrange output order to make more sense
- Make only the function level output count as "detailed"
- Output dump output directly to stream, don't buffer it.
- Fix counting of block sizes
- Implement new handlers for number of types, dependent libs, target triple
- Compute the size of block headers.

llvm-svn: 15985
2004-08-21 20:58:19 +00:00
Reid Spencer
9874c63314 Get rid of an extraneous local variable.
llvm-svn: 15984
2004-08-21 20:53:56 +00:00
Reid Spencer
6639333f20 Two Changes:
- Pass the output stream to the analyzer so it can write its output there
  directly instead of buffering it.
- Don't pass a boolean to ParseBytecode because its not needed any more.

llvm-svn: 15983
2004-08-21 20:52:03 +00:00
Reid Spencer
8631bc3aaa Add boolean file format flags in preparation for version 5 bytecode.
Remove the "processFunctions" boolean from ParseBytecode as it is no
longer needed. This is part of avoiding double reading of functions
when analyzing bytecode.

llvm-svn: 15982
2004-08-21 20:50:49 +00:00
Reid Spencer
191aa30ac1 Bytecode Reader Cleanup:
- provide the correct conversion for ModuleBlockID in read_block (a potential
  bug but not actually exploited because reading module block ids doesn't
  use read_block).
- install support for handleTypeList handler
- install support for handleDependentLibrary handler
- install support for handleTargetTriple handler
- clean up comments, output strings,
- ensure that processing function arguments doesn't SIGSEGV if one of the
  arguments is a null pointer (yeah, it happened .. weird)
- prepare for version 5 bytecode by documenting what will change.

llvm-svn: 15981
2004-08-21 20:49:23 +00:00
Reid Spencer
c039e6301a Dump the DependentLibsBlockID, its not a block, its just a list inside the
globals info block. Add an enumerator for getting the number of enumerators
so we can range check in assertions.

llvm-svn: 15980
2004-08-21 20:42:28 +00:00
Nate Begeman
45b0b7cd7c Back out branchless SetCC code. While it helped a lot in some cases, it
hurt a lot in others.  Instead, improve branching version of SetCC and
Select instructions.  The old code will be in CVS should we ever need to
dig it up again.

llvm-svn: 15979
2004-08-21 20:42:14 +00:00
Reid Spencer
f9ce66b75a Add new methods:
- get the total number of types in the global type list
- handle dependent libraries
- handle target triple

llvm-svn: 15978
2004-08-21 20:41:12 +00:00
Reid Spencer
83c307de5d Bytecode Analyzer cleanup:
- don't save the "dump" output, just emit it
- record the bc version number
- record info about the dependent libraries and target triple
- use the correct enumeration as the index on the block size map

llvm-svn: 15977
2004-08-21 20:40:08 +00:00
Chris Lattner
8eab62ee0d Alignment is now in bits.
llvm-svn: 15976
2004-08-21 20:15:25 +00:00
Chris Lattner
70efc8f8e1 Switch from bytes to bits for alignment.
Also, change GPRC for PPC32 to align on 32-bit boundary instead of 64-bit

llvm-svn: 15975
2004-08-21 20:14:40 +00:00
Chris Lattner
5f6556da45 Switch from bytes to bits for alignment for consistency
llvm-svn: 15974
2004-08-21 20:14:13 +00:00
Chris Lattner
7c98308013 Reduce uses of getRegClass
llvm-svn: 15973
2004-08-21 20:13:52 +00:00
Chris Lattner
a440d5b081 Convert regclass alignment from bytes to bites
llvm-svn: 15972
2004-08-21 20:13:09 +00:00
Chris Lattner
b7ddc73b45 Convert bytes to bits in alignment
llvm-svn: 15971
2004-08-21 20:09:46 +00:00
Chris Lattner
36ba4bb042 Register info alignment is in bits, frame object alignment is (currently) in
bytes.

llvm-svn: 15970
2004-08-21 20:04:59 +00:00
Chris Lattner
beadefde19 Make alignment be in bits, just like size is
llvm-svn: 15969
2004-08-21 20:00:36 +00:00
Chris Lattner
c1ba9fb6e1 Reduce uses of getRegClass
llvm-svn: 15968
2004-08-21 19:51:17 +00:00
Chris Lattner
f76ccd43b8 Now that we have per-register spill size/alignment info, remove more uses
of getRegClass

llvm-svn: 15967
2004-08-21 19:45:10 +00:00
Chris Lattner
a6d34d9e19 Infer the spillsize/alignment of a register based on the register classes
it is embedded into.

llvm-svn: 15966
2004-08-21 19:42:03 +00:00
Chris Lattner
d3244d9cec Support "Methods" in register classes in CodgeGenRegisterClass
llvm-svn: 15965
2004-08-21 19:21:21 +00:00
Chris Lattner
f7833ba375 Fix warning
llvm-svn: 15964
2004-08-21 19:11:03 +00:00
Reid Spencer
04f4d52d9e Examine the type code in the setcc class of instructions and if it
is a PackedType, throw an error. Temporary solution.

Patch contributed by Brad Jones.

llvm-svn: 15963
2004-08-21 16:11:02 +00:00
Nate Begeman
3ad3ad4f3f Move XForm instructions over to the auto-generated asm writer
llvm-svn: 15962
2004-08-21 05:56:39 +00:00
Chris Lattner
2a86fab933 Start parsing register classes into a more structured form
llvm-svn: 15961
2004-08-21 04:05:00 +00:00
Chris Lattner
e34ae99942 Read in declared reg sizes
llvm-svn: 15960
2004-08-21 02:24:57 +00:00
Chris Lattner
6a92fdef72 Add two values
llvm-svn: 15959
2004-08-21 02:17:39 +00:00
Chris Lattner
8439f382b6 Fix a nasty bug that Nate ran into. In particular, instead of emitting a 2+MB
error message, print out:

llvm-link: error linking in 'g.2.rbc': Global Variable Collision on
' %struct.D_Reduction* %d_reduction_10_gram' - External linkage globals have
different initializers

That's a bit more concise, huh?

llvm-svn: 15958
2004-08-21 00:50:59 +00:00
Reid Spencer
7f9971f349 Change @ -> % in config files. @name@ might be needed for config files to
themselves be configured via autoconf so its not a good substitition syntax
for llvmc. Furthermore % is more llvmish :)

llvm-svn: 15957
2004-08-20 22:53:11 +00:00
Nate Begeman
abf3c4d787 remove some things from the todo list.
llvm-svn: 15956
2004-08-20 18:46:54 +00:00
Chris Lattner
f1cd650251 Do not register ppc64 yet, as it breaks the SparcV9 backend
llvm-svn: 15955
2004-08-20 18:09:18 +00:00
Chris Lattner
d0713e7664 quish a warning
llvm-svn: 15954
2004-08-20 18:07:39 +00:00
Reid Spencer
e203d35be4 Fix a bug found exposed by: Regression/Other/2004-08-20-PackedControlFlow.ll
Packed types need to be allowed in type statements too.

Patch provided by Brad Jones.

llvm-svn: 15953
2004-08-20 15:37:30 +00:00
Nate Begeman
1b1a784afa Implement code to convert SetCC into straight line code where appropriate. Add necessary instructions for this transformation to the .td file.
llvm-svn: 15952
2004-08-20 09:56:22 +00:00
Reid Spencer
6f7407880f Remove even the slightest chance of a race condition occurring :)
llvm-svn: 15951
2004-08-20 09:32:32 +00:00
Reid Spencer
a17a413cc1 Implement the correct search for configuration files. llvmc will now try
the following in this order:
 1. -config-dir=/path/to/configs
 2. LLVM_CONFIG_DIR=/path/to/configs
 3. ~/.llvm/etc
 4. $prefix/etc
 5. /etc/llvm

llvm-svn: 15950
2004-08-20 09:24:07 +00:00
Reid Spencer
6ad57b2491 Add CONFIG_FILES so the language specific config files can be installed.
llvm-svn: 15949
2004-08-20 09:21:51 +00:00
Reid Spencer
cc51e7b358 Added a set of rules for installing configuration files. You can now say
CONFIG_FILES=a b c
in a Makefile and when you "make install" the files a b and c will get
installed into the $prefix/etc directory.

llvm-svn: 15948
2004-08-20 09:20:05 +00:00
Reid Spencer
fab530daf2 Implement Assembly support.
Consolidate platform-specific code into "sys" namespace.

llvm-svn: 15947
2004-08-20 09:14:05 +00:00
Reid Spencer
288adf1a3f Changes resulting from change in autoconf/configure.in (rename a #define)
llvm-svn: 15946
2004-08-20 09:10:31 +00:00
Reid Spencer
3b65b0a67a Actually name the #define correctly.
llvm-svn: 15945
2004-08-20 09:08:57 +00:00
Reid Spencer
d677a43b4b Added various LLVM_* strings that are configured to provide the user's
choice of installation directories. Programs can then automagically know
where the installation files are located.

llvm-svn: 15944
2004-08-20 09:05:15 +00:00
Reid Spencer
4d5c2a98d3 Update after change to autoconf/configure.ac
llvm-svn: 15943
2004-08-20 09:03:57 +00:00
Reid Spencer
cf05c1256b Change version 1.3 -> 1.4
Add basic installation directories as AC_DEFINES and AC_SUBST so they can
be used by llvm programs with a simple #include <Config/config.h>

llvm-svn: 15942
2004-08-20 09:03:12 +00:00
Chris Lattner
befb7361c6 New testcase that the vector support does not work with yet.
This is also designed to make lowering a bitch :)

llvm-svn: 15941
2004-08-20 08:34:27 +00:00
Reid Spencer
f98e3c9358 Added various tests in support of Packed Types.
Tests kindly provided by Brad Jones.

llvm-svn: 15940
2004-08-20 06:06:43 +00:00
Reid Spencer
b6388f725e Added a test case for packed types. Test case kindly provided by Brad Jones
llvm-svn: 15939
2004-08-20 06:02:24 +00:00
Brian Gaeke
0220904e7a Packed types, brought to you by Brad Jones
llvm-svn: 15938
2004-08-20 06:00:58 +00:00
Reid Spencer
2b4b4a577a Avoid building samples. Require explicit list of directory names to build.
llvm-svn: 15937
2004-08-20 01:49:59 +00:00
Chris Lattner
ab8d172df2 Make people explicitly add dirs to this. Remove ModuleMaker as it currently
does not build (it must be configured before it will work)

llvm-svn: 15936
2004-08-20 01:11:16 +00:00
Chris Lattner
40d0204067 Only build project dirs with a Makefile in them. This should fix the
problem where Depend or Debug directories prevent CVS from nuking an obsolete
project dir

llvm-svn: 15935
2004-08-20 01:07:54 +00:00
Chris Lattner
615ffb84fa Bug fixed
llvm-svn: 15934
2004-08-20 00:36:23 +00:00
Chris Lattner
14c198d09a If we are linking two global variables and they have the same size, do not
spew warnings, even if the types don't match.

llvm-svn: 15933
2004-08-20 00:30:39 +00:00
Misha Brukman
8f12956327 Fix opcodes being printed in caps (the more general fix may be `AsmWriter')
llvm-svn: 15932
2004-08-19 21:56:12 +00:00
Reid Spencer
9251cb2ecd Actually let it compile after file name changes.
llvm-svn: 15931
2004-08-19 21:52:49 +00:00
Misha Brukman
170943a795 Stack space for argument passing is 32 regardless of 32- vs. 64-bit arch.
Thanks to Nate Begeman for pointing this out.

llvm-svn: 15930
2004-08-19 21:51:19 +00:00
Misha Brukman
f73c87b36c LR needs to be saved at 16-byte offset on a 64-bit arch
llvm-svn: 15929
2004-08-19 21:36:14 +00:00
Misha Brukman
f35b35a926 On 64-bit PowerPC, pointers are 8 bytes, so parameter area offset is 48, not 24
llvm-svn: 15928
2004-08-19 21:34:05 +00:00
Reid Spencer
b32e350931 Moved ConfigData -> Configuration
llvm-svn: 15927
2004-08-19 21:17:53 +00:00
Misha Brukman
75e987d0b8 This PHI has 4 additional operands, not 2.
llvm-svn: 15926
2004-08-19 21:00:12 +00:00
Reid Spencer
90b057bf2a Moved these files to "SmallExamples" directory.
llvm-svn: 15925
2004-08-19 20:16:42 +00:00
Reid Spencer
f30f28e05f Add the fibonacci example provided by Valery Khamenya.
llvm-svn: 15924
2004-08-19 20:10:04 +00:00
Reid Spencer
7d12179af1 Make the SmallExamples programs compile in their new home.
llvm-svn: 15923
2004-08-19 20:09:14 +00:00
Misha Brukman
a26a61aa18 Use the appropriate 64-bit register description file.
llvm-svn: 15922
2004-08-19 19:36:57 +00:00
Reid Spencer
01ea7aed59 Fixed the test to actually run correctly.
llvm-svn: 15921
2004-08-19 19:23:28 +00:00
Reid Spencer
cdce60cae2 Add a test case test test 1.3 alignment removal and to test a regression
on disassembly speed (where SlotMachine was being recomputed on each
getSlot() call).

llvm-svn: 15920
2004-08-19 19:11:57 +00:00
Misha Brukman
a5543ac5fb Fix more remaining 32-bit vestiges of PowerPC
llvm-svn: 15919
2004-08-19 18:49:58 +00:00
Misha Brukman
2ff719f74f Fix another vestige of the 32-bit PowerPC backend.
llvm-svn: 15918
2004-08-19 16:50:30 +00:00
Misha Brukman
714d166c22 Correct character prepended to global symbols ('.'), use Mangler consistently
llvm-svn: 15917
2004-08-19 16:33:56 +00:00
Misha Brukman
0010ea3042 * Eliminate global base register, r2 is used for that on AIX/PowerPC
* Fix bug from 32-bit PowerPC days of 2-register long split

llvm-svn: 15916
2004-08-19 16:29:25 +00:00
Misha Brukman
6c4a085286 Wrap long lines.
llvm-svn: 15915
2004-08-19 16:28:30 +00:00
Nate Begeman
d5c6380015 Convert casts that will have no effect into move instructions.
llvm-svn: 15914
2004-08-19 08:07:50 +00:00
Nate Begeman
e4e6d92d1d Clean up floating point instruction selection.
Change int->float cast code to put conversion constants in constant pool.
Shorten code sequence for constant pool fp loads.
Remove LOADLoDirect/LOADLoIndirect psuedo instructions and tweak asmwriter

llvm-svn: 15913
2004-08-19 05:20:54 +00:00
Reid Spencer
dc20389b5c Implement many new features for llvmc. This is the first version that will
actually execute actions and it is been shown to optimize a Stacker program

llvm-svn: 15912
2004-08-19 04:49:47 +00:00
Misha Brukman
b3b5890213 Instead of int64_t, overload itostr with `long long' parameter.
This appeases both SparcV9 and 64-bit PowerPC.

llvm-svn: 15910
2004-08-18 22:56:12 +00:00
Reid Spencer
3cff8a04ef Correct a link, add a TOC entry.
llvm-svn: 15909
2004-08-18 20:17:05 +00:00
Reid Spencer
375d78428c Provided opcode definitions.
Clarified documentation of symbol tables.
Clarified definition of slot numbers.
Added the http-equiv meta tag for HTML 4.01 strict compliance.
Adjusted line lengths.
Differentiated between "type slot" and "value slot" everywhere.
ispelled it.

llvm-svn: 15908
2004-08-18 20:06:19 +00:00
Brian Gaeke
1936ce708d M_DUMMY_PHI_FLAG is no longer used to distinguish V9::PHI. Get rid of it and
its TargetInstrInfo accessor.

llvm-svn: 15907
2004-08-18 20:04:28 +00:00
Brian Gaeke
7593525fcd Instead of using isDummyPhiInstr, we just compare the opcode with V9::PHI.
llvm-svn: 15906
2004-08-18 20:04:24 +00:00
Brian Gaeke
de44bc018a Instead of using isDummyPhiInstr, we just compare the opcode with V9::PHI.
Also, squash a use of TargetInstrInfo::isNop().

llvm-svn: 15905
2004-08-18 20:04:21 +00:00
Chris Lattner
1ea6d207ce Convert to the new MachineFunctionInfo interface
llvm-svn: 15904
2004-08-18 18:13:37 +00:00
Chris Lattner
663bf7e765 All targets are now allowed to have their own MachineFunctionInfo objects,
also, make getInfo do some checking and cast to the appropriate concrete type.

llvm-svn: 15903
2004-08-18 18:13:16 +00:00
Brian Gaeke
dddd639059 M_PSEUDO_FLAG is no longer used. Get rid of it and its accessor.
llvm-svn: 15902
2004-08-18 17:44:17 +00:00
Brian Gaeke
b8183ff647 The SparcV9 target no longer uses any pseudoinstructions (SETSW, SETUW,
SETX) or M_PSEUDO_FLAG.

llvm-svn: 15901
2004-08-18 17:44:16 +00:00
Brian Gaeke
2fbe85b1f3 The Create*Const methods don't need to pass around a TargetMachine reference.
Other minor cleanups.

llvm-svn: 15900
2004-08-18 17:44:15 +00:00
Brian Gaeke
c03556f67e Doxygenify some comments.
Clean up cpReg2MemMI and cpMem2RegMI, and doxygenify comments.
Get rid of their uses of SETSW, which is a pseudoinstruction. We can't
JIT-compile pseudoinstructions at the moment. This was blowing up 252.eon/jit,
which has some HUGE stack frames.
Reduce the uses of constantFitsInImmedField().
Consolidate some assertions.

llvm-svn: 15899
2004-08-18 17:44:14 +00:00
Chris Lattner
12754fe6b3 Switch V9 over to using the AsmPrinter base class to do its constant printing
Massive thanks to the brg miester for doing the testing. :)

llvm-svn: 15898
2004-08-18 05:29:08 +00:00
Chris Lattner
10262ab3f1 Rename var
llvm-svn: 15897
2004-08-18 02:22:55 +00:00
Chris Lattner
ddc7e4863d Alkis pointed out that this is not a character (we actually support strings)
and as such, we should use self revealing names.  Hey, makes sense to me!

llvm-svn: 15896
2004-08-18 02:22:34 +00:00
Chris Lattner
6a9f355b1b new method
llvm-svn: 15895
2004-08-17 21:38:51 +00:00
Chris Lattner
ea75199996 Add support for targets without a .zero directive
llvm-svn: 15894
2004-08-17 21:38:40 +00:00
Misha Brukman
faa6e51d6e This file is no longer used.
llvm-svn: 15893
2004-08-17 20:23:33 +00:00
Chris Lattner
2501f5852a Start using alignment output routines from AsmPrinter.
Changes to make this more similar to the X86 asmprinter

Fix overalignment of globals.

llvm-svn: 15891
2004-08-17 19:26:03 +00:00
Chris Lattner
866b58d2ef Start using alignment output routines from AsmPrinter.
Changes to make this more similar to the ppc asmprinter

llvm-svn: 15890
2004-08-17 19:25:42 +00:00
Chris Lattner
32ac814f29 Add an overload
llvm-svn: 15889
2004-08-17 19:17:10 +00:00
Chris Lattner
1d35c1673f Add support for alignment
llvm-svn: 15888
2004-08-17 19:14:29 +00:00
Chris Lattner
0c2ab8a9d4 Add a new helper method to get log2(type alignment)
llvm-svn: 15887
2004-08-17 19:13:00 +00:00
Chris Lattner
65066a40ea Add punctuation, add a new method
llvm-svn: 15886
2004-08-17 19:12:44 +00:00
Misha Brukman
a9ed31a50b Add itostr(long) for our furry 64-bit friends.
llvm-svn: 15885
2004-08-17 18:08:52 +00:00
Misha Brukman
0f2e2f7e5b Ultra-doxygenify some function header comments.
llvm-svn: 15884
2004-08-17 17:52:36 +00:00
Chris Lattner
caf3f3e970 Check constant expression validity more strictly
llvm-svn: 15883
2004-08-17 17:28:46 +00:00
Chris Lattner
fca2833838 Work around PR424 for old c/c++ frontends.
llvm-svn: 15882
2004-08-17 17:26:41 +00:00
Chris Lattner
cc21bfd809 Print comments with ;
llvm-svn: 15881
2004-08-17 16:27:26 +00:00
Chris Lattner
da6beac0ff Use a designated comment character when printing comments.
llvm-svn: 15880
2004-08-17 16:27:05 +00:00
Chris Lattner
db00f45936 Allow targets to specify a comment character
llvm-svn: 15879
2004-08-17 16:26:36 +00:00
Reid Spencer
9f093edf1a Added a *very* initial cut at a lexicon for LLVM. I don't plan to write
this whole thing. Just use the pattern in the file to add entries as you
think of them. This will be really helpful for newbies to advanced compiler
optimization techniques such as myself.

llvm-svn: 15878
2004-08-17 09:38:50 +00:00
Reid Spencer
be6a243b9f Documented (Java properties file like) syntax of config file format
Added definitions for some of the configuration items.
Made the document HTML 4.01 Strict compliant.
Ran ispell on it.

llvm-svn: 15877
2004-08-17 09:18:37 +00:00
Reid Spencer
cde8a13a1c Add a reference to the ComilerDriver documentation.
llvm-svn: 15876
2004-08-17 08:01:57 +00:00
Reid Spencer
c3e436427b Bytecode File Format Changes:
- File format version number bumped to 4
- Writer will now align nothing
- Reader now only expects alignment for version 3 or earlier

llvm-svn: 15875
2004-08-17 07:45:14 +00:00
Reid Spencer
0b85d03b57 Documented the removal of alignment in version 4 bytecode files (version 3
was released with LLVM 1.3). Alignment of fields can add severe size to
certain kinds of functions (those with lots of long format instructions) so
we decided to do away with alignment altogether in this bc version.

llvm-svn: 15874
2004-08-17 07:43:43 +00:00
Nate Begeman
0818541631 Re-fix hiding the Frame Pointer from the register allocator in functions
that have a frame pointer.  This change fixes Burg.  In addition, make
the necessary changes to floating point code gen and constant loading after
Chris Lattner's fixes to the asm writer.  These changes fix MallocBench/gs

llvm-svn: 15873
2004-08-17 07:17:44 +00:00
Chris Lattner
b3739ceb6e Use the AsmPrinter emitGlobalConstant.
llvm-svn: 15872
2004-08-17 06:48:55 +00:00
Chris Lattner
404bc3dcaf Add missing \t
llvm-svn: 15871
2004-08-17 06:48:34 +00:00
Chris Lattner
9fa0fc4d5e Add support for targets that have .quad, drop extra tab inserted
llvm-svn: 15870
2004-08-17 06:48:16 +00:00
Chris Lattner
f97bce7214 Use the emitGlobalConstant defined in AsmPrinter
llvm-svn: 15869
2004-08-17 06:37:12 +00:00
Chris Lattner
8452a1f6df Implement emitGlobalConstant
llvm-svn: 15868
2004-08-17 06:36:49 +00:00
Chris Lattner
81e514b8a6 Add some hooks
llvm-svn: 15867
2004-08-17 06:36:27 +00:00
Chris Lattner
ac253447d3 New, more general, interface.
llvm-svn: 15866
2004-08-17 06:07:43 +00:00
Chris Lattner
104bfb7576 Allow an arbitrary prefix
llvm-svn: 15865
2004-08-17 06:06:54 +00:00
Chris Lattner
c16a4a7b55 Allow an arbitrary prefix.
llvm-svn: 15864
2004-08-17 06:06:37 +00:00
Chris Lattner
6d42cbd71a We now allow targets to use any prefix they want for global symbols. Lets
hear it for ".".

llvm-svn: 15863
2004-08-17 06:06:19 +00:00
Misha Brukman
9254441cdf Rewrite targets/rules to generate files for just PowerPC or PPC{32,64}
llvm-svn: 15862
2004-08-17 05:11:54 +00:00
Misha Brukman
4eab7f3d5b Register classes are target-dependent
llvm-svn: 15861
2004-08-17 05:10:31 +00:00
Misha Brukman
851a54656a #include <map> is not necessary here
llvm-svn: 15860
2004-08-17 05:09:39 +00:00
Misha Brukman
fd2df5afab `PowerPC' is no longer a real target
llvm-svn: 15859
2004-08-17 05:09:10 +00:00
Misha Brukman
38c61506a8 Move variables and methods which need PPC{32,64}* distinction to subclasses
llvm-svn: 15858
2004-08-17 05:08:44 +00:00
Misha Brukman
ba7fe16dbf No need for an `is64bit' flag
llvm-svn: 15857
2004-08-17 05:06:47 +00:00
Misha Brukman
fe3e46a0b3 PowerPCInstrInfo and PowerPCRegisterInfo have gone away; they are replaced
by 32- and 64-bit customized files, named appropriately.

llvm-svn: 15856
2004-08-17 05:05:00 +00:00
Misha Brukman
de4fc10733 Consistently name passed with 32 or 64 in their name
llvm-svn: 15855
2004-08-17 05:02:58 +00:00
Misha Brukman
68ede7e9ba PowerPCRegisterInfo no longer takes a bool to differentiate 32 vs 64 bits
llvm-svn: 15854
2004-08-17 05:02:18 +00:00
Misha Brukman
d61283f347 The PowerPCInstrInfo class has gone away.
llvm-svn: 15853
2004-08-17 05:00:46 +00:00
Misha Brukman
0674182457 PowerPCInstrInfo has gone away, PPC32 and PPC64 share opcodes.
llvm-svn: 15852
2004-08-17 04:58:50 +00:00
Misha Brukman
ac0ae7c215 PowerPC 32-/64-bit split: Part II, 64-bit customizations on PowerPC
llvm-svn: 15851
2004-08-17 04:57:37 +00:00
Misha Brukman
116f9277f6 PowerPC 32-/64-bit split: Part I, PPC32* bit files, adapted from former PowerPC*
llvm-svn: 15850
2004-08-17 04:55:41 +00:00
Chris Lattner
c9d99efdd3 Do not #include files into the llvm namespace
llvm-svn: 15849
2004-08-17 03:08:28 +00:00
Reid Spencer
f8a18099fb Correct the comments in the symbol table writer to reflect reality.
llvm-svn: 15848
2004-08-17 02:59:02 +00:00
Chris Lattner
a8fbbc0ec3 Print float constants as 4 byte values.
Also, fix endianness problems when cross compiling from little-endian host.

llvm-svn: 15847
2004-08-17 02:48:44 +00:00
Chris Lattner
bc9372bf77 Make sure to put an _ prefix on all identifiers!
Also, add some (currently disabled) code to print float's as 32-bits.

llvm-svn: 15846
2004-08-17 02:29:00 +00:00
Chris Lattner
07e78f177a Some asmwriters want an _ prefix
llvm-svn: 15845
2004-08-17 02:28:26 +00:00
Chris Lattner
278f1cb3d4 Some asmweriters want an _ prefix
llvm-svn: 15844
2004-08-17 02:28:12 +00:00
Reid Spencer
9a91081c51 Technical Corrections (thanks to Robert Mykland):
- Define the "opcode" data type and reference the Instruction.def file
- Clean up the definition of symtab by indicating that it is composed of
  two llists.
- Fix some broken links.

llvm-svn: 15843
2004-08-17 00:49:03 +00:00
Chris Lattner
5491774934 More changes to make PPC32 and X86 more similar
llvm-svn: 15842
2004-08-16 23:38:36 +00:00
Chris Lattner
b4f1f71bf0 Minor changes to make the diff be nothing against the X86 version
llvm-svn: 15841
2004-08-16 23:30:16 +00:00
Chris Lattner
0ced90583d Finegrainify namespacification
Start using the AsmPrinter base class to factor out a bunch of code

llvm-svn: 15840
2004-08-16 23:25:21 +00:00
Chris Lattner
9cf46456cb Start using the AsmPrinter to emit our first class constants. This also
drops our half-assed support for cygwin, which noone uses and doesn't work
anyway.

llvm-svn: 15839
2004-08-16 23:16:06 +00:00
Chris Lattner
6a8e0f511b Initial implementation of the asmprinter base class
llvm-svn: 15838
2004-08-16 23:15:22 +00:00
Chris Lattner
7e3f28fcdf Moved this file out of lib/CodeGen
llvm-svn: 15837
2004-08-16 22:38:02 +00:00
Chris Lattner
2cb145ceb5 Hacks to make the MachineFunction class be able to delete the MFI object
without knowing anything about it.

llvm-svn: 15836
2004-08-16 22:37:18 +00:00
Chris Lattner
95de5ddbbd Code moved out of lib/CodeGen/MachineFunction.cpp
llvm-svn: 15835
2004-08-16 22:36:54 +00:00
Chris Lattner
a1d7802e3c Move this code to lib/Target/SparcV9/MachineFunctionInfo.cpp
llvm-svn: 15834
2004-08-16 22:36:34 +00:00
Chris Lattner
bb9aa25a52 This file is moving to lib/Target/SparcV9
llvm-svn: 15833
2004-08-16 22:36:10 +00:00
Chris Lattner
5217efc496 Fit into 80 lines, add a gross hack for MachineFunctionInfo
llvm-svn: 15832
2004-08-16 22:35:26 +00:00
Chris Lattner
359c83fb5a These files now live in lib/Target/SparcV9
llvm-svn: 15831
2004-08-16 21:56:15 +00:00
Chris Lattner
9fb30a4257 Move MachineCodeForInstruction.h and MachineFunctionInfo.h into lib/Target/SparcV9
llvm-svn: 15830
2004-08-16 21:55:02 +00:00
Chris Lattner
491a52cf22 Nuke this file
llvm-svn: 15829
2004-08-16 21:36:40 +00:00
Chris Lattner
d75c0438a1 Fold MachineInstrAnnot.cpp into this file
llvm-svn: 15828
2004-08-16 21:36:31 +00:00
Chris Lattner
a752fceb91 Spaces arg!
llvm-svn: 15827
2004-08-16 20:20:46 +00:00
Reid Spencer
f57b8b9e70 Correct the documentation for the module block header which uses the long
format instead of the short format used in other blocks.

Discrepancy noted by Robert Mykland. Thanks Robert!

llvm-svn: 15826
2004-08-16 19:24:36 +00:00
Misha Brukman
30cee49933 Move these files (which are dependent on VMCore) into VMCore
llvm-svn: 15825
2004-08-16 19:04:36 +00:00
Brian Gaeke
a7ae92436f Update and consolidate comments. Remove some excess whitespace.
llvm-svn: 15824
2004-08-16 18:27:25 +00:00
Brian Gaeke
224704fc6f Add a note that people shouldn't use MachineFunctionInfo.
llvm-svn: 15823
2004-08-16 18:27:24 +00:00
Reid Spencer
f03b47c7f1 Bug 422 fixed.
llvm-svn: 15822
2004-08-16 16:48:19 +00:00
John Criswell
23c656d050 Merged in RELEASE_13. This fixes the Command Guide link when browsing the
files from a local filesystem.

llvm-svn: 15821
2004-08-16 15:19:02 +00:00
John Criswell
07c0f37f5b Updated for 1.3.
llvm-svn: 15820
2004-08-16 15:17:40 +00:00
John Criswell
1e87b97d38 Merged in release_13 branch.
llvm-svn: 15819
2004-08-16 14:51:33 +00:00
Reid Spencer
b0ac8c48a6 Fix PR422.
Ouch! Changes in the lazy initialization code caused each incorporated
function to reprocess the entire function on every lookup of a value's
slot number. This caused a horrible slowdown in all functions. This
fix made llvm-dis go from "longer than I care to wait" (minutes) on a large
test case to 0.53 seconds.

llvm-svn: 15818
2004-08-16 07:46:33 +00:00
Reid Spencer
8fac94b882 Back out include/llvm/System changes until a satisfactory solution can
be determined.

llvm-svn: 15817
2004-08-16 07:10:09 +00:00
Reid Spencer
bd2642e7e8 Remove lib/System contents until a satisfactory solution can be
provided.

llvm-svn: 15816
2004-08-16 07:08:38 +00:00
Reid Spencer
263bbbd2df Back out dependencies on lib/System/Path.h
llvm-svn: 15815
2004-08-16 07:06:38 +00:00
Reid Spencer
efd6e266fa Fix definitions to match tool's actual capabilities.
llvm-svn: 15814
2004-08-16 07:06:13 +00:00
Chris Lattner
a10ed3b1ce Bug fixed
llvm-svn: 15813
2004-08-16 05:46:57 +00:00
Chris Lattner
712de8407d Believe it or not, this was broken in LLVM 1.3
llvm-svn: 15812
2004-08-16 05:39:19 +00:00
Chris Lattner
12324753f2 Fix a bug that caused the pass to go into infinite loops on trivial testcases.
This is fallout of the Bug 122 changes.

llvm-svn: 15811
2004-08-16 05:38:02 +00:00
Chris Lattner
f2e9ea2106 There is no need for a cast here
llvm-svn: 15810
2004-08-16 05:09:58 +00:00
Nate Begeman
ab6b08d937 Update the current state of the world
llvm-svn: 15809
2004-08-16 05:06:43 +00:00
Nate Begeman
a6808b8efc Fix typo of the word 'implicit' I made resolving a CVS conflict. Whoops!
llvm-svn: 15808
2004-08-16 02:12:49 +00:00
Nate Begeman
dabf0a52c0 Fix frame pointer handling:
Reserve R0 in store/load from stack slot for building >32k offsets from SP
or FP.  This also requires we use R11 rather than R0 for holding the LR
value we want to save or restore.  Also, tell the register allocator not
to use R31 (our FP) in functions that have a frame pointer.  These changes
fix Burg.

llvm-svn: 15807
2004-08-16 01:52:12 +00:00
Nate Begeman
8b44a07246 Fix mismatched adjust down/up of SP in functions that contain variable
sized allocas.

llvm-svn: 15806
2004-08-16 01:50:22 +00:00
Chris Lattner
8af61ddb96 Use CodeGenRegister class to make reading in of register information more
systematic.

llvm-svn: 15805
2004-08-16 01:10:21 +00:00
Chris Lattner
b7b70480e1 Add initial support for register and register class representation.
Obviously this is not done.

llvm-svn: 15804
2004-08-16 01:09:52 +00:00
Chris Lattner
a9e2ab44a1 Flags and TSFlags were (thankfully) never used, so remove them. But wait,
not so fast, add some fields for spill slot size and alignment

llvm-svn: 15803
2004-08-16 01:07:53 +00:00
Chris Lattner
3361c5da6f Add a special case for argc,argv
llvm-svn: 15802
2004-08-16 01:07:04 +00:00
Chris Lattner
b1cad0b3bc Don't pass too many arguments into runFunction
llvm-svn: 15801
2004-08-16 01:05:35 +00:00
Chris Lattner
163c326060 Scrub all LLVM 1.3 stuff, changing over to 1.4. Add info about PR419,
which is now fixed.

llvm-svn: 15800
2004-08-16 00:20:18 +00:00
Chris Lattner
3f9d4ed43d Finally, add support for calling arbitrary non-varargs functions.
llvm-svn: 15799
2004-08-16 00:14:18 +00:00
Chris Lattner
58d0582548 Handle all nullary functions, of any valid return type.
llvm-svn: 15798
2004-08-15 23:53:06 +00:00
Chris Lattner
23f7c98016 Fine, go all of the way and check that the argument types are correct as well.
llvm-svn: 15797
2004-08-15 23:39:59 +00:00
Chris Lattner
8f8f72f21b These only really work if returning int or void
llvm-svn: 15796
2004-08-15 23:34:48 +00:00
Chris Lattner
30411e0973 Switch to using the JIT now that it can directly call zeroarg functions
llvm-svn: 15795
2004-08-15 23:31:57 +00:00
Chris Lattner
47380e3ba0 Handle zero arg function case
llvm-svn: 15794
2004-08-15 23:31:43 +00:00
Chris Lattner
a349c03347 Simplify code a bit, print error message always instead of asserting.
llvm-svn: 15793
2004-08-15 23:29:50 +00:00
Chris Lattner
f56b692110 Simplify code, make it print the constructed module before it is run.
llvm-svn: 15792
2004-08-15 23:21:54 +00:00
Chris Lattner
26971f4bc2 V8 never used the instrselectorgenerator
llvm-svn: 15791
2004-08-15 23:07:40 +00:00
Chris Lattner
291de48b59 isdummyclass goes away
llvm-svn: 15790
2004-08-15 23:04:35 +00:00
Chris Lattner
0bbf7005f5 Remove awareness of isDummyClass
llvm-svn: 15789
2004-08-15 23:04:13 +00:00
Chris Lattner
aa6a8abc02 disable all of the pattern isel stuff
llvm-svn: 15788
2004-08-15 23:02:34 +00:00
Chris Lattner
1d088db15e Disable the pattern isel
llvm-svn: 15787
2004-08-15 23:02:17 +00:00
Chris Lattner
9f714c8d35 Include .td and .txt files in the greps. This will allow me to find symbols in
them, and also count them in the LOC of LLVM for the nightly tester.

llvm-svn: 15786
2004-08-15 22:54:31 +00:00
Chris Lattner
26516544a1 Documentation like this doesn't belong here, and now we have the commandguide
llvm-svn: 15785
2004-08-15 22:53:20 +00:00
Chris Lattner
5943c5078c Reduce usage of MRegisterInfo::getRegClass
llvm-svn: 15784
2004-08-15 22:23:09 +00:00
Chris Lattner
f26b1fd35d Add new TargetRegisterClass::contains method
llvm-svn: 15783
2004-08-15 22:19:38 +00:00
Chris Lattner
48a3b942ae Insertion methods now return void instead of #instrs inserted. Also, use
more powerful forms of BuildMI to concisify the code

llvm-svn: 15782
2004-08-15 22:15:56 +00:00
Chris Lattner
772f0d4106 Code insertion methods now return void instead of #instrs inserted
llvm-svn: 15781
2004-08-15 22:15:30 +00:00
Chris Lattner
a0b38d3cb1 Code insertion methods now return void instead of an int.
llvm-svn: 15780
2004-08-15 22:15:11 +00:00
Chris Lattner
6199899483 The insertion method returns void now
llvm-svn: 15779
2004-08-15 22:14:31 +00:00
Chris Lattner
a246668640 Implement a long overdue FIXME, by changing these methods to return void.
llvm-svn: 15778
2004-08-15 22:14:19 +00:00
Chris Lattner
afe8e34940 Nuke ifdef'd out code
llvm-svn: 15777
2004-08-15 22:03:57 +00:00
Chris Lattner
2b5d9a0270 Remove helper method
llvm-svn: 15776
2004-08-15 22:02:36 +00:00
Chris Lattner
c66f27fd29 Stop using CreateStackObject(RegClass*)
llvm-svn: 15775
2004-08-15 22:02:22 +00:00
Chris Lattner
98de1d7795 These methods no longer take a TargetRegisterClass* operand.
llvm-svn: 15774
2004-08-15 21:56:44 +00:00
Chris Lattner
3e0ea4593a Eliminate the RegisterClass argument, since it can easily be derived from
the regno

llvm-svn: 15773
2004-08-15 21:55:29 +00:00
Alkis Evlogimenos
4922e2e8ef Make this compile on gc 3.4.1 (static_cast to non-const type was not
allowed).

llvm-svn: 15766
2004-08-15 09:18:55 +00:00
Reid Spencer
f58e8d3d0c More Functionality:
- cleaned up lexical scanner
- added support for "lang.optN" configuration items
- added temporary file support (ala lib/System)
- corrected logic for deciding which phases to run
- consolidated the Action and ActionPattern classes

llvm-svn: 15765
2004-08-15 08:19:46 +00:00
Reid Spencer
82737a1e8b Initial configuration files (to be installed) for ll (LLVM Assembly) and
st (Stacker) source files. These versions for testing/review only.

llvm-svn: 15764
2004-08-15 08:16:12 +00:00
Reid Spencer
bc51b928d6 Initial implementations of the ErrorCode and Path concepts for Linux.
llvm-svn: 15763
2004-08-15 08:14:33 +00:00
Reid Spencer
b708529d80 First version of a class to represent the notion of an operating system
path to a file or directory and some rudimentary operations on them.

llvm-svn: 15762
2004-08-15 08:13:01 +00:00
Reid Spencer
87d050f59b First version of a class to represent operating system and lib/System
error codes in a platform independent way.

llvm-svn: 15761
2004-08-15 08:12:14 +00:00
Nate Begeman
78862c3717 Add future optimization opportunity
llvm-svn: 15760
2004-08-15 06:43:10 +00:00
Nate Begeman
373744c6dc Fix float to int codepath by always allocating 8 bytes for the target of a double store; optimize cmplwi generation.
llvm-svn: 15759
2004-08-15 06:42:28 +00:00
Chris Lattner
7dfaac4300 Zimm16 is now dead. Its entry is not removed from the enum, to avoid having
to renumber everything.  Similar elimination should be applied to other
operand enum values that are only used to format printing in the .s file.

llvm-svn: 15755
2004-08-15 05:48:47 +00:00
Chris Lattner
da2e56fb0c Convert all of the DForm_6* operations, which makes all of the Zimm16 users
dead.

llvm-svn: 15754
2004-08-15 05:46:14 +00:00
Chris Lattner
ae0c2c7583 Add i1imm
llvm-svn: 15753
2004-08-15 05:37:00 +00:00
Chris Lattner
94ab6273b6 Reenable the CCRC
llvm-svn: 15752
2004-08-15 05:31:15 +00:00
Chris Lattner
8a796858da Convert the DForm_4 over to the asmprintergen
llvm-svn: 15751
2004-08-15 05:20:16 +00:00
Nate Begeman
abc8173b18 Remove dead code
llvm-svn: 15750
2004-08-15 00:31:02 +00:00
Chris Lattner
ec1cc1b861 Print mflr using the asmwriter generator
llvm-svn: 15749
2004-08-14 23:27:29 +00:00
Chris Lattner
b08d2a2a11 Update to no longer take MF as an argument
llvm-svn: 15748
2004-08-14 22:57:22 +00:00
Chris Lattner
6ffa501d9f Make the AsmWriter a first-class tblgen object. Allow targets to specify
name of the generated asmwriter class, and the name of the format string.

llvm-svn: 15747
2004-08-14 22:50:53 +00:00
Nate Begeman
412602d7d9 Replace PowerPCPEI.cpp with target independant PrologEpilogInserter
llvm-svn: 15746
2004-08-14 22:16:36 +00:00
Nate Begeman
0c8c0346f8 Add support for frame pointers, and large offsets from stack and frame pointers. Adopt elimination of MachineFunction& arg from eliminateFrameIndex.
llvm-svn: 15745
2004-08-14 22:13:58 +00:00
Misha Brukman
9b5bdf9216 Use the `tools-only' target to avoid getting warnings about not having a CFE.
llvm-svn: 15744
2004-08-14 22:13:33 +00:00
Nate Begeman
9c7ddc3e21 Add indexed forms of load doubleword and load word algebraic for 64 bit targets
llvm-svn: 15743
2004-08-14 22:12:20 +00:00
Nate Begeman
caeb78e720 Fix handling of FP constants with single precision, and loading of internal linkage function addresses
llvm-svn: 15742
2004-08-14 22:11:38 +00:00
Nate Begeman
0ad7f813d8 Add initial support for using the generated asm writer. Also, fix FP constant printing to always print 8 byte intializers. Move printing of LinkOnce stubs.
llvm-svn: 15741
2004-08-14 22:09:10 +00:00
Nate Begeman
8536df7dbe Add generation of asm writer from tablegen files to Makefile
llvm-svn: 15740
2004-08-14 22:06:38 +00:00
Nate Begeman
a4da0d6294 Eliminate MachineFunction& argument from eliminateFrameIndex in x86 Target. Get MachineFunction from MachineInstruction's parent's parent
llvm-svn: 15739
2004-08-14 22:05:10 +00:00
Nate Begeman
1b0142d54e Eliminate MachineFunction& argument from eliminateFrameIndex in SparcV9 target
llvm-svn: 15738
2004-08-14 22:03:29 +00:00
Nate Begeman
7f1f81511d Eliminate MachineFunction& argument from eliminateFrameIndex in Skeleton target
llvm-svn: 15737
2004-08-14 22:01:38 +00:00
Nate Begeman
386d940f5c Elminiate MachineFunction& argument from eliminateFrameIndex
llvm-svn: 15736
2004-08-14 22:00:10 +00:00
Chris Lattner
6139134715 Implement test/Regression/Transforms/GlobalConstifier/phi-select.llx
This allows more globals to be marked constant, particularly global arrays.

llvm-svn: 15735
2004-08-14 20:57:17 +00:00
Chris Lattner
22bef5979a New testcase that the constifier should handle
llvm-svn: 15734
2004-08-14 20:47:56 +00:00
Chris Lattner
aad412256f New basic testcase for the constifier
llvm-svn: 15733
2004-08-14 20:44:09 +00:00
Reid Spencer
9d68ff6ef0 Converted to use flex for tokenizing input so we can use an easier to
understand recursive descent parser, we can easily handle more syntax
variety, and we can more easily change the configuration items accepted.

llvm-svn: 15732
2004-08-14 09:37:15 +00:00
Reid Spencer
e37345e78f Fix header commentary.
llvm-svn: 15729
2004-08-13 20:25:54 +00:00
Reid Spencer
cf7c2fe153 Additional functionality. This version handles option parsing and parameter
subsitution correctly for at least .ll and .st files. There's still a long
way to go (i.e. this isn't worth of review yet).

llvm-svn: 15728
2004-08-13 20:22:43 +00:00
Reid Spencer
fdda7ace31 First version of a utility internal to llvmc that handles the parsing and
construction of configuration data for compiler front ends.

llvm-svn: 15727
2004-08-13 20:21:22 +00:00
Reid Spencer
c0f1b21c7b Added description of usage of the getPosition() option on cl::opt and
cl::list.

llvm-svn: 15726
2004-08-13 20:19:14 +00:00
Reid Spencer
2027a6ffdc Allow any cl::opt to use the method getPosition() to retrieve the option's
absolute position on the command line. Similarly allow any cl::list to
use the method getPosition(n) to retrieve the absolute position of the nth
option in the list. This provides support for two things: (a) options like
-l that are actually positional and their order of occurrence matters when
they are intermixed with positional arguments like "a.o"; and (b) options
like -x LANG which affect only the positional arguments that come after
the option. In both cases, knowing the absolute position of a given option
helps.

llvm-svn: 15725
2004-08-13 19:47:30 +00:00
Nate Begeman
6e5010d935 Remove an unneeded header and forward declaration
llvm-svn: 15722
2004-08-13 09:33:17 +00:00
Nate Begeman
5bf9bfe398 Fix siod by switching BoolTy to byte rather than int until CFE changes for
Darwin.  Also, change asm printer to output proper stubs for external
functions whose address is passed as an argument to aid in bugpointing.

llvm-svn: 15721
2004-08-13 09:32:01 +00:00
Nate Begeman
420213f3c5 Fix 177.mesa compilation, don't use floating point regs for base addresses!
llvm-svn: 15720
2004-08-13 04:45:14 +00:00
Nate Begeman
2f1d849271 Fix llc crasher compiling siod by giving BuildMI the correct number of arguments
llvm-svn: 15719
2004-08-13 03:56:49 +00:00
Chris Lattner
43a080e65b Add another test
llvm-svn: 15718
2004-08-13 03:27:48 +00:00
Chris Lattner
56273827b1 If we are extracting a block that has multiple successors that are the same
block (common in a switch), make sure to remove extra edges in successor
blocks.  This fixes CodeExtractor/2004-08-12-BlockExtractPHI.ll and should
be pulled into LLVM 1.3 (though the regression test need not be, as that
would require pulling in the LoopExtract.cpp changes).

llvm-svn: 15717
2004-08-13 03:27:07 +00:00
Chris Lattner
f06b043204 When we code extract some stuff, leave the codeRepl block in the place where
the extracted code was, instead of putting it at the end of the function

llvm-svn: 15716
2004-08-13 03:17:39 +00:00
Chris Lattner
664d88cbd0 New testcase, which causes the block extractor to barf
llvm-svn: 15715
2004-08-13 03:08:54 +00:00
Chris Lattner
7386e6333d "extract" the block extractor pass from bugpoint (haha)
llvm-svn: 15714
2004-08-13 03:05:17 +00:00
Chris Lattner
df2ae522b1 Add a pass
llvm-svn: 15713
2004-08-13 03:03:44 +00:00
Chris Lattner
889d346e6e Add value mapper support for select constant exprs. This should fix a bug
Nate ran into when bugpointing siod.  This fix should go into LLVM 1.3

llvm-svn: 15712
2004-08-13 02:43:19 +00:00
Nate Begeman
2e8bfa2364 Longs are in one register on PowerPC 64; use appropriate instructions to operate on them.
llvm-svn: 15711
2004-08-13 02:20:47 +00:00
Nate Begeman
765cb5f844 Add some more 64 bit instructions we need for the PowerPC-64 ISel to the tablegen files
llvm-svn: 15710
2004-08-13 02:19:26 +00:00
Misha Brukman
20f9a62596 Wrap long lines and try to fill the 80 chars per line so that we don't have too
many short lines.

llvm-svn: 15706
2004-08-12 20:16:08 +00:00
Misha Brukman
810f89d11d * Escape &, <, and >
* Wrap code in <tt> or for larger blocks, <div class="doc_text">
* Wrap lines at 80 cols

llvm-svn: 15705
2004-08-12 19:58:43 +00:00
Chris Lattner
c8cb695f83 Add description of packed type support.
Patch contributed by Brad Jones!

llvm-svn: 15704
2004-08-12 19:12:28 +00:00
Chris Lattner
012301c37e Add information on adding a derived type to LLVM, patch contributed by
Brad Jones!

llvm-svn: 15703
2004-08-12 19:06:24 +00:00
Chris Lattner
d6dffa3f6c Allow targets to specify particular stack slots that certain physregs must
be spilled into.

llvm-svn: 15702
2004-08-12 19:01:55 +00:00
Chris Lattner
8885c4e2a5 Split saveCallerSavedRegisters into two methods for clarity, and add comments.
Add support for targets that must spill certain physregs at certain locations.

Patch contributed by Nate Begeman, slightly hacked by me.

llvm-svn: 15701
2004-08-12 19:01:14 +00:00
Chris Lattner
f9db6ff94b Remove dead methods
llvm-svn: 15698
2004-08-12 18:37:15 +00:00
Chris Lattner
907a360b11 Fix warning
llvm-svn: 15697
2004-08-12 18:36:28 +00:00
Chris Lattner
5ff05d724f Instead of a virtual method call, lets try a direct constant reference
llvm-svn: 15696
2004-08-12 18:29:05 +00:00
Chris Lattner
6411ff3c83 Virtual method calls are overrated
llvm-svn: 15695
2004-08-12 18:20:55 +00:00
Chris Lattner
df86f30815 Virtual method calls are overrated.
llvm-svn: 15694
2004-08-12 18:20:41 +00:00
Chris Lattner
e64f008fe3 Forward substitute some constants into their users
llvm-svn: 15693
2004-08-12 18:10:18 +00:00
Chris Lattner
eb02313413 The only target that uses this code (v9) always has argsOnStackHaveFixedSize
set to true (obviously)

llvm-svn: 15692
2004-08-12 18:06:35 +00:00
Chris Lattner
b0ac422db5 Remove dead methods
llvm-svn: 15691
2004-08-12 17:58:27 +00:00
Chris Lattner
e843032834 When we want a constant, just use it, instead of calling through layers of
virtual methods and register name mapping functions

llvm-svn: 15690
2004-08-12 17:56:01 +00:00
Reid Spencer
4260a38ac3 Convert to unix line format.
llvm-svn: 15689
2004-08-12 17:52:47 +00:00
Misha Brukman
af77fe4097 Disable PPC64 backend by default because LLC cannot choose automatically between
SparcV9 and PowerPC64 without target triples, since they are both 64-bit
big-endian targets.

llvm-svn: 15688
2004-08-12 17:16:43 +00:00
Chris Lattner
cde351ee30 This patch makes the inliner refuse to inline functions that have alloca
instructions in the body of the function (not the entry block).  This fixes
test/Programs/SingleSource/Regression/C/2004-08-12-InlinerAndAllocas.c
and test/Programs/External/SPEC/CINT2000/176.gcc on zion.

This should obviously be pulled into 1.3.

llvm-svn: 15684
2004-08-12 05:45:09 +00:00
Misha Brukman
52a4abc299 * Correct 64-bit version: blr 1 (not 0)
* BuildMI() can build 0-param instructions (e.g., NOP)

llvm-svn: 15681
2004-08-12 03:30:03 +00:00
Misha Brukman
5d967b3c5e * Print out full names for non-GPR or -FPR registers
* BuildMI() really *does* handle 0 params!

llvm-svn: 15680
2004-08-12 03:28:47 +00:00
Chris Lattner
7f1c7ede5b Fix code extraction of unwind blocks. This fixed bugs that bugpoint can
run into.  This should go into 1.3

llvm-svn: 15679
2004-08-12 03:17:02 +00:00
Misha Brukman
58040a63ee * Pointers are 8 bytes, hence cLong type on 64-bit PPC
* Fix loading of GlobalValues

llvm-svn: 15678
2004-08-12 02:53:01 +00:00
Misha Brukman
6f2e67a726 Eliminate special-casing 14-bit immediate load/store opcodes
llvm-svn: 15677
2004-08-12 02:51:38 +00:00
Chris Lattner
a7ba90e672 Hrm, this pass didn't compile. This bugfix should go into 1.3!
llvm-svn: 15676
2004-08-12 02:44:23 +00:00
Chris Lattner
af32dfa0f4 If the block extractor fails, actually emit the bc file that failed to extract
llvm-svn: 15675
2004-08-12 02:36:50 +00:00
Misha Brukman
5098bd5499 Correctly print out ASCII literal strings on AIX
llvm-svn: 15674
2004-08-12 01:01:13 +00:00
Misha Brukman
345399b06e Mark R2 as available for allocation on Darwin/PPC32, but not AIX/PPC64
llvm-svn: 15673
2004-08-12 00:10:01 +00:00
Misha Brukman
c94c0f75f4 * Move AIX into the llvm namespace to be accessed from RegisterInfo
* Mark InstrInfo with 32 vs. 64 bit flag
* Enable the 64-bit isel and asm printer

llvm-svn: 15672
2004-08-11 23:47:08 +00:00
Misha Brukman
aea37d65c8 Set the is64bit flag and propagate it to PowerPCRegisterInfo
llvm-svn: 15671
2004-08-11 23:45:43 +00:00
Misha Brukman
39f7533b40 * Set the is64bit boolean flag in PowerPCRegisterInfo
* Doubles are 8 bytes in 64-bit PowerPC, and use the general register class
* Use double-word loads and stores for restoring from/saving to stack
* Do not allocate R2 if compiling for AIX

llvm-svn: 15670
2004-08-11 23:44:55 +00:00
Misha Brukman
c2a043488a 64-bit instruction selector and AIX-specific 64-bit asm printer
llvm-svn: 15669
2004-08-11 23:42:15 +00:00
Misha Brukman
d7344dc9bd Fix names of 64-bit CMP*D* opcodes, add LWA and STD* opcodes
llvm-svn: 15668
2004-08-11 23:33:34 +00:00
Misha Brukman
78c1dcfc3e Add support for 64-bit CMPDI, CMPLDI, and CMPLD opcodes
llvm-svn: 15667
2004-08-11 20:56:14 +00:00
Misha Brukman
28beda9ba4 Add doubleword load/store (64-bit only).
llvm-svn: 15665
2004-08-11 15:54:36 +00:00
Misha Brukman
81f6ee8070 Simple hand-coded tests to aid in early development of backends, along with a
Makefile to run ad-hoc tests easily.

llvm-svn: 15664
2004-08-11 14:16:34 +00:00
Misha Brukman
7224ee1e4c Hyphenate ##-bit and remove first-person from comments.
llvm-svn: 15663
2004-08-11 13:35:44 +00:00
Nate Begeman
f17ea0f7b7 Clean up 32/64bit and Darwin/AIX split. Next steps: 64 bit ISel, AIX asm printer.
llvm-svn: 15662
2004-08-11 07:40:04 +00:00
Chris Lattner
6f0291792e Fix a case where constantexprs could leak into the PPC isel.
llvm-svn: 15661
2004-08-11 07:34:50 +00:00
Chris Lattner
eb34c59930 Remove a bunch of ad-hoc target-specific flags that were only used by the
old asmprinter.

llvm-svn: 15660
2004-08-11 07:12:04 +00:00
Chris Lattner
085663c4ec Remove a dead method
llvm-svn: 15659
2004-08-11 07:07:14 +00:00
Chris Lattner
d1bee6ee12 Finally, the entire instruction asmprinter is now generated from tblgen, woo!
llvm-svn: 15658
2004-08-11 07:02:04 +00:00
Chris Lattner
a0bafce127 Add asmprintergen support for the last X86 instruction that needs it: pcrelative calls.
llvm-svn: 15657
2004-08-11 06:59:12 +00:00
Chris Lattner
5edeb20bbb This file is long dead
llvm-svn: 15656
2004-08-11 06:55:12 +00:00
Chris Lattner
5f4b65e57d Scrunch memoperands, add a few more for floating point memops
Eliminate the FPI*m classes, converting them to use FPI instead.

llvm-svn: 15655
2004-08-11 06:50:10 +00:00
Chris Lattner
b975636f71 Move hacks up
llvm-svn: 15654
2004-08-11 06:09:55 +00:00
Chris Lattner
6dd0474edd Make FPI take asm string and operand list
llvm-svn: 15653
2004-08-11 05:54:16 +00:00
Chris Lattner
c52899c3c7 Nuke the Im*i* patterns, by asmprintergenifying all users.
llvm-svn: 15652
2004-08-11 05:31:07 +00:00
Chris Lattner
f5c767038a X86 instructions that read-modify-write memory are not LLVM two-address instructions.
llvm-svn: 15651
2004-08-11 05:07:25 +00:00
Chris Lattner
0d7bc2c5da Get rid of the Im8, Im16, Im32 classes, converting more instructions over to
asmprintergeneration

llvm-svn: 15650
2004-08-11 04:31:00 +00:00
Chris Lattner
baa2ecb798 Fix minor bug in previous checkin
llvm-svn: 15649
2004-08-11 04:08:36 +00:00
Nate Begeman
7526da6ead Fix 255.vortex by using getClassB instead of getClass
llvm-svn: 15648
2004-08-11 03:30:55 +00:00
Chris Lattner
4dfadc05e6 Remove dead method
llvm-svn: 15647
2004-08-11 02:26:39 +00:00
Chris Lattner
09ee05bcdf Convert asmprinter to new style of instruction printer
Start asmprintergen'ifying machine instrs with memory operands.

llvm-svn: 15646
2004-08-11 02:25:00 +00:00
Chris Lattner
c1904dd38f change how we invoke the printer. Instead of passing in the MO directly,
pass in the MI, operand number, and the type of the operand.

llvm-svn: 15645
2004-08-11 02:23:23 +00:00
Chris Lattner
3bc477a237 Start parsing more information from the Operand information
llvm-svn: 15644
2004-08-11 02:22:39 +00:00
Chris Lattner
101f3fea82 Remove special case hacks
llvm-svn: 15643
2004-08-11 01:53:58 +00:00
Chris Lattner
6bd2d26b56 Fill out immediate operand classes, add a new Operand class
llvm-svn: 15642
2004-08-11 01:53:34 +00:00
Chris Lattner
4456da6a4c Fix InstCombine/2004-08-10-BoolSetCC.ll, a bug that is miscompiling
176.gcc.  Note that this is apparently not the only bug miscompiling gcc
though. :(

llvm-svn: 15639
2004-08-11 00:50:51 +00:00
Chris Lattner
39884511ee New testcase that instcombine is getting wrong
llvm-svn: 15637
2004-08-11 00:49:50 +00:00
Misha Brukman
e67a212267 Breaking up the PowerPC target into 32- and 64-bit subparts, Part III: the rest.
llvm-svn: 15636
2004-08-11 00:11:25 +00:00
Misha Brukman
284086aa4a Breaking up the PowerPC target into 32- and 64-bit subparts: Part II: 64-bit.
llvm-svn: 15635
2004-08-11 00:10:41 +00:00
Misha Brukman
d022a5ac5a Breaking up the PowerPC target into 32- and 64-bit subparts, Part I: 32-bit.
llvm-svn: 15634
2004-08-11 00:09:42 +00:00
Misha Brukman
3decf86fb7 Implement new constructor.
llvm-svn: 15633
2004-08-10 23:10:25 +00:00
Misha Brukman
8ca3b7568a Add new constructor.
llvm-svn: 15632
2004-08-10 23:10:21 +00:00
Misha Brukman
dad438bfb9 Renamed PPC32 (namespace for regs, opcodes) to PPC to include 64-bit targets
llvm-svn: 15631
2004-08-10 22:47:03 +00:00
Misha Brukman
0b9444e536 * Fix file header to use tablegen emacs mode instead of c++
* Wrap long line to 80 cols

llvm-svn: 15630
2004-08-10 21:24:44 +00:00
Chris Lattner
ce5fb7db1c This is purely a formatting patch that gets us closer to the mecca of fitting
X86InstrInfo.td into 80 columns

llvm-svn: 15629
2004-08-10 21:21:30 +00:00
Chris Lattner
116fc25d79 Drop the first argument of FPI, and asmprinterify fxch
llvm-svn: 15628
2004-08-10 21:02:13 +00:00
Misha Brukman
422d0fadf1 Deleted commented-out code as we now get namespace directly, add comments
llvm-svn: 15627
2004-08-10 20:54:58 +00:00
Nate Begeman
63be70d8f2 Fix casts of float to unsigned long
Replace STDX (store 64 bit int indexed) with STFDX (store double indexed)
Fix latent bug in indexed load generation
Generate indexed loads and stores in many more cases

llvm-svn: 15626
2004-08-10 20:42:36 +00:00
Misha Brukman
1401c28e35 Fix file header comment: update filename, set tablegen emacs mode.
llvm-svn: 15625
2004-08-10 20:28:13 +00:00
Chris Lattner
ead14c1a07 This purely mechanical patch gives the "I" tblgen class operand list and asm
string operands, and adjusts all users to pass them in instead of using II.

llvm-svn: 15624
2004-08-10 20:17:41 +00:00
Reid Spencer
e66c307d2a Fix a copy & paste error .. correct the description of the program.
llvm-svn: 15623
2004-08-10 19:18:51 +00:00
Reid Spencer
b8773e31d8 Adding a simple example of how to use the JIT.
Contributed by Valery A. Khamenya. THANKS, Valery!

llvm-svn: 15622
2004-08-10 19:14:36 +00:00
Chris Lattner
c4eb5951d5 Convert Ii32 instructions over to use the asmprinter generator
llvm-svn: 15621
2004-08-10 19:06:36 +00:00
Misha Brukman
c6b114f258 DForm 5/6 extended mneumonics take 3 arguments.
llvm-svn: 15620
2004-08-10 19:03:31 +00:00
Misha Brukman
59978333a3 Use the target name instead of hard-coding SparcV9.
llvm-svn: 15616
2004-08-10 18:31:01 +00:00
Misha Brukman
dc541abcd0 * Instruction definitions moved to SparcV9InstrInfo.td for consistency
* Defined PHI instruction and SparcV9 subclass of Target

llvm-svn: 15615
2004-08-10 18:15:31 +00:00
Misha Brukman
591d47113f Renamed SparcV9_Reg.td -> SparcV9RegisterInfo.td for consistency.
llvm-svn: 15614
2004-08-10 18:14:04 +00:00
Misha Brukman
09d87b4939 Fix DForm_4: format is `op r, r, i'
llvm-svn: 15613
2004-08-10 18:07:55 +00:00
Misha Brukman
17913b3f23 Fix comment header, specify type of file `tablegen'.
llvm-svn: 15612
2004-08-10 17:37:14 +00:00
Reid Spencer
424cf6c880 Finish HTMLizing the document. Configuration section is very crufty.
llvm-svn: 15611
2004-08-10 16:40:56 +00:00
Reid Spencer
a39bf3da7b Fixed some spellos and grammaros.
llvm-svn: 15610
2004-08-10 16:38:18 +00:00
Reid Spencer
5532159340 Move CompilerDriver.h here.
llvm-svn: 15609
2004-08-10 16:29:18 +00:00
Reid Spencer
e70c43de89 Initial makefile for the LLVM Compiler Driver.
llvm-svn: 15608
2004-08-10 16:27:08 +00:00
Reid Spencer
89ff1de384 First "do nothing" version of the LLVM Compiler Driver. This version just
processes command line arguments and allows --help to be used.

llvm-svn: 15607
2004-08-10 16:26:01 +00:00
Chris Lattner
9f49a91b44 Convert the Ii16 instructions over
llvm-svn: 15606
2004-08-10 16:22:02 +00:00
Chris Lattner
4d66b78036 Convert all Ii8 instructions over to the autogenerated asmprinter.
llvm-svn: 15605
2004-08-10 16:09:54 +00:00
Misha Brukman
8fbdc9fc4f Define the target name so we can use it via TableGen.
llvm-svn: 15604
2004-08-10 15:29:15 +00:00
Chris Lattner
79db057a3b This was a good idea, but until this does not break the build of
lib/Target/Sparc, we should not use it.

llvm-svn: 15603
2004-08-10 15:05:18 +00:00
Chris Lattner
1d787355e7 Paper over CBackend/2004-08-09-va-end-null.ll
Note that this indicates a serious problem with the way we are emitting varargs,
but this should not be properly fixed until after 1.3.

This patch SHOULD go into 1.3.

llvm-svn: 15602
2004-08-10 00:19:16 +00:00
Chris Lattner
cee3c6b1be This testcase causes the CBE to generate code that is not legal C.
llvm-svn: 15601
2004-08-09 23:56:17 +00:00
Misha Brukman
189229151f Stub definition of the PowerPC CodeEmitter class; this isn't functional (yet).
llvm-svn: 15600
2004-08-09 23:03:59 +00:00
Misha Brukman
eca36a5aa0 CodePrinter -> AsmPrinter
llvm-svn: 15599
2004-08-09 22:27:45 +00:00
Chris Lattner
8e7260652b Fix InstCombine/2004-08-09-RemInfLoop.llx
This should go into the 1.3 branch

llvm-svn: 15593
2004-08-09 21:05:48 +00:00
Chris Lattner
cf5dd04f8b New testcase
llvm-svn: 15592
2004-08-09 21:03:35 +00:00
Misha Brukman
976381e554 Do not mention Chris in public Makefiles
llvm-svn: 15591
2004-08-09 20:23:44 +00:00
Misha Brukman
265fd5dbbd Shorten comment header to 80 cols
llvm-svn: 15590
2004-08-09 20:13:14 +00:00
Misha Brukman
f1c538e16e * Remove UIUC-specific comment
* Make header comment span 80 cols

llvm-svn: 15589
2004-08-09 20:07:44 +00:00
Misha Brukman
876d5f1bad Add note about AIX/PowerPC with disk space requirements. Wrap long line.
llvm-svn: 15588
2004-08-09 19:57:01 +00:00
Misha Brukman
a71ab1cedd Remove Chris-related bytecode-dir comment
llvm-svn: 15587
2004-08-09 19:51:49 +00:00
Misha Brukman
8f951e579b Remove ClassPrefix variable as it's no longer used.
llvm-svn: 15586
2004-08-09 19:13:29 +00:00
Misha Brukman
920ae9524d Use the current target name instead of a ClassPrefix.
llvm-svn: 15585
2004-08-09 19:10:43 +00:00
Misha Brukman
65c7925816 * CFE builds on AIX/PowerPC
* Wrap long code lines

llvm-svn: 15584
2004-08-09 18:37:04 +00:00
Misha Brukman
0eb9cee698 The (future) SparcV8 JIT would do well to have a class prefix.
llvm-svn: 15583
2004-08-09 18:13:09 +00:00
Misha Brukman
18d27dc342 * Use Classname and ClassPrefix instead of hard-coded V9 values
* Simplify code and shorten lines by not recomputing values

llvm-svn: 15582
2004-08-09 17:47:45 +00:00
Misha Brukman
11bbbb9cdd Define the ClassPrefix for SparcV9.
llvm-svn: 15581
2004-08-09 17:46:49 +00:00
Misha Brukman
d210ed1855 Define a ClassPrefix for PowerPC.
llvm-svn: 15580
2004-08-09 17:46:26 +00:00
Misha Brukman
8f7272c249 Classes need to have a prefix name, so that they can be tacked on to the pieces
that TableGen creates for them, e.g. CodeEmitter, AsmPrinter, etc.

llvm-svn: 15579
2004-08-09 17:46:06 +00:00
Misha Brukman
b3401c4c50 Generate a code emitter for PowerPC as well, this will be used in the JIT.
llvm-svn: 15578
2004-08-09 17:24:32 +00:00
Misha Brukman
5295e1db10 Use instruction formats as defined in the PowerPC ISA manual
llvm-svn: 15577
2004-08-09 17:24:04 +00:00
Reid Spencer
4606127bf2 Move information on Configuration files to the ../CompilerDriver.html
file since it doesn't belong in the man page.

llvm-svn: 15575
2004-08-09 03:10:39 +00:00
Reid Spencer
d5c0ccbe2c This is the initial draft of the Compiler Driver documentation. It is not
worthy of review at this point. There is much thought and content remaining
to be written.

llvm-svn: 15574
2004-08-09 03:08:29 +00:00
Reid Spencer
42817b7ea1 Fix stack size processing now that the return address isn't an implied
push onto the top of the stack like x86, which uses the local area
offset.  This will allow the removal of PowerPCPEI.cpp soon.

llvm-svn: 15573
2004-08-09 01:24:32 +00:00
Chris Lattner
c0171089fb This isn't a bug, it's a missing feature
llvm-svn: 15571
2004-08-08 03:33:07 +00:00
Chris Lattner
4956a32c9e Fix another really nasty regression that Anshu pointed out. In cases where
dangling constant users were removed from a function, causing it to be dead,
we never removed the call graph edge from the external node to the function.

In most cases, this didn't cause a problem (by luck).  This should definitely
go into 1.3

llvm-svn: 15570
2004-08-08 03:29:50 +00:00
Chris Lattner
6b54110281 Add standard print/dump methods to CallGraph classes.
llvm-svn: 15569
2004-08-08 03:27:49 +00:00
Chris Lattner
92b9906199 Two fixes:
1. Fix a REALLY nasty cyclic replacement issue that Anshu discovered, causing
   nondeterminstic crashes and memory corruption.
2. For performance, don't go inserting constantexpr casts of GV pointers.

This should definitely go into 1.3

llvm-svn: 15568
2004-08-08 01:30:07 +00:00
Chris Lattner
6a93462144 This DEBUG is buggy. comment it out because it's not worth fixing. This
should go into 1.3

llvm-svn: 15567
2004-08-08 01:27:56 +00:00
Reid Spencer
6c70fdd7b8 Added information about the configuration file. This is a temporary home
for this information as it belongs in a larger document on the subject of
llvmc.

llvm-svn: 15566
2004-08-07 16:30:14 +00:00
Reid Spencer
2bce8006d5 Get rid of a warning when compiling optimized. Uninitialized variable has
been initialized.

llvm-svn: 15565
2004-08-07 15:19:31 +00:00
Chris Lattner
57cafee576 Ok get rid of the REST of the tabs
llvm-svn: 15564
2004-08-07 07:18:41 +00:00
Chris Lattner
0ee8279979 Death to tabs
llvm-svn: 15563
2004-08-07 07:07:57 +00:00
Reid Spencer
e132906258 Correct spelling mistakes. Wrap lines at 80 columns.
llvm-svn: 15562
2004-08-06 22:56:49 +00:00
Reid Spencer
fd5ea75c3e Various updates suggested by Misha and Chris. Moved material that is
aimed more at the comiler writer than the llvmc user later in the document.

llvm-svn: 15561
2004-08-06 22:28:47 +00:00
Brian Gaeke
8d38dee7b4 dumpSavedState has outlived its usefulness.
llvm-svn: 15555
2004-08-06 19:11:43 +00:00
Chris Lattner
9ad9ab8952 New testcase for critical 1.3 feature
llvm-svn: 15553
2004-08-06 18:09:02 +00:00
Reid Spencer
9a908daf38 First version of a manual page for the llvmc compiler driver. This tool is
being documented before being written to foster discussion about what the
tool should do. Eventually, we'll achieve a decision point at which time
this document forms the requirements for the tool from which it will be
coded.

llvm-svn: 15552
2004-08-06 16:58:48 +00:00
Alkis Evlogimenos
079fbde482 Split assertion to two in order to give better assertion messages.
llvm-svn: 15543
2004-08-06 14:33:37 +00:00
2197 changed files with 214910 additions and 179998 deletions

View File

@@ -3,3 +3,4 @@ Makefile.config
config.log
config.status
cvs.out
autom4te.cache

View File

@@ -12,14 +12,12 @@ E: vadve@cs.uiuc.edu
W: http://www.cs.uiuc.edu/~vadve/
D: The Sparc64 backend, provider of much wisdom, and motivator for LLVM
N: Henrik Bach
D: MingW Win32 API portability layer
N: Nate Begeman
E: natebegeman@mac.com
D: Portions of the PowerPC backend
N: Tanya Brethour
E: tonic@nondot.org
W: http://nondot.org/~tonic/
D: The llvm-ar tool
D: Primary PowerPC backend developer
N: Misha Brukman
E: brukman+llvm@uiuc.edu
@@ -35,28 +33,73 @@ N: Casey Carter
E: ccarter@uiuc.edu
D: Fixes to the Reassociation pass, various improvement patches
N: Jeff Cohen
E: jeffc@jolt-lang.org
W: http://jolt-lang.org
D: Native Win32 API portability layer
N: John T. Criswell
E: criswell@uiuc.edu
D: Autoconf support, QMTest database, documentation improvements
N: Alkis Evlogimenos
E: alkis@evlogimenos.com
D: Linear scan register allocator, many codegen improvements, Java frontend
N: Brian Gaeke
E: gaeke@uiuc.edu
W: http://www.students.uiuc.edu/~gaeke/
D: Portions of X86 static and JIT compilers.
D: Portions of X86 static and JIT compilers; SparcV8 backend
D: Dynamic trace optimizer
D: FreeBSD/X86 compatibility fixes, the llvm-nm tool
N: Louis Gerbarg
D: Portions of the PowerPC backend
N: Paolo Invernizzi
E: arathorn@fastwebnet.it
D: Visual C++ compatibility fixes
N: Brad Jones
E: kungfoomaster@nondot.org
D: Support for packed types
N: Sumant Kowshik
E: kowshik@uiuc.edu
D: Author of the original C backend
N: Chris Lattner
E: sabre@nondot.org
W: http://nondot.org/~sabre/
D: Primary architect of LLVM
N: Tanya Lattner (formerly Tanya Brethour)
E: tonic@nondot.org
W: http://nondot.org/~tonic/
D: The initial llvm-ar tool, converted regression testsuite to dejagnu
D: Modulo scheduling in the SparcV9 backend
N: Andrew Lenharth
E: alenhar2@cs.uiuc.edu
W: http://www.lenharth.org/~andrewl/
D: Alpha backend
N: Duraid Madina
E: duraid@octopus.com.au
W: http://kinoko.c.u-tokyo.ac.jp/~duraid/
D: IA64 backend
N: Michael McCracken
E: michael.mccracken@gmail.com
D: Line number support for llvmgcc
N: Vladimir Merzliakov
E: wanderer@rsu.ru
D: Test suite fixes for FreeBSD.
D: Test suite fixes for FreeBSD
N: Morten Ofstad
E: morten@hue.no
D: Visual C++ compatibility fixes
N: Vladimir Prus
E: ghost@cs.msu.su
@@ -72,9 +115,12 @@ D: The `paths' pass
N: Reid Spencer
E: rspencer@x10sys.com
W: http://extprosys.sourceforge.net/
D: 'llvm' namespacification, Stacker FE, VMCore cleanup (SymbolTable,
D: Value != Type, CPR removal, bytecode improvements, llvmcs).
W: http://llvm.x10sys.com/rspencer
D: Stacker, llvmc, bytecode, other. See web page for current notes.
N: Adam Treat
E: manyoso@yahoo.com
D: C++ bugs filed, and C++ front-end bug fixes.
N: Bill Wendling
E: wendling@isanbard.org

View File

@@ -4,7 +4,7 @@ LLVM Release License
University of Illinois/NCSA
Open Source License
Copyright (c) 2003, 2004 University of Illinois at Urbana-Champaign.
Copyright (c) 2003, 2004, 2005 University of Illinois at Urbana-Champaign.
All rights reserved.
Developed by:
@@ -61,41 +61,12 @@ licenses, and/or restrictions:
Program Directory
------- ---------
System Library llvm/lib/System
Compiler Driver llvm/tools/llvmc
PowerPC Backend llvm/lib/Target/PowerPC
Autoconf: llvm/autoconf
bzip2 llvm/lib/Support/bzip2/LICENSE
Autoconf llvm/autoconf
llvm/projects/ModuleMaker/autoconf
llvm/projects/sample/autoconf
Burg: llvm/utils/Burg
llvm/test/Programs/MultiSource/Applications/Burg
Aha: llvm/test/Programs/MultiSource/Applications/aha
SGEFA: llvm/test/Programs/MultiSource/Applications/sgefa
SIOD: llvm/test/Programs/MultiSource/Applications/siod
Spiff: llvm/test/Programs/MultiSource/Applications/spiff
D: llvm/test/Programs/MultiSource/Applications/d
Lambda: llvm/test/Programs/MultiSource/Applications/lambda-0.1.3
hbd: llvm/test/Programs/MultiSource/Applications/hbd
treecc: llvm/test/Programs/MultiSource/Applications/treecc
kimwitu++: llvm/test/Programs/MultiSource/Applications/kimwitu++
obsequi: llvm/test/Programs/MultiSource/Applications/obsequi
Fhourstones: llvm/test/Programs/MultiSource/Benchmarks/Fhourstones
McCat: llvm/test/Programs/MultiSource/Benchmarks/McCat
Olden: llvm/test/Programs/MultiSource/Benchmarks/Olden
OptimizerEval: llvm/test/Programs/MultiSource/Benchmarks/OptimizerEval
Ptrdist: llvm/test/Programs/MultiSource/Benchmarks/Ptrdist
LLUBenchmark: llvm/test/Programs/MultiSource/Benchmarks/llubenchmark
SIM: llvm/test/Programs/MultiSource/Benchmarks/sim
cfrac: llvm/test/Programs/MultiSource/Benchmarks/MallocBench/cfrac
espresso: llvm/test/Programs/MultiSource/Benchmarks/MallocBench/espresso
gs: llvm/test/Programs/MultiSource/Benchmarks/MallocBench/gs
p2c: llvm/test/Programs/MultiSource/Benchmarks/MallocBench/p2c
gawk: llvm/test/Programs/MultiSource/Benchmarks/MallocBench/gawk
make: llvm/test/Programs/MultiSource/Benchmarks/MallocBench/make
perl: llvm/test/Programs/MultiSource/Benchmarks/MallocBench/perl
Dhrystone: llvm/test/Programs/SingleSource/Benchmarks/Dhrystone
SingleSource Tests: llvm/test/Programs/SingleSource/Benchmarks/Misc
llvm/test/Programs/SingleSource/CustomChecked
llvm/test/Programs/SingleSource/Gizmos
GNU Libc: llvm/runtime/GCCLibraries/libc
Zlib Library: llvm/runtime/zlib
PNG Library: llvm/runtime/libpng
Burg llvm/utils/Burg
GNU Libc llvm/runtime/GCCLibraries/libc

View File

@@ -7,46 +7,38 @@
#
#===------------------------------------------------------------------------===#
LEVEL = .
DIRS = lib/Support utils lib tools
DIRS = lib/System lib/Support utils lib tools
ifneq ($(MAKECMDGOALS),tools-only)
DIRS += runtime
OPTIONAL_DIRS = projects
DIRS += runtime docs
OPTIONAL_DIRS = examples projects
endif
EXTRA_DIST := test llvm.spec include
include $(LEVEL)/Makefile.common
test :: all
cd test; $(MAKE)
.PHONY: debug-opt-prof
debug-opt-prof:
$(Echo) Building Debug Version
$(Verb) $(MAKE)
$(Echo)
$(Echo) Building Optimized Version
$(Echo)
$(Verb) $(MAKE) ENABLE_OPTIMIZED=1
$(Echo)
$(Echo) Building Profiling Version
$(Echo)
$(Verb) $(MAKE) ENABLE_PROFILING=1
distclean:: clean
$(VERB) $(RM) -rf $(LEVEL)/Makefile.config \
$(LEVEL)/include/Config/config.h \
$(LEVEL)/autoconf/autom4te.cache \
$(LEVEL)/config.log \
$(LEVEL)/TAGS
dist-hook::
$(Echo) Eliminating files constructed by configure
$(Verb) $(RM) -f \
$(TopDistDir)/include/llvm/ADT/hash_map \
$(TopDistDir)/include/llvm/ADT/hash_set \
$(TopDistDir)/include/llvm/ADT/iterator \
$(TopDistDir)/include/llvm/Config/config.h \
$(TopDistDir)/include/llvm/Support/DataTypes.h \
$(TopDistDir)/include/llvm/Support/ThreadSupport.h
tools-only: all
# Install support for llvm include files:
.PHONY: install-includes
install-includes:
$(MKDIR) $(DESTDIR)$(includedir)/llvm
cd include && find * -path '*/Internal' -prune -o '(' '!' '(' -name '*~' -o -name .cvsignore ')' -print ')' | grep -v CVS | pax -rwdvpe $(DESTDIR)$(includedir)/llvm
ifneq ($(BUILD_SRC_ROOT),$(BUILD_OBJ_ROOT))
cd $(BUILD_SRC_ROOT)/include && find * -path '*/Internal' -prune -o '(' '!' '(' -name '*~' -o -name .cvsignore ')' -print ')' | grep -v CVS | pax -rwdvpe $(DESTDIR)$(includedir)/llvm
endif
install:: install-includes
# Build tags database for Emacs/Xemacs:
.PHONY: tags
TAGS: tags
all::
tags:
find $(wildcard $(SourceDir)/include $(SourceDir)/lib $(SourceDir)/tools) -name '*.cpp' -o -name '*.h' | $(ETAGS) $(ETAGSFLAGS) -

View File

@@ -16,7 +16,7 @@
# The variable $(LEVEL) *must* be set:
#
# 1. LEVEL - The level of the current subdirectory from the top of the
# MagicStats view. This level should be expressed as a path, for
# source directory. This level should be expressed as a path, for
# example, ../.. for two levels deep.
#
# 2. DIRS - A list of subdirectories to be built. Fake targets are set up
@@ -39,25 +39,29 @@
#
# 6. LLVM_SRC_ROOT - If specified, points to the top of the LLVM source tree.
#
# 8. BUILD_SRC_DIR - The directory which contains the current set of Makefiles
# 8. PROJ_SRC_DIR - The directory which contains the current set of Makefiles
# and usually the source code too (unless SourceDir is set).
#
# 9. BUILD_SRC_ROOT - The root directory of the source code being compiled.
# 9. PROJ_SRC_ROOT - The root directory of the source code being compiled.
#
# 10. BUILD_OBJ_DIR - The directory where object code should be placed.
# 10. PROJ_OBJ_DIR - The directory where object code should be placed.
#
# 11. BUILD_OBJ_ROOT - The root directory for where object code should be
# 11. PROJ_OBJ_ROOT - The root directory for where object code should be
# placed.
#
# For building,
# LLVM, LLVM_SRC_ROOT = BUILD_SRC_ROOT
# LLVM, LLVM_SRC_ROOT = PROJ_SRC_ROOT
#
#===-----------------------------------------------------------------------====
#
# Configuration file to set paths specific to local installation of LLVM
#
ifndef LLVM_OBJ_ROOT
include $(LEVEL)/Makefile.config
else
include $(LLVM_OBJ_ROOT)/Makefile.config
endif
#
# Include all of the build rules used for making LLVM

View File

@@ -12,12 +12,97 @@
#
#===------------------------------------------------------------------------===#
# Define LLVM specific info and directories based on the autoconf variables
LLVMPackageName := @PACKAGE_NAME@
LLVMVersion := @PACKAGE_VERSION@
LLVM_CONFIGTIME := @LLVM_CONFIGTIME@
###########################################################################
# Directory Configuration
# This section of the Makefile determines what is where. To be
# specific, there are several locations that need to be defined:
#
# o LLVM_SRC_ROOT : The root directory of the LLVM source code.
# o LLVM_OBJ_ROOT : The root directory containing the built LLVM code.
#
# o PROJ_SRC_DIR : The directory containing the code to build.
# o PROJ_SRC_ROOT : The root directory of the code to build.
#
# o PROJ_OBJ_DIR : The directory in which compiled code will be placed.
# o PROJ_OBJ_ROOT : The root directory in which compiled code is placed.
#
###########################################################################
# Set the project name to LLVM if its not defined
ifndef PROJECT_NAME
PROJECT_NAME := LLVM
endif
PROJ_OBJ_DIR := $(shell pwd)
PROJ_OBJ_ROOT := $(subst //,/,$(shell cd $(PROJ_OBJ_DIR)/$(LEVEL); pwd))
ifeq ($(PROJECT_NAME),LLVM)
LLVM_SRC_ROOT := @abs_top_srcdir@
LLVM_OBJ_ROOT := @abs_top_builddir@
PROJ_SRC_ROOT := $(LLVM_SRC_ROOT)
PROJ_SRC_DIR := $(subst //,/,$(LLVM_SRC_ROOT)/$(patsubst $(PROJ_OBJ_ROOT)%,%,$(PROJ_OBJ_DIR)))
PROJ_prefix := @prefix@
PROJ_bindir := @prefix@/bin
PROJ_libdir := @prefix@/lib
PROJ_datadir := @prefix@/share
PROJ_docsdir := @prefix@/docs/llvm
PROJ_etcdir := @prefix@/etc/llvm
PROJ_includedir := @prefix@/include
PROJ_infodir := @prefix@/info
PROJ_mandir := @prefix@/man
PROJ_VERSION := $(LLVMVersion)
else
ifndef PROJ_SRC_ROOT
$(error Projects must define PROJ_SRC_ROOT)
endif
ifndef PROJ_OBJ_ROOT
$(error Projects must define PROJ_OBJ_ROOT)
endif
ifndef PROJ_INSTALL_ROOT
$(error Projects must define PROJ_INSTALL_ROOT)
endif
ifndef LLVM_SRC_ROOT
$(error Projects must define LLVM_SRC_ROOT)
endif
ifndef LLVM_OBJ_ROOT
$(error Projects must define LLVM_OBJ_ROOT)
endif
PROJ_SRC_DIR := $(subst //,/,$(PROJ_SRC_ROOT)/$(patsubst $(PROJ_OBJ_ROOT)%,%,$(PROJ_OBJ_DIR)))
PROJ_prefix := $(PROJ_INSTALL_ROOT)
PROJ_bindir := $(PROJ_INSTALL_ROOT)/bin
PROJ_libdir := $(PROJ_INSTALL_ROOT)/lib
PROJ_datadir := $(PROJ_INSTALL_ROOT)/share
PROJ_docsdir := $(PROJ_INSTALL_ROOT)/docs/llvm
PROJ_etcdir := $(PROJ_INSTALL_ROOT)/etc/llvm
PROJ_includedir := $(PROJ_INSTALL_ROOT)/include
PROJ_infodir := $(PROJ_INSTALL_ROOT)/info
PROJ_mandir := $(PROJ_INSTALL_ROOT)/man
ifndef PROJ_VERSION
PROJ_VERSION := 1.0
endif
endif
# Determine if we're on a unix type operating system
LLVM_ON_UNIX:=@LLVM_ON_UNIX@
LLVM_ON_WIN32:=@LLVM_ON_WIN32@
# Target operating system for which LLVM will be compiled.
OS=@OS@
# Target hardware architecture
ARCH=@ARCH@
# Target triple (cpu-vendor-os) for which we should generate code
TARGET_TRIPLE=@target@
# Targets that we should build
TARGETS_TO_BUILD=@TARGETS_TO_BUILD@
# Endian-ness of the target
ENDIAN=@ENDIAN@
@@ -28,83 +113,62 @@ CXX = @CXX@
# Path to the CC binary, which use used by testcases for native builds.
CC := @CC@
# Path to the Python interpreter
PYTHON := @PYTHON@
# Linker flags.
LDFLAGS+=@LDFLAGS@
# Libraries needed by tools
TOOLLINKOPTS=@LIBS@
# Path to the library archiver program.
AR_PATH = @AR@
# The pathnames of the Flex and Bison programs, respectively.
YACC = @YACC@
BISON = @BISON@
FLEX = @LEX@
# The pathnames of the programs we require to build
BISON := @BISON@
CMP := @CMP@
CP := @CP@
DATE := @DATE@
FIND := @FIND@
FLEX := @LEX@
GREP := @GREP@
INSTALL := @INSTALL@
MKDIR := $(LLVM_SRC_ROOT)/autoconf/mkinstalldirs
MV := @MV@
RANLIB := @RANLIB@
RM := @RM@
SED := @SED@
TAR := @TAR@
YACC := @YACC@
# Paths to miscellaneous programs.
RPWD = pwd
SED = sed
RM = rm
ECHO = echo
MKDIR = @abs_top_srcdir@/autoconf/mkinstalldirs
DATE = date
MV = mv
INSTALL = @INSTALL@
DOT = @DOT@
ETAGS = @ETAGS@
ETAGSFLAGS = @ETAGSFLAGS@
# Paths to miscellaneous programs we hope are present but might not be
BZIP2 := @BZIP2@
DOT := @DOT@
DOXYGEN := @DOXYGEN@
ETAGS := @ETAGS@
ETAGSFLAGS := @ETAGSFLAGS@
GROFF := @GROFF@
GZIP := @GZIP@
POD2HTML := @POD2HTML@
POD2MAN := @POD2MAN@
RUNTEST := @RUNTEST@
TCLSH := @TCLSH@
ZIP := @ZIP@
# Determine the target for which LLVM should generate code.
LLVMGCCARCH := @target@/3.4-llvm
# Full pathnames of LLVM C/C++ front-end 'cc1' and 'cc1plus' binaries:
LCC1 = @LLVMCC1@
LCC1XX = @LLVMCC1PLUS@
# Path to directory where object files should be stored during a build.
# Set OBJ_ROOT to "." if you do not want to use a separate place for
# object files.
OBJ_ROOT := .
LIBS := @LIBS@
# Path to location for LLVM C/C++ front-end. You can modify this if you
# want to override the value set by configure.
LLVMGCCDIR := @LLVMGCCDIR@
# When this variable is set to 1, programs in the llvm/test/Programs hierarchy
# are not recompiled from source code. Instead, the bytecode for the file is
# pulled from the BYTECODE_REPOSITORY directory. This can be useful when disk
# space is limited or when you just don't want to spend time running the C
# frontend.
#USE_PRECOMPILED_BYTECODE := 1
@UPB@
# Determine the target for which LLVM should generate code.
LLVMGCCARCH := @target@/3.4-llvm
# This path specifies the cannonical location of bytecode files for compiled
# versions of the test/Programs/* programs. This is used as the bytecode source
# when USE_PRECOMPILED_BYTECODE is specified or when source code is not
# available for the program (such as SPEC).
BYTECODE_REPOSITORY := @BCR@
# Full pathnames of LLVM C/C++ front-end 'cc1' and 'cc1plus' binaries:
LLVMGCC := @LLVMGCC@
LLVMGXX := @LLVMGXX@
LLVMCC1 := @LLVMCC1@
LLVMCC1PLUS := @LLVMCC1PLUS@
# SPEC benchmarks:
# If these are set then run the SPEC benchmarks.
# You must provide the SPEC benchmarks on your own.
@USE_SPEC2000@
@USE_SPEC95@
# Path to the SPEC benchmarks.
SPEC2000_ROOT := @SPEC2000_ROOT@
SPEC95_ROOT := @SPEC95_ROOT@
# Path to the Povray source code.
@USE_POVRAY@
POVRAY_ROOT := @POVRAY_ROOT@
# Path to the PAPI code. This is used by the reoptimizer only.
#PAPIDIR := /home/vadve/shared/papi-2.3.4.1
PAPIDIR := @PAPIDIR@
# Path to directory where object files should be stored during a build.
# Set OBJ_ROOT to "." if you do not want to use a separate place for
# object files.
OBJ_ROOT := .
# These are options that can either be enabled here, or can be enabled on the
# make command line (ie, make ENABLE_PROFILING=1):
@@ -118,6 +182,9 @@ PAPIDIR := @PAPIDIR@
# information to allow gprof to be used to get execution frequencies.
#ENABLE_PROFILING = 1
# When ENABLE_DOXYGEN is enabled, the doxygen documentation will be built
ENABLE_DOXYGEN = @ENABLE_DOXYGEN@
# This option tells the Makefiles to produce verbose output.
# It essentially prints the commands that make is executing
#VERBOSE = 1
@@ -125,88 +192,11 @@ PAPIDIR := @PAPIDIR@
# Enable JIT for this platform
@JIT@
# Disable LLC diffs for testing.
@DISABLE_LLC_DIFFS@
# Shared library extension for this platform.
SHLIBEXT = @SHLIBEXT@
# Executable file extension for this platform.
EXEEXT = @EXEEXT@
###########################################################################
# Directory Configuration
# This section of the Makefile determines what is where. To be
# specific, there are several locations that need to be defined:
#
# o LLVM_SRC_ROOT : The root directory of the LLVM source code.
# o LLVM_OBJ_ROOT : The root directory containing the built LLVM code.
#
# o BUILD_SRC_DIR : The directory containing the code to build.
# o BUILD_SRC_ROOT : The root directory of the code to build.
#
# o BUILD_OBJ_DIR : The directory in which compiled code will be placed.
# o BUILD_OBJ_ROOT : The root directory in which compiled code is placed.
#
###########################################################################
# Set the object build directory. By default, it is the current directory.
ifndef BUILD_OBJ_DIR
BUILD_OBJ_DIR := $(subst //,/,$(shell $(RPWD)))
endif
# Set the root of the object directory.
ifndef BUILD_OBJ_ROOT
BUILD_OBJ_ROOT := $(subst //,/,$(shell cd $(BUILD_OBJ_DIR)/$(LEVEL); $(RPWD)))
endif
# Set the source build directory. That is almost always the current directory.
ifndef BUILD_SRC_DIR
BUILD_SRC_DIR := $(subst //,/,@abs_top_srcdir@/$(patsubst $(BUILD_OBJ_ROOT)%,%,$(BUILD_OBJ_DIR)))
endif
# Set the source root directory.
ifndef BUILD_SRC_ROOT
BUILD_SRC_ROOT := $(subst //,/,@abs_top_srcdir@)
endif
# Set the LLVM object directory.
ifndef LLVM_OBJ_ROOT
ifdef LLVM_SRC_ROOT
LLVM_OBJ_ROOT := $(shell cd $(LLVM_SRC_ROOT); $(RPWD))
else
LLVM_OBJ_ROOT := $(BUILD_OBJ_ROOT)
endif
endif
# Set the LLVM source directory.
# It is typically the root directory of what we're compiling now.
ifndef LLVM_SRC_ROOT
LLVM_SRC_ROOT := $(BUILD_SRC_ROOT)
endif
# Set SourceDir for backwards compatbility.
ifndef SourceDir
SourceDir=$(BUILD_SRC_DIR)
endif
# Installation directories, as provided by the configure script.
exec_prefix = @exec_prefix@
prefix = @prefix@
program_transform_name = @program_transform_name@
bindir = @bindir@
sbindir = @sbindir@
libexecdir = @libexecdir@
datadir = @datadir@
sysconfdir = @sysconfdir@
sharedstatedir = @sharedstatedir@
localstatedir = @localstatedir@
libdir = @libdir@
bytecode_libdir = $(LLVMGCCDIR)/bytecode-libs
includedir = @includedir@
infodir = @infodir@
mandir = @mandir@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_DATA = @INSTALL_DATA@
# Things we just assume are "there"
ECHO := echo

File diff suppressed because it is too large Load Diff

View File

@@ -1 +1,12 @@
This file is a placeholder; see docs/index.html for documentation.
Low Level Virtual Machine (LLVM)
================================
This directory and its subdirectories contain source code for the Low Level
Virtual Machine, a toolkit for the construction of highly optimized compilers,
optimizers, and runtime environments.
LLVM is open source software. You may freely distribute it under the terms of
the license agreement found in LICENSE.txt.
Please see the HTML documentation provided in docs/index.html for further
assistance with LLVM.

2
llvm/autoconf/.cvsignore Normal file
View File

@@ -0,0 +1,2 @@
aclocal.m4
autom4te.cache

View File

@@ -3,19 +3,41 @@ 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"
outfile=configure
configfile=configure.ac
test -d autoconf && test -f autoconf/$configfile && cd autoconf
test -f $configfile || die "Can't find 'autoconf' dir; please cd into it first"
autoconf --version | egrep '2\.59' > /dev/null
if test $? -ne 0 ; then
die "Your autoconf was not detected as being 2.59"
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"
aclocal --version | egrep '1\.9\.2' > /dev/null
if test $? -ne 0 ; then
die "Your aclocal was not detected as being 1.9.2"
fi
autoheader --version | egrep '2\.59' > /dev/null
if test $? -ne 0 ; then
die "Your autoheader was not detected as being 2.59"
fi
libtool --version | grep '1\.5\.10' > /dev/null
if test $? -ne 0 ; then
die "Your libtool was not detected as being 1.5.10"
fi
echo ""
echo "### NOTE: ############################################################"
echo "### If you get *any* warnings from autoconf below you MUST fix the"
echo "### scripts in the m4 directory because there are future forward"
echo "### compatibility or platform support issues at risk. Please do NOT"
echo "### commit any configure script that was generated with warnings"
echo "### present. You should get just three 'Regenerating..' lines."
echo "######################################################################"
echo ""
echo "Regenerating aclocal.m4 with aclocal 1.9.2"
cwd=`pwd`
aclocal --force -I $cwd/m4 || die "aclocal failed"
echo "Regenerating configure with autoconf 2.59"
autoconf --force --warnings=all -o ../$outfile $configfile || die "autoconf failed"
cd ..
echo "Regenerating config.h.in with autoheader 2.5x"
autoheader -I autoconf autoconf/configure.ac || die "autoheader failed"
echo "Regenerating config.h.in with autoheader 2.59"
autoheader --warnings=all -I autoconf -I autoconf/m4 autoconf/$configfile || die "autoheader failed"
exit 0

40
llvm/autoconf/README.TXT Normal file
View File

@@ -0,0 +1,40 @@
Upgrading Libtool
===============================================================================
If you are in the mood to upgrade libtool, you must do the following:
1. Get the new version of libtool and put it in <SRC>
2. configure/build/install libtool with --prefix=<PFX>
3. Copy <SRC>/ltdl.m4 to llvm/autoconf/m4
4. Copy <PFX>/share/aclocal/libtool.m4 to llvm/autoconf/m4/libtool.m4
5. Copy <PFX>/share/libtool/ltmain.sh to llvm/autoconf/ltmain.sh
6. Run sed -e 's/output.exp/outputname.exp/g' on ltmain.sh
7. Copy <PFX>/share/libtool/libltdl/ltdl.c to llvm/lib/System
8. Copy <PFX>/share/libtool/libltdl/ltdl.h to llvm/lib/System
9. Adjust the llvm/autoconf/m4/libtool.m4 file to ensure that the variable
default_ofile is set to "mklib" instead of "libtool"
10. Run "autoupdate libtool.m4 ltdl.m4" in the llvm/autoconf/m4 directory.
This should correctly update the macro definitions in the libtool m4
files to match the version of autoconf that LLVM uses. This converts
AC_HELP_STRING to AS_HELP_STRING and AC_TRY_LINK to AC_LINK_IFELSE, amongst
other things. You may need to manually adjust the files.
11. Run AutoRegen.sh to get the new macros into configure script
12. If there are any warnings from configure, go to step 9.
13. Rebuild LLVM, making sure it reconfigured
14. Test the JIT which uses libltdl
15. If it all works, only THEN commit the changes.
Upgrading autoconf
===============================================================================
If you are in the mood to upgrade autoconf, you should:
1. Consider not upgrading.
2. No really, this is a hassle, you don't want to do it.
3. Get the new version of autoconf and put it in <SRC>
4. configure/build/install autoconf with --prefix=<PFX>
5. Run autoupdate on all the m4 macros in llvm/autoconf/m4
6. Run autoupdate on llvm/autoconf/configure.ac
7. Regenerate configure script with AutoRegen.sh
8. If there are any warnings from autoconf, fix them and go to step 7.
9. Test, test, test.

View File

@@ -1,9 +1,9 @@
#! /bin/sh
# Attempt to guess a canonical system name.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
# 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
# 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
timestamp='2003-02-22'
timestamp='2004-09-07'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@@ -53,7 +53,7 @@ version="\
GNU config.guess ($timestamp)
Originally written by Per Bothner.
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
@@ -106,6 +106,7 @@ trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
: ${TMPDIR=/tmp} ;
{ tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
{ test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
{ tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
{ echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
dummy=$tmp/dummy ;
tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
@@ -196,15 +197,21 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
echo "${machine}-${os}${release}"
exit 0 ;;
amd64:OpenBSD:*:*)
echo x86_64-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
amiga:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
arc:OpenBSD:*:*)
echo mipsel-unknown-openbsd${UNAME_RELEASE}
cats:OpenBSD:*:*)
echo arm-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
hp300:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
luna88k:OpenBSD:*:*)
echo m88k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
mac68k:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
@@ -220,25 +227,33 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
mvmeppc:OpenBSD:*:*)
echo powerpc-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
pmax:OpenBSD:*:*)
echo mipsel-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
sgi:OpenBSD:*:*)
echo mipseb-unknown-openbsd${UNAME_RELEASE}
echo mips64-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
sun3:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
wgrisc:OpenBSD:*:*)
echo mipsel-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
*:OpenBSD:*:*)
echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
*:ekkoBSD:*:*)
echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
exit 0 ;;
macppc:MirBSD:*:*)
echo powerppc-unknown-mirbsd${UNAME_RELEASE}
exit 0 ;;
*:MirBSD:*:*)
echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
exit 0 ;;
alpha:OSF1:*:*)
if test $UNAME_RELEASE = "V4.0"; then
case $UNAME_RELEASE in
*4.0)
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
fi
;;
*5.*)
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
;;
esac
# According to Compaq, /usr/sbin/psrinfo has been available on
# OSF/1 and Tru64 systems produced since 1995. I hope that
# covers most systems running today. This code pipes the CPU
@@ -276,11 +291,12 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
"EV7.9 (21364A)")
UNAME_MACHINE="alphaev79" ;;
esac
# A Pn.n version is a patched version.
# A Vn.n version is a released version.
# A Tn.n version is a released field test version.
# A Xn.n version is an unreleased experimental baselevel.
# 1.2 uses "1.2" for uname -r.
echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
exit 0 ;;
Alpha\ *:Windows_NT*:*)
# How do we know it's Interix rather than the generic POSIX subsystem?
@@ -303,6 +319,9 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
*:OS/390:*:*)
echo i370-ibm-openedition
exit 0 ;;
*:OS400:*:*)
echo powerpc-ibm-os400
exit 0 ;;
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
echo arm-acorn-riscix${UNAME_RELEASE}
exit 0;;
@@ -320,6 +339,9 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
NILE*:*:*:dcosx)
echo pyramid-pyramid-svr4
exit 0 ;;
DRS?6000:unix:4.0:6*)
echo sparc-icl-nx6
exit 0 ;;
DRS?6000:UNIX_SV:4.2*:7*)
case `/usr/bin/uname -p` in
sparc) echo sparc-icl-nx7 && exit 0 ;;
@@ -392,6 +414,9 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
*:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
echo m68k-unknown-mint${UNAME_RELEASE}
exit 0 ;;
m68k:machten:*:*)
echo m68k-apple-machten${UNAME_RELEASE}
exit 0 ;;
powerpc:machten:*:*)
echo powerpc-apple-machten${UNAME_RELEASE}
exit 0 ;;
@@ -727,7 +752,7 @@ EOF
echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit 0 ;;
*:UNICOS/mp:*:*)
echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit 0 ;;
F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
@@ -735,6 +760,11 @@ EOF
FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
exit 0 ;;
5000:UNIX_System_V:4.*:*)
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
exit 0 ;;
i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
exit 0 ;;
@@ -745,18 +775,7 @@ EOF
echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
exit 0 ;;
*:FreeBSD:*:*)
# Determine whether the default compiler uses glibc.
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#include <features.h>
#if __GLIBC__ >= 2
LIBC=gnu
#else
LIBC=
#endif
EOF
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC}
echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
exit 0 ;;
i*:CYGWIN*:*)
echo ${UNAME_MACHINE}-pc-cygwin
@@ -767,8 +786,8 @@ EOF
i*:PW*:*)
echo ${UNAME_MACHINE}-pc-pw32
exit 0 ;;
x86:Interix*:3*)
echo i586-pc-interix3
x86:Interix*:[34]*)
echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//'
exit 0 ;;
[345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
echo i${UNAME_MACHINE}-pc-mks
@@ -789,17 +808,34 @@ EOF
echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit 0 ;;
*:GNU:*:*)
# the GNU system
echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
exit 0 ;;
*:GNU/*:*:*)
# other systems with GNU libc and userland
echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
exit 0 ;;
i*86:Minix:*:*)
echo ${UNAME_MACHINE}-pc-minix
exit 0 ;;
arm*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit 0 ;;
cris:Linux:*:*)
echo cris-axis-linux-gnu
exit 0 ;;
crisv32:Linux:*:*)
echo crisv32-axis-linux-gnu
exit 0 ;;
frv:Linux:*:*)
echo frv-unknown-linux-gnu
exit 0 ;;
ia64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit 0 ;;
m32r*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit 0 ;;
m68*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit 0 ;;
@@ -875,6 +911,9 @@ EOF
s390:Linux:*:* | s390x:Linux:*:*)
echo ${UNAME_MACHINE}-ibm-linux
exit 0 ;;
sh64*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit 0 ;;
sh*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit 0 ;;
@@ -932,6 +971,9 @@ EOF
LIBC=gnuaout
#endif
#endif
#ifdef __dietlibc__
LIBC=dietlibc
#endif
EOF
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0
@@ -962,6 +1004,9 @@ EOF
i*86:atheos:*:*)
echo ${UNAME_MACHINE}-unknown-atheos
exit 0 ;;
i*86:syllable:*:*)
echo ${UNAME_MACHINE}-pc-syllable
exit 0 ;;
i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
echo i386-unknown-lynxos${UNAME_RELEASE}
exit 0 ;;
@@ -1031,9 +1076,9 @@ EOF
M680?0:D-NIX:5.3:*)
echo m68k-diab-dnix
exit 0 ;;
M68*:*:R3V[567]*:*)
M68*:*:R3V[5678]*:*)
test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0)
3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
OS_REL=''
test -r /etc/.relid \
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
@@ -1131,9 +1176,10 @@ EOF
echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
exit 0 ;;
*:Darwin:*:*)
case `uname -p` in
UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
case $UNAME_PROCESSOR in
*86) UNAME_PROCESSOR=i686 ;;
powerpc) UNAME_PROCESSOR=powerpc ;;
unknown) UNAME_PROCESSOR=powerpc ;;
esac
echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
exit 0 ;;
@@ -1148,7 +1194,7 @@ EOF
*:QNX:*:4*)
echo i386-pc-qnx
exit 0 ;;
NSR-[DGKLNPTVW]:NONSTOP_KERNEL:*:*)
NSR-?:NONSTOP_KERNEL:*:*)
echo nsr-tandem-nsk${UNAME_RELEASE}
exit 0 ;;
*:NonStop-UX:*:*)
@@ -1189,6 +1235,19 @@ EOF
*:ITS:*:*)
echo pdp10-unknown-its
exit 0 ;;
SEI:*:*:SEIUX)
echo mips-sei-seiux${UNAME_RELEASE}
exit 0 ;;
*:DragonFly:*:*)
echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
exit 0 ;;
*:*VMS:*:*)
UNAME_MACHINE=`(uname -p) 2>/dev/null`
case "${UNAME_MACHINE}" in
A*) echo alpha-dec-vms && exit 0 ;;
I*) echo ia64-dec-vms && exit 0 ;;
V*) echo vax-dec-vms && exit 0 ;;
esac
esac
#echo '(No uname command or uname output not recognized.)' 1>&2

View File

@@ -1,9 +1,9 @@
#! /bin/sh
# Configuration validation subroutine script.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
# 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
# 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
timestamp='2003-02-22'
timestamp='2004-08-29'
# This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software
@@ -70,7 +70,7 @@ Report bugs and patches to <config-patches@gnu.org>."
version="\
GNU config.sub ($timestamp)
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
@@ -118,7 +118,8 @@ esac
# Here we must recognize all the valid KERNEL-OS combinations.
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
case $maybe_os in
nto-qnx* | linux-gnu* | freebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \
kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
os=-$maybe_os
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
;;
@@ -144,7 +145,7 @@ case $os in
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
-apple | -axis)
-apple | -axis | -knuth | -cray)
os=
basic_machine=$1
;;
@@ -228,14 +229,15 @@ case $basic_machine in
| a29k \
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
| am33_2.0 \
| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
| clipper \
| c4x | clipper \
| d10v | d30v | dlx | dsp16xx \
| fr30 | frv \
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
| i370 | i860 | i960 | ia64 \
| ip2k \
| m32r | m68000 | m68k | m88k | mcore \
| ip2k | iq2000 \
| m32r | m32rle | m68000 | m68k | m88k | mcore \
| mips | mipsbe | mipseb | mipsel | mipsle \
| mips16 \
| mips64 | mips64el \
@@ -247,6 +249,7 @@ case $basic_machine in
| mipsisa32 | mipsisa32el \
| mipsisa32r2 | mipsisa32r2el \
| mipsisa64 | mipsisa64el \
| mipsisa64r2 | mipsisa64r2el \
| mipsisa64sb1 | mipsisa64sb1el \
| mipsisa64sr71k | mipsisa64sr71kel \
| mipstx39 | mipstx39el \
@@ -259,9 +262,9 @@ case $basic_machine in
| pyramid \
| sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
| sh64 | sh64le \
| sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \
| sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv8 | sparcv9 | sparcv9b \
| strongarm \
| tahoe | thumb | tic80 | tron \
| tahoe | thumb | tic4x | tic80 | tron \
| v850 | v850e \
| we32k \
| x86 | xscale | xstormy16 | xtensa \
@@ -297,15 +300,15 @@ case $basic_machine in
| avr-* \
| bs2000-* \
| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
| clipper-* | cydra-* \
| clipper-* | craynv-* | cydra-* \
| d10v-* | d30v-* | dlx-* \
| elxsi-* \
| f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
| h8300-* | h8500-* \
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
| i*86-* | i860-* | i960-* | ia64-* \
| ip2k-* \
| m32r-* \
| ip2k-* | iq2000-* \
| m32r-* | m32rle-* \
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
| m88110-* | m88k-* | mcore-* \
| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
@@ -319,11 +322,13 @@ case $basic_machine in
| mipsisa32-* | mipsisa32el-* \
| mipsisa32r2-* | mipsisa32r2el-* \
| mipsisa64-* | mipsisa64el-* \
| mipsisa64r2-* | mipsisa64r2el-* \
| mipsisa64sb1-* | mipsisa64sb1el-* \
| mipsisa64sr71k-* | mipsisa64sr71kel-* \
| mipstx39-* | mipstx39el-* \
| mmix-* \
| msp430-* \
| none-* | np1-* | nv1-* | ns16k-* | ns32k-* \
| none-* | np1-* | ns16k-* | ns32k-* \
| orion-* \
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
@@ -332,7 +337,7 @@ case $basic_machine in
| sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
| sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \
| sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
| sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
| tahoe-* | thumb-* \
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
| tron-* \
@@ -359,6 +364,9 @@ case $basic_machine in
basic_machine=a29k-amd
os=-udi
;;
abacus)
basic_machine=abacus-unknown
;;
adobe68k)
basic_machine=m68010-adobe
os=-scout
@@ -373,6 +381,12 @@ case $basic_machine in
basic_machine=a29k-none
os=-bsd
;;
amd64)
basic_machine=x86_64-pc
;;
amd64-*)
basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
amdahl)
basic_machine=580-amdahl
os=-sysv
@@ -432,12 +446,27 @@ case $basic_machine in
basic_machine=j90-cray
os=-unicos
;;
craynv)
basic_machine=craynv-cray
os=-unicosmp
;;
cr16c)
basic_machine=cr16c-unknown
os=-elf
;;
crds | unos)
basic_machine=m68k-crds
;;
crisv32 | crisv32-* | etraxfs*)
basic_machine=crisv32-axis
;;
cris | cris-* | etrax*)
basic_machine=cris-axis
;;
crx)
basic_machine=crx-unknown
os=-elf
;;
da30 | da30-*)
basic_machine=m68k-da30
;;
@@ -638,10 +667,6 @@ case $basic_machine in
mips3*)
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
;;
mmix*)
basic_machine=mmix-knuth
os=-mmixware
;;
monitor)
basic_machine=m68k-rom68k
os=-coff
@@ -722,10 +747,6 @@ case $basic_machine in
np1)
basic_machine=np1-gould
;;
nv1)
basic_machine=nv1-cray
os=-unicosmp
;;
nsr-tandem)
basic_machine=nsr-tandem
;;
@@ -737,6 +758,10 @@ case $basic_machine in
basic_machine=or32-unknown
os=-coff
;;
os400)
basic_machine=powerpc-ibm
os=-os400
;;
OSE68000 | ose68000)
basic_machine=m68000-ericsson
os=-ose
@@ -768,18 +793,24 @@ case $basic_machine in
pentiumpro | p6 | 6x86 | athlon | athlon_*)
basic_machine=i686-pc
;;
pentiumii | pentium2)
pentiumii | pentium2 | pentiumiii | pentium3)
basic_machine=i686-pc
;;
pentium4)
basic_machine=i786-pc
;;
pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pentiumpro-* | p6-* | 6x86-* | athlon-*)
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pentiumii-* | pentium2-*)
pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pentium4-*)
basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pn)
basic_machine=pn-gould
;;
@@ -838,6 +869,10 @@ case $basic_machine in
sb1el)
basic_machine=mipsisa64sb1el-unknown
;;
sei)
basic_machine=mips-sei
os=-seiux
;;
sequent)
basic_machine=i386-sequent
;;
@@ -845,6 +880,9 @@ case $basic_machine in
basic_machine=sh-hitachi
os=-hms
;;
sh64)
basic_machine=sh64-unknown
;;
sparclite-wrs | simso-wrs)
basic_machine=sparclite-wrs
os=-vxworks
@@ -919,10 +957,6 @@ case $basic_machine in
basic_machine=t90-cray
os=-unicos
;;
tic4x | c4x*)
basic_machine=tic4x-unknown
os=-coff
;;
tic54x | c54x*)
basic_machine=tic54x-unknown
os=-coff
@@ -948,6 +982,10 @@ case $basic_machine in
tower | tower-32)
basic_machine=m68k-ncr
;;
tpf)
basic_machine=s390x-ibm
os=-tpf
;;
udi29k)
basic_machine=a29k-amd
os=-udi
@@ -1021,6 +1059,9 @@ case $basic_machine in
romp)
basic_machine=romp-ibm
;;
mmix)
basic_machine=mmix-knuth
;;
rs6000)
basic_machine=rs6000-ibm
;;
@@ -1043,7 +1084,7 @@ case $basic_machine in
sh64)
basic_machine=sh64-unknown
;;
sparc | sparcv9 | sparcv9b)
sparc | sparcv8 | sparcv9 | sparcv9b)
basic_machine=sparc-sun
;;
cydra)
@@ -1116,19 +1157,20 @@ case $os in
| -aos* \
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
| -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
| -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
| -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \
| -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
| -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
| -chorusos* | -chorusrdb* \
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
| -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
| -mingw32* | -linux-gnu* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
| -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
| -powermax* | -dnix*)
| -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly*)
# Remember, each alternative MUST END IN *, to match a version number.
;;
-qnx*)
@@ -1152,6 +1194,9 @@ case $os in
-mac*)
os=`echo $os | sed -e 's|mac|macos|'`
;;
-linux-dietlibc)
os=-linux-dietlibc
;;
-linux*)
os=`echo $os | sed -e 's|linux|linux-gnu|'`
;;
@@ -1164,6 +1209,9 @@ case $os in
-opened*)
os=-openedition
;;
-os400*)
os=-os400
;;
-wince*)
os=-wince
;;
@@ -1185,6 +1233,9 @@ case $os in
-atheos*)
os=-atheos
;;
-syllable*)
os=-syllable
;;
-386bsd)
os=-bsd
;;
@@ -1207,6 +1258,9 @@ case $os in
-sinix*)
os=-sysv4
;;
-tpf*)
os=-tpf
;;
-triton*)
os=-sysv3
;;
@@ -1274,6 +1328,9 @@ case $basic_machine in
arm*-semi)
os=-aout
;;
c4x-* | tic4x-*)
os=-coff
;;
# This must come before the *-dec entry.
pdp10-*)
os=-tops20
@@ -1320,6 +1377,9 @@ case $basic_machine in
*-ibm)
os=-aix
;;
*-knuth)
os=-mmixware
;;
*-wec)
os=-proelf
;;
@@ -1452,9 +1512,15 @@ case $basic_machine in
-mvs* | -opened*)
vendor=ibm
;;
-os400*)
vendor=ibm
;;
-ptx*)
vendor=sequent
;;
-tpf*)
vendor=ibm
;;
-vxsim* | -vxworks* | -windiss*)
vendor=wrs
;;

File diff suppressed because it is too large Load Diff

522
llvm/autoconf/depcomp Executable file
View File

@@ -0,0 +1,522 @@
#! /bin/sh
# depcomp - compile a program generating dependencies as side-effects
scriptversion=2004-05-31.23
# Copyright (C) 1999, 2000, 2003, 2004 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
case $1 in
'')
echo "$0: No command. Try \`$0 --help' for more information." 1>&2
exit 1;
;;
-h | --h*)
cat <<\EOF
Usage: depcomp [--help] [--version] PROGRAM [ARGS]
Run PROGRAMS ARGS to compile a file, generating dependencies
as side-effects.
Environment variables:
depmode Dependency tracking mode.
source Source file read by `PROGRAMS ARGS'.
object Object file output by `PROGRAMS ARGS'.
DEPDIR directory where to store dependencies.
depfile Dependency file to output.
tmpdepfile Temporary file to use when outputing dependencies.
libtool Whether libtool is used (yes/no).
Report bugs to <bug-automake@gnu.org>.
EOF
exit 0
;;
-v | --v*)
echo "depcomp $scriptversion"
exit 0
;;
esac
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
echo "depcomp: Variables source, object and depmode must be set" 1>&2
exit 1
fi
# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
depfile=${depfile-`echo "$object" |
sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
rm -f "$tmpdepfile"
# Some modes work just like other modes, but use different flags. We
# parameterize here, but still list the modes in the big case below,
# to make depend.m4 easier to write. Note that we *cannot* use a case
# here, because this file can only contain one case statement.
if test "$depmode" = hp; then
# HP compiler uses -M and no extra arg.
gccflag=-M
depmode=gcc
fi
if test "$depmode" = dashXmstdout; then
# This is just like dashmstdout with a different argument.
dashmflag=-xM
depmode=dashmstdout
fi
case "$depmode" in
gcc3)
## gcc 3 implements dependency tracking that does exactly what
## we want. Yay! Note: for some reason libtool 1.4 doesn't like
## it if -MD -MP comes after the -MF stuff. Hmm.
"$@" -MT "$object" -MD -MP -MF "$tmpdepfile"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
mv "$tmpdepfile" "$depfile"
;;
gcc)
## There are various ways to get dependency output from gcc. Here's
## why we pick this rather obscure method:
## - Don't want to use -MD because we'd like the dependencies to end
## up in a subdir. Having to rename by hand is ugly.
## (We might end up doing this anyway to support other compilers.)
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
## -MM, not -M (despite what the docs say).
## - Using -M directly means running the compiler twice (even worse
## than renaming).
if test -z "$gccflag"; then
gccflag=-MD,
fi
"$@" -Wp,"$gccflag$tmpdepfile"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
echo "$object : \\" > "$depfile"
alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
## The second -e expression handles DOS-style file names with drive letters.
sed -e 's/^[^:]*: / /' \
-e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
## This next piece of magic avoids the `deleted header file' problem.
## The problem is that when a header file which appears in a .P file
## is deleted, the dependency causes make to die (because there is
## typically no way to rebuild the header). We avoid this by adding
## dummy dependencies for each header file. Too bad gcc doesn't do
## this for us directly.
tr ' ' '
' < "$tmpdepfile" |
## Some versions of gcc put a space before the `:'. On the theory
## that the space means something, we add a space to the output as
## well.
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
hp)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
sgi)
if test "$libtool" = yes; then
"$@" "-Wp,-MDupdate,$tmpdepfile"
else
"$@" -MDupdate "$tmpdepfile"
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
echo "$object : \\" > "$depfile"
# Clip off the initial element (the dependent). Don't try to be
# clever and replace this with sed code, as IRIX sed won't handle
# lines with more than a fixed number of characters (4096 in
# IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
# the IRIX cc adds comments like `#:fec' to the end of the
# dependency line.
tr ' ' '
' < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
tr '
' ' ' >> $depfile
echo >> $depfile
# The second pass generates a dummy entry for each header file.
tr ' ' '
' < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
>> $depfile
else
# The sourcefile does not contain any dependencies, so just
# store a dummy comment line, to avoid errors with the Makefile
# "include basename.Plo" scheme.
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
aix)
# The C for AIX Compiler uses -M and outputs the dependencies
# in a .u file. In older versions, this file always lives in the
# current directory. Also, the AIX compiler puts `$object:' at the
# start of each line; $object doesn't have directory information.
# Version 6 uses the directory in both cases.
stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'`
tmpdepfile="$stripped.u"
if test "$libtool" = yes; then
"$@" -Wc,-M
else
"$@" -M
fi
stat=$?
if test -f "$tmpdepfile"; then :
else
stripped=`echo "$stripped" | sed 's,^.*/,,'`
tmpdepfile="$stripped.u"
fi
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
if test -f "$tmpdepfile"; then
outname="$stripped.o"
# Each line is of the form `foo.o: dependent.h'.
# Do two passes, one to just change these to
# `$object: dependent.h' and one to simply `dependent.h:'.
sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
else
# The sourcefile does not contain any dependencies, so just
# store a dummy comment line, to avoid errors with the Makefile
# "include basename.Plo" scheme.
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
icc)
# Intel's C compiler understands `-MD -MF file'. However on
# icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
# ICC 7.0 will fill foo.d with something like
# foo.o: sub/foo.c
# foo.o: sub/foo.h
# which is wrong. We want:
# sub/foo.o: sub/foo.c
# sub/foo.o: sub/foo.h
# sub/foo.c:
# sub/foo.h:
# ICC 7.1 will output
# foo.o: sub/foo.c sub/foo.h
# and will wrap long lines using \ :
# foo.o: sub/foo.c ... \
# sub/foo.h ... \
# ...
"$@" -MD -MF "$tmpdepfile"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
# Each line is of the form `foo.o: dependent.h',
# or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
# Do two passes, one to just change these to
# `$object: dependent.h' and one to simply `dependent.h:'.
sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
# Some versions of the HPUX 10.20 sed can't process this invocation
# correctly. Breaking it into two sed invocations is a workaround.
sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
tru64)
# The Tru64 compiler uses -MD to generate dependencies as a side
# effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
# dependencies in `foo.d' instead, so we check for that too.
# Subdirectories are respected.
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
test "x$dir" = "x$object" && dir=
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
if test "$libtool" = yes; then
# Dependencies are output in .lo.d with libtool 1.4.
# With libtool 1.5 they are output both in $dir.libs/$base.o.d
# and in $dir.libs/$base.o.d and $dir$base.o.d. We process the
# latter, because the former will be cleaned when $dir.libs is
# erased.
tmpdepfile1="$dir.libs/$base.lo.d"
tmpdepfile2="$dir$base.o.d"
tmpdepfile3="$dir.libs/$base.d"
"$@" -Wc,-MD
else
tmpdepfile1="$dir$base.o.d"
tmpdepfile2="$dir$base.d"
tmpdepfile3="$dir$base.d"
"$@" -MD
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
exit $stat
fi
if test -f "$tmpdepfile1"; then
tmpdepfile="$tmpdepfile1"
elif test -f "$tmpdepfile2"; then
tmpdepfile="$tmpdepfile2"
else
tmpdepfile="$tmpdepfile3"
fi
if test -f "$tmpdepfile"; then
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
# That's a tab and a space in the [].
sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
else
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
#nosideeffect)
# This comment above is used by automake to tell side-effect
# dependency tracking mechanisms from slower ones.
dashmstdout)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout, regardless of -o.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test $1 != '--mode=compile'; do
shift
done
shift
fi
# Remove `-o $object'.
IFS=" "
for arg
do
case $arg in
-o)
shift
;;
$object)
shift
;;
*)
set fnord "$@" "$arg"
shift # fnord
shift # $arg
;;
esac
done
test -z "$dashmflag" && dashmflag=-M
# Require at least two characters before searching for `:'
# in the target name. This is to cope with DOS-style filenames:
# a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
"$@" $dashmflag |
sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile"
tr ' ' '
' < "$tmpdepfile" | \
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
dashXmstdout)
# This case only exists to satisfy depend.m4. It is never actually
# run, as this mode is specially recognized in the preamble.
exit 1
;;
makedepend)
"$@" || exit $?
# Remove any Libtool call
if test "$libtool" = yes; then
while test $1 != '--mode=compile'; do
shift
done
shift
fi
# X makedepend
shift
cleared=no
for arg in "$@"; do
case $cleared in
no)
set ""; shift
cleared=yes ;;
esac
case "$arg" in
-D*|-I*)
set fnord "$@" "$arg"; shift ;;
# Strip any option that makedepend may not understand. Remove
# the object too, otherwise makedepend will parse it as a source file.
-*|$object)
;;
*)
set fnord "$@" "$arg"; shift ;;
esac
done
obj_suffix="`echo $object | sed 's/^.*\././'`"
touch "$tmpdepfile"
${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile"
sed '1,2d' "$tmpdepfile" | tr ' ' '
' | \
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile" "$tmpdepfile".bak
;;
cpp)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test $1 != '--mode=compile'; do
shift
done
shift
fi
# Remove `-o $object'.
IFS=" "
for arg
do
case $arg in
-o)
shift
;;
$object)
shift
;;
*)
set fnord "$@" "$arg"
shift # fnord
shift # $arg
;;
esac
done
"$@" -E |
sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
sed '$ s: \\$::' > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
cat < "$tmpdepfile" >> "$depfile"
sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
msvisualcpp)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout, regardless of -o,
# because we must use -o when running libtool.
"$@" || exit $?
IFS=" "
for arg
do
case "$arg" in
"-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
set fnord "$@"
shift
shift
;;
*)
set fnord "$@" "$arg"
shift
shift
;;
esac
done
"$@" -E |
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
echo " " >> "$depfile"
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
rm -f "$tmpdepfile"
;;
none)
exec "$@"
;;
*)
echo "Unknown depmode $depmode" 1>&2
exit 1
;;
esac
exit 0
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-end: "$"
# End:

View File

@@ -1,19 +1,38 @@
#!/bin/sh
#
# install - install a program, script, or datafile
# This comes from X11R5 (mit/util/scripts/install.sh).
scriptversion=2004-09-10.20
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
# following copyright and license.
#
# Copyright 1991 by the Massachusetts Institute of Technology
# Copyright (C) 1994 X Consortium
#
# 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, and that the name of M.I.T. not be used in advertising or
# publicity pertaining to distribution of the software without specific,
# written prior permission. M.I.T. makes no representations about the
# suitability of this software for any purpose. It is provided "as is"
# without express or implied warranty.
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# 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
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name of the X Consortium shall not
# be used in advertising or otherwise to promote the sale, use or other deal-
# ings in this Software without prior written authorization from the X Consor-
# tium.
#
#
# FSF changes to this file are in the public domain.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# `make' implicit rules from creating a file called install from it
@@ -23,13 +42,11 @@
# from scratch. It can only install one file at a time, a restriction
# shared with many OS's install programs.
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit="${DOITPROG-}"
# put in absolute paths if you don't have them in your path; or use env. vars.
mvprog="${MVPROG-mv}"
@@ -41,211 +58,265 @@ stripprog="${STRIPPROG-strip}"
rmprog="${RMPROG-rm}"
mkdirprog="${MKDIRPROG-mkdir}"
transformbasename=""
transform_arg=""
instcmd="$mvprog"
chmodcmd="$chmodprog 0755"
chowncmd=""
chgrpcmd=""
stripcmd=""
chowncmd=
chgrpcmd=
stripcmd=
rmcmd="$rmprog -f"
mvcmd="$mvprog"
src=""
dst=""
dir_arg=""
src=
dst=
dir_arg=
dstarg=
no_target_directory=
while [ x"$1" != x ]; do
case $1 in
-c) instcmd="$cpprog"
shift
continue;;
usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
or: $0 [OPTION]... SRCFILES... DIRECTORY
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
or: $0 [OPTION]... -d DIRECTORIES...
-d) dir_arg=true
shift
continue;;
In the 1st form, copy SRCFILE to DSTFILE.
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
In the 4th, create DIRECTORIES.
-m) chmodcmd="$chmodprog $2"
shift
shift
continue;;
Options:
-c (ignored)
-d create directories instead of installing files.
-g GROUP $chgrpprog installed files to GROUP.
-m MODE $chmodprog installed files to MODE.
-o USER $chownprog installed files to USER.
-s $stripprog installed files.
-t DIRECTORY install into DIRECTORY.
-T report an error if DSTFILE is a directory.
--help display this help and exit.
--version display version info and exit.
-o) chowncmd="$chownprog $2"
shift
shift
continue;;
Environment variables override the default commands:
CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG
"
-g) chgrpcmd="$chgrpprog $2"
shift
shift
continue;;
while test -n "$1"; do
case $1 in
-c) shift
continue;;
-s) stripcmd="$stripprog"
shift
continue;;
-d) dir_arg=true
shift
continue;;
-t=*) transformarg=`echo $1 | sed 's/-t=//'`
shift
continue;;
-g) chgrpcmd="$chgrpprog $2"
shift
shift
continue;;
-b=*) transformbasename=`echo $1 | sed 's/-b=//'`
shift
continue;;
--help) echo "$usage"; exit 0;;
*) if [ x"$src" = x ]
then
src=$1
else
# this colon is to work around a 386BSD /bin/sh bug
:
dst=$1
fi
shift
continue;;
esac
done
-m) chmodcmd="$chmodprog $2"
shift
shift
continue;;
if [ x"$src" = x ]
then
echo "install: no input file specified"
exit 1
else
:
fi
-o) chowncmd="$chownprog $2"
shift
shift
continue;;
if [ x"$dir_arg" != x ]; then
dst=$src
src=""
if [ -d $dst ]; then
instcmd=:
chmodcmd=""
else
instcmd=$mkdirprog
fi
else
-s) stripcmd=$stripprog
shift
continue;;
# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if [ -f $src -o -d $src ]
then
:
else
echo "install: $src does not exist"
exit 1
fi
if [ x"$dst" = x ]
then
echo "install: no destination specified"
exit 1
else
:
fi
# If destination is a directory, append the input filename; if your system
# does not like double slashes in filenames, you may need to add some logic
if [ -d $dst ]
then
dst="$dst"/`basename $src`
else
:
fi
fi
## this sed command emulates the dirname command
dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
# Make sure that the destination directory exists.
# this part is taken from Noah Friedman's mkinstalldirs script
# Skip lots of stat calls in the usual case.
if [ ! -d "$dstdir" ]; then
defaultIFS='
'
IFS="${IFS-${defaultIFS}}"
oIFS="${IFS}"
# Some sh's can't handle IFS=/ for some reason.
IFS='%'
set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
IFS="${oIFS}"
pathcomp=''
while [ $# -ne 0 ] ; do
pathcomp="${pathcomp}${1}"
-t) dstarg=$2
shift
shift
continue;;
if [ ! -d "${pathcomp}" ] ;
then
$mkdirprog "${pathcomp}"
else
:
fi
-T) no_target_directory=true
shift
continue;;
pathcomp="${pathcomp}/"
--version) echo "$0 $scriptversion"; exit 0;;
*) # When -d is used, all remaining arguments are directories to create.
# When -t is used, the destination is already specified.
test -n "$dir_arg$dstarg" && break
# Otherwise, the last argument is the destination. Remove it from $@.
for arg
do
if test -n "$dstarg"; then
# $@ is not empty: it contains at least $arg.
set fnord "$@" "$dstarg"
shift # fnord
fi
shift # arg
dstarg=$arg
done
break;;
esac
done
if test -z "$1"; then
if test -z "$dir_arg"; then
echo "$0: no input file specified." >&2
exit 1
fi
# It's OK to call `install-sh -d' without argument.
# This can happen when creating conditional directories.
exit 0
fi
if [ x"$dir_arg" != x ]
then
$doit $instcmd $dst &&
for src
do
# Protect names starting with `-'.
case $src in
-*) src=./$src ;;
esac
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else : ; fi &&
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else : ; fi &&
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else : ; fi &&
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else : ; fi
else
if test -n "$dir_arg"; then
dst=$src
src=
# If we're going to rename the final executable, determine the name now.
if test -d "$dst"; then
mkdircmd=:
chmodcmd=
else
mkdircmd=$mkdirprog
fi
else
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if test ! -f "$src" && test ! -d "$src"; then
echo "$0: $src does not exist." >&2
exit 1
fi
if [ x"$transformarg" = x ]
then
dstfile=`basename $dst`
else
dstfile=`basename $dst $transformbasename |
sed $transformarg`$transformbasename
fi
if test -z "$dstarg"; then
echo "$0: no destination specified." >&2
exit 1
fi
# don't allow the sed command to completely eliminate the filename
dst=$dstarg
# Protect names starting with `-'.
case $dst in
-*) dst=./$dst ;;
esac
if [ x"$dstfile" = x ]
then
dstfile=`basename $dst`
else
:
fi
# If destination is a directory, append the input filename; won't work
# if double slashes aren't ignored.
if test -d "$dst"; then
if test -n "$no_target_directory"; then
echo "$0: $dstarg: Is a directory" >&2
exit 1
fi
dst=$dst/`basename "$src"`
fi
fi
# Make a temp file name in the proper directory.
# This sed command emulates the dirname command.
dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
dsttmp=$dstdir/#inst.$$#
# Make sure that the destination directory exists.
# Move or copy the file name to the temp name
# Skip lots of stat calls in the usual case.
if test ! -d "$dstdir"; then
defaultIFS='
'
IFS="${IFS-$defaultIFS}"
$doit $instcmd $src $dsttmp &&
oIFS=$IFS
# Some sh's can't handle IFS=/ for some reason.
IFS='%'
set - `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
IFS=$oIFS
trap "rm -f ${dsttmp}" 0 &&
pathcomp=
# and set any options; do chmod last to preserve setuid bits
while test $# -ne 0 ; do
pathcomp=$pathcomp$1
shift
if test ! -d "$pathcomp"; then
$mkdirprog "$pathcomp"
# mkdir can fail with a `File exist' error in case several
# install-sh are creating the directory concurrently. This
# is OK.
test -d "$pathcomp" || exit
fi
pathcomp=$pathcomp/
done
fi
# If any of these fail, we abort the whole thing. If we want to
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $instcmd $src $dsttmp" command.
if test -n "$dir_arg"; then
$doit $mkdircmd "$dst" \
&& { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \
&& { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \
&& { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \
&& { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; }
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else :;fi &&
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else :;fi &&
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else :;fi &&
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else :;fi &&
else
dstfile=`basename "$dst"`
# Now rename the file to the real destination.
# Make a couple of temp file names in the proper directory.
dsttmp=$dstdir/_inst.$$_
rmtmp=$dstdir/_rm.$$_
$doit $rmcmd -f $dstdir/$dstfile &&
$doit $mvcmd $dsttmp $dstdir/$dstfile
# Trap to clean up those temp files at exit.
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
trap '(exit $?); exit' 1 2 13 15
fi &&
# Copy the file name to the temp name.
$doit $cpprog "$src" "$dsttmp" &&
# and set any options; do chmod last to preserve setuid bits.
#
# If any of these fail, we abort the whole thing. If we want to
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $cpprog $src $dsttmp" command.
#
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \
&& { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \
&& { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \
&& { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } &&
exit 0
# Now rename the file to the real destination.
{ $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \
|| {
# The rename failed, perhaps because mv can't rename something else
# to itself, or perhaps because mv is so ancient that it does not
# support -f.
# Now remove or move aside any old file at destination location.
# We try this two ways since rm can't unlink itself on some
# systems and the destination file might be busy for other
# reasons. In this case, the final cleanup might fail but the new
# file should still install successfully.
{
if test -f "$dstdir/$dstfile"; then
$doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \
|| $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \
|| {
echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
(exit 1); exit
}
else
:
fi
} &&
# Now rename the file to the real destination.
$doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
}
}
fi || { (exit 1); exit; }
done
# The final little trick to "correctly" pass the exit status to the exit trap.
{
(exit 0); exit
}
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-end: "$"
# End:

File diff suppressed because it is too large Load Diff

14
llvm/autoconf/m4/bison.m4 Normal file
View File

@@ -0,0 +1,14 @@
#
# Check for Bison.
#
# 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_CACHE_CHECK([],[llvm_cv_has_bison],[AC_PROG_YACC()])
if test "$YACC" != "bison -y"; then
AC_MSG_ERROR([bison not found but required])
else
AC_SUBST(BISON,[bison],[location of bison])
fi])

View File

@@ -0,0 +1,31 @@
#
# Determine if the printf() functions have the %a format character.
# This is modified from:
# http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_have_ext_slist.html
AC_DEFUN([AC_C_PRINTF_A],
[AC_CACHE_CHECK([if printf has the %a format character],[llvm_cv_c_printf_a],
[AC_LANG_PUSH([C])
AC_RUN_IFELSE([
AC_LANG_PROGRAM([[
#include <stdio.h>
#include <stdlib.h>
]],[[
volatile double A, B;
char Buffer[100];
A = 1;
A /= 10.0;
sprintf(Buffer, "%a", A);
B = atof(Buffer);
if (A != B)
return (1);
if (A != 0x1.999999999999ap-4)
return (1);
return (0);]])],
llvm_cv_c_printf_a=yes,
llvmac_cv_c_printf_a=no,
llvmac_cv_c_printf_a=no)
AC_LANG_POP([C])])
if test "$llvm_cv_c_printf_a" = "yes"; then
AC_DEFINE([HAVE_PRINTF_A],[1],[Define to have the %a format string])
fi
])

View File

@@ -0,0 +1,26 @@
#
# Check for GNU Make. This is originally from
# http://www.gnu.org/software/ac-archive/htmldoc/check_gnu_make.html
#
AC_DEFUN([AC_CHECK_GNU_MAKE],
[AC_CACHE_CHECK([for GNU make],[llvm_cv_gnu_make_command],
dnl Search all the common names for GNU make
[llvm_cv_gnu_make_command=''
for a in "$MAKE" make gmake gnumake ; do
if test -z "$a" ; then continue ; fi ;
if ( sh -c "$a --version" 2> /dev/null | grep GNU 2>&1 > /dev/null )
then
llvm_cv_gnu_make_command=$a ;
break;
fi
done])
dnl If there was a GNU version, then set @ifGNUmake@ to the empty string,
dnl '#' otherwise
if test "x$llvm_cv_gnu_make_command" != "x" ; then
ifGNUmake='' ;
else
ifGNUmake='#' ;
AC_MSG_RESULT("Not found");
fi
AC_SUBST(ifGNUmake)
])

View File

@@ -0,0 +1,9 @@
#
# Configure a Makefile without clobbering it if it exists and is not out of
# date. This macro is unique to LLVM.
#
AC_DEFUN([AC_CONFIG_MAKEFILE],
[AC_CONFIG_COMMANDS($1,
[${llvm_src}/autoconf/mkinstalldirs `dirname $1`
${SHELL} ${llvm_src}/autoconf/install-sh -c ${srcdir}/$1 $1])
])

View File

@@ -0,0 +1,14 @@
#
# Provide the arguments and other processing needed for an LLVM project
#
AC_DEFUN([LLVM_CONFIG_PROJECT],
[AC_ARG_WITH([llvmsrc],
AS_HELP_STRING([--with-llvmsrc],[Location of LLVM Source Code]),
[llvm_src="$withval"],[llvm_src=`cd ${srcdir}/../..; pwd`])
AC_SUBST(LLVM_SRC,$llvm_src)
AC_ARG_WITH([llvmobj],
AS_HELP_STRING([--with-llvmobj],[Location of LLVM Object Code]),
[llvm_obj="$withval"],[llvm_obj=`cd ../..; pwd`])
AC_SUBST(LLVM_OBJ,$llvm_obj)
AC_CONFIG_COMMANDS([setup],,[llvm_src="${LLVM_SRC}"])
])

View File

@@ -0,0 +1,22 @@
#
# Check for bidirectional iterator extension. This is modified from
# http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_have_ext_hash_set.html
#
AC_DEFUN([AC_CXX_HAVE_BI_ITERATOR],
[AC_CACHE_CHECK(whether the compiler has the bidirectional iterator,
ac_cv_cxx_have_bi_iterator,
[AC_REQUIRE([AC_CXX_NAMESPACES])
AC_LANG_PUSH([C++])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <iterator>
#ifdef HAVE_NAMESPACES
using namespace std;
#endif]], [[bidirectional_iterator<int,int> t; return 0;]])],[ac_cv_cxx_have_bi_iterator=yes],[ac_cv_cxx_have_bi_iterator=no])
AC_LANG_POP([C++])
])
if test "$ac_cv_cxx_have_bi_iterator" = yes
then
AC_DEFINE(HAVE_BI_ITERATOR,1,[Have bi-directional iterator])
else
AC_DEFINE(HAVE_BI_ITERATOR,0,[Does not have bi-directional iterator])
fi
])

View File

@@ -0,0 +1,22 @@
# Check for forward iterator extension. This is modified from
# http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_have_ext_hash_set.html
AC_DEFUN([AC_CXX_HAVE_FWD_ITERATOR],
[AC_CACHE_CHECK(whether the compiler has forward iterators,
ac_cv_cxx_have_fwd_iterator,
[AC_REQUIRE([AC_CXX_NAMESPACES])
AC_LANG_PUSH([C++])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <iterator>
#ifdef HAVE_NAMESPACES
using namespace std;
#endif]], [[forward_iterator<int,int> t; return 0;]])],[ac_cv_cxx_have_fwd_iterator=yes],[ac_cv_cxx_have_fwd_iterator=no])
AC_LANG_POP([C++])
])
if test "$ac_cv_cxx_have_fwd_iterator" = yes
then
AC_DEFINE(HAVE_FWD_ITERATOR,1,[Have forward iterator])
else
AC_DEFINE(HAVE_FWD_ITERATOR,0,[Does not have forward iterator])
fi
])

View File

@@ -0,0 +1,59 @@
# Check for hash_map extension. This is from
# 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_CACHE_CHECK([whether the compiler has <ext/hash_map> defining template class std::hash_map],
ac_cv_cxx_have_std_ext_hash_map,
[AC_REQUIRE([AC_CXX_NAMESPACES])
AC_LANG_PUSH([C++])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <ext/hash_map>
#ifdef HAVE_NAMESPACES
using namespace std;
#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_LANG_POP([C++])])
if test "$ac_cv_cxx_have_std_ext_hash_map" = yes
then
AC_DEFINE(HAVE_STD_EXT_HASH_MAP,1,[Have ext/hash_map>])
else
AC_DEFINE(HAVE_STD_EXT_HASH_MAP,0,[Does not have ext/hash_map>])
fi
])
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_cv_cxx_have_gnu_ext_hash_map,
[AC_REQUIRE([AC_CXX_NAMESPACES])
AC_LANG_PUSH([C++])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <ext/hash_map>
#ifdef HAVE_NAMESPACES
using namespace __gnu_cxx;
#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_LANG_POP([C++])])
if test "$ac_cv_cxx_have_gnu_ext_hash_map" = yes
then
AC_DEFINE(HAVE_GNU_EXT_HASH_MAP,1,[Have ext/hash_map])
else
AC_DEFINE(HAVE_GNU_EXT_HASH_MAP,0,[Does not have ext/hash_map])
fi
])
AC_DEFUN([AC_CXX_HAVE_GLOBAL_HASH_MAP],
[AC_CACHE_CHECK([whether the compiler has <hash_map> defining template class ::hash_map],
ac_cv_cxx_have_global_hash_map,
[AC_REQUIRE([AC_CXX_NAMESPACES])
AC_LANG_PUSH([C++])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#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_LANG_POP([C++])])
if test "$ac_cv_cxx_have_global_hash_map" = yes
then
AC_DEFINE(HAVE_GLOBAL_HASH_MAP,1,[Have <hash_map>])
else
AC_DEFINE(HAVE_GLOBAL_HASH_MAP,0,[Does not have <hash_map>])
fi
])
AC_DEFUN([AC_CXX_HAVE_HASH_MAP],
[AC_CXX_HAVE_STD_EXT_HASH_MAP
AC_CXX_HAVE_GNU_EXT_HASH_MAP
AC_CXX_HAVE_GLOBAL_HASH_MAP])

View File

@@ -0,0 +1,60 @@
# Check for hash_set extension. This is modified from
# 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_CACHE_CHECK([whether the compiler has <ext/hash_set> defining template class std::hash_set],
ac_cv_cxx_have_std_ext_hash_set,
[AC_REQUIRE([AC_CXX_NAMESPACES])
AC_LANG_PUSH([C++])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <ext/hash_set>
#ifdef HAVE_NAMESPACES
using namespace std;
#endif]], [[hash_set<int> t; ]])],[ac_cv_cxx_have_std_ext_hash_set=yes],[ac_cv_cxx_have_std_ext_hash_set=no])
AC_LANG_POP([C++])])
if test "$ac_cv_cxx_have_std_ext_hash_set" = yes
then
AC_DEFINE(HAVE_STD_EXT_HASH_SET,1,[Have hash_set in std namespace])
else
AC_DEFINE(HAVE_STD_EXT_HASH_SET,0,[Does not have hash_set in std namespace])
fi
])
AC_DEFUN([AC_CXX_HAVE_GNU_EXT_HASH_SET],
[AC_CACHE_CHECK(
[whether the compiler has <ext/hash_set> defining template class __gnu_cxx::hash_set],
ac_cv_cxx_have_gnu_ext_hash_set,
[AC_REQUIRE([AC_CXX_NAMESPACES])
AC_LANG_PUSH([C++])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <ext/hash_set>
#ifdef HAVE_NAMESPACES
using namespace __gnu_cxx;
#endif]], [[hash_set<int> t; ]])],[ac_cv_cxx_have_gnu_ext_hash_set=yes],[ac_cv_cxx_have_gnu_ext_hash_set=no])
AC_LANG_POP([C++])])
if test "$ac_cv_cxx_have_gnu_ext_hash_set" = yes
then
AC_DEFINE(HAVE_GNU_EXT_HASH_SET,1,[Have hash_set in gnu namespace])
else
AC_DEFINE(HAVE_GNU_EXT_HASH_SET,0,[Does not have hash_set in gnu namespace])
fi
])
AC_DEFUN([AC_CXX_HAVE_GLOBAL_HASH_SET],
[AC_CACHE_CHECK([whether the compiler has <hash_set> defining template class ::hash_set],
ac_cv_cxx_have_global_hash_set,
[AC_REQUIRE([AC_CXX_NAMESPACES])
AC_LANG_PUSH([C++])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#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_LANG_POP([C++])])
if test "$ac_cv_cxx_have_global_hash_set" = yes
then
AC_DEFINE(HAVE_GLOBAL_HASH_SET,1,[Have hash_set in global namespace])
else
AC_DEFINE(HAVE_GLOBAL_HASH_SET,0,[Does not have hash_set in global namespace])
fi
])
AC_DEFUN([AC_CXX_HAVE_HASH_SET],
[AC_CXX_HAVE_STD_EXT_HASH_SET
AC_CXX_HAVE_GNU_EXT_HASH_SET
AC_CXX_HAVE_GLOBAL_HASH_SET])

View File

@@ -0,0 +1,19 @@
# Check for C++ namespace support. This is from
# http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_namespaces.html
#
AC_DEFUN([AC_CXX_NAMESPACES],
[AC_CACHE_CHECK(whether the compiler implements namespaces,
ac_cv_cxx_namespaces,
[AC_LANG_PUSH([C++])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[[namespace Outer { namespace Inner { int i = 0; }}]],
[[using namespace Outer::Inner; return i;]])],
ac_cv_cxx_namespaces=yes,
ac_cv_cxx_namespaces=no)
AC_LANG_POP([C++])
])
if test "$ac_cv_cxx_namespaces" = yes; then
AC_DEFINE(HAVE_NAMESPACES,,[define if the compiler implements namespaces])
fi
])

View File

@@ -0,0 +1,26 @@
# Check for standard iterator extension. This is modified from
# http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_have_ext_hash_set.html
AC_DEFUN([AC_CXX_HAVE_STD_ITERATOR],
[AC_CACHE_CHECK(whether the compiler has the standard iterator,
ac_cv_cxx_have_std_iterator,
[AC_REQUIRE([AC_CXX_NAMESPACES])
AC_LANG_PUSH([C++])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[[#include <iterator>
#ifdef HAVE_NAMESPACES
using namespace std;
#endif]],
[[iterator<int,int,int> t; return 0;]])],
ac_cv_cxx_have_std_iterator=yes,
ac_cv_cxx_have_std_iterator=no)
AC_LANG_POP([C++])
])
if test "$ac_cv_cxx_have_std_iterator" = yes
then
AC_DEFINE(HAVE_STD_ITERATOR,1,[Have std namespace iterator])
else
AC_DEFINE(HAVE_STD_ITERATOR,0,[Does not have std namespace iterator])
fi
])

17
llvm/autoconf/m4/flex.m4 Normal file
View File

@@ -0,0 +1,17 @@
#
# Check for FLEX.
#
# This macro verifies that flex is installed. If successful, then
# 1) $LEX is set to "flex" (to emulate lex calls)
# 2) BISON is set to bison
AC_DEFUN([AC_PROG_FLEX],
[AC_CACHE_CHECK(,
ac_cv_has_flex,
[AC_PROG_LEX()
])
if test "$LEX" != "flex"; then
AC_MSG_ERROR([flex not found but required])
else
AC_SUBST(FLEX,[flex],[location of flex])
fi
])

View File

@@ -0,0 +1,36 @@
#
# This function determins if the the isinf function isavailable on this
# platform.
#
AC_DEFUN([AC_FUNC_ISINF],[
AC_SINGLE_CXX_CHECK([ac_cv_func_isinf_in_math_h],
[isinf], [<math.h>],
[float f; isinf(f);])
if test "$ac_cv_func_isinf_in_math_h" = "yes" ; then
AC_DEFINE([HAVE_ISINF_IN_MATH_H],1,[Set to 1 if the isinf function is found in <math.h>])
fi
AC_SINGLE_CXX_CHECK([ac_cv_func_isinf_in_cmath],
[isinf], [<cmath>],
[float f; isinf(f);])
if test "$ac_cv_func_isinf_in_cmath" = "yes" ; then
AC_DEFINE([HAVE_ISINF_IN_CMATH],1,[Set to 1 if the isinf function is found in <cmath>])
fi
AC_SINGLE_CXX_CHECK([ac_cv_func_std_isinf_in_cmath],
[std::isinf], [<cmath>],
[float f; std::isinf(f)}])
if test "$ac_cv_func_std_isinf_in_cmath" = "yes" ; then
AC_DEFINE([HAVE_STD_ISINF_IN_CMATH],1,[Set to 1 if the std::isinf function is found in <cmath>])
fi
AC_SINGLE_CXX_CHECK([ac_cv_func_finite_in_ieeefp_h],
[finite], [<ieeefp.h>],
[float f; finite(f);])
if test "$ac_cv_func_finite_in_ieeefp_h" = "yes" ; then
AC_DEFINE([HAVE_FINITE_IN_IEEEFP_H],1,[Set to 1 if the finite function is found in <ieeefp.h>])
fi
])

View File

@@ -0,0 +1,27 @@
#
# This function determines if the isnan function is available on this
# platform.
#
AC_DEFUN([AC_FUNC_ISNAN],[
AC_SINGLE_CXX_CHECK([ac_cv_func_isnan_in_math_h],
[isnan], [<math.h>],
[float f; isnan(f);])
if test "$ac_cv_func_isnan_in_math_h" = "yes" ; then
AC_DEFINE([HAVE_ISNAN_IN_MATH_H],1,[Set to 1 if the isnan function is found in <math.h>])
fi
AC_SINGLE_CXX_CHECK([ac_cv_func_isnan_in_cmath],
[isnan], [<cmath>],
[float f; isnan(f);])
if test "$ac_cv_func_isnan_in_cmath" = "yes" ; then
AC_DEFINE([HAVE_ISNAN_IN_CMATH],1,[Set to 1 if the isnan function is found in <cmath>])
fi
AC_SINGLE_CXX_CHECK([ac_cv_func_std_isnan_in_cmath],
[std::isnan], [<cmath>],
[float f; std::isnan(f);])
if test "$ac_cv_func_std_isnan_in_cmath" = "yes" ; then
AC_DEFINE([HAVE_STD_ISNAN_IN_CMATH],1,[Set to 1 if the std::isnan function is found in <cmath>])
fi
])

View File

@@ -0,0 +1,26 @@
#
# Check for the ability to mmap a file.
#
AC_DEFUN([AC_FUNC_MMAP_FILE],
[AC_CACHE_CHECK(for mmap of files,
ac_cv_func_mmap_file,
[ AC_LANG_PUSH([C])
AC_RUN_IFELSE([
AC_LANG_PROGRAM([[
#include <sys/types.h>
#include <sys/mman.h>
#include <fcntl.h>
]],[[
int fd;
fd = creat ("foo",0777);
fd = (int) mmap (0, 1, PROT_READ, MAP_SHARED, fd, 0);
unlink ("foo");
return (fd != (int) MAP_FAILED);]])],
[ac_cv_func_mmap_file=yes],[ac_cv_func_mmap_file=no],[ac_cv_func_mmap_file=no])
AC_LANG_POP([C])
])
if test "$ac_cv_func_mmap_file" = yes; then
AC_DEFINE([HAVE_MMAP_FILE],[],[Define if mmap() can map files into memory])
AC_SUBST(MMAP_FILE,[yes])
fi
])

View File

@@ -0,0 +1,21 @@
#
# Check for anonymous mmap macros. This is modified from
# http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_have_ext_slist.html
#
AC_DEFUN([AC_HEADER_MMAP_ANONYMOUS],
[AC_CACHE_CHECK(for MAP_ANONYMOUS vs. MAP_ANON,
ac_cv_header_mmap_anon,
[ AC_LANG_PUSH([C])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[[#include <sys/mman.h>
#include <unistd.h>
#include <fcntl.h>]],
[[mmap (0, 1, PROT_READ, MAP_ANONYMOUS, -1, 0); return (0);]])],
ac_cv_header_mmap_anon=yes,
ac_cv_header_mmap_anon=no)
AC_LANG_POP([C])
])
if test "$ac_cv_header_mmap_anon" = yes; then
AC_DEFINE([HAVE_MMAP_ANONYMOUS],[1],[Define if mmap() uses MAP_ANONYMOUS to map anonymous pages, or undefine if it uses MAP_ANON])
fi
])

View File

@@ -0,0 +1,19 @@
#
# Determine if the system can handle the -R option being passed to the linker.
#
# This macro is specific to LLVM.
#
AC_DEFUN([AC_LINK_USE_R],
[AC_CACHE_CHECK([for compiler -Wl,-R<path> option],[llvm_cv_link_use_r],
[ AC_LANG_PUSH([C])
oldcflags="$CFLAGS"
CFLAGS="$CFLAGS -Wl,-R."
AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[int main() { return 0; }]])],
[llvm_cv_link_use_r=yes],[llvm_cv_link_use_r=no])
CFLAGS="$oldcflags"
AC_LANG_POP([C])
])
if test "$llvm_cv_link_use_r" = yes ; then
AC_DEFINE([HAVE_LINK_R],[1],[Define if you can use -Wl,-R. to pass -R. to the linker, in order to add the current directory to the dynamic linker search path.])
fi
])

427
llvm/autoconf/m4/ltdl.m4 Normal file
View File

@@ -0,0 +1,427 @@
## ltdl.m4 - Configure ltdl for the target system. -*-Autoconf-*-
## Copyright (C) 1999-2000 Free Software Foundation, Inc.
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the License, or
## (at your option) any later version.
##
## This program is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program; if not, write to the Free Software
## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
##
## As a special exception to the GNU General Public License, if you
## distribute this file as part of a program that contains a
## configuration script generated by Autoconf, you may include it under
## the same distribution terms that you use for the rest of that program.
# serial 6 AC_LIB_LTDL
# AC_WITH_LTDL
# ------------
# Clients of libltdl can use this macro to allow the installer to
# choose between a shipped copy of the ltdl sources or a preinstalled
# version of the library.
AC_DEFUN([AC_WITH_LTDL],
[AC_REQUIRE([AC_LIB_LTDL])
AC_SUBST([LIBLTDL])
AC_SUBST([INCLTDL])
# Unless the user asks us to check, assume no installed ltdl exists.
use_installed_libltdl=no
AC_ARG_WITH([included_ltdl],
[ --with-included-ltdl use the GNU ltdl sources included here])
if test "x$with_included_ltdl" != xyes; then
# We are not being forced to use the included libltdl sources, so
# decide whether there is a useful installed version we can use.
AC_CHECK_HEADER([ltdl.h],
[AC_CHECK_LIB([ltdl], [lt_dlcaller_register],
[with_included_ltdl=no],
[with_included_ltdl=yes])
])
fi
if test "x$enable_ltdl_install" != xyes; then
# If the user did not specify an installable libltdl, then default
# to a convenience lib.
AC_LIBLTDL_CONVENIENCE
fi
if test "x$with_included_ltdl" = xno; then
# If the included ltdl is not to be used. then Use the
# preinstalled libltdl we found.
AC_DEFINE([HAVE_LTDL], 1,
[Define this if a modern libltdl is already installed])
LIBLTDL=-lltdl
fi
# Report our decision...
AC_MSG_CHECKING([whether to use included libltdl])
AC_MSG_RESULT([$with_included_ltdl])
AC_CONFIG_SUBDIRS([libltdl])
])# AC_WITH_LTDL
# AC_LIB_LTDL
# -----------
# Perform all the checks necessary for compilation of the ltdl objects
# -- including compiler checks and header checks.
AC_DEFUN([AC_LIB_LTDL],
[AC_PREREQ(2.59)
AC_REQUIRE([AC_PROG_CC])
AC_REQUIRE([AC_C_CONST])
AC_REQUIRE([AC_HEADER_STDC])
AC_REQUIRE([AC_HEADER_DIRENT])
AC_REQUIRE([_LT_AC_CHECK_DLFCN])
AC_REQUIRE([AC_LTDL_ENABLE_INSTALL])
AC_REQUIRE([AC_LTDL_SHLIBEXT])
AC_REQUIRE([AC_LTDL_SHLIBPATH])
AC_REQUIRE([AC_LTDL_SYSSEARCHPATH])
AC_REQUIRE([AC_LTDL_OBJDIR])
AC_REQUIRE([AC_LTDL_DLPREOPEN])
AC_REQUIRE([AC_LTDL_DLLIB])
AC_REQUIRE([AC_LTDL_SYMBOL_USCORE])
AC_REQUIRE([AC_LTDL_DLSYM_USCORE])
AC_REQUIRE([AC_LTDL_SYS_DLOPEN_DEPLIBS])
AC_REQUIRE([AC_LTDL_FUNC_ARGZ])
AC_CHECK_HEADERS([assert.h ctype.h errno.h malloc.h memory.h stdlib.h \
stdio.h unistd.h])
AC_CHECK_HEADERS([dl.h sys/dl.h dld.h mach-o/dyld.h])
AC_CHECK_HEADERS([string.h strings.h], [break])
AC_CHECK_FUNCS([strchr index], [break])
AC_CHECK_FUNCS([strrchr rindex], [break])
AC_CHECK_FUNCS([memcpy bcopy], [break])
AC_CHECK_FUNCS([memmove strcmp])
AC_CHECK_FUNCS([closedir opendir readdir])
])# AC_LIB_LTDL
# AC_LTDL_ENABLE_INSTALL
# ----------------------
AC_DEFUN([AC_LTDL_ENABLE_INSTALL],
[AC_ARG_ENABLE([ltdl-install],
[AS_HELP_STRING([--enable-ltdl-install], [install libltdl])])
AM_CONDITIONAL(INSTALL_LTDL, test x"${enable_ltdl_install-no}" != xno)
AM_CONDITIONAL(CONVENIENCE_LTDL, test x"${enable_ltdl_convenience-no}" != xno)
])])# AC_LTDL_ENABLE_INSTALL
# AC_LTDL_SYS_DLOPEN_DEPLIBS
# --------------------------
AC_DEFUN([AC_LTDL_SYS_DLOPEN_DEPLIBS],
[AC_REQUIRE([AC_CANONICAL_HOST])
AC_CACHE_CHECK([whether deplibs are loaded by dlopen],
[libltdl_cv_sys_dlopen_deplibs],
[# PORTME does your system automatically load deplibs for dlopen?
# or its logical equivalent (e.g. shl_load for HP-UX < 11)
# For now, we just catch OSes we know something about -- in the
# future, we'll try test this programmatically.
libltdl_cv_sys_dlopen_deplibs=unknown
case "$host_os" in
aix3*|aix4.1.*|aix4.2.*)
# Unknown whether this is true for these versions of AIX, but
# we want this `case' here to explicitly catch those versions.
libltdl_cv_sys_dlopen_deplibs=unknown
;;
aix[[45]]*)
libltdl_cv_sys_dlopen_deplibs=yes
;;
darwin*)
# Assuming the user has installed a libdl from somewhere, this is true
# If you are looking for one http://www.opendarwin.org/projects/dlcompat
libltdl_cv_sys_dlopen_deplibs=yes
;;
gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu)
# GNU and its variants, using gnu ld.so (Glibc)
libltdl_cv_sys_dlopen_deplibs=yes
;;
hpux10*|hpux11*)
libltdl_cv_sys_dlopen_deplibs=yes
;;
irix[[12345]]*|irix6.[[01]]*)
# Catch all versions of IRIX before 6.2, and indicate that we don't
# know how it worked for any of those versions.
libltdl_cv_sys_dlopen_deplibs=unknown
;;
irix*)
# The case above catches anything before 6.2, and it's known that
# at 6.2 and later dlopen does load deplibs.
libltdl_cv_sys_dlopen_deplibs=yes
;;
netbsd*)
libltdl_cv_sys_dlopen_deplibs=yes
;;
openbsd*)
libltdl_cv_sys_dlopen_deplibs=yes
;;
osf[[1234]]*)
# dlopen did load deplibs (at least at 4.x), but until the 5.x series,
# it did *not* use an RPATH in a shared library to find objects the
# library depends on, so we explictly say `no'.
libltdl_cv_sys_dlopen_deplibs=no
;;
osf5.0|osf5.0a|osf5.1)
# dlopen *does* load deplibs and with the right loader patch applied
# it even uses RPATH in a shared library to search for shared objects
# that the library depends on, but there's no easy way to know if that
# patch is installed. Since this is the case, all we can really
# say is unknown -- it depends on the patch being installed. If
# it is, this changes to `yes'. Without it, it would be `no'.
libltdl_cv_sys_dlopen_deplibs=unknown
;;
osf*)
# the two cases above should catch all versions of osf <= 5.1. Read
# the comments above for what we know about them.
# At > 5.1, deplibs are loaded *and* any RPATH in a shared library
# is used to find them so we can finally say `yes'.
libltdl_cv_sys_dlopen_deplibs=yes
;;
solaris*)
libltdl_cv_sys_dlopen_deplibs=yes
;;
esac
])
if test "$libltdl_cv_sys_dlopen_deplibs" != yes; then
AC_DEFINE([LTDL_DLOPEN_DEPLIBS], [1],
[Define if the OS needs help to load dependent libraries for dlopen().])
fi
])# AC_LTDL_SYS_DLOPEN_DEPLIBS
# AC_LTDL_SHLIBEXT
# ----------------
AC_DEFUN([AC_LTDL_SHLIBEXT],
[AC_REQUIRE([AC_LIBTOOL_SYS_DYNAMIC_LINKER])
AC_CACHE_CHECK([which extension is used for loadable modules],
[libltdl_cv_shlibext],
[
module=yes
eval libltdl_cv_shlibext=$shrext_cmds
])
if test -n "$libltdl_cv_shlibext"; then
AC_DEFINE_UNQUOTED(LTDL_SHLIB_EXT, "$libltdl_cv_shlibext",
[Define to the extension used for shared libraries, say, ".so".])
fi
])# AC_LTDL_SHLIBEXT
# AC_LTDL_SHLIBPATH
# -----------------
AC_DEFUN([AC_LTDL_SHLIBPATH],
[AC_REQUIRE([AC_LIBTOOL_SYS_DYNAMIC_LINKER])
AC_CACHE_CHECK([which variable specifies run-time library path],
[libltdl_cv_shlibpath_var], [libltdl_cv_shlibpath_var="$shlibpath_var"])
if test -n "$libltdl_cv_shlibpath_var"; then
AC_DEFINE_UNQUOTED(LTDL_SHLIBPATH_VAR, "$libltdl_cv_shlibpath_var",
[Define to the name of the environment variable that determines the dynamic library search path.])
fi
])# AC_LTDL_SHLIBPATH
# AC_LTDL_SYSSEARCHPATH
# ---------------------
AC_DEFUN([AC_LTDL_SYSSEARCHPATH],
[AC_REQUIRE([AC_LIBTOOL_SYS_DYNAMIC_LINKER])
AC_CACHE_CHECK([for the default library search path],
[libltdl_cv_sys_search_path],
[libltdl_cv_sys_search_path="$sys_lib_dlsearch_path_spec"])
if test -n "$libltdl_cv_sys_search_path"; then
sys_search_path=
for dir in $libltdl_cv_sys_search_path; do
if test -z "$sys_search_path"; then
sys_search_path="$dir"
else
sys_search_path="$sys_search_path$PATH_SEPARATOR$dir"
fi
done
AC_DEFINE_UNQUOTED(LTDL_SYSSEARCHPATH, "$sys_search_path",
[Define to the system default library search path.])
fi
])# AC_LTDL_SYSSEARCHPATH
# AC_LTDL_OBJDIR
# --------------
AC_DEFUN([AC_LTDL_OBJDIR],
[AC_CACHE_CHECK([for objdir],
[libltdl_cv_objdir],
[libltdl_cv_objdir="$objdir"
if test -n "$objdir"; then
:
else
rm -f .libs 2>/dev/null
mkdir .libs 2>/dev/null
if test -d .libs; then
libltdl_cv_objdir=.libs
else
# MS-DOS does not allow filenames that begin with a dot.
libltdl_cv_objdir=_libs
fi
rmdir .libs 2>/dev/null
fi
])
AC_DEFINE_UNQUOTED(LTDL_OBJDIR, "$libltdl_cv_objdir/",
[Define to the sub-directory in which libtool stores uninstalled libraries.])
])# AC_LTDL_OBJDIR
# AC_LTDL_DLPREOPEN
# -----------------
AC_DEFUN([AC_LTDL_DLPREOPEN],
[AC_REQUIRE([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])
AC_CACHE_CHECK([whether libtool supports -dlopen/-dlpreopen],
[libltdl_cv_preloaded_symbols],
[if test -n "$lt_cv_sys_global_symbol_pipe"; then
libltdl_cv_preloaded_symbols=yes
else
libltdl_cv_preloaded_symbols=no
fi
])
if test x"$libltdl_cv_preloaded_symbols" = xyes; then
AC_DEFINE(HAVE_PRELOADED_SYMBOLS, 1,
[Define if libtool can extract symbol lists from object files.])
fi
])# AC_LTDL_DLPREOPEN
# AC_LTDL_DLLIB
# -------------
AC_DEFUN([AC_LTDL_DLLIB],
[LIBADD_DL=
AC_SUBST(LIBADD_DL)
AC_LANG_PUSH([C])
AC_CHECK_FUNC([shl_load],
[AC_DEFINE([HAVE_SHL_LOAD], [1],
[Define if you have the shl_load function.])],
[AC_CHECK_LIB([dld], [shl_load],
[AC_DEFINE([HAVE_SHL_LOAD], [1],
[Define if you have the shl_load function.])
LIBADD_DL="$LIBADD_DL -ldld"],
[AC_CHECK_LIB([dl], [dlopen],
[AC_DEFINE([HAVE_LIBDL], [1],
[Define if you have the libdl library or equivalent.])
LIBADD_DL="-ldl" libltdl_cv_lib_dl_dlopen="yes"],
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#if HAVE_DLFCN_H
# include <dlfcn.h>
#endif
]], [[dlopen(0, 0);]])],[AC_DEFINE([HAVE_LIBDL], [1],
[Define if you have the libdl library or equivalent.]) libltdl_cv_func_dlopen="yes"],[AC_CHECK_LIB([svld], [dlopen],
[AC_DEFINE([HAVE_LIBDL], [1],
[Define if you have the libdl library or equivalent.])
LIBADD_DL="-lsvld" libltdl_cv_func_dlopen="yes"],
[AC_CHECK_LIB([dld], [dld_link],
[AC_DEFINE([HAVE_DLD], [1],
[Define if you have the GNU dld library.])
LIBADD_DL="$LIBADD_DL -ldld"],
[AC_CHECK_FUNC([_dyld_func_lookup],
[AC_DEFINE([HAVE_DYLD], [1],
[Define if you have the _dyld_func_lookup function.])])
])
])
])
])
])
])
if test x"$libltdl_cv_func_dlopen" = xyes || test x"$libltdl_cv_lib_dl_dlopen" = xyes
then
lt_save_LIBS="$LIBS"
LIBS="$LIBS $LIBADD_DL"
AC_CHECK_FUNCS([dlerror])
LIBS="$lt_save_LIBS"
fi
AC_LANG_POP
])# AC_LTDL_DLLIB
# AC_LTDL_SYMBOL_USCORE
# ---------------------
# does the compiler prefix global symbols with an underscore?
AC_DEFUN([AC_LTDL_SYMBOL_USCORE],
[AC_REQUIRE([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])
AC_CACHE_CHECK([for _ prefix in compiled symbols],
[ac_cv_sys_symbol_underscore],
[ac_cv_sys_symbol_underscore=no
cat > conftest.$ac_ext <<EOF
void nm_test_func(){}
int main(){nm_test_func;return 0;}
EOF
if AC_TRY_EVAL(ac_compile); then
# Now try to grab the symbols.
ac_nlist=conftest.nm
if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $ac_nlist) && test -s "$ac_nlist"; then
# See whether the symbols have a leading underscore.
if grep '^. _nm_test_func' "$ac_nlist" >/dev/null; then
ac_cv_sys_symbol_underscore=yes
else
if grep '^. nm_test_func ' "$ac_nlist" >/dev/null; then
:
else
echo "configure: cannot find nm_test_func in $ac_nlist" >&AS_MESSAGE_LOG_FD()
fi
fi
else
echo "configure: cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD()
fi
else
echo "configure: failed program was:" >&AS_MESSAGE_LOG_FD()
cat conftest.c >&AS_MESSAGE_LOG_FD()
fi
rm -rf conftest*
])
])# AC_LTDL_SYMBOL_USCORE
# AC_LTDL_DLSYM_USCORE
# --------------------
AC_DEFUN([AC_LTDL_DLSYM_USCORE],
[AC_REQUIRE([AC_LTDL_SYMBOL_USCORE])
if test x"$ac_cv_sys_symbol_underscore" = xyes; then
if test x"$libltdl_cv_func_dlopen" = xyes ||
test x"$libltdl_cv_lib_dl_dlopen" = xyes ; then
AC_CACHE_CHECK([whether we have to add an underscore for dlsym],
[libltdl_cv_need_uscore],
[libltdl_cv_need_uscore=unknown
save_LIBS="$LIBS"
LIBS="$LIBS $LIBADD_DL"
_LT_AC_TRY_DLOPEN_SELF(
[libltdl_cv_need_uscore=no], [libltdl_cv_need_uscore=yes],
[], [libltdl_cv_need_uscore=cross])
LIBS="$save_LIBS"
])
fi
fi
if test x"$libltdl_cv_need_uscore" = xyes; then
AC_DEFINE(NEED_USCORE, 1,
[Define if dlsym() requires a leading underscore in symbol names.])
fi
])# AC_LTDL_DLSYM_USCORE
# AC_LTDL_FUNC_ARGZ
# -----------------
AC_DEFUN([AC_LTDL_FUNC_ARGZ],
[AC_CHECK_HEADERS([argz.h])
AC_CHECK_TYPES([error_t],
[],
[AC_DEFINE([error_t], [int],
[Define to a type to use for `error_t' if it is not otherwise available.])],
[#if HAVE_ARGZ_H
# include <argz.h>
#endif])
AC_CHECK_FUNCS([argz_append argz_create_sep argz_insert argz_next argz_stringify])
])# AC_LTDL_FUNC_ARGZ

View File

@@ -0,0 +1,17 @@
#
# When allocating RWX memory, check whether we need to use /dev/zero
# as the file descriptor or not.
#
AC_DEFUN([AC_NEED_DEV_ZERO_FOR_MMAP],
[AC_CACHE_CHECK([if /dev/zero is needed for mmap],
ac_cv_need_dev_zero_for_mmap,
[if test "$llvm_cv_os_type" = "Interix" ; then
ac_cv_need_dev_zero_for_mmap=yes
else
ac_cv_need_dev_zero_for_mmap=no
fi
])
if test "$ac_cv_need_dev_zero_for_mmap" = yes; then
AC_DEFINE([NEED_DEV_ZERO_FOR_MMAP],[1],
[Define if /dev/zero should be used when mapping RWX memory, or undefine if its not necessary])
fi])

View File

@@ -0,0 +1,39 @@
dnl This macro checks for tclsh which is required to run dejagnu. On some
dnl platforms (notably FreeBSD), tclsh is named tclshX.Y - this handles
dnl that for us so we can get the latest installed tclsh version.
dnl
AC_DEFUN([DJ_AC_PATH_TCLSH], [
no_itcl=true
AC_MSG_CHECKING(for the tclsh program in tclinclude directory)
AC_ARG_WITH(tclinclude,
AS_HELP_STRING([--with-tclinclude],
[directory where tcl headers are]),
[with_tclinclude=${withval}],[with_tclinclude=''])
AC_CACHE_VAL(ac_cv_path_tclsh,[
dnl first check to see if --with-itclinclude was specified
if test x"${with_tclinclude}" != x ; then
if test -f ${with_tclinclude}/tclsh ; then
ac_cv_path_tclsh=`(cd ${with_tclinclude}; pwd)`
elif test -f ${with_tclinclude}/src/tclsh ; then
ac_cv_path_tclsh=`(cd ${with_tclinclude}/src; pwd)`
else
AC_MSG_ERROR([${with_tclinclude} directory doesn't contain tclsh])
fi
fi
dnl see if one is installed
if test x"${ac_cv_path_tclsh}" = x ; then
AC_MSG_RESULT(none)
AC_PATH_PROGS([TCLSH],[tclsh8.4 tclsh8.4.8 tclsh8.4.7 tclsh8.4.6 tclsh8.4.5 tclsh8.4.4 tclsh8.4.3 tclsh8.4.2 tclsh8.4.1 tclsh8.4.0 tclsh8.3 tclsh8.3.5 tclsh8.3.4 tclsh8.3.3 tclsh8.3.2 tclsh8.3.1 tclsh8.3.0 tclsh])
if test x"${TCLSH}" = x ; then
ac_cv_path_tclsh='';
else
ac_cv_path_tclsh="${TCLSH}";
fi
else
AC_MSG_RESULT(${ac_cv_path_tclsh})
TCLSH="${ac_cv_path_tclsh}"
AC_SUBST(TCLSH)
fi
])])

View File

@@ -0,0 +1,12 @@
#
# This function determins if the the srand48,drand48,lrand48 functions are
# available on this platform.
#
AC_DEFUN([AC_FUNC_RAND48],[
AC_SINGLE_CXX_CHECK([ac_cv_func_rand48],
[srand48/lrand48/drand48], [<stdlib.h>],
[srand48(0);lrand48();drand48();])
if test "$ac_cv_func_rand48" = "yes" ; then
AC_DEFINE([HAVE_RAND48],1,[Define to 1 if srand48/lrand48/drand48 exist in <stdlib.h>])
fi
])

View File

@@ -0,0 +1,10 @@
dnl AC_SINGLE_CXX_CHECK(CACHEVAR, FUNCTION, HEADER, PROGRAM)
dnl $1, $2, $3, $4,
dnl
AC_DEFUN([AC_SINGLE_CXX_CHECK],
[AC_CACHE_CHECK([for $2 in $3], [$1],
[AC_LANG_PUSH([C++])
AC_COMPILE_IFELSE(AC_LANG_PROGRAM([#include $3],[$4]),[$1=yes],[$1=no])
AC_LANG_POP([C++])])
])

353
llvm/autoconf/missing Executable file
View File

@@ -0,0 +1,353 @@
#! /bin/sh
# Common stub for a few missing GNU programs while installing.
scriptversion=2004-09-07.08
# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004
# Free Software Foundation, Inc.
# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
if test $# -eq 0; then
echo 1>&2 "Try \`$0 --help' for more information"
exit 1
fi
run=:
# In the cases where this matters, `missing' is being run in the
# srcdir already.
if test -f configure.ac; then
configure_ac=configure.ac
else
configure_ac=configure.in
fi
msg="missing on your system"
case "$1" in
--run)
# Try to run requested program, and just exit if it succeeds.
run=
shift
"$@" && exit 0
# Exit code 63 means version mismatch. This often happens
# when the user try to use an ancient version of a tool on
# a file that requires a minimum version. In this case we
# we should proceed has if the program had been absent, or
# if --run hadn't been passed.
if test $? = 63; then
run=:
msg="probably too old"
fi
;;
-h|--h|--he|--hel|--help)
echo "\
$0 [OPTION]... PROGRAM [ARGUMENT]...
Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
error status if there is no known handling for PROGRAM.
Options:
-h, --help display this help and exit
-v, --version output version information and exit
--run try to run the given command, and emulate it if it fails
Supported PROGRAM values:
aclocal touch file \`aclocal.m4'
autoconf touch file \`configure'
autoheader touch file \`config.h.in'
automake touch all \`Makefile.in' files
bison create \`y.tab.[ch]', if possible, from existing .[ch]
flex create \`lex.yy.c', if possible, from existing .c
help2man touch the output file
lex create \`lex.yy.c', if possible, from existing .c
makeinfo touch the output file
tar try tar, gnutar, gtar, then tar without non-portable flags
yacc create \`y.tab.[ch]', if possible, from existing .[ch]
Send bug reports to <bug-automake@gnu.org>."
exit 0
;;
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
echo "missing $scriptversion (GNU Automake)"
exit 0
;;
-*)
echo 1>&2 "$0: Unknown \`$1' option"
echo 1>&2 "Try \`$0 --help' for more information"
exit 1
;;
esac
# Now exit if we have it, but it failed. Also exit now if we
# don't have it and --version was passed (most likely to detect
# the program).
case "$1" in
lex|yacc)
# Not GNU programs, they don't have --version.
;;
tar)
if test -n "$run"; then
echo 1>&2 "ERROR: \`tar' requires --run"
exit 1
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
exit 1
fi
;;
*)
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
# We have it, but it failed.
exit 1
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
# Could not run --version or --help. This is probably someone
# running `$TOOL --version' or `$TOOL --help' to check whether
# $TOOL exists and not knowing $TOOL uses missing.
exit 1
fi
;;
esac
# If it does not exist, or fails to run (possibly an outdated version),
# try to emulate it.
case "$1" in
aclocal*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`acinclude.m4' or \`${configure_ac}'. You might want
to install the \`Automake' and \`Perl' packages. Grab them from
any GNU archive site."
touch aclocal.m4
;;
autoconf)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`${configure_ac}'. You might want to install the
\`Autoconf' and \`GNU m4' packages. Grab them from any GNU
archive site."
touch configure
;;
autoheader)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`acconfig.h' or \`${configure_ac}'. You might want
to install the \`Autoconf' and \`GNU m4' packages. Grab them
from any GNU archive site."
files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
test -z "$files" && files="config.h"
touch_files=
for f in $files; do
case "$f" in
*:*) touch_files="$touch_files "`echo "$f" |
sed -e 's/^[^:]*://' -e 's/:.*//'`;;
*) touch_files="$touch_files $f.in";;
esac
done
touch $touch_files
;;
automake*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
You might want to install the \`Automake' and \`Perl' packages.
Grab them from any GNU archive site."
find . -type f -name Makefile.am -print |
sed 's/\.am$/.in/' |
while read f; do touch "$f"; done
;;
autom4te)
echo 1>&2 "\
WARNING: \`$1' is needed, but is $msg.
You might have modified some files without having the
proper tools for further handling them.
You can get \`$1' as part of \`Autoconf' from any GNU
archive site."
file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'`
test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'`
if test -f "$file"; then
touch $file
else
test -z "$file" || exec >$file
echo "#! /bin/sh"
echo "# Created by GNU Automake missing as a replacement of"
echo "# $ $@"
echo "exit 0"
chmod +x $file
exit 1
fi
;;
bison|yacc)
echo 1>&2 "\
WARNING: \`$1' $msg. You should only need it if
you modified a \`.y' file. You may need the \`Bison' package
in order for those modifications to take effect. You can get
\`Bison' from any GNU archive site."
rm -f y.tab.c y.tab.h
if [ $# -ne 1 ]; then
eval LASTARG="\${$#}"
case "$LASTARG" in
*.y)
SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
if [ -f "$SRCFILE" ]; then
cp "$SRCFILE" y.tab.c
fi
SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
if [ -f "$SRCFILE" ]; then
cp "$SRCFILE" y.tab.h
fi
;;
esac
fi
if [ ! -f y.tab.h ]; then
echo >y.tab.h
fi
if [ ! -f y.tab.c ]; then
echo 'main() { return 0; }' >y.tab.c
fi
;;
lex|flex)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified a \`.l' file. You may need the \`Flex' package
in order for those modifications to take effect. You can get
\`Flex' from any GNU archive site."
rm -f lex.yy.c
if [ $# -ne 1 ]; then
eval LASTARG="\${$#}"
case "$LASTARG" in
*.l)
SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
if [ -f "$SRCFILE" ]; then
cp "$SRCFILE" lex.yy.c
fi
;;
esac
fi
if [ ! -f lex.yy.c ]; then
echo 'main() { return 0; }' >lex.yy.c
fi
;;
help2man)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified a dependency of a manual page. You may need the
\`Help2man' package in order for those modifications to take
effect. You can get \`Help2man' from any GNU archive site."
file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
if test -z "$file"; then
file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
fi
if [ -f "$file" ]; then
touch $file
else
test -z "$file" || exec >$file
echo ".ab help2man is required to generate this page"
exit 1
fi
;;
makeinfo)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified a \`.texi' or \`.texinfo' file, or any other file
indirectly affecting the aspect of the manual. The spurious
call might also be the consequence of using a buggy \`make' (AIX,
DU, IRIX). You might want to install the \`Texinfo' package or
the \`GNU make' package. Grab either from any GNU archive site."
file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
if test -z "$file"; then
file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file`
fi
touch $file
;;
tar)
shift
# We have already tried tar in the generic part.
# Look for gnutar/gtar before invocation to avoid ugly error
# messages.
if (gnutar --version > /dev/null 2>&1); then
gnutar "$@" && exit 0
fi
if (gtar --version > /dev/null 2>&1); then
gtar "$@" && exit 0
fi
firstarg="$1"
if shift; then
case "$firstarg" in
*o*)
firstarg=`echo "$firstarg" | sed s/o//`
tar "$firstarg" "$@" && exit 0
;;
esac
case "$firstarg" in
*h*)
firstarg=`echo "$firstarg" | sed s/h//`
tar "$firstarg" "$@" && exit 0
;;
esac
fi
echo 1>&2 "\
WARNING: I can't seem to be able to run \`tar' with the given arguments.
You may want to install GNU tar or Free paxutils, or check the
command line arguments."
exit 1
;;
*)
echo 1>&2 "\
WARNING: \`$1' is needed, and is $msg.
You might have modified some files without having the
proper tools for further handling them. Check the \`README' file,
it often tells you about the needed prerequisites for installing
this package. You may also peek at any GNU archive site, in case
some other package would contain this missing \`$1' program."
exit 1
;;
esac
exit 0
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-end: "$"
# End:

View File

@@ -1,31 +1,56 @@
#! /bin/sh
# mkinstalldirs --- make directory hierarchy
# Author: Noah Friedman <friedman@prep.ai.mit.edu>
# Created: 1993-05-16
# Public domain
# $Id$
scriptversion=2004-02-15.20
# Original author: Noah Friedman <friedman@prep.ai.mit.edu>
# Created: 1993-05-16
# Public domain.
#
# This file is maintained in Automake, please report
# bugs to <bug-automake@gnu.org> or send patches to
# <automake-patches@gnu.org>.
errstatus=0
dirmode=""
usage="\
Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..."
Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ...
Create each directory DIR (with mode MODE, if specified), including all
leading file name components.
Report bugs to <bug-automake@gnu.org>."
# process command line arguments
while test $# -gt 0 ; do
case "${1}" in
-h | --help | --h* ) # -h for help
echo "${usage}" 1>&2; exit 0 ;;
-m ) # -m PERM arg
shift
test $# -eq 0 && { echo "${usage}" 1>&2; exit 1; }
dirmode="${1}"
shift ;;
-- ) shift; break ;; # stop option processing
-* ) echo "${usage}" 1>&2; exit 1 ;; # unknown option
* ) break ;; # first non-opt arg
esac
case $1 in
-h | --help | --h*) # -h for help
echo "$usage"
exit 0
;;
-m) # -m PERM arg
shift
test $# -eq 0 && { echo "$usage" 1>&2; exit 1; }
dirmode=$1
shift
;;
--version)
echo "$0 $scriptversion"
exit 0
;;
--) # stop option processing
shift
break
;;
-*) # unknown option
echo "$usage" 1>&2
exit 1
;;
*) # first non-opt arg
break
;;
esac
done
for file
@@ -38,64 +63,88 @@ do
done
case $# in
0) exit 0 ;;
0) exit 0 ;;
esac
# Solaris 8's mkdir -p isn't thread-safe. If you mkdir -p a/b and
# mkdir -p a/c at the same time, both will detect that a is missing,
# one will create a, then the other will try to create a and die with
# a "File exists" error. This is a problem when calling mkinstalldirs
# from a parallel make. We use --version in the probe to restrict
# ourselves to GNU mkdir, which is thread-safe.
case $dirmode in
'')
if mkdir -p -- . 2>/dev/null; then
echo "mkdir -p -- $*"
exec mkdir -p -- "$@"
fi ;;
*)
if mkdir -m "$dirmode" -p -- . 2>/dev/null; then
echo "mkdir -m $dirmode -p -- $*"
exec mkdir -m "$dirmode" -p -- "$@"
fi ;;
'')
if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
# echo "mkdir -p -- $*"
exec mkdir -p -- "$@"
else
# On NextStep and OpenStep, the `mkdir' command does not
# recognize any option. It will interpret all options as
# directories to create, and then abort because `.' already
# exists.
test -d ./-p && rmdir ./-p
test -d ./--version && rmdir ./--version
fi
;;
*)
if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 &&
test ! -d ./--version; then
# echo "mkdir -m $dirmode -p -- $*"
exec mkdir -m "$dirmode" -p -- "$@"
else
# Clean up after NextStep and OpenStep mkdir.
for d in ./-m ./-p ./--version "./$dirmode";
do
test -d $d && rmdir $d
done
fi
;;
esac
for file
do
set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
shift
set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
shift
pathcomp=
for d
do
pathcomp="$pathcomp$d"
case "$pathcomp" in
-* ) pathcomp=./$pathcomp ;;
esac
pathcomp=
for d
do
pathcomp="$pathcomp$d"
case $pathcomp in
-*) pathcomp=./$pathcomp ;;
esac
if test ! -d "$pathcomp"; then
echo "mkdir $pathcomp"
if test ! -d "$pathcomp"; then
# echo "mkdir $pathcomp"
mkdir "$pathcomp" || lasterr=$?
mkdir "$pathcomp" || lasterr=$?
if test ! -d "$pathcomp"; then
errstatus=$lasterr
else
if test ! -z "$dirmode"; then
echo "chmod $dirmode $pathcomp"
if test ! -d "$pathcomp"; then
errstatus=$lasterr
else
if test ! -z "$dirmode"; then
# echo "chmod $dirmode $pathcomp"
lasterr=""
chmod "$dirmode" "$pathcomp" || lasterr=$?
lasterr=""
chmod "$dirmode" "$pathcomp" || lasterr=$?
if test ! -z "$lasterr"; then
errstatus=$lasterr
fi
if test ! -z "$lasterr"; then
errstatus=$lasterr
fi
fi
fi
fi
fi
pathcomp="$pathcomp/"
done
pathcomp="$pathcomp/"
done
done
exit $errstatus
# Local Variables:
# mode: shell-script
# sh-indentation: 3
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-end: "$"
# End:
# mkinstalldirs ends here

15580
llvm/configure vendored

File diff suppressed because it is too large Load Diff

2
llvm/docs/.cvsignore Normal file
View File

@@ -0,0 +1,2 @@
doxygen.cfg

View File

@@ -274,7 +274,6 @@ memory location to be modified.</p>
</div>
<!-- _______________________________________________________________________ -->
<div class="doc_subsubsection">
<a name="simplemodref">The <tt>doesNotAccessMemory</tt> and
@@ -304,8 +303,6 @@ functions that satisfy the <tt>doesNotAccessMemory</tt> method also satisfies
</div>
<!-- *********************************************************************** -->
<div class="doc_section">
<a name="writingnew">Writing a new <tt>AliasAnalysis</tt> Implementation</a>

View File

@@ -1,33 +1,63 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<title>LLVM: bugpoint tool</title>
<head>
<title>LLVM bugpoint tool: design and usage</title>
<link rel="stylesheet" href="llvm.css" type="text/css">
</head>
<body bgcolor=white>
<div class="doc_title">
LLVM bugpoint tool: design and usage
</div>
<center><h1>LLVM: <tt>bugpoint</tt> tool</h1></center>
<HR>
<ul>
<li><a href="#desc">Description</a></li>
<li><a href="#design">Design Philosophy</a>
<ul>
<li><a href="#autoselect">Automatic Debugger Selection</a></li>
<li><a href="#crashdebug">Crash debugger</a></li>
<li><a href="#codegendebug">Code generator debugger</a></li>
<li><a href="#miscompilationdebug">Miscompilation debugger</a></li>
</ul></li>
<li><a href="#advice">Advice for using <tt>bugpoint</tt></a></li>
</ul>
<h3>NAME</h3>
<tt>bugpoint</tt>
<div class="doc_author">
<p>Written by <a href="mailto:sabre@nondot.org">Chris Lattner</a></p>
</div>
<h3>SYNOPSIS</h3>
<tt>bugpoint [options] [input LLVM ll/bc files] [LLVM passes] --args &lt;program arguments&gt;...</tt>
<!-- *********************************************************************** -->
<div class="doc_section">
<a name="desc">Description</a>
</div>
<!-- *********************************************************************** -->
<img src="img/Debugging.gif" width=444 height=314 align=right>
<h3>DESCRIPTION</h3>
<div class="doc_text">
The <tt>bugpoint</tt> tool narrows down the source of
problems in LLVM tools and passes. It can be used to debug three types of
failures: optimizer crashes, miscompilations by optimizers, or bad native
code generation (including problems in the static and JIT compilers). It aims
to reduce large test cases to small, useful ones. For example,
if <tt><a href="CommandGuide/gccas.html">gccas</a></tt> crashes while optimizing a file, it
will identify the optimization (or combination of optimizations) that causes the
crash, and reduce the file down to a small example which triggers the crash.<p>
<p><tt>bugpoint</tt> narrows down the source of problems in LLVM tools and
passes. It can be used to debug three types of failures: optimizer crashes,
miscompilations by optimizers, or bad native code generation (including problems
in the static and JIT compilers). It aims to reduce large test cases to small,
useful ones. For example, if <tt>gccas</tt> crashes while optimizing a
file, it will identify the optimization (or combination of optimizations) that
causes the crash, and reduce the file down to a small example which triggers the
crash.</p>
<a name="designphilosophy">
<h4>Design Philosophy</h4>
<p>For detailed case scenarios, such as debugging <tt>gccas</tt>,
<tt>gccld</tt>, or one of the LLVM code generators, see <a
href="HowToSubmitABug.html">How To Submit a Bug Report document</a>.</p>
<tt>bugpoint</tt> is designed to be a useful tool without requiring any
</div>
<!-- *********************************************************************** -->
<div class="doc_section">
<a name="design">Design Philosophy</a>
</div>
<!-- *********************************************************************** -->
<div class="doc_text">
<p><tt>bugpoint</tt> is designed to be a useful tool without requiring any
hooks into the LLVM infrastructure at all. It works with any and all LLVM
passes and code generators, and does not need to "know" how they work. Because
of this, it may appear to do stupid things or miss obvious
@@ -36,47 +66,57 @@ time for computer time in the compiler-debugging process; consequently, it may
take a long period of (unattended) time to reduce a test case, but we feel it
is still worth it. Note that <tt>bugpoint</tt> is generally very quick unless
debugging a miscompilation where each test of the program (which requires
executing it) takes a long time.<p>
executing it) takes a long time.</p>
<a name="automaticdebuggerselection">
<h4>Automatic Debugger Selection</h4>
</div>
<tt>bugpoint</tt> reads each <tt>.bc</tt> or <tt>.ll</tt> file
specified on the command line and links them together into a single module,
called the test program. If any LLVM passes are
specified on the command line, it runs these passes on the test program. If
any of the passes crash, or if they produce malformed output (which causes the
verifier to abort),
<tt>bugpoint</tt> starts the <a href="#crashdebug">crash debugger</a>.<p>
<!-- ======================================================================= -->
<div class="doc_subsection">
<a name="autoselect">Automatic Debugger Selection</a>
</div>
Otherwise, if the <a href="#opt_output"><tt>-output</tt></a> option was not
specified, <tt>bugpoint</tt> runs the test program with the C backend (which is
assumed to generate good code) to generate a reference output. Once
<tt>bugpoint</tt> has a reference output for the test program, it tries
executing it with the <a href="#opt_run-">selected</a> code generator. If the
selected code generator crashes, <tt>bugpoint</tt> starts the <a
href="#crashdebug">crash debugger</a> on the code generator. Otherwise, if the
resulting output differs from the reference output, it assumes the difference
resulted from a code generator failure, and starts the <a
href="#codegendebug">code generator debugger</a>.<p>
<div class="doc_text">
Finally, if the output of the selected code generator matches the reference
<p><tt>bugpoint</tt> reads each <tt>.bc</tt> or <tt>.ll</tt> file specified on
the command line and links them together into a single module, called the test
program. If any LLVM passes are specified on the command line, it runs these
passes on the test program. If any of the passes crash, or if they produce
malformed output (which causes the verifier to abort), <tt>bugpoint</tt> starts
the <a href="#crashdebug">crash debugger</a>.</p>
<p>Otherwise, if the <tt>-output</tt> option was not specified,
<tt>bugpoint</tt> runs the test program with the C backend (which is assumed to
generate good code) to generate a reference output. Once <tt>bugpoint</tt> has
a reference output for the test program, it tries executing it with the
selected code generator. If the selected code generator crashes,
<tt>bugpoint</tt> starts the <a href="#crashdebug">crash debugger</a> on the
code generator. Otherwise, if the resulting output differs from the reference
output, it assumes the difference resulted from a code generator failure, and
starts the <a href="#codegendebug">code generator debugger</a>.</p>
<p>Finally, if the output of the selected code generator matches the reference
output, <tt>bugpoint</tt> runs the test program after all of the LLVM passes
have been applied to it. If its output differs from the reference output, it
assumes the difference resulted from a failure in one of the LLVM passes, and
enters the <a href="#miscompilationdebug">miscompilation
debugger</a>. Otherwise, there is no problem <tt>bugpoint</tt> can debug.<p>
enters the <a href="#miscompilationdebug">miscompilation debugger</a>.
Otherwise, there is no problem <tt>bugpoint</tt> can debug.</p>
<a name="crashdebug">
<h4>Crash debugger</h4>
</div>
If an optimizer or code generator crashes, <tt>bugpoint</tt> will try as hard as
it can to reduce the list of passes (for optimizer crashes) and the size of the
test program. First, <tt>bugpoint</tt> figures out which combination of
<!-- ======================================================================= -->
<div class="doc_subsection">
<a name="crashdebug">Crash debugger</a>
</div>
<div class="doc_text">
<p>If an optimizer or code generator crashes, <tt>bugpoint</tt> will try as hard
as it can to reduce the list of passes (for optimizer crashes) and the size of
the test program. First, <tt>bugpoint</tt> figures out which combination of
optimizer passes triggers the bug. This is useful when debugging a problem
exposed by <tt>gccas</tt>, for example, because it runs over 38 passes.<p>
exposed by <tt>gccas</tt>, for example, because it runs over 38 passes.</p>
Next, <tt>bugpoint</tt> tries removing functions from the test program, to
<p>Next, <tt>bugpoint</tt> tries removing functions from the test program, to
reduce its size. Usually it is able to reduce a test program to a single
function, when debugging intraprocedural optimizations. Once the number of
functions has been reduced, it attempts to delete various edges in the control
@@ -84,38 +124,55 @@ flow graph, to reduce the size of the function as much as possible. Finally,
<tt>bugpoint</tt> deletes any individual LLVM instructions whose absence does
not eliminate the failure. At the end, <tt>bugpoint</tt> should tell you what
passes crash, give you a bytecode file, and give you instructions on how to
reproduce the failure with <tt><a href="CommandGuide/opt.html">opt</a></tt>, <tt><a
href="CommandGuide/analyze.html">analyze</a></tt>, or <tt><a href="CommandGuide/llc.html">llc</a></tt>.<p>
reproduce the failure with <tt>opt</tt>, <tt>analyze</tt>, or <tt>llc</tt>.</p>
<a name="codegendebug">
<h4>Code generator debugger</h4>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection">
<a name="codegendebug">Code generator debugger</a>
</div>
<div class="doc_text">
<p>The code generator debugger attempts to narrow down the amount of code that
is being miscompiled by the <a href="#opt_run-">selected</a> code generator. To
do this, it takes the test program and partitions it into two pieces: one piece
which it compiles with the C backend (into a shared object), and one piece which
it runs with either the JIT or the static LLC compiler. It uses several
techniques to reduce the amount of code pushed through the LLVM code generator,
to reduce the potential scope of the problem. After it is finished, it emits
two bytecode files (called "test" [to be compiled with the code generator] and
"safe" [to be compiled with the C backend], respectively), and instructions for
reproducing the problem. The code generator debugger assumes that the C backend
produces good code.</p>
is being miscompiled by the selected code generator. To do this, it takes the
test program and partitions it into two pieces: one piece which it compiles
with the C backend (into a shared object), and one piece which it runs with
either the JIT or the static LLC compiler. It uses several techniques to
reduce the amount of code pushed through the LLVM code generator, to reduce the
potential scope of the problem. After it is finished, it emits two bytecode
files (called "test" [to be compiled with the code generator] and "safe" [to be
compiled with the C backend], respectively), and instructions for reproducing
the problem. The code generator debugger assumes that the C backend produces
good code.</p>
<a name="miscompilationdebug">
<h4>Miscompilation debugger</h4>
</div>
The miscompilation debugger works similarly to the code generator
debugger. It works by splitting the test program into two pieces, running the
optimizations specified on one piece, linking the two pieces back together,
and then executing the result.
It attempts to narrow down the list of passes to the one (or few) which are
causing the miscompilation, then reduce the portion of the test program which is
being miscompiled. The miscompilation debugger assumes that the selected
code generator is working properly.<p>
<!-- ======================================================================= -->
<div class="doc_subsection">
<a name="miscompilationdebug">Miscompilation debugger</a>
</div>
<a name="bugpoint notes">
<h4>Advice for using <tt>bugpoint</tt></h4>
<div class="doc_text">
<p>The miscompilation debugger works similarly to the code generator debugger.
It works by splitting the test program into two pieces, running the
optimizations specified on one piece, linking the two pieces back together, and
then executing the result. It attempts to narrow down the list of passes to
the one (or few) which are causing the miscompilation, then reduce the portion
of the test program which is being miscompiled. The miscompilation debugger
assumes that the selected code generator is working properly.</p>
</div>
<!-- *********************************************************************** -->
<div class="doc_section">
<a name="advice">Advice for using bugpoint</a>
</div>
<!-- *********************************************************************** -->
<div class="doc_text">
<tt>bugpoint</tt> can be a remarkably useful tool, but it sometimes works in
non-obvious ways. Here are some hints and tips:<p>
@@ -123,10 +180,10 @@ non-obvious ways. Here are some hints and tips:<p>
<ol>
<li>In the code generator and miscompilation debuggers, <tt>bugpoint</tt> only
works with programs that have deterministic output. Thus, if the program
outputs <tt>argv[0]</tt>, the date, time, or any other "random" data, <tt>bugpoint</tt> may
misinterpret differences in these data, when output, as the result of a
miscompilation. Programs should be temporarily modified to disable
outputs that are likely to vary from run to run.
outputs <tt>argv[0]</tt>, the date, time, or any other "random" data,
<tt>bugpoint</tt> may misinterpret differences in these data, when output,
as the result of a miscompilation. Programs should be temporarily modified
to disable outputs that are likely to vary from run to run.
<li>In the code generator and miscompilation debuggers, debugging will go
faster if you manually modify the program or its inputs to reduce the
@@ -135,15 +192,19 @@ non-obvious ways. Here are some hints and tips:<p>
<li><tt>bugpoint</tt> is extremely useful when working on a new optimization:
it helps track down regressions quickly. To avoid having to relink
<tt>bugpoint</tt> every time you change your optimization however, have
<tt>bugpoint</tt> dynamically load your optimization with the <a
href="#opt_load"><tt>-load</tt></a> option.
<tt>bugpoint</tt> dynamically load your optimization with the
<tt>-load</tt> option.
<li><tt>bugpoint</tt> can generate a lot of output and run for a long period of
time. It is often useful to capture the output of the program to file. For
example, in the C shell, you can type:<br>
<tt>bugpoint ..... |&amp; tee bugpoint.log</tt>
<br>to get a copy of <tt>bugpoint</tt>'s output in the file
<tt>bugpoint.log</tt>, as well as on your terminal.
<li><p><tt>bugpoint</tt> can generate a lot of output and run for a long period
of time. It is often useful to capture the output of the program to file.
For example, in the C shell, you can run:</p>
<div class="doc_code">
<p><tt>bugpoint ... |&amp; tee bugpoint.log</tt></p>
</div>
<p>to get a copy of <tt>bugpoint</tt>'s output in the file
<tt>bugpoint.log</tt>, as well as on your terminal.</p>
<li><tt>bugpoint</tt> cannot debug problems with the LLVM linker. If
<tt>bugpoint</tt> crashes before you see its "All input ok" message,
@@ -157,89 +218,21 @@ non-obvious ways. Here are some hints and tips:<p>
</ol>
<h3>OPTIONS</h3>
</div>
<ul>
<li><tt>-additional-so &lt;library&gt;</tt><br>
Load <tt>&lt;library&gt;</tt> into the test program whenever it is run.
This is useful if you are debugging programs which depend on non-LLVM
libraries (such as the X or curses libraries) to run.<p>
<!-- *********************************************************************** -->
<li><tt>-args &lt;program args&gt;</tt><br>
Pass all arguments specified after <tt>-args</tt> to the
test program whenever it runs. Note that if any of
the <tt>&lt;program args&gt;</tt> start with a '-', you should use:
<p>
<tt>bugpoint &lt;bugpoint args&gt; -args -- &lt;program args&gt;</tt>
<p>
The "<tt>--</tt>" right after the <tt>-args</tt> option tells
<tt>bugpoint</tt> to consider any options starting with <tt>-</tt> to be
part of the <tt>-args</tt> option, not as options to <tt>bugpoint</tt>
itself.<p>
<hr>
<address>
<a href="http://jigsaw.w3.org/css-validator/check/referer"><img
src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a>
<a href="http://validator.w3.org/check/referer"><img
src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!"></a>
<li><tt>-tool-args &lt;tool args&gt;</tt><br>
Pass all arguments specified after <tt>-tool-args</tt> to the
LLVM tool under test (llc, lli, etc.) whenever it runs.
You should use this option in the following way:
<p>
<tt>bugpoint &lt;bugpoint args&gt; -tool-args -- &lt;tool args&gt;</tt>
<p>
The "<tt>--</tt>" right after the <tt>-tool-args</tt> option tells
<tt>bugpoint</tt> to consider any options starting with <tt>-</tt> to be
part of the <tt>-tool-args</tt> option, not as options to
<tt>bugpoint</tt> itself. (See <tt>-args</tt>, above.)<p>
<a href="mailto:sabre@nondot.org">Chris Lattner</a><br>
<a href="http://llvm.cs.uiuc.edu">LLVM Compiler Infrastructure</a><br>
Last modified: $Date$
</address>
<li><tt>-check-exit-code={true,false}</tt><br>
Assume a non-zero exit code or core dump from the test program is
a failure. Defaults to true.<p>
<li><tt>-disable-{dce,simplifycfg}</tt><br>
Do not run the specified passes to clean up and reduce the size of the
test program. By default, <tt>bugpoint</tt> uses these passes internally
when attempting to reduce test programs. If you're trying to find
a bug in one of these passes, <tt>bugpoint</tt> may crash.<p>
<li> <tt>-help</tt><br>
Print a summary of command line options.<p>
<a name="opt_input"><li><tt>-input &lt;filename&gt;</tt><br>
Open <tt>&lt;filename&gt;</tt> and redirect the standard input of the
test program, whenever it runs, to come from that file.
<p>
<a name="opt_load"><li> <tt>-load &lt;plugin&gt;</tt><br>
Load the dynamic object <tt>&lt;plugin&gt;</tt> into <tt>bugpoint</tt>
itself. This object should register new
optimization passes. Once loaded, the object will add new command line
options to enable various optimizations. To see the new complete list
of optimizations, use the -help and -load options together:
<p>
<tt>bugpoint -load &lt;plugin&gt; -help</tt>
<p>
<a name="opt_output"><li><tt>-output &lt;filename&gt;</tt><br>
Whenever the test program produces output on its standard output
stream, it should match the contents of <tt>&lt;filename&gt;</tt>
(the "reference output"). If you do not use this option,
<tt>bugpoint</tt> will attempt to generate a reference output by
compiling the program with the C backend and running it.<p>
<li><tt>-profile-info-file &lt;filename&gt;</tt><br>
Profile file loaded by -profile-loader.<p>
<a name="opt_run-"><li><tt>-run-{int,jit,llc,cbe}</tt><br>
Whenever the test program is compiled, <tt>bugpoint</tt> should generate
code for it using the specified code generator. These options allow
you to choose the interpreter, the JIT compiler, the static native
code compiler, or the C backend, respectively.<p>
</ul>
<h3>EXIT STATUS</h3>
If <tt>bugpoint</tt> succeeds in finding a problem, it will exit with 0.
Otherwise, if an error occurs, it will exit with a non-zero value.
<HR>
Maintained by the <a href="http://llvm.cs.uiuc.edu">LLVM Team</a>.
</body>
</html>

View File

@@ -1,6 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>LLVM Bytecode File Format</title>
<link rel="stylesheet" href="llvm.css" type="text/css">
<style type="text/css">
@@ -39,11 +40,13 @@
<li><a href="#functiondefs">Function Definition</a></li>
<li><a href="#compactiontable">Compaction Table</a></li>
<li><a href="#instructionlist">Instruction List</a></li>
<li><a href="#opcodes">Instruction Opcodes</a></li>
<li><a href="#symtab">Symbol Table</a></li>
</ol>
</li>
<li><a href="#versiondiffs">Version Differences</a>
<ol>
<li><a href="#vers13">Version 1.3 Differences From 1.4</a></li>
<li><a href="#vers12">Version 1.2 Differences From 1.3</a></li>
<li><a href="#vers11">Version 1.1 Differences From 1.2</a></li>
<li><a href="#vers10">Version 1.0 Differences From 1.1</a></li>
@@ -397,10 +400,9 @@ slot numbers with their "type plane". That is, Values of the same type
are written to the bytecode file in a list (sequentially). Their order in
that list determines their slot number. This means that slot #1 doesn't mean
anything unless you also specify for which type you want slot #1. Types are
handled specially and are always written to the file first (in the <a
href="#globaltypes">Global Type Pool</a>) and in such a way that both forward
and backward references of the types can often be resolved with a single pass
through the type pool. </p>
always written to the file first (in the <a href="#globaltypes">Global Type
Pool</a>) and in such a way that both forward and backward references of the
types can often be resolved with a single pass through the type pool. </p>
<p>Slot numbers are also kept small by rearranging their order. Because
of the structure of LLVM, certain values are much more likely to be used
frequently in the body of a function. For this reason, a compaction table is
@@ -409,6 +411,10 @@ smaller. Suppose you have a function body that uses just the types "int*" and
"{double}" but uses them thousands of time. Its worthwhile to ensure that the
slot number for these types are low so they can be encoded in a single byte
(via vbr). This is exactly what the compaction table does.</p>
<p>In summary then, a slot number can be though of as just a vbr encoded index
into a list of Type* or Value*. To keep slot numbers low, Value* are indexed by
two slot numbers: the "type plane index" (type slot) and the "value index"
(value slot).</p>
</div>
<!-- *********************************************************************** -->
<div class="doc_section"> <a name="general">General Structure</a> </div>
@@ -574,30 +580,57 @@ bytecode file. This block is always four bytes in length and differs from the
other blocks because there is no identifier and no block length at the start
of the block. Essentially, this block is just the "magic number" for the file.
</p>
<p>There are two types of signatures for LLVM bytecode: uncompressed and
compressed as shown in the table below. </p>
<table>
<tbody>
<tr>
<th><b>Type</b></th>
<th class="td_left"><b>Field Description</b></th>
<th class="td_left"><b>Uncompressed</b></th>
<th class="td_left"><b>Compressed</b></th>
</tr>
<tr>
<td><a href="#char">char</a></td>
<td class="td_left">Constant "l" (0x6C)</td>
<td class="td_left">Constant "l" (0x6C)</td>
</tr>
<tr>
<td><a href="#char">char</a></td>
<td class="td_left">Constant "l" (0x6C)</td>
<td class="td_left">Constant "l" (0x6C)</td>
</tr>
<tr>
<td><a href="#char">char</a></td>
<td class="td_left">Constant "v" (0x76)</td>
<td class="td_left">Constant "v" (0x76)</td>
</tr>
<tr>
<td><a href="#char">char</a></td>
<td class="td_left">Constant "m" (0x6D)</td>
<td class="td_left">Constant "c" (0x63)</td>
</tr>
<tr>
<td><a href="#char">char</a></td>
<td class="td_left">N/A</td>
<td class="td_left">'0'=null,'1'=gzip,'2'=bzip2</td>
</tr>
</tbody>
</table>
<p>In other words, the uncompressed signature is just the characters 'llvm'
while the compressed signature is the characters 'llvc' followed by an ascii
digit ('0', '1', or '2') that indicates the kind of compression used. A value of
'0' indicates that null compression was used. This can happen when compression
was requested on a platform that wasn't configured for gzip or bzip2. A value of
'1' means that the rest of the file is compressed using the gzip algorithm and
should be uncompressed before interpretation. A value of '2' means that the rest
of the file is compressed using the bzip2 algorithm and should be uncompressed
before interpretation. In all cases, the data resulting from uncompression
should be interpreted as if it occurred immediately after the 'llvm'
signature (i.e. the uncompressed data begins with the
<a href="#module">Module Block</a></p>
<p><b>NOTE:</b> As of LLVM 1.4, all bytecode files produced by the LLVM tools
are compressed by default. To disable compression, pass the
<tt>--disable-compression</tt> option to the tool, if it supports it.
</div>
<!-- _______________________________________________________________________ -->
<div class="doc_subsection"><a name="module">Module Block</a> </div>
@@ -614,10 +647,13 @@ sections.</p>
<th class="td_left"><b>Field Description</b></th>
</tr>
<tr>
<td><a href="#block">block</a><br>
</td>
<td class="td_left">Module Block Identifier (0x01) and Size<br>
</td>
<td><a href="#unsigned">unsigned</a><br></td>
<td class="td_left"><a href="#mod_header">Module Block Identifier
(0x01)</a></td>
</tr>
<tr>
<td><a href="#unsigned">unsigned</a></td>
<td class="td_left"><a href="#mod_header">Module Block Size</a></td>
</tr>
<tr>
<td><a href="#uint32_vbr">uint32_vbr</a></td>
@@ -641,11 +677,26 @@ sections.</p>
</tr>
<tr>
<td><a href="#block">block</a></td>
<td class="td_left"><a href="#symboltable">Module Symbol Table</a></td>
<td class="td_left"><a href="#symtab">Module Symbol Table</a></td>
</tr>
</tbody>
</table>
</div>
<!-- _______________________________________________________________________ -->
<div class="doc_subsubsection"><a name="mod_header">Module Block Header</a></div>
<div class="doc_text">
<p>The block header for the module block uses a longer format than the other
blocks in a bytecode file. Specifically, instead of encoding the type and size
of the block into a 32-bit integer with 5-bits for type and 27-bits for size,
the module block header uses two 32-bit unsigned values, one for type, and one
for size. While the 2<sup>27</sup> byte limit on block size is sufficient for the blocks
contained in the module, it isn't sufficient for the module block itself
because we want to ensure that bytecode files as large as 2<sup>32</sup> bytes
are possible. For this reason, the module block (and only the module block)
uses a long format header.</p>
</div>
<!-- _______________________________________________________________________ -->
<div class="doc_subsubsection"><a name="format">Format Information</a></div>
<div class="doc_text">
@@ -702,7 +753,7 @@ triples</a>.
<div class="doc_subsection"><a name="globaltypes">Global Type Pool</a> </div>
<div class="doc_text">
<p>The global type pool consists of type definitions. Their order of appearance
in the file determines their slot number (0 based). Slot numbers are
in the file determines their type slot number (0 based). Slot numbers are
used to replace pointers in the intermediate representation. Each slot number
uniquely identifies one entry in a type plane (a collection of values of the
same type). Since all values have types and are associated with the order in
@@ -736,7 +787,7 @@ table below.</p>
of type, as given in the following sections.</p>
<h3>Primitive Types</h3>
<p>The primitive types encompass the basic integer and floating point
types</p>
types. They are encoded simply as their TypeID.</p>
<table>
<tbody>
<tr>
@@ -784,11 +835,11 @@ following mapping:
</tr>
<tr>
<td><a href="#uint24_vbr">uint24_vbr</a></td>
<td class="td_left">Slot number of function's return type.</td>
<td class="td_left">Type slot number of function's return type.</td>
</tr>
<tr>
<td><a href="#llist">llist</a>(<a href="#uint24_vbr">uint24_vbr</a>)</td>
<td class="td_left">Slot number of each argument's type.</td>
<td class="td_left">Type slot number of each argument's type.</td>
</tr>
<tr>
<td><a href="#uint32_vbr">uint32_vbr</a>?</td>
@@ -827,7 +878,7 @@ missing otherwise.</td>
</tr>
<tr>
<td><a href="#uint24_vbr">uint24_vbr</a></td>
<td class="td_left">Slot number of array's element type.</td>
<td class="td_left">Type slot number of array's element type.</td>
</tr>
<tr>
<td><a href="#uint32_vbr">uint32_vbr</a></td>
@@ -848,7 +899,7 @@ missing otherwise.</td>
</tr>
<tr>
<td><a href="#uint24_vbr">uint24_vbr</a></td>
<td class="td_left">Slot number of pointer's element type.</td>
<td class="td_left">Type slot number of pointer's element type.</td>
</tr>
</tbody>
</table>
@@ -865,6 +916,27 @@ missing otherwise.</td>
</tr>
</tbody>
</table>
<h3>Packed Types</h3>
<table>
<tbody>
<tr>
<th><b>Type</b></th>
<th class="td_left"><b>Description</b></th>
</tr>
<tr>
<td><a href="#uint24_vbr">uint24_vbr</a></td>
<td class="td_left">Type ID for Packed Types (18)</td>
</tr>
<tr>
<td><a href="#uint24_vbr">uint24_vbr</a></td>
<td class="td_left">Slot number of packed vector's element type.</td>
</tr>
<tr>
<td><a href="#uint32_vbr">uint32_vbr</a></td>
<td class="td_left">The number of elements in the packed vector.</td>
</tr>
</tbody>
</table>
</div>
<!-- _______________________________________________________________________ -->
<div class="doc_subsection"><a name="globalinfo">Module Global Info</a>
@@ -887,12 +959,12 @@ all functions. The format is shown in the table below:</p>
<tr>
<td><a href="#zlist">zlist</a>(<a href="#globalvar">globalvar</a>)</td>
<td class="td_left">A zero terminated list of global var
definitions occuring in the module.</td>
definitions occurring in the module.</td>
</tr>
<tr>
<td><a href="#zlist">zlist</a>(<a href="#uint24_vbr">uint24_vbr</a>)</td>
<td class="td_left">A zero terminated list of function types
occuring in the module.</td>
<td><a href="#zlist">zlist</a>(<a href="#funcfield">funcfield</a>)</td>
<td class="td_left">A zero terminated list of function definitions
occurring in the module.</td>
</tr>
<tr>
<td style="vertical-align: top;"><a href="#llist">llist</a>(<a
@@ -914,6 +986,7 @@ platform independent module).<br>
</tbody>
</table>
</div>
<!-- _______________________________________________________________________ -->
<div class="doc_subsubsection"><a name="globalvar">Global Variable Field</a>
</div>
@@ -946,7 +1019,7 @@ follows. </td>
</tr>
<tr>
<td><a href="#bit">bit(5-31)</a></td>
<td class="td_left">Slot number of type for the global variable.</td>
<td class="td_left">Type slot number of type for the global variable.</td>
</tr>
</tbody>
</table>
@@ -961,12 +1034,52 @@ the global variable field, if it has one.</p>
<tr>
<td>(<a href="#zlist">zlist</a>(<a href="#uint32_vbr">uint32_vbr</a>))?
</td>
<td class="td_left">An optional zero-terminated list of slot
<td class="td_left">An optional zero-terminated list of value slot
numbers of the global variable's constant initializer.</td>
</tr>
</tbody>
</table>
</div>
<!-- _______________________________________________________________________ -->
<div class="doc_subsubsection"><a name="funcfield">Function Field</a>
</div>
<div class="doc_text">
<p>Functions are written using an <a href="#uint32_vbr">uint32_vbr</a>
that encodes information about the function and a set of flags.</p>
<p>The table below provides the bit layout of the <a
href="#uint32_vbr">uint32_vbr</a> that describes the function.</p>
<table>
<tbody>
<tr>
<th><b>Type</b></th>
<th class="td_left"><b>Description</b></th>
</tr>
<tr>
<td><a href="#bit">bit(0-3)</a></td>
<td class="td_left">
Encodes the calling convention number of the function. If this number is
zero, this field is followed by a vbr indicating the CC#. Otherwise, the
CC number of the function is the value of this field minus one.
</td>
</tr>
<tr>
<td><a href="#bit">bit(4)</a></td>
<td class="td_left">If this bit is set to 1, the indicated function is
external, and there is no <a href="#functiondefs">Function Definiton
Block</a> in the bytecode file for the function.</td>
</tr>
<tr>
<td><a href="#bit">bit(5-)</a></td>
<td class="td_left">Type slot number of type for the function.</td>
</tr>
</tbody>
</table>
</div>
<!-- _______________________________________________________________________ -->
<div class="doc_subsection"><a name="constantpool">Constant Pool</a> </div>
<div class="doc_text">
@@ -1011,7 +1124,7 @@ uniquely from other constant planes that follow. </td>
</tr>
<tr>
<td><a href="#uint24_vbr">uint24_vbr</a>+</td>
<td class="td_left">Slot number of the constant string's type.
<td class="td_left">Type slot number of the constant string's type.
Note that the constant string's type implicitly defines the length of
the string. </td>
</tr>
@@ -1046,7 +1159,7 @@ for the details. </p>
<!-- _______________________________________________________________________ -->
<div class="doc_subsubsection"><a name="constant">Constant Field</a></div>
<div class="doc_text">
<p>Constants come in many shapes and flavors. The sections that followe
<p>Constants come in many shapes and flavors. The sections that follow
define the format for each of them. All constants start with a <a
href="#uint32_vbr">uint32_vbr</a> encoded integer that provides the
number of operands for the constant. For primitive, structure, and
@@ -1064,14 +1177,19 @@ corresponding value. </li>
<li><b>Floating Point</b>. Both the float and double types are
written literally in binary format.</li>
<li><b>Arrays</b>. Arrays are written simply as a list of <a
href="#uint32_vbr">uint32_vbr</a> encoded slot numbers to the constant
href="#uint32_vbr">uint32_vbr</a> encoded value slot numbers to the constant
element values.</li>
<li><b>Structures</b>. Structures are written simply as a list of <a
href="#uint32_vbr">uint32_vbr</a> encoded slot numbers to the constant
href="#uint32_vbr">uint32_vbr</a> encoded value slot numbers to the constant
field values of the structure.</li>
</ul>
<p>When the number of operands to the constant is non-zero, we have a
constant expression and its field format is provided in the table below.</p>
<p>When the number of operands to the constant is one, we have an 'undef' value
of the specified type.</p>
<p>When the number of operands to the constant is greater than one, we have a
constant expression and its field format is provided in the table below, and the
number is equal to the number of operands+1.</p>
<table>
<tbody>
<tr>
@@ -1085,12 +1203,12 @@ expression.</td>
</tr>
<tr>
<td><a href="#uint32_vbr">uint32_vbr</a></td>
<td class="td_left">The slot number of the constant value for an
<td class="td_left">The value slot number of the constant value for an
operand.<sup>1</sup></td>
</tr>
<tr>
<td><a href="#uint24_vbr">uint24_vbr</a></td>
<td class="td_left">The slot number for the type of the constant
<td class="td_left">The type slot number for the type of the constant
value for an operand.<sup>1</sup></td>
</tr>
</tbody>
@@ -1141,7 +1259,7 @@ list</a> for the function.</td>
</tr>
<tr>
<td><a href="#block">block</a></td>
<td class="td_left">The function's <a href="#symboltable">symbol
<td class="td_left">The function's <a href="#symtab">symbol
table</a> containing only those symbols pertinent to the function
(mostly block labels).</td>
</tr>
@@ -1162,7 +1280,7 @@ save bytecode space. If not, then a regular constant pool is written.</li>
<div class="doc_text">
<p>Compaction tables are part of a function definition. They are merely
a device for reducing the size of bytecode files. The size of a
bytecode file is dependent on the <em>value</em> of the slot numbers
bytecode file is dependent on the <em>values</em> of the slot numbers
used because larger values use more bytes in the variable bit rate
encoding scheme. Furthermore, the compressed instruction format
reserves only six bits for the type of the instruction. In large
@@ -1185,7 +1303,7 @@ both. Compaction tables have the format shown in the table below.</p>
</tr>
<tr>
<td><a href="#uint24_vbr">uint24_vbr</a>+</td>
<td class="td_left">The slot number in the global type plane of
<td class="td_left">The type slot number in the global types of
the type that will be referenced in the function with the index of this
entry in the compaction table.</td>
</tr>
@@ -1198,9 +1316,9 @@ details.</td>
</tr>
<tr>
<td><a href="#uint32_vbr">uint32_vbr</a>+</td>
<td class="td_left">The slot number in the globals of the value
<td class="td_left">The value slot number in the global values
that will be referenced in the function with the index of this entry in
the compaction table</td>
the compaction table.</td>
</tr>
</tbody>
</table>
@@ -1218,8 +1336,7 @@ encoding uses a <a href="#uint32_vbr">uint32_vbr</a> for each of the
length and type, in that order.</p>
</div>
<!-- _______________________________________________________________________ -->
<div class="doc_subsection"><a name="instructionlist">Instruction List</a>
</div>
<div class="doc_subsection"><a name="instructionlist">Instruction List</a></div>
<div class="doc_text">
<p>The instructions in a function are written as a simple list. Basic
blocks are inferred by the terminating instruction types. The format of
@@ -1251,11 +1368,11 @@ of formats. See <a href="#instruction">Instructions</a> for details.</td>
depending on the number of operands to the instruction. Each
instruction begins with a <a href="#uint32_vbr">uint32_vbr</a> that
encodes the type of the instruction as well as other things. The tables
that follow describe the format of this first word of each instruction.</p>
that follow describe the format of this first part of each instruction.</p>
<p><b>Instruction Format 0</b></p>
<p>This format is used for a few instructions that can't easily be
optimized because they have large numbers of operands (e.g. PHI Node or
getelementptr). Each of the opcode, type, and operand fields is as
shortened because they have large numbers of operands (e.g. PHI Node or
getelementptr). Each of the opcode, type, and operand fields is found in
successive fields.</p>
<table>
<tbody>
@@ -1272,8 +1389,8 @@ format.</td>
</tr>
<tr>
<td><a href="#uint24_vbr">uint24_vbr</a></td>
<td class="td_left">Provides the slot number of the result type
of the instruction</td>
<td class="td_left">Provides the type slot number of the result type of
the instruction.</td>
</tr>
<tr>
<td><a href="#uint32_vbr">uint32_vbr</a></td>
@@ -1281,8 +1398,8 @@ of the instruction</td>
</tr>
<tr>
<td><a href="#uint32_vbr">uint32_vbr</a>+</td>
<td class="td_left">The slot number of the value(s) for the
operand(s). <sup>1</sup></td>
<td class="td_left">The slot number of the value(s) for the operand(s).
<sup>1</sup></td>
</tr>
</tbody>
</table>
@@ -1306,27 +1423,27 @@ single <a href="#uint32_vbr">uint32_vbr</a> as follows:</p>
<tr>
<td>0-1</td>
<td>constant "1"</td>
<td class="td_left">These two bits must be the value 1 which
identifies this as an instruction of format 1.</td>
<td class="td_left">These two bits must be the value 1 which identifies
this as an instruction of format 1.</td>
</tr>
<tr>
<td>2-7</td>
<td><a href="#opcodes">opcode</a></td>
<td class="td_left">Specifies the opcode of the instruction. Note
that the maximum opcode value is 63.</td>
<td><a href="#opcode">opcode</a></td>
<td class="td_left">Specifies the opcode of the instruction. Note that
the maximum opcode value is 63.</td>
</tr>
<tr>
<td>8-19</td>
<td><a href="#unsigned">unsigned</a></td>
<td class="td_left">Specifies the slot number of the type for
this instruction. Maximum slot number is 2<sup>12</sup>-1=4095.</td>
<td class="td_left">Specifies the slot number of the type for this
instruction. Maximum slot number is 2<sup>12</sup>-1=4095.</td>
</tr>
<tr>
<td>20-31</td>
<td><a href="#unsigned">unsigned</a></td>
<td class="td_left">Specifies the slot number of the value for
the first operand. Maximum slot number is 2<sup>12</sup>-1=4095. Note
that the value 2<sup>12</sup>-1 denotes zero operands.</td>
<td class="td_left">Specifies the slot number of the value for the
first operand. Maximum slot number is 2<sup>12</sup>-1=4095. Note that
the value 2<sup>12</sup>-1 denotes zero operands.</td>
</tr>
</tbody>
</table>
@@ -1343,32 +1460,32 @@ that the value 2<sup>12</sup>-1 denotes zero operands.</td>
<tr>
<td>0-1</td>
<td>constant "2"</td>
<td class="td_left">These two bits must be the value 2 which
identifies this as an instruction of format 2.</td>
<td class="td_left">These two bits must be the value 2 which identifies
this as an instruction of format 2.</td>
</tr>
<tr>
<td>2-7</td>
<td><a href="#opcodes">opcode</a></td>
<td class="td_left">Specifies the opcode of the instruction. Note
that the maximum opcode value is 63.</td>
<td class="td_left">Specifies the opcode of the instruction. Note that
the maximum opcode value is 63.</td>
</tr>
<tr>
<td>8-15</td>
<td><a href="#unsigned">unsigned</a></td>
<td class="td_left">Specifies the slot number of the type for
this instruction. Maximum slot number is 2<sup>8</sup>-1=255.</td>
<td class="td_left">Specifies the slot number of the type for this
instruction. Maximum slot number is 2<sup>8</sup>-1=255.</td>
</tr>
<tr>
<td>16-23</td>
<td><a href="#unsigned">unsigned</a></td>
<td class="td_left">Specifies the slot number of the value for
the first operand. Maximum slot number is 2<sup>8</sup>-1=255.</td>
<td class="td_left">Specifies the slot number of the value for the first
operand. Maximum slot number is 2<sup>8</sup>-1=255.</td>
</tr>
<tr>
<td>24-31</td>
<td><a href="#unsigned">unsigned</a></td>
<td class="td_left">Specifies the slot number of the value for
the second operand. Maximum slot number is 2<sup>8</sup>-1=255.</td>
<td class="td_left">Specifies the slot number of the value for the second
operand. Maximum slot number is 2<sup>8</sup>-1=255.</td>
</tr>
</tbody>
</table>
@@ -1385,51 +1502,154 @@ single <a href="#uint32_vbr">uint32_vbr</a> as follows:</p>
<tr>
<td>0-1</td>
<td>constant "3"</td>
<td class="td_left">These two bits must be the value 3 which
identifies this as an instruction of format 3.</td>
<td class="td_left">These two bits must be the value 3 which identifies
this as an instruction of format 3.</td>
</tr>
<tr>
<td>2-7</td>
<td><a href="#opcodes">opcode</a></td>
<td class="td_left">Specifies the opcode of the instruction. Note
that the maximum opcode value is 63.</td>
<td class="td_left">Specifies the opcode of the instruction. Note that
the maximum opcode value is 63.</td>
</tr>
<tr>
<td>8-13</td>
<td><a href="#unsigned">unsigned</a></td>
<td class="td_left">Specifies the slot number of the type for
this instruction. Maximum slot number is 2<sup>6</sup>-1=63.</td>
<td class="td_left">Specifies the slot number of the type for this
instruction. Maximum slot number is 2<sup>6</sup>-1=63.</td>
</tr>
<tr>
<td>14-19</td>
<td><a href="#unsigned">unsigned</a></td>
<td class="td_left">Specifies the slot number of the value for
the first operand. Maximum slot number is 2<sup>6</sup>-1=63.</td>
<td class="td_left">Specifies the slot number of the value for the first
operand. Maximum slot number is 2<sup>6</sup>-1=63.</td>
</tr>
<tr>
<td>20-25</td>
<td><a href="#unsigned">unsigned</a></td>
<td class="td_left">Specifies the slot number of the value for
the second operand. Maximum slot number is 2<sup>6</sup>-1=63.</td>
<td class="td_left">Specifies the slot number of the value for the second
operand. Maximum slot number is 2<sup>6</sup>-1=63.</td>
</tr>
<tr>
<td>26-31</td>
<td><a href="#unsigned">unsigned</a></td>
<td class="td_left">Specifies the slot number of the value for
the third operand. Maximum slot number is 2<sup>6</sup>-1=63.</td>
<td class="td_left">Specifies the slot number of the value for the third
operand. Maximum slot number is 2<sup>6</sup>-1=63.</td>
</tr>
</tbody>
</table>
</div>
<!-- _______________________________________________________________________ -->
<div class="doc_subsection"><a name="opcodes">Instruction Opcodes</a></div>
<div class="doc_text">
<p>Instructions encode an opcode that identifies the kind of instruction.
Opcodes are an enumerated integer value. The specific values used depend on
the version of LLVM you're using. The opcode values are defined in the
<a href="http://llvm.cs.uiuc.edu/cvsweb/cvsweb.cgi/llvm/include/llvm/Instruction.def">
<tt>include/llvm/Instruction.def</tt></a> file. You should check there for the
most recent definitions. The table below provides the opcodes defined as of
the writing of this document. The table associates each opcode mnemonic with
its enumeration value and the bytecode and LLVM version numbers in which the
opcode was introduced.</p>
<table>
<tbody>
<tr>
<th>Opcode</th>
<th>Number</th>
<th>Bytecode Version</th>
<th>LLVM Version</th>
</tr>
<tr><td colspan="4"><b>Terminator Instructions</b></td></tr>
<tr><td>Ret</td><td>1</td><td>1</td><td>1.0</td></tr>
<tr><td>Br</td><td>2</td><td>1</td><td>1.0</td></tr>
<tr><td>Switch</td><td>3</td><td>1</td><td>1.0</td></tr>
<tr><td>Invoke</td><td>4</td><td>1</td><td>1.0</td></tr>
<tr><td>Unwind</td><td>5</td><td>1</td><td>1.0</td></tr>
<tr><td>Unreachable</td><td>6</td><td>1</td><td>1.4</td></tr>
<tr><td colspan="4"><b>Binary Operators</b></td></tr>
<tr><td>Add</td><td>7</td><td>1</td><td>1.0</td></tr>
<tr><td>Sub</td><td>8</td><td>1</td><td>1.0</td></tr>
<tr><td>Mul</td><td>9</td><td>1</td><td>1.0</td></tr>
<tr><td>Div</td><td>10</td><td>1</td><td>1.0</td></tr>
<tr><td>Rem</td><td>11</td><td>1</td><td>1.0</td></tr>
<tr><td colspan="4"><b>Logical Operators</b></td></tr>
<tr><td>And</td><td>12</td><td>1</td><td>1.0</td></tr>
<tr><td>Or</td><td>13</td><td>1</td><td>1.0</td></tr>
<tr><td>Xor</td><td>14</td><td>1</td><td>1.0</td></tr>
<tr><td colspan="4"><b>Binary Comparison Operators</b></td></tr>
<tr><td>SetEQ</td><td>15</td><td>1</td><td>1.0</td></tr>
<tr><td>SetNE</td><td>16</td><td>1</td><td>1.0</td></tr>
<tr><td>SetLE</td><td>17</td><td>1</td><td>1.0</td></tr>
<tr><td>SetGE</td><td>18</td><td>1</td><td>1.0</td></tr>
<tr><td>SetLT</td><td>19</td><td>1</td><td>1.0</td></tr>
<tr><td>SetGT</td><td>20</td><td>1</td><td>1.0</td></tr>
<tr><td colspan="4"><b>Memory Operators</b></td></tr>
<tr><td>Malloc</td><td>21</td><td>1</td><td>1.0</td></tr>
<tr><td>Free</td><td>22</td><td>1</td><td>1.0</td></tr>
<tr><td>Alloca</td><td>23</td><td>1</td><td>1.0</td></tr>
<tr><td>Load</td><td>24</td><td>1</td><td>1.0</td></tr>
<tr><td>Store</td><td>25</td><td>1</td><td>1.0</td></tr>
<tr><td>GetElementPtr</td><td>26</td><td>1</td><td>1.0</td></tr>
<tr><td colspan="4"><b>Other Operators</b></td></tr>
<tr><td>PHI</td><td>27</td><td>1</td><td>1.0</td></tr>
<tr><td>Cast</td><td>28</td><td>1</td><td>1.0</td></tr>
<tr><td>Call</td><td>29</td><td>1</td><td>1.0</td></tr>
<tr><td>Shl</td><td>30</td><td>1</td><td>1.0</td></tr>
<tr><td>Shr</td><td>31</td><td>1</td><td>1.0</td></tr>
<tr><td>VANext</td><td>32</td><td>1</td><td>1.0</td></tr>
<tr><td>VAArg</td><td>33</td><td>1</td><td>1.0</td></tr>
<tr><td>Select</td><td>34</td><td>2</td><td>1.2</td></tr>
<tr><td colspan="4">
<b>Pseudo Instructions<a href="#pi_note">*</a></b>
</td></tr>
<tr><td>Invoke+CC </td><td>56</td><td>5</td><td>1.5</td></tr>
<tr><td>Invoke+FastCC</td><td>57</td><td>5</td><td>1.5</td></tr>
<tr><td>Call+CC</td><td>58</td><td>5</td><td>1.5</td></tr>
<tr><td>Call+FastCC+TailCall</td><td>59</td><td>5</td><td>1.5</td></tr>
<tr><td>Call+FastCC</td><td>60</td><td>5</td><td>1.5</td></tr>
<tr><td>Call+CCC+TailCall</td><td>61</td><td>5</td><td>1.5</td></tr>
<tr><td>Load+Volatile</td><td>62</td><td>3</td><td>1.3</td></tr>
<tr><td>Store+Volatile</td><td>63</td><td>3</td><td>1.3</td></tr>
</tbody>
</table>
</div>
<p><b><a name="pi_note">* Note: </a></b>
These aren't really opcodes from an LLVM language prespeective. They encode
information into other opcodes without reserving space for that information.
For example, opcode=63 is a Volatile Store. The opcode for this
instruction is 25 (Store) but we encode it as 63 to indicate that is a Volatile
Store. The same is done for the calling conventions and tail calls.
In each of these entries in range 56-63, the opcode is documented as the base
opcode (Invoke, Call, Store) plus some set of modifiers, as follows:</p>
<dl>
<dt>CC</dt>
<dd>This means an arbitrary calling convention is specified
in a VBR that follows the opcode. This is used when the instruction cannot
be encoded with one of the more compact forms.
</dd>
<dt>FastCC</dt>
<dd>This indicates that the Call or Invoke is using the FastCC calling
convention.</dd>
<dt>CCC</dt>
<dd>This indicates that the Call or Invoke is using the native "C" calling
convention.</dd>
<dt>TailCall</dt>
<dd>This indicates that the Call has the 'tail' modifier.</dd>
</dl>
<!-- _______________________________________________________________________ -->
<div class="doc_subsection"><a name="symtab">Symbol Table</a> </div>
<div class="doc_text">
<p>A symbol table can be put out in conjunction with a module or a function.
A symbol table is a list of type planes. Each type plane starts with the number
of entries in the plane and the type plane's slot number (so the type
can be looked up in the global type pool). For each entry in a type
plane, the slot number of the value and the name associated with that
value are written. The format is given in the table below. </p>
<p>A symbol table can be put out in conjunction with a module or a function. A
symbol table has a list of name/type associations followed by a list of
name/value associations. The name/value associations are organized into "type
planes" so that all values of a common type are listed together. Each type
plane starts with the number of entries in the plane and the type slot number
for all the values in that plane (so the type can be looked up in the global
type pool). For each entry in a type plane, the slot number of the value and
the name associated with that value are written. The format is given in the
table below. </p>
<table>
<tbody>
<tr>
@@ -1441,19 +1661,48 @@ value are written. The format is given in the table below. </p>
</td>
<td class="td_left">Symbol Table Identifier (0x04)</td>
</tr>
<tr>
<td><a href="#llist">llist</a>(<a href="#symtab_entry">type_entry</a>)</td>
<td class="td_left">A length list of symbol table entries for
<tt>Type</tt>s
</td>
</tr>
<tr>
<td><a href="#zlist">llist</a>(<a href="#symtab_plane">symtab_plane</a>)</td>
<td class="td_left">A length list of "type planes" of symbol table
entries for <tt>Value</tt>s</td>
</tr>
</tbody>
</table>
</div>
<!-- _______________________________________________________________________ -->
<div class="doc_subsubsection"> <a name="type_entry">Symbol Table Type
Entry</a>
</div>
<div class="doc_text">
<p>A symbol table type entry associates a name with a type. The name is provided
simply as an array of chars. The type is provided as a type slot number (index)
into the global type pool. The format is given in the following table:</p>
<table>
<tbody>
<tr>
<th><b>Type</b></th>
<th class="td_left"><b>Field Description</b></th>
</tr>
<tr>
<td><a href="#uint32_vbr">uint24_vbr</a></td>
<td class="td_left">Type slot number of the type being given a
name relative to the global type pool.
</td>
</tr>
<tr>
<td><a href="#uint32_vbr">uint32_vbr</a></td>
<td class="td_left">Number of entries in type plane</td>
<td class="td_left">Length of the character array that follows.</td>
</tr>
<tr>
<td><a href="#symtab_entry">symtab_entry</a>*</td>
<td class="td_left">Provides the slot number of the type and its
name.</td>
</tr>
<tr>
<td><a href="#symtab_plane">symtab_plane</a>*</td>
<td class="td_left">A type plane containing value slot number and
name for all values of the same type.</td>
<td><a href="#char">char</a>+</td>
<td class="td_left">The characters of the name.</td>
</tr>
</tbody>
</table>
@@ -1477,22 +1726,23 @@ values of a common type. The encoding is given in the following table:</p>
</tr>
<tr>
<td><a href="#uint32_vbr">uint32_vbr</a></td>
<td class="td_left">Slot number of type for this plane.</td>
<td class="td_left">Type slot number of type for all values in this plane..</td>
</tr>
<tr>
<td><a href="#symtab_entry">symtab_entry</a>+</td>
<td class="td_left">The symbol table entries for this plane.</td>
<td><a href="#value_entry">value_entry</a>+</td>
<td class="td_left">The symbol table entries for to associate values with
names.</td>
</tr>
</tbody>
</table>
</div>
<!-- _______________________________________________________________________ -->
<div class="doc_subsubsection"> <a name="symtab_entry">Symbol Table
<div class="doc_subsubsection"><a name="value_entry">Symbol Table Value
Entry</a>
</div>
<div class="doc_text">
<p>A symbol table entry provides the assocation between a type or
value's slot number and the name given to that type or value. The
<p>A symbol table value entry provides the assocation between a value and the
name given to the value. The value is referenced by its slot number. The
format is given in the following table:</p>
<table>
<tbody>
@@ -1502,8 +1752,8 @@ format is given in the following table:</p>
</tr>
<tr>
<td><a href="#uint32_vbr">uint24_vbr</a></td>
<td class="td_left">Slot number of the type or value being given
a name. </td>
<td class="td_left">Value slot number of the value being given a name.
</td>
</tr>
<tr>
<td><a href="#uint32_vbr">uint32_vbr</a></td>
@@ -1516,6 +1766,7 @@ a name. </td>
</tbody>
</table>
</div>
<!-- *********************************************************************** -->
<div class="doc_section"> <a name="versiondiffs">Version Differences</a>
</div>
@@ -1529,10 +1780,64 @@ section here
describes the differences between that version and the one that <i>follows</i>.
</p>
</div>
<!-- _______________________________________________________________________ -->
<div class="doc_subsection"><a name="vers13">Version 1.3 Differences From
1.4</a></div>
<!-- _______________________________________________________________________ -->
<div class="doc_subsubsection">Unreachable Instruction</div>
<div class="doc_text">
<p>The LLVM <a href="LangRef.html#i_unreachable">Unreachable</a> instruction
was added in version 1.4 of LLVM. This caused all instruction numbers after
it to shift down by one.</p>
</div>
<div class="doc_subsubsection">Function Flags</div>
<div class="doc_text">
<p>LLVM bytecode versions prior to 1.4 did not include the 5 bit offset
in <a href="#funcfield">the function list</a> in the <a
href="#globalinfo">Module Global Info</a> block.</p>
</div>
<div class="doc_subsubsection">Function Flags</div>
<div class="doc_text">
<p>LLVM bytecode versions prior to 1.4 did not include the 'undef' constant
value, which affects the encoding of <a href="#constant">Constant
Fields</a>.</p>
</div>
<!--
<div class="doc_subsubsection">Aligned Data</div>
<div class="doc_text">
<p>In version 1.3, certain data items were aligned to 32-bit boundaries. In
version 1.4, alignment of data was done away with completely. The need for
alignment has gone away and the only thing it adds is bytecode file size
overhead. In most cases this overhead was small. However, in functions with
large numbers of format 0 instructions (GEPs and PHIs with lots of parameters)
or regular instructions with large valued operands (e.g. because there's just
a lot of instructions in the function) the overhead can be extreme. In one
test case, the overhead was 44,000 bytes (34% of the total file size).
Consequently in release 1.4, the decision was made to eliminate alignment
altogether.</p>
<p>In version 1.3 format, the following bytecode constructs were aligned (i.e.
they were followed by one to three bytes of padding):</p>
<ul>
<li>All blocks.</li>
<li>Instructions using the long format (format 0).</li>
<li>All call instructions that called a var args function.</li>
<li>The target triple (a string field at the end of the module block).</li>
<li>The version field (immediately following the signature).</li>
</ul>
<p>None of these constructs are aligned in version 1.4</p>
</div>
-->
<!-- _______________________________________________________________________ -->
<div class="doc_subsection"><a name="vers12">Version 1.2 Differences
From 1.3</a></div>
<!-- _______________________________________________________________________ -->
<div class="doc_subsubsection">Type Derives From Value</div>
<div class="doc_text">
<p>In version 1.2, the Type class in the LLVM IR derives from the Value
@@ -1632,7 +1937,5 @@ From 1.1</a></div>
<a href="http://llvm.cs.uiuc.edu">The LLVM Compiler Infrastructure</a><br>
Last modified: $Date$
</address>
<!-- vim: sw=2
-->
</body>
</html>

View File

@@ -16,6 +16,7 @@
<li><a href="#cautionarynote">A Cautionary Note</a>
<ul>
<li><a href="#cygwin">Building under Cygwin</a></li>
<li><a href="#aix">Building under AIX</a></li>
</ul>
</li>
<li><a href="#instructions">Instructions</a></li>
@@ -44,8 +45,8 @@ process, and you should <b>only</b> try to do it if:</p>
<ol>
<li>you really, really, really can't use the binaries we distribute</li>
<li>you need GCC to fix some of the header files on your system</li>
<li>you are an elite GCC hacker.</li>
<li>you want to use the latest bits from CVS.</li>
</ol>
<p>We welcome patches to help make this process simpler.</p>
@@ -58,7 +59,7 @@ process, and you should <b>only</b> try to do it if:</p>
<!--=========================================================================-->
<div class="doc_text">
<p>If you are building LLVM and the C front-end under Cygwin, please note that
<p>If you are building LLVM and the GCC front-end under Cygwin, please note that
the LLVM and GCC makefiles do not correctly handle spaces in paths. To deal
with this issue, make sure that your LLVM and GCC source and build trees are
located in a top-level directory (like <tt>/cygdrive/c/llvm</tt> and
@@ -66,6 +67,28 @@ located in a top-level directory (like <tt>/cygdrive/c/llvm</tt> and
(which includes your "home directory", because it lives under the "Documents
and Settings" directory). We welcome patches to fix this issue.
</p>
<p>It has been found that the GCC 3.3.3 compiler provided with recent Cygwin
versions is incapable of compiling the LLVM CFE correctly. If your Cygwin
installation includes GCC 3.3.3, we <i>strongly</i> recommend that you download
GCC 3.4.3, build it separately, and use it for compiling LLVM CFE. This has been
shown to work correctly.</p>
<p>Some versions of Cygwin utilize an experimental version of GNU binutils that
will cause the GNU <tt>ld</tt> linker to fail an assertion when linking
components of the libstdc++. It is recommended that you replace the entire
binutils package with version 2.15 such that "<tt>ld --version</tt>" responds
with</p>
<pre>GNU ld version 2.15</pre>
not with:<br/>
<pre>GNU ld version 2.15.91 20040725</pre>
</div>
<!--=========================================================================-->
<div class="doc_subsection"><a name="aix">Building under AIX</a></div>
<div class="doc_text">
<p>If you are building LLVM and the GCC front-end under AIX, do NOT use GNU
Binutils. They are not stable under AIX and may produce incorrect and/or
invalid code. Instead, use the system assembler and linker.
</p>
</div>
<!-- *********************************************************************** -->
@@ -77,25 +100,39 @@ and Settings" directory). We welcome patches to fix this issue.
<div class="doc_text">
<p>
<ol>
<li><p>Configure and build the LLVM libraries and tools using:</p>
<pre>
<li><p>Configure and build the LLVM libraries and tools. There are two ways to
do this: either with <i>objdir</i> == <i>srcdir</i> or
<i>objdir</i> != <i>srcdir</i>. It is recommended
that <i>srcdir</i> not be the same as <i>objdir</i>:</p>
<ul>
<li>With <i>objdir</i> != <i>srcdir</i>:<pre>
% cd <i>objdir</i>
% <i>srcdir</i>/configure --prefix=/some/path/you/can/install/to [options...]
% gmake tools-only
</pre></li>
<li>With <i>objdir</i> == <i>srcdir</i>:<pre>
% cd llvm
% ./configure [options...]
% gmake
</pre>
<p>This will build all of the LLVM tools and libraries, but you will see
warnings about missing the C front-end (certain runtime libraries can't
be built without it). Ignore these warnings for now.</p></li>
% ./configure --prefix=/some/path/you/can/install/to [options...]
% gmake tools-only
</pre></li>
</ul>
<p>This will build all of the LLVM tools and libraries. The <tt>--prefix</tt>
option defaults to /usr/local (per configure standards) but unless you are a
system administrator, you probably won't be able to install LLVM there because
of permissions. Specify a path into which LLVM can be installed (e.g.
<tt>--prefix=/home/user/llvm</tt>).</p>
</li>
<li><p>Add the directory containing the tools to your PATH.</p>
<pre>
% set path = ( `cd llvm/tools/Debug &amp;&amp; pwd` $path )
% set path = ( `cd llvm/Debug/bin &amp;&amp; pwd` $path )
</pre></li>
<li><p>Unpack the C/C++ front-end source into cfrontend/src.</p></li>
<li><p>Unpack the C/C++ front-end source into cfrontend/src, either by
untar'ing a cfrontend.source.tar.gz file or checking out CVS into this
directory.</p></li>
<li><p>Make "build" and "install" directories as siblings of the "src"
tree.</p>
<li><p>Make "build" and "install" directories as siblings of the "src" tree:</p>
<pre>
% pwd
/usr/local/example/cfrontend/src
@@ -105,19 +142,18 @@ and Settings" directory). We welcome patches to fix this issue.
</pre></li>
<li><p>Configure, build, and install the C front-end:</p>
<li><p>Configure, build, and install the GCC front-end:</p>
<p>
<b>Linux/x86:</b><br>
<b>MacOS X/PowerPC</b> (requires dlcompat library):
<b>MacOS X/PowerPC</b> (requires dlcompat library):<br>
<b>AIX/PowerPC:</b>
</p>
<pre>
% cd build
% ../src/configure --prefix=$CFEINSTALL --disable-threads --disable-nls --disable-shared \
--enable-languages=c,c++
% gmake
% setenv LLVM_LIB_SEARCH_PATH `pwd`/gcc
% ../src/configure --prefix=$CFEINSTALL --disable-threads --disable-nls \
--disable-shared --enable-languages=c,c++ --program-prefix=llvm-
% gmake all; gmake install
</pre>
@@ -125,18 +161,24 @@ and Settings" directory). We welcome patches to fix this issue.
<pre>
% cd build
% ../src/configure --prefix=$CFEINSTALL --disable-threads --disable-nls --disable-shared \
--enable-languages=c,c++ --disable-c-mbchar
% gmake
% setenv LLVM_LIB_SEARCH_PATH `pwd`/gcc
% ../src/configure --prefix=$CFEINSTALL --disable-threads --disable-nls \
--disable-shared --enable-languages=c,c++ --disable-c-mbchar \
--program-prefix=llvm-
% gmake all; gmake install
</pre>
<p><b>Solaris/SPARC:</b></p>
<p>
For Solaris/SPARC, LLVM only supports the SPARC V9. Therefore, the
configure command line should specify sparcv9, as shown below. Also,
The GCC front-end can be configured for either SPARC V8 (32 bit) or SPARC V9 (64
bit). This changes, among other things, the sizes of integer types and the
macros defined for conditional compilation.
</p>
<p>
The SPARC V8 backend is still beta quality software. Unless you are working on
the SPARC V8 backend, you should specify sparcv9 on the configure command line,
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>).
@@ -146,9 +188,7 @@ functions from C as referenced from C++, so we typically configure with
% cd build
% ../src/configure --prefix=$CFEINSTALL --disable-threads --disable-nls \
--disable-shared --enable-languages=c,c++ --host=sparcv9-sun-solaris2.8 \
--disable-c-mbchar
% gmake
% setenv LLVM_LIB_SEARCH_PATH `pwd`/gcc
--disable-c-mbchar --program-prefix=llvm-
% gmake all; gmake install
</pre>
@@ -159,8 +199,8 @@ functions from C as referenced from C++, so we typically configure with
<ul>
<li><p><b>Fix 1:</b> If you have system header files that include
inline assembly, you may have to modify them to remove the inline
assembly, and install the modified versions in
<code>$CFEINSTALL/<i>target-triplet</i>/sys-include</code>.</li>
assembly and install the modified versions in
<code>$CFEINSTALL/lib/gcc/<i>target-triplet</i>/3.4-llvm/include</code>.</li>
<li><b>Fix 2:</b> If you are building the C++ front-end on a CPU we
haven't tried yet, you will probably have to edit the appropriate
@@ -169,13 +209,13 @@ functions from C as referenced from C++, so we typically configure with
and apply a patch so that it does not use inline assembly.</li>
</ul>
<p><b>Porting to a new architecture:</b> If you are porting the new front-end
to a new architecture, or compiling in a different configuration that we have
previously, there are probably several changes you will have to make to the GCC
target to get it to work correctly. These include:<p>
<p><b>Porting to a new architecture:</b> If you are porting the front-end
to a new architecture or compiling in a configuration that we have
not tried previously, there are probably several changes you will have to make
to the GCC target to get it to work correctly. These include:<p>
<ul>
<li>Often targets include special or assembler linker flags which
<li>Often targets include special assembler or linker flags which
<tt>gccas</tt>/<tt>gccld</tt> does not understand. In general, these can
just be removed.</li>
<li>LLVM currently does not support any floating point values other than
@@ -197,35 +237,47 @@ functions from C as referenced from C++, so we typically configure with
</ul>
</li>
<li><p>Go back into the LLVM source tree proper. Rerun configure, using
the <code>--with-llvmgccdir=$CFEINSTALL</code> option to specify the path
to the newly built C front-end.</p></li>
<li><p>Put <tt>$CFEINSTALL/bin</tt> into your <tt>PATH</tt> environment
variable.</p>
<ul>
<li>sh: <tt>export PATH=$CFEINSTALL/bin:$PATH</tt></li>
<li>csh: <tt>setenv PATH $CFEINSTALL/bin:$PATH</tt></li>
</ul>
</li>
<li><p>If you edited header files during the C/C++ front-end build as
described in "Fix 1" above, you must now copy those header files from
<code>$CFEINSTALL/<i>target-triplet</i>/sys-include</code> to
<code>$CFEINSTALL/lib/gcc/<i>target-triplet</i>/3.4-llvm/include</code>.
(This should be the "include" directory in the same directory as the
libgcc.a library, which you can find by running
<code>$CFEINSTALL/bin/gcc --print-libgcc-file-name</code>.)</p></li>
<li><p>Go back into the LLVM source tree proper. Rerun configure, using
the same options as the last time. This will cause the configuration to now find
the newly built llvm-gcc and llvm-g++ executables. </p></li>
<li><p>Rebuild your CVS tree. This shouldn't cause the whole thing to be
rebuilt, but it should build the runtime libraries. After the tree is
built, install the runtime libraries into your C front-end build tree.
These are the commands you need.</p>
built, install the runtime libraries into your GCC front-end build tree.
These are the commands you need:</p>
<pre>
% gmake
% mkdir $CFEINSTALL/bytecode-libs
% gmake -C runtime install-bytecode
% setenv LLVM_LIB_SEARCH_PATH $CFEINSTALL/bytecode-libs
</pre></li>
<li><p>Optionally, build a symbol table for the newly installed runtime
libraries. Although this step is optional, you are strongly encouraged to
do this as the symbol tables will make a significant difference in your
link times. Use the <tt>llvm-ranlib</tt> tool to do this, as follows:</p>
<pre>
% cd $CFEINSTALL/lib
% llvm-ranlib libiberty.a
% llvm-ranlib libstdc++.a
% llvm-ranlib libsupc++.a
% cd $CFEINSTALL/lib/gcc/<i>target-triplet</i>/3.4-llvm
% llvm-ranlib libgcc.a
% llvm-ranlib libgcov.a
</pre>
<li><p>Test the newly-installed C frontend by one or more of the
following means:</p>
<ul>
<li> running the feature &amp; regression tests via <tt>make check</tt></li>
<li> compiling and running a "hello, LLVM" program in C and C++.</li>
<li> running the tests under <tt>test/Programs</tt> using <code>gmake -C
test/Programs</code></li>
<li> running the tests found in the <tt>llvm-test</tt> CVS module</li>
</ul></li>
</ol>
</div>
@@ -248,7 +300,7 @@ The software also has the following additional copyrights:
<pre>
Copyright (c) 2003, 2004 University of Illinois at Urbana-Champaign.
Copyright (c) 2003, 2004, 2005 University of Illinois at Urbana-Champaign.
All rights reserved.
Developed by:

View File

@@ -23,6 +23,7 @@
<ul>
<li><a href="#targetmachine">The <tt>TargetMachine</tt> class</a></li>
<li><a href="#targetdata">The <tt>TargetData</tt> class</a></li>
<li><a href="#targetlowering">The <tt>TargetLowering</tt> class</a></li>
<li><a href="#mregisterinfo">The <tt>MRegisterInfo</tt> class</a></li>
<li><a href="#targetinstrinfo">The <tt>TargetInstrInfo</tt> class</a></li>
<li><a href="#targetframeinfo">The <tt>TargetFrameInfo</tt> class</a></li>
@@ -31,14 +32,30 @@
</li>
<li><a href="#codegendesc">Machine code description classes</a>
<ul>
<li><a href="#machineinstr">The <tt>MachineInstr</tt> class</a></li>
<li><a href="#machineinstr">The <tt>MachineInstr</tt> class</a></li>
</ul>
</li>
<li><a href="#codegenalgs">Target-independent code generation algorithms</a>
<ul>
<li><a href="#instselect">Instruction Selection</a>
<ul>
<li><a href="#selectiondag_intro">Introduction to SelectionDAGs</a></li>
<li><a href="#selectiondag_process">SelectionDAG Code Generation
Process</a></li>
<li><a href="#selectiondag_build">Initial SelectionDAG
Construction</a></li>
<li><a href="#selectiondag_legalize">SelectionDAG Legalize Phase</a></li>
<li><a href="#selectiondag_optimize">SelectionDAG Optimization
Phase</a></li>
<li><a href="#selectiondag_select">SelectionDAG Select Phase</a></li>
<li><a href="#selectiondag_future">Future directions for the
SelectionDAG</a></li>
</ul></li>
</ul>
</li>
<li><a href="#targetimpls">Target description implementations</a>
<ul>
<li><a href="#x86">The X86 backend</a></li>
<li><a href="#x86">The X86 backend</a></li>
</ul>
</li>
@@ -120,7 +137,7 @@ classes, ensuring that it is portable.
code generator and the set of reusable components that can be used to build
target-specific backends. The two most important interfaces (<a
href="#targetmachine"><tt>TargetMachine</tt></a> and <a
href="#targetdata"><tt>TargetData</tt></a> classes) are the only ones that are
href="#targetdata"><tt>TargetData</tt></a>) are the only ones that are
required to be defined for a backend to fit into the LLVM system, but the others
must be defined if the reusable code generator components are going to be
used.</p>
@@ -159,41 +176,43 @@ predictable completion date.</p>
<div class="doc_text">
<p>The LLVM target-indendent code generator is designed to support efficient and
<p>The LLVM target-independent code generator is designed to support efficient and
quality code generation for standard register-based microprocessors. Code
generation in this model is divided into the following stages:</p>
<ol>
<li><b>Instruction Selection</b> - Determining an efficient implementation of the
input LLVM code in the target instruction set. This stage produces the initial
code for the program in the target instruction set, then makes use of virtual
registers in SSA form and physical registers that represent any required
register assignments due to target constraints or calling conventions.</li>
<li><b><a href="#instselect">Instruction Selection</a></b> - Determining an
efficient implementation of the input LLVM code in the target instruction set.
This stage produces the initial code for the program in the target instruction
set, then makes use of virtual registers in SSA form and physical registers that
represent any required register assignments due to target constraints or calling
conventions.</li>
<li><b>SSA-based Machine Code Optimizations</b> - This (optional) stage consists
of a series of machine-code optimizations that operate on the SSA-form produced
by the instruction selector. Optimizations like modulo-scheduling, normal
scheduling, or peephole optimization work here.</li>
<li><b><a href="#ssamco">SSA-based Machine Code Optimizations</a></b> - This
optional stage consists of a series of machine-code optimizations that
operate on the SSA-form produced by the instruction selector. Optimizations
like modulo-scheduling, normal scheduling, or peephole optimization work here.
</li>
<li><b>Register Allocation</b> - The target code is transformed from an infinite
virtual register file in SSA form to the concrete register file used by the
target. This phase introduces spill code and eliminates all virtual register
references from the program.</li>
<li><b><a name="#regalloc">Register Allocation</a></b> - The
target code is transformed from an infinite virtual register file in SSA form
to the concrete register file used by the target. This phase introduces spill
code and eliminates all virtual register references from the program.</li>
<li><b>Prolog/Epilog Code Insertion</b> - Once the machine code has been
generated for the function and the amount of stack space required is known (used
for LLVM alloca's and spill slots), the prolog and epilog code for the function
can be inserted and "abstract stack location references" can be eliminated.
This stage is responsible for implementing optimizations like frame-pointer
elimination and stack packing.</li>
<li><b><a name="#proepicode">Prolog/Epilog Code Insertion</a></b> - Once the
machine code has been generated for the function and the amount of stack space
required is known (used for LLVM alloca's and spill slots), the prolog and
epilog code for the function can be inserted and "abstract stack location
references" can be eliminated. This stage is responsible for implementing
optimizations like frame-pointer elimination and stack packing.</li>
<li><b>Late Machine Code Optimizations</b> - Optimizations that operate on
"final" machine code can go here, such as spill code scheduling and peephole
optimizations.</li>
<li><b><a name="latemco">Late Machine Code Optimizations</a></b> - Optimizations
that operate on "final" machine code can go here, such as spill code scheduling
and peephole optimizations.</li>
<li><b>Code Emission</b> - The final stage actually outputs the code for
the current function, either in the target assembler format or in machine
code.</li>
<li><b><a name="codemission">Code Emission</a></b> - The final stage actually
puts out the code for the current function, either in the target assembler
format or in machine code.</li>
</ol>
@@ -205,7 +224,7 @@ expansion and
aggressive iterative peephole optimization are much slower. This design
permits efficient compilation (important for JIT environments) and
aggressive optimization (used when generating code offline) by allowing
components of varying levels of sophisication to be used for any step of
components of varying levels of sophistication to be used for any step of
compilation.</p>
<p>
@@ -227,11 +246,13 @@ targets with unusual requirements can be supported with custom passes as needed.
<p>The target description classes require a detailed description of the target
architecture. These target descriptions often have a large amount of common
information (e.g., an add instruction is almost identical to a sub instruction).
information (e.g., an <tt>add</tt> instruction is almost identical to a
<tt>sub</tt> instruction).
In order to allow the maximum amount of commonality to be factored out, the LLVM
code generator uses the <a href="TableGenFundamentals.html">TableGen</a> tool to
describe big chunks of the target machine, which allows the use of domain- and
target-specific abstractions to reduce the amount of repetition.
describe big chunks of the target machine, which allows the use of
domain-specific and target-specific abstractions to reduce the amount of
repetition.
</p>
</div>
@@ -246,11 +267,11 @@ target-specific abstractions to reduce the amount of repetition.
<p>The LLVM target description classes (which are located in the
<tt>include/llvm/Target</tt> directory) provide an abstract description of the
target machine, independent of any particular client. These classes are
designed to capture the <i>abstract</i> properties of the target (such as what
instruction and registers it has), and do not incorporate any particular pieces
of code generation algorithms (these interfaces do not take interference graphs
as inputs or other algorithm-specific data structures).</p>
target machine; independent of any particular client. These classes are
designed to capture the <i>abstract</i> properties of the target (such as the
instructions and registers it has), and do not incorporate any particular pieces
of code generation algorithms. These interfaces do not take interference graphs
as inputs or other algorithm-specific data structures.</p>
<p>All of the target description classes (except the <tt><a
href="#targetdata">TargetData</a></tt> class) are designed to be subclassed by
@@ -270,8 +291,9 @@ should be implemented by the target.</p>
<p>The <tt>TargetMachine</tt> class provides virtual methods that are used to
access the target-specific implementations of the various target description
classes (with the <tt>getInstrInfo</tt>, <tt>getRegisterInfo</tt>,
<tt>getFrameInfo</tt>, ... methods). This class is designed to be specialized by
classes via the <tt>get*Info</tt> methods (<tt>getInstrInfo</tt>,
<tt>getRegisterInfo</tt>, <tt>getFrameInfo</tt>, etc.). This class is
designed to be specialized by
a concrete target implementation (e.g., <tt>X86TargetMachine</tt>) which
implements the various virtual methods. The only required target description
class is the <a href="#targetdata"><tt>TargetData</tt></a> class, but if the
@@ -289,13 +311,35 @@ implemented as well.</p>
<div class="doc_text">
<p>The <tt>TargetData</tt> class is the only required target description class,
and it is the only class that is not extensible (it cannot be derived from). It
specifies information about how the target lays out memory for structures, the
alignment requirements for various data types, the size of pointers in the
target, and whether the target is little- or big-endian.</p>
and it is the only class that is not extensible. You cannot derived a new
class from it. <tt>TargetData</tt> specifies information about how the target
lays out memory for structures, the alignment requirements for various data
types, the size of pointers in the target, and whether the target is
little-endian or big-endian.</p>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection">
<a name="targetlowering">The <tt>TargetLowering</tt> class</a>
</div>
<div class="doc_text">
<p>The <tt>TargetLowering</tt> class is used by SelectionDAG based instruction
selectors primarily to describe how LLVM code should be lowered to SelectionDAG
operations. Among other things, this class indicates:
<ul><li>an initial register class to use for various ValueTypes,</li>
<li>which operations are natively supported by the target machine,</li>
<li>the return type of setcc operations, and</li>
<li>the type to use for shift amounts, etc</li>.
</ol></p>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection">
@@ -378,14 +422,14 @@ representation for machine code, as well as a register allocated, non-SSA form.
<p>Target machine instructions are represented as instances of the
<tt>MachineInstr</tt> class. This class is an extremely abstract way of
representing machine instructions. In particular, all it keeps track of is
an opcode number and some number of operands.</p>
representing machine instructions. In particular, it only keeps track of
an opcode number and a set of operands.</p>
<p>The opcode number is an simple unsigned number that only has meaning to a
<p>The opcode number is a simple unsigned number that only has meaning to a
specific backend. All of the instructions for a target should be defined in
the <tt>*InstrInfo.td</tt> file for the target, and the opcode enum values
are autogenerated from this description. The <tt>MachineInstr</tt> class does
not have any information about how to intepret the instruction (i.e., what the
the <tt>*InstrInfo.td</tt> file for the target. The opcode enum values
are auto-generated from this description. The <tt>MachineInstr</tt> class does
not have any information about how to interpret the instruction (i.e., what the
semantics of the instruction are): for that you must refer to the
<tt><a href="#targetinstrinfo">TargetInstrInfo</a></tt> class.</p>
@@ -396,15 +440,15 @@ In addition, a machine operand should be marked as a def or a use of the value
<p>By convention, the LLVM code generator orders instruction operands so that
all register definitions come before the register uses, even on architectures
that are normally printed in other orders. For example, the sparc add
that are normally printed in other orders. For example, the SPARC add
instruction: "<tt>add %i1, %i2, %i3</tt>" adds the "%i1", and "%i2" registers
and stores the result into the "%i3" register. In the LLVM code generator,
the operands should be stored as "<tt>%i3, %i1, %i2</tt>": with the destination
first.</p>
<p>Keeping destination operands at the beginning of the operand list has several
advantages. In particular, the debugging printer will print the instruction
like this:</p>
<p>Keeping destination (definition) operands at the beginning of the operand
list has several advantages. In particular, the debugging printer will print
the instruction like this:</p>
<pre>
%r3 = add %i1, %i2
@@ -453,17 +497,18 @@ instructions. Usage of the <tt>BuildMI</tt> functions look like this:
<p>
The key thing to remember with the <tt>BuildMI</tt> functions is that you have
to specify the number of operands that the machine instruction will take
(allowing efficient memory allocation). Also, if operands default to be uses
of values, not definitions. If you need to add a definition operand (other
than the optional destination register), you must explicitly mark it as such.
to specify the number of operands that the machine instruction will take. This
allows for efficient memory allocation. You also need to specify if operands
default to be uses of values, not definitions. If you need to add a definition
operand (other than the optional destination register), you must explicitly
mark it as such.
</p>
</div>
<!-- _______________________________________________________________________ -->
<div class="doc_subsubsection">
<a name="fixedregs">Fixed (aka preassigned) registers</a>
<a name="fixedregs">Fixed (preassigned) registers</a>
</div>
<div class="doc_text">
@@ -472,7 +517,7 @@ than the optional destination register), you must explicitly mark it as such.
presence of fixed registers. In particular, there are often places in the
instruction stream where the register allocator <em>must</em> arrange for a
particular value to be in a particular register. This can occur due to
limitations in the instruction set (e.g., the X86 can only do a 32-bit divide
limitations of the instruction set (e.g., the X86 can only do a 32-bit divide
with the <tt>EAX</tt>/<tt>EDX</tt> registers), or external factors like calling
conventions. In any case, the instruction selector should emit code that
copies a virtual register into or out of a physical register when needed.</p>
@@ -503,7 +548,7 @@ and ret (use
ret
</pre>
<p>By the end of code generation, the register allocator has coallesced
<p>By the end of code generation, the register allocator has coalesced
the registers and deleted the resultant identity moves, producing the
following code:</p>
@@ -533,7 +578,7 @@ register.</p>
<div class="doc_text">
<p><tt>MachineInstr</tt>'s are initially instruction selected in SSA-form, and
<p><tt>MachineInstr</tt>'s are initially selected in SSA-form, and
are maintained in SSA-form until register allocation happens. For the most
part, this is trivially simple since LLVM is already in SSA form: LLVM PHI nodes
become machine code PHI nodes, and virtual registers are only allowed to have a
@@ -544,6 +589,318 @@ are no virtual registers left in the code.</p>
</div>
<!-- *********************************************************************** -->
<div class="doc_section">
<a name="codegenalgs">Target-independent code generation algorithms</a>
</div>
<!-- *********************************************************************** -->
<div class="doc_text">
<p>This section documents the phases described in the <a
href="high-level-design">high-level design of the code generator</a>. It
explains how they work and some of the rationale behind their design.</p>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection">
<a name="instselect">Instruction Selection</a>
</div>
<div class="doc_text">
<p>
Instruction Selection is the process of translating LLVM code presented to the
code generator into target-specific machine instructions. There are several
well-known ways to do this in the literature. In LLVM there are two main forms:
the old-style 'simple' instruction selector (which effectively peephole selects
each LLVM instruction into a series of machine instructions), and the new
SelectionDAG based instruction selector.
</p>
<p>The 'simple' instruction selectors are tedious to write, require a lot of
boiler plate code, and are difficult to get correct. Additionally, any
optimizations written for a simple instruction selector cannot be used by other
targets. For this reason, LLVM is moving to a new SelectionDAG based
instruction selector, which is described in this section. If you are starting a
new port, we recommend that you write the instruction selector using the
SelectionDAG infrastructure.</p>
<p>In time, most of the target-specific code for instruction selection will be
auto-generated from the target description (<tt>*.td</tt>) files. For now,
however, the <a href="#selectiondag_select">Select Phase</a> must still be
written by hand.</p>
</div>
<!-- _______________________________________________________________________ -->
<div class="doc_subsubsection">
<a name="selectiondag_intro">Introduction to SelectionDAGs</a>
</div>
<div class="doc_text">
<p>
The SelectionDAG provides an abstraction for code representation in a way that
is amenable to instruction selection using automatic techniques
(e.g. dynamic-programming based optimal pattern matching selectors), It is also
well suited to other phases of code generation; in particular, instruction scheduling. Additionally, the SelectionDAG provides a host representation where a
large variety of very-low-level (but target-independent)
<a href="#selectiondag_optimize">optimizations</a> may be
performed: ones which require extensive information about the instructions
efficiently supported by the target.
</p>
<p>
The SelectionDAG is a Directed-Acyclic-Graph whose nodes are instances of the
<tt>SDNode</tt> class. The primary payload of the <tt>SDNode</tt> is its
operation code (Opcode) that indicates what operation the node performs.
The various operation node types are described at the top of the
<tt>include/llvm/CodeGen/SelectionDAGNodes.h</tt> file. Depending on the
operation, nodes may contain additional information (e.g. the condition code
for a SETCC node) contained in a derived class.</p>
<p>Although most operations define a single value, each node in the graph may
define multiple values. For example, a combined div/rem operation will define
both the dividend and the remainder. Many other situations require multiple
values as well. Each node also has some number of operands, which are edges
to the node defining the used value. Because nodes may define multiple values,
edges are represented by instances of the <tt>SDOperand</tt> class, which is
a &lt;SDNode, unsigned&gt; pair, indicating the node and result
value being used, respectively. Each value produced by an SDNode has an
associated MVT::ValueType, indicating what type the value is.
</p>
<p>
SelectionDAGs contain two different kinds of values: those that represent data
flow and those that represent control flow dependencies. Data values are simple
edges with an integer or floating point value type. Control edges are
represented as "chain" edges which are of type MVT::Other. These edges provide
an ordering between nodes that have side effects (such as
loads/stores/calls/return/etc). All nodes that have side effects should take a
token chain as input and produce a new one as output. By convention, token
chain inputs are always operand #0, and chain results are always the last
value produced by an operation.</p>
<p>
A SelectionDAG has designated "Entry" and "Root" nodes. The Entry node is
always a marker node with an Opcode of ISD::EntryToken. The Root node is the
final side-effecting node in the token chain. For example, in a single basic
block function, this would be the return node.
</p>
<p>
One important concept for SelectionDAGs is the notion of a "legal" vs. "illegal"
DAG. A legal DAG for a target is one that only uses supported operations and
supported types. On PowerPC, for example, a DAG with any values of i1, i8, i16,
or i64 type would be illegal. The <a href="#selectiondag_legalize">legalize</a>
phase is responsible for turning an illegal DAG into a legal DAG.
</p>
</div>
<!-- _______________________________________________________________________ -->
<div class="doc_subsubsection">
<a name="selectiondag_process">SelectionDAG Instruction Selection Process</a>
</div>
<div class="doc_text">
<p>
SelectionDAG-based instruction selection consists of the following steps:
</p>
<ol>
<li><a href="#selectiondag_build">Build initial DAG</a> - This stage performs
a simple translation from the input LLVM code to an illegal SelectionDAG.
</li>
<li><a href="#selectiondag_optimize">Optimize SelectionDAG</a> - This stage
performs simple optimizations on the SelectionDAG to simplify it and
recognize meta instructions (like rotates and div/rem pairs) for
targets that support these meta operations. This makes the resultant code
more efficient and the 'select instructions from DAG' phase (below) simpler.
</li>
<li><a href="#selectiondag_legalize">Legalize SelectionDAG</a> - This stage
converts the illegal SelectionDAG to a legal SelectionDAG, by eliminating
unsupported operations and data types.</li>
<li><a href="#selectiondag_optimize">Optimize SelectionDAG (#2)</a> - This
second run of the SelectionDAG optimized the newly legalized DAG, to
eliminate inefficiencies introduced by legalization.</li>
<li><a href="#selectiondag_select">Select instructions from DAG</a> - Finally,
the target instruction selector matches the DAG operations to target
instructions, emitting them and building the MachineFunction being
compiled.</li>
</ol>
<p>After all of these steps are complete, the SelectionDAG is destroyed and the
rest of the code generation passes are run.</p>
</div>
<!-- _______________________________________________________________________ -->
<div class="doc_subsubsection">
<a name="selectiondag_build">Initial SelectionDAG Construction</a>
</div>
<div class="doc_text">
<p>
The initial SelectionDAG is naively peephole expanded from the LLVM input by
the <tt>SelectionDAGLowering</tt> class in the SelectionDAGISel.cpp file. The
intent of this pass is to expose as much low-level, target-specific details
to the SelectionDAG as possible. This pass is mostly hard-coded (e.g. an LLVM
add turns into an SDNode add while a geteelementptr is expanded into the obvious
arithmetic). This pass requires target-specific hooks to lower calls and
returns, varargs, etc. For these features, the TargetLowering interface is
used.
</p>
</div>
<!-- _______________________________________________________________________ -->
<div class="doc_subsubsection">
<a name="selectiondag_legalize">SelectionDAG Legalize Phase</a>
</div>
<div class="doc_text">
<p>The Legalize phase is in charge of converting a DAG to only use the types and
operations that are natively supported by the target. This involves two major
tasks:</p>
<ol>
<li><p>Convert values of unsupported types to values of supported types.</p>
<p>There are two main ways of doing this: promoting a small type to a larger
type (e.g. f32 -&gt; f64, or i16 -&gt; i32), and breaking up large
integer types
to smaller ones (e.g. implementing i64 with i32 operations where
possible). Type conversions can insert sign and zero extensions as
needed to make sure that the final code has the same behavior as the
input.</p>
</li>
<li><p>Eliminate operations that are not supported by the target in a supported
type.</p>
<p>Targets often have wierd constraints, such as not supporting every
operation on every supported datatype (e.g. X86 does not support byte
conditional moves). Legalize takes care of either open-coding another
sequence of operations to emulate the operation (this is known as
expansion), promoting to a larger type that supports the operation
(promotion), or using a target-specific hook to implement the
legalization.</p>
</li>
</ol>
<p>
Instead of using a Legalize pass, we could require that every target-specific
<a href="#selectiondag_optimize">selector</a> supports and expands every
operator and type even if they are not supported and may require many
instructions to implement (in fact, this is the approach taken by the
"simple" selectors). However, using a Legalize pass allows all of the
cannonicalization patterns to be shared across targets which makes it very
easy to optimize the cannonicalized code because it is still in the form of
a DAG.
</p>
</div>
<!-- _______________________________________________________________________ -->
<div class="doc_subsubsection">
<a name="selectiondag_optimize">SelectionDAG Optimization Phase</a>
</div>
<div class="doc_text">
<p>
The SelectionDAG optimization phase is run twice for code generation: once
immediately after the DAG is built and once after legalization. The first run
of the pass allows the initial code to be cleaned up (e.g. performing
optimizations that depend on knowing that the operators have restricted type
inputs). The second run of the pass cleans up the messy code generated by the
Legalize pass, allowing Legalize to be very simple since it can ignore many
special cases.
</p>
<p>
One important class of optimizations that this pass will do in the future is
optimizing inserted sign and zero extension instructions. Here are some good
papers on the subject:</p>
<p>
"<a href="http://www.eecs.harvard.edu/~nr/pubs/widen-abstract.html">Widening
integer arithmetic</a>"<br>
Kevin Redwine and Norman Ramsey<br>
International Conference on Compiler Construction (CC) 2004
</p>
<p>
"<a href="http://portal.acm.org/citation.cfm?doid=512529.512552">Effective
sign extension elimination</a>"<br>
Motohiro Kawahito, Hideaki Komatsu, and Toshio Nakatani<br>
Proceedings of the ACM SIGPLAN 2002 Conference on Programming Language Design
and Implementation.
</p>
</div>
<!-- _______________________________________________________________________ -->
<div class="doc_subsubsection">
<a name="selectiondag_select">SelectionDAG Select Phase</a>
</div>
<div class="doc_text">
<p>The Select phase is the bulk of the target-specific code for instruction
selection. This phase takes a legal SelectionDAG as input, and does simple
pattern matching on the DAG to generate code. In time, the Select phase will
be automatically generated from the target's InstrInfo.td file, which is why we
want to make the Select phase as simple and mechanical as possible.</p>
</div>
<!-- _______________________________________________________________________ -->
<div class="doc_subsubsection">
<a name="selectiondag_future">Future directions for the SelectionDAG</a>
</div>
<div class="doc_text">
<ol>
<li>Optional whole-function selection.</li>
<li>Select is a graph translation phase.</li>
<li>Place the machine instructions resulting from Select according to register
pressure or a schedule.</li>
<li>DAG Scheduling.</li>
<li>Auto-generate the Select phase from the target description (*.td) files.
</li>
</ol>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection">
<a name="ssamco">SSA-based Machine Code Optimizations</a>
</div>
<div class="doc_text"><p>To Be Written</p></div>
<!-- ======================================================================= -->
<div class="doc_subsection">
<a name="regalloc">Register Allocation</a>
</div>
<div class="doc_text"><p>To Be Written</p></div>
<!-- ======================================================================= -->
<div class="doc_subsection">
<a name="proepicode">Prolog/Epilog Code Insertion</a>
</div>
<div class="doc_text"><p>To Be Written</p></div>
<!-- ======================================================================= -->
<div class="doc_subsection">
<a name="latemco">Late Machine Code Optimizations</a>
</div>
<div class="doc_text"><p>To Be Written</p></div>
<!-- ======================================================================= -->
<div class="doc_subsection">
<a name="codemission">Code Emission</a>
</div>
<!-- *********************************************************************** -->
<div class="doc_section">
<a name="targetimpls">Target description implementations</a>
@@ -552,7 +909,7 @@ are no virtual registers left in the code.</p>
<div class="doc_text">
<p>This section of the document explains any features or design decisions that
<p>This section of the document explains features or design decisions that
are specific to the code generator for a particular target.</p>
</div>
@@ -570,7 +927,7 @@ The X86 code generator lives in the <tt>lib/Target/X86</tt> directory. This
code generator currently targets a generic P6-like processor. As such, it
produces a few P6-and-above instructions (like conditional moves), but it does
not make use of newer features like MMX or SSE. In the future, the X86 backend
will have subtarget support added for specific processor families and
will have sub-target support added for specific processor families and
implementations.</p>
</div>
@@ -582,8 +939,7 @@ implementations.</p>
<div class="doc_text">
<p>
The x86 has a very, uhm, flexible, way of accessing memory. It is capable of
<p>The x86 has a very flexible way of accessing memory. It is capable of
forming memory addresses of the following expression directly in integer
instructions (which use ModR/M addressing):</p>
@@ -591,9 +947,9 @@ instructions (which use ModR/M addressing):</p>
Base+[1,2,4,8]*IndexReg+Disp32
</pre>
<p>Wow, that's crazy. In order to represent this, LLVM tracks no less that 4
operands for each memory operand of this form. This means that the "load" form
of 'mov' has the following "Operands" in this order:</p>
<p>In order to represent this, LLVM tracks no less than 4 operands for each
memory operand of this form. This means that the "load" form of 'mov' has the
following <tt>MachineOperand</tt>s in this order:</p>
<pre>
Index: 0 | 1 2 3 4
@@ -601,8 +957,8 @@ Meaning: DestReg, | BaseReg, Scale, IndexReg, Displacement
OperandTy: VirtReg, | VirtReg, UnsImm, VirtReg, SignExtImm
</pre>
<p>Stores and all other instructions treat the four memory operands in the same
way, in the same order.</p>
<p>Stores, and all other instructions, treat the four memory operands in the
same way, in the same order.</p>
</div>
@@ -614,9 +970,8 @@ way, in the same order.</p>
<div class="doc_text">
<p>
An instruction name consists of the base name, a default operand size
followed by a character per operand with an optional special size. For
example:</p>
An instruction name consists of the base name, a default operand size, and a
a character per operand with an optional special size. For example:</p>
<p>
<tt>ADD8rr</tt> -&gt; add, 8-bit register, 8-bit register<br>

View File

@@ -19,7 +19,7 @@
<ol>
<li><a href="#scf_commenting">Commenting</a></li>
<li><a href="#scf_commentformat">Comment Formatting</a></li>
<li><a href="#scf_includes">#include Style</a></li>
<li><a href="#scf_includes"><tt>#include</tt> Style</a></li>
<li><a href="#scf_codewidth">Source Code Width</a></li>
<li><a href="#scf_spacestabs">Use Spaces Instead of Tabs</a></li>
<li><a href="#scf_indentation">Indent Code Consistently</a></li>
@@ -29,6 +29,7 @@
<li><a href="#ci_warningerrors">Treat Compiler Warnings Like
Errors</a></li>
<li><a href="#ci_portable_code">Write Portable Code</a></li>
<li><a href="#ci_class_struct">Use of class/struct Keywords</a></li>
</ol></li>
</ol></li>
<li><a href="#styleissues">Style Issues</a>
@@ -45,7 +46,7 @@
<ol>
<li><a href="#hl_assert">Assert Liberally</a></li>
<li><a href="#hl_preincrement">Prefer Preincrement</a></li>
<li><a href="#hl_avoidendl">Avoid std::endl</a></li>
<li><a href="#hl_avoidendl">Avoid <tt>std::endl</tt></a></li>
<li><a href="#hl_exploitcpp">Exploit C++ to its Fullest</a></li>
</ol></li>
</ol></li>
@@ -110,7 +111,7 @@ href="mailto:sabre@nondot.org">Chris</a>.</p>
<div class="doc_text">
<p>Comments are one critical part of readability and maintainability. Everyone
knows they should comment, so should you. :) Although we all should probably
knows they should comment, so should you. Although we all should probably
comment our code more than we do, there are a few very critical places that
documentation is very useful:</p>
@@ -163,7 +164,7 @@ included, as well as any notes or "gotchas" in the code to watch out for.</p>
a class definition should have a comment block that explains what the class is
used for... if it's not obvious. If it's so completely obvious your grandma
could figure it out, it's probably safe to leave it out. Naming classes
something sane goes a long ways towards avoiding writing documentation. :)</p>
something sane goes a long ways towards avoiding writing documentation.</p>
<b>Method information</b>
@@ -193,8 +194,9 @@ when it is useful to use C style (<tt>/* */</tt>) comments however:</p>
<ol>
<li>When writing a C code: Obviously if you are writing C code, use C style
comments. :)</li>
<li>When writing a header file that may be #included by a C source file.</li>
comments.</li>
<li>When writing a header file that may be <tt>#include</tt>d by a C source
file.</li>
<li>When writing a source file that is used by a tool that only accepts C
style comments.</li>
</ol>
@@ -206,7 +208,7 @@ These nest properly and are better behaved in general than C style comments.</p>
<!-- _______________________________________________________________________ -->
<div class="doc_subsubsection">
<a name="scf_includes">#include Style</a>
<a name="scf_includes"><tt>#include</tt> Style</a>
</div>
<div class="doc_text">
@@ -234,13 +236,13 @@ order:</p>
<p>... and each catagory should be sorted by name.</p>
<p><a name="mmheader">The "Main Module Header"</a> file applies to .cpp file
which implement an interface defined by a .h file. This #include should always
be included <b>first</b> regardless of where it lives on the file system. By
including a header file first in the .cpp files that implement the interfaces,
we ensure that the header does not have any hidden dependencies which are not
explicitly #included in the header, but should be. It is also a form of
documentation in the .cpp file to indicate where the interfaces it implements
are defined.</p>
which implement an interface defined by a .h file. This <tt>#include</tt>
should always be included <b>first</b> regardless of where it lives on the file
system. By including a header file first in the .cpp files that implement the
interfaces, we ensure that the header does not have any hidden dependencies
which are not explicitly #included in the header, but should be. It is also a
form of documentation in the .cpp file to indicate where the interfaces it
implements are defined.</p>
</div>
@@ -366,6 +368,26 @@ to support it.</p>
</div>
<!-- _______________________________________________________________________ -->
<div class="doc_subsubsection">
<a name="ci_class_struct">Use of <tt>class</tt> and <tt>struct</tt> Keywords</a>
</div>
<div class="doc_text">
<p>In C++, the <tt>class</tt> and <tt>struct</tt> keywords can be used almost
interchangeably. The only difference is when they are used to declare a class:
<tt>class</tt> makes all members private by default while <tt>struct</tt> makes
all members public by default.</p>
<p>Unfortunately, not all compilers follow the rules and some will generate
different symbols based on whether <tt>class</tt> or <tt>struct</tt> was used to
declare the symbol. This can lead to problems at link time.</p>
<p>So, the rule for LLVM is to always use the <tt>class</tt> keyword, unless
<b>all</b> members are public, in which case <tt>struct</tt> is allowed.</p>
</div>
<!-- *********************************************************************** -->
<div class="doc_section">
<a name="styleissues">Style Issues</a>
@@ -411,7 +433,7 @@ translation unit.</p>
<!-- _______________________________________________________________________ -->
<div class="doc_subsubsection">
<a name="hl_dontinclude">#include as Little as Possible</a>
<a name="hl_dontinclude"><tt>#include</tt> as Little as Possible</a>
</div>
<div class="doc_text">
@@ -420,13 +442,13 @@ translation unit.</p>
have to, especially in header files.</p>
<p>But wait, sometimes you need to have the definition of a class to use it, or
to inherit from it. In these cases go ahead and #include that header file. Be
aware however that there are many cases where you don't need to have the full
definition of a class. If you are using a pointer or reference to a class, you
don't need the header file. If you are simply returning a class instance from a
prototyped function or method, you don't need it. In fact, for most cases, you
simply don't need the definition of a class... and not <tt>#include</tt>'ing
speeds up compilation.</p>
to inherit from it. In these cases go ahead and <tt>#include</tt> that header
file. Be aware however that there are many cases where you don't need to have
the full definition of a class. If you are using a pointer or reference to a
class, you don't need the header file. If you are simply returning a class
instance from a prototyped function or method, you don't need it. In fact, for
most cases, you simply don't need the definition of a class... and not
<tt>#include</tt>'ing speeds up compilation.</p>
<p>It is easy to try to go too overboard on this recommendation, however. You
<b>must</b> include all of the header files that you are using, either directly
@@ -448,7 +470,7 @@ about later...</p>
<p>Many modules have a complex implementation that causes them to use more than
one implementation (<tt>.cpp</tt>) file. It is often tempting to put the
internal communication interface (helper classes, extra functions, etc) in the
public module header file. Don't do this. :)</p>
public module header file. Don't do this.</p>
<p>If you really need to do something like this, put a private header file in
the same directory as the source files, and include it locally. This ensures
@@ -536,7 +558,7 @@ get in the habit of always using preincrement, and you won't have a problem.</p>
<!-- _______________________________________________________________________ -->
<div class="doc_subsubsection">
<a name="hl_avoidendl">Avoid std::endl</a>
<a name="hl_avoidendl">Avoid <tt>std::endl</tt></a>
</div>
<div class="doc_text">
@@ -571,8 +593,8 @@ to be remembered. Reducing the total number of lines of code you write is a
good way to avoid documentation, and avoid giving bugs a place to hide.</p>
<p>For these reasons, come to know and love the contents of your local
&lt;algorithm&gt; header file. Know about &lt;functional&gt; and what it can do
for you. C++ is just a tool that wants you to master it. :)</p>
<tt>&lt;algorithm&gt;</tt> header file. Know about <tt>&lt;functional&gt;</tt>
and what it can do for you. C++ is just a tool that wants you to master it.</p>
</div>
@@ -602,7 +624,7 @@ Software Design</a> by John Lakos</li>
</ol>
<p>If you get some free time, and you haven't read them: do so, you might learn
something. :)</p>
something.</p>
</div>

View File

@@ -0,0 +1 @@
pod2htm?.tmp

View File

@@ -1,7 +1,24 @@
POD = $(wildcard *.pod)
HTML = $(patsubst %.pod, html/%.html, $(POD))
MAN = $(patsubst %.pod, man/man1/%.1, $(POD))
PS = $(patsubst %.pod, ps/%.ps, $(POD))
##===- docs/CommandGuide/Makefile --------------------------*- Makefile -*-===##
#
# The LLVM Compiler Infrastructure
#
# This file was developed by the LLVM research group and is distributed under
# the University of Illinois Open Source License. See LICENSE.TXT for details.
#
##===----------------------------------------------------------------------===##
ifdef BUILD_FOR_WEBSITE
# This special case is for keeping the CommandGuide on the LLVM web site
# up to date automatically as the documents are checked in. It must build
# the POD files to HTML only and keep them in the src directories. It must also
# build in an unconfigured tree, hence the ifdef. To use this, run
# make -s BUILD_FOR_WEBSITE=1 inside the cvs commit script.
POD := $(wildcard *.pod)
HTML := $(patsubst %.pod, html/%.html, $(POD))
MAN := $(patsubst %.pod, man/man1/%.1, $(POD))
PS := $(patsubst %.pod, ps/%.ps, $(POD))
all: $(HTML) $(MAN) $(PS)
@@ -10,10 +27,10 @@ all: $(HTML) $(MAN) $(PS)
html/%.html: %.pod
pod2html --css=manpage.css --htmlroot=. \
--podpath=. --noindex --infile=$< --outfile=$@
--podpath=. --noindex --infile=$< --outfile=$@ --title=$*
man/man1/%.1: %.pod
pod2man --release=1.3 --center="LLVM Command Guide" $< $@
pod2man --release=1.5 --center="LLVM Command Guide" $< $@
ps/%.ps: man/man1/%.1
groff -Tps -man $< > $@
@@ -21,3 +38,64 @@ ps/%.ps: man/man1/%.1
clean:
rm -f pod2htm*.*~~ $(HTML) $(MAN) $(PS)
else
LEVEL := ../..
include $(LEVEL)/Makefile.common
POD := $(wildcard $(PROJ_SRC_DIR)/*.pod)
EXTRA_DIST := $(POD) index.html
HTML = $(patsubst $(PROJ_SRC_DIR)/%.pod, $(PROJ_OBJ_DIR)/%.html, $(POD))
MAN = $(patsubst $(PROJ_SRC_DIR)/%.pod, $(PROJ_OBJ_DIR)/%.1, $(POD))
PS = $(patsubst $(PROJ_SRC_DIR)/%.pod, $(PROJ_OBJ_DIR)/%.ps, $(POD))
.SUFFIXES:
.SUFFIXES: .html .pod .1 .ps
$(HTML) : html/.dir man/.dir man/man1/.dir ps/.dir
html: $(HTML)
$(PROJ_OBJ_DIR)/%.html: %.pod
$(POD2HTML) --css=manpage.css --htmlroot=. --podpath=. \
--noindex --infile=$< --outfile=$@ --title=$*
$(PROJ_OBJ_DIR)/%.1: %.pod
$(POD2MAN) --release=$(LLVMVersion) \
--center="LLVM Command Guide" $< $@
$(PROJ_OBJ_DIR)/%.ps: $(PROJ_OBJ_DIR)/%.1
$(GROFF) -Tps -man $< > $@
clean-local::
$(Verb) $(RM) -f pod2htm*.*~~ $(HTML) $(MAN) $(PS)
HTML_DIR := $(PROJ_docsdir)/html/CommandGuide
MAN_DIR := $(PROJ_mandir)/man1
PS_DIR := $(PROJ_docsdir)/ps
install-local:: $(HTML) $(MAN) $(PS)
$(Echo) Installing HTML CommandGuide Documentation
$(Verb) $(MKDIR) $(HTML_DIR)
$(Verb) $(DataInstall) $(HTML) $(HTML_DIR)
$(Verb) $(DataInstall) $(PROJ_SRC_DIR)/index.html $(HTML_DIR)
$(Verb) $(DataInstall) $(PROJ_SRC_DIR)/manpage.css $(HTML_DIR)
$(Echo) Installing MAN CommandGuide Documentation
$(Verb) $(MKDIR) $(MAN_DIR)
$(Verb) $(DataInstall) $(MAN) $(MAN_DIR)
$(Echo) Installing PS CommandGuide Documentation
$(Verb) $(MKDIR) $(PS_DIR)
$(Verb) $(DataInstall) $(PS) $(PS_DIR)
uninstall-local::
$(Echo) Uninstalling Documentation
$(Verb) $(RM) -rf $(LLVM_DOCSDIR)
printvars::
$(Echo) "POD : " '$(POD)'
$(Echo) "HTML : " '$(HTML)'
endif

View File

@@ -15,140 +15,9 @@ B<bugpoint> narrows down the source of problems in LLVM tools and passes. It
can be used to debug three types of failures: optimizer crashes, miscompilations
by optimizers, or bad native code generation (including problems in the static
and JIT compilers). It aims to reduce large test cases to small, useful ones.
For example, if B<gccas> crashes while optimizing a file, it will identify the
optimization (or combination of optimizations) that causes the crash, and reduce
the file down to a small example which triggers the crash.
=head2 Design Philosophy
B<bugpoint> is designed to be a useful tool without requiring any hooks into the
LLVM infrastructure at all. It works with any and all LLVM passes and code
generators, and does not need to "know" how they work. Because of this, it may
appear to do stupid things or miss obvious simplifications. B<bugpoint> is also
designed to trade off programmer time for computer time in the
compiler-debugging process; consequently, it may take a long period of
(unattended) time to reduce a test case, but we feel it is still worth it. Note
that B<bugpoint> is generally very quick unless debugging a miscompilation where
each test of the program (which requires executing it) takes a long time.
=head2 Automatic Debugger Selection
B<bugpoint> reads each F<.bc> or F<.ll> file specified on the command line and
links them together into a single module, called the test program. If any LLVM
passes are specified on the command line, it runs these passes on the test
program. If any of the passes crash, or if they produce malformed output (which
causes the verifier to abort), B<bugpoint> starts the crash debugger.
Otherwise, if the B<-output> option was not specified, B<bugpoint> runs the test
program with the C backend (which is assumed to generate good code) to generate
a reference output. Once B<bugpoint> has a reference output for the test
program, it tries executing it with the selected code generator. If the
selected code generator crashes, B<bugpoint> starts the L</Crash debugger> on
the code generator. Otherwise, if the resulting output differs from the
reference output, it assumes the difference resulted from a code generator
failure, and starts the L</Code generator debugger>.
Finally, if the output of the selected code generator matches the reference
output, B<bugpoint> runs the test program after all of the LLVM passes have been
applied to it. If its output differs from the reference output, it assumes the
difference resulted from a failure in one of the LLVM passes, and enters the
miscompilation debugger. Otherwise, there is no problem B<bugpoint> can debug.
=head2 Crash debugger
If an optimizer or code generator crashes, B<bugpoint> will try as hard as it
can to reduce the list of passes (for optimizer crashes) and the size of the
test program. First, B<bugpoint> figures out which combination of optimizer
passes triggers the bug. This is useful when debugging a problem exposed by
B<gccas>, for example, because it runs over 38 passes.
Next, B<bugpoint> tries removing functions from the test program, to reduce its
size. Usually it is able to reduce a test program to a single function, when
debugging intraprocedural optimizations. Once the number of functions has been
reduced, it attempts to delete various edges in the control flow graph, to
reduce the size of the function as much as possible. Finally, B<bugpoint>
deletes any individual LLVM instructions whose absence does not eliminate the
failure. At the end, B<bugpoint> should tell you what passes crash, give you a
bytecode file, and give you instructions on how to reproduce the failure with
B<opt>, B<analyze>, or B<llc>.
=head2 Code generator debugger
The code generator debugger attempts to narrow down the amount of code that is
being miscompiled by the selected code generator. To do this, it takes the test
program and partitions it into two pieces: one piece which it compiles with the
C backend (into a shared object), and one piece which it runs with either the
JIT or the static compiler (B<llc>). It uses several techniques to reduce the
amount of code pushed through the LLVM code generator, to reduce the potential
scope of the problem. After it is finished, it emits two bytecode files (called
"test" [to be compiled with the code generator] and "safe" [to be compiled with
the C backend], respectively), and instructions for reproducing the problem.
The code generator debugger assumes that the C backend produces good code.
=head2 Miscompilation debugger
The miscompilation debugger works similarly to the code generator debugger. It
works by splitting the test program into two pieces, running the optimizations
specified on one piece, linking the two pieces back together, and then executing
the result. It attempts to narrow down the list of passes to the one (or few)
which are causing the miscompilation, then reduce the portion of the test
program which is being miscompiled. The miscompilation debugger assumes that
the selected code generator is working properly.
=head2 Advice for using bugpoint
B<bugpoint> can be a remarkably useful tool, but it sometimes works in
non-obvious ways. Here are some hints and tips:
=over
=item *
In the code generator and miscompilation debuggers, B<bugpoint> only
works with programs that have deterministic output. Thus, if the program
outputs C<argv[0]>, the date, time, or any other "random" data, B<bugpoint> may
misinterpret differences in these data, when output, as the result of a
miscompilation. Programs should be temporarily modified to disable outputs that
are likely to vary from run to run.
=item *
In the code generator and miscompilation debuggers, debugging will go faster if
you manually modify the program or its inputs to reduce the runtime, but still
exhibit the problem.
=item *
B<bugpoint> is extremely useful when working on a new optimization: it helps
track down regressions quickly. To avoid having to relink B<bugpoint> every
time you change your optimization, make B<bugpoint> dynamically load
your optimization by using the B<-load> option.
=item *
B<bugpoint> can generate a lot of output and run for a long period of time. It
is often useful to capture the output of the program to file. For example, in
the C shell, you can type:
bugpoint ... |& tee bugpoint.log
to get a copy of B<bugpoint>'s output in the file F<bugpoint.log>, as well as on
your terminal.
=item *
B<bugpoint> cannot debug problems with the LLVM linker. If B<bugpoint> crashes
before you see its C<All input ok> message, you might try running C<llvm-link
-v> on the same set of input files. If that also crashes, you may be
experiencing a linker bug.
=item *
If your program is supposed to crash, B<bugpoint> will be confused. One way to
deal with this is to cause B<bugpoint> to ignore the exit code from your
program, by giving it the B<-check-exit-code=false> option.
=back
For more information on the design and inner workings of B<bugpoint>, as well as
advice for using bugpoint, see F<llvm/docs/Bugpoint.html> in the LLVM
distribution.
=head1 OPTIONS

View File

@@ -112,7 +112,7 @@ Do not mark all symbols as internal.
Preserve the list of symbol names in the file filename.
=item B<-internalize-public-api-list &lt;list&gt;>
=item B<-internalize-public-api-list> I<list>
Preserve the symbol names in list.

View File

@@ -1 +1,2 @@
*html
.dir

View File

@@ -48,18 +48,30 @@ options) arguments to the tool you are interested in.</p>
directly run a program compiled to bytecode using a JIT compiler or
interpreter</li>
<li><a href="html/llvm-link.html"><b>llvm-link</b></A>
<li><a href="html/llvm-link.html"><b>llvm-link</b></a> -
link several bytecode files into one</li>
<li><a href="html/analyze.html"><b>analyze</b></a> -
run LLVM analyses on a bytecode file and print the results</li>
<li><a href="html/llvm-nm.html"><b>llvm-nm</b></a>
<li><a href="html/llvm-ar.html"><b>llvm-ar</b></a> -
archive bytecode files</li>
<li><a href="html/llvm-ranlib.html"><b>llvm-ranlib</b></a> -
create an index for archives made with llvm-ar</li>
<li><a href="html/llvm-nm.html"><b>llvm-nm</b></a> -
print out the names and types of symbols in a bytecode file</li>
<li><a href="html/llvm-prof.html"><b>llvm-prof</b></a> -
format raw `<tt>llvmprof.out</tt>' data into a human-readable report</li>
<li><a href="html/llvmc.html"><b>llvmc</b></a> -
generic and configurable compiler driver</li>
<li><a href="html/llvm-ld.html"><b>llvm-ld</b></a> -
general purpose linker with loadable runtime optimization support</li>
</ul>
</div>
@@ -107,7 +119,7 @@ options) arguments to the tool you are interested in.</p>
<li><a href="html/bugpoint.html"><b>bugpoint</b></a> -
automatic test-case reducer</li>
<li><a href="html/extract.html"><b>extract</b></a> -
<li><a href="html/llvm-extract.html"><b>llvm-extract</b></a> -
extract a function from an LLVM bytecode file</li>
<li><a href="html/llvm-bcanalyzer.html"><b>llvm-bcanalyzer</b></a> -

View File

@@ -12,36 +12,11 @@ B<llc> [I<options>] [I<filename>]
The B<llc> command compiles LLVM bytecode into assembly language for a
specified architecture. The assembly language output can then be passed through
a native assembler and linker to generate native code.
a native assembler and linker to generate a native executable.
The choice of architecture for the output assembly code is determined as
follows, by attempting to satisfy each of the following rules in turn (first
one wins):
=over
=item *
If the user has specified an architecture with the -m option, use that
architecture.
=item *
Examine the input LLVM bytecode file: if it is little endian and has a
pointer size of 32 bits, select the Intel IA-32 architecture. If it is big
endian and has a pointer size of 64 bits, select the SparcV9 architecture.
=item *
If B<llc> was compiled on an architecture for which it can generate code, select
the architecture upon which B<llc> was compiled.
=item *
Exit with an error message telling the user to specify the output
architecture explicitly.
=back
The choice of architecture for the output assembly code is automatically
determined from the input bytecode file, unless the B<-march> option is used to
override the default.
=head1 OPTIONS
@@ -58,8 +33,14 @@ removing any existing F<.bc> extension, and adding a F<.s> suffix.
Other B<llc> options are as follows:
=head2 End-user Options
=over
=item B<--help>
Print a summary of command line options.
=item B<-f>
Overwrite output files. By default, B<llc> will refuse to overwrite
@@ -67,60 +48,56 @@ an output file which already exists.
=item B<-march>=I<arch>
Specify the architecture for which to generate assembly. Valid
architectures are:
=over
=item I<x86>
Intel IA-32 (Pentium and above)
=item I<sparcv9>
64-bit SPARC V9
=item I<c>
Emit C code, not assembly
=back
=item B<-enable-correct-eh-support>
Instruct the B<-lowerinvoke> pass to insert code for correct exception handling
support. This is expensive and is by default omitted for efficiency.
=item B<-help>
Print a summary of command line options.
=item B<-stats>
Print statistics recorded by code-generation passes.
=item B<-time-passes>
Record the amount of time needed for each pass and print a report to standard
error.
=back
=head2 Intel IA-32-specific Options
=over
Specify the architecture for which to generate assembly, overriding the target
encoded in the bytecode file. See the output of B<llc --help> for a list of
valid architectures.
=item B<--disable-fp-elim>
Disable frame pointer elimination optimization.
=item B<--disable-pattern-isel>
=item B<--disable-excess-fp-precision>
Use the 'simple' X86 instruction selector (the default).
Disable optimizations that may produce excess precision for floating point.
Note that this option can dramatically slow down code on some systems
(e.g. X86).
=item B<--enable-unsafe-fp-math>
Enable optimizations that make unsafe assumptions about IEEE math (e.g. that
addition is associative) or may not work for all input ranges. These
optimizations allow the code generator to make use of some instructions which
would otherwise not be usable (such as fsin on X86).
=item B<--enable-correct-eh-support>
Instruct the B<lowerinvoke> pass to insert code for correct exception handling
support. This is expensive and is by default omitted for efficiency.
=item B<--stats>
Print statistics recorded by code-generation passes.
=item B<--time-passes>
Record the amount of time needed for each pass and print a report to standard
error.
=item B<--load>=F<dso_path>
Dynamically load F<dso_path> (a path to a dynamically shared object) that
implements an LLVM target. This will permit the target name to be used with the
B<-march> option so that code can be generated for that target.
=back
=head2 Tuning/Configuration Options
=over
=item B<--print-machineinstrs>
Print generated machine code.
Print generated machine code between compilation phases (useful for debugging).
=item B<--regalloc>=I<allocator>
@@ -167,6 +144,17 @@ Local spiller
=back
=head2 Intel IA-32-specific Options
=over
=item B<--x86-asm-syntax=att|intel>
Specify whether to emit assembly code in AT&T syntax (the default) or intel
syntax.
=back
=head2 SPARCV9-specific Options
=over
@@ -179,15 +167,6 @@ Disable peephole optimization pass.
Disable local scheduling pass.
=item B<--disable-strip>
The Sparc backend embeds the LLVM bytecode into the assembly output. This
option requests that symbol names be retained; by default, they are stripped out.
=item B<--enable-maps>
Emit LLVM-to-machine code mapping information into the assembly output.
=back
=head1 EXIT STATUS

View File

@@ -0,0 +1,406 @@
=pod
=head1 NAME
llvm-ar - LLVM archiver
=head1 SYNOPSIS
B<llvm-ar> [-]{dmpqrtx}[Rabfikouz] [relpos] [count] <archive> [files...]
=head1 DESCRIPTION
The B<llvm-ar> command is similar to the common Unix utility, C<ar>. It
archives several files together into a single file. The intent for this is
to produce archive libraries by LLVM bytecode that can be linked into an
LLVM program. However, the archive can contain any kind of file. By default,
B<llvm-ar> generates a symbol table that makes linking faster because
only the symbol table needs to be consulted, not each individual file member
of the archive.
The B<llvm-ar> command can be used to I<read> both SVR4 and BSD style archive
files. However, it cannot be used to write them. While the B<llvm-ar> command
produces files that are I<almost> identical to the format used by other C<ar>
implementations, it has two significant departures in order to make the
archive appropriate for LLVM. The first departure is that B<llvm-ar> only
uses BSD4.4 style long path names (stored immediately after the header) and
never contains a string table for long names. The second departure is that the
symbol table is formated for efficient construction of an in-memory data
structure that permits rapid (red-black tree) lookups. Consequently, archives
produced with B<llvm-ar> usually won't be readable or editable with any
C<ar> implementation or useful for linking. Using the C<f> modifier to flatten
file names will make the archive readable by other C<ar> implementations
but not for linking because the symbol table format for LLVM is unique. If an
SVR4 or BSD style archive is used with the C<r> (replace) or C<q> (quick
update) operations, the archive will be reconstructed in LLVM format. This
means that the string table will be dropped (in deference to BSD 4.4 long names)
and an LLVM symbol table will be added (by default). The system symbol table
will be retained.
Here's where B<llvm-ar> departs from previous C<ar> implementations:
=over
=item I<Symbol Table>
Since B<llvm-ar> is intended to archive bytecode files, the symbol table
won't make much sense to anything but LLVM. Consequently, the symbol table's
format has been simplified. It consists simply of a sequence of pairs
of a file member index number as an LSB 4byte integer and a null-terminated
string.
=item I<Long Paths>
Some C<ar> implementations (SVR4) use a separate file member to record long
path names (> 15 characters). B<llvm-ar> takes the BSD 4.4 and Mac OS X
approach which is to simply store the full path name immediately preceding
the data for the file. The path name is null terminated and may contain the
slash (/) character.
=item I<Compression>
B<llvm-ar> can compress the members of an archive to save space. The
compression used depends on what's available on the platform and what choices
the LLVM Compressor utility makes. It generally favors bzip2 but will select
between "no compression" or bzip2 depending on what makes sense for the
file's content.
=item I<Directory Recursion>
Most C<ar> implementations do not recurse through directories but simply
ignore directories if they are presented to the program in the F<files>
option. B<llvm-ar>, however, can recurse through directory structures and
add all the files under a directory, if requested.
=item I<TOC Verbose Output>
When B<llvm-ar> prints out the verbose table of contents (C<tv> option), it
precedes the usual output with a character indicating the basic kind of
content in the file. A blank means the file is a regular file. A 'Z' means
the file is compressed. A 'B' means the file is an LLVM bytecode file. An
'S' means the file is the symbol table.
=back
=head1 OPTIONS
The options to B<llvm-ar> are compatible with other C<ar> implementations.
However, there are a few modifiers (F<zR>) that are not found in other
C<ar>s. The options to B<llvm-ar> specify a single basic operation to
perform on the archive, a variety of modifiers for that operation, the
name of the archive file, and an optional list of file names. These options
are used to determine how B<llvm-ar> should process the archive file.
The Operations and Modifiers are explained in the sections below. The minimal
set of options is at least one operator and the name of the archive. Typically
archive files end with a C<.a> suffix, but this is not required. Following
the F<archive-name> comes a list of F<files> that indicate the specific members
of the archive to operate on. If the F<files> option is not specified, it
generally means either "none" or "all" members, depending on the operation.
=head2 Operations
=over
=item d
Delete files from the archive. No modifiers are applicable to this operation.
The F<files> options specify which members should be removed from the
archive. It is not an error if a specified file does not appear in the archive.
If no F<files> are specified, the archive is not modified.
=item m[abi]
Move files from one location in the archive to another. The F<a>, F<b>, and
F<i> modifiers apply to this operation. The F<files> will all be moved
to the location given by the modifiers. If no modifiers are used, the files
will be moved to the end of the archive. If no F<files> are specified, the
archive is not modified.
=item p[k]
Print files to the standard output. The F<k> modifier applies to this
operation. This operation simply prints the F<files> indicated to the
standard output. If no F<files> are specified, the entire archive is printed.
Printing bytecode files is ill-advised as they might confuse your terminal
settings. The F<p> operation never modifies the archive.
=item q[Rfz]
Quickly append files to the end of the archive. The F<R>, F<f>, and F<z>
modifiers apply to this operation. This operation quickly adds the
F<files> to the archive without checking for duplicates that should be
removed first. If no F<files> are specified, the archive is not modified.
Because of the way that B<llvm-ar> constructs the archive file, its dubious
whether the F<q> operation is any faster than the F<r> operation.
=item r[Rabfuz]
Replace or insert file members. The F<R>, F<a>, F<b>, F<f>, F<u>, and F<z>
modifiers apply to this operation. This operation will replace existing
F<files> or insert them at the end of the archive if they do not exist. If no
F<files> are specified, the archive is not modified.
=item t[v]
Print the table of contents. Without any modifiers, this operation just prints
the names of the members to the standard output. With the F<v> modifier,
B<llvm-ar> also prints out the file type (B=bytecode, Z=compressed, S=symbol
table, blank=regular file), the permission mode, the owner and group, the
size, and the date. If any F<files> are specified, the listing is only for
those files. If no F<files> are specified, the table of contents for the
whole archive is printed.
=item x[oP]
Extract archive members back to files. The F<o> modifier applies to this
operation. This operation retrieves the indicated F<files> from the archive
and writes them back to the operating system's file system. If no
F<files> are specified, the entire archive is extract.
=back
=head2 Modifiers (operation specific)
The modifiers below are specific to certain operations. See the Operations
section (above) to determine which modifiers are applicable to which operations.
=over
=item [a]
When inserting or moving member files, this option specifies the destination of
the new files as being C<a>fter the F<relpos> member. If F<relpos> is not found,
the files are placed at the end of the archive.
=item [b]
When inserting or moving member files, this option specifies the destination of
the new files as being C<b>efore the F<relpos> member. If F<relpos> is not
found, the files are placed at the end of the archive. This modifier is
identical to the the F<i> modifier.
=item [f]
Normally, B<llvm-ar> stores the full path name to a file as presented to it on
the command line. With this option, truncated (15 characters max) names are
used. This ensures name compatibility with older versions of C<ar> but may also
thwart correct extraction of the files (duplicates may overwrite). If used with
the F<R> option, the directory recursion will be performed but the file names
will all be C<f>lattened to simple file names.
=item [i]
A synonym for the F<b> option.
=item [k]
Normally, B<llvm-ar> will not print the contents of bytecode files when the
F<p> operation is used. This modifier defeats the default and allows the
bytecode members to be printed.
=item [N]
This option is ignored by B<llvm-ar> but provided for compatibility.
=item [o]
When extracting files, this option will cause B<llvm-ar> to preserve the
original modification times of the files it writes.
=item [P]
use full path names when matching
=item [R]
This modifier instructions the F<r> option to recursively process directories.
Without F<R>, directories are ignored and only those F<files> that refer to
files will be added to the archive. When F<R> is used, any directories specified
with F<files> will be scanned (recursively) to find files to be added to the
archive. Any file whose name begins with a dot will not be added.
=item [u]
When replacing existing files in the archive, only replace those files that have
a time stamp than the time stamp of the member in the archive.
=item [z]
When inserting or replacing any file in the archive, compress the file first.
This
modifier is safe to use when (previously) compressed bytecode files are added to
the archive; the compressed bytecode files will not be doubly compressed.
=back
=head2 Modifiers (generic)
The modifiers below may be applied to any operation.
=over
=item [c]
For all operations, B<llvm-ar> will always create the archive if it doesn't
exist. Normally, B<llvm-ar> will print a warning message indicating that the
archive is being created. Using this modifier turns off that warning.
=item [s]
This modifier requests that an archive index (or symbol table) be added to the
archive. This is the default mode of operation. The symbol table will contain
all the externally visible functions and global variables defined by all the
bytecode files in the archive. Using this modifier is more efficient that using
L<llvm-ranlib|llvm-ranlib> which also creates the symbol table.
=item [S]
This modifier is the opposite of the F<s> modifier. It instructs B<llvm-ar> to
not build the symbol table. If both F<s> and F<S> are used, the last modifier to
occur in the options will prevail.
=item [v]
This modifier instructs B<llvm-ar> to be verbose about what it is doing. Each
editing operation taken against the archive will produce a line of output saying
what is being done.
=back
=head1 STANDARDS
The B<llvm-ar> utility is intended to provide a superset of the IEEE Std 1003.2
(POSIX.2) functionality for C<ar>. B<llvm-ar> can read both SVR4 and BSD4.4 (or
Mac OS X) archives. If the C<f> modifier is given to the C<x> or C<r> operations
then B<llvm-ar> will write SVR4 compatible archives. Without this modifier,
B<llvm-ar> will write BSD4.4 compatible archives that have long names
immediately after the header and indicated using the "#1/ddd" notation for the
name in the header.
=head1 FILE FORMAT
The file format for LLVM Archive files is similar to that of BSD 4.4 or Mac OSX
archive files. In fact, except for the symbol table, the C<ar> commands on those
operating systems should be able to read LLVM archive files. The details of the
file format follow.
Each archive begins with the archive magic number which is the eight printable
characters "!<arch>\n" where \n represents the newline character (0x0A).
Following the magic number, the file is composed of even length members that
begin with an archive header and end with a \n padding character if necessary
(to make the length even). Each file member is composed of a header (defined
below), an optional newline-terminated "long file name" and the contents of
the file.
The fields of the header are described in the items below. All fields of the
header contain only ASCII characters, are left justified and are right padded
with space characters.
=over
=item name - char[16]
This field of the header provides the name of the archive member. If the name is
longer than 15 characters or contains a slash (/) character, then this field
contains C<#1/nnn> where C<nnn> provides the length of the name and the C<#1/>
is literal. In this case, the actual name of the file is provided in the C<nnn>
bytes immediately following the header. If the name is 15 characters or less, it
is contained directly in this field and terminated with a slash (/) character.
=item date - char[12]
This field provides the date of modification of the file in the form of a
decimal encoded number that provides the number of seconds since the epoch
(since 00:00:00 Jan 1, 1970) per Posix specifications.
=item uid - char[6]
This field provides the user id of the file encoded as a decimal ASCII string.
This field might not make much sense on non-Unix systems. On Unix, it is the
same value as the st_uid field of the stat structure returned by the stat(2)
operating system call.
=item gid - char[6]
This field provides the group id of the file encoded as a decimal ASCII string.
This field might not make much sense on non-Unix systems. On Unix, it is the
same value as the st_gid field of the stat structure returned by the stat(2)
operating system call.
=item mode - char[8]
This field provides the access mode of the file encoded as an octal ASCII
string. This field might not make much sense on non-Unix systems. On Unix, it
is the same value as the st_mode field of the stat structure returned by the
stat(2) operating system call.
=item size - char[10]
This field provides the size of the file, in bytes, encoded as a decimal ASCII
string. If the size field is negative (starts with a minus sign, 0x02D), then
the archive member is stored in compressed form. The first byte of the archive
member's data indicates the compression type used. A value of 0 (0x30) indicates
that no compression was used. A value of 2 (0x32) indicates that bzip2
compression was used.
=item fmag - char[2]
This field is the archive file member magic number. Its content is always the
two characters back tick (0x60) and newline (0x0A). This provides some measure
utility in identifying archive files that have been corrupted.
=back
The LLVM symbol table has the special name "#_LLVM_SYM_TAB_#". It is presumed
that no regular archive member file will want this name. The LLVM symbol table
is simply composed of a sequence of triplets: byte offset, length of symbol,
and the symbol itself. Symbols are not null or newline terminated. Here are
the details on each of these items:
=over
=item offset - vbr encoded 32-bit integer
The offset item provides the offset into the archive file where the bytecode
member is stored that is associated with the symbol. The offset value is 0
based at the start of the first "normal" file member. To derive the actual
file offset of the member, you must add the number of bytes occupied by the file
signature (8 bytes) and the symbol tables. The value of this item is encoded
using variable bit rate encoding to reduce the size of the symbol table.
Variable bit rate encoding uses the high bit (0x80) of each byte to indicate
if there are more bytes to follow. The remaining 7 bits in each byte carry bits
from the value. The final byte does not have the high bit set.
=item length - vbr encoded 32-bit integer
The length item provides the length of the symbol that follows. Like this
I<offset> item, the length is variable bit rate encoded.
=item symbol - character array
The symbol item provides the text of the symbol that is associated with the
I<offset>. The symbol is not terminated by any character. Its length is provided
by the I<length> field. Note that is allowed (but unwise) to use non-printing
characters (even 0x00) in the symbol. This allows for multiple encodings of
symbol names.
=back
=head1 EXIT STATUS
If B<llvm-ar> succeeds, it will exit with 0. A usage error, results
in an exit code of 1. A hard (file system typically) error results in an
exit code of 2. Miscellaneous or unknown errors result in an
exit code of 3.
=head1 SEE ALSO
L<llvm-ranlib|llvm-ranlib>, L<ar(1)>
=head1 AUTHORS
Maintained by the LLVM Team (L<http://llvm.cs.uiuc.edu>).
=cut

View File

@@ -10,9 +10,9 @@ B<llvm-as> [I<options>] [I<filename>]
=head1 DESCRIPTION
The B<llvm-as> command invokes the LLVM assembler. It reads a file containing
human-readable LLVM assembly language, translates it to LLVM bytecode, and
writes the result into a file or to standard output.
B<llvm-as> is the LLVM assembler. It reads a file containing human-readable
LLVM assembly language, translates it to LLVM bytecode, and writes the result
into a file or to standard output.
If F<filename> is omitted or is C<->, then B<llvm-as> reads its input from
standard input.
@@ -59,15 +59,6 @@ Print a summary of command line options.
Specify the output file name. If F<filename> is C<->, then B<llvm-as>
sends its output to standard output.
=item B<--stats>
Print statistics.
=item B<--time-passes>
Record the amount of time needed for each pass and print it to standard
error.
=back
=head1 EXIT STATUS

View File

@@ -6,21 +6,20 @@ llvm-bcanalyzer - LLVM bytecode analyzer
=head1 SYNOPSIS
B<llvm-bcanalyzer> [I<options>] [I<filename>]
B<llvm-bcanalyzer> [I<options>] [F<filename>]
=head1 DESCRIPTION
The B<llvm-bcanalyzer> command is a small utility for analyzing bytecode files.
The tool reads a bytecode file (such as generated with the B<llvm-as> tool) and
produces a statistical report on the contents of the byteocde file. The tool
will also dump a low level but human readable version of the bytecode file.
can also dump a low level but human readable version of the bytecode file.
This tool is probably not of much interest or utility except for those working
directly with the bytecode file format. Most LLVM users can just ignore
this tool.
If F<filename> is omitted or is C<->, then B<llvm-bcanalyzer> reads its input
from standard input. This is useful for combining the tool into a pipeline.
Output is written to the standard output.
=head1 OPTIONS
@@ -36,11 +35,11 @@ level summary. The details for individual functions are not displayed.
Causes B<llvm-bcanalyzer> to dump the bytecode in a human readable format. This
format is significantly different from LLVM assembly and provides details about
the encoding of the bytecode file.
the encoding of the bytecode file.
=item B<-verify>
Causes B<llvm-bcanalyzer> to verify the module produced by by reading the
Causes B<llvm-bcanalyzer> to verify the module produced by reading the
bytecode. This ensures that the statistics generated are based on a consistent
module.
@@ -55,6 +54,256 @@ Print a summary of command line options.
If B<llvm-bcanalyzer> succeeds, it will exit with 0. Otherwise, if an error
occurs, it will exit with a non-zero value, usually 1.
=head1 SUMMARY OUTPUT DEFINITIONS
The following items are always printed by llvm-bcanalyzer. They comprize the
summary output.
=over
=item B<Bytecode Analysis Of Module>
This just provides the name of the module for which bytecode analysis is being
generated.
=item B<Bytecode Version Number>
The bytecode version (not LLVM version) of the file read by the analyzer.
=item B<File Size>
The size, in bytes, of the entire bytecode file.
=item B<Module Bytes>
The size, in bytes, of the module block. Percentage is relative to File Size.
=item B<Function Bytes>
The size, in bytes, of all the function blocks. Percentage is relative to File
Size.
=item B<Global Types Bytes>
The size, in bytes, of the Global Types Pool. Percentage is relative to File
Size. This is the size of the definitions of all types in the bytecode file.
=item B<Constant Pool Bytes>
The size, in bytes, of the Constant Pool Blocks Percentage is relative to File
Size.
=item B<Module Globals Bytes>
Ths size, in bytes, of the Global Variable Definitions and their initializers.
Percentage is relative to File Size.
=item B<Instruction List Bytes>
The size, in bytes, of all the instruction lists in all the functions.
Percentage is relative to File Size. Note that this value is also included in
the Function Bytes.
=item B<Compaction Table Bytes>
The size, in bytes, of all the compaction tables in all the functions.
Percentage is relative to File Size. Note that this value is also included in
the Function Bytes.
=item B<Symbol Table Bytes>
The size, in bytes, of all the symbol tables in all the functions. Percentage is
relative to File Size. Note that this value is also included in the Function
Bytes.
=item B<Dependent Libraries Bytes>
The size, in bytes, of the list of dependent libraries in the module. Percentage
is relative to File Size. Note that this value is also included in the Module
Global Bytes.
=item B<Number Of Bytecode Blocks>
The total number of blocks of any kind in the bytecode file.
=item B<Number Of Functions>
The total number of function definitions in the bytecode file.
=item B<Number Of Types>
The total number of types defined in the Global Types Pool.
=item B<Number Of Constants>
The total number of constants (of any type) defined in the Constant Pool.
=item B<Number Of Basic Blocks>
The total number of basic blocks defined in all functions in the bytecode file.
=item B<Number Of Instructions>
The total number of instructions defined in all functions in the bytecode file.
=item B<Number Of Long Instructions>
The total number of long instructions defined in all functions in the bytecode
file. Long instructions are those taking greater than 4 bytes. Typically long
instructions are GetElementPtr with several indices, PHI nodes, and calls to
functions with large numbers of arguments.
=item B<Number Of Operands>
The total number of operands used in all instructions in the bytecode file.
=item B<Number Of Compaction Tables>
The total number of compaction tables in all functions in the bytecode file.
=item B<Number Of Symbol Tables>
The total number of symbol tables in all functions in the bytecode file.
=item B<Number Of Dependent Libs>
The total number of dependent libraries found in the bytecode file.
=item B<Total Instruction Size>
The total size of the instructions in all functions in the bytecode file.
=item B<Average Instruction Size>
The average number of bytes per instruction across all functions in the bytecode
file. This value is computed by dividing Total Instruction Size by Number Of
Instructions.
=item B<Maximum Type Slot Number>
The maximum value used for a type's slot number. Larger slot number values take
more bytes to encode.
=item B<Maximum Value Slot Number>
The maximum value used for a value's slot number. Larger slot number values take
more bytes to encode.
=item B<Bytes Per Value>
The average size of a Value definition (of any type). This is computed by
dividing File Size by the total number of values of any type.
=item B<Bytes Per Global>
The average size of a global definition (constants and global variables).
=item B<Bytes Per Function>
The average number of bytes per function definition. This is computed by
dividing Function Bytes by Number Of Functions.
=item B<# of VBR 32-bit Integers>
The total number of 32-bit integers encoded using the Variable Bit Rate
encoding scheme.
=item B<# of VBR 64-bit Integers>
The total number of 64-bit integers encoded using the Variable Bit Rate encoding
scheme.
=item B<# of VBR Compressed Bytes>
The total number of bytes consumed by the 32-bit and 64-bit integers that use
the Variable Bit Rate encoding scheme.
=item B<# of VBR Expanded Bytes>
The total number of bytes that would have been consumed by the 32-bit and 64-bit
integers had they not been compressed with the Variable Bit Rage encoding
scheme.
=item B<Bytes Saved With VBR>
The total number of bytes saved by using the Variable Bit Rate encoding scheme.
The percentage is relative to # of VBR Expanded Bytes.
=back
=head1 DETAILED OUTPUT DEFINITIONS
The following definitions occur only if the -nodetails option was not given.
The detailed output provides additional information on a per-function basis.
=over
=item B<Type>
The type signature of the function.
=item B<Byte Size>
The total number of bytes in the function's block.
=item B<Basic Blocks>
The number of basic blocks defined by the function.
=item B<Instructions>
The number of instructions defined by the function.
=item B<Long Instructions>
The number of instructions using the long instruction format in the function.
=item B<Operands>
The number of operands used by all instructions in the function.
=item B<Instruction Size>
The number of bytes consumed by instructions in the function.
=item B<Average Instruction Size>
The average number of bytes consumed by the instructions in the funtion. This
value is computed by dividing Instruction Size by Instructions.
=item B<Bytes Per Instruction>
The average number of bytes used by the function per instruction. This value is
computed by dividing Byte Size by Instructions. Note that this is not the same
as Average Instruction Size. It computes a number relative to the total function
size not just the size of the instruction list.
=item B<Number of VBR 32-bit Integers>
The total number of 32-bit integers found in this function (for any use).
=item B<Number of VBR 64-bit Integers>
The total number of 64-bit integers found in this function (for any use).
=item B<Number of VBR Compressed Bytes>
The total number of bytes in this function consumed by the 32-bit and 64-bit
integers that use the Variable Bit Rate encoding scheme.
=item B<Number of VBR Expanded Bytes>
The total number of bytes in this function that would have been consumed by
the 32-bit and 64-bit integers had they not been compressed with the Variable
Bit Rate encoding scheme.
=item B<Bytes Saved With VBR>
The total number of bytes saved in this function by using the Variable Bit
Rate encoding scheme. The percentage is relative to # of VBR Expanded Bytes.
=back
=head1 SEE ALSO
L<llvm-dis|llvm-dis>, L<http://llvm.cs.uiuc.edu/docs/BytecodeFormat.html>

View File

@@ -42,11 +42,6 @@ Print a summary of command line options.
Specify the output file name. If F<filename> is -, then the output is sent
to standard output.
=item B<-time-passes>
Record the amount of time needed for each pass and print it to standard
error.
=back
=head1 EXIT STATUS

View File

@@ -2,23 +2,23 @@
=head1 NAME
extract - extract a function from an LLVM module
llvm-extract - extract a function from an LLVM module
=head1 SYNOPSIS
B<extract> [I<options>] B<--func> I<function-name> [I<filename>]
B<llvm-extract> [I<options>] B<--func> I<function-name> [I<filename>]
=head1 DESCRIPTION
The B<extract> command takes the name of a function and extracts it from
The B<llvm-extract> command takes the name of a function and extracts it from
the specified LLVM bytecode file. It is primarily used as a debugging tool to
reduce test cases from larger programs that are triggering a bug.
In addition to extracting the bytecode of the specified function,
B<extract> will also remove unreachable global variables, prototypes, and
B<llvm-extract> will also remove unreachable global variables, prototypes, and
unused types.
The B<extract> command reads its input from standard input if filename is
The B<llvm-extract> command reads its input from standard input if filename is
omitted or if filename is -. The output is always written to standard output,
unless the B<-o> option is specified (see below).
@@ -28,8 +28,8 @@ unless the B<-o> option is specified (see below).
=item B<-f>
Force overwrite. Normally, B<extract> will refuse to overwrite an
output file that already exists. With this option, B<extract>
Force overwrite. Normally, B<llvm-extract> will refuse to overwrite an
output file that already exists. With this option, B<llvm-extract>
will overwrite the output file and replace it with new bytecode.
=item B<--func> I<function-name>
@@ -43,22 +43,13 @@ Print a summary of command line options.
=item B<-o> I<filename>
Specify the output filename. If filename is "-" (the default), then
B<extract> sends its output to standard output.
=item B<--stats>
Print statistics.
=item B<--time-passes>
Record the amount of time needed for each pass and print it to standard
error.
B<llvm-extract> sends its output to standard output.
=back
=head1 EXIT STATUS
If B<extract> succeeds, it will exit with 0. Otherwise, if an error
If B<llvm-extract> succeeds, it will exit with 0. Otherwise, if an error
occurs, it will exit with a non-zero value.
=head1 SEE ALSO

View File

@@ -0,0 +1,171 @@
=pod
=head1 NAME
llvm-ld - LLVM linker
=head1 SYNOPSIS
B<llvm-ld> <options> <files>
=head1 DESCRIPTION
The B<llvm-ld> command is similar to the common Unix utility, C<ld>. It
links together bytecode modules to produce an executable program.
=head1 OPTIONS
=head2 Input/Output Options
=over
=item B<-o> F<filename>
This overrides the default output file and specifies the name of the file that
should be generated by the linker. By default, B<llvm-ld> generates a file named
F<a.out> for compatibility with B<ld>. The output will be written to
F<filename>.
=item B<-l>F<name>
This option specifies the F<name> of a library to search when resolving symbols
for the program. Only the base name should be specified as F<name>, without a
F<lib> prefix or any suffix.
=item B<-L>F<Path>
This option tells B<llvm-ld> to look in F<Path> to find any library subsequently
specified with the B<-l> option. The paths will be searched in the order in
which they are specified on the command line. If the library is still not found,
a small set of system specific directories will also be searched. Note that
libraries specified with the B<-l> option that occur I<before> any B<-L> options
will not search the paths given by the B<-L> options following it.
=item B<-link-as-library>
Link the bytecode files together as a library, not an executable. In this mode,
undefined symbols will be permitted.
=item B<-r>
An alias for -link-as-library.
=item B<-march=>C<target>
Specifies the kind of machine for which code or assembly should be generated.
=item B<-native>
Generate a native binary instead of a shell script that runs the JIT from
bytecode.
=item B<-native-cbe>
Generate a native binary with the C back end and compilation with GCC.
=item B<-disable-compression>
Do not compress bytecode files.
=back
=head2 Optimization Options
=over
=item B<-O0>
An alias for the -O1 option.
=item B<-O1>
Optimize for linking speed, not execution speed. The optimizer will attempt to
reduce the size of the linked program to reduce I/O but will not otherwise
perform any link-time optimizations.
=item B<-O2>
Perform only the minimal or required set of scalar optimizations.
=item B<-03>
An alias for the -O2 option.
=item B<-04>
Perform the standard link time inter-procedural optimizations. This will
attempt to optimize the program taking the entire program into consideration.
=item B<-O5>
Perform aggressive link time optimizations. This is the same as -O4 but works
more aggressively to optimize the program.
=item B<-disable-inlining>
Do not run the inlining pass. Functions will not be inlined into other
functions.
=item B<-disable-opt>
Completely disable optimization. The various B<-On> options will be ignored and
no link time optimization passes will be run.
=item B<-disable-internalize>
Do not mark all symbols as internal.
=item B<-verify>
Run the verification pass after each of the passes to verify intermediate
results.
=item B<-s>
Strip symbol info from the executable to make it smaller.
=item B<-export-dynamic>
An alias for -disable-internalize
=item B<-load> F<module>
Load an optimization module, F<module>, which is expected to be a dynamic
library that provides the function name C<RunOptimizations>. This function will
be passed the PassManager, and the optimization level (values 0-5 based on the
B<-On> option). This function may add passes to the PassManager that should be
run. This feature allows the optimization passes of B<llvm-ld> to be extended.
=back
=head2 Miscellaneous Options
=over
=item B<-v>
Specifies verbose mode. In this mode the linker will print additional
information about the actions it takes, programs it executes, etc.
=back
=head1 EXIT STATUS
If B<llvm-ld> succeeds, it will exit with 0 return code. If an error occurs,
it will exit with a non-zero return code.
=head1 ENVIRONMENT
The C<LLVM_LIB_SEARCH_PATH> environment variable is used to find bytecode
libraries. Any paths specified in this variable will be searched after the C<-L>
options.
=head1 SEE ALSO
L<llvm-ar|llvm-ar>
=head1 AUTHORS
Maintained by the LLVM Team (L<http://llvm.cs.uiuc.edu>).
=cut

View File

@@ -10,15 +10,15 @@ B<llvm-link> [I<options>] I<filename ...>
=head1 DESCRIPTION
The B<llvm-link> command takes several LLVM bytecode files and links them
together into a single LLVM bytecode file. It writes the output file to
standard output, unless the B<-o> option is used to specify a filename.
B<llvm-link> takes several LLVM bytecode files and links them together into a
single LLVM bytecode file. It writes the output file to standard output, unless
the B<-o> option is used to specify a filename.
The B<llvm-link> command attempts to load the input files from the current
directory. If that fails, it looks for each file in each of the directories
specified by the B<-L> options on the command line. The library search paths
are global; each one is searched for every input file if necessary. The
directories are searched in the order they were specified on the command line.
B<llvm-link> attempts to load the input files from the current directory. If
that fails, it looks for each file in each of the directories specified by the
B<-L> options on the command line. The library search paths are global; each
one is searched for every input file if necessary. The directories are searched
in the order they were specified on the command line.
=head1 OPTIONS
@@ -65,11 +65,10 @@ occurs, it will exit with a non-zero value.
=head1 SEE ALSO
L<gccld>
L<gccld|gccld>
=head1 AUTHORS
Maintained by the LLVM Team (L<http://llvm.cs.uiuc.edu>).
=cut

View File

@@ -47,8 +47,8 @@ error.
=head1 EXIT STATUS
B<llvm-prof|llvm-prof> returns 1 if it cannot load the bytecode file or the
profile information. Otherwise, it exits with zero.
B<llvm-prof> returns 1 if it cannot load the bytecode file or the profile
information. Otherwise, it exits with zero.
=head1 AUTHOR

View File

@@ -0,0 +1,52 @@
=pod
=head1 NAME
llvm-ranlib - Generate index for LLVM archive
=head1 SYNOPSIS
B<llvm-ranlib> [--version] [--help] <archive-file>
=head1 DESCRIPTION
The B<llvm-ranlib> command is similar to the common Unix utility, C<ranlib>. It
adds or updates the symbol table in an LLVM archive file. Note that using the
B<llvm-ar> modifier F<s> is usually more efficient than running B<llvm-ranlib>
which is only provided only for completness and compatibility. Unlike other
implementations of C<ranlib>, B<llvm-ranlib> indexes LLVM bytecode files, not
native object modules. You can list the contents of the symbol table with the
C<llvm-nm -s> command.
=head1 OPTIONS
=over
=item F<archive-file>
Specifies the archive-file to which the symbol table is added or updated.
=item F<--version>
Print the version of B<llvm-ranlib> and exit without building a symbol table.
=item F<--help>
Print usage help for B<llvm-ranlib> and exit without building a symbol table.
=back
=head1 EXIT STATUS
If B<llvm-ranlib> succeeds, it will exit with 0. If an error occurs, a non-zero
exit code will be returned.
=head1 SEE ALSO
L<llvm-ar|llvm-ar>, ranlib(1)
=head1 AUTHORS
Maintained by the LLVM Team (L<http://llvm.cs.uiuc.edu>).
=cut

View File

@@ -0,0 +1,406 @@
=pod
=head1 NAME
llvmc - The LLVM Compiler Driver
=head1 SYNOPSIS
B<llvmc> [I<options>] [I<filenames>...]
=head1 DESCRIPTION
The B<llvmc> command is a configurable driver for invoking other
LLVM (and non-LLVM) tools in order to compile, optimize and link software
for multiple languages. For those familiar with the GNU Compiler
Collection's B<gcc> tool, it is very similar. This tool has the
following main goals or purposes:
=over
=item * A Single point of access to the LLVM tool set.
=item * Hide the complexities of the LLVM tools through a single interface.
=item * Make integration of existing non-LLVM tools simple.
=item * Extend the capabilities of minimal front ends.
=item * Make the interface for compiling consistent for all languages.
=back
The tool itself does nothing with a user's program. It merely invokes other
tools to get the compilation tasks done.
The options supported by B<llvmc> generalize the compilation process and
provide a consistent and simple interface for multiple programming languages.
This makes it easier for developers to get their software compiled with LLVM.
Without B<llvmc>, developers would need to understand how to invoke the
front-end compiler, optimizer, assembler, and linker in order to compile their
programs. B<llvmc>'s sole mission is to trivialize that process.
=head2 Basic Operation
B<llvmc> always takes the following basic actions:
=over
=item * Command line options and filenames are collected.
The command line options provide the marching orders to B<llvmc> on what actions
it should perform. This is the I<request> the user is making of B<llvmc> and it
is interpreted first.
=item * Configuration files are read.
Based on the options and the suffixes of the filenames presented, a set of
configuration files are read to configure the actions B<llvmc> will take.
Configuration files are provided by either LLVM or the front end compiler tools
that B<llvmc> invokes. Users generally don't need to be concerned with the
contents of the configuration files.
=item * Determine actions to take.
The tool chain needed to complete the task is determined. This is the primary
work of B<llvmc>. It breaks the request specified by the command line options
into a set of basic actions to be done:
=over
=item * Pre-processing: gathering/filtering compiler input (optional).
=item * Translation: source language to bytecode conversion.
=item * Assembly: bytecode to native code conversion.
=item * Optimization: conversion of bytecode to something that runs faster.
=item * Linking: combining multiple bytecodes to produce executable program.
=back
=item * Execute actions.
The actions determined previously are executed sequentially and then
B<llvmc> terminates.
=back
=head1 OPTIONS
=head2 Control Options
Control options tell B<llvmc> what to do at a high level. The
following control options are defined:
=over
=item B<-c> or B<--compile>
This option specifies that the linking phase is not to be run. All
previous phases, if applicable will run. This is generally how a given
bytecode file is compiled and optimized for a source language module.
=item B<-k> or B<--link> or default
This option (or the lack of any control option) specifies that all stages
of compilation, optimization, and linking should be attempted. Source files
specified on the command line will be compiled and linked with objects and
libraries also specified.
=item B<-S>
This option specifies that compilation should end in the creation of
an LLVM assembly file that can be later converted to an LLVM object
file.
=item B<-E>
This option specifies that no compilation or linking should be
performed. Only pre-processing, if applicable to the language being
compiled, is performed. For languages that support it, this will
result in the output containing the raw input to the compiler.
=back
=head2 Optimization Options
Optimization with B<llvmc> is based on goals and specified with
the following -O options. The specific details of which
optimizations run is controlled by the configuration files because
each source language will have different needs.
=over
=item B<-O1> or B<-O0> (default, fast compilation)
Only those optimizations that will hasten the compilation (mostly by reducing
the output) are applied. In general these are extremely fast and simple
optimizations that reduce emitted code size. The goal here is not to make the
resulting program fast but to make the compilation fast. If not specified,
this is the default level of optimization.
=item B<-O2> (basic optimization)
This level of optimization specifies a balance between generating good code
that will execute reasonably quickly and not spending too much time optimizing
the code to get there. For example, this level of optimization may include
things like global common subexpression elimination, aggressive dead code
elimination, and scalar replication.
=item B<-O3> (aggressive optimization)
This level of optimization aggressively optimizes each set of files compiled
together. However, no link-time inter-procedural optimization is performed.
This level implies all the optimizations of the B<-O1> and B<-O2> optimization
levels, and should also provide loop optimizations and compile time
inter-procedural optimizations. Essentially, this level tries to do as much
as it can with the input it is given but doesn't do any link time IPO.
=item B<-O4> (link time optimization)
In addition to the previous three levels of optimization, this level of
optimization aggressively optimizes each program at link time. It employs
basic analysis and basic link-time inter-procedural optimizations,
considering the program as a whole.
=item B<-O5> (aggressive link time optimization)
This is the same as B<-O4> except it employs aggressive analyses and
aggressive inter-procedural optimization.
=item B<-O6> (profile guided optimization: not implemented)
This is the same as B<-O5> except that it employs profile-guided
re-optimization of the program after it has executed. Note that this implies
a single level of re-optimization based on runtime profile analysis. Once
the re-optimization has completed, the profiling instrumentation is
removed and final optimizations are employed.
=item B<-O7> (lifelong optimization: not implemented)
This is the same as B<-O5> and similar to B<-O6> except that re-optimization
is performed through the life of the program. That is, each run will update
the profile by which future re-optimizations are directed.
=back
=head2 Input Options
=over
=item B<-l> I<LIBRARY>
This option instructs B<llvmc> to locate a library named I<LIBRARY> and search
it for unresolved symbols when linking the program.
=item B<-L> F<path>
This option instructs B<llvmc> to add F<path> to the list of places in which
the linker will
=item B<-x> I<LANGUAGE>
This option instructs B<llvmc> to regard the following input files as
containing programs in the language I<LANGUAGE>. Normally, input file languages
are identified by their suffix but this option will override that default
behavior. The B<-x> option stays in effect until the end of the options or
a new B<-x> option is encountered.
=back
=head2 Output Options
=over
=item B<-m>I<arch>
This option selects the back end code generator to use. The I<arch> portion
of the option names the back end to use.
=item B<--native>
Normally, B<llvmc> produces bytecode files at most stages of compilation.
With this option, B<llvmc> will arrange for native object files to be
generated with the B<-c> option, native assembly files to be generated
with the B<-S> option, and native executables to be generated with the
B<--link> option. In the case of the B<-E> option, the output will not
differ as there is no I<native> version of pre-processed output.
=item B<-o> F<filename>
Specify the output file name. The contents of the file depend on other
options.
=back
=head2 Information Options
=over
=item B<-n> or B<--no-op>
This option tells B<llvmc> to do everything but actually execute the
resulting tools. In combination with the B<-v> option, this causes B<llvmc>
to merely print out what it would have done.
=item B<-v> or B<--verbose>
This option will cause B<llvmc> to print out (on standard output) each of the
actions it takes to accomplish the objective. The output will immediately
precede the invocation of other tools.
=item B<--stats>
Print all statistics gathered during the compilation to the standard error.
Note that this option is merely passed through to the sub-tools to do with
as they please.
=item B<--time-passes>
Record the amount of time needed for each optimization pass and print it
to standard error. Like B<--stats> this option is just passed through to
the sub-tools to do with as they please.
=item B<--time-programs>
Record the amount of time each program (compilation tool) takes and print
it to the standard error.
=back
=head2 Language Specific Options
=over
=item B<-T,pre>=I<options>
Pass an arbitrary option to the pre-processor.
=item B<-T,opt>=I<options>
Pass an arbitrary option to the optimizer.
=item B<-T,lnk>=I<options>
Pass an arbitrary option to the linker.
=item B<-T,asm>=I<options>
Pass an arbitrary option to the code generator.
=back
=head2 C/C++ Specific Options
=over
=item B<-I>F<path>
This option is just passed through to a C or C++ front end compiler to tell it
where include files can be found.
=item B<-D>F<symbol>
This option is just passed through to a C or C++ front end compiler to tell it
to define a symbol.
=back
=head2 Miscellaneous Options
=over
=item B<--help>
Print a summary of command line options.
=item B<--version>
This option will cause B<llvmc> to print out its version number and terminate.
=back
=head2 Advanced Options
You better know what you're doing if you use these options. Improper use
of these options can produce drastically wrong results.
=over
=item B<--config-dir> F<dirname>
This option tells B<llvmc> to read configuration data from the I<directory>
named F<dirname>. Data from such directories will be read in the order
specified on the command line after all other standard configuration files have
been read. This allows users or groups of users to conveniently create
their own configuration directories in addition to the standard ones to which
they may not have write access.
=head2 Unimplemented Options
The options below are not currently implemented in B<llvmc> but will be
eventually. They are documented here as "future design".
=over
=item B<--show-config> I<[suffixes...]>
When this option is given, the only action taken by B<llvmc> is to show its
final configuration state in the form of a configuration file. No compilation
tasks will be conducted when this option is given; processing will stop once
the configuration has been printed. The optional (comma separated) list of
suffixes controls what is printed. Without any suffixes, the configuration
for all languages is printed. With suffixes, only the languages pertaining
to those file suffixes will be printed. The configuration information is
printed after all command line options and configuration files have been
read and processed. This allows the user to verify that the correct
configuration data has been read by B<llvmc>.
=item B<--config> :I<section>:I<name>=I<value>
This option instructs B<llvmc> to accept I<value> as the value for configuration
item I<name> in the section named I<section>. This is a quick way to override
a configuration item on the command line without resorting to changing the
configuration files.
=item B<--config-only-from> F<dirname>
This option tells B<llvmc> to skip the normal processing of configuration
files and only configure from the contents of the F<dirname> directory. Multiple
B<--config-only-from> options may be given in which case the directories are
read in the order given on the command line.
=item B<--emit-raw-code>
No optimization is done whatsoever. The compilers invoked by B<llvmc> with
this option given will be instructed to produce raw, unoptimized code. This
option is useful only to front end language developers and therefore does not
participate in the list of B<-O> options. This is distinctly different from
the B<-O0> option (a synonym for B<-O1>) because those optimizations will
reduce code size to make compilation faster. With B<--emit-raw-code>, only
the full raw code produced by the compiler will be generated.
=back
=head1 EXIT STATUS
If B<llvmc> succeeds, it will exit with 0. Otherwise, if an error
occurs, it will exit with a non-zero value and no compilation actions
will be taken. If one of the compilation tools returns a non-zero
status, pending actions will be discarded and B<llvmc> will return the
same result code as the failing compilation tool.
=head1 SEE ALSO
L<gccas|gccas>, L<gccld|gccld>, L<llvm-as|llvm-as>, L<llvm-dis|llvm-dis>,
L<llc|llc>, L<llvm-link|llvm-link>
=head1 AUTHORS
Maintained by the LLVM Team (L<http://llvm.cs.uiuc.edu>).
=cut

View File

@@ -2,26 +2,26 @@
=head1 NAME
llvmgcc - LLVM C front-end
llvm-gcc - LLVM C front-end
=head1 SYNOPSIS
B<llvmgcc> [I<options>] I<filename>
B<llvm-gcc> [I<options>] I<filename>
=head1 DESCRIPTION
The B<llvmgcc> command is the LLVM C front end. It is a modified
The B<llvm-gcc> command is the LLVM C front end. It is a modified
version of gcc that takes C programs and compiles them into LLVM
bytecode or assembly language, depending upon the options.
Unless the B<-S> option is specified, B<llvmgcc> will use the
Unless the B<-S> option is specified, B<llvm-gcc> will use the
L<gccas|gccas> program to perform some optimizations and create an
LLVM bytecode file. Unless the B<-c> option is specified, B<llvmgcc>
LLVM bytecode file. Unless the B<-c> option is specified, B<llvm-gcc>
will also use the L<gccld|gccld> program to perform further
optimizations and link the resulting bytecode file(s) with support
libraries to create an executable program.
Being derived from the GNU Compiler Collection, B<llvmgcc> has many
Being derived from the GNU Compiler Collection, B<llvm-gcc> has many
of gcc's features and accepts most of gcc's options. It handles a
number of gcc's extensions to the C programming language.
@@ -64,20 +64,28 @@ repeated.
Link in the library libI<name>.[bc | a | so]. This library should
be a bytecode library.
=item B<-Wa,>I<option>
Pass I<option> to gccas
=item B<-Wl,>I<option>
Pass I<option> to the linker (usually gccld).
Pass I<option> to gccld
=item B<-Wa,-disable-inlining -Wl,-disable-inlining>
Fully disable all inlining
=back
=head1 EXIT STATUS
If B<llvmgcc> succeeds, it will exit with 0. Otherwise, if an error
If B<llvm-gcc> succeeds, it will exit with 0. Otherwise, if an error
occurs, it will exit with a non-zero value.
=head1 SEE ALSO
L<llvmg++|llvmgxx>, L<gccas|gccas>, L<gccld|gccld>
L<llvm-g++|llvmgxx>, L<gccas|gccas>, L<gccld|gccld>
=head1 AUTHORS

View File

@@ -2,26 +2,26 @@
=head1 NAME
llvmg++ - LLVM C++ front-end
llvm-g++ - LLVM C++ front-end
=head1 SYNOPSIS
B<llvmg++> [I<options>] I<filename>
B<llvm-g++> [I<options>] I<filename>
=head1 DESCRIPTION
The B<llvmg++> command is the LLVM C++ front end. It is a modified
The B<llvm-g++> command is the LLVM C++ front end. It is a modified
version of g++ that takes C++ programs and compiles them into LLVM
bytecode or assembly language, depending upon the options.
Unless the B<-S> option is specified, B<llvmg++> will use the
Unless the B<-S> option is specified, B<llvm-g++> will use the
L<gccas|gccas> program to perform some optimizations and create an
LLVM bytecode file. Unless the B<-c> option is specified, B<llvmg++>
LLVM bytecode file. Unless the B<-c> option is specified, B<llvm-g++>
will also use the L<gccld|gccld> program to perform further
optimizations and link the resulting bytecode file(s) with support
libraries to create an executable program.
Being derived from the GNU Compiler Collection, B<llvmg++> has many
Being derived from the GNU Compiler Collection, B<llvm-g++> has many
of g++'s features and accepts most of g++'s options. It handles a
number of g++'s extensions to the C++ programming language.
@@ -64,20 +64,28 @@ repeated.
Link in the library libI<name>.[bc | a | so]. This library should
be a bytecode library.
=item B<-Wa,>I<option>
Pass I<option> to gccas
=item B<-Wl,>I<option>
Pass I<option> to the linker (usually gccld).
Pass I<option> to gccld
=item B<-Wa,-disable-inlining -Wl,-disable-inlining>
Fully disable all inlining
=back
=head1 EXIT STATUS
If B<llvmg++> succeeds, it will exit with 0. Otherwise, if an error
If B<llvm-g++> succeeds, it will exit with 0. Otherwise, if an error
occurs, it will exit with a non-zero value.
=head1 SEE ALSO
L<llvmgcc>, L<gccas>, L<gccld>
L<llvm-gcc|llvmgcc>, L<gccas>, L<gccld>
=head1 AUTHORS

View File

@@ -0,0 +1 @@
.dir

View File

@@ -1 +1,2 @@
*.1
.dir

View File

@@ -1 +1,2 @@
*ps
.dir

View File

@@ -2,6 +2,7 @@
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>CommandLine 2.0 Library Manual</title>
<link rel="stylesheet" href="llvm.css" type="text/css">
</head>
@@ -30,6 +31,8 @@
<li><a href="#positional">Positional Arguments</a>
<ul>
<li><a href="#--">Specifying positional options with hyphens</a></li>
<li><a href="#getPosition">Determining absolute position with
getPosition</a></li>
<li><a href="#cl::ConsumeAfter">The <tt>cl::ConsumeAfter</tt>
modifier</a></li>
</ul></li>
@@ -59,6 +62,7 @@
<li><a href="#cl::opt">The <tt>cl::opt</tt> class</a></li>
<li><a href="#cl::list">The <tt>cl::list</tt> class</a></li>
<li><a href="#cl::alias">The <tt>cl::alias</tt> class</a></li>
<li><a href="#cl::extrahelp">The <tt>cl::extrahelp</tt> class</a></li>
</ul></li>
<li><a href="#builtinparsers">Builtin parsers</a>
@@ -188,19 +192,19 @@ can do.</p>
<p>To start out, you need to include the CommandLine header file into your
program:</p>
<pre>
<div class="doc_code"><pre>
#include "Support/CommandLine.h"
</pre>
</pre></div>
<p>Additionally, you need to add this as the first line of your main
program:</p>
<pre>
<div class="doc_code"><pre>
int main(int argc, char **argv) {
<a href="#cl::ParseCommandLineOptions">cl::ParseCommandLineOptions</a>(argc, argv);
...
}
</pre>
</pre></div>
<p>... which actually parses the arguments and fills in the variable
declarations.</p>
@@ -216,9 +220,9 @@ to specify where to put the output. With the CommandLine library, this is
represented like this:</p>
<a name="value_desc_example"></a>
<pre>
<div class="doc_code"><pre>
<a href="#cl::opt">cl::opt</a>&lt;string&gt; OutputFilename("<i>o</i>", <a href="#cl::desc">cl::desc</a>("<i>Specify output filename</i>"), <a href="#cl::value_desc">cl::value_desc</a>("<i>filename</i>"));
</pre>
</pre></div>
<p>This declares a global variable "<tt>OutputFilename</tt>" that is used to
capture the result of the "<tt>o</tt>" argument (first parameter). We specify
@@ -231,25 +235,25 @@ that the data type that we are parsing is a string.</p>
to output for the "<tt>--help</tt>" option. In this case, we get a line that
looks like this:</p>
<pre>
<div class="doc_code"><pre>
USAGE: compiler [options]
OPTIONS:
-help - display available options (--help-hidden for more)
<b>-o &lt;filename&gt; - Specify output filename</b>
</pre>
</pre></div>
<p>Because we specified that the command line option should parse using the
<tt>string</tt> data type, the variable declared is automatically usable as a
real string in all contexts that a normal C++ string object may be used. For
example:</p>
<pre>
<div class="doc_code"><pre>
...
ofstream Output(OutputFilename.c_str());
if (Out.good()) ...
...
</pre>
</pre></div>
<p>There are many different options that you can use to customize the command
line option handling library, but the above example shows the general interface
@@ -266,9 +270,9 @@ href="#positional">positional</a> arguments to be specified for the program.
These positional arguments are filled with command line parameters that are not
in option form. We use this feature like this:</p>
<pre>
<div class="doc_code"><pre>
<a href="#cl::opt">cl::opt</a>&lt;string&gt; InputFilename(<a href="#cl::Positional">cl::Positional</a>, <a href="#cl::desc">cl::desc</a>("<i>&lt;input file&gt;</i>"), <a href="#cl::init">cl::init</a>("<i>-</i>"));
</pre>
</pre></div>
<p>This declaration indicates that the first positional argument should be
treated as the input filename. Here we use the <tt><a
@@ -281,16 +285,16 @@ that the user always specify an input filename, we would add the <tt><a
href="#cl::Required">cl::Required</a></tt> flag, and we could eliminate the
<tt><a href="#cl::init">cl::init</a></tt> modifier, like this:</p>
<pre>
<div class="doc_code"><pre>
<a href="#cl::opt">cl::opt</a>&lt;string&gt; InputFilename(<a href="#cl::Positional">cl::Positional</a>, <a href="#cl::desc">cl::desc</a>("<i>&lt;input file&gt;</i>"), <b><a href="#cl::Required">cl::Required</a></b>);
</pre>
</pre></div>
<p>Again, the CommandLine library does not require the options to be specified
in any particular order, so the above declaration is equivalent to:</p>
<pre>
<div class="doc_code"><pre>
<a href="#cl::opt">cl::opt</a>&lt;string&gt; InputFilename(<a href="#cl::Positional">cl::Positional</a>, <a href="#cl::Required">cl::Required</a>, <a href="#cl::desc">cl::desc</a>("<i>&lt;input file&gt;</i>"));
</pre>
</pre></div>
<p>By simply adding the <tt><a href="#cl::Required">cl::Required</a></tt> flag,
the CommandLine library will automatically issue an error if the argument is not
@@ -300,13 +304,13 @@ can alter the default behaviour of the library, on a per-option basis. By
adding one of the declarations above, the <tt>--help</tt> option synopsis is now
extended to:</p>
<pre>
<div class="doc_code"><pre>
USAGE: compiler [options] <b>&lt;input file&gt;</b>
OPTIONS:
-help - display available options (--help-hidden for more)
-o &lt;filename&gt; - Specify output filename
</pre>
</pre></div>
<p>... indicating that an input filename is expected.</p>
@@ -325,11 +329,11 @@ file, "<tt>--quiet</tt>" to enable quiet mode, and "<tt>-q</tt>" for backwards
compatibility with some of our users. We can support these by declaring options
of boolean type like this:</p>
<pre>
<div class="doc_code"><pre>
<a href="#cl::opt">cl::opt</a>&lt;bool&gt; Force ("<i>f</i>", <a href="#cl::desc">cl::desc</a>("<i>Overwrite output files</i>"));
<a href="#cl::opt">cl::opt</a>&lt;bool&gt; Quiet ("<i>quiet</i>", <a href="#cl::desc">cl::desc</a>("<i>Don't print informational messages</i>"));
<a href="#cl::opt">cl::opt</a>&lt;bool&gt; Quiet2("<i>q</i>", <a href="#cl::desc">cl::desc</a>("<i>Don't print informational messages</i>"), <a href="#cl::Hidden">cl::Hidden</a>);
</pre>
</pre></div>
<p>This does what you would expect: it declares three boolean variables
("<tt>Force</tt>", "<tt>Quiet</tt>", and "<tt>Quiet2</tt>") to recognize these
@@ -347,12 +351,12 @@ it assigns the value of true to the variable), or it allows the values
"<tt>true</tt>" or "<tt>false</tt>" to be specified, allowing any of the
following inputs:</p>
<pre>
<div class="doc_code"><pre>
compiler -f # No value, 'Force' == true
compiler -f=true # Value specified, 'Force' == true
compiler -f=TRUE # Value specified, 'Force' == true
compiler -f=FALSE # Value specified, 'Force' == false
</pre>
</pre></div>
<p>... you get the idea. The <a href="#boolparser">bool parser</a> just turns
the string values into boolean values, and rejects things like '<tt>compiler
@@ -363,7 +367,7 @@ library calls to parse the string value into the specified data type.</p>
<p>With the declarations above, "<tt>compiler --help</tt>" emits this:</p>
<pre>
<div class="doc_code"><pre>
USAGE: compiler [options] &lt;input file&gt;
OPTIONS:
@@ -371,11 +375,11 @@ OPTIONS:
-o - Override output filename
<b>-quiet - Don't print informational messages</b>
-help - display available options (--help-hidden for more)
</pre>
</pre></div>
<p>and "<tt>opt --help-hidden</tt>" prints this:</p>
<pre>
<div class="doc_code"><pre>
USAGE: compiler [options] &lt;input file&gt;
OPTIONS:
@@ -384,7 +388,7 @@ OPTIONS:
<b>-q - Don't print informational messages</b>
-quiet - Don't print informational messages
-help - display available options (--help-hidden for more)
</pre>
</pre></div>
<p>This brief example has shown you how to use the '<tt><a
href="#cl::opt">cl::opt</a></tt>' class to parse simple scalar command line
@@ -404,22 +408,22 @@ and <a href="#list">lists</a> of options.</p>
<p>So far, the example works well, except for the fact that we need to check the
quiet condition like this now:</p>
<pre>
<div class="doc_code"><pre>
...
if (!Quiet &amp;&amp; !Quiet2) printInformationalMessage(...);
...
</pre>
</pre></div>
<p>... which is a real pain! Instead of defining two values for the same
condition, we can use the "<tt><a href="#cl::alias">cl::alias</a></tt>" class to make the "<tt>-q</tt>"
option an <b>alias</b> for the "<tt>-quiet</tt>" option, instead of providing
a value itself:</p>
<pre>
<div class="doc_code"><pre>
<a href="#cl::opt">cl::opt</a>&lt;bool&gt; Force ("<i>f</i>", <a href="#cl::desc">cl::desc</a>("<i>Overwrite output files</i>"));
<a href="#cl::opt">cl::opt</a>&lt;bool&gt; Quiet ("<i>quiet</i>", <a href="#cl::desc">cl::desc</a>("<i>Don't print informational messages</i>"));
<a href="#cl::alias">cl::alias</a> QuietA("<i>q</i>", <a href="#cl::desc">cl::desc</a>("<i>Alias for -quiet</i>"), <a href="#cl::aliasopt">cl::aliasopt</a>(Quiet));
</pre>
</pre></div>
<p>The third line (which is the only one we modified from above) defines a
"<tt>-q</tt> alias that updates the "<tt>Quiet</tt>" variable (as specified by
@@ -432,11 +436,11 @@ output</tt>).</p>
<p>Now the application code can simply use:</p>
<pre>
<div class="doc_code"><pre>
...
if (!Quiet) printInformationalMessage(...);
...
</pre>
</pre></div>
<p>... which is much nicer! The "<tt><a href="#cl::alias">cl::alias</a></tt>"
can be used to specify an alternative name for any variable type, and has many
@@ -458,10 +462,10 @@ things it doesn't know about, like enums or '<tt>int*</tt>'s?</p>
<p>The answer is that it uses a table driven generic parser (unless you specify
your own parser, as described in the <a href="#extensionguide">Extension
Guide</a>). This parser maps literal strings to whatever type is required, are
Guide</a>). This parser maps literal strings to whatever type is required, and
requires you to tell it what this mapping should be.</p>
<p>Lets say that we would like to add four optimizations levels to our
<p>Lets say that we would like to add four optimization levels to our
optimizer, using the standard flags "<tt>-g</tt>", "<tt>-O0</tt>",
"<tt>-O1</tt>", and "<tt>-O2</tt>". We could easily implement this with boolean
options like above, but there are several problems with this strategy:</p>
@@ -482,7 +486,7 @@ see if some level &gt;= "<tt>-O1</tt>" is enabled.</li>
CommandLine library fill it in with the appropriate level directly, which is
used like this:</p>
<pre>
<div class="doc_code"><pre>
enum OptLevel {
g, O1, O2, O3
};
@@ -498,7 +502,7 @@ enum OptLevel {
...
if (OptimizationLevel &gt;= O2) doPartialRedundancyElimination(...);
...
</pre>
</pre></div>
<p>This declaration defines a variable "<tt>OptimizationLevel</tt>" of the
"<tt>OptLevel</tt>" enum type. This variable can be assigned any of the values
@@ -510,7 +514,7 @@ enum values can be specified. The "<tt>clEnumVal</tt>" macros ensure that the
command line arguments matched the enum values. With this option added, our
help output now is:</p>
<pre>
<div class="doc_code"><pre>
USAGE: compiler [options] &lt;input file&gt;
OPTIONS:
@@ -523,14 +527,14 @@ OPTIONS:
-help - display available options (--help-hidden for more)
-o &lt;filename&gt; - Specify output filename
-quiet - Don't print informational messages
</pre>
</pre></div>
<p>In this case, it is sort of awkward that flag names correspond directly to
enum names, because we probably don't want a enum definition named "<tt>g</tt>"
in our program. Because of this, we can alternatively write this example like
this:</p>
<pre>
<div class="doc_code"><pre>
enum OptLevel {
Debug, O1, O2, O3
};
@@ -546,7 +550,7 @@ enum OptLevel {
...
if (OptimizationLevel == Debug) outputDebugInfo(...);
...
</pre>
</pre></div>
<p>By using the "<tt>clEnumValN</tt>" macro instead of "<tt>clEnumVal</tt>", we
can directly specify the name that the flag should get. In general a direct
@@ -571,7 +575,7 @@ following options, of which only one can be specified at a time:
our optimization level flags, but we also specify an option name. For this
case, the code looks like this:</p>
<pre>
<div class="doc_code"><pre>
enum DebugLev {
nodebuginfo, quick, detailed
};
@@ -583,14 +587,14 @@ enum DebugLev {
clEnumVal(quick, "<i>enable quick debug information</i>"),
clEnumVal(detailed, "<i>enable detailed debug information</i>"),
clEnumValEnd));
</pre>
</pre></div>
<p>This definition defines an enumerated command line variable of type "<tt>enum
DebugLev</tt>", which works exactly the same way as before. The difference here
is just the interface exposed to the user of your program and the help output by
the "<tt>--help</tt>" option:</p>
<pre>
<div class="doc_code"><pre>
USAGE: compiler [options] &lt;input file&gt;
OPTIONS:
@@ -607,10 +611,10 @@ OPTIONS:
-help - display available options (--help-hidden for more)
-o &lt;filename&gt; - Specify output filename
-quiet - Don't print informational messages
</pre>
</pre></div>
<p>Again, the only structural difference between the debug level declaration and
the optimiation level declaration is that the debug level declaration includes
the optimization level declaration is that the debug level declaration includes
an option name (<tt>"debug_level"</tt>), which automatically changes how the
library processes the argument. The CommandLine library supports both forms so
that you can choose the form most appropriate for your application.</p>
@@ -633,16 +637,16 @@ important. This is what the "<tt><a href="#cl::list">cl::list</a></tt>"
template is for. First, start by defining an enum of the optimizations that you
would like to perform:</p>
<pre>
<div class="doc_code"><pre>
enum Opts {
// 'inline' is a C++ keyword, so name it 'inlining'
dce, constprop, inlining, strip
};
</pre>
</pre></div>
<p>Then define your "<tt><a href="#cl::list">cl::list</a></tt>" variable:</p>
<pre>
<div class="doc_code"><pre>
<a href="#cl::list">cl::list</a>&lt;Opts&gt; OptimizationList(<a href="#cl::desc">cl::desc</a>("<i>Available Optimizations:</i>"),
<a href="#cl::values">cl::values</a>(
clEnumVal(dce , "<i>Dead Code Elimination</i>"),
@@ -650,17 +654,17 @@ enum Opts {
clEnumValN(inlining, "<i>inline</i>", "<i>Procedure Integration</i>"),
clEnumVal(strip , "<i>Strip Symbols</i>"),
clEnumValEnd));
</pre>
</pre></div>
<p>This defines a variable that is conceptually of the type
"<tt>std::vector&lt;enum Opts&gt;</tt>". Thus, you can access it with standard
vector methods:</p>
<pre>
<div class="doc_code"><pre>
for (unsigned i = 0; i != OptimizationList.size(); ++i)
switch (OptimizationList[i])
...
</pre>
</pre></div>
<p>... to iterate through the list of options specified.</p>
@@ -672,11 +676,11 @@ arguments together if there may be more than one specified. In the case of a
linker, for example, the linker takes several '<tt>.o</tt>' files, and needs to
capture them into a list. This is naturally specified as:</p>
<pre>
<div class="doc_code"><pre>
...
<a href="#cl::list">cl::list</a>&lt;std::string&gt; InputFilenames(<a href="#cl::Positional">cl::Positional</a>, <a href="#cl::desc">cl::desc</a>("&lt;Input files&gt;"), <a href="#cl::OneOrMore">cl::OneOrMore</a>);
...
</pre>
</pre></div>
<p>This variable works just like a "<tt>vector&lt;string&gt;</tt>" object. As
such, accessing the list is simple, just like above. In this example, we used
@@ -705,17 +709,17 @@ call in main. This additional argument is then printed as the overview
information for your program, allowing you to include any additional information
that you want. For example:</p>
<pre>
<div class="doc_code"><pre>
int main(int argc, char **argv) {
<a href="#cl::ParseCommandLineOptions">cl::ParseCommandLineOptions</a>(argc, argv, " CommandLine compiler example\n\n"
" This program blah blah blah...\n");
...
}
</pre>
</pre></div>
<p>Would yield the help output:</p>
<p>would yield the help output:</p>
<pre>
<div class="doc_code"><pre>
<b>OVERVIEW: CommandLine compiler example
This program blah blah blah...</b>
@@ -726,7 +730,7 @@ OPTIONS:
...
-help - display available options (--help-hidden for more)
-o &lt;filename&gt; - Specify output filename
</pre>
</pre></div>
</div>
@@ -760,27 +764,27 @@ tool takes a regular expression argument, and an optional filename to search
through (which defaults to standard input if a filename is not specified).
Using the CommandLine library, this would be specified as:</p>
<pre>
<div class="doc_code"><pre>
<a href="#cl::opt">cl::opt</a>&lt;string&gt; Regex (<a href="#cl::Positional">cl::Positional</a>, <a href="#cl::desc">cl::desc</a>("<i>&lt;regular expression&gt;</i>"), <a href="#cl::Required">cl::Required</a>);
<a href="#cl::opt">cl::opt</a>&lt;string&gt; Filename(<a href="#cl::Positional">cl::Positional</a>, <a href="#cl::desc">cl::desc</a>("<i>&lt;input file&gt;</i>"), <a href="#cl::init">cl::init</a>("<i>-</i>"));
</pre>
</pre></div>
<p>Given these two option declarations, the <tt>--help</tt> output for our grep
replacement would look like this:</p>
<pre>
<div class="doc_code"><pre>
USAGE: spiffygrep [options] <b>&lt;regular expression&gt; &lt;input file&gt;</b>
OPTIONS:
-help - display available options (--help-hidden for more)
</pre>
</pre></div>
<p>... and the resultant program could be used just like the standard
<tt>grep</tt> tool.</p>
<p>Positional arguments are sorted by their order of construction. This means
that command line options will be ordered according to how they are listed in a
.cpp file, but will not have an ordering defined if they positional arguments
.cpp file, but will not have an ordering defined if the positional arguments
are defined in multiple .cpp files. The fix for this problem is simply to
define all of your positional arguments in one .cpp file.</p>
@@ -800,7 +804,7 @@ first, you will have trouble doing this, because it will try to find an argument
named '<tt>-foo</tt>', and will fail (and single quotes will not save you).
Note that the system <tt>grep</tt> has the same problem:</p>
<pre>
<div class="doc_code"><pre>
$ spiffygrep '-foo' test.txt
Unknown command line argument '-foo'. Try: spiffygrep --help'
@@ -809,7 +813,7 @@ Note that the system <tt>grep</tt> has the same problem:</p>
grep: illegal option -- o
grep: illegal option -- o
Usage: grep -hblcnsviw pattern file . . .
</pre>
</pre></div>
<p>The solution for this problem is the same for both your tool and the system
version: use the '<tt>--</tt>' marker. When the user specifies '<tt>--</tt>' on
@@ -817,13 +821,72 @@ the command line, it is telling the program that all options after the
'<tt>--</tt>' should be treated as positional arguments, not options. Thus, we
can use it like this:</p>
<pre>
<div class="doc_code"><pre>
$ spiffygrep -- -foo test.txt
...output...
</pre>
</pre></div>
</div>
<!-- _______________________________________________________________________ -->
<div class="doc_subsubsection">
<a name="getPosition">Determining absolute position with getPosition()</a>
</div>
<div class="doc_text">
<p>Sometimes an option can affect or modify the meaning of another option. For
example, consider <tt>gcc</tt>'s <tt>-x LANG</tt> option. This tells
<tt>gcc</tt> to ignore the suffix of subsequent positional arguments and force
the file to be interpreted as if it contained source code in language
<tt>LANG</tt>. In order to handle this properly , you need to know the
absolute position of each argument, especially those in lists, so their
interaction(s) can be applied correctly. This is also useful for options like
<tt>-llibname</tt> which is actually a positional argument that starts with
a dash.</p>
<p>So, generally, the problem is that you have two <tt>cl::list</tt> variables
that interact in some way. To ensure the correct interaction, you can use the
<tt>cl::list::getPosition(optnum)</tt> method. This method returns the
absolute position (as found on the command line) of the <tt>optnum</tt>
item in the <tt>cl::list</tt>.</p>
<p>The idiom for usage is like this:</p>
<div class="doc_code"><pre>
static cl::list&lt;std::string&gt; Files(cl::Positional, cl::OneOrMore);
static cl::listlt;std::string&gt; Libraries("l", cl::ZeroOrMore);
int main(int argc, char**argv) {
// ...
std::vector&lt;std::string&gt;::iterator fileIt = Files.begin();
std::vector&lt;std::string&gt;::iterator libIt = Libraries.begin();
unsigned libPos = 0, filePos = 0;
while ( 1 ) {
if ( libIt != Libraries.end() )
libPos = Libraries.getPosition( libIt - Libraries.begin() );
else
libPos = 0;
if ( fileIt != Files.end() )
filePos = Files.getPosition( fileIt - Files.begin() );
else
filePos = 0;
if ( filePos != 0 &amp;&amp; (libPos == 0 || filePos &lt; libPos) ) {
// Source File Is next
++fileIt;
}
else if ( libPos != 0 &amp;&amp; (filePos == 0 || libPos &lt; filePos) ) {
// Library is next
++libIt;
}
else
break; // we're done with the list
}
}</pre></div>
<p>Note that, for compatibility reasons, the <tt>cl::opt</tt> also supports an
<tt>unsigned getPosition()</tt> option that will provide the absolute position
of that option. You can apply the same approach as above with a
<tt>cl::opt</tt> and a <tt>cl::list</tt> option as you can with two lists.</p>
</div>
<!-- _______________________________________________________________________ -->
<div class="doc_subsubsection">
<a name="cl::ConsumeAfter">The <tt>cl::ConsumeAfter</tt> modifier</a>
@@ -845,23 +908,23 @@ arguments to the script. These arguments to the script are parsed by the bourne
shell command line option processor, but are not interpreted as options to the
shell itself. Using the CommandLine library, we would specify this as:</p>
<pre>
<div class="doc_code"><pre>
<a href="#cl::opt">cl::opt</a>&lt;string&gt; Script(<a href="#cl::Positional">cl::Positional</a>, <a href="#cl::desc">cl::desc</a>("<i>&lt;input script&gt;</i>"), <a href="#cl::init">cl::init</a>("-"));
<a href="#cl::list">cl::list</a>&lt;string&gt; Argv(<a href="#cl::ConsumeAfter">cl::ConsumeAfter</a>, <a href="#cl::desc">cl::desc</a>("<i>&lt;program arguments&gt;...</i>"));
<a href="#cl::opt">cl::opt</a>&lt;bool&gt; Trace("<i>x</i>", <a href="#cl::desc">cl::desc</a>("<i>Enable trace output</i>"));
</pre>
</pre></div>
<p>which automatically provides the help output:</p>
<pre>
<div class="doc_code"><pre>
USAGE: spiffysh [options] <b>&lt;input script&gt; &lt;program arguments&gt;...</b>
OPTIONS:
-help - display available options (--help-hidden for more)
<b>-x - Enable trace output</b>
</pre>
</pre></div>
<p>At runtime, if we run our new shell replacement as '<tt>spiffysh -x test.sh
<p>At runtime, if we run our new shell replacement as `<tt>spiffysh -x test.sh
-a -x -y bar</tt>', the <tt>Trace</tt> variable will be set to true, the
<tt>Script</tt> variable will be set to "<tt>test.sh</tt>", and the
<tt>Argv</tt> list will contain <tt>["-a", "-x", "-y", "bar"]</tt>, because they
@@ -900,6 +963,7 @@ all of these clients (requiring lots of .cpp files to #include
<p>To do this, set up your .h file with your option, like this for example:</p>
<div class="doc_code">
<pre>
<i>// DebugFlag.h - Get access to the '-debug' command line option
//
@@ -915,15 +979,15 @@ extern bool DebugFlag;
// debug build, then the code specified as the option to the macro will be
// executed. Otherwise it will not be. Example:
//
// DEBUG(cerr << "Bitset contains: " << Bitset << "\n");
// DEBUG(std::cerr &lt;&lt; "Bitset contains: " &lt;&lt; Bitset &lt;&lt; "\n");
//</i>
<span class="doc_red">#ifdef NDEBUG
<span class="doc_hilite">#ifdef NDEBUG
#define DEBUG(X)
#else
#define DEBUG(X)</span> \
do { if (DebugFlag) { X; } } while (0)
<span class="doc_red">#endif</span>
#define DEBUG(X)</span> do { if (DebugFlag) { X; } } while (0)
<span class="doc_hilite">#endif</span>
</pre>
</div>
<p>This allows clients to blissfully use the <tt>DEBUG()</tt> macro, or the
<tt>DebugFlag</tt> explicitly if they want to. Now we just need to be able to
@@ -932,18 +996,19 @@ an additial argument to our command line argument processor, and we specify
where to fill in with the <a href="#cl::location">cl::location</a>
attribute:</p>
<div class="doc_code">
<pre>
bool DebugFlag; <i>// the actual value</i>
bool DebugFlag; <i>// the actual value</i>
static <a href="#cl::opt">cl::opt</a>&lt;bool, true&gt; <i>// The parser</i>
Debug("<i>debug</i>", <a href="#cl::desc">cl::desc</a>("<i>Enable debug output</i>"), <a href="#cl::Hidden">cl::Hidden</a>,
<a href="#cl::location">cl::location</a>(DebugFlag));
Debug("<i>debug</i>", <a href="#cl::desc">cl::desc</a>("<i>Enable debug output</i>"), <a href="#cl::Hidden">cl::Hidden</a>, <a href="#cl::location">cl::location</a>(DebugFlag));
</pre>
</div>
<p>In the above example, we specify "<tt>true</tt>" as the second argument to
the <a href="#cl::opt">cl::opt</a> template, indicating that the template should
not maintain a copy of the value itself. In addition to this, we specify the <a
href="#cl::location">cl::location</a> attribute, so that <tt>DebugFlag</tt> is
automatically set.</p>
the <tt><a href="#cl::opt">cl::opt</a></tt> template, indicating that the
template should not maintain a copy of the value itself. In addition to this,
we specify the <tt><a href="#cl::location">cl::location</a></tt> attribute, so
that <tt>DebugFlag</tt> is automatically set.</p>
</div>
@@ -994,8 +1059,8 @@ the section on <a href="#storage">Internal vs External Storage</a> for more
information.</li>
<li><a name="cl::aliasopt">The <b><tt>cl::aliasopt</tt></b></a> attribute
specifies which option a <a href="#cl::alias">cl::alias</a> option is an alias
for.</li>
specifies which option a <tt><a href="#cl::alias">cl::alias</a></tt> option is
an alias for.</li>
<li><a name="cl::values">The <b><tt>cl::values</tt></b></a> attribute specifies
the string-to-value mapping to be used by the generic parser. It takes a
@@ -1215,35 +1280,39 @@ Arguments</a> section for more information.</li>
specifies that this option is used to capture "interpreter style" arguments. See <a href="#cl::ConsumeAfter">this section for more information</a>.</li>
<li><a name="cl::Prefix">The <b><tt>cl::Prefix</tt></b></a> modifier specifies
that this option prefixes its value. With 'Prefix' options, there is no equal
sign that separates the value from the option name specified. This is useful
for processing odd arguments like '<tt>-lmalloc -L/usr/lib'</tt> in a linker
tool. Here, the '<tt>l</tt>' and '<tt>L</tt>' options are normal string (list)
options, that have the <a href="#cl::Prefix">cl::Prefix</a> modifier added to
allow the CommandLine library to recognize them. Note that <a
href="#cl::Prefix">cl::Prefix</a> options must not have the <a
href="#cl::ValueDisallowed">cl::ValueDisallowed</a> modifier specified.</li>
that this option prefixes its value. With 'Prefix' options, the equal sign does
not separate the value from the option name specified. Instead, the value is
everything after the prefix, including any equal sign if present. This is useful
for processing odd arguments like <tt>-lmalloc</tt> and <tt>-L/usr/lib</tt> in a
linker tool or <tt>-DNAME=value</tt> in a compiler tool. Here, the
'<tt>l</tt>', '<tt>D</tt>' and '<tt>L</tt>' options are normal string (or list)
options, that have the <b><tt><a href="#cl::Prefix">cl::Prefix</a></tt></b>
modifier added to allow the CommandLine library to recognize them. Note that
<b><tt><a href="#cl::Prefix">cl::Prefix</a></tt></b> options must not have the
<b><tt><a href="#cl::ValueDisallowed">cl::ValueDisallowed</a></tt></b> modifier
specified.</li>
<li><a name="cl::Grouping">The <b><tt>cl::Grouping</tt></b></a> modifier is used
to implement unix style tools (like <tt>ls</tt>) that have lots of single letter
arguments, but only require a single dash. For example, the '<tt>ls -labF</tt>'
command actually enables four different options, all of which are single
letters. Note that <a href="#cl::Grouping">cl::Grouping</a> options cannot have
values.</li>
letters. Note that <b><tt><a href="#cl::Grouping">cl::Grouping</a></tt></b>
options cannot have values.</li>
</ul>
<p>The CommandLine library does not restrict how you use the <a
href="#cl::Prefix">cl::Prefix</a> or <a href="#cl::Grouping">cl::Grouping</a>
modifiers, but it is possible to specify ambiguous argument settings. Thus, it
is possible to have multiple letter options that are prefix or grouping options,
and they will still work as designed.</p>
<p>The CommandLine library does not restrict how you use the <b><tt><a
href="#cl::Prefix">cl::Prefix</a></tt></b> or <b><tt><a
href="#cl::Grouping">cl::Grouping</a></tt></b> modifiers, but it is possible to
specify ambiguous argument settings. Thus, it is possible to have multiple
letter options that are prefix or grouping options, and they will still work as
designed.</p>
<p>To do this, the CommandLine library uses a greedy algorithm to parse the
input option into (potentially multiple) prefix and grouping options. The
strategy basically looks like this:</p>
<p><tt>parse(string OrigInput) {</tt>
<div class="doc_code"><tt>parse(string OrigInput) {</tt>
<ol>
<li><tt>string input = OrigInput;</tt>
@@ -1259,10 +1328,10 @@ strategy basically looks like this:</p>
&nbsp;&nbsp;while (!isOption(input) &amp;&amp; !input.empty()) input.pop_back();<br>
}</tt>
<li><tt>if (!OrigInput.empty()) error();</tt></li>
</ol>
<p><tt>}</tt></p>
</div>
</div>
@@ -1387,13 +1456,13 @@ options, and is the one used most of the time. It is a templated class which
can take up to three arguments (all except for the first have default values
though):</p>
<pre>
<div class="doc_code"><pre>
<b>namespace</b> cl {
<b>template</b> &lt;<b>class</b> DataType, <b>bool</b> ExternalStorage = <b>false</b>,
<b>class</b> ParserClass = parser&lt;DataType&gt; &gt;
<b>class</b> opt;
}
</pre>
</pre></div>
<p>The first template argument specifies what underlying data type the command
line argument is, and is used to select a default parser implementation. The
@@ -1421,13 +1490,13 @@ href="#customparser">custom parser</a>.</p>
line options. It too is a templated class which can take up to three
arguments:</p>
<pre>
<div class="doc_code"><pre>
<b>namespace</b> cl {
<b>template</b> &lt;<b>class</b> DataType, <b>class</b> Storage = <b>bool</b>,
<b>class</b> ParserClass = parser&lt;DataType&gt; &gt;
<b>class</b> list;
}
</pre>
</pre></div>
<p>This class works the exact same as the <a
href="#cl::opt"><tt>cl::opt</tt></a> class, except that the second argument is
@@ -1447,11 +1516,11 @@ be used.</p>
<p>The <tt>cl::alias</tt> class is a nontemplated class that is used to form
aliases for other arguments.</p>
<pre>
<div class="doc_code"><pre>
<b>namespace</b> cl {
<b>class</b> alias;
}
</pre>
</pre></div>
<p>The <a href="#cl::aliasopt"><tt>cl::aliasopt</tt></a> attribute should be
used to specify which option this is an alias for. Alias arguments default to
@@ -1460,6 +1529,34 @@ the conversion from string to data.</p>
</div>
<!-- _______________________________________________________________________ -->
<div class="doc_subsubsection">
<a name="cl::extrahelp">The <tt>cl::extrahelp</tt> class</a>
</div>
<div class="doc_text">
<p>The <tt>cl::extrahelp</tt> class is a nontemplated class that allows extra
help text to be printed out for the <tt>--help</tt> option.</p>
<div class="doc_code"><pre>
<b>namespace</b> cl {
<b>struct</b> extrahelp;
}
</pre></div>
<p>To use the extrahelp, simply construct one with a <tt>const char*</tt>
parameter to the constructor. The text passed to the constructor will be printed
at the bottom of the help message, verbatim. Note that multiple
<tt>cl::extrahelp</tt> <b>can</b> be used, but this practice is discouraged. If
your tool needs to print additional help information, put all that help into a
single <tt>cl::extrahelp</tt> instance.</p>
<p>For example:</p>
<div class="doc_code"><pre>
cl::extrahelp("\nADDITIONAL HELP:\n\n This is the extra help\n");
</pre></div>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection">
<a name="builtinparsers">Builtin parsers</a>
@@ -1584,13 +1681,13 @@ this the default for all <tt>unsigned</tt> options.</p>
<p>To start out, we declare our new <tt>FileSizeParser</tt> class:</p>
<pre>
<div class="doc_code"><pre>
<b>struct</b> FileSizeParser : <b>public</b> cl::basic_parser&lt;<b>unsigned</b>&gt; {
<i>// parse - Return true on error.</i>
<b>bool</b> parse(cl::Option &amp;O, <b>const char</b> *ArgName, <b>const</b> std::string &amp;ArgValue,
<b>unsigned</b> &amp;Val);
};
</pre>
</pre></div>
<p>Our new class inherits from the <tt>cl::basic_parser</tt> template class to
fill in the default, boiler plate, code for us. We give it the data type that
@@ -1606,7 +1703,7 @@ is not well formed, the parser should output an error message and return true.
Otherwise it should return false and set '<tt>Val</tt>' to the parsed value. In
our example, we implement <tt>parse</tt> as:</p>
<pre>
<div class="doc_code"><pre>
<b>bool</b> FileSizeParser::parse(cl::Option &amp;O, <b>const char</b> *ArgName,
<b>const</b> std::string &amp;Arg, <b>unsigned</b> &amp;Val) {
<b>const char</b> *ArgStart = Arg.c_str();
@@ -1632,7 +1729,7 @@ our example, we implement <tt>parse</tt> as:</p>
}
}
}
</pre>
</pre></div>
<p>This function implements a very simple parser for the kinds of strings we are
interested in. Although it has some holes (it allows "<tt>123KKK</tt>" for
@@ -1641,25 +1738,25 @@ itself to print out the error message (the <tt>error</tt> method always returns
true) in order to get a nice error message (shown below). Now that we have our
parser class, we can use it like this:</p>
<pre>
<div class="doc_code"><pre>
<b>static</b> <a href="#cl::opt">cl::opt</a>&lt;<b>unsigned</b>, <b>false</b>, FileSizeParser&gt;
MFS(<i>"max-file-size"</i>, <a href="#cl::desc">cl::desc</a>(<i>"Maximum file size to accept"</i>),
<a href="#cl::value_desc">cl::value_desc</a>("<i>size</i>"));
</pre>
</pre></div>
<p>Which adds this to the output of our program:</p>
<pre>
<div class="doc_code"><pre>
OPTIONS:
-help - display available options (--help-hidden for more)
...
<b>-max-file-size=&lt;size&gt; - Maximum file size to accept</b>
</pre>
</pre></div>
<p>And we can test that our parse works correctly now (the test program just
prints out the max-file-size argument value):</p>
<pre>
<div class="doc_code"><pre>
$ ./test
MFS: 0
$ ./test -max-file-size=123MB
@@ -1668,7 +1765,7 @@ $ ./test -max-file-size=3G
MFS: 3221225472
$ ./test -max-file-size=dog
-max-file-size option: 'dog' value invalid for file size argument!
</pre>
</pre></div>
<p>It looks like it works. The error message that we get is nice and helpful,
and we seem to accept reasonable file sizes. This wraps up the "custom parser"
@@ -1682,8 +1779,16 @@ tutorial.</p>
</div>
<div class="doc_text">
<p>Several of the LLVM libraries define static <tt>cl::opt</tt> instances that
will automatically be included in any program that links with that library.
This is a feature. However, sometimes it is necessary to know the value of the
command line option outside of the library. In these cases the library does or
should provide an external storage location that is accessible to users of the
library. Examples of this include the <tt>llvm::DebugFlag</tt> exported by the
<tt>lib/Support/Debug.cpp</tt> file and the <tt>llvm::TimePassesIsEnabled</tt>
flag exported by the <tt>lib/VMCore/Pass.cpp</tt> file.</p>
<p>TODO: fill in this section</p>
<p>TODO: complete this section</p>
</div>

View File

@@ -0,0 +1,823 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>The LLVM Compiler Driver (llvmc)</title>
<link rel="stylesheet" href="llvm.css" type="text/css">
<meta name="author" content="Reid Spencer">
<meta name="description"
content="A description of the use and design of the LLVM Compiler Driver.">
</head>
<body>
<div class="doc_title">The LLVM Compiler Driver (llvmc)</div>
<p class="doc_warning">NOTE: This document is a work in progress!</p>
<ol>
<li><a href="#abstract">Abstract</a></li>
<li><a href="#introduction">Introduction</a>
<ol>
<li><a href="#purpose">Purpose</a></li>
<li><a href="#operation">Operation</a></li>
<li><a href="#phases">Phases</a></li>
<li><a href="#actions">Actions</a></li>
</ol>
</li>
<li><a href="#configuration">Configuration</a>
<ol>
<li><a href="#overview">Overview</a></li>
<li><a href="#filetypes">Configuration Files</a></li>
<li><a href="#syntax">Syntax</a></li>
<li><a href="#substitutions">Substitutions</a></li>
<li><a href="#sample">Sample Config File</a></li>
</ol>
<li><a href="#glossary">Glossary</a>
</ol>
<div class="doc_author">
<p>Written by <a href="mailto:rspencer@x10sys.com">Reid Spencer</a>
</p>
</div>
<!-- *********************************************************************** -->
<div class="doc_section"> <a name="abstract">Abstract</a></div>
<!-- *********************************************************************** -->
<div class="doc_text">
<p>This document describes the requirements, design, and configuration of the
LLVM compiler driver, <tt>llvmc</tt>. The compiler driver knows about LLVM's
tool set and can be configured to know about a variety of compilers for
source languages. It uses this knowledge to execute the tools necessary
to accomplish general compilation, optimization, and linking tasks. The main
purpose of <tt>llvmc</tt> is to provide a simple and consistent interface to
all compilation tasks. This reduces the burden on the end user who can just
learn to use <tt>llvmc</tt> instead of the entire LLVM tool set and all the
source language compilers compatible with LLVM.</p>
</div>
<!-- *********************************************************************** -->
<div class="doc_section"> <a name="introduction">Introduction</a></div>
<!-- *********************************************************************** -->
<div class="doc_text">
<p>The <tt>llvmc</tt> <a href="#def_tool">tool</a> is a configurable compiler
<a href="#def_driver">driver</a>. As such, it isn't a compiler, optimizer,
or a linker itself but it drives (invokes) other software that perform those
tasks. If you are familiar with the GNU Compiler Collection's <tt>gcc</tt>
tool, <tt>llvmc</tt> is very similar.</p>
<p>The following introductory sections will help you understand why this tool
is necessary and what it does.</p>
</div>
<!-- _______________________________________________________________________ -->
<div class="doc_subsection"><a name="purpose">Purpose</a></div>
<div class="doc_text">
<p><tt>llvmc</tt> was invented to make compilation of user programs with
LLVM-based tools easier. To accomplish this, <tt>llvmc</tt> strives to:</p>
<ul>
<li>Be the single point of access to most of the LLVM tool set.</li>
<li>Hide the complexities of the LLVM tools through a single interface.</li>
<li>Provide a consistent interface for compiling all languages.</li>
</ul>
<p>Additionally, <tt>llvmc</tt> makes it easier to write a compiler for use
with LLVM, because it:</p>
<ul>
<li>Makes integration of existing non-LLVM tools simple.</li>
<li>Extends the capabilities of minimal compiler tools by optimizing their
output.</li>
<li>Reduces the number of interfaces a compiler writer must know about
before a working compiler can be completed (essentially only the VMCore
interfaces need to be understood).</li>
<li>Supports source language translator invocation via both dynamically
loadable shared objects and invocation of an executable.</li>
</ul>
</div>
<!-- _______________________________________________________________________ -->
<div class="doc_subsection"><a name="operation">Operation</a></div>
<div class="doc_text">
<p>At a high level, <tt>llvmc</tt> operation is very simple. The basic action
taken by <tt>llvmc</tt> is to simply invoke some tool or set of tools to fill
the user's request for compilation. Every execution of <tt>llvmc</tt>takes the
following sequence of steps:</p>
<dl>
<dt><b>Collect Command Line Options</b></dt>
<dd>The command line options provide the marching orders to <tt>llvmc</tt>
on what actions it should perform. This is the request the user is making
of <tt>llvmc</tt> and it is interpreted first. See the <tt>llvmc</tt>
<a href="CommandGuide/html/llvmc.html">manual page</a> for details on the
options.</dd>
<dt><b>Read Configuration Files</b></dt>
<dd>Based on the options and the suffixes of the filenames presented, a set
of configuration files are read to configure the actions <tt>llvmc</tt> will
take. Configuration files are provided by either LLVM or the
compiler tools that <tt>llvmc</tt> invokes. These files determine what
actions <tt>llvmc</tt> will take in response to the user's request. See
the section on <a href="#configuration">configuration</a> for more details.
</dd>
<dt><b>Determine Phases To Execute</b></dt>
<dd>Based on the command line options and configuration files,
<tt>llvmc</tt> determines the compilation <a href="#phases">phases</a> that
must be executed by the user's request. This is the primary work of
<tt>llvmc</tt>.</dd>
<dt><b>Determine Actions To Execute</b></dt>
<dd>Each <a href="#phases">phase</a> to be executed can result in the
invocation of one or more <a href="#actions">actions</a>. An action is
either a whole program or a function in a dynamically linked shared library.
In this step, <tt>llvmc</tt> determines the sequence of actions that must be
executed. Actions will always be executed in a deterministic order.</dd>
<dt><b>Execute Actions</b></dt>
<dd>The <a href="#actions">actions</a> necessary to support the user's
original request are executed sequentially and deterministically. All
actions result in either the invocation of a whole program to perform the
action or the loading of a dynamically linkable shared library and invocation
of a standard interface function within that library.</dd>
<dt><b>Termination</b></dt>
<dd>If any action fails (returns a non-zero result code), <tt>llvmc</tt>
also fails and returns the result code from the failing action. If
everything succeeds, <tt>llvmc</tt> will return a zero result code.</dd>
</dl>
<p><tt>llvmc</tt>'s operation must be simple, regular and predictable.
Developers need to be able to rely on it to take a consistent approach to
compilation. For example, the invocation:</p>
<code>
llvmc -O2 x.c y.c z.c -o xyz</code>
<p>must produce <i>exactly</i> the same results as:</p>
<pre><tt>
llvmc -O2 x.c -o x.o
llvmc -O2 y.c -o y.o
llvmc -O2 z.c -o z.o
llvmc -O2 x.o y.o z.o -o xyz</tt></pre>
<p>To accomplish this, <tt>llvmc</tt> uses a very simple goal oriented
procedure to do its work. The overall goal is to produce a functioning
executable. To accomplish this, <tt>llvmc</tt> always attempts to execute a
series of compilation <a href="#def_phase">phases</a> in the same sequence.
However, the user's options to <tt>llvmc</tt> can cause the sequence of phases
to start in the middle or finish early.</p>
</div>
<!-- _______________________________________________________________________ -->
<div class="doc_subsection"><a name="phases"></a>Phases </div>
<div class="doc_text">
<p><tt>llvmc</tt> breaks every compilation task into the following five
distinct phases:</p>
<dl><dt><b>Preprocessing</b></dt><dd>Not all languages support preprocessing;
but for those that do, this phase can be invoked. This phase is for
languages that provide combining, filtering, or otherwise altering with the
source language input before the translator parses it. Although C and C++
are the most common users of this phase, other languages may provide their
own preprocessor (whether its the C pre-processor or not).</dd>
</dl>
<dl><dt><b>Translation</b></dt><dd>The translation phase converts the source
language input into something that LLVM can interpret and use for
downstream phases. The translation is essentially from "non-LLVM form" to
"LLVM form".</dd>
</dl>
<dl><dt><b>Optimization</b></dt><dd>Once an LLVM Module has been obtained from
the translation phase, the program enters the optimization phase. This phase
attempts to optimize all of the input provided on the command line according
to the options provided.</dd>
</dl>
<dl><dt><b>Linking</b></dt><dd>The inputs are combined to form a complete
program.</dd>
</dl>
<p>The following table shows the inputs, outputs, and command line options
applicable to each phase.</p>
<table>
<tr>
<th style="width: 10%">Phase</th>
<th style="width: 25%">Inputs</th>
<th style="width: 25%">Outputs</th>
<th style="width: 40%">Options</th>
</tr>
<tr><td><b>Preprocessing</b></td>
<td class="td_left"><ul><li>Source Language File</li></ul></td>
<td class="td_left"><ul><li>Source Language File</li></ul></td>
<td class="td_left"><dl>
<dt><tt>-E</tt></dt>
<dd>Stops the compilation after preprocessing</dd>
</dl></td>
</tr>
<tr>
<td><b>Translation</b></td>
<td class="td_left"><ul>
<li>Source Language File</li>
</ul></td>
<td class="td_left"><ul>
<li>LLVM Assembly</li>
<li>LLVM Bytecode</li>
<li>LLVM C++ IR</li>
</ul></td>
<td class="td_left"><dl>
<dt><tt>-c</tt></dt>
<dd>Stops the compilation after translation so that optimization and
linking are not done.</dd>
<dt><tt>-S</tt></dt>
<dd>Stops the compilation before object code is written so that only
assembly code remains.</dd>
</dl></td>
</tr>
<tr>
<td><b>Optimization</b></td>
<td class="td_left"><ul>
<li>LLVM Assembly</li>
<li>LLVM Bytecode</li>
</ul></td>
<td class="td_left"><ul>
<li>LLVM Bytecode</li>
</ul></td>
<td class="td_left"><dl>
<dt><tt>-Ox</tt>
<dd>This group of options controls the amount of optimization
performed.</dd>
</dl></td>
</tr>
<tr>
<td><b>Linking</b></td>
<td class="td_left"><ul>
<li>LLVM Bytecode</li>
<li>Native Object Code</li>
<li>LLVM Library</li>
<li>Native Library</li>
</ul></td>
<td class="td_left"><ul>
<li>LLVM Bytecode Executable</li>
<li>Native Executable</li>
</ul></td>
<td class="td_left"><dl>
<dt><tt>-L</tt></dt><dd>Specifies a path for library search.</dd>
<dt><tt>-l</tt></dt><dd>Specifies a library to link in.</dd>
</dl></td>
</tr>
</table>
</div>
<!-- _______________________________________________________________________ -->
<div class="doc_subsection"><a name="actions"></a>Actions</div>
<div class="doc_text">
<p>An action, with regard to <tt>llvmc</tt> is a basic operation that it takes
in order to fulfill the user's request. Each phase of compilation will invoke
zero or more actions in order to accomplish that phase.</p>
<p>Actions come in two forms:</p>
<ul>
<li>Invokable Executables</li>
<li>Functions in a shared library</li>
</ul>
</div>
<!-- *********************************************************************** -->
<div class="doc_section"><a name="configuration">Configuration</a></div>
<!-- *********************************************************************** -->
<div class="doc_text">
<p>This section of the document describes the configuration files used by
<tt>llvmc</tt>. Configuration information is relatively static for a
given release of LLVM and a compiler tool. However, the details may
change from release to release of either. Users are encouraged to simply use
the various options of the <tt>llvmc</tt> command and ignore the configuration
of the tool. These configuration files are for compiler writers and LLVM
developers. Those wishing to simply use <tt>llvmc</tt> don't need to understand
this section but it may be instructive on how the tool works.</p>
</div>
<!-- _______________________________________________________________________ -->
<div class="doc_subsection"><a name="overview"></a>Overview</div>
<div class="doc_text">
<p><tt>llvmc</tt> is highly configurable both on the command line and in
configuration files. The options it understands are generic, consistent and
simple by design. Furthermore, the <tt>llvmc</tt> options apply to the
compilation of any LLVM enabled programming language. To be enabled as a
supported source language compiler, a compiler writer must provide a
configuration file that tells <tt>llvmc</tt> how to invoke the compiler
and what its capabilities are. The purpose of the configuration files then
is to allow compiler writers to specify to <tt>llvmc</tt> how the compiler
should be invoked. Users may but are not advised to alter the compiler's
<tt>llvmc</tt> configuration.</p>
<p>Because <tt>llvmc</tt> just invokes other programs, it must deal with the
available command line options for those programs regardless of whether they
were written for LLVM or not. Furthermore, not all compiler tools will
have the same capabilities. Some compiler tools will simply generate LLVM assembly
code, others will be able to generate fully optimized byte code. In general,
<tt>llvmc</tt> doesn't make any assumptions about the capabilities or command
line options of a sub-tool. It simply uses the details found in the
configuration files and leaves it to the compiler writer to specify the
configuration correctly.</p>
<p>This approach means that new compiler tools can be up and working very
quickly. As a first cut, a tool can simply compile its source to raw
(unoptimized) bytecode or LLVM assembly and <tt>llvmc</tt> can be configured
to pick up the slack (translate LLVM assembly to bytecode, optimize the
bytecode, generate native assembly, link, etc.). In fact, the compiler tools
need not use any LLVM libraries, and it could be written in any language
(instead of C++). The configuration data will allow the full range of
optimization, assembly, and linking capabilities that LLVM provides to be added
to these kinds of tools. Enabling the rapid development of front-ends is one
of the primary goals of <tt>llvmc</tt>.</p>
<p>As a compiler tool matures, it may utilize the LLVM libraries and tools
to more efficiently produce optimized bytecode directly in a single compilation
and optimization program. In these cases, multiple tools would not be needed
and the configuration data for the compiler would change.</p>
<p>Configuring <tt>llvmc</tt> to the needs and capabilities of a source language
compiler is relatively straight-forward. A compiler writer must provide a
definition of what to do for each of the five compilation phases for each of
the optimization levels. The specification consists simply of prototypical
command lines into which <tt>llvmc</tt> can substitute command line
arguments and file names. Note that any given phase can be completely blank if
the source language's compiler combines multiple phases into a single program.
For example, quite often pre-processing, translation, and optimization are
combined into a single program. The specification for such a compiler would have
blank entries for pre-processing and translation but a full command line for
optimization.</p>
</div>
<!-- _______________________________________________________________________ -->
<div class="doc_subsection"><a name="filetypes">Configuration Files</a></div>
<div class="doc_subsubsection"><a name="filecontents">File Contents</a></div>
<div class="doc_text">
<p>Each configuration file provides the details for a single source language
that is to be compiled. This configuration information tells <tt>llvmc</tt>
how to invoke the language's pre-processor, translator, optimizer, assembler
and linker. Note that a given source language needn't provide all these tools
as many of them exist in llvm currently.</p>
</div>
<!-- _______________________________________________________________________ -->
<div class="doc_subsubsection"><a name="dirsearch">Directory Search</a></div>
<div class="doc_text">
<p><tt>llvmc</tt> always looks for files of a specific name. It uses the
first file with the name its looking for by searching directories in the
following order:<br/>
<ol>
<li>Any directory specified by the <tt>-config-dir</tt> option will be
checked first.</li>
<li>If the environment variable LLVM_CONFIG_DIR is set, and it contains
the name of a valid directory, that directory will be searched next.</li>
<li>If the user's home directory (typically <tt>/home/user</tt> contains
a sub-directory named <tt>.llvm</tt> and that directory contains a
sub-directory named <tt>etc</tt> then that directory will be tried
next.</li>
<li>If the LLVM installation directory (typically <tt>/usr/local/llvm</tt>
contains a sub-directory named <tt>etc</tt> then that directory will be
tried last.</li>
<li>A standard "system" directory will be searched next. This is typically
<tt>/etc/llvm</tt> on UNIX&trade; and <tt>C:\WINNT</tt> on Microsoft
Windows&trade;.</li>
<li>If the configuration file sought still can't be found, <tt>llvmc</tt>
will print an error message and exit.</li>
</ol>
<p>The first file found in this search will be used. Other files with the
same name will be ignored even if they exist in one of the subsequent search
locations.</p>
</div>
<div class="doc_subsubsection"><a name="filenames">File Names</a></div>
<div class="doc_text">
<p>In the directories searched, each configuration file is given a specific
name to foster faster lookup (so llvmc doesn't have to do directory searches).
The name of a given language specific configuration file is simply the same
as the suffix used to identify files containing source in that language.
For example, a configuration file for C++ source might be named
<tt>cpp</tt>, <tt>C</tt>, or <tt>cxx</tt>. For languages that support multiple
file suffixes, multiple (probably identical) files (or symbolic links) will
need to be provided.</p>
</div>
<div class="doc_subsubsection"><a name="whatgetsread">What Gets Read</a></div>
<div class="doc_text">
<p>Which configuration files are read depends on the command line options and
the suffixes of the file names provided on <tt>llvmc</tt>'s command line. Note
that the <tt>-x LANGUAGE</tt> option alters the language that <tt>llvmc</tt>
uses for the subsequent files on the command line. Only the configuration
files actually needed to complete <tt>llvmc</tt>'s task are read. Other
language specific files will be ignored.</p>
</div>
<!-- _______________________________________________________________________ -->
<div class="doc_subsection"><a name="syntax"></a>Syntax</div>
<div class="doc_text">
<p>The syntax of the configuration files is very simple and somewhat
compatible with Java's property files. Here are the syntax rules:</p>
<ul>
<li>The file encoding is ASCII.</li>
<li>The file is line oriented. There should be one configuration definition
per line. Lines are terminated by the newline (0x0A) and/or carriage return
characters (0x0D)</li>
<li>A backslash (<tt>\</tt>) before a newline causes the newline to be
ignored. This is useful for line continuation of long definitions. A
backslash anywhere else is recognized as a backslash.</li>
<li>A configuration item consists of a name, an <tt>=</tt> and a value.</li>
<li>A name consists of a sequence of identifiers separated by period.</li>
<li>An identifier consists of specific keywords made up of only lower case
and upper case letters (e.g. <tt>lang.name</tt>).</li>
<li>Values come in four flavors: booleans, integers, commands and
strings.</li>
<li>Valid "false" boolean values are <tt>false False FALSE no No NO
off Off</tt> and <tt>OFF</tt>.</li>
<li>Valid "true" boolean values are <tt>true True TRUE yes Yes YES
on On</tt> and <tt>ON</tt>.</li>
<li>Integers are simply sequences of digits.</li>
<li>Commands start with a program name and are followed by a sequence of
words that are passed to that program as command line arguments. Program
arguments that begin and end with the <tt>%</tt> sign will have their value
substituted. Program names beginning with <tt>/</tt> are considered to be
absolute. Otherwise the <tt>PATH</tt> will be applied to find the program to
execute.</li>
<li>Strings are composed of multiple sequences of characters from the
character class <tt>[-A-Za-z0-9_:%+/\\|,]</tt> separated by white
space.</li>
<li>White space on a line is folded. Multiple blanks or tabs will be
reduced to a single blank.</li>
<li>White space before the configuration item's name is ignored.</li>
<li>White space on either side of the <tt>=</tt> is ignored.</li>
<li>White space in a string value is used to separate the individual
components of the string value but otherwise ignored.</li>
<li>Comments are introduced by the <tt>#</tt> character. Everything after a
<tt>#</tt> and before the end of line is ignored.</li>
</ul>
</div>
<!-- _______________________________________________________________________ -->
<div class="doc_subsection"><a name="items">Configuration Items</a></div>
<div class="doc_text">
<p>The table below provides definitions of the allowed configuration items
that may appear in a configuration file. Every item has a default value and
does not need to appear in the configuration file. Missing items will have the
default value. Each identifier may appear as all lower case, first letter
capitalized or all upper case.</p>
<table>
<tbody>
<tr>
<th>Name</th>
<th>Value Type</th>
<th>Description</th>
<th>Default</th>
</tr>
<tr><td colspan="4"><h4>LLVMC ITEMS</h4></td></tr>
<tr>
<td><b>version</b></td>
<td>string</td>
<td class="td_left">Provides the version string for the contents of this
configuration file. What is accepted as a legal configuration file
will change over time and this item tells <tt>llvmc</tt> which version
should be expected.</td>
<td><i>b</i></td>
</tr>
<tr><td colspan="4"><h4>LANG ITEMS</h4></td></tr>
<tr>
<td><b>lang.name</b></td>
<td>string</td>
<td class="td_left">Provides the common name for a language definition.
For example "C++", "Pascal", "FORTRAN", etc.</td>
<td><i>blank</i></td>
</tr>
<tr>
<td><b>lang.opt1</b></td>
<td>string</td>
<td class="td_left">Specifies the parameters to give the optimizer when
<tt>-O1</tt> is specified on the <tt>llvmc</tt> command line.</td>
<td><tt>-simplifycfg -instcombine -mem2reg</tt></td>
</tr>
<tr>
<td><b>lang.opt2</b></td>
<td>string</td>
<td class="td_left">Specifies the parameters to give the optimizer when
<tt>-O2</tt> is specified on the <tt>llvmc</tt> command line.</td>
<td><i>TBD</i></td>
</tr>
<tr>
<td><b>lang.opt3</b></td>
<td>string</td>
<td class="td_left">Specifies the parameters to give the optimizer when
<tt>-O3</tt> is specified on the <tt>llvmc</tt> command line.</td>
<td><i>TBD</i></td>
</tr>
<tr>
<td><b>lang.opt4</b></td>
<td>string</td>
<td class="td_left">Specifies the parameters to give the optimizer when
<tt>-O4</tt> is specified on the <tt>llvmc</tt> command line.</td>
<td><i>TBD</i></td>
</tr>
<tr>
<td><b>lang.opt5</b></td>
<td>string</td>
<td class="td_left">Specifies the parameters to give the optimizer when
<tt>-O5</tt> is specified on the <tt>llvmc</tt> command line.</td>
<td><i>TBD</i></td>
</tr>
<tr><td colspan="4"><h4>PREPROCESSOR ITEMS</h4></td></tr>
<tr>
<td><b>preprocessor.command</b></td>
<td>command</td>
<td class="td_left">This provides the command prototype that will be used
to run the preprocessor. This is generally only used with the
<tt>-E</tt> option.</td>
<td>&lt;blank&gt;</td>
</tr>
<tr>
<td><b>preprocessor.required</b></td>
<td>boolean</td>
<td class="td_left">This item specifies whether the pre-processing phase
is required by the language. If the value is true, then the
<tt>preprocessor.command</tt> value must not be blank. With this option,
<tt>llvmc</tt> will always run the preprocessor as it assumes that the
translation and optimization phases don't know how to pre-process their
input.</td>
<td>false</td>
</tr>
<tr><td colspan="4"><h4>TRANSLATOR ITEMS</h4></td></tr>
<tr>
<td><b>translator.command</b></td>
<td>command</td>
<td class="td_left">This provides the command prototype that will be used
to run the translator. Valid substitutions are <tt>%in%</tt> for the
input file and <tt>%out%</tt> for the output file.</td>
<td>&lt;blank&gt;</td>
</tr>
<tr>
<td><b>translator.output</b></td>
<td><tt>bytecode</tt> or <tt>assembly</tt></td>
<td class="td_left">This item specifies the kind of output the language's
translator generates.</td>
<td><tt>bytecode</tt></td>
</tr>
<tr>
<td><b>translator.preprocesses</b></td>
<td>boolean</td>
<td class="td_left">Indicates that the translator also preprocesses. If
this is true, then <tt>llvmc</tt> will skip the pre-processing phase
whenever the final phase is not pre-processing.</td>
<td><tt>false</tt></td>
</tr>
<tr><td colspan="4"><h4>OPTIMIZER ITEMS</h4></td></tr>
<tr>
<td><b>optimizer.command</b></td>
<td>command</td>
<td class="td_left">This provides the command prototype that will be used
to run the optimizer. Valid substitutions are <tt>%in%</tt> for the
input file and <tt>%out%</tt> for the output file.</td>
<td>&lt;blank&gt;</td>
</tr>
<tr>
<td><b>optimizer.output</b></td>
<td><tt>bytecode</tt> or <tt>assembly</tt></td>
<td class="td_left">This item specifies the kind of output the language's
optimizer generates. Valid values are "assembly" and "bytecode"</td>
<td><tt>bytecode</tt></td>
</tr>
<tr>
<td><b>optimizer.preprocesses</b></td>
<td>boolean</td>
<td class="td_left">Indicates that the optimizer also preprocesses. If
this is true, then <tt>llvmc</tt> will skip the pre-processing phase
whenever the final phase is optimization or later.</td>
<td><tt>false</tt></td>
</tr>
<tr>
<td><b>optimizer.translates</b></td>
<td>boolean</td>
<td class="td_left">Indicates that the optimizer also translates. If
this is true, then <tt>llvmc</tt> will skip the translation phase
whenever the final phase is optimization or later.</td>
<td><tt>false</tt></td>
</tr>
<tr><td colspan="4"><h4>ASSEMBLER ITEMS</h4></td></tr>
<tr>
<td><b>assembler.command</b></td>
<td>command</td>
<td class="td_left">This provides the command prototype that will be used
to run the assembler. Valid substitutions are <tt>%in%</tt> for the
input file and <tt>%out%</tt> for the output file.</td>
<td>&lt;blank&gt;</td>
</tr>
</tbody>
</table>
</div>
<!-- _______________________________________________________________________ -->
<div class="doc_subsection"><a name="substitutions">Substitutions</a></div>
<div class="doc_text">
<p>On any configuration item that ends in <tt>command</tt>, you must
specify substitution tokens. Substitution tokens begin and end with a percent
sign (<tt>%</tt>) and are replaced by the corresponding text. Any substitution
token may be given on any <tt>command</tt> line but some are more useful than
others. In particular each command <em>should</em> have both an <tt>%in%</tt>
and an <tt>%out%</tt> substitution. The table below provides definitions of
each of the allowed substitution tokens.</p>
<table>
<tbody>
<tr>
<th>Substitution Token</th>
<th>Replacement Description</th>
</tr>
<tr>
<td><tt>%args%</tt></td>
<td class="td_left">Replaced with all the tool-specific arguments given
to <tt>llvmc</tt> via the <tt>-T</tt> set of options. This just allows
you to place these arguments in the correct place on the command line.
If the <tt>%args%</tt> option does not appear on your command line,
then you are explicitly disallowing the <tt>-T</tt> option for your
tool.
</td>
<tr>
<td><tt>%force%</tt></td>
<td class="td_left">Replaced with the <tt>-f</tt> option if it was
specified on the <tt>llvmc</tt> command line. This is intended to tell
the compiler tool to force the overwrite of output files.
</td>
</tr>
<tr>
<td><tt>%in%</tt></td>
<td class="td_left">Replaced with the full path of the input file. You
needn't worry about the cascading of file names. <tt>llvmc</tt> will
create temporary files and ensure that the output of one phase is the
input to the next phase.</td>
</tr>
<tr>
<td><tt>%opt%</tt></td>
<td class="td_left">Replaced with the optimization options for the
tool. If the tool understands the <tt>-O</tt> options then that will
be passed. Otherwise, the <tt>lang.optN</tt> series of configuration
items will specify which arguments are to be given.</td>
</tr>
<tr>
<td><tt>%out%</tt></td>
<td class="td_left">Replaced with the full path of the output file.
Note that this is not necessarily the output file specified with the
<tt>-o</tt> option on <tt>llvmc</tt>'s command line. It might be a
temporary file that will be passed to a subsequent phase's input.
</td>
</tr>
<tr>
<td><tt>%stats%</tt></td>
<td class="td_left">If your command accepts the <tt>-stats</tt> option,
use this substitution token. If the user requested <tt>-stats</tt>
from the <tt>llvmc</tt> command line then this token will be replaced
with <tt>-stats</tt>, otherwise it will be ignored.
</td>
</tr>
<tr>
<td><tt>%target%</tt></td>
<td class="td_left">Replaced with the name of the target "machine" for
which code should be generated. The value used here is taken from the
<tt>llvmc</tt> option <tt>-march</tt>.
</td>
</tr>
<tr>
<td><tt>%time%</tt></td>
<td class="td_left">If your command accepts the <tt>-time-passes</tt>
option, use this substitution token. If the user requested
<tt>-time-passes</tt> from the <tt>llvmc</tt> command line then this
token will be replaced with <tt>-time-passes</tt>, otherwise it will
be ignored.
</td>
</tr>
</tbody>
</table>
</div>
<!-- _______________________________________________________________________ -->
<div class="doc_subsection"><a name="sample">Sample Config File</a></div>
<div class="doc_text">
<p>Since an example is always instructive, here's how the Stacker language
configuration file looks.</p>
<pre><tt>
# Stacker Configuration File For llvmc
##########################################################
# Language definitions
##########################################################
lang.name=Stacker
lang.opt1=-simplifycfg -instcombine -mem2reg
lang.opt2=-simplifycfg -instcombine -mem2reg -load-vn \
-gcse -dse -scalarrepl -sccp
lang.opt3=-simplifycfg -instcombine -mem2reg -load-vn \
-gcse -dse -scalarrepl -sccp -branch-combine -adce \
-globaldce -inline -licm
lang.opt4=-simplifycfg -instcombine -mem2reg -load-vn \
-gcse -dse -scalarrepl -sccp -ipconstprop \
-branch-combine -adce -globaldce -inline -licm
lang.opt5=-simplifycfg -instcombine -mem2reg --load-vn \
-gcse -dse scalarrepl -sccp -ipconstprop \
-branch-combine -adce -globaldce -inline -licm \
-block-placement
##########################################################
# Pre-processor definitions
##########################################################
# Stacker doesn't have a preprocessor but the following
# allows the -E option to be supported
preprocessor.command=cp %in% %out%
preprocessor.required=false
##########################################################
# Translator definitions
##########################################################
# To compile stacker source, we just run the stacker
# compiler with a default stack size of 2048 entries.
translator.command=stkrc -s 2048 %in% -o %out% %time% \
%stats% %force% %args%
# stkrc doesn't preprocess but we set this to true so
# that we don't run the cp command by default.
translator.preprocesses=true
# The translator is required to run.
translator.required=true
# stkrc doesn't handle the -On options
translator.output=bytecode
##########################################################
# Optimizer definitions
##########################################################
# For optimization, we use the LLVM "opt" program
optimizer.command=opt %in% -o %out% %opt% %time% %stats% \
%force% %args%
optimizer.required = true
# opt doesn't translate
optimizer.translates = no
# opt doesn't preprocess
optimizer.preprocesses=no
# opt produces bytecode
optimizer.output = bc
##########################################################
# Assembler definitions
##########################################################
assembler.command=llc %in% -o %out% %target% %time% %stats%
</tt></pre>
</div>
<!-- *********************************************************************** -->
<div class="doc_section"><a name="glossary">Glossary</a></div>
<!-- *********************************************************************** -->
<div class="doc_text">
<p>This document uses precise terms in reference to the various artifacts and
concepts related to compilation. The terms used throughout this document are
defined below.</p>
<dl>
<dt><a name="def_assembly"><b>assembly</b></a></dt>
<dd>A compilation <a href="#def_phase">phase</a> in which LLVM bytecode or
LLVM assembly code is assembled to a native code format (either target
specific aseembly language or the platform's native object file format).
</dd>
<dt><a name="def_compiler"><b>compiler</b></a></dt>
<dd>Refers to any program that can be invoked by <tt>llvmc</tt> to accomplish
the work of one or more compilation <a href="#def_phase">phases</a>.</dd>
<dt><a name="def_driver"><b>driver</b></a></dt>
<dd>Refers to <tt>llvmc</tt> itself.</dd>
<dt><a name="def_linking"><b>linking</b></a></dt>
<dd>A compilation <a href="#def_phase">phase</a> in which LLVM bytecode files
and (optionally) native system libraries are combined to form a complete
executable program.</dd>
<dt><a name="def_optimization"><b>optimization</b></a></dt>
<dd>A compilation <a href="#def_phase">phase</a> in which LLVM bytecode is
optimized.</dd>
<dt><a name="def_phase"><b>phase</b></a></dt>
<dd>Refers to any one of the five compilation phases that that
<tt>llvmc</tt> supports. The five phases are:
<a href="#def_preprocessing">preprocessing</a>,
<a href="#def_translation">translation</a>,
<a href="#def_optimization">optimization</a>,
<a href="#def_assembly">assembly</a>,
<a href="#def_linking">linking</a>.</dd>
<dt><a name="def_sourcelanguage"><b>source language</b></a></dt>
<dd>Any common programming language (e.g. C, C++, Java, Stacker, ML,
FORTRAN). These languages are distinguished from any of the lower level
languages (such as LLVM or native assembly), by the fact that a
<a href="#def_translation">translation</a> <a href="#def_phase">phase</a>
is required before LLVM can be applied.</dd>
<dt><a name="def_tool"><b>tool</b></a></dt>
<dd>Refers to any program in the LLVM tool set.</dd>
<dt><a name="def_translation"><b>translation</b></a></dt>
<dd>A compilation <a href="#def_phase">phase</a> in which
<a href="#def_sourcelanguage">source language</a> code is translated into
either LLVM assembly language or LLVM bytecode.</dd>
</dl>
</div>
<!-- *********************************************************************** -->
<hr>
<address> <a href="http://jigsaw.w3.org/css-validator/check/referer"><img
src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a><a
href="http://validator.w3.org/check/referer"><img
src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!"></a><a
href="mailto:rspencer@x10sys.com">Reid Spencer</a><br>
<a href="http://llvm.cs.uiuc.edu">The LLVM Compiler Infrastructure</a><br>
Last modified: $Date$
</address>
<!-- vim: sw=2
-->
</body>
</html>

View File

@@ -0,0 +1,260 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Architecture/platform information for compiler writers</title>
<link rel="stylesheet" href="llvm.css" type="text/css">
</head>
<div class="doc_title">
Architecture/platform information for compiler writers
</div>
<div class="doc_warning">
<p>Note: This document is a work-in-progress. Additions and clarifications
are welcome.</p>
</div>
<ol>
<li><a href="#hw">Hardware</a>
<ol>
<li><a href="#alpha">Alpha</a></li>
<li><a href="#arm">ARM</a></li>
<li><a href="#ia64">Itanium</a></li>
<li><a href="#mips">MIPS</a></li>
<li><a href="#ppc">PowerPC</a></li>
<li><a href="#sparc">SPARC</a></li>
<li><a href="#x86">X86</a></li>
<li><a href="#other">Other lists</a></li>
</ol></li>
<li><a href="#abi">Application Binary Interface (ABI)</a>
<ol>
<li><a href="#linux">Linux</a></li>
<li><a href="#osx">OS X</a></li>
</ol></li>
<li><a href="#misc">Miscellaneous resources</a></li>
</ol>
<div class="doc_author">
<p>Compiled by <a href="http://misha.brukman.net">Misha Brukman</a></p>
</div>
<!-- *********************************************************************** -->
<div class="doc_section"><a name="hw">Hardware</a></div>
<!-- *********************************************************************** -->
<!-- ======================================================================= -->
<div class="doc_subsection"><a name="alpha">Alpha</a></div>
<div class="doc_text">
<ul>
<li><a
href="http://ftp.digital.com/pub/Digital/info/semiconductor/literature/dsc-library.html">Alpha manuals</a>
</li>
</ul>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection"><a name="arm">ARM</a></div>
<div class="doc_text">
<ul>
<li><a href="http://www.arm.com/documentation/">ARM documentation</a>
(<a href="http://www.arm.com/documentation/ARMProcessor_Cores/">Processor
Cores</a>)</li>
</ul>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection"><a name="ia64">Itanium (ia64)</a></div>
<div class="doc_text">
<ul>
<li><a
href="http://developer.intel.com/design/itanium2/documentation.htm">Itanium documentation</a>
</li>
</ul>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection"><a name="mips">MIPS</a></div>
<div class="doc_text">
<ul>
<li><a
href="http://mips.com/content/Documentation/MIPSDocumentation/ProcessorArchitecture/doclibrary">MIPS
Processor Architecture</a></li>
</ul>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection"><a name="ppc">PowerPC</a></div>
<!-- _______________________________________________________________________ -->
<div class="doc_subsubsection">IBM - Official manuals and docs</div>
<div class="doc_text">
<ul>
<li><a
href="http://www-106.ibm.com/developerworks/eserver/articles/archguide.html">PowerPC
Architecture Book</a>
<ul>
<li>Book I: <a
href="http://www-106.ibm.com/developerworks/eserver/pdfs/archpub1.pdf">PowerPC
User Instruction Set Architecture</a></li>
<li>Book II: <a
href="http://www-106.ibm.com/developerworks/eserver/pdfs/archpub2.pdf">PowerPC
Virtual Environment Architecture</a></li>
<li>Book III: <a
href="http://www-106.ibm.com/developerworks/eserver/pdfs/archpub3.pdf">PowerPC
Operating Environment Architecture</a></li>
</ul></li>
<li><a
href="http://www-3.ibm.com/chips/techlib/techlib.nsf/techdocs/852569B20050FF7785256996007558C6">PowerPC
Compiler Writer's Guide</a></li>
<li><A
href="http://www-3.ibm.com/chips/techlib/techlib.nsf/products/PowerPC">PowerPC
Processor Manuals</a></li>
<li><a
href="http://www-106.ibm.com/developerworks/linux/library/l-powarch/">Intro to
PowerPC architecture</a></li>
<li><a href="http://publibn.boulder.ibm.com/doc_link/en_US/a_doc_lib/aixassem/alangref/alangreftfrm.htm">IBM AIX/5L for POWER Assembly reference</a></li>
</ul>
</div>
<!-- _______________________________________________________________________ -->
<div class="doc_subsubsection">Other documents, collections, notes</div>
<div class="doc_text">
<ul>
<li><a href="http://penguinppc.org/dev/#library">PowerPC ABI documents</a></li>
<li><a href="http://gcc.gnu.org/ml/gcc-patches/2003-09/msg00997.html">PowerPC64
alignment of long doubles (from GCC)</a></li>
<li><a href="http://sources.redhat.com/ml/binutils/2002-04/msg00573.html">Long
branch stubs for powerpc64-linux (from binutils)</a></li>
</ul>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection"><a name="sparc">SPARC</a></div>
<div class="doc_text">
<ul>
<li><a href="http://www.sparc.org/resource.htm">SPARC resources</a></li>
<li><a href="http://www.sparc.org/standards.html">SPARC standards</a></li>
</ul>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection"><a name="x86">X86</a></div>
<!-- _______________________________________________________________________ -->
<div class="doc_subsubsection">AMD - Official manuals and docs</div>
<div class="doc_text">
<ul>
<li><a
href="http://www.amd.com/us-en/Processors/TechnicalResources/0,,30_182_739,00.html">AMD processor manuals</a></li>
<li><a href="http://www.x86-64.org/documentation">X86-64 ABI</a></li>
</ul>
</div>
<!-- _______________________________________________________________________ -->
<div class="doc_subsubsection">Intel - Official manuals and docs</div>
<div class="doc_text">
<ul>
<li><a
href="http://developer.intel.com/design/pentium4/manuals/index_new.htm">IA-32
manuals</a></li>
<li><a
href="http://www.intel.com/design/itanium/documentation.htm?iid=ipp_srvr_proc_itanium2+techdocs">Intel
Itanium documentation</a></li>
</ul>
</div>
<!-- _______________________________________________________________________ -->
<div class="doc_subsubsection">Other x86-specific information</div>
<div class="doc_text">
<ul>
<li><a href="http://www.agner.org/assem/calling_conventions.pdf">Calling
conventions for different C++ compilers and operating systems</a></li>
</ul>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection"><a name="other">Other relevant lists</a></div>
<div class="doc_text">
<ul>
<li><a href="http://gcc.gnu.org/readings.html">GCC reading list</a></li>
</ul>
</div>
<!-- *********************************************************************** -->
<div class="doc_section"><a name="abi">ABI</a></div>
<!-- *********************************************************************** -->
<!-- ======================================================================= -->
<div class="doc_subsection"><a name="linux">Linux</a></div>
<div class="doc_text">
<ol>
<li><a href="http://www.linuxbase.org/spec/ELF/ppc64/">PowerPC 64-bit ELF ABI
Supplement</a></li>
</ol>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection"><a name="osx">OS X</a></div>
<div class="doc_text">
<ol>
<li><a
href="http://developer.apple.com/documentation/Darwin/RuntimeArchitecture-date.html">Mach-O
Runtime Architecture</a></li>
<li><a href="http://www.unsanity.org/archives/000044.php">Notes on Mach-O
ABI</a></li>
</ol>
</div>
<!-- *********************************************************************** -->
<div class="doc_section"><a name="misc">Miscellaneous resources</a></div>
<!-- *********************************************************************** -->
<ul>
<li><a
href="http://www.nondot.org/sabre/os/articles/ExecutableFileFormats/">Executable
File Format library</a></li>
<li><a href="http://gcc.gnu.org/projects/prefetch.html">GCC prefetch project</a>
page has a good survey of the prefetching capabilities of a variety of modern
processors.</li>
</ul>
<!-- *********************************************************************** -->
<hr>
<address>
<a href="http://jigsaw.w3.org/css-validator/check/referer"><img
src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a>
<a href="http://validator.w3.org/check/referer"><img
src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!"></a>
<a href="http://misha.brukman.net">Misha Brukman</a><br>
<a href="http://llvm.cs.uiuc.edu">LLVM Compiler Infrastructure</a><br>
Last modified: $Date$
</address>
</body>
</html>

View File

@@ -24,7 +24,8 @@
</ol>
<div class="doc_author">
<p>Written by <a href="http://misha.brukman.net">Misha Brukman</a></p>
<p>Written by <a href="http://misha.brukman.net">Misha Brukman</a>,
Brad Jones, and <a href="http://nondot.org/sabre">Chris Lattner</a></p>
</div>
<!-- *********************************************************************** -->
@@ -62,11 +63,6 @@ looking to do can be done with already-existing infrastructure, or if maybe
someone else is already working on it. You will save yourself a lot of time and
effort by doing so.</p>
<p>Finally, these are my notes, and since my extensions are not complete, I may
be missing steps. If you find some omissions, please let me know <a
href="http://misha.brukman.net/contact.html">directly</a> or post on <a
href="http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev">LLVM-dev</a>.</p>
</div>
<!-- *********************************************************************** -->
@@ -90,9 +86,6 @@ function and then be turned into an instruction if warranted.</p>
<li><tt>llvm/include/llvm/Intrinsics.h</tt>:
add an enum in the <tt>llvm::Intrinsic</tt> namespace</li>
<li><tt>llvm/lib/CodeGen/IntrinsicLowering.cpp</tt>:
implement the lowering for this intrinsic</li>
<li><tt>llvm/lib/VMCore/Verifier.cpp</tt>:
Add code to check the invariants of the intrinsic are respected.</li>
@@ -105,15 +98,62 @@ function and then be turned into an instruction if warranted.</p>
of functions.</li>
<li><tt>llvm/lib/Transforms/Utils/Local.cpp</tt>: If it is possible to constant
propagate your intrinsic, add support to it in the
<tt>canConstantFoldCallTo</tt> and <tt>ConstantFoldCall</tt> functions.</li>
fold your intrinsic, add support to it in the <tt>canConstantFoldCallTo</tt> and
<tt>ConstantFoldCall</tt> functions.</li>
<li>Test your intrinsic</li>
<li><tt>llvm/test/Regression/*</tt>: add your test cases to the test suite.</li>
<li><tt>llvm/test/Regression/*</tt>: add your test cases to the test suite</li>
</ol>
<p>If this intrinsic requires code generator support (ie, it cannot be lowered).
You should also add support to the code generator in question.</p>
<p>Once the intrinsic has been added to the system, you must add code generator
support for it. Generally you must do the following steps:</p>
<dl>
<dt>Add support to the C backend in <tt>lib/Target/CBackend/</tt></dt>
<dd>Depending on the intrinsic, there are a few ways to implement this. First,
if it makes sense to lower the intrinsic to an expanded sequence of C code in
all cases, just emit the expansion in <tt>visitCallInst</tt>. Second, if the
intrinsic has some way to express it with GCC (or any other compiler)
extensions, it can be conditionally supported based on the compiler compiling
the CBE output (see llvm.prefetch for an example). Third, if the intrinsic
really has no way to be lowered, just have the code generator emit code that
prints an error message and calls abort if executed.
</dd>
<dt>Add a enum value for the SelectionDAG node in
<tt>include/llvm/CodeGen/SelectionDAGNodes.h</tt></dt>
<dd>Also, add code to <tt>lib/CodeGen/SelectionDAG/SelectionDAG.cpp</tt> (and
<tt>SelectionDAGPrinter.cpp</tt>) to print the node.</dd>
<dt>Add code to <tt>SelectionDAG/SelectionDAGISel.cpp</tt> to recognize the
intrinsic.</dt>
<dd>Presumably the intrinsic should be recognized and turned into the node you
added above.</dd>
<dt>Add code to <tt>SelectionDAG/LegalizeDAG.cpp</tt> to <a
href="CodeGenerator.html#selectiondag_legalize">legalize, promote, and
expand</a> the node as necessary.</dt>
<dd>If the intrinsic can be expanded to primitive operations, legalize can break
the node down into other elementary operations that are be supported.</dd>
<dt>Add target-specific support to specific code generators.</dt>
<dd>Extend the code generators you are interested in to recognize and support
the node, emitting the code you want.</dd>
</dl>
<p>
Unfortunately, the process of extending the code generator to support a new node
is not extremely well documented. As such, it is often helpful to look at other
intrinsics (e.g. <tt>llvm.ctpop</tt>) to see how they are recognized and turned
into a node by <tt>SelectionDAGISel.cpp</tt>, legalized by
<tt>LegalizeDAG.cpp</tt>, then finally emitted by the various code generators.
</p>
</div>
@@ -148,14 +188,23 @@ necessary.</p>
add the grammar on how your instruction can be read and what it will
construct as a result</li>
<li><tt>llvm/lib/Bytecode/Reader/InstructionReader.cpp</tt>:
<li><tt>llvm/lib/Bytecode/Reader/Reader.cpp</tt>:
add a case for your instruction and how it will be parsed from bytecode</li>
<li><tt>llvm/lib/VMCore/Instruction.cpp</tt>:
add a case for how your instruction will be printed out to assembly</li>
<li><tt>llvm/lib/VMCore/Instructions.cpp</tt>:
implement the class you defined in <tt>llvm/include/llvm/Instructions.h</tt></li>
implement the class you defined in
<tt>llvm/include/llvm/Instructions.h</tt></li>
<li>Test your instruction</li>
<li><tt>llvm/lib/Target/*</tt>:
Add support for your instruction to code generators, or add a lowering
pass.</li>
<li><tt>llvm/test/Regression/*</tt>: add your test cases to the test suite.</li>
</ol>
@@ -188,11 +237,8 @@ installations.</span> Only add new types if it is absolutely necessary.</p>
<ol>
<li><tt>llvm/include/llvm/Type.def</tt>:
add enum for the type</li>
<li><tt>llvm/include/llvm/Type.h</tt>:
add ID number for the new type; add static <tt>Type*</tt> for this type</li>
add enum for the new type; add static <tt>Type*</tt> for this type</li>
<li><tt>llvm/lib/VMCore/Type.cpp</tt>:
add mapping from <tt>TypeID</tt> =&gt; <tt>Type*</tt>;
@@ -215,7 +261,53 @@ installations.</span> Only add new types if it is absolutely necessary.</p>
<div class="doc_text">
<p>TODO</p>
<ol>
<li><tt>llvm/include/llvm/Type.h</tt>:
add enum for the new type; add a forward declaration of the type
also</li>
<li><tt>llvm/include/llvm/DerivedType.h</tt>:
add new class to represent new class in the hierarchy; add forward
declaration to the TypeMap value type</li>
<li><tt>llvm/lib/VMCore/Type.cpp</tt>:
add support for derived type to:
<div class="doc_code">
<pre>
std::string getTypeDescription(const Type &amp;Ty,
std::vector&lt;const Type*&gt; &amp;TypeStack)
bool TypesEqual(const Type *Ty, const Type *Ty2,
std::map&lt;const Type*, const Type*&gt; &amp; EqTypes)
</pre>
</div>
add necessary member functions for type, and factory methods</li>
<li><tt>llvm/lib/AsmReader/Lexer.l</tt>:
add ability to parse in the type from text assembly</li>
<li><tt>llvm/lib/ByteCode/Writer/Writer.cpp</tt>:
modify <tt>void BytecodeWriter::outputType(const Type *T)</tt> to serialize
your type</li>
<li><tt>llvm/lib/ByteCode/Reader/Reader.cpp</tt>:
modify <tt>const Type *BytecodeReader::ParseType()</tt> to read your data
type</li>
<li><tt>llvm/lib/VMCore/AsmWriter.cpp</tt>:
modify
<div class="doc_code">
<pre>
void calcTypeName(const Type *Ty,
std::vector&lt;const Type*&gt; &amp;TypeStack,
std::map&lt;const Type*,std::string&gt; &amp;TypeNames,
std::string &amp; Result)
</pre>
</div>
to output the new derived type
</li>
</ol>
</div>
@@ -228,7 +320,6 @@ installations.</span> Only add new types if it is absolutely necessary.</p>
<a href="http://validator.w3.org/check/referer"><img
src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /></a>
<a href="http://misha.brukman.net">Misha Brukman</a><br>
<a href="http://llvm.cs.uiuc.edu">The LLVM Compiler Infrastructure</a>
<br>
Last modified: $Date$

View File

@@ -51,6 +51,8 @@
<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>
<li>After CVS update, rebuilding gives the error "No rule to make
target".</li>
</ol></li>
<li><a href="#cfe">Using the GCC Front End</a>
@@ -65,17 +67,23 @@
When I compile code using the LLVM GCC front end, it complains that it
cannot find libcrtend.a.
</li>
<li>
How can I disable all optimizations when compiling code using the LLVM GCC front end?
</li>
</ol>
</li>
<li><a href="#cfe_code">Questions about code generated by the GCC front-end</a>
<ol>
<li>What is this <tt>__main()</tt> call that gets inserted into
<tt>main()</tt>?</li>
<li>Where did all of my code go??</li>
<li>What is this <tt>llvm.global_ctors</tt> and
<li><a href="#__main">What is this <tt>__main()</tt> call that gets inserted into
<tt>main()</tt>?</a></li>
<li><a href="#iosinit">What is this <tt>llvm.global_ctors</tt> and
<tt>_GLOBAL__I__tmp_webcompile...</tt> stuff that happens when I
#include &lt;iostream&gt;?</li>
#include &lt;iostream&gt;?</a></li>
<li><a href="#codedce">Where did all of my code go??</a></li>
<li><a href="#undef">What is this "<tt>undef</tt>" thing that shows up in my code?</a></li>
</ol>
</li>
</ol>
@@ -121,7 +129,7 @@ Source Initiative (OSI).</p>
<div class="answer">
<p>Yes. The modified source distribution must retain the copyright notice and
follow the three bulletted conditions listed in the <a
href="http://llvm.cs.uiuc.edu/releases/1.2/LICENSE.TXT">LLVM license</a>.</p>
href="http://llvm.cs.uiuc.edu/releases/1.3/LICENSE.TXT">LLVM license</a>.</p>
</div>
<div class="question">
@@ -166,10 +174,6 @@ LLVM have been ported to a plethora of platforms.</p>
<li>The GCC front end code is not as portable as the LLVM suite, so it may not
compile as well on unsupported platforms.</li>
<li>The Python test classes are more UNIX-centric than they should be, so
porting to non-UNIX like platforms (i.e. Windows, MacOS 9) will require some
effort.</li>
<li>The LLVM build system relies heavily on UNIX shell tools, like the Bourne
Shell and sed. Porting to systems without these tools (MacOS 9, Plan 9) will
require more effort.</li>
@@ -349,28 +353,34 @@ build.</p>
</div>
<div class="question">
<p>
When I use the test suite, all of the C Backend tests fail. What is
wrong?
</p>
<p>After CVS update, rebuilding gives the error "No rule to make target".</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>If the error is of the form:</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 class="doc_code">
<tt>
gmake[2]: *** No rule to make target `/path/to/somefile', needed by
`/path/to/another/file.d'.<br>
Stop.
</tt>
</div>
<p>This may occur anytime files are moved within the CVS repository or removed
entirely. In this case, the best solution is to erase all <tt>.d</tt> files,
which list dependencies for source files, and rebuild:</p>
<div class="doc_code">
<pre>
% cd $LLVM_OBJ_DIR
% rm -f `find . -name \*\.d`
% gmake
</pre>
</div>
<p>In other cases, it may be necessary to run <tt>make clean</tt> before
rebuilding.</p>
</div>
<!-- *********************************************************************** -->
@@ -429,13 +439,27 @@ find libcrtend.a.
<div class="answer">
<p>
In order to find libcrtend.a, you must have the directory in which it lives in
your LLVM_LIB_SEARCH_PATH environment variable. For the binary distribution of
the LLVM GCC front end, this will be the full path of the bytecode-libs
directory inside of the LLVM GCC distribution.
The only way this can happen is if you haven't installed the runtime library. To
correct this, do:</p>
<pre>
% cd llvm/runtime
% make clean ; make install-bytecode
</pre>
</div>
<div class="question">
<p>
How can I disable all optimizations when compiling code using the LLVM GCC front end?
</p>
</div>
<div class="answer">
<p>
Passing "-Wa,-disable-opt -Wl,-disable-opt" will disable *all* cleanup and
optimizations done at the llvm level, leaving you with the truly horrible
code that you desire.
</p>
</div>
<!-- *********************************************************************** -->
<div class="doc_section">
@@ -443,6 +467,7 @@ directory inside of the LLVM GCC distribution.
</div>
<div class="question"><p>
<a name="__main"></a>
What is this <tt>__main()</tt> call that gets inserted into <tt>main()</tt>?
</p></div>
@@ -464,7 +489,40 @@ linked in automatically when you link the program.
<!--=========================================================================-->
<div class="question">
<a name="iosinit"></a>
<p> What is this <tt>llvm.global_ctors</tt> and
<tt>_GLOBAL__I__tmp_webcompile...</tt> stuff that happens when I #include
&lt;iostream&gt;?</p>
</div>
<div class="answer">
<p>If you #include the &lt;iostream&gt; header into a C++ translation unit, the
file will probably use the <tt>std::cin</tt>/<tt>std::cout</tt>/... global
objects. However, C++ does not guarantee an order of initialization between
static objects in different translation units, so if a static ctor/dtor in your
.cpp file used <tt>std::cout</tt>, for example, the object would not necessarily
be automatically initialized before your use.</p>
<p>To make <tt>std::cout</tt> and friends work correctly in these scenarios, the
STL that we use declares a static object that gets created in every translation
unit that includes <tt>&lt;iostream&gt;</tt>. This object has a static
constructor and destructor that initializes and destroys the global iostream
objects before they could possibly be used in the file. The code that you see
in the .ll file corresponds to the constructor and destructor registration code.
</p>
<p>If you would like to make it easier to <b>understand</b> the LLVM code
generated by the compiler in the demo page, consider using <tt>printf()</tt>
instead of <tt>iostream</tt>s to print values.</p>
</div>
<!--=========================================================================-->
<div class="question"><p>
<a name="codedce"></a>
Where did all of my code go??
</p></div>
@@ -487,32 +545,22 @@ you can read from and assign to <tt>volatile</tt> global variables.
<!--=========================================================================-->
<div class="question"><p>
What is this <tt>llvm.global_ctors</tt> and <tt>_GLOBAL__I__tmp_webcompile...</tt> stuff that happens when I #include &lt;iostream&gt;?
<a name="undef"></a>
<p>What is this "<tt>undef</tt>" thing that shows up in my code?
</p></div>
<div class="answer">
<p>
If you #include the &lt;iostream&gt; header into a C++ translation unit, the
file will probably use the <tt>std::cin</tt>/<tt>std::cout</tt>/... global
objects. However, C++ does not guarantee an order of initialization between
static objects in different translation units, so if a static ctor/dtor in your
.cpp file used <tt>std::cout</tt>, for example, the object would not necessarily
be automatically initialized before your use.
</p>
<a href="LangRef.html#undef"><tt>undef</tt></a> is the LLVM way of representing
a value that is not defined. You can get these if you do not initialize a
variable before you use it. For example, the C function:</p>
<p>
To make <tt>std::cout</tt> and friends work correctly in these scenarios, the
STL that we use declares a static object that gets created in every translation
unit that includes &lt;iostream&gt;. This object has a static constructor and
destructor that initializes and destroys the global iostream objects before they
could possibly be used in the file. The code that you see in the .ll file
corresponds to the constructor and destructor registration code.
</p>
<div class="doc_code">
<tt>int X() { int i; return i; }</tt>
</div>
<p>
If you would like to make it easier to <b>understand</b> the LLVM code generated
by the compiler in the demo page, consider using printf instead of iostreams to
print values.
<p>Is compiled to "<tt>ret int undef</tt>" because "i" never has a value
specified for it.
</p>
</div>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,360 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Getting Started with LLVM System for Microsoft Visual Studio</title>
<link rel="stylesheet" href="llvm.css" type="text/css">
</head>
<body>
<div class="doc_title">
Getting Started with the LLVM System using Microsoft Visual Studio
</div>
<ul>
<li><a href="#overview">Overview</a>
<li><a href="#quickstart">Getting Started Quickly (A Summary)</a>
<li><a href="#requirements">Requirements</a>
<ol>
<li><a href="#hardware">Hardware</a>
<li><a href="#software">Software</a>
</ol></li>
<li><a href="#starting">Getting Started with LLVM</a>
<ol>
<li><a href="#terminology">Terminology and Notation</a>
<li><a href="#objfiles">The Location of LLVM Object Files</a>
</ol></li>
<li><a href="#tutorial">An Example Using the LLVM Tool Chain</a>
<li><a href="#problems">Common Problems</a>
<li><a href="#links">Links</a>
</ul>
<div class="doc_author">
<p>Written by:
<a href="mailto:jeffc@jolt-lang.org">Jeff Cohen</a>
</p>
</div>
<!-- *********************************************************************** -->
<div class="doc_section">
<a name="overview"><b>Overview</b></a>
</div>
<!-- *********************************************************************** -->
<div class="doc_text">
<p>The Visual Studio port at this time is experimental. It is suitable for
use only if you are writing your own compiler front end or otherwise have a
need to dynamically generate machine code. The JIT and interpreter are
functional, but it is currently not possible to generate assembly code which
is then assembled into an executable. You can indirectly create executables
by using the C back end.</p>
<p>To emphasize, there is no C/C++ front end currently available.
<tt>llvm-gcc</tt> is based on GCC, which cannot be bootstrapped using VC++.
Eventually there should be a <tt>llvm-gcc</tt> based on Cygwin or MinGW that
is usable. There is also the option of generating bytecode files on Unix and
copying them over to Windows. But be aware the odds of linking C++ code
compiled with <tt>llvm-gcc</tt> with code compiled with VC++ is essentially
zero.</p>
<p>The LLVM test suite cannot be run on the Visual Studio port at this
time.</p>
<p>Most of the tools build and work. <tt>llvm-db</tt> does not build at this
time. <tt>bugpoint</tt> does build, but does not work.
<p>Additional information about the LLVM directory structure and tool chain
can be found on the main <a href="GettingStarted.html">Getting Started</a>
page.</P>
</div>
<!-- *********************************************************************** -->
<div class="doc_section">
<a name="quickstart"><b>Getting Started Quickly (A Summary)</b></a>
</div>
<!-- *********************************************************************** -->
<div class="doc_text">
<p>Here's the short story for getting up and running quickly with LLVM:</p>
<ol>
<li>Read the documentation.</li>
<li>Read the documentation.</li>
<li>Remember that you were warned twice about reading the documentation.</li>
<li>Get the Source Code
<ul>
<li>With the distributed files:
<ol>
<li><tt>cd <i>where-you-want-llvm-to-live</i></tt>
<li><tt>gunzip --stdout llvm-<i>version</i>.tar.gz | tar -xvf -</tt>
<i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;or use WinZip</i>
<li><tt>cd llvm</tt></li>
</ol></li>
<li>With anonymous CVS access (or use a <a href="#mirror">mirror</a>):
<ol>
<li><tt>cd <i>where-you-want-llvm-to-live</i></tt></li>
<li><tt>cvs -d
:pserver:anon@llvm-cvs.cs.uiuc.edu:/var/cvs/llvm login</tt></li>
<li>Hit the return key when prompted for the password.
<li><tt>cvs -z3 -d :pserver:anon@llvm-cvs.cs.uiuc.edu:/var/cvs/llvm
co llvm</tt></li>
<li><tt>cd llvm</tt></li>
<li><tt>cvs up -P -d</tt></li>
</ol></li>
</ul></li>
<li>Start Visual Studio
<ol>
<li>Simply double click on the solution file <tt>llvm/win32/llvm.sln</tt>.
</li>
</ol></li>
<li>Build the LLVM Suite:
<ol>
<li>Simply build the solution.</li>
<li>The Fibonacci project is a sample program that uses the JIT. Modify
the project's debugging properties to provide a numeric command line
argument. The program will print the corresponding fibonacci value.</li>
</ol></li>
</ol>
<p>It is strongly encouraged that you get the latest version from CVS. Much
progress has been made since the 1.4 release.</p>
</div>
<!-- *********************************************************************** -->
<div class="doc_section">
<a name="requirements"><b>Requirements</b></a>
</div>
<!-- *********************************************************************** -->
<div class="doc_text">
<p>Before you begin to use the LLVM system, review the requirements given
below. This may save you some trouble by knowing ahead of time what hardware
and software you will need.</p>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection">
<a name="hardware"><b>Hardware</b></a>
</div>
<div class="doc_text">
<p>Any system that can adequately run Visual Studio .NET 2003 is fine. The
LLVM source tree and object files, libraries and executables will consume
approximately 3GB.</p>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection"><a name="software"><b>Software</b></a></div>
<div class="doc_text">
<p>You will need Visual Studio .NET 2003. Earlier versions cannot open the
solution/project files. The VS 2005 beta can, but will migrate these files
to its own format in the process. While it should work with the VS 2005
beta, there are no guarantees and there is no support for it at this time.
It has been reported that VC++ Express also works.</p>
<p>You will also need several open source packages: bison, flex, and sed.
These must be installed in <tt>llvm/win32/tools</tt>. These can be found at
<a href="http://gnuwin32.sourceforge.net">http://gnuwin32.sourceforge.net</a>
or
<a href="http://unxutils.sourceforge.net">http://unxutils.sourceforge.net</a>.
Bison prefers that m4 be in the path. You must add it to the Visual Studio
configuration under the menu Options -&gt; Projects -&gt; VC++ Directories.
Alternatively, you can set the environment variable <tt>M4</tt> to point to
<tt>m4</tt> executable.</p>
</div>
<!-- *********************************************************************** -->
<div class="doc_section">
<a name="starting"><b>Getting Started with LLVM</b></a>
</div>
<!-- *********************************************************************** -->
<div class="doc_text">
<p>The remainder of this guide is meant to get you up and running with
LLVM using Visual Studio and to give you some basic information about the LLVM
environment.</p>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection">
<a name="terminology">Terminology and Notation</a>
</div>
<div class="doc_text">
<p>Throughout this manual, the following names are used to denote paths
specific to the local system and working environment. <i>These are not
environment variables you need to set but just strings used in the rest
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.
All these paths are absolute:</p>
<dl>
<dt>SRC_ROOT
<dd>
This is the top level directory of the LLVM source tree.
<p>
<dt>OBJ_ROOT
<dd>
This is the top level directory of the LLVM object tree (i.e. the
tree where object files and compiled programs will be placed. It
is fixed at SRC_ROOT/win32).
<p>
</dl>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection">
<a name="objfiles">The Location of LLVM Object Files</a>
</div>
<div class="doc_text">
<p>The object files are placed under <tt>OBJ_ROOT/Debug</tt> for debug builds
and <tt>OBJ_ROOT/Release</tt> for release (optimized) builds. These include
both executables and libararies that your application can link against.
<p>The files that <tt>configure</tt> would create when building on Unix are
created by the <tt>Configure</tt> project and placed in
<tt>OBJ_ROOT/llvm</tt>. You application must have OBJ_ROOT in its include
search path just before <tt>SRC_ROOT/include</tt>.
</div>
<!-- *********************************************************************** -->
<div class="doc_section">
<a name="tutorial">An Example Using the LLVM Tool Chain</a>
</div>
<!-- *********************************************************************** -->
<div class="doc_text">
<ol>
<li>First, create a simple C file, name it 'hello.c':
<pre>
#include &lt;stdio.h&gt;
int main() {
printf("hello world\n");
return 0;
}
</pre></li>
<li><p>Next, compile the C file into a LLVM bytecode file:</p>
<p><tt>% llvm-gcc hello.c -o hello</tt></p>
<p>Note that you should have already built the tools and they have to be
in your path, at least <tt>gccas</tt> and <tt>gccld</tt>.</p>
<p>This will create two result files: <tt>hello</tt> and
<tt>hello.bc</tt>. The <tt>hello.bc</tt> is the LLVM bytecode that
corresponds the the compiled program and the library facilities that it
required. <tt>hello</tt> is a simple shell script that runs the bytecode
file with <tt>lli</tt>, making the result directly executable. Note that
all LLVM optimizations are enabled by default, so there is no need for a
"-O3" switch.</p>
<p><b>Note: while you cannot do this step on Windows, you can do it on a
Unix system and transfer <tt>hello.bc</tt> to Windows.</b></p></li>
<li><p>Run the program. To make sure the program ran, execute the
following command:</p>
<p><tt>% lli hello.bc</tt></p></li>
<li><p>Use the <tt>llvm-dis</tt> utility to take a look at the LLVM assembly
code:</p>
<p><tt>% llvm-dis &lt; hello.bc | less</tt><p></li>
<li><p>Compile the program to native assembly using the LLC code
generator:</p>
<p><tt>% llc hello.bc -o hello.s</tt></p>
<li><p>Assemble the native assembly language file into a program:</p>
<p><b>Not currently possible, but eventually will use <tt>NASMW</tt>.</b></p>
<li><p>Execute the native code program:</p>
<p><tt>% ./hello.native</tt></p></li>
</ol>
</div>
<!-- *********************************************************************** -->
<div class="doc_section">
<a name="problems">Common Problems</a>
</div>
<!-- *********************************************************************** -->
<div class="doc_text">
<p>If you are having problems building or using LLVM, or if you have any other
general questions about LLVM, please consult the <a href="FAQ.html">Frequently
Asked Questions</a> page.</p>
</div>
<!-- *********************************************************************** -->
<div class="doc_section">
<a name="links">Links</a>
</div>
<!-- *********************************************************************** -->
<div class="doc_text">
<p>This document is just an <b>introduction</b> to how to use LLVM to do
some simple things... there are many more interesting and complicated things
that you can do that aren't documented here (but we'll gladly accept a patch
if you want to write something up!). For more information about LLVM, check
out:</p>
<ul>
<li><a href="http://llvm.cs.uiuc.edu/">LLVM homepage</a></li>
<li><a href="http://llvm.cs.uiuc.edu/doxygen/">LLVM doxygen tree</a></li>
<li><a href="http://llvm.cs.uiuc.edu/docs/Projects.html">Starting a Project
that Uses LLVM</a></li>
</ul>
</div>
<!-- *********************************************************************** -->
<hr>
<address>
<a href="http://jigsaw.w3.org/css-validator/check/referer"><img
src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a>
<a href="http://validator.w3.org/check/referer"><img
src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /></a>
<a href="mailto:jeffc@jolt-lang.org">Jeff Cohen</a><br>
<a href="http://llvm.cs.uiuc.edu">The LLVM Compiler Infrastructure</a><br>
Last modified: $Date$
</address>
</body>
</html>

View File

@@ -11,10 +11,9 @@
How to submit an LLVM bug report
</div>
<table border="0" width="100%">
<tr>
<td valign="top">
<table class="layout" style="width: 90%" >
<tr class="layout">
<td class="left">
<ol>
<li><a href="#introduction">Introduction - Got bugs?</a></li>
<li><a href="#crashers">Crashing Bugs</a>
@@ -26,16 +25,13 @@
</ul></li>
<li><a href="#miscompilations">Miscompilations</a></li>
<li><a href="#codegen">Incorrect code generation (JIT and LLC)</a></li>
</ol>
<div class="doc_author">
<p>Written by <a href="mailto:sabre@nondot.org">Chris Lattner</a> and
<a href="http://misha.brukman.net">Misha Brukman</a></p>
</div>
</td>
<td align="right">
<td class="right">
<img src="img/Debugging.gif" alt="Debugging" width="444" height="314">
</td>
</tr>

File diff suppressed because it is too large Load Diff

172
llvm/docs/Lexicon.html Normal file
View File

@@ -0,0 +1,172 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>The LLVM Lexicon</title>
<link rel="stylesheet" href="llvm.css" type="text/css">
<meta name="author" content="Various">
<meta name="description"
content="A glossary of terms used with the LLVM project.">
</head>
<body>
<div class="doc_title">The LLVM Lexicon</div>
<p class="doc_warning">NOTE: This document is a work in progress!</p>
<!-- *********************************************************************** -->
<div class="doc_section">Table Of Contents</div>
<!-- *********************************************************************** -->
<div class="doc_text">
<table>
<tr><th colspan="8"><b>- <a href="#A">A</a> -</b></th></tr>
<tr>
<td><a href="#ADCE">ADCE</a></td>
</tr>
<tr><th colspan="8"><b>- <a href="#B">B</a> -</b></th></tr>
<tr>
<td><a href="#BURS">BURS</a></td>
</tr>
<tr><th colspan="8"><b>- <a href="#C">C</a> -</b></th></tr>
<tr>
<td><a href="#CSE">CSE</a></td>
</tr>
<tr><th colspan="8"><b>- <a href="#D">D</a> -</b></th></tr>
<tr>
<td><a href="#DSA">DSA</a></td>
<td><a href="#DSE">DSE</a></td>
</tr>
<tr><th colspan="8"><b>- <a href="#I">I</a> -</b></th></tr>
<tr>
<td><a href="#IPA">IPA</a></td>
<td><a href="#IPO">IPO</a></td>
</tr>
<tr><th colspan="8"><b>- <a href="#L">L</a> -</b></th></tr>
<tr>
<td><a href="#LICM">LICM</a></td>
<td><a href="#Load-VN">Load-VN</a></td>
</tr>
<tr><th colspan="8"><b>- <a href="#P">P</a> -</b></th></tr>
<tr>
<td><a href="#PRE">PRE</a></td>
</tr>
<tr><th colspan="8"><b>- <a href="#R">R</a> -</b></th></tr>
<tr>
<td><a href="#Reassociation">Reassociation</a></td>
</tr>
<tr><th colspan="8"><b>- <a href="#S">S</a> -</b></th></tr>
<tr>
<td><a href="#SCCP">SCCP</a></td>
<td><a href="#SSA">SSA</a></td>
</tr>
</table>
</div>
<!-- *********************************************************************** -->
<div class="doc_section">Definitions</div>
<!-- *********************************************************************** -->
<!-- _______________________________________________________________________ -->
<div class="doc_subsection"><a name="A">- A -</a></div>
<div class="doc_text">
<dl>
<dt><a name="ADCE"><b>ADCE</b></a></dt>
<dd>Aggressive Dead Code Elimination</dd>
</dl>
</div>
<!-- _______________________________________________________________________ -->
<div class="doc_subsection"><a name="B">- B -</a></div>
<div class="doc_text">
<dl>
<dt><a name="BURS"><b>BURS</b></a></dt>
<dd>Bottom Up Rewriting System - A method of instruction selection for
code generation. An example is the <a
href="http://www.program-transformation.org/Transform/BURG">BURG</a> tool.</dd>
</dl>
</div>
<!-- _______________________________________________________________________ -->
<div class="doc_subsection"><a name="C">- C -</a></div>
<div class="doc_text">
<dl>
<dt><a name="CSE"><b>CSE</b></a></dt>
<dd>Common Subexpression Elimination. An optimization that removes common
subexpression compuation. For example <tt>(a+b)*(a+b)</tt> has two
subexpressions that are the same: <tt>(a+b)</tt>. This optimization would
perform the addition only once and then perform the multiply (but only if
its compulationally correct/safe).
</dl>
</div>
<!-- _______________________________________________________________________ -->
<div class="doc_subsection"><a name="D">- D -</a></div>
<div class="doc_text">
<dl>
<dt><a name="DSA"><b>DSA</b></a></dt>
<dd>Data Structure Analysis</dd>
<dt><a name="DSE"><b>DSE</b></a></dt>
<dd>Dead Store Elimination</dd>
</dl>
</div>
<!-- _______________________________________________________________________ -->
<div class="doc_subsection"><a name="I">- I -</a></div>
<div class="doc_text">
<dl>
<dt><a name="IPA"><b>IPA</b></a></dt>
<dd>Inter-Procedural Analysis. Refers to any variety of code analysis that
occurs between procedures, functions or compilation units (modules).</dd>
<dt><a name="IPO"><b>IPO</b></a></dt>
<dd>Inter-Procedural Optimization. Refers to any variety of code
optimization that occurs between procedures, functions or compilation units
(modules).</dd>
</dl>
</div>
<!-- _______________________________________________________________________ -->
<div class="doc_subsection"><a name="L">- L -</a></div>
<div class="doc_text">
<dl>
<dt><a name="LICM"><b>LICM</b></a></dt>
<dd>Loop Invariant Code Motion</dd>
<dt><a name="Load-VN"><b>Load-VN</b></a></dt>
<dd>Load Value Numbering</dd>
</dl>
</div>
<!-- _______________________________________________________________________ -->
<div class="doc_subsection"><a name="P">- P -</a></div>
<div class="doc_text">
<dl>
<dt><a name="PRE"><b>PRE</b></a></dt>
<dd>Partial Redundancy Elimination</dd>
</dl>
</div>
<!-- _______________________________________________________________________ -->
<div class="doc_subsection"><a name="R">- R -</a></div>
<div class="doc_text">
<dl>
<dt><a name="Reassociation"><b>Reassociation</b></a></dt> <dd>Rearranging
associative expressions to promote better redundancy elimination and other
optimization. For example, changing (A+B-A) into (B+A-A), permitting it to
be optimized into (B+0) then (B).
</dl>
</div>
<!-- _______________________________________________________________________ -->
<div class="doc_subsection"><a name="S">- S -</a></div>
<div class="doc_text">
<dl>
<dt><a name="SCCP"><b>SCCP</b></a></dt>
<dd>Sparse Conditional Constant Propagation
<dt><a name="SSA"><b>SSA</b></a></dt>
<dd>Static Single Assignment</dd>
</dl>
</div>
<!-- *********************************************************************** -->
<hr>
<address> <a href="http://jigsaw.w3.org/css-validator/check/referer"><img
src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a><a
href="http://validator.w3.org/check/referer"><img
src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!"></a><a
href="http://llvm.cs.uiuc.edu/">The LLVM Team</a><br>
<a href="http://llvm.cs.uiuc.edu">The LLVM Compiler Infrastructure</a><br>
Last modified: $Date$
</address>
<!-- vim: sw=2
-->
</body>
</html>

View File

@@ -6,9 +6,61 @@
# the University of Illinois Open Source License. See LICENSE.TXT for details.
#
##===----------------------------------------------------------------------===##
doxygen-files:
doxygen doxygen.cfg
doxygen.tar.gz: doxygen/index.html
rm -rf $@
gtar czvf $@ doxygen
LEVEL := ..
DIRS := CommandGuide
include $(LEVEL)/Makefile.common
HTML := $(wildcard $(PROJ_SRC_DIR)/*.html) \
$(wildcard $(PROJ_SRC_DIR)/*.css)
IMAGES := $(wildcard $(PROJ_SRC_DIR)/img/*.*)
DOXYFILES := doxygen.cfg.in doxygen.css doxygen.footer doxygen.header \
doxygen.intro
EXTRA_DIST := $(HTML) $(DOXYFILES) llvm.css CommandGuide img
.PHONY: install-html install-doxygen doxygen
ifeq ($(ENABLE_DOXYGEN),1)
install-local:: install-html install-doxygen
else
install-local:: install-html
endif
install-html: $(PROJ_OBJ_DIR)/html.tar.gz
$(Echo) Installing HTML documentation
$(Verb) $(MKDIR) $(PROJ_docsdir)/html
$(Verb) $(MKDIR) $(PROJ_docsdir)/html/img
$(Verb) $(DataInstall) $(HTML) $(PROJ_docsdir)/html
$(Verb) $(DataInstall) $(IMAGES) $(PROJ_docsdir)/html/img
$(Verb) $(DataInstall) $(PROJ_OBJ_DIR)/html.tar.gz $(PROJ_docsdir)
$(PROJ_OBJ_DIR)/html.tar.gz: $(HTML)
$(Echo) Packaging HTML documentation
$(Verb) $(RM) -rf $@ $(PROJ_OBJ_DIR)/html.tar
$(Verb) cd $(PROJ_SRC_DIR) && \
$(TAR) cf $(PROJ_OBJ_DIR)/html.tar *.html
$(Verb) $(GZIP) $(PROJ_OBJ_DIR)/html.tar
install-doxygen: doxygen
$(Echo) Installing doxygen documentation
$(Echo) Installing doxygen documentation
$(Verb) $(MKDIR) $(PROJ_docsdir)/html/doxygen
$(Verb) $(DataInstall) $(PROJ_OBJ_DIR)/doxygen.tar.gz $(PROJ_docsdir)
$(Verb) cd $(PROJ_OBJ_DIR)/doxygen && \
$(FIND) . -type f -exec \
$(DataInstall) {} $(PROJ_docsdir)/html/doxygen \;
doxygen: $(PROJ_OBJ_DIR)/doxygen.tar.gz
$(PROJ_OBJ_DIR)/doxygen.tar.gz: $(DOXYFILES) $(PROJ_OBJ_DIR)/doxygen.cfg
$(Echo) Building doxygen documentation
$(Verb) if test -e $(PROJ_OBJ_DIR)/doxygen ; then \
$(RM) -rf $(PROJ_OBJ_DIR)/doxygen ; \
fi
$(Verb) $(DOXYGEN) $(PROJ_OBJ_DIR)/doxygen.cfg
$(Echo) Packaging doxygen documentation
$(Verb) $(RM) -rf $@ $(PROJ_OBJ_DIR)/doxygen.tar
$(Verb) $(TAR) cf $(PROJ_OBJ_DIR)/doxygen.tar doxygen
$(Verb) $(GZIP) $(PROJ_OBJ_DIR)/doxygen.tar

1006
llvm/docs/MakefileGuide.html Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,300 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>
<head>
<title>Object Files: Understanding The Result Of LLVM Compilation</title>
<link rel="stylesheet" href="llvm.css" type="text/css">
</head>
<body>
<div class="doc_title">Object Files: Understanding The Result Of LLVM Compilation</div>
<hr>
<ol>
<li><a href="#abstract">Abstract</a></li>
<li><a href="#introduction">Introduction</a></li>
<li><a href="#files">File Contents</a></li>
<li><a href="#rot">Linkage Rules Of Thumb</a>
<ol>
<li><a href="#always">Always Link vmcore.o, support.a</a>
<li><a href="#placeholder">Placeholder</a>
</ol>
</li>
</ol>
<div class="doc_author">
<p>Written by <a href="mailto:rspencer@x10sys.com">Reid Spencer</a></p>
</div>
<hr>
<!-- ======================================================================= -->
<div class="doc_section"><a name="abstract">Abstract</a></div>
<div class="doc_text">
<p>This document describes the contents of the many objects files and libraries
that are produced by compiling LLVM. To make use of LLVM this information is
needed in order to understand what files should be linked into your program.
</p>
</div>
<!-- ======================================================================= -->
<div class="doc_section"> <a name="introduction">Introduction</a></div>
<div class="doc_text">
<p>If you're writing a compiler, virtual machine, or any other utility for
LLVM, you'll need to figure out which of the many .a (archive) and .o
(object) files you will need to link with to be successful. An
understanding of the contents of these files and their inter-relationships
will be useful in coming up with an optimal specification for the objects
and libraries to link with.
</p>
<p>The purpose of this document is to hopefully reduce some of the trial and
error that the author experienced in using LLVM.
</p>
</div>
<!-- ======================================================================= -->
<div class="doc_section"><a name="files"></a>File Contents</div>
<div class="doc_text">
<p>The table below provides a summary of the basic contents of each file.</p>
<table class="doc_table"
style="width:80%; text-align: left; border: 2px solid blue; border-collapse: collapse;">
<tr class="doc_table">
<td colspan="2" class="doc_section">Summary Of LLVM Library And Object Files
</td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue"><h2><u>Library</u></h2></td>
<td style="border: 2px solid blue"><h2><u>Description</u></h2></td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue">libipo.a</td>
<td style="border: 2px solid blue">
An archive of all inter-procedural optimizations.
</td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue">libscalaropts.a</td>
<td style="border: 2px solid blue">
An archive of all scalar optimizations.
</td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue">libtransforms.a</td>
<td style="border: 2px solid blue">
An archive of just the level raise pass.
</td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue">libtarget.a</td>
<td style="border: 2px solid blue">
An archive containing code generator support for describing
target architectures.
</td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue">libanalysis.a</td>
<td style="border: 2px solid blue">
An archive containing intra-procedural analyses.
</td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue">libdatastructure.a</td>
<td style="border: 2px solid blue">
An archive containing optimizations for data structures.
</td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue">libinstrument.a</td>
<td style="border: 2px solid blue">No idea.</td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue">libregalloc.a</td>
<td style="border: 2px solid blue">Register Allocation code.</td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue">libipa.a</td>
<td style="border: 2px solid blue">
An archive containing inter-procedural analyses</td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue">libtransformutils.a</td>
<td style="border: 2px solid blue">
Utiltities for transformations?
</td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue">libsupport.a</td>
<td style="border: 2px solid blue">General support utilities</td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue">libevar.a</td>
<td style="border: 2px solid blue">Live variable analysis for SPARC</td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue"><h2><u>Object File</u></h2></td>
<td style="border: 2px solid blue"><h2><u>Description</u></h2></td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue">support.o</td>
<td style="border: 2px solid blue">General support utilities</td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue">asmparser.o</td>
<td style="border: 2px solid blue">Assembler Parser</td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue">bcreader.o</td>
<td style="border: 2px solid blue">Byte Code Reader</td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue">bcwriter.o</td>
<td style="border: 2px solid blue">Byte Code Writer</td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue">sched.o</td>
<td style="border: 2px solid blue">SPARC instruction scheduler</td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue">selectiondag.o</td>
<td style="border: 2px solid blue">Aggressive instruction selector for Directed Acyclic Graphs</td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue">transformutils.o</td>
<td style="border: 2px solid blue">Utilities for code transformations</td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue">ipa.o</td>
<td style="border: 2px solid blue">Inter-Procedural Analysis Optimizations</td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue">select.o</td>
<td style="border: 2px solid blue">SPARC instruction selector</td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue">cwriter.o</td>
<td style="border: 2px solid blue">"C" Code Writer</td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue">profpaths.o</td>
<td style="border: 2px solid blue">Path profiling instrumentation</td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue">regalloc.o</td>
<td style="border: 2px solid blue">Register Allocation</td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue">instrument.o</td>
<td style="border: 2px solid blue">Instrumentation? Of What?</td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue">datastructure.o</td>
<td style="border: 2px solid blue">Data Structure Analysis</td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue">codegen.o</td>
<td style="border: 2px solid blue">Native code generation</td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue">livevar.o</td>
<td style="border: 2px solid blue">Live Variable Analysis</td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue">vmcore.o</td>
<td style="border: 2px solid blue">Virtual Machine Core</td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue">lli-interpreter.o</td>
<td style="border: 2px solid blue">Interpreter for LLVM ByteCode</td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue">lli-jit.o</td>
<td style="border: 2px solid blue">
Just-In-Time Compiler For LLVM ByteCode
</td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue">executionengine.o</td>
<td style="border: 2px solid blue">Engine for LLI</td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue">debugger.o</td>
<td style="border: 2px solid blue">Source Level Debugging Support</td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue">analysis.o</td>
<td style="border: 2px solid blue">General Framework For Analysis?</td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue">sparc.o</td>
<td style="border: 2px solid blue">Sun SPARC Processor Specific</td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue">target.o</td>
<td style="border: 2px solid blue">Target Machine Support?</td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue">transforms.o</td>
<td style="border: 2px solid blue">Code Transformations</td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue">x86.o</td>
<td style="border: 2px solid blue">Intel x86 Processor Specific</td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue">powerpc.o</td>
<td style="border: 2px solid blue">PowerPC Processor Specific</td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue">scalaropts.o</td>
<td style="border: 2px solid blue">Optimizations For Scalars</td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue">ipo.o</td>
<td style="border: 2px solid blue">Inter-Procedural Optimization</td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue">trace.o</td>
<td style="border: 2px solid blue">Support For Tracing/Debugging?</td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue">profile_rt.o</td>
<td style="border: 2px solid blue">Runtime Library For Profiler</td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue">sample.o</td>
<td style="border: 2px solid blue">Sample Program ?</td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue">stkr_compiler.o</td>
<td style="border: 2px solid blue">Stacker Language Compiler Library</td>
</tr>
<tr class="doc_table">
<td style="border: 2px solid blue">stkr_runtime.o</td>
<td style="border: 2px solid blue">Stacker Language Runtime Library</td>
</tr>
</table>
</div>
<p></p>
<!-- ======================================================================= -->
<div class="doc_section"><a name="rot">Linkage Rules Of Thumb</a></div>
<div class="doc_text">
<p>This section contains various "rules of thumb" about what files you
should link into your programs.</p>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection"><a name="always">Always Link vmcore.o support.a</a>
</div>
<div class="doc_text">
<p>No matter what you do with LLVM, you'll always need to link with vmcore.o
and support.a.</p>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection"><a name="Placeholder">Placeholder</a></div>
<div class="doc_text">
<p>Need more rules of thumb here.</p>
</div>
<!-- ======================================================================= -->
<hr>
<div class="doc_footer">
<address><a href="mailto:rspencer@x10sys.com">Reid Spencer</a></address>
<a href="http://llvm.cs.uiuc.edu">The LLVM Compiler Infrastructure</a>
<br>Last modified: $Date$ </div>
</body>
</html>
<!-- vim: sw=2 ts=2 ai
-->

View File

@@ -1,360 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Open LLVM Projects</title>
<link rel="stylesheet" href="llvm.css" type="text/css">
</head>
<body>
<div class="doc_title">
Open LLVM Projects
</div>
<ul>
<li><a href="#what">What is this?</a></li>
<li><a href="#improving">Improving the current system</a>
<ol>
<li><a href="#code-cleanups">Implementing Code Cleanup bugs</a></li>
<li><a href="#glibc">Port glibc to LLVM</a></li>
<li><a href="#programs">Compile programs with the LLVM Compiler</a></li>
<li><a href="#llvm_ir">Extend the LLVM intermediate representation</a></li>
<li><a href="#misc_imp">Miscellaneous Improvements</a></li>
</ol></li>
<li><a href="#new">Adding new capabilities to LLVM</a>
<ol>
<li><a href="#newfeaturebugs">Implementing new feature PRs</a></li>
<li><a href="#pointeranalysis">Pointer and Alias Analysis</a></li>
<li><a href="#profileguided">Profile Guided Optimization</a></li>
<li><a href="#xforms">New Transformations and Analyses</a></li>
<li><a href="#x86be">X86 Back-end Improvements</a></li>
<li><a href="#misc_new">Miscellaneous Additions</a></li>
</ol></li>
</ul>
<div class="doc_author">
<p>Written by the <a href="http://llvm.cs.uiuc.edu/">LLVM Team</a></p>
</div>
<!-- *********************************************************************** -->
<div class="doc_section">
<a name="what">What is this?</a>
</div>
<!-- *********************************************************************** -->
<div class="doc_text">
<p>This document is meant to be a sort of "big TODO list" for LLVM. Each
project in this document is something that would be useful for LLVM to have, and
would also be a great way to get familiar with the system. Some of these
projects are small and self-contained, which may be implemented in a couple of
days, others are larger. Several of these projects may lead to interesting
research projects in their own right. In any case, we welcome all
contributions.</p>
<p>If you are thinking about tackling one of these projects, please send a mail
to the <a href="http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev">LLVM
Developer's</a> mailing list, so that we know the project is being worked on.
Additionally this is a good way to get more information about a specific project
or to suggest other projects to add to this page.
</p>
<p>The projects in this page are open-ended. More specific projects are
filed as unassigned enhancements in the <a href="http://llvm.cs.uiuc.edu/bugs/">
LLVM bug tracker</a>. See the <a href="http://llvm.cs.uiuc.edu/bugs/buglist.cgi?keywords_type=allwords&amp;keywords=&amp;bug_status=NEW&amp;bug_status=ASSIGNED&amp;bug_status=REOPENED&amp;bug_severity=enhancement&amp;emailassigned_to1=1&amp;emailtype1=substring&amp;email1=unassigned">list of currently outstanding issues</a> if you wish to help improve LLVM.</p>
</div>
<!-- *********************************************************************** -->
<div class="doc_section">
<a name="improving">Improving the current system</a>
</div>
<!-- *********************************************************************** -->
<div class="doc_text">
<p>Improvements to the current infrastructure are always very welcome and tend
to be fairly straight-forward to implement. Here are some of the key areas that
can use improvement...</p>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection">
<a name="code-cleanups">Implementing Code Cleanup bugs</a>
</div>
<div class="doc_text">
<p>
The <a href="http://llvm.cs.uiuc.edu/bugs/">LLVM bug tracker</a> occasionally
has <a href="http://llvm.cs.uiuc.edu/bugs/buglist.cgi?short_desc_type=allwordssubstr&short_desc=&long_desc_type=allwordssubstr&long_desc=&bug_file_loc_type=allwordssubstr&bug_file_loc=&status_whiteboard_type=allwordssubstr&status_whiteboard=&keywords_type=allwords&keywords=code-cleanup&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&emailassigned_to1=1&emailtype1=substring&email1=&emailassigned_to2=1&emailreporter2=1&emailcc2=1&emailtype2=substring&email2=&bugidtype=include&bug_id=&votes=&changedin=&chfieldfrom=&chfieldto=Now&chfieldvalue=&cmdtype=doit&order=Bug+Number&field0-0-0=noop&type0-0-0=noop&value0-0-0=">"code-cleanup" bugs</a> filed in it. Taking one of these and fixing it is a good
way to get your feet wet in the LLVM code and discover how some of its components
work.
</p>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection">
<a name="glibc">Port glibc to LLVM</a>
</div>
<div class="doc_text">
<p>It would be very useful to <a
href="http://www.gnu.org/software/libc/manual/html_node/Porting.html">port</a> <a
href="http://www.gnu.org/software/libc/">glibc</a> to LLVM. This would allow a
variety of interprocedural algorithms to be much more effective in the face of
library calls. The most important pieces to port are things like the string
library and the <tt>stdio</tt> related functions... low-level system calls like
'<tt>read</tt>' should stay unimplemented in LLVM.</p>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection">
<a name="programs">Compile programs with the LLVM Compiler</a>
</div>
<div class="doc_text">
<p>We are always looking for new testcases and benchmarks for use with LLVM. In
particular, it is useful to try compiling your favorite C source code with LLVM.
If it doesn't compile, try to figure out why or report it to the <a
href="http://mail.cs.uiuc.edu/pipermail/llvmbugs/">llvm-bugs</a> list. If you
get the program to compile, it would be extremely useful to convert the build
system to be compatible with the LLVM Programs testsuite so that we can check it
into CVS and the automated tester can use it to track progress of the
compiler.</p>
<p>When testing a code, try running it with a variety of optimizations, and with
all the back-ends: CBE, llc, and lli.</p>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection">
<a name="llvm_ir">Extend the LLVM intermediate representation</a>
</div>
<div class="doc_text">
<ol>
<li>Add support for platform-independent prefetch support. The GCC <a
href="http://gcc.gnu.org/projects/prefetch.html">prefetch project</a> page
has a good survey of the prefetching capabilities of a variety of modern
processors.</li>
</ol>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection">
<a name="misc_imp">Miscellaneous Improvements</a>
</div>
<div class="doc_text">
<ol>
<li>Someone needs to look into getting the <tt>ranlib</tt> tool to index LLVM
bytecode files, so that linking in .a files is not hideously slow. They
would also then have to implement the reader for this index in
<tt>gccld</tt>.</li>
<li>Rework the PassManager to be more flexible</li>
<li>Some transformations and analyses only work on reducible flow graphs. It
would be nice to have a transformation which could be "required" by these passes
which makes irreducible graphs reducible. This can easily be accomplished
through code duplication. See <a
href="http://citeseer.nj.nec.com/janssen97making.html">Making Graphs Reducible
with Controlled Node Splitting</a> and perhaps <a
href="http://doi.acm.org/10.1145/262004.262005">Nesting of Reducible and
Irreducible Loops</a>.</li>
</ol>
</div>
<!-- *********************************************************************** -->
<div class="doc_section">
<a name="new">Adding new capabilities to LLVM</a>
</div>
<!-- *********************************************************************** -->
<div class="doc_text">
<p>Sometimes creating new things is more fun than improving existing things.
These projects tend to be more involved and perhaps require more work, but can
also be very rewarding.</p>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection">
<a name="newfeaturebugs">Implementing new feature PRs</a>
</div>
<div class="doc_text">
<p>Many ideas for feature requests are stored in LLVM bugzilla. Just <a href="http://llvm.org/bugs/buglist.cgi?short_desc_type=allwordssubstr&short_desc=&long_desc_type=allwordssubstr&long_desc=&bug_file_loc_type=allwordssubstr&bug_file_loc=&status_whiteboard_type=allwordssubstr&status_whiteboard=&keywords_type=allwords&keywords=new-feature&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&emailassigned_to1=1&emailtype1=substring&email1=&emailassigned_to2=1&emailreporter2=1&emailcc2=1&emailtype2=substring&email2=&bugidtype=include&bug_id=&votes=&changedin=&chfieldfrom=&chfieldto=Now&chfieldvalue=&cmdtype=doit&namedcmd=All+PRs&newqueryname=&order=Bug+Number&field0-0-0=noop&type0-0-0=noop&value0-0-0=">search for bugs with a "new-feature" keyword</a>.</p>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection">
<a name="pointeranalysis">Pointer and Alias Analysis</a>
</div>
<div class="doc_text">
<p>We have a <a href="AliasAnalysis.html">strong base for development</a> of
both pointer analysis based optimizations as well as pointer analyses
themselves. It seems natural to want to take advantage of this...</p>
<ol>
<li>Implement a flow-sensitive context-sensitive alias analysis algorithm<br>
- Pick one of the somewhat efficient algorithms, but strive for maximum
precision</li>
<li>Implement a flow-sensitive context-insensitive alias analysis algorithm<br>
- Just an efficient local algorithm perhaps?</li>
<li>Implement alias-analysis-based optimizations:
<ul>
<li>Dead store elimination</li>
<li>...</li>
</ul></li>
</ol>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection">
<a name="profileguided">Profile Guided Optimization</a>
</div>
<div class="doc_text">
<p>We now have a unified infrastructure for writing profile-guided
transformations, which will work either at offline-compile-time or in the JIT,
but we don't have many transformations. We would welcome new profile-guided
transformations as well as improvements to the current profiling system.
</p>
<p>Ideas for profile guided transformations:</p>
<ol>
<li>Superblock formation (with many optimizations)</li>
<li>Loop unrolling/peeling</li>
<li>Profile directed inlining</li>
<li>Code layout</li>
<li>...</li>
</ol>
<p>Improvements to the existing support:</p>
<ol>
<li>The current block and edge profiling code that gets inserted is very simple
and inefficient. Through the use of control-dependence information, many fewer
counters could be inserted into the code. Also, if the execution count of a
loop is known to be a compile-time or runtime constant, all of the counters in
the loop could be avoided.</li>
<li>You could implement one of the "static profiling" algorithms which analyze a
piece of code an make educated guesses about the relative execution frequencies
of various parts of the code.</li>
<li>You could add path profiling support, or adapt the existing LLVM path
profiling code to work with the generic profiling interfaces.</li>
</ol>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection">
<a name="xforms">New Transformations and Analyses</a>
</div>
<div class="doc_text">
<ol>
<li>Implement a Dependence Analysis Infrastructure<br>
- Design some way to represent and query dep analysis</li>
<li>Implement a strength reduction pass</li>
<li>Value range propagation pass</li>
</ol>
</div>
<!-- ======================================================================= -->
<div class="doc_section">
<a name="x86be">X86 Back-end Improvements</a>
</div>
<div class="doc_text">
<ol>
<li>Implement a better instruction selector</li>
<li>Implement support for the "switch" instruction without requiring the
lower-switches pass.</li>
<li>Implement interprocedural register allocation. The CallGraphSCCPass can be
used to implement a bottom-up analysis that will determine the *actual*
registers clobbered by a function. Use the pass to fine tune register usage
in callers based on *actual* registers used by the callee.</li>
</ol>
</div>
<!-- ======================================================================= -->
<div class="doc_section">
<a name="misc_new">Miscellaneous Additions</a>
</div>
<div class="doc_text">
<ol>
<li>Port the <a href="http://www-sop.inria.fr/mimosa/fp/Bigloo/">Bigloo</A>
Scheme compiler, from Manuel Serrano at INRIA Sophia-Antipolis, to
output LLVM bytecode. It seems that it can already output .NET
bytecode, JVM bytecode, and C, so LLVM would ostensibly be another good
candidate.</li>
<li>Write a new frontend for C/C++ <b>in</b> C++, giving us the ability to
directly use LLVM C++ classes from within a compiler rather than use
C-based wrapper functions a la llvm-gcc. One possible starting point is the <a
href="http://www.parashift.com/c++-faq-lite/compiler-dependencies.html#faq-37.11">C++
yacc grammar by Ed Willink</a>.</li>
<li>Write a new frontend for some other language (Java? OCaml? Forth?)</li>
<li>Write a new backend for a target (IA64? MIPS? MMIX?)</li>
<li>Write a disassembler for machine code that would use TableGen to output
<tt>MachineInstr</tt>s for transformations, optimizations, etc.</li>
<li>Random test vector generator: Use a C grammar to generate random C code;
run it through llvm-gcc, then run a random set of passes on it using opt.
Try to crash opt. When opt crashes, use bugpoint to reduce the test case and
mail the result to yourself. Repeat ad infinitum.</li>
<li>Design a simple, recognizable logo.</li>
</ol>
</div>
<!-- *********************************************************************** -->
<hr>
<address>
<a href="http://jigsaw.w3.org/css-validator/check/referer"><img
src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a>
<a href="http://validator.w3.org/check/referer"><img
src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!"></a>
<a href="mailto:sabre@nondot.org">Chris Lattner</a><br>
<a href="http://llvm.cs.uiuc.edu">LLVM Compiler Infrastructure</a><br>
Last modified: $Date$
</address>
</body>
</html>

File diff suppressed because it is too large Load Diff

View File

@@ -40,37 +40,32 @@ projects that use LLVM header files, libraries, and tools. In order to use
these facilities, a Makefile from a project must do the following things:</p>
<ol>
<li>Set environment variables.There are several environment variables that a
Makefile needs to set to use the LLVM build system:
<ul>
<li><tt>LLVM_SRC_ROOT</tt> - The root of the LLVM source tree.</li>
<li><tt>LLVM_OBJ_ROOT</tt> - The root of the LLVM object tree.</li>
<li><tt>BUILD_SRC_ROOT</tt> - The root of the project's source tree.</li>
<li><tt>BUILD_OBJ_ROOT</tt> - The root of the project's object tree.</li>
<li><tt>BUILD_SRC_DIR</tt> - The directory containing the current source to be
compiled.</li>
<li><tt>BUILD_OBJ_DIR</tt> - The directory where the current source will place
the new object files. This should always be the current directory.</li>
<li><tt>LEVEL</tt> - The relative path from the current directory to the root
of the object tree.</li>
</ul></li>
<li>Include <tt>Makefile.config</tt> from <tt>$(LLVM_OBJ_ROOT)</tt>.</li>
<li>Include <tt>Makefile.rules</tt> from <tt>$(LLVM_SRC_ROOT)</tt>.</li>
<li>Set <tt>make</tt> variables. There are several variables that a Makefile
needs to set to use the LLVM build system:
<ul>
<li><tt>PROJECT_NAME</tt> - The name by which your project is known.</li>
<li><tt>LLVM_SRC_ROOT</tt> - The root of the LLVM source tree.</li>
<li><tt>LLVM_OBJ_ROOT</tt> - The root of the LLVM object tree.</li>
<li><tt>PROJ_SRC_ROOT</tt> - The root of the project's source tree.</li>
<li><tt>PROJ_OBJ_ROOT</tt> - The root of the project's object tree.</li>
<li><tt>PROJ_INSTALL_ROOT</tt> - The root installation directory.</li>
<li><tt>LEVEL</tt> - The relative path from the current directory to the
project's root ($PROJ_OBJ_ROOT).</li>
</ul></li>
<li>Include <tt>Makefile.config</tt> from <tt>$(LLVM_OBJ_ROOT)</tt>.</li>
<li>Include <tt>Makefile.rules</tt> from <tt>$(LLVM_SRC_ROOT)</tt>.</li>
</ol>
<p>There are two ways that you can set all of these variables:</p>
<ol>
<li>You can write your own Makefiles which hard-code these values.</li>
<li> You can use the pre-made LLVM sample project. This sample project includes
Makefiles, a configure script that can be used to configure the location of
LLVM, and the ability to support multiple object directories from a single
source directory.</li>
<li>You can write your own Makefiles which hard-code these values.</li>
<li>You can use the pre-made LLVM sample project. This sample project
includes Makefiles, a configure script that can be used to configure the
location of LLVM, and the ability to support multiple object directories
from a single source directory.</li>
</ol>
<p>This document assumes that you will base your project off of the LLVM sample
<p>This document assumes that you will base your project on the LLVM sample
project found in <tt>llvm/projects/sample</tt>. If you want to devise your own
build system, studying the sample project and LLVM Makefiles will probably
provide enough information on how to write your own Makefiles.</p>
@@ -94,39 +89,52 @@ the name of your project.</li>
<li>Add your source code and Makefiles to your source tree.</li>
<li>If you want your Makefiles to be configured by the <tt>configure</tt>
script, or if you want to support multiple object directories, add your
Makefiles to the <tt>configure</tt> script by adding them into the
<tt>autoconf/configure.ac</tt> file. The macro <tt>AC_CONFIG_MAKEFILE</tt> will
copy a file, unmodified, from the source directory to the object directory.</li>
<li>If you want your project to be configured with the <tt>configure</tt> script
then you need to edit <tt>autoconf/configure.ac</tt> as follows:
<ul>
<li><b>AC_INIT</b>. Place the name of your project, its version number and
a contact email address for your project as the arguments to this macro</li>
<li><b>AC_CONFIG_AUC_DIR</b>. If your project isn't in the
<tt>llvm/projects</tt> directory then you might need to adjust this so that
it specifies a relative path to the <tt>llvm/autoconf</tt> directory.</li>
<li><b>LLVM_CONFIG_PROJECT</b>. Just leave this alone.</li>
<li><b>AC_CONFIG_SRCDIR</b>. Specify a path to a file name that identifies
your project; or just leave it at <tt>Makefile.config.in</tt></li>
<li><b>AC_CONFIG_FILES</b>. Do not change.</li>
<li><b>AC_CONFIG_MAKEFILE</b>. Use one of these macros for each Makefile
that your project uses. This macro arranges for your makefiles to be copied
from the source directory, unmodified, to the build directory.</li>
</ul>
</li>
<li>After updating <tt>autoconf/configure.ac</tt>, regenerate the
configure script with these commands:
<div class="doc_code">
<p><tt>% cd autoconf<br>
% autoconf -o ../configure</tt></p>
% AutoRegen.sh</tt></p>
</div>
<p>You must be using Autoconf version 2.57 or higher.</p></li>
<p>You must be using Autoconf version 2.59 or later and your aclocal version
should 1.9 or later.</p></li>
<li>Run <tt>configure</tt> in the directory in which you want to place
object code. Use the following options to tell your project where it
can find LLVM:
<dl>
<dt><tt>--with-llvmsrc=&lt;directory&gt;</tt>
<dd>
Tell your project where the LLVM source tree is located.
<p>
<dt><tt>--with-llvmobj=&lt;directory&gt;</tt>
<dd>
Tell your project where the LLVM object tree is located.
<dt><tt>--with-llvmsrc=&lt;directory&gt;</tt></dt>
<dd>Tell your project where the LLVM source tree is located.</dd>
<dt><br/><tt>--with-llvmobj=&lt;directory&gt;</tt></dt>
<dd>Tell your project where the LLVM object tree is located.</dd>
<dt><br/><tt>--prefix=&lt;directory&gt;</tt></dt>
<dd>Tell your project where it should get installed.</dd>
</dl>
</ol>
<p>That's it! Now all you have to do is type <tt>gmake</tt> in the root of
your object directory, and your project should build.</p>
<p>That's it! Now all you have to do is type <tt>gmake</tt> (or <tt>make</tt>
if your on a GNU/Linux system) in the root of your object directory, and your
project should build.</p>
</div>
@@ -186,30 +194,25 @@ directories:</p>
This subdirectory should contain tests that verify that your code
works correctly. Automated tests are especially useful.
<p>
Currently, the LLVM build system provides little support for tests,
although some exists. Expanded support for tests will hopefully
occur in the future. In the meantime, the LLVM system does provide the
following:
Currently, the LLVM build system provides basic support for tests.
The LLVM system provides the following:
<ul>
<li>
LLVM provides several QMTest test classes that can be used to
create tests. They can be found in
<tt>llvm/test/QMTest/llvm.py</tt>. These test classes perform a
variety of functions, including code optimization tests, assembly
tests, and code analysis tests. The Makefile in
<tt>llvm/test</tt> provides the QMTest context needed by LLVM test
classes.
<p>
LLVM provides a tcl procedure that is used by Dejagnu to run
tests. It can be found in <tt>llvm/lib/llvm-dg.exp</tt>. This
test procedure uses RUN lines in the actual test case to determine
how to run the test. See the <a
href="TestingGuide.html">TestingGuide</a> for more details. You
can easily write Makefile support similar to the Makefiles in
<tt>llvm/test</tt> to use Dejagnu to run your project's tests.<br/></li>
<li>
The LLVM source tree provides benchmarks and programs which are
known to compile with the LLVM GCC front ends. You can use these
LLVM contains an optional package called <tt>llvm-test</tt>
which provides benchmarks and programs that are known to compile with the
LLVM GCC front ends. You can use these
programs to test your code, gather statistics information, and
compare it to the current LLVM performance statistics. These
programs are found in the <tt>llvm/test/Programs</tt> directory.
<p>
Currently, there is no way to hook your tests directly into the
<tt>llvm/test/Programs</tt> testing harness. You will simply
compare it to the current LLVM performance statistics.
<br/>Currently, there is no way to hook your tests directly into the
<tt>llvm/test</tt> testing harness. You will simply
need to find a way to use the source provided within that directory
on your own.
</ul>
@@ -404,13 +407,13 @@ whether you do a Debug, Release, or Profile build.</p>
<dt>Libraries
<dd>
All libraries (static and dynamic) will be stored in
<tt>BUILD_OBJ_ROOT/lib/&lt;type&gt;</tt>, where type is <tt>Debug</tt>,
<tt>PROJ_OBJ_ROOT/&lt;type&gt;/lib</tt>, where type is <tt>Debug</tt>,
<tt>Release</tt>, or <tt>Profile</tt> for a debug, optimized, or
profiled build, respectively.<p>
<dt>Executables
<dd>All executables will be stored in
<tt>BUILD_OBJ_ROOT/tools/&lt;type&gt;</tt>, where type is <tt>Debug</tt>,
<tt>PROJ_OBJ_ROOT/&lt;type&gt;/bin</tt>, where type is <tt>Debug</tt>,
<tt>Release</tt>, or <tt>Profile</tt> for a debug, optimized, or profiled
build, respectively.
</dl>

View File

@@ -2,12 +2,13 @@
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="llvm.css" type="text/css">
<title>LLVM 1.3 Release Notes</title>
<title>LLVM 1.5 Release Notes</title>
</head>
<body>
<div class="doc_title">LLVM 1.3 Release Notes</div>
<div class="doc_title">LLVM 1.5 Release Notes</div>
<ol>
<li><a href="#intro">Introduction</a></li>
@@ -15,21 +16,11 @@
<li><a href="GettingStarted.html">Installation Instructions</a></li>
<li><a href="#portability">Portability and Supported Platforms</a></li>
<li><a href="#knownproblems">Known Problems</a>
<ul>
<li><a href="#experimental">Experimental features included in this
release</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="#x86-be">Known problems with the X86 Back-end</a>
<li><a href="#sparcv9-be">Known problems with the SparcV9 Back-end</a>
<li><a href="#c-be">Known problems with the C back-end</a>
</ul></li>
<li><a href="#additionalinfo">Additional Information</a></li>
</ol>
<div class="doc_author">
<p>Written by the <a href="http://llvm.cs.uiuc.edu">LLVM team</a><p>
<p>Written by the <a href="http://llvm.cs.uiuc.edu">LLVM Team</a><p>
</div>
<!-- *********************************************************************** -->
@@ -41,22 +32,22 @@
<div class="doc_text">
<p>This document contains the release notes for the LLVM compiler
infrastructure, release 1.3. Here we describe the status of LLVM, including any
known problems and bug fixes from the previous release. The most up-to-date
version of this document can be found on the <a
href="http://llvm.cs.uiuc.edu/releases/1.3/">LLVM 1.3 web site</a>. If you are
infrastructure, release 1.5. Here we describe the status of LLVM, including any
known problems and major improvements from the previous release. The most
up-to-date version of this document can be found on the <a
href="http://llvm.cs.uiuc.edu/releases/1.5/">LLVM 1.5 web site</a>. If you are
not reading this on the LLVM web pages, you should probably go there because
this document may be updated after the release.</p>
<p>For more information about LLVM, including information about potentially more
current releases, please check out the <a href="http://llvm.cs.uiuc.edu">main
<p>For more information about LLVM, including information about the latest
release, please check out the <a href="http://llvm.cs.uiuc.edu">main LLVM
web site</a>. If you have questions or comments, the <a
href="http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev">LLVM developer's mailing
list</a> is a good place to send them.</p>
<p>Note that if you are reading this file from CVS, this document applies
to the <i>next</i> release, not the current one. To see the release notes for
the current or previous releases, see the <a
<p>Note that if you are reading this file from CVS or the main LLVM web page,
this document applies to the <i>next</i> release, not the current one. To see
the release notes for the current or previous releases, see the <a
href="http://llvm.cs.uiuc.edu/releases/">releases page</a>.</p>
</div>
@@ -69,271 +60,286 @@ href="http://llvm.cs.uiuc.edu/releases/">releases page</a>.</p>
<div class="doc_text">
<p>This is the fourth public release of the LLVM compiler infrastructure. This
release primarily improves the <a href="#codequality">performance of the
code</a> produced by all aspects of the LLVM compiler, adds many <a
href="#newfeatures">new features</a>, <a href="#bugfix">fixes a few
bugs</a>, speeds up the compiler, and introduces a new (experimental)
PowerPC code generator.</p>
<p>This is the sixth public release of the LLVM Compiler Infrastructure.</p>
<p> At this time, LLVM is known to correctly compile and run all C &amp; C++
SPEC CPU95 &amp; 2000 benchmarks, the Olden benchmarks, and the Ptrdist
benchmarks, and <b>many</b> other programs. LLVM now also works
with a broad variety of C++ programs.</p>
<p>LLVM 1.5 is known to correctly compile a wide range of C and C++ programs,
includes bug fixes for those problems found since the 1.4 release, and includes
a large number of new features and enhancements, described below.</p>
</div>
<!--=========================================================================-->
<div class="doc_subsubsection">
<a name="newfeatures">This release implements the following new features:</a>
<div class="doc_subsection">
<a name="newfeatures">New Features in LLVM 1.5</a>
</div>
<!--_________________________________________________________________________-->
<div class="doc_subsubsection"><a name="newcg">New Native Code
Generators</a></div>
<div class="doc_text">
<ol>
<li>The LLVM <a href="LangRef.html#i_select"><tt>select</tt></a> instruction is
now fully implemented and supported by all transformations, native code
generators, and the interpreter.</li>
<li>Bugpoint can now narrow down code-generation bugs to a loop nest, where
before it could only narrow them down to a function being miscompiled.</li>
<li><a href="http://llvm.cs.uiuc.edu/PR40">Bugpoint can now debug arbitrary
modes of llc</a> and lli, by passing them command line flags (e.g.
<tt>-regalloc=linearscan</tt>).</li>
<li>The Control Flow Graph in the native code generators is no longer
constrained to be the same as the CFG for the LLVM input code.</li>
<li>The LLVM induction variable analysis routines have been rewritten.</li>
<li>LLVM now has new loop unrolling and loop unswitching passes.</li>
<li>The induction variable substitution pass performs linear function test
replacement and exit value replacement optimizations.</li>
<li>LLVM now has first-class support for <a
href="GarbageCollection.html">Accurate Garbage Collection</a>, enabling the use
of aggressive copying and generational collectors.</li>
<li>LLVM now includes a simple implementation of <a
href="AliasAnalysis.html#anders-aa">Andersen's interprocedural alias
analysis</a> algorithm.</li>
<li>Bugpoint can <a href="http://llvm.cs.uiuc.edu/PR327">extract individual
basic blocks</a> to track down reduce miscompilation testcases.</li>
<li>LLVM and the C front-end now work under Win32 using the
<a href="http://www.cygwin.com">Cygwin</a> runtime libraries.
This includes the JIT compiler.</li>
<li>The LLVM code generator is now being <a
href="CodeGenerator.html">documented</a>.</li>
<li>LLVM includes a new tool, <a
href="CommandGuide/html/llvm-bcanalyzer.html">llvm-bcanalyzer</a>, This tool
can compute various statistics and dump information about LLVM bytecode
encoding.</li>
<li>The <a href="BytecodeFormat.html">LLVM bytecode file format</a> is now
documented.</li>
<li>LLVM now provides an <a
href="LangRef.html#i_isunordered">llvm.isunordered</a> intrinsic for efficient
implementation of unordered floating point comparisons.</li>
<li>The llvmgcc front-end now supports the GCC builtins for ISO C99 floating
point comparison macros (e.g., <tt>__builtin_islessequal</tt>).</li>
<li>We now generate <a href="CommandGuide/">HTML documentation and man pages</a>
for the tools from a single source (perl-style POD files).</li>
<li>The LLVM code generator can now dynamically load targets from shared
objects.</li>
<li>LLVM now includes a "skeleton" target, which makes it easier to get
started porting LLVM to new architectures.</li>
<li>The linear scan register allocator is now enabled by default in the
target-independent code generator.</li>
<li>LLVM now includes a dead store elimination pass.</li>
<li>Bugpoint can now debug miscompilations that lead to the program going
into an infinite loop.</li>
<li>LLVM now provides interfaces to support ML-style pattern matching on the
LLVM IR.</li>
<li>LLVM now includes a <a
href="AliasAnalysis.html#globalsmodref">context-sensitive mod/ref analysis</a>
for global variables, which is now enabled by default in gccld.</li>
<li>LLVM can now autogenerate assembly printers for code generators from the
tablegen description of the target (before they were hand coded).</li>
<li>All LLVM tools will now respond to the
<a href="http://llvm.cs.uiuc.edu/PR413"><tt>--version</tt> option</a> which
will tell you the version of LLVM on which the tool is based.</li>
<li>An experimental PowerPC backend has been added, capable of compiling several
SPEC benchmarks.</li>
</ol>
<p>
This release includes new native code generators for <a
href="#alpha-be">Alpha</a>, <a href="#ia64-be">IA-64</a>, and <a
href="#sparcv8">SPARC-V8</a> (32-bit SPARC). These code generators are still
beta quality, but are progressing rapidly. The Alpha backend is implemented
with an eye towards being compatible with the widely used SimpleScalar
simulator.
</p>
</div>
<!--=========================================================================-->
<div class="doc_subsubsection">
In this release, the following missing features were implemented:
</div>
<!--_________________________________________________________________________-->
<div class="doc_subsubsection"><a name="selectiondag">New Instruction
Selector Framework</a></div>
<div class="doc_text">
<ol>
<li><a href="http://llvm.cs.uiuc.edu/PR82">LLVM cannot handle structures with
more than 256 elements</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR38">[bugpoint] External functions used in
non-instruction entities, such as global constant initializer</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR178">Stacker does not handle targets
with 64-bit pointers.</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR290">Bugpoint doesn't support
uses of external fns by immediate constant exprs</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR407">Can't add function passes that
depend on immutable passes to the FunctionPassManager</a>.</li>
<li><a href="http://llvm.cs.uiuc.edu/PR308">Archive file reader doesn't
understand abbreviated names in headers</a></li>
</ol>
<p>This release includes a <a href="CodeGenerator.html#instselect">new framework
for building instruction selectors</a>, which has long been the hardest part of
building a new LLVM target. This framework handles a lot of the mundane (but
easy to get wrong) details of writing the instruction selector, such as
generating efficient code for <a
href="LangRef.html#i_getelementptr">getelementptr</a> instructions, promoting
small integer types to larger types (e.g. for RISC targets with one size of
integer registers), expanding 64-bit integer operations for 32-bit targets, etc.
Currently, the X86, PowerPC, Alpha, and IA-64 backends use this framework. The
SPARC backends will be migrated when time permits.
</p>
</div>
<!--=========================================================================-->
<div class="doc_subsubsection">
<a name="qualityofimp">In this release, the following Quality of Implementation
issues were fixed:</a>
</div>
<!--_________________________________________________________________________-->
<div class="doc_subsubsection"><a name="customccs">New Support for Per-Function
Calling Conventions</a></div>
<div class="doc_text">
<p>LLVM 1.5 adds supports for <a href="LangRef.html#callingconv">per-function
calling conventions</a>. Traditionally, the LLVM code generators match the
native C calling conventions for a target. This is important for compatibility,
but is not very flexible. This release allows custom calling conventions to be
established for functions, and defines three target-independent conventions (<a
href="LangRef.html#callingconv">C call, fast call, and cold call</a>) which may
be supported by code generators. When possible, the LLVM optimizer promotes C
functions to use the "fastcc" convention, allowing the use of more efficient
calling sequences (e.g., parameters are passed in registers in the X86 target).
</p>
<ol>
<li><a href="http://llvm.cs.uiuc.edu/PR305">LLVM tools will happily spew
bytecode onto your terminal</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR329">[llvmgcc] type names are not emitted
for structure typedefs</a></li>
<li>All documentation is now conformant to the HTML 4.01 (Strict) level.</li>
<li>The spurious "WARNING: Found global types that are not compatible" warning
produced when linking C++ programs has been fixed.</li>
<li><a href="http://llvm.cs.uiuc.edu/PR391">lli Doesn't Handle Exceptions From
Bytecode Reader</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR392">Global Vars Have (Somewhat) Limited
Type Range</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR341">operator&lt;&lt; on a Value* now
prints the address of the object instead of its contents.</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR402">Bytecode Enhancements
Needed</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR404">[loopsimplify] Loop simplify is
really slow on 252.eon</a></li>
<li><a href="Http://llvm.cs.uiuc.edu/PR122">[code-cleanup] SymbolTable class
cleanup, Type should not derive from Value, eliminate ConstantPointerRef
class</a>.</li>
<li>The memory footprint of the LLVM IR has been reduced substantially.</li>
<li>The LLVM linker and many core classes have been sped up substantially.</li>
</ol>
<p>Targets may now also define target-specific calling conventions, allowing
LLVM to fully support calling convention altering options (e.g. GCC's
<tt>-mregparm</tt> flag) and well-defined target conventions (e.g. stdcall and
fastcall on X86).</p>
</div>
<!--_________________________________________________________________________-->
<div class="doc_subsubsection"><a name="tailcalls">New Support for
Proper Tail Calls</a></div>
<div class="doc_text">
<p>The release now includes support for <a
href="http://doi.acm.org/10.1145/277650.277719">proper tail calls</a>, as
required to implement languages like Scheme. Tail calls make use of two
features: custom calling conventions (described above), which allow the code
generator to use a convention where the caller deallocates its stack before it
returns. The second feature is a flag on the <a href="LangRef.html#i_call">call
instruction</a>, which indicates that the callee does not access the caller's
stack frame (indicating that it is acceptable to deallocate the caller stack
before invoking the callee). LLVM proper tail calls run on the system stack (as
do normal calls), supports indirect tail calls, tail calls with arbitrary
numbers of arguments, tail calls where the callee requires more argument space
than the caller, etc. The only case not supported are varargs calls, but that
could be added if desired.
</p>
<p>To ensure a call is interpreted as a tail call, a front-end must mark
functions as "fastcc", mark calls with the 'tail' marker, and follow the call
with a return of the called value (or void). The optimizer and code generator
attempt to handle more general cases, but the simple case will always work if
the code generator supports tail calls. Here is an example:</p>
<pre>
fastcc int %bar(int %X, int(double, int)* %FP) { ;<i> fastcc</i>
%Y = tail call fastcc int %FP(double 0.0, int %X) ;<i> tail, fastcc</i>
ret int %Y
}
</pre>
<p>In LLVM 1.5, the X86 code generator is the only target that has been enhanced
to support proper tail calls (other targets will be enhanced in future).
Further, because this support was added very close to the release, it is
disabled by default. Pass <tt>-enable-x86-fastcc</tt> to llc to enable it (this
will be enabled by default in the next release). The example above compiles to:
</p>
<pre>
bar:
sub ESP, 8 # Callee uses more space than the caller
mov ECX, DWORD PTR [ESP + 8] # Get the old return address
mov DWORD PTR [ESP + 4], 0 # First half of 0.0
mov DWORD PTR [ESP + 8], 0 # Second half of 0.0
mov DWORD PTR [ESP], ECX # Put the return address where it belongs
jmp EDX # Tail call "FP"
</pre>
<p>
With fastcc on X86, the first two integer arguments are passed in EAX/EDX, the
callee pops its arguments off the stack, and the argument area is always a
multiple of 8 bytes in size.
</p>
</div>
<!--=========================================================================-->
<div class="doc_subsubsection">
In this release, the following build problems were fixed:
</div>
<!--_________________________________________________________________________-->
<div class="doc_subsubsection">Other New Features</div>
<div class="doc_text">
<ol>
<li><a href="http://llvm.cs.uiuc.edu/PR301">Minor configure bugs with
-disable/enable-povray and -disable-spec</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR289">shell scripts output by gccld don't
work if you change PATH</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR364">[llvmgcc] llvmgcc does not compile
with gcc 3.4</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR373">[llvmgcc] obstack.h relies on
obsolete casts-as-lvalues GCC extension</a></li>
<li>LLVM now includes an <a href="http://llvm.cs.uiuc.edu/PR415">
Interprocedural Sparse Conditional Constant Propagation</a> pass, named
-ipsccp, which is run by default at link-time.</li>
<li>LLVM 1.5 is now about 15% faster than LLVM 1.4 and its core data
structures use about 30% less memory.</li>
<li>Support for Microsoft Visual Studio is improved, and <a
href="GettingStartedVS.html">now documented</a>. Most LLVM tools build
natively with Visual C++ now.</li>
<li><a href="GettingStarted.html#config">Configuring LLVM to build a subset
of the available targets</a> is now implemented, via the
<tt>--enable-targets=</tt> option.</li>
<li>LLVM can now create native shared libraries with '<tt>llvm-gcc ...
-shared -Wl,-native</tt>' (or with <tt>-Wl,-native-cbe</tt>).</li>
<li>LLVM now supports a new "<a href="LangRef.html#i_prefetch">llvm.prefetch
</a>" intrinsic, and llvm-gcc now supports __builtin_prefetch.
<li>LLVM now supports intrinsics for <a href="LangRef.html#int_count">bit
counting</a> and llvm-gcc now implements the GCC
<tt>__builtin_popcount</tt>, <tt>__builtin_ctz</tt>, and
<tt>__builtin_clz</tt> builtins.</li>
<li>LLVM now mostly builds on HP-UX with the HP aCC Compiler.</li>
<li>The LLVM X86 backend can now emit Cygwin-compatible .s files.</li>
<li>LLVM now includes workarounds in the code generator generator which
reduces the likelyhood of <a href="http://llvm.cs.uiuc.edu/PR448">GCC
hitting swap during optimized builds</a>.</li>
<li>The <a href="http://llvm.cs.uiuc.edu/ProjectsWithLLVM/#llvmtv">LLVM
Transformation Visualizer</a> (llvm-tv) project has been updated to
work with LLVM 1.5.</li>
<li>Nightly tester output is now archived on the <a
href="http://mail.cs.uiuc.edu/pipermail/llvm-testresults/">
llvm-testresults</a> mailing list.</li>
</ol>
</div>
<!--=========================================================================-->
<div class="doc_subsubsection">
<a name="codequality">This release includes the following Code Quality
improvements:</a>
<div class="doc_subsection">
<a name="codequality">Code Quality Improvements in LLVM 1.5</a>
</div>
<div class="doc_text">
<ol>
<li>Fixed: <a href="http://llvm.cs.uiuc.edu/PR309">[vmcore] Code quality problem
due to long operand of getelementptr</a></li>
<li>The new -simplify-libcalls pass improves code generated for well-known
library calls. The pass optimizes calls to many of the string, memory, and
standard I/O functions (e.g. replace the calls with simpler/faster calls) when
possible, given information known statically about the arguments to the call.
</li>
<li>The X86 backend now generates substantially better code for 64-bit integer
and floating point operations.</li>
<li>The -globalopt pass now promotes non-address-taken static globals that are
only accessed in main to SSA registers.</li>
<li>The -inline pass no longer inlines mutually recursive functions until it
hits the inlining threshold.</li>
<li>Loops with trip counts based on array pointer comparisons (e.g. "<tt>for (i
= 0; &amp;A[i] != &amp;A[n]; ++i) ...</tt>") are optimized better than before,
which primarily helps iterator-intensive C++ code.</li>
<li>The -inline pass no longer misses obvious inlining opportunities just
because the callee eventually calls into an external function.</li>
<li>The optimizer now eliminates simple cases where redundant conditions exist
between neighboring blocks.</li>
<li>The -simplifycfg pass can now "if convert" simple statements into the
<tt>select</tt> instruction.</li>
<li>The reassociation pass (which turns (1+X+3) into (X+1+3) among other
things), is more aggressive and intelligent.</li>
<li>The -loopsimplify pass can now break <a
href="http://llvm.cs.uiuc.edu/PR35">natural loops with multiple backedges</a>
into multiple nested loops. This enables a variety of subsequent
optimizations.</li>
<li>The -prune-eh pass now detects no-return functions in addition to the
no-unwind functions it did before.</li>
<li>The -adce pass can now eliminate calls to functions that do not not write to
memory.</li>
<li>The link-time optimizer now runs the -prune-eh pass (to remove unused
exception handlers).</li>
<li>The link-time optimizer now runs dead store elimination and uses a simple
interprocedural alias analysis.</li>
<li>The -simplifycfg pass can now eliminate simple correlated branches (such as
"<tt>if (A &lt; B &amp;&amp; A &lt; B)</tt>", and can turn short-circuiting
operators into the strict versions when useful (such as "<tt>if (A &lt; B || A
&gt; C)</tt>" into "<tt>if (A &lt; B | A &gt; C)</tt>"</li>
<li>LLVM now has infrastructure for (simple and sparse conditional) constant
propagation of function calls. It currently supports a few math library
functions like sqrt/sin/cos/etc.</li>
<li>The C backend now emits <a href="http://llvm.cs.uiuc.edu/PR334">syntactic
loops</a> in the code to help C compilers whose optimizers do not recognize
loops formed from gotos (like GCC).</li>
<li>The SparcV9 backend no longers <a
href="http://llvm.cs.uiuc.edu/PR368">spills the null constant to the constant
pool</a>.</li>
<li>The -globalsmodref alias analysis generates more precise results in some
cases.</li>
</ol>
</div>
<!--=========================================================================-->
<div class="doc_subsubsection">
<a name="bugfix">In this release, the following bugs in the previous release
were fixed:</a>
<div class="doc_subsection">
<a name="codequality">Code Generator Improvements in LLVM 1.5</a>
</div>
<div class="doc_text">
<ol>
<li>The code generator now can provide and use information about commutative
two-address instructions when performing register allocation.</li>
<li>The code generator now tracks function live-in registers explicitly,
instead of requiring the target to generate 'implicit defs' at the
entry to a function.</li>
<li>The code generator can lower integer division by a constant to
multiplication by a magic constant and multiplication by a constant into
shift/add sequences.</li>
<li>The code generator compiles fabs/fneg/sin/cos/sqrt to assembly instructions
when possible.</li>
<li>The PowerPC backend generates better code in many cases, making use of
FMA instructions and the recording ("dot") forms of various PowerPC
instructions.</li>
</ol>
</div>
<!--=========================================================================-->
<div class="doc_subsection">
<a name="bugfix">Significant Bugs Fixed in LLVM 1.5</a>
</div>
<div class="doc_text">
<p>Bugs fixed in the LLVM Core:</p>
<ol>
<li><a href="http://llvm.cs.uiuc.edu/PR306">[loopsimplify] Loop simplify
incorrectly updates dominator information</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR310">[tailduplicate] DemoteRegToStack
breaks SSA form</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR313">[X86] JIT miscompiles unsigned short
to floating point cast</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR330">[vmcore] Linker causes erroneous
asssertion</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR332">[adce] Crash handling unreachable
code that unwinds</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR333">[sparcv9] LLC can't emit 2 functions
of the same name, both having constant pools</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR337">[livevar] Live variables missed
physical register use of aliased definition</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR369">[X86] stackifier crash on floating
point setcc X, X</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR491">[dse] DSE deletes stores that
are partially overwritten by smaller stores</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR548">[instcombine] miscompilation of
setcc or setcc in one case</a></li>
<li>Transition code for LLVM 1.0 style varargs was removed from the .ll file
parser. LLVM 1.0 bytecode files are still supported. </li>
</ol>
<p>Code Generator Bugs:</p>
<ol>
<li><a href="http://llvm.cs.uiuc.edu/PR490">[cbackend] Logical constant
expressions (and/or/xor) not implemented</a>.</li>
<li><a href="http://llvm.cs.uiuc.edu/PR511">[cbackend] C backend does not
respect 'volatile'</a>.</li>
<li>The JIT sometimes miscompiled globals and constant pool entries for
64-bit integer constants on 32-bit hosts.</li>
<li>The C backend should no longer produce code that crashes ICC 8.1.</li>
</ol>
<p>Bugs in the C/C++ front-end:</p>
<ol>
<li><a href="http://llvm.cs.uiuc.edu/PR298">[llvmgcc] Variable length array
indexing miscompiled</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR326">[llvmgcc] Crash on use of undeclared
enum type</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR355">[llvmgcc] Errors handling function
prototypes that take opaque structs by-value</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR374">[llvmgcc] Crash compiling variable
length array of structures</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR377">[llvmgcc] miscompilation of staticly
initialized unsigned bitfields</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR396">[llvm-gcc] Crash casting function to void</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR487">[llvmgcc] llvm-gcc incorrectly
rejects some constant initializers involving the addresses of array
elements</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR501">[llvm-g++] Crash compiling
anonymous union</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR509">[llvm-g++] Do not use dynamic
initialization where static init will do</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR510">[llvmgcc] Field offset
miscalculated for some structure fields following bit fields</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR513">[llvm-g++] Temporary lifetimes
incorrect for short circuit logical operations</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR517">[llvm-gcc] Crash compiling
bitfield &lt;-&gt; aggregate assignment</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR520">[llvm-g++] Error compiling
virtual function thunk with an unnamed argument</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR522">[llvm-gcc] Crash on certain
C99 complex number routines</a></li>
<li><a href="http://llvm.cs.uiuc.edu/PR529">[llvm-g++] Crash using placement
new on an array type</a></li>
</ol>
</div>
<!-- *********************************************************************** -->
@@ -344,16 +350,17 @@ initialized unsigned bitfields</a></li>
<div class="doc_text">
<p>LLVM is known to work in the following platforms:</p>
<p>LLVM is known to work on the following platforms:</p>
<ul>
<li>Intel and AMD machines running Red Hat Linux and FreeBSD (and probably
other unix-like systems).</li>
<li>Intel and AMD machines running Red Hat Linux, Fedora Core and FreeBSD
(and probably other unix-like systems).</li>
<li>Sun UltraSPARC workstations running Solaris 8.</li>
<li>Intel and AMD machines running on Win32 with the Cygwin libraries.</li>
<li>PowerPC-based Mac OS X boxes, running 10.2 and above. Note that no JIT
support is available yet, and LLC support is beta. The C backend can be used
to produce stable code for this platform.</li>
<li>Intel and AMD machines running on Win32 with the Cygwin libraries (limited
support is available for native builds with Visual C++).</li>
<li>PowerPC-based Mac OS X systems, running 10.2 and above.</li>
<li>Alpha-based machines running Debian GNU/Linux.</li>
<li>Itanium-based machines running Linux and HP-UX.</li>
</ul>
<p>The core LLVM infrastructure uses
@@ -362,13 +369,6 @@ to the machine and operating system on which it is built. However, minor
porting may be required to get LLVM to work on new platforms. We welcome your
portability patches and reports of successful builds or error messages.</p>
<p>Note that the LLVM build system does not currently support directories with
spaces on them when running on Win32/cygwin. We strongly recommend running
LLVM and the C frontend out of a top-level directory without spaces (e.g.,
<tt>/cygdrive/c/llvm</tt>). Also, make sure to install <b>all</b> of the
cygwin packages. By default, many important tools are not installed that
are needed by the LLVM build process or test suite (e.g., /bin/time).</p>
</div>
<!-- *********************************************************************** -->
@@ -401,15 +401,13 @@ 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 PowerPC backend is incomplete and is known to miscompile several SPEC
benchmarks. The file <tt>llvm/lib/Target/PowerPC/README.txt</tt> has
details.</li>
<li>The following passes are incomplete or buggy: <tt>-pgmdep, -memdep,
-ipmodref, -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>
<li>The following passes are incomplete or buggy, and may be removed in future
releases: <tt>-cee, -branch-combine, -instloops, -paths, -pre</tt></li>
<li>The <tt>llvm-db</tt> tool is in a very early stage of development, but can
be used to step through programs and inspect the stack.</li>
<li>The "iterative scan" register allocator (enabled with
<tt>-regalloc=iterativescan</tt>) is not stable.</li>
<li>The SparcV8, Alpha, and IA64 code generators are experimental.</li>
</ul>
</div>
@@ -422,26 +420,16 @@ details.</li>
<div class="doc_text">
<ul>
<li>In the JIT, <tt>dlsym</tt> on a symbol compiled by the JIT will not
work.</li>
<li>The JIT does not use mutexes to protect its internal data structures. As
such, execution of a threaded program could cause these data structures to be
corrupted.</li>
<li>It is not possible to <tt>dlopen</tt> an LLVM bytecode file in the JIT.</li>
<li>Linking in static archive files (.a files) is very slow (there is no symbol
table in the archive).</li>
<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>
<li>In the JIT, <tt>dlsym()</tt> on a symbol compiled by the JIT will not
work.</li>
<li>The JIT does not use mutexes to protect its internal data structures. As
such, execution of a threaded program could cause these data structures to be
corrupted.
</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>
@@ -465,11 +453,7 @@ register file.</li>
</pre></li>
<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>
href="http://llvm.cs.uiuc.edu/PR162">with the largest union member</a>.</li>
</ul>
</div>
@@ -511,7 +495,7 @@ work:
<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/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/Thread-Local.html#Thread-Local">Thread-Local</a>: Per-thread variables.</li>
<li><a href="http://gcc.gnu.org/onlinedocs/gcc/Thread_002dLocal.html">Thread-Local</a>: Per-thread variables.</li>
<li><a href="http://gcc.gnu.org/onlinedocs/gcc/Pragmas.html#Pragmas">Pragmas</a>: Pragmas accepted by GCC.</li>
</ol>
@@ -532,10 +516,11 @@ work:
return.<br>
<b>Supported:</b> <tt>format</tt>, <tt>format_arg</tt>, <tt>non_null</tt>,
<tt>constructor</tt>, <tt>destructor</tt>, <tt>unused</tt>,
<tt>noreturn</tt>, <tt>constructor</tt>, <tt>destructor</tt>,
<tt>unused</tt>,
<tt>deprecated</tt>, <tt>warn_unused_result</tt>, <tt>weak</tt><br>
<b>Ignored:</b> <tt>noreturn</tt>, <tt>noinline</tt>,
<b>Ignored:</b> <tt>noinline</tt>,
<tt>always_inline</tt>, <tt>pure</tt>, <tt>const</tt>, <tt>nothrow</tt>,
<tt>malloc</tt>, <tt>no_instrument_function</tt>, <tt>cdecl</tt><br>
@@ -568,7 +553,9 @@ work:
<tt>__builtin_types_compatible_p</tt>, <tt>__builtin_choose_expr</tt>,
<tt>__builtin_constant_p</tt>, and <tt>__builtin_expect</tt>
(currently ignored). We also support builtins for ISO C99 floating
point comparison macros (e.g., <tt>__builtin_islessequal</tt>).</li>
point comparison macros (e.g., <tt>__builtin_islessequal</tt>),
<tt>__builtin_prefetch</tt>, <tt>__builtin_popcount[ll]</tt>,
<tt>__builtin_clz[ll]</tt>, and <tt>__builtin_ctz[ll]</tt>.</li>
</ol>
<p>The following extensions <b>are</b> known to be supported:</p>
@@ -596,7 +583,7 @@ or arrays as values.</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/Mixed-Declarations.html#Mixed%20Declarations">Mixed Declarations</a>: Mixing declarations and code.</li>
<li><a href="http://gcc.gnu.org/onlinedocs/gcc/Function-Prototypes.html#Function%20Prototypes">Function Prototypes</a>: Prototype declarations and old-style definitions.</li>
<li><a href="http://gcc.gnu.org/onlinedocs/gcc/C---Comments.html#C++%20Comments">C++ Comments</a>: C++ comments are recognized.</li>
<li><a href="http://gcc.gnu.org/onlinedocs/gcc/C_002b_002b-Comments.html#C_002b_002b-Comments">C++ Comments</a>: C++ comments are recognized.</li>
<li><a href="http://gcc.gnu.org/onlinedocs/gcc/Dollar-Signs.html#Dollar%20Signs">Dollar Signs</a>: Dollar sign is allowed in identifiers.</li>
<li><a href="http://gcc.gnu.org/onlinedocs/gcc/Character-Escapes.html#Character%20Escapes">Character Escapes</a>: <code>\e</code> stands for the character &lt;ESC&gt;.</li>
<li><a href="http://gcc.gnu.org/onlinedocs/gcc/Alignment.html#Alignment">Alignment</a>: Inquiring about the alignment of a type or variable.</li>
@@ -623,10 +610,9 @@ lists, please let us know (also including whether or not they work).</p>
<div class="doc_text">
<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
works for a number of non-trivial programs, but there may be lurking bugs.
Please report any bugs or problems.</p>
<p>For this release, the C++ front-end is considered to be fully
tested and works for a number of non-trivial programs, including LLVM
itself.</p>
</div>
@@ -639,12 +625,6 @@ Please report any bugs or problems.</p>
<li>The C++ front-end inherits all problems afflicting the <a href="#c-fe">C
front-end</a>.</li>
<li><b>IA-64 specific</b>: The C++ front-end does not use <a
href="http://llvm.cs.uiuc.edu/PR406">IA64 ABI compliant layout of v-tables</a>.
In particular, it just stores function pointers instead of function
descriptors in the vtable. This bug prevents mixing C++ code compiled with
LLVM with C++ objects compiled by other C++ compilers.</li>
</ul>
</div>
@@ -684,6 +664,28 @@ href="http://gcc.gnu.org/gcc-3.4/changes.html">GCC 3.4 release notes</a>.</li>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection">
<a name="c-be">Known problems with the C back-end</a>
</div>
<div class="doc_text">
<ul>
<li>The C back-end produces code that violates the ANSI C Type-Based Alias
Analysis rules. As such, special options may be necessary to compile the code
(for example, GCC requires the <tt>-fno-strict-aliasing</tt> option). This
problem probably cannot be fixed.</li>
<li><a href="http://llvm.cs.uiuc.edu/PR56">Zero arg vararg functions are not
supported</a>. This should not affect LLVM produced by the C or C++
frontends.</li>
</ul>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection">
<a name="x86-be">Known problems with the X86 back-end</a>
@@ -692,7 +694,20 @@ href="http://gcc.gnu.org/gcc-3.4/changes.html">GCC 3.4 release notes</a>.</li>
<div class="doc_text">
<ul>
<li>none yet</li>
<li><a href="http://llvm.cs.uiuc.edu/PR566">Memory Mapped I/O Intrinsics do not fence memory</a></li>
</ul>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection">
<a name="ppc-be">Known problems with the PowerPC back-end</a>
</div>
<div class="doc_text">
<ul>
<li>None yet</li>
</ul>
</div>
@@ -713,30 +728,71 @@ several programs in the LLVM test suite</a></li>
<!-- ======================================================================= -->
<div class="doc_subsection">
<a name="c-be">Known problems with the C back-end</a>
<a name="alpha-be">Known problems with the Alpha back-end</a>
</div>
<div class="doc_text">
<ul>
<li>The C back-end produces code that violates the ANSI C Type-Based Alias
Analysis rules. As such, special options may be necessary to compile the code
(for example, GCC requires the <tt>-fno-strict-aliasing</tt> option). This
problem probably cannot be fixed.</li>
<li>On 21164s, some rare FP arithmetic sequences which may trap do not have the
appropriate nops inserted to ensure restartability.</li>
<li><a href="http://llvm.cs.uiuc.edu/PR33">Initializers for global variables</a>
cannot include special floating point numbers like Not-A-Number or
Infinity.</li>
<li>Defining vararg functions is not supported (but calling them is ok).</li>
<li><a href="http://llvm.cs.uiuc.edu/PR56">Zero arg vararg functions are not
supported</a>. This should not affect LLVM produced by the C or C++
frontends.</li>
<li>Due to the vararg problems, C++ exceptions do not work. Small changes are required to the CFE (which break correctness in the exception handler) to compile the exception handling library (and thus the C++ standard library).</li>
</ul>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection">
<a name="ia64-be">Known problems with the IA64 back-end</a>
</div>
<div class="doc_text">
<ul>
<li>C++ programs are likely to fail on IA64, as calls to <tt>setjmp</tt> are
made where the argument is not 16-byte aligned, as required on IA64. (Strictly
speaking this is not a bug in the IA64 back-end; it will also be encountered
when building C++ programs using the C back-end.)</li>
<li>The C++ front-end does not use <a href="http://llvm.cs.uiuc.edu/PR406">IA64
ABI compliant layout of v-tables</a>. In particular, it just stores function
pointers instead of function descriptors in the vtable. This bug prevents
mixing C++ code compiled with LLVM with C++ objects compiled by other C++
compilers.</li>
<li>There are a few ABI violations which will lead to problems when mixing LLVM
output with code built with other compilers, particularly for floating-point
programs.</li>
<li>Defining vararg functions is not supported (but calling them is ok).</li>
</ul>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection">
<a name="sparcv8">Known problems with the SPARC-V8 back-end</a>
</div>
<div class="doc_text">
<ul>
<li>Many features are still missing (e.g. support for 64-bit integer
arithmetic).</li>
<li>This backend needs to be updated to use the SelectionDAG instruction
selection framework.</li>
</ul>
</div>
<!-- *********************************************************************** -->
<div class="doc_section">
<a name="additionalinfo">Additional Information</a>
@@ -745,15 +801,17 @@ frontends.</li>
<div class="doc_text">
<p>A wide variety of additional information is available on the LLVM web page,
including mailing lists and publications describing algorithms and components
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
can access versions of these documents specific to this release by going into
the "<tt>llvm/doc/</tt>" directory in the LLVM tree.</p>
<p>A wide variety of additional information is available on the <a
href="http://llvm.cs.uiuc.edu">LLVM web page</a>, including <a
href="http://llvm.cs.uiuc.edu/docs/">documentation</a> and <a
href="http://llvm.cs.uiuc.edu/pubs/">publications describing algorithms and
components implemented in LLVM</a>. The web page also contains versions of the
API 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 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
us via the <a href="http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev">mailing
us via the <a href="http://llvm.cs.uiuc.edu/docs/#maillist"> mailing
lists</a>.</p>
</div>

View File

@@ -9,11 +9,10 @@
<div class="doc_title">Source Level Debugging with LLVM</div>
<table border="0" width="100%">
<tr>
<td valign="top">
<table class="layout" style="width:100%">
<tr class="layout">
<td class="left">
<ul>
<li><a href="#introduction">Introduction</a>
<ol>
<li><a href="#phil">Philosophy behind LLVM debugging information</a></li>
@@ -61,12 +60,11 @@
</ol></li>
</ul>
</td>
<td align="right" valign="top">
<td class="right">
<img src="img/venusflytrap.jpg" alt="A leafy and green bug eater" width="247"
height="369">
</td>
</tr>
</table>
</tr></table>
<div class="doc_author">
<p>Written by <a href="mailto:sabre@nondot.org">Chris Lattner</a></p>
@@ -74,8 +72,8 @@ height="369">
<!-- *********************************************************************** -->
<div class="doc_section"><a name="introduction">Introduction</a></div> <!--
*********************************************************************** -->
<div class="doc_section"><a name="introduction">Introduction</a></div>
<!-- *********************************************************************** -->
<div class="doc_text">
@@ -225,7 +223,7 @@ compatible with the LLVM license).</p>
<p>For someone so inclined, it should be straight-forward to write different
front-ends for the LLVM debugger, as the LLVM debugging engine is cleanly
separated from the <tt>llvm-db</tt> front-end. A new LLVM GUI debugger or IDE
would be nice. :)</p>
would be nice.</p>
</div>
@@ -248,7 +246,7 @@ interface as possible. This should make it extremely easy to learn
provides the subset of GDB commands that are applicable to LLVM debugging users.
If there is a command missing that make a reasonable amount of sense within the
<a href="#limitations">limitations of <tt>llvm-db</tt></a>, please report it as
a bug or, better yet, submit a patch to add it. :)</p>
a bug or, better yet, submit a patch to add it.</p>
</div>
@@ -1030,6 +1028,7 @@ change in the future.</p>
<div class="doc_section">
<a name="ccxx_frontend">C/C++ front-end specific debug information</a>
</div>
<!-- *********************************************************************** -->
<div class="doc_text">

View File

@@ -4,10 +4,6 @@
<head>
<title>Stacker: An Example Of Using LLVM</title>
<link rel="stylesheet" href="llvm.css" type="text/css">
<style>
table, tr, td { border: 2px solid gray }
table { border-collapse: collapse; margin-bottom: 2em }
</style>
</head>
<body>
@@ -515,16 +511,16 @@ using the following construction:</p>
</ol>
</div>
<div class="doc_text" >
<table class="doc_table">
<tr class="doc_table"><td colspan="4">Definition Of Operation Of Built In Words</td></tr>
<tr class="doc_table"><td colspan="4"><b>LOGICAL OPERATIONS</b></td></tr>
<tr class="doc_table">
<table>
<tr><th colspan="4">Definition Of Operation Of Built In Words</th></tr>
<tr><th colspan="4"><b>LOGICAL OPERATIONS</b></th></tr>
<tr>
<td>Word</td>
<td>Name</td>
<td>Operation</td>
<td>Description</td>
</tr>
<tr class="doc_table">
<tr>
<td>&lt;</td>
<td>LT</td>
<td>w1 w2 -- b</td>
@@ -581,7 +577,7 @@ using the following construction:</p>
<td> -- b</td>
<td>The boolean value TRUE (-1) is pushed on to the stack.</td>
</tr>
<tr><td colspan="4"><b>BITWISE OPERATORS</b></td></tr>
<tr><th colspan="4"><b>BITWISE OPERATORS</b></th></tr>
<tr>
<td>Word</td>
<td>Name</td>
@@ -623,7 +619,7 @@ using the following construction:</p>
are bitwise exclusive OR'd together and pushed back on the stack.
For example, The sequence 1 3 XOR yields 2.</td>
</tr>
<tr><td colspan="4"><b>ARITHMETIC OPERATORS</b></td></tr>
<tr><th colspan="4"><b>ARITHMETIC OPERATORS</b></th></tr>
<tr>
<td>Word</td>
<td>Name</td>
@@ -704,7 +700,7 @@ using the following construction:</p>
<td>Two values are popped off the stack. The larger value is pushed back
on to the stack.</td>
</tr>
<tr><td colspan="4"><b>STACK MANIPULATION OPERATORS</b></td></tr>
<tr><th colspan="4"><b>STACK MANIPULATION OPERATORS</b></th></tr>
<tr>
<td>Word</td>
<td>Name</td>
@@ -791,7 +787,7 @@ using the following construction:</p>
</tr>
<tr><td>RROT</td>
<td>RROT</td>
<td>w1 w2 w3 -- w2 w3 w1</td>
<td>w1 w2 w3 -- w3 w1 w2</td>
<td>Reverse rotation. Like ROT, but it rotates the other way around.
Essentially, the third element on the stack is moved to the top
of the stack.</td>
@@ -849,7 +845,7 @@ using the following construction:</p>
how much to rotate. That is, ROLL with n=1 is the same as ROT and
ROLL with n=2 is the same as ROT2.</td>
</tr>
<tr><td colspan="4"><b>MEMORY OPERATORS</b></td></tr>
<tr><th colspan="4"><b>MEMORY OPERATORS</b></th></tr>
<tr>
<td>Word</td>
<td>Name</td>
@@ -902,7 +898,7 @@ using the following construction:</p>
pushed back on the stack so this doesn't count as a "use ptr"
in the FREE idiom.</td>
</tr>
<tr><td colspan="4"><b>CONTROL FLOW OPERATORS</b></td></tr>
<tr><th colspan="4"><b>CONTROL FLOW OPERATORS</b></th></tr>
<tr>
<td>Word</td>
<td>Name</td>
@@ -950,26 +946,30 @@ using the following construction:</p>
executed. In either case, after the (words....) have executed, execution continues
immediately following the ENDIF. </td>
</tr>
<tr><td>WHILE (words...) END</td>
<td>WHILE (words...) END</td>
<tr><td>WHILE word END</td>
<td>WHILE word END</td>
<td>b -- b </td>
<td>The boolean value on the top of the stack is examined. If it is non-zero then the
"words..." between WHILE and END are executed. Execution then begins again at the WHILE where another
boolean is popped off the stack. To prevent this operation from eating up the entire
stack, you should push on to the stack (just before the END) a boolean value that indicates
whether to terminate. Note that since booleans and integers can be coerced you can
use the following "for loop" idiom:<br/>
<code>(push count) WHILE (words...) -- END</code><br/>
<td>The boolean value on the top of the stack is examined (not popped). If
it is non-zero then the "word" between WHILE and END is executed.
Execution then begins again at the WHILE where the boolean on the top of
the stack is examined again. The stack is not modified by the WHILE...END
loop, only examined. It is imperative that the "word" in the body of the
loop ensure that the top of the stack contains the next boolean to examine
when it completes. Note that since booleans and integers can be coerced
you can use the following "for loop" idiom:<br/>
<code>(push count) WHILE word -- END</code><br/>
For example:<br/>
<code>10 WHILE DUP &gt;d -- END</code><br/>
This will print the numbers from 10 down to 1. 10 is pushed on the stack. Since that is
non-zero, the while loop is entered. The top of the stack (10) is duplicated and then
printed out with &gt;d. The top of the stack is decremented, yielding 9 and control is
transfered back to the WHILE keyword. The process starts all over again and repeats until
the top of stack is decremented to 0 at which the WHILE test fails and control is
transfered to the word after the END.</td>
<code>10 WHILE &gt;d -- END</code><br/>
This will print the numbers from 10 down to 1. 10 is pushed on the
stack. Since that is non-zero, the while loop is entered. The top of
the stack (10) is printed out with &gt;d. The top of the stack is
decremented, yielding 9 and control is transfered back to the WHILE
keyword. The process starts all over again and repeats until
the top of stack is decremented to 0 at which point the WHILE test
fails and control is transfered to the word after the END.
</td>
</tr>
<tr><td colspan="4"><b>INPUT &amp; OUTPUT OPERATORS</b></td></tr>
<tr><th colspan="4"><b>INPUT &amp; OUTPUT OPERATORS</b></th></tr>
<tr>
<td>Word</td>
<td>Name</td>
@@ -1379,8 +1379,6 @@ interested, here are some things that could be implemented better:</p>
<li>Write an LLVM pass to optimize the use of the global stack. The code
emitted currently is somewhat wasteful. It gets cleaned up a lot by existing
passes but more could be done.</li>
<li>Add -O -O1 -O2 and -O3 optimization switches to the compiler driver to
allow LLVM optimization without using "opt."</li>
<li>Make the compiler driver use the LLVM linking facilities (with IPO)
before depending on GCC to do the final link.</li>
<li>Clean up parsing. It doesn't handle errors very well.</li>

View File

@@ -8,35 +8,26 @@
<body>
<div class="doc_title">System Library</div>
<div class="doc_warning">
<p>Warning: This document is a work in progress.</p>
</div>
<ul>
<li><a href="#abstract">Abstract</a></li>
<li><a href="#requirements">System Library Requirements</a>
<li><a href="#requirements">Keeping LLVM Portable</a>
<ol>
<li><a href="#headers">Hide System Header Files</a></li>
<li><a href="#headers">Don't Include System Headers</a></li>
<li><a href="#expose">Don't Expose System Headers</a></li>
<li><a href="#c_headers">Allow Standard C Header Files</a></li>
<li><a href="#cpp_headers">Allow Standard C++ Header Files</a></li>
<li><a href="#highlev">High-Level Interface</a></li>
<li><a href="#nofunc">No Exposed Functions</a></li>
<li><a href="#nodata">No Exposed Data</a></li>
<li><a href="#xcptns">No Exceptions</a></li>
<li><a href="#errors">Standard Error Codes</a></li>
<li><a href="#overhead">Minimize Overhead</a></li>
</ol></li>
<li><a href="#design">System Library Design</a>
<ol>
<li><a href="#opaque">Use Opaque Classes</a></li>
<li><a href="#common">Common Implementations</a></li>
<li><a href="#multi_imps">Multiple Implementations</a></li>
<li><a href="#lowlevel">Use Low Level Interfaces</a></li>
<li><a href="#memalloc">No Memory Allocation</a></li>
<li><a href="#nodupl">No Duplicate Implementations</a></li>
<li><a href="#nounused">No Unused Functionality</a></li>
<li><a href="#virtuals">No Virtual Methods</a></li>
</ol></li>
<li><a href="#detail">System Library Details</a>
<ol>
<li><a href="#softerrors">Minimize Soft Errors</a></li>
<li><a href="#throw">Throw Only std::string</a></li>
<li><a href="#throw_spec">No throw() Specifications</a></li>
<li><a href="#organization">Code Organization</a></li>
<li><a href="#semantics">Consistent Semantics</a></li>
<li><a href="#bug">Tracking Bugzilla Bug: 351</a></li>
<li><a href="#refimpl">Reference Implementatation</a></li>
</ol></li>
</ul>
@@ -48,123 +39,285 @@
<!-- *********************************************************************** -->
<div class="doc_section"><a name="abstract">Abstract</a></div>
<div class="doc_text">
<p>This document describes the requirements, design, and implementation
details of LLVM's System Library. The library is composed of the header files
in <tt>llvm/include/llvm/System</tt> and the source files in
<tt>llvm/lib/System</tt>. The goal of this library is to completely shield
LLVM from the variations in operating system interfaces. By centralizing
LLVM's use of operating system interfaces, we make it possible for the LLVM
tool chain and runtime libraries to be more easily ported to new platforms.
The library also unclutters the rest of LLVM from #ifdef use and special
cases for specific operating systems.</p>
<p>The System Library was donated to LLVM by Reid Spencer who formulated the
original design as part of the eXtensible Programming System (XPS) which is
based, in part, on LLVM.</p>
<p>This document provides some details on LLVM's System Library, located in
the source at <tt>lib/System</tt> and <tt>include/llvm/System</tt>. The
library's purpose is to shield LLVM from the differences between operating
systems for the few services LLVM needs from the operating system. Much of
LLVM is written using portability features of standard C++. However, in a few
areas, system dependent facilities are needed and the System Library is the
wrapper around those system calls.</p>
<p>By centralizing LLVM's use of operating system interfaces, we make it
possible for the LLVM tool chain and runtime libraries to be more easily
ported to new platforms since (theoretically) only <tt>lib/System</tt> needs
to be ported. This library also unclutters the rest of LLVM from #ifdef use
and special cases for specific operating systems. Such uses are replaced
with simple calls to the interfaces provided in <tt>include/llvm/System</tt>.
</p>
<p>Note that the System Library is not intended to be a complete operating
system wrapper (such as the Adaptive Communications Environment (ACE) or
Apache Portable Runtime (APR)), but only provides the functionality necessary
to support LLVM.
<p>The System Library was written by Reid Spencer who formulated the
design based on similar work originating from the eXtensible Programming
System (XPS). Several people helped with the effort; especially,
Jeff Cohen and Henrik Bach on the Win32 port.</p>
</div>
<!-- *********************************************************************** -->
<div class="doc_section">
<a name="requirements">System Library Requirements</a>
<a name="requirements">Keeping LLVM Portable</a>
</div>
<div class="doc_text">
<p>The System library's requirements are aimed at shielding LLVM from the
variations in operating system interfaces. The following sections define the
requirements needed to fulfill this objective.</p>
<p>In order to keep LLVM portable, LLVM developers should adhere to a set of
portability rules associated with the System Library. Adherence to these rules
should help the System Library achieve its goal of shielding LLVM from the
variations in operating system interfaces and doing so efficiently. The
following sections define the rules needed to fulfill this objective.</p>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection"><a name="headers">Hide System Header Files</a></div>
<div class="doc_subsection"><a name="headers">Don't Inlcude System Headers</a>
</div>
<div class="doc_text">
<p>To be written.</p>
<p>Except in <tt>lib/System</tt>, no LLVM source code should directly
<tt>#include</tt> a system header. Care has been taken to remove all such
<tt>#includes</tt> from LLVM while <tt>lib/System</tt> was being
developed. Specifically this means that header files like "unistd.h",
"windows.h", "stdio.h", and "string.h" are forbidden to be included by LLVM
source code outside the implementation of <tt>lib/System</tt>.</p>
<p>To obtain system-dependent functionality, existing interfaces to the system
found in <tt>include/llvm/System</tt> should be used. If an appropriate
interface is not available, it should be added to <tt>include/llvm/System</tt>
and implemented in <tt>lib/System</tt> for all supported platforms.</p>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection"><a name="nofunc">No Exposed Functions</a></div>
<div class="doc_subsection"><a name="expose">Don't Expose System Headers</a>
</div>
<div class="doc_text">
<p>To be written.</p>
<p>The System Library must shield LLVM from <em>all</em> system headers. To
obtain system level functionality, LLVM source must
<tt>#include "llvm/System/Thing.h"</tt> and nothing else. This means that
<tt>Thing.h</tt> cannot expose any system header files. This protects LLVM
from accidentally using system specific functionality and only allows it
via the <tt>lib/System</tt> interface.</p>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection"><a name="nodata">No Exposed Data</a></div>
<div class="doc_subsection"><a name="c_headers">Use Standard C Headers</a></div>
<div class="doc_text">
<p>To be written.</p>
<p>The <em>standard</em> C headers (the ones beginning with "c") are allowed
to be exposed through the <tt>lib/System</tt> interface. These headers and
the things they declare are considered to be platform agnostic. LLVM source
files may include them directly or obtain their inclusion through
<tt>lib/System</tt> interfaces.</p>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection"><a name="xcptns">No Exceptions</a></div>
<div class="doc_subsection"><a name="cpp_headers">Use Standard C++ Headers</a>
</div>
<div class="doc_text">
<p>To be written.</p>
<p>The <em>standard</em> C++ headers from the standard C++ library and
standard template library may be exposed through the <tt>lib/System</tt>
interface. These headers and the things they declare are considered to be
platform agnostic. LLVM source files may include them or obtain their
inclusion through lib/System interfaces.</p>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection"><a name="errors">Standard Error Codes</a></div>
<div class="doc_subsection"><a name="highlev">High Level Interface</a></div>
<div class="doc_text">
<p>To be written.</p>
<p>The entry points specified in the interface of lib/System must be aimed at
completing some reasonably high level task needed by LLVM. We do not want to
simply wrap each operating system call. It would be preferable to wrap several
operating system calls that are always used in conjunction with one another by
LLVM.</p>
<p>For example, consider what is needed to execute a program, wait for it to
complete, and return its result code. On Unix, this involves the following
operating system calls: <tt>getenv, fork, execve,</tt> and <tt>wait</tt>. The
correct thing for lib/System to provide is a function, say
<tt>ExecuteProgramAndWait</tt>, that implements the functionality completely.
what we don't want is wrappers for the operating system calls involved.</p>
<p>There must <em>not</em> be a one-to-one relationship between operating
system calls and the System library's interface. Any such interface function
will be suspicious.</p>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection"><a name="overhead">Minimize Overhead</a></div>
<div class="doc_subsection"><a name="nounused">No Unused Functionality</a></div>
<div class="doc_text">
<p>To be written.</p>
</div>
<!-- *********************************************************************** -->
<div class="doc_section"><a name="design">System Library Design</a></div>
<div class="doc_text">
<p>In order to fulfill the requirements of the system library, strict design
objectives must be maintained in the library as it evolves. The goal here
is to provide interfaces to operating system concepts (files, memory maps,
sockets, signals, locking, etc) efficiently and in such a way that the
remainder of LLVM is completely operating system agnostic.</p>
<p>There must be no functionality specified in the interface of lib/System
that isn't actually used by LLVM. We're not writing a general purpose
operating system wrapper here, just enough to satisfy LLVM's needs. And, LLVM
doesn't need much. This design goal aims to keep the lib/System interface
small and understandable which should foster its actual use and adoption.</p>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection"><a name="opaque">Use Opaque Classes</a></div>
<div class="doc_text">
<p>no public data</p>
<p>onlyprimitive typed private/protected data</p>
<p>data size is "right" for platform, not max of all platforms</p>
<p>each class corresponds to O/S concept</p>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection"><a name="common">Common Implementations</a></div>
<div class="doc_text">
<p>To be written.</p>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection">
<a name="multi_imps">Multiple Implementations</a>
<div class="doc_subsection"><a name="nodupl">No Duplicate Implementations</a>
</div>
<div class="doc_text">
<p>To be written.</p>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection">
<a name="low_level">Use Low Level Interfaces</a>
</div>
<div class="doc_text">
<p>To be written.</p>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection"><a name="memalloc">No Memory Allocation</a></div>
<div class="doc_text">
<p>To be written.</p>
<p>The implementation of a function for a given platform must be written
exactly once. This implies that it must be possible to apply a function's
implementation to multiple operating systems if those operating systems can
share the same implementation. This rule applies to the set of operating
systems supported for a given class of operating system (e.g. Unix, Win32).
</p>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection"><a name="virtuals">No Virtual Methods</a></div>
<div class="doc_text">
<p>To be written.</p>
<p>The System Library interfaces can be called quite frequently by LLVM. In
order to make those calls as efficient as possible, we discourage the use of
virtual methods. There is no need to use inheritance for implementation
differences, it just adds complexity. The <tt>#include</tt> mechanism works
just fine.</p>
</div>
<!-- *********************************************************************** -->
<div class="doc_section"><a name="detail">System Library Details</a></div>
<!-- ======================================================================= -->
<div class="doc_subsection"><a name="nofunc">No Exposed Functions</a></div>
<div class="doc_text">
<p>To be written.</p>
<p>Any functions defined by system libraries (i.e. not defined by lib/System)
must not be exposed through the lib/System interface, even if the header file
for that function is not exposed. This prevents inadvertent use of system
specific functionality.</p>
<p>For example, the <tt>stat</tt> system call is notorious for having
variations in the data it provides. <tt>lib/System</tt> must not declare
<tt>stat</tt> nor allow it to be declared. Instead it should provide its own
interface to discovering information about files and directories. Those
interfaces may be implemented in terms of <tt>stat</tt> but that is strictly
an implementation detail. The interface provided by the System Library must
be implemented on all platforms (even those without <tt>stat</tt>).</p>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection"><a name="nodata">No Exposed Data</a></div>
<div class="doc_text">
<p>Any data defined by system libraries (i.e. not defined by lib/System) must
not be exposed through the lib/System interface, even if the header file for
that function is not exposed. As with functions, this prevents inadvertent use
of data that might not exist on all platforms.</p>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection"><a name="softerrors">Minimize Soft Errors</a></div>
<div class="doc_text">
<p>Operating system interfaces will generally provide error results for every
little thing that could go wrong. In almost all cases, you can divide these
error results into two groups: normal/good/soft and abnormal/bad/hard. That
is, some of the errors are simply information like "file not found",
"insufficient privileges", etc. while other errors are much harder like
"out of space", "bad disk sector", or "system call interrupted". We'll call
the first group "<i>soft</i>" errors and the second group "<i>hard</i>"
errors.<p>
<p>lib/System must always attempt to minimize soft errors and always just
throw a std::string on hard errors. This is a design requirement because the
minimization of soft errors can affect the granularity and the nature of the
interface. In general, if you find that you're wanting to throw soft errors,
you must review the granularity of the interface because it is likely you're
trying to implement something that is too low level. The rule of thumb is to
provide interface functions that <em>can't</em> fail, except when faced with
hard errors.</p>
<p>For a trivial example, suppose we wanted to add an "OpenFileForWriting"
function. For many operating systems, if the file doesn't exist, attempting
to open the file will produce an error. However, lib/System should not
simply throw that error if it occurs because its a soft error. The problem
is that the interface function, OpenFileForWriting is too low level. It should
be OpenOrCreateFileForWriting. In the case of the soft "doesn't exist" error,
this function would just create it and then open it for writing.</p>
<p>This design principle needs to be maintained in lib/System because it
avoids the propagation of soft error handling throughout the rest of LLVM.
Hard errors will generally just cause a termination for an LLVM tool so don't
be bashful about throwing them.</p>
<p>Rules of thumb:</p>
<ol>
<li>Don't throw soft errors, only hard errors.</li>
<li>If you're tempted to throw a soft error, re-think the interface.</li>
<li>Handle internally the most common normal/good/soft error conditions
so the rest of LLVM doesn't have to.</li>
</ol>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection"><a name="throw">Throw Only std::string</a></div>
<div class="doc_text">
<p>If an error occurs that lib/System cannot handle, the only action taken by
lib/System is to throw an instance of std:string. The contents of the string
must explain both what happened and the context in which it happened. The
format of the string should be a (possibly empty) list of contexts each
terminated with a : and a space, followed by the error message, optionally
followed by a reason, and optionally followed by a suggestion.</p>
<p>For example, failure to open a file named "foo" could result in a message
like:</p>
<ul><li>foo: Unable to open file because it doesn't exist."</li></ul>
<p>The "foo:" part is the context. The "Unable to open file" part is the error
message. The "because it doesn't exist." part is the reason. This message has
no suggestion. Where possible, the implementation of lib/System should use
operating system specific facilities for converting the error code returned by
a system call into an error message. This will help to make the error message
more familiar to users of that type of operating system.</p>
<p>Note that this requirement precludes the throwing of any other exceptions.
For example, various C++ standard library functions can cause exceptions to be
thrown (e.g. out of memory situation). In all cases, if there is a possibility
that non-string exceptions could be thrown, the lib/System library must ensure
that the exceptions are translated to std::string form.</p>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection"><a name="throw_spec">No throw Specifications</a>
</div>
<div class="doc_text">
<p>None of the lib/System interface functions may be declared with C++
<tt>throw()</tt> specifications on them. This requirement makes sure that the
compiler does not insert additional exception handling code into the interface
functions. This is a performance consideration: lib/System functions are at
the bottom of many call chains and as such can be frequently called. We
need them to be as efficient as possible.</p>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection"><a name="organization">Code Organization</a></div>
<div class="doc_text">
<p>Implementations of the System Library interface are separated by their
general class of operating system. Currently only Unix and Win32 classes are
defined but more could be added for other operating system classifications.
To distinguish which implementation to compile, the code in lib/System uses
the LLVM_ON_UNIX and LLVM_ON_WIN32 #defines provided via configure through the
llvm/Config/config.h file. Each source file in lib/System, after implementing
the generic (operating system independent) functionality needs to include the
correct implementation using a set of <tt>#if defined(LLVM_ON_XYZ)</tt>
directives. For example, if we had lib/System/File.cpp, we'd expect to see in
that file:</p>
<pre><tt>
#if defined(LLVM_ON_UNIX)
#include "Unix/File.cpp"
#endif
#if defined(LLVM_ON_WIN32)
#include "Win32/File.cpp"
#endif
</tt></pre>
<p>The implementation in lib/System/Unix/File.cpp should handle all Unix
variants. The implementation in lib/System/Win32/File.cpp should handle all
Win32 variants. What this does is quickly differentiate the basic class of
operating system that will provide the implementation. The specific details
for a given platform must still be determined through the use of
<tt>#ifdef</tt>.</p>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection"><a name="semantics">Consistent Semantics</a></div>
<div class="doc_text">
<p>The implementation of a lib/System interface can vary drastically between
platforms. That's okay as long as the end result of the interface function
is the same. For example, a function to create a directory is pretty straight
forward on all operating system. System V IPC on the other hand isn't even
supported on all platforms. Instead of "supporting" System V IPC, lib/System
should provide an interface to the basic concept of inter-process
communications. The implementations might use System V IPC if that was
available or named pipes, or whatever gets the job done effectively for a
given operating system. In all cases, the interface and the implementation
must be semantically consistent. </p>
</div>
<!-- ======================================================================= -->
@@ -174,18 +327,6 @@
for further details on the progress of this work</p>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection">
<a name="refimpl">Reference Implementation</a>
</div>
<div class="doc_text">
<p>The <tt>linux</tt> implementation of the system library will always be the
reference implementation. This means that (a) the concepts defined by the
linux must be identically replicated in the other implementations and (b) the
linux implementation must always be complete (provide implementations for all
concepts).</p>
</div>
<!-- *********************************************************************** -->
<hr>

View File

@@ -12,28 +12,30 @@
</div>
<ol>
<li><a href="#overview">Overview</a></li>
<li><a href="#Requirements">Requirements</a></li>
<li><a href="#quick">Quick Start</a></li>
<li><a href="#org">LLVM Test Suite Organization</a>
<ul>
<li><a href="#codefragments">Code Fragments</a></li>
<li><a href="#wholeprograms">Whole Programs</a></li>
</ul></li>
<li><a href="#tree">LLVM Test Suite Tree</a></li>
<li><a href="#qmstructure">QMTest Structure</a></li>
<li><a href="#progstructure">Programs Structure</a></li>
<li><a href="#run">Running the LLVM Tests</a></li>
<li><a href="#nightly">Running the nightly tester</a></li>
<li><a href="#overview">Overview</a></li>
<li><a href="#Requirements">Requirements</a></li>
<li><a href="#quick">Quick Start</a></li>
<li><a href="#org">LLVM Test Suite Organization</a>
<ul>
<li><a href="#codefragments">Code Fragments</a></li>
<li><a href="#wholeprograms">Whole Programs</a></li>
</ul>
</li>
<li><a href="#tree">LLVM Test Suite Tree</a></li>
<li><a href="#dgstructure">DejaGNU Structure</a></li>
<li><a href="#progstructure"><tt>llvm-test</tt> Structure</a></li>
<li><a href="#run">Running the LLVM Tests</a></li>
<li><a href="#nightly">Running the nightly tester</a></li>
</ol>
<div class="doc_author">
<p>Written by John T. Criswell</p>
<p>Written by John T. Criswell, <a
href="http://llvm.x10sys.com/rspencer">Reid Spencer</a>, and Tanya Lattner</p>
</div>
<!--===============================================================-->
<!--=========================================================================-->
<div class="doc_section"><a name="overview">Overview</a></div>
<!--===============================================================-->
<!--=========================================================================-->
<div class="doc_text">
@@ -43,9 +45,9 @@ and run tests.</p>
</div>
<!--===============================================================-->
<!--=========================================================================-->
<div class="doc_section"><a name="Requirements">Requirements</a></div>
<!--===============================================================-->
<!--=========================================================================-->
<div class="doc_text">
@@ -53,57 +55,98 @@ and run tests.</p>
required to build LLVM, plus the following:</p>
<dl>
<dt><a href="http://www.qmtest.com">QMTest</A></dt>
<dd>The LLVM test suite uses QMTest to organize and run tests. <b>Note:
you will need <a href="http://llvm.cs.uiuc.edu/qm-2.0.3.tar.gz">QMTest
2.0.3 (source tar.gz file)</a> to be successful. The tests do not run with
any other version.</b></dd>
<dt><a href="http://www.gnu.org/software/dejagnu/">DejaGNU</a></dt>
<dd>The Feature and Regressions tests are organized and run by DejaGNU.</dd>
<dt><a href="http://expect.nist.gov/">Expect</a></dt>
<dd>Expect is required by DejaGNU.</dd>
<dt><a href="http://www.tcl.tk/software/tcltk/">tcl</a></dt>
<dd>Tcl is required by DejaGNU. </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>
<dt><a href="http://www.netlib.org/f2c">F2C</a></dt>
<dd>For now, LLVM does not have a Fortran front-end, but using F2C, we can run
Fortran benchmarks. F2C support must be enabled via <tt>configure</tt> if not
installed in a standard place. F2C requires three items: the <tt>f2c</tt>
executable, <tt>f2c.h</tt> to compile the generated code, and <tt>libf2c.a</tt>
to link generated code. By default, given an F2C directory <tt>$DIR</tt>, the
configure script will search <tt>$DIR/bin</tt> for <tt>f2c</tt>,
<tt>$DIR/include</tt> for <tt>f2c.h</tt>, and <tt>$DIR/lib</tt> for
<tt>libf2c.a</tt>. The default <tt>$DIR</tt> values are: <tt>/usr</tt>,
<tt>/usr/local</tt>, <tt>/sw</tt>, and <tt>/opt</tt>. If you installed F2C in a
different location, you must tell <tt>configure</tt>:
<ul>
<li><tt>./configure --with-f2c=$DIR</tt><br>
This will specify a new <tt>$DIR</tt> for the above-described search
process. This will only work if the binary, header, and library are in their
respective subdirectories of <tt>$DIR</tt>.</li>
<li><tt>./configure --with-f2c-bin=/binary/path --with-f2c-inc=/include/path
--with-f2c-lib=/lib/path</tt><br>
This allows you to specify the F2C components separately. Note: if you choose
this route, you MUST specify all three components, and you need to only specify
<em>directories</em> where the files are located; do NOT include the
filenames themselves on the <tt>configure</tt> line.</li>
</ul></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>
<p>The tests are located in two separate CVS modules. The basic feature and
regression tests are in the main "llvm" module under the directory
<tt>llvm/test</tt>. A more comprehensive test suite that includes whole
programs in C and C++ is in the <tt>llvm-test</tt> module. This module should
be checked out to the <tt>llvm/projects</tt> directory. When you
<tt>configure</tt> the <tt>llvm</tt> module, the <tt>llvm-test</tt> module
will be automatically configured. Alternatively, you can configure the <tt>llvm-test</tt> module manually.</p>
<p>To run all of the simple tests in LLVM using DejaGNU, use the master Makefile in the
<tt>llvm/test</tt> directory:</p>
<pre>
% gmake -C llvm/test
% gmake -C llvm/test
</pre>
or<br>
<pre>
% gmake check
</pre>
<p>To run only the code fragment tests (i.e. those that do basic testing of
LLVM), run the tests organized by QMTest:</p>
<p>To run only a subdirectory of tests in llvm/test using DejaGNU (ie.
Regression/Transforms), just set the TESTSUITE variable to the path of the
subdirectory (relative to <tt>llvm/test</tt>):</p>
<pre>
% gmake -C llvm/test qmtest
% gmake -C llvm/test TESTSUITE=Regression/Transforms
</pre>
<p>To run only the tests that compile and execute whole programs, run the
Programs tests:</p>
<p><b>Note: If you are running the tests with <tt>objdir != subdir</tt>, you
must have run the complete testsuite before you can specify a
subdirectory.</b></p>
<p>To run the comprehensive test suite (tests that compile and execute whole
programs), run the <tt>llvm-test</tt> tests:</p>
<pre>
% gmake -C llvm/test/Programs
% cd llvm/projects
% cvs co llvm-test
% cd llvm-test
% ./configure --with-llvmsrc=$LLVM_SRC_ROOT --with-llvmobj=$LLVM_OBJ_ROOT
% gmake
</pre>
</div>
<!--===============================================================-->
<!--=========================================================================-->
<div class="doc_section"><a name="org">LLVM Test Suite Organization</a></div>
<!--===============================================================-->
<!--=========================================================================-->
<div class="doc_text">
<p>The LLVM test suite contains two major categories of tests: code
fragments and whole programs.</p>
fragments and whole programs. Code fragments are in the <tt>llvm</tt> module
under the <tt>llvm/test</tt> directory. The whole programs
test suite is in the <tt>llvm-test</tt> module under the main directory.</p>
</div>
@@ -120,8 +163,8 @@ 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>
<p>These code fragment tests are located in the <tt>llvm/test/Features</tt> and
<tt>llvm/test/Regression</tt> directories.</p>
</div>
@@ -133,7 +176,7 @@ fragments.</p>
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
@@ -144,171 +187,166 @@ 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>
<p>All "whole program" tests are located in the <tt>llvm-test</tt> CVS
module.</p>
</div>
<!--===============================================================-->
<!--=========================================================================-->
<div class="doc_section"><a name="tree">LLVM Test Suite Tree</a></div>
<!--===============================================================-->
<!--=========================================================================-->
<div class="doc_text">
<p>Each type of test in the LLVM test suite has its own directory. The major
subtrees of the test suite directory tree are as follows:</p>
<ul>
<li>Features
<p>This directory contains sample codes that test various features of the
LLVM language. These pieces of sample code are run through various
assembler, disassembler, and optimizer passes.</p>
<li>Regression
<p>This directory contains regression tests for LLVM. When a bug is found
in LLVM, a regression test containing just enough code to reproduce the
problem should be written and placed somewhere underneath this directory.
In most cases, this will be a small piece of LLVM assembly language code,
often distilled from an actual application or benchmark.</p>
<li>Programs
<p>The Programs directory contains programs that can be compiled with LLVM
and executed. These programs are compiled using the native compiler and
various LLVM backends. The output from the program compiled with the native
compiler is assumed correct; the results from the other programs are
compared to the native program output and pass if they match. </p>
<p> In addition for testing correctness, the Programs directory also
performs timing tests of various LLVM optimizations. It also records
compilation times for the compilers and the JIT. This information can be
used to compare the effectiveness of LLVM's optimizations and code
generation.</p>
<p>The Programs directory is subdivided into several smaller subdirectories:
</p>
<ul>
<li>Programs/SingleSource
<p>The SingleSource directory contains test programs that are only a
single source file in size. These are usually small benchmark programs
or small programs that calculate a particular value. Several such
programs are grouped together in each directory.</p></li>
<li>Programs/MultiSource
<p>The MultiSource directory contains subdirectories which contain
entire programs with multiple source files. Large benchmarks and whole
applications go here.</p></li>
<li>Programs/External
<p>The External directory contains Makefiles for building code that is
external to (i.e. not distributed with) LLVM. The most prominent member
of this directory is the SPEC 2000 benchmark suite. The presence and
location of these external programs is configured by the LLVM
<tt>configure</tt> script.</p></li>
</ul></li>
<li>QMTest
<p>This directory contains the QMTest information files. Inside this
directory are QMTest administration files and the Python code that
implements the LLVM test and database classes.</p>
</ul>
</div>
<!--===============================================================-->
<div class="doc_section"><a name="qmstructure">QMTest Structure</a></div>
<!--===============================================================-->
<div class="doc_text">
<p>The LLVM test suite is partially driven by QMTest and partially
driven by GNU Make. Specifically, the Features and Regression tests
are all driven by QMTest. The Programs directory is currently
driven by a set of Makefiles.</p>
<p>The QMTest system needs to have several pieces of information
available; these pieces of configuration information are known
collectively as the "context" in QMTest parlance. Since the context
for LLVM is relatively large, the master Makefile in llvm/test
sets it for you.</p>
<p>The LLVM database class makes the subdirectories of llvm/test a
QMTest test database. For each directory that contains tests driven by
QMTest, it knows what type of test the source file is and how to run it.</p>
<p>Hence, the QMTest namespace is essentially what you see in the
Feature and Regression directories, but there is some magic that
the database class performs (as described below).</p>
<p>The QMTest namespace is currently composed of the following tests and test
suites:</p>
<ul>
<li>Feature
<p>
These are the feature tests found in the Feature directory.
They are broken up into the following categories:
</p>
<ul>
<li>ad
<p>Assembler/Disassembler tests. These tests verify that a piece of LLVM
assembly language can be assembled into bytecode and then disassembled
into the original assembly language code. It does this several times to
ensure that assembled output can be disassembled and disassembler output
can be assembled. It also verifies that the give assembly language file
can be assembled correctly.</p></li>
<li><tt>llvm/test/Features</tt>
<p>This directory contains sample codes that test various features of the
LLVM language. These pieces of sample code are run through various
assembler, disassembler, and optimizer passes.</p>
</li>
<li>opt
<p>Optimizer tests. These tests verify that two of the optimizer passes
completely optimize a program (i.e. after a single pass, they cannot
optimize a program any further).</p></li>
<li><tt>llvm/test/Regression</tt>
<p>This directory contains regression tests for LLVM. When a bug is found
in LLVM, a regression test containing just enough code to reproduce the
problem should be written and placed somewhere underneath this directory.
In most cases, this will be a small piece of LLVM assembly language code,
often distilled from an actual application or benchmark.</p>
</li>
<li>mc
<p> Machine code tests. These tests verify that the LLVM assembly
language file can be translated into native assembly code.</p></li>
<li><tt>llvm-test</tt>
<p>The <tt>llvm-test</tt> CVS module contains programs that can be compiled
with LLVM and executed. These programs are compiled using the native compiler
and various LLVM backends. The output from the program compiled with the
native compiler is assumed correct; the results from the other programs are
compared to the native program output and pass if they match.</p>
<li>cc
<p>C code tests. These tests verify that the specified LLVM assembly
code can be converted into C source code using the C backend.</p></li>
</ul>
<p>In addition for testing correctness, the <tt>llvm-test</tt> directory also
performs timing tests of various LLVM optimizations. It also records
compilation times for the compilers and the JIT. This information can be
used to compare the effectiveness of LLVM's optimizations and code
generation.</p></li>
<p>The LLVM database class looks at every file in the Feature directory and
creates a fake test hierarchy containing
<tt>Feature.&lt;testtype&gt;.&lt;testname&gt;</tt>. So, if you add an LLVM
assembly language file to the Feature directory, it actually creates 5 new
tests: assembler/disassembler, assembler, optimizer, machine code, and C code.
</p>
<li><tt>llvm-test/SingleSource</tt>
<p>The SingleSource directory contains test programs that are only a single
source file in size. These are usually small benchmark programs or small
programs that calculate a particular value. Several such programs are grouped
together in each directory.</p></li>
<li>Regression
<p>These are the regression tests. There is one suite for each
subdirectory of the Regression directory. If you add a new subdirectory
there, you will need to modify, at least, the <tt>RegressionMap</tt>
variable in <tt>QMTest/llvmdb.py</tt> so that QMTest knows how to run the
tests in the new subdirectory.</p>
<li><tt>llvm-test/MultiSource</tt>
<p>The MultiSource directory contains subdirectories which contain entire
programs with multiple source files. Large benchmarks and whole applications
go here.</p></li>
</ul>
<li><tt>llvm-test/External</tt>
<p>The External directory contains Makefiles for building code that is external
to (i.e., not distributed with) LLVM. The most prominent members of this
directory are the SPEC 95 and SPEC 2000 benchmark suites. The presence and
location of these external programs is configured by the llvm-test
<tt>configure</tt> script.</p></li>
</ul>
</div>
<!--=========================================================================-->
<div class="doc_section"><a name="dgstructure">DejaGNU Structure</a></div>
<!--=========================================================================-->
<div class="doc_text">
<p>The LLVM test suite is partially driven by DejaGNU and partially
driven by GNU Make. Specifically, the Features and Regression tests
are all driven by DejaGNU. The <tt>llvm-test</tt>
module is currently driven by a set of Makefiles.</p>
<p>The DejaGNU structure is very simple, but does require some
information to be set. This information is gathered via <tt>configure</tt> and
is written to a file, <tt>site.exp</tt> in <tt>llvm/test</tt>. The
<tt>llvm/test</tt>
Makefile does this work for you.</p>
<p>In order for DejaGNU to work, each directory of tests must have a
<tt>dg.exp</tt> file. This file is a program written in tcl that calls
the <tt>llvm-runtests</tt> procedure on each test file. The
llvm-runtests procedure is defined in
<tt>llvm/test/lib/llvm-dg.exp</tt>. Any directory that contains only
directories does not need the <tt>dg.exp</tt> file.</p>
<p>In order for a test to be run, it must contain information within
the test file on how to run the test. These are called <tt>RUN</tt>
lines. Run lines are specified in the comments of the test program
using the keyword <tt>RUN</tt> followed by a colon, and lastly the
commands to execute. These commands will be executed in a bash script,
so any bash syntax is acceptable. You can specify as many RUN lines as
necessary. Each RUN line translates to one line in the resulting bash
script. Below is an example of legal RUN lines in a <tt>.ll</tt>
file:</p>
<pre>
; RUN: llvm-as < %s | llvm-dis > %t1
; RUN: llvm-dis < %s.bc-13 > %t2
; RUN: diff %t1 %t2
</pre>
<p>There are a couple patterns within a <tt>RUN</tt> line that the
llvm-runtest procedure looks for and replaces with the appropriate
syntax:</p>
<dl style="margin-left: 25px">
<dt>%p</dt>
<dd>The path to the source directory. This is for locating
any supporting files that are not generated by the test, but used by
the test.</dd>
<dt>%s</dt>
<dd>The test file.</dd>
<dt>%t</dt>
<dd>Temporary filename: testscript.test_filename.tmp, where
test_filename is the name of the test file. All temporary files are
placed in the Output directory within the directory the test is
located.</dd>
<dt>%prcontext</dt>
<dd>Path to a script that performs grep -C. Use this since not all
platforms support grep -C.</dd>
<dt>%llvmgcc</dt> <dd>Full path to the llvm-gcc executable.</dd>
<dt>%llvmgxx</dt> <dd>Full path to the llvm-g++ executable.</dd>
</dl>
<p>There are also several scripts in the llvm/test/Scripts directory
that you might find useful when writing <tt>RUN</tt> lines.</p>
<p>Lastly, you can easily mark a test that is expected to fail on a
specific platform by using the <tt>XFAIL</tt> keyword. Xfail lines are
specified in the comments of the test program using <tt>XFAIL</tt>,
followed by a colon, and one or more regular expressions (separated by
a comma) that will match against the target triplet for the
machine. You can use * to match all targets. Here is an example of an
<tt>XFAIL</tt> line:</p>
<pre>
; XFAIL: darwin,sun
</pre>
</div>
<!--===============================================================-->
<div class="doc_section"><a name="progstructure">Programs Structure</a></div>
<!--===============================================================-->
<!--=========================================================================-->
<div class="doc_section"><a name="progstructure"><tt>llvm-test</tt>
Structure</a></div>
<!--=========================================================================-->
<div class="doc_text">
<p>As mentioned previously, the Programs tree in llvm/test provides three types
<p>As mentioned previously, the <tt>llvm-test</tt> module 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>In addition to the regular "whole program" tests, the <tt>llvm-test</tt>
module 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
@@ -319,40 +357,91 @@ 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>
<p>Note, when configuring the <tt>llvm-test</tt> module, you might want to
specify the following configuration options:</p>
<dl>
<dt><i>--enable-spec2000</i>
<dt><i>--enable-spec2000=&lt;<tt>directory</tt>&gt;</i>
<dd>
Enable the use of SPEC2000 when testing LLVM. This is disabled by default
(unless <tt>configure</tt> finds SPEC2000 installed). By specifying
<tt>directory</tt>, you can tell configure where to find the SPEC2000
benchmarks. If <tt>directory</tt> is left unspecified, <tt>configure</tt>
uses the default value
<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>
</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>
<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>The master Makefile in llvm/test is capable of running only the DejaGNU driven
tests. By default, it will run all of these 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>To run only the DejaGNU driven tests, run <tt>gmake</tt> at the
command line in <tt>llvm/test</tt>. To run a specific directory of tests, use
the TESTSUITE variable.
</p>
<p>For example, to run the Regression.LLC tests, type <tt>gmake
Regression.LLC.t</tt> in llvm/tests.</p>
<p>For example, to run the Regression tests, type
<tt>gmake TESTSUITE=Regression</tt> in <tt>llvm/tests</tt>.</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>Note that there are no Makefiles in <tt>llvm/test/Features</tt> and
<tt>llvm/test/Regression</tt>. You must use DejaGNU from the <tt>llvm/test</tt>
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
<p>To run the <tt>llvm-test</tt> suite, you need to use the following steps:
</p>
<ol>
<li>cd into the llvm/projects directory</li>
<li>check out the <tt>llvm-test</tt> module with:<br/>
<tt>cvs -d :pserver:anon@llvm.cs.uiuc.edu:/var/cvs/llvm co -PR llvm-test</tt><br>
This will get the test suite into <tt>llvm/projects/llvm-test</tt></li>
<li>configure the test suite. You can do this one of two ways:
<ol>
<li>Use the regular llvm configure:<br/>
<tt>cd $LLVM_OBJ_ROOT ; $LLVM_SRC_ROOT/configure</tt><br/>
This will ensure that the <tt>projects/llvm-test</tt> directory is also
properly configured.</li>
<li>Use the <tt>configure</tt> script found in the <tt>llvm-test</tt> source
directory:<br/>
<tt>$LLVM_SRC_ROOT/projects/llvm-test/configure --with-llvmsrc=$LLVM_SRC_ROOT --with-llvmobj=$LLVM_OBJ_ROOT</tt>
</li>
</ol>
<li>gmake</li>
</ol>
<p>Note that the second and third steps only need to be done once. After you
have the suite checked out and configured, you don't need to do it again (unless
the test code or configure script changes).</p>
<p>To make a specialized test (use one of the
<tt>llvm-test/TEST.&lt;type&gt;.Makefile</tt>s), just run:<br/>
<tt>gmake TEST=&lt;type&gt; test</tt><br/>For example, you could run the
nightly tester tests using the following commands:</p>
<pre>
% cd llvm/test/Programs
% cd llvm/projects/llvm-test
% gmake TEST=nightly test
</pre>
@@ -361,46 +450,65 @@ output and standard error. You can redirect these results to a file if you
choose.</p>
<p>Some tests are known to fail. Some are bugs that we have not fixed yet;
others are features that we haven't added yet (or may never add). In QMTest,
others are features that we haven't added yet (or may never add). In DejaGNU,
the result for such tests will be XFAIL (eXpected FAILure). In this way, you
can tell the difference between an expected and unexpected failure.</p>
<p>The Programs tests have no such feature as of this time. If the test passes,
only warnings and other miscellaneous output will be generated. If a test
fails, a large &lt;program&gt; FAILED message will be displayed. This will help
you separate benign warnings from actual test failures.</p>
<p>The tests in <tt>llvm-test</tt> have no such feature at this time. If the
test passes, only warnings and other miscellaneous output will be generated. If
a test fails, a large &lt;program&gt; FAILED message will be displayed. This
will help you separate benign warnings from actual test failures.</p>
</div>
<!--===============================================================-->
<!--=========================================================================-->
<div class="doc_section"><a name="nightly">Running the nightly tester</a></div>
<!--===============================================================-->
<!--=========================================================================-->
<div class="doc_text">
<p>
The <a href="http://llvm.cs.uiuc.edu/testresults/">LLVM Nightly Testers</a>
automatically check out an LLVM tree, build it, run the "nightly"
program test (described above) and all of the regression tests, then
delete the checked out tree. This tester is designed to ensure that
program test (described above), run all of the feature and regression tests,
and then delete the checked out tree. This tester is designed to ensure that
programs don't break as well as keep track of LLVM's progress over time.</p>
<p>
If you'd like to set up an instance of the nightly tester to run on your
machine, take a look at the comments at the top of the utils/NightlyTester.pl
file. We usually run it from a crontab entry that looks ilke this:
</p>
<p>If you'd like to set up an instance of the nightly tester to run on your
machine, take a look at the comments at the top of the
<tt>utils/NightlyTester.pl</tt> file. We usually run it from a crontab entry
that looks ilke this:</p>
<div class="doc_code">
<pre>
5 3 * * * LLVM_LIB_SEARCH_PATH=.../llvm-gcc/bytecode-libs $HOME/llvm/utils/NightlyTest.pl -parallel -enable-linscan ...CVSREPOSTRING... $HOME/buildtest-X86 $HOME/cvs/testresults-X86
5 3 * * * $HOME/llvm/utils/NightlyTest.pl -parallel $CVSROOT $HOME/buildtest-X86 $HOME/cvs/testresults-X86
</pre>
</div>
<p>Or, you can create a shell script to encapsulate the running of the script.
The optimized x86 Linux nightly test is run from just such a script:</p>
<div class="doc_code">
<pre>
#!/bin/bash
BASE=/proj/work/llvm/nightlytest
export CVSROOT=:pserver:anon@llvm.cs.uiuc.edu:/var/cvs/llvm
export BUILDDIR=$BASE/build
export WEBDIR=$BASE/testresults
export LLVMGCCDIR=/proj/work/llvm/cfrontend/install
export PATH=/proj/install/bin:$LLVMGCCDIR/bin:$PATH
export LD_LIBRARY_PATH=/proj/install/lib
cd $BASE
cp /proj/work/llvm/llvm/utils/NightlyTest.pl .
nice ./NightlyTest.pl -nice -release -verbose -parallel -enable-linscan -noexternals 2&gt;&amp;1 &gt; output.log
mail -s 'X86 nightly tester results' <a href="http://mail.cs.uiuc.edu/mailman/listinfo/llvm-testresults">llvm-testresults@cs.uiuc.edu</a> &lt; output.log
</pre>
</div>
<p>Take a look at the <tt>NightlyTest.pl</tt> file to see what all of the flags
and strings do. If you start running the nightly tests, please let us know and
we'll link your page to the global tester page. Thanks!</p>
<p>
Take a look at the NightlyTest.pl file to see what all of the flags and
strings do. If you start running the nightly tests, please let us know and
we'll link your page to the global tester page. Thanks!
</p>
</div>
<!-- *********************************************************************** -->
@@ -412,8 +520,8 @@ we'll link your page to the global tester page. Thanks!
<a href="http://validator.w3.org/check/referer"><img
src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /></a>
John T. Criswell<br>
<a href="http://llvm.cs.uiuc.edu">The LLVM Compiler Infrastructure</a><br>
John T. Criswell, Reid Spencer, and Tanya Lattner<br>
<a href="http://llvm.cs.uiuc.edu">The LLVM Compiler Infrastructure</a><br/>
Last modified: $Date$
</address>
</body>

View File

@@ -0,0 +1,504 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Using The LLVM Libraries</title>
<link rel="stylesheet" href="llvm.css" type="text/css">
</head>
<body>
<div class="doc_title">Using The LLVM Libraries</div>
<ol>
<li><a href="#abstract">Abstract</a></li>
<li><a href="#introduction">Introduction</a></li>
<li><a href="#descriptions">Library Descriptions</a></li>
<li><a href="#dependencies">Library Dependencies</a></li>
<li><a href="#rot">Linkage Rules Of Thumb</a>
<ol>
<li><a href="#always">Always link LLVMCore, LLVMSupport, LLVMSystem</a>
<li><a href="#onlyone">Never link both archive and re-linked</a>
</ol>
</li>
</ol>
<div class="doc_author">
<p>Written by <a href="mailto:rspencer@x10sys.com">Reid Spencer</a></p>
</div>
<!-- ======================================================================= -->
<div class="doc_section"><a name="abstract">Abstract</a></div>
<div class="doc_text">
<p>Amongst other things, LLVM is a toolkit for building compilers, linkers,
runtime executives, virtual machines, and other program execution related
tools. In addition to the LLVM tool set, the functionality of LLVM is
available through a set of libraries. To use LLVM as a toolkit for
constructing tools, a developer needs to understand what is contained in the
various libraries, what they depend on, and how to use them. This document
describes the contents of the libraries and how and when to use them.
</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 based
on LLVM, you'll need to figure out which of the many libraries 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 libraries to link with. The purpose of this document is
to reduce some of the trial and error that the author experienced in using
LLVM.</p>
<p>LLVM produces two types of libraries: archives (ending in <tt>.a</tt>) and
objects (ending in <tt>.o</tt>). However, both are libraries. Libraries ending
in <tt>.o</tt> are known as re-linked libraries because they contain all the
compilation units of the library linked together as a single <tt>.o</tt> file.
Furthermore, many of the libraries have <em>both</em> forms of library. The
re-linked libraries are used whenever you want to include all symbols from the
library. The archive libraries are used whenever you want to only resolve
outstanding symbols at that point in the link without including everything in
the library. </p>
<p>When linking your tools, you will use the <tt>LLVMLIBS</tt> make variable.
(see the <a href="MakefileGuide.html#LLVMLIBS">Makefile Guide</a> for
details). This variable specifies which LLVM libraries to link into your tool
and the order in which they will be linked. You specify re-linked libraries by
naming the library without a suffix. You specify archive libraries by naming
the library with a <tt>.a</tt> suffix but without the <tt>lib</tt> prefix. The
order in which the libraries appear in the <tt>LLVMLIBS</tt> variable
definition is the order in which they will be linked. Getting this order
correct for your tool can sometimes be challenging.
</div>
<!-- ======================================================================= -->
<div class="doc_section"><a name="descriptions"></a>Library Descriptions</div>
<div class="doc_text">
<p>The table below categorizes each library
<table style="text-align:left">
<tr><th>Library</th><th>Forms</th><th>Description</th></tr>
<tr><th colspan="3">Core Libraries</th></tr>
<tr><td>LLVMArchive</td><td><tt>.a</tt></td>
<td>LLVM archive reading and writing</td></tr>
<tr><td>LLVMAsmParser</td><td><tt>.o</tt></td>
<td>LLVM assembly parsing</td></tr>
<tr><td>LLVMBCReader</td><td><tt>.o</tt></td>
<td>LLVM bytecode reading</td></tr>
<tr><td>LLVMBCWriter</td><td><tt>.o</tt></td>
<td>LLVM bytecode writing</td></tr>
<tr><td>LLVMCore</td><td><tt>.o</tt></td>
<td>LLVM core intermediate representation</td></tr>
<tr><td>LLVMDebugger</td><td><tt>.o</tt></td>
<td>Source level debugging support</td></tr>
<tr><td>LLVMLinker</td><td><tt>.a</tt></td>
<td>Bytecode and archive linking interface</td></tr>
<tr><td>LLVMSupport</td><td><tt>.a .o</tt></td>
<td>General support utilities</td></tr>
<tr><td>LLVMSystem</td><td><tt>.a .o</tt></td>
<td>Operating system abstraction layer</td></tr>
<tr><th colspan="3">Analysis Libraries</th></tr>
<tr><td>LLVMAnalysis</td><td><tt>.a .o</tt></td>
<td>Various analysis passes.</td></tr>
<tr><td>LLVMDataStructure</td><td><tt>.a .o</tt></td>
<td>Data structure analysis passes.</td></tr>
<tr><td>LLVMipa</td><td><tt>.a .o</tt></td>
<td>Inter-procedural analysis passes.</td></tr>
<tr><th colspan="3">Transformation Libraries</th></tr>
<tr><td>LLVMInstrumentation</td><td><tt>.a .o</tt></td>
<td>Instrumentation passes.</td></tr>
<tr><td>LLVMipo</td><td><tt>.a .o</tt></td>
<td>All inter-procedural optimization passes.</td></tr>
<tr><td>LLVMScalarOpts</td><td><tt>.a .o</tt></td>
<td>All scalar optimization passes.</td></tr>
<tr><td>LLVMTransforms</td><td><tt>.a .o</tt></td>
<td>Uncategorized transformation passes.</td></tr>
<tr><td>LLVMTransformUtils</td><td><tt>.a .o</tt></td>
<td>Transformation utilities.</td></tr>
<tr><td>LLVMProfilePaths</td><td><tt>.o</tt></td>
<td>Profile paths for instrumentation.</td></tr>
<tr><th colspan="3">Code Generation Libraries </th></tr>
<tr><td>LLVMCodeGen</td><td><tt>.o</tt></td>
<td>Native code generation infrastructure</td></tr>
<tr><th colspan="3">Target Libraries</th></tr>
<tr><td>LLVMCBackend</td><td><tt>.o</tt></td>
<td>'C' language code generator.</td></tr>
<tr><td>LLVMPowerPC</td><td><tt>.o</tt></td>
<td>PowerPC code generation backend</td></tr>
<tr><td>LLVMSelectionDAG</td><td><tt>.o</tt></td>
<td>Aggressive instruction selector for directed acyclic graphs.</td></tr>
<tr><td>LLVMSkeleton</td><td><tt>.a .o</tt></td>
<td>Skeleton for a code generation backend.</td></tr>
<tr><td>LLVMSparcV8</td><td><tt>.o</tt></td>
<td>Code generation for SparcV8.</td></tr>
<tr><td>LLVMSparcV9</td><td><tt>.o</tt></td>
<td>Code generation for SparcV9.</td></tr>
<tr><td>LLVMSparcV9RegAlloc</td><td><tt>.a .o</tt></td>
<td>Graph-coloring register allocator for SparcV9.</td></tr>
<tr><td>LLVMSparcV9InstrSched</td><td><tt>.o</tt></td>
<td>Instruction scheduling for SparcV9.</td></tr>
<tr><td>LLVMSparcV9LiveVar</td><td><tt>.o</tt></td>
<td>Live variable analysis SparcV9.</td></tr>
<tr><td>LLVMSparcV9ModuloSched</td><td><tt>.o</tt></td>
<td>Modulo scheduling for SparcV9.</td></tr>
<tr><td>LLVMTarget</td><td><tt>.a .o</tt></td>
<td>Generic code generation utilities.</td></tr>
<tr><td>LLVMX86</td><td><tt>.o</tt></td>
<td>Intel x86 code generation backend</td></tr>
<tr><th colspan="3">Runtime Libraries</th></tr>
<tr><td>LLVMInterpreter</td><td><tt>.o</tt></td>
<td>Bytecode Interpreter</td></tr>
<tr><td>LLVMJIT</td><td><tt>.o</tt></td>
<td>Bytecode JIT Compiler</td></tr>
<tr><td>LLVMExecutionEngine</td><td><tt>.o</tt></td>
<td>Virtual machine engine</td></tr>
<tr><td>LLVMexecve</td><td><tt>.o</tt></td>
<td>execve(2) replacement for llee</td></tr>
</table>
</div>
<!-- ======================================================================= -->
<div class="doc_section"><a name="dependencies"></a>Library Dependencies</div>
<div class="doc_text">
<p>Below are two dependency graphs and a list that show the relationships
between the various LLVM archive libraries and object files. This information
can be automatically generated with the <tt>GenLibDeps.pl</tt> utility found
in the <tt>llvm/utils</tt> directory.</p>
<!-- =======NOTE: =========================================================-->
<!-- === The following graphs and <dl> list are generated automatically ===-->
<!-- === by the util named GenLibDeps.pl in the llvm/utils directory. ===-->
<!-- === This should be updated whenever new libraries are added, ===-->
<!-- === removed, or changed ===-->
<!-- =======NOTE: =========================================================-->
<h2>Dependency Relationships Of Libraries</h2>
<p>This graph shows the dependency of archive libraries on other archive
libraries or objects. Where a library has both archive and object forms, only
the archive form is shown.</p>
<img src="img/libdeps.gif" alt="Library Dependencies"/>
<h2>Dependency Relationships Of Object Files</h2>
<p>This graph shows the dependency of object files on archive libraries or
other objects. Where a library has both object and archive forms, only the
dependency to the archive form is shown.</p>
<img src="img/objdeps.gif" alt="Object File Dependencies"/>
<p>The following list shows the dependency relationships between libraries in
textual form. The information is the same as shown on the graphs but arranged
alphabetically.</p>
<dl>
<dt><b>libLLVMAnalysis.a</b</dt><dd><ul>
<li>libLLVMScalarOpts.a</li>
<li>libLLVMSupport.a</li>
<li>libLLVMTarget.a</li>
<li>libLLVMTransformUtils.a</li>
<li>LLVMCore.o</li>
</ul></dd>
<dt><b>libLLVMArchive.a</b</dt><dd><ul>
<li>libLLVMSupport.a</li>
<li>libLLVMSystem.a</li>
<li>LLVMBCReader.o</li>
</ul></dd>
<dt><b>libLLVMDataStructure.a</b</dt><dd><ul>
<li>libLLVMAnalysis.a</li>
<li>libLLVMSupport.a</li>
<li>libLLVMTarget.a</li>
<li>libLLVMTransformUtils.a</li>
<li>LLVMCore.o</li>
</ul></dd>
<dt><b>libLLVMInstrumentation.a</b</dt><dd><ul>
<li>libLLVMSupport.a</li>
<li>libLLVMTransformUtils.a</li>
<li>LLVMCore.o</li>
</ul></dd>
<dt><b>libLLVMLinker.a</b</dt><dd><ul>
<li>libLLVMArchive.a</li>
<li>libLLVMSystem.a</li>
<li>LLVMBCReader.o</li>
<li>LLVMCore.o</li>
</ul></dd>
<dt><b>libLLVMScalarOpts.a</b</dt><dd><ul>
<li>libLLVMAnalysis.a</li>
<li>libLLVMSupport.a</li>
<li>libLLVMTarget.a</li>
<li>libLLVMTransformUtils.a</li>
<li>LLVMCore.o</li>
</ul></dd>
<dt><b>libLLVMSparcV9RegAlloc.a</b</dt><dd><ul>
<li>libLLVMAnalysis.a</li>
<li>libLLVMSupport.a</li>
<li>LLVMCodeGen.o</li>
<li>LLVMCore.o</li>
<li>LLVMSparcV9LiveVar.o</li>
<li>LLVMSparcV9.o</li>
</ul></dd>
<dt><b>libLLVMSupport.a</b</dt><dd><ul>
<li>libLLVMSystem.a</li>
<li>LLVMbzip2.o</li>
</ul></dd>
<dt><b>libLLVMSystem.a</b</dt><dd></dd>
<dt><b>libLLVMTarget.a</b</dt><dd><ul>
<li>libLLVMSupport.a</li>
<li>LLVMCore.o</li>
</ul></dd>
<dt><b>libLLVMTransformUtils.a</b</dt><dd><ul>
<li>libLLVMAnalysis.a</li>
<li>libLLVMScalarOpts.a</li>
<li>libLLVMSupport.a</li>
<li>LLVMCore.o</li>
</ul></dd>
<dt><b>libLLVMTransforms.a</b</dt><dd><ul>
<li>libLLVMAnalysis.a</li>
<li>libLLVMSupport.a</li>
<li>libLLVMTarget.a</li>
<li>libLLVMTransformUtils.a</li>
<li>LLVMCore.o</li>
</ul></dd>
<dt><b>libLLVMipa.a</b</dt><dd><ul>
<li>libLLVMAnalysis.a</li>
<li>libLLVMSupport.a</li>
<li>LLVMCore.o</li>
</ul></dd>
<dt><b>libLLVMipo.a</b</dt><dd><ul>
<li>libLLVMAnalysis.a</li>
<li>libLLVMipa.a</li>
<li>libLLVMScalarOpts.a</li>
<li>libLLVMSupport.a</li>
<li>libLLVMTarget.a</li>
<li>libLLVMTransformUtils.a</li>
<li>LLVMCore.o</li>
</ul></dd>
<dt><b>LLVMAnalysis.o</b</dt><dd><ul>
<li>libLLVMScalarOpts.a</li>
<li>libLLVMSupport.a</li>
<li>libLLVMTarget.a</li>
<li>libLLVMTransformUtils.a</li>
<li>LLVMCore.o</li>
</ul></dd>
<dt><b>LLVMAsmParser.o</b</dt><dd><ul>
<li>LLVMCore.o</li>
</ul></dd>
<dt><b>LLVMBCReader.o</b</dt><dd><ul>
<li>libLLVMSupport.a</li>
<li>libLLVMSystem.a</li>
<li>LLVMCore.o</li>
</ul></dd>
<dt><b>LLVMBCWriter.o</b</dt><dd><ul>
<li>libLLVMSupport.a</li>
<li>LLVMCore.o</li>
</ul></dd>
<dt><b>LLVMCBackend.o</b</dt><dd><ul>
<li>libLLVMAnalysis.a</li>
<li>libLLVMipa.a</li>
<li>libLLVMScalarOpts.a</li>
<li>libLLVMSupport.a</li>
<li>libLLVMTarget.a</li>
<li>LLVMCore.o</li>
</ul></dd>
<dt><b>LLVMCodeGen.o</b</dt><dd><ul>
<li>libLLVMAnalysis.a</li>
<li>libLLVMSupport.a</li>
<li>libLLVMTarget.a</li>
<li>LLVMCore.o</li>
</ul></dd>
<dt><b>LLVMCore.o</b</dt><dd><ul>
<li>libLLVMSupport.a</li>
</ul></dd>
<dt><b>LLVMDataStructure.o</b</dt><dd><ul>
<li>libLLVMAnalysis.a</li>
<li>libLLVMSupport.a</li>
<li>libLLVMTarget.a</li>
<li>libLLVMTransformUtils.a</li>
<li>LLVMCore.o</li>
</ul></dd>
<dt><b>LLVMDebugger.o</b</dt><dd><ul>
<li>libLLVMSupport.a</li>
<li>libLLVMSystem.a</li>
<li>LLVMBCReader.o</li>
<li>LLVMCodeGen.o</li>
<li>LLVMCore.o</li>
<li>LLVMExecutionEngine.o</li>
</ul></dd>
<dt><b>LLVMExecutionEngine.o</b</dt><dd><ul>
<li>libLLVMSupport.a</li>
<li>libLLVMSystem.a</li>
<li>libLLVMTarget.a</li>
<li>LLVMCore.o</li>
<li>LLVMInterpreter.o</li>
<li>LLVMJIT.o</li>
</ul></dd>
<dt><b>LLVMInstrumentation.o</b</dt><dd><ul>
<li>libLLVMSupport.a</li>
<li>libLLVMTransformUtils.a</li>
<li>LLVMCore.o</li>
</ul></dd>
<dt><b>LLVMInterpreter.o</b</dt><dd><ul>
<li>libLLVMSupport.a</li>
<li>libLLVMSystem.a</li>
<li>libLLVMTarget.a</li>
<li>LLVMCore.o</li>
<li>LLVMExecutionEngine.o</li>
</ul></dd>
<dt><b>LLVMJIT.o</b</dt><dd><ul>
<li>libLLVMSupport.a</li>
<li>libLLVMSystem.a</li>
<li>libLLVMTarget.a</li>
<li>LLVMCore.o</li>
<li>LLVMExecutionEngine.o</li>
</ul></dd>
<dt><b>LLVMPowerPC.o</b</dt><dd><ul>
<li>libLLVMScalarOpts.a</li>
<li>libLLVMSupport.a</li>
<li>libLLVMTarget.a</li>
<li>LLVMCodeGen.o</li>
<li>LLVMCore.o</li>
</ul></dd>
<dt><b>LLVMProfilePaths.o</b</dt><dd><ul>
<li>libLLVMInstrumentation.a</li>
<li>libLLVMSupport.a</li>
<li>LLVMCore.o</li>
</ul></dd>
<dt><b>LLVMScalarOpts.o</b</dt><dd><ul>
<li>libLLVMAnalysis.a</li>
<li>libLLVMSupport.a</li>
<li>libLLVMTarget.a</li>
<li>libLLVMTransformUtils.a</li>
<li>LLVMCore.o</li>
</ul></dd>
<dt><b>LLVMSelectionDAG.o</b</dt><dd><ul>
<li>LLVMCodeGen.o</li>
<li>LLVMCore.o</li>
</ul></dd>
<dt><b>LLVMSkeleton.o</b</dt><dd><ul>
<li>libLLVMTarget.a</li>
<li>LLVMCodeGen.o</li>
<li>LLVMCore.o</li>
</ul></dd>
<dt><b>LLVMSparcV8.o</b</dt><dd><ul>
<li>libLLVMScalarOpts.a</li>
<li>libLLVMSupport.a</li>
<li>libLLVMTarget.a</li>
<li>LLVMCodeGen.o</li>
<li>LLVMCore.o</li>
</ul></dd>
<dt><b>LLVMSparcV9.o</b</dt><dd><ul>
<li>libLLVMScalarOpts.a</li>
<li>libLLVMSparcV9RegAlloc.a</li>
<li>libLLVMSupport.a</li>
<li>libLLVMTarget.a</li>
<li>LLVMBCWriter.o</li>
<li>LLVMCodeGen.o</li>
<li>LLVMCore.o</li>
<li>LLVMSparcV9InstrSched.o</li>
<li>LLVMSparcV9ModuloSched.o</li>
</ul></dd>
<dt><b>LLVMSparcV9InstrSched.o</b</dt><dd><ul>
<li>libLLVMSupport.a</li>
<li>LLVMCodeGen.o</li>
<li>LLVMCore.o</li>
<li>LLVMSparcV9LiveVar.o</li>
<li>LLVMSparcV9.o</li>
</ul></dd>
<dt><b>LLVMSparcV9LiveVar.o</b</dt><dd><ul>
<li>libLLVMSupport.a</li>
<li>LLVMCodeGen.o</li>
<li>LLVMCore.o</li>
</ul></dd>
<dt><b>LLVMSparcV9ModuloSched.o</b</dt><dd><ul>
<li>libLLVMSupport.a</li>
<li>libLLVMTarget.a</li>
<li>LLVMCodeGen.o</li>
<li>LLVMCore.o</li>
<li>LLVMSparcV9.o</li>
</ul></dd>
<dt><b>LLVMSparcV9RegAlloc.o</b</dt><dd><ul>
<li>libLLVMAnalysis.a</li>
<li>libLLVMSupport.a</li>
<li>LLVMCodeGen.o</li>
<li>LLVMCore.o</li>
<li>LLVMSparcV9LiveVar.o</li>
<li>LLVMSparcV9.o</li>
</ul></dd>
<dt><b>LLVMSupport.o</b</dt><dd><ul>
<li>libLLVMSystem.a</li>
<li>LLVMbzip2.o</li>
</ul></dd>
<dt><b>LLVMSystem.o</b</dt><dd></dd>
<dt><b>LLVMTarget.o</b</dt><dd><ul>
<li>libLLVMSupport.a</li>
<li>LLVMCore.o</li>
</ul></dd>
<dt><b>LLVMTransformUtils.o</b</dt><dd><ul>
<li>libLLVMAnalysis.a</li>
<li>libLLVMScalarOpts.a</li>
<li>libLLVMSupport.a</li>
<li>LLVMCore.o</li>
</ul></dd>
<dt><b>LLVMTransforms.o</b</dt><dd><ul>
<li>libLLVMAnalysis.a</li>
<li>libLLVMSupport.a</li>
<li>libLLVMTarget.a</li>
<li>libLLVMTransformUtils.a</li>
<li>LLVMCore.o</li>
</ul></dd>
<dt><b>LLVMX86.o</b</dt><dd><ul>
<li>libLLVMScalarOpts.a</li>
<li>libLLVMSupport.a</li>
<li>libLLVMTarget.a</li>
<li>LLVMCodeGen.o</li>
<li>LLVMCore.o</li>
</ul></dd>
<dt><b>LLVMbzip2.o</b</dt><dd></dd>
<dt><b>LLVMipa.o</b</dt><dd><ul>
<li>libLLVMAnalysis.a</li>
<li>libLLVMSupport.a</li>
<li>LLVMCore.o</li>
</ul></dd>
<dt><b>LLVMipo.o</b</dt><dd><ul>
<li>libLLVMAnalysis.a</li>
<li>libLLVMipa.a</li>
<li>libLLVMScalarOpts.a</li>
<li>libLLVMSupport.a</li>
<li>libLLVMTarget.a</li>
<li>libLLVMTransformUtils.a</li>
<li>LLVMCore.o</li>
</ul></dd>
</dl>
</div>
<!-- ======================================================================= -->
<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 LLVMCore, LLVMSupport,
and LLVMSystem</a></div>
<div class="doc_text">
<p>No matter what you do with LLVM, the last three entries in the value of
your LLVMLIBS make variable should always be:
<tt>LLVMCore LLVMSupport.a LLVMSystem.a</tt>. There are no <tt>LLVM</tt>
programs that don't depend on these three.</p>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection"><a name="onlyone">Never link both archive and
re-linked library</a></div>
<div class="doc_text">
<p>There is never any point to linking both the re-linked (<tt>.o</tt>) and
the archive (<tt>.a</tt>) versions of a library. Since the re-linked version
includes the entire library, the archive version will not resolve any symbols.
You could even end up with link error if you place the archive version before
the re-linked version on the linker's command line.</p>
</div>
<!-- ======================================================================= -->
<hr>
<div class="doc_footer">
<address>
<a href="http://jigsaw.w3.org/css-validator/check/referer"><img
src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"/></a>
<a href="http://validator.w3.org/check/referer"><img
src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /></a>
<a href="mailto:rspencer@x10sys.com">Reid Spencer</a>
</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

@@ -0,0 +1,260 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Writing an LLVM backend</title>
<link rel="stylesheet" href="llvm.css" type="text/css">
</head>
<body>
<div class="doc_title">
Writing an LLVM backend
</div>
<ol>
<li><a href="#intro">Introduction</a>
<li><a href="#backends">Writing a backend</a>
<ol>
<li><a href="#machine">Machine backends</a>
<ol>
<li><a href="#machineTOC">Outline</a></li>
<li><a href="#machineDetails">Implementation details</a></li>
</ol></li>
<li><a href="#lang">Language backends</a></li>
</ol></li>
<li><a href="#related">Related reading material</a>
</ol>
<div class="doc_author">
<p>Written by <a href="http://misha.brukman.net">Misha Brukman</a></p>
</div>
<!-- *********************************************************************** -->
<div class="doc_section">
<a name="intro">Introduction</a>
</div>
<!-- *********************************************************************** -->
<div class="doc_text">
<p>This document describes techniques for writing backends for LLVM which
convert the LLVM representation to machine assembly code or other languages.</p>
</div>
<!-- *********************************************************************** -->
<div class="doc_section">
<a name="backends">Writing a backend</a>
</div>
<!-- *********************************************************************** -->
<!-- ======================================================================= -->
<div class="doc_subsection">
<a name="machine">Machine backends</a>
</div>
<!-- _______________________________________________________________________ -->
<div class="doc_subsubsection">
<a name="machineTOC">Outline</a>
</div>
<div class="doc_text">
<p>In general, you want to follow the format of X86 or PowerPC (in
<tt>lib/Target</tt>).</p>
<p>To create a static compiler (one that emits text assembly), you need to
implement the following:</p>
<ul>
<li>Describe the register set
<ul>
<li>Create a <a href="TableGenFundamentals.html">TableGen</a> description of
the register set and register classes</li>
<li>Implement a subclass of <tt><a
href="CodeGenerator.html#mregisterinfo">MRegisterInfo</a></tt></li>
</ul></li>
<li>Describe the instruction set
<ul>
<li>Create a <a href="TableGenFundamentals.html">TableGen</a> description of
the instruction set</li>
<li>Implement a subclass of <tt><a
href="CodeGenerator.html#targetinstrinfo">TargetInstrInfo</a></tt></li>
</ul></li>
<li>Describe the target machine
<ul>
<li>Create a <a href="TableGenFundamentals.html">TableGen</a> description of
the target that describes the pointer size and references the instruction
set</li>
<li>Implement a subclass of <tt><a
href="CodeGenerator.html#targetmachine">TargetMachine</a></tt>, which
configures <tt><a href="CodeGenerator.html#targetdata">TargetData</a></tt>
correctly</li>
<li>Register your new target using the <tt>RegisterTarget</tt>
template:<br><br>
<div class="doc_code"><pre>
RegisterTarget&lt;<em>MyTargetMachine</em>&gt; M("short_name", " Target name");
</pre></div>
<br>Here, <em>MyTargetMachine</em> is the name of your implemented
subclass of <tt><a
href="CodeGenerator.html#targetmachine">TargetMachine</a></tt>,
<em>short_name</em> is the option that will be active following
<tt>-march=</tt> to select a target in llc and lli, and the last string
is the description of your target to appear in <tt>-help</tt>
listing.</li>
</ul></li>
<li>Implement the assembly printer for the architecture. Usually, if you have
described the instruction set with the assembly printer generator in mind, that
step can be almost automated.</li>
</ul>
<p>You also need to write an instruction selector for your platform. The
recommended method is the <a
href="CodeGenerator.html#instselect">pattern-matching instruction selector</a>,
examples of which you can see in other targets:
<tt>lib/Target/*/*ISelPattern.cpp</tt>. The former method for writing
instruction selectors (<b>not</b> recommended for new targets) is evident in
<tt>lib/Target/*/*ISelSimple.cpp</tt>, which are <tt>InstVisitor</tt>-based
translators, generating code for an LLVM instruction at a time. Creating an
instruction selector is perhaps the most time-consuming part of creating a
back-end.</p>
<p>To create a JIT for your platform:</p>
<ul>
<li>Create a subclass of <tt><a
href="CodeGenerator.html#targetjitinfo">TargetJITInfo</a></tt></li>
<li>Create a machine code emitter that will be used to emit binary code
directly into memory, given <tt>MachineInstr</tt>s</li>
</ul>
<p>Note that <tt>lib/target/Skeleton</tt> is a clean skeleton for a new target,
so you might want to start with that and adapt it for your target, and if you
are wondering how things are done, peek in the X86 or PowerPC target.</p>
<p>The Skeleton target is non-functional but provides the basic building blocks
you will need for your endeavor.</p>
</div>
<!-- _______________________________________________________________________ -->
<div class="doc_subsubsection">
<a name="machineDetails">Implementation details</a>
</div>
<div class="doc_text">
<ul>
<li><p><b>TableGen register info description</b> - describe a class which
will store the register's number in the binary encoding of the instruction
(e.g., for JIT purposes).</p>
<p>You also need to define register classes to contain these registers, such as
the integer register class and floating-point register class, so that you can
allocate virtual registers to instructions from these sets, and let the
target-independent register allocator automatically choose the actual
architected registers.</p>
<div class="doc_code">
<pre>
// class Register is defined in Target.td
<b>class</b> <em>Target</em>Reg&lt;string name&gt; : Register&lt;name&gt; {
<b>let</b> Namespace = "<em>Target</em>";
}
<b>class</b> IntReg&lt;<b>bits</b>&lt;5&gt; num, string name&gt; : <em>Target</em>Reg&lt;name&gt; {
<b>field</b> <b>bits</b>&lt;5&gt; Num = num;
}
<b>def</b> R0 : IntReg&lt;0, "%R0"&gt;;
...
// class RegisterClass is defined in Target.td
<b>def</b> IReg : RegisterClass&lt;i64, 64, [R0, ... ]&gt;;
</pre>
</div>
</li>
<li><p><b>TableGen instruction info description</b> - break up instructions into
classes, usually that's already done by the manufacturer (see instruction
manual). Define a class for each instruction category. Define each opcode as a
subclass of the category, with appropriate parameters such as the fixed binary
encoding of opcodes and extended opcodes, and map the register bits to the bits
of the instruction which they are encoded in (for the JIT). Also specify how
the instruction should be printed so it can use the automatic assembly printer,
e.g.:</p>
<div class="doc_code">
<pre>
// class Instruction is defined in Target.td
<b>class</b> Form&lt;<b>bits</b>&lt;6&gt; opcode, <b>dag</b> OL, <b>string</b> asmstr&gt; : Instruction {
<b>field</b> <b>bits</b>&lt;42&gt; Inst;
<b>let</b> Namespace = "<em>Target</em>";
<b>let</b> Inst{0-6} = opcode;
<b>let</b> OperandList = OL;
<b>let</b> AsmString = asmstr;
}
<b>def</b> ADD : Form&lt;42, (ops IReg:$rD, IReg:$rA, IReg:$rB), "add $rD, $rA, $rB"&gt;;
</pre>
</div>
</li>
</ul>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection">
<a name="lang">Language backends</a>
</div>
<div class="doc_text">
<p>For now, just take a look at <tt>lib/Target/CBackend</tt> for an example of
how the C backend is written.</p>
</div>
<!-- *********************************************************************** -->
<div class="doc_section">
<a name="related">Related reading material</a>
</div>
<!-- *********************************************************************** -->
<div class="doc_text">
<ul>
<li><a href="CodeGenerator.html">Code generator</a> -
describes some of the classes in code generation at a high level, but
it is not (yet) complete</li>
<li><a href="TableGenFundamentals.html">TableGen fundamentals</a> -
describes how to use TableGen to describe your target information
succinctly</li>
<li><a href="HowToSubmitABug.html#codegen">Debugging code generation with
bugpoint</a> - shows bugpoint usage scenarios to simplify backend
development</li>
</ul>
</div>
<!-- *********************************************************************** -->
<hr>
<address>
<a href="http://jigsaw.w3.org/css-validator/check/referer"><img
src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a>
<a href="http://validator.w3.org/check/referer"><img
src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /></a>
<a href="http://misha.brukman.net">Misha Brukman</a><br>
<a href="http://llvm.cs.uiuc.edu">The LLVM Compiler Infrastructure</a>
<br>
Last modified: $Date$
</address>
</body>
</html>

View File

@@ -2,6 +2,7 @@
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Writing an LLVM Pass</title>
<link rel="stylesheet" href="llvm.css" type="text/css">
</head>
@@ -18,14 +19,22 @@
<li><a href="#makefile">Setting up the build environment</a></li>
<li><a href="#basiccode">Basic code required</a></li>
<li><a href="#running">Running a pass with <tt>opt</tt>
or <tt>analyze</tt></a></li>
or <tt>analyze</tt></a></li>
</ul></li>
<li><a href="#passtype">Pass classes and requirements</a>
<ul>
<li><a href="#ImmutablePass">The <tt>ImmutablePass</tt> class</a></li>
<li><a href="#Pass">The <tt>Pass</tt> class</a>
<li><a href="#ModulePass">The <tt>ModulePass</tt> class</a>
<ul>
<li><a href="#run">The <tt>run</tt> method</a></li>
<li><a href="#runOnModule">The <tt>runOnModule</tt> method</a></li>
</ul></li>
<li><a href="#CallGraphSCCPass">The <tt>CallGraphSCCPass</tt> class</a>
<ul>
<li><a href="#doInitialization_scc">The <tt>doInitialization(Module
&amp;)</tt> method</a></li>
<li><a href="#runOnSCC">The <tt>runOnSCC</tt> method</a></li>
<li><a href="#doFinalization_scc">The <tt>doFinalization(Module
&amp;)</tt> method</a></li>
</ul></li>
<li><a href="#FunctionPass">The <tt>FunctionPass</tt> class</a>
<ul>
@@ -69,6 +78,7 @@
<li><a href="#agconcepts">Analysis Group Concepts</a></li>
<li><a href="#registerag">Using <tt>RegisterAnalysisGroup</tt></a></li>
</ul></li>
<li><a href="#passStatistics">Pass Statistics</a>
<li><a href="#passmanager">What PassManager does</a>
<ul>
<li><a href="#releaseMemory">The <tt>releaseMemory</tt> method</a></li>
@@ -81,8 +91,7 @@
<li><a href="#future">Future extensions planned</a>
<ul>
<li><a href="#SMP">Multithreaded LLVM</a></li>
<li><a href="#ModuleSource">A new <tt>ModuleSource</tt> interface</a></li>
<li><a href="#PassFunctionPass"><tt>Pass</tt>es requiring
<li><a href="#PassFunctionPass"><tt>ModulePass</tt>es requiring
<tt>FunctionPass</tt>es</a></li>
</ul></li>
</ol>
@@ -100,23 +109,23 @@
<div class="doc_text">
<p>The LLVM Pass Framework is an important part of the LLVM system, because LLVM
passes are where the interesting parts of the compiler exist. Passes perform
the transformations and optimizations that make up the compiler, they build
the analysis results that are used by these transformations, and they are, above
all, a structuring technique for compiler code.</p>
passes are where most of the interesting parts of the compiler exist. Passes
perform the transformations and optimizations that make up the compiler, they
build the analysis results that are used by these transformations, and they are,
above all, a structuring technique for compiler code.</p>
<p>All LLVM passes are subclasses of the <tt><a
href="http://llvm.cs.uiuc.edu/doxygen/classllvm_1_1Pass.html">Pass</a></tt>
class, which implement functionality by overriding virtual methods inherited
from <tt>Pass</tt>. Depending on how your pass works, you may be able to
inherit from the <tt><a
href="http://llvm.cs.uiuc.edu/doxygen/structllvm_1_1FunctionPass.html">FunctionPass</a></tt>
or <tt><a
href="http://llvm.cs.uiuc.edu/doxygen/structllvm_1_1BasicBlockPass.html">BasicBlockPass</a></tt>,
which gives the system more information about what your pass does, and how it
can be combined with other passes. One of the main features of the LLVM Pass
Framework is that it schedules passes to run in an efficient way based on the
constraints that your pass has.</p>
from <tt>Pass</tt>. Depending on how your pass works, you should inherit from
the <tt><a href="#ModulePass">ModulePass</a></tt>, <tt><a
href="#CallGraphSCCPass">CallGraphSCCPass</a></tt>, <tt><a
href="#FunctionPass">FunctionPass</a></tt>, or <tt><a
href="#BasicBlockPass">BasicBlockPass</a></tt> classes, which gives the system
more information about what your pass does, and how it can be combined with
other passes. One of the main features of the LLVM Pass Framework is that it
schedules passes to run in an efficient way based on the constraints that your
pass meets (which are indicated by which class they derive from).</p>
<p>We start by showing you how to construct a pass, everything from setting up
the code, to compiling, loading, and executing it. After the basics are down,
@@ -134,7 +143,7 @@ more advanced features are discussed.</p>
<p>Here we describe how to write the "hello world" of passes. The "Hello" pass
is designed to simply print out the name of non-external functions that exist in
the program being compiled. It does not modify the program at all, just
the program being compiled. It does not modify the program at all, it just
inspects it. The source code and files for this pass are available in the LLVM
source tree in the <tt>lib/Transforms/Hello</tt> directory.</p>
@@ -147,13 +156,12 @@ source tree in the <tt>lib/Transforms/Hello</tt> directory.</p>
<div class="doc_text">
<p>First thing you need to do is create a new directory somewhere in the LLVM
source base. For this example, we'll assume that you made
"<tt>lib/Transforms/Hello</tt>". The first thing you must do is set up a build
script (Makefile) that will compile the source code for the new pass. To do
this, copy this into "<tt>Makefile</tt>":</p>
<hr>
<p>First, you need to create a new directory somewhere in the LLVM source
base. For this example, we'll assume that you made
<tt>lib/Transforms/Hello</tt>. Next, you must set up a build script
(Makefile) that will compile the source code for the new pass. To do this,
copy the following into <tt>Makefile</tt>:</p>
<hr/>
<pre>
# Makefile for hello pass
@@ -162,21 +170,25 @@ this, copy this into "<tt>Makefile</tt>":</p>
LEVEL = ../../..
# Name of the library to build
LIBRARYNAME = hello
LIBRARYNAME = Hello
# Build a dynamically loadable shared object
# Build a dynamically linkable shared object
SHARED_LIBRARY = 1
# Make the shared library become a loadable module so the tools can
# dlopen/dlsym on the resulting library.
LOADABLE_MODULE
# Include the makefile implementation stuff
include $(LEVEL)/Makefile.common
</pre>
<p>This makefile specifies that all of the <tt>.cpp</tt> files in the current
directory are to be compiled and linked together into a
<tt>lib/Debug/libhello.so</tt> shared object that can be dynamically loaded by
the <tt>opt</tt> or <tt>analyze</tt> tools. If your operating system uses a
suffix other than .so (such as windows of Mac OS/X), the appropriate extension
will be used.</p>
<tt>Debug/lib/Hello.so</tt> shared object that can be dynamically loaded by
the <tt>opt</tt> or <tt>analyze</tt> tools via their <tt>-load</tt> options.
If your operating system uses a suffix other than .so (such as windows or
Mac OS/X), the appropriate extension will be used.</p>
<p>Now that we have the build scripts set up, we just need to write the code for
the pass itself.</p>
@@ -230,7 +242,7 @@ information.</p>
</pre><p>
<p>This declares a "<tt>Hello</tt>" class that is a subclass of <tt><a
href="http://llvm.cs.uiuc.edu/doxygen/structllvm_1_1FunctionPass.html">FunctionPass</a></tt>.
href="http://llvm.cs.uiuc.edu/doxygen/classllvm_1_1FunctionPass.html">FunctionPass</a></tt>.
The different builtin pass subclasses are described in detail <a
href="#passtype">later</a>, but for now, know that <a
href="#FunctionPass"><tt>FunctionPass</tt></a>'s operate a function at a
@@ -283,7 +295,7 @@ depending on what it is to be used for. For "optimizations" we use the
<p>Now that it's all together, compile the file with a simple "<tt>gmake</tt>"
command in the local directory and you should get a new
"<tt>lib/Debug/libhello.so</tt> file. Note that everything in this file is
"<tt>Debug/lib/Hello.so</tt> file. Note that everything in this file is
contained in an anonymous namespace: this reflects the fact that passes are self
contained units that do not need external interfaces (although they can have
them) to be useful.</p>
@@ -309,7 +321,7 @@ through our transformation like this (or course, any bytecode file will
work):</p>
<pre>
$ opt -load ../../../lib/Debug/libhello.so -hello &lt; hello.bc &gt; /dev/null
$ opt -load ../../../Debug/lib/Hello.so -hello &lt; hello.bc &gt; /dev/null
Hello: __main
Hello: puts
Hello: main
@@ -326,7 +338,7 @@ interesting way, we just throw away the result of <tt>opt</tt> (sending it to
<tt>opt</tt> with the <tt>--help</tt> option:</p>
<pre>
$ opt -load ../../../lib/Debug/libhello.so --help
$ opt -load ../../../Debug/lib/Hello.so --help
OVERVIEW: llvm .bc -&gt; .bc modular optimizer
USAGE: opt [options] &lt;input bytecode&gt;
@@ -354,7 +366,7 @@ the execution time of your pass along with the other passes you queue up. For
example:</p>
<pre>
$ opt -load ../../../lib/Debug/libhello.so -hello -time-passes &lt; hello.bc &gt; /dev/null
$ opt -load ../../../Debug/lib/Hello.so -hello -time-passes &lt; hello.bc &gt; /dev/null
Hello: __main
Hello: puts
Hello: main
@@ -412,7 +424,7 @@ slow.</p>
<div class="doc_text">
<p>The most plain and boring type of pass is the "<tt><a
href="http://llvm.cs.uiuc.edu/doxygen/structllvm_1_1ImmutablePass.html">ImmutablePass</a></tt>"
href="http://llvm.cs.uiuc.edu/doxygen/classllvm_1_1ImmutablePass.html">ImmutablePass</a></tt>"
class. This pass type is used for passes that do not have to be run, do not
change state, and never need to be updated. This is not a normal type of
transformation or analysis, but can provide information about the current
@@ -429,41 +441,150 @@ invalidated, and are never "run".</p>
<!-- ======================================================================= -->
<div class="doc_subsection">
<a name="Pass">The <tt>Pass</tt> class</a>
<a name="ModulePass">The <tt>ModulePass</tt> class</a>
</div>
<div class="doc_text">
<p>The "<tt><a
href="http://llvm.cs.uiuc.edu/doxygen/classllvm_1_1Pass.html">Pass</a></tt>"
href="http://llvm.cs.uiuc.edu/doxygen/classllvm_1_1ModulePass.html">ModulePass</a></tt>"
class is the most general of all superclasses that you can use. Deriving from
<tt>Pass</tt> indicates that your pass uses the entire program as a unit,
<tt>ModulePass</tt> indicates that your pass uses the entire program as a unit,
refering to function bodies in no predictable order, or adding and removing
functions. Because nothing is known about the behavior of direct <tt>Pass</tt>
functions. Because nothing is known about the behavior of <tt>ModulePass</tt>
subclasses, no optimization can be done for their execution.</p>
<p>To write a correct <tt>Pass</tt> subclass, derive from <tt>Pass</tt> and
overload the <tt>run</tt> method with the following signature:</p>
<p>To write a correct <tt>ModulePass</tt> subclass, derive from
<tt>ModulePass</tt> and overload the <tt>runOnModule</tt> method with the
following signature:</p>
</div>
<!-- _______________________________________________________________________ -->
<div class="doc_subsubsection">
<a name="run">The <tt>run</tt> method</a>
<a name="runOnModule">The <tt>runOnModule</tt> method</a>
</div>
<div class="doc_text">
<pre>
<b>virtual bool</b> run(Module &amp;M) = 0;
<b>virtual bool</b> runOnModule(Module &amp;M) = 0;
</pre>
<p>The <tt>run</tt> method performs the interesting work of the pass, and should
return true if the module was modified by the transformation, false
<p>The <tt>runOnModule</tt> method performs the interesting work of the pass,
and should return true if the module was modified by the transformation, false
otherwise.</p>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection">
<a name="CallGraphSCCPass">The <tt>CallGraphSCCPass</tt> class</a>
</div>
<div class="doc_text">
<p>The "<tt><a
href="http://llvm.cs.uiuc.edu/doxygen/classllvm_1_1CallGraphSCCPass.html">CallGraphSCCPass</a></tt>"
is used by passes that need to traverse the program bottom-up on the call graph
(callees before callers). Deriving from CallGraphSCCPass provides some
mechanics for building and traversing the CallGraph, but also allows the system
to optimize execution of CallGraphSCCPass's. If your pass meets the
requirements outlined below, and doesn't meet the requirements of a <tt><a
href="#FunctionPass">FunctionPass</a></tt> or <tt><a
href="#BasicBlockPass">BasicBlockPass</a></tt>, you should derive from
<tt>CallGraphSCCPass</tt>.</p>
<p><b>TODO</b>: explain briefly what SCC, Tarjan's algo, and B-U mean.</p>
<p>To be explicit, <tt>CallGraphSCCPass</tt> subclasses are:</p>
<ol>
<li>... <em>not allowed</em> to modify any <tt>Function</tt>s that are not in
the current SCC.</li>
<li>... <em>allowed</em> to inspect any Function's other than those in the
current SCC and the direct callees of the SCC.</li>
<li>... <em>required</em> to preserve the current CallGraph object, updating it
to reflect any changes made to the program.</li>
<li>... <em>not allowed</em> to add or remove SCC's from the current Module,
though they may change the contents of an SCC.</li>
<li>... <em>allowed</em> to add or remove global variables from the current
Module.</li>
<li>... <em>allowed</em> to maintain state across invocations of
<a href="#runOnSCC"><tt>runOnSCC</tt></a> (including global data).</li>
</ol>
<p>Implementing a <tt>CallGraphSCCPass</tt> is slightly tricky in some cases
because it has to handle SCCs with more than one node in it. All of the virtual
methods described below should return true if they modified the program, or
false if they didn't.</p>
</div>
<!-- _______________________________________________________________________ -->
<div class="doc_subsubsection">
<a name="doInitialization_scc">The <tt>doInitialization(Module &amp;)</tt>
method</a>
</div>
<div class="doc_text">
<pre>
<b>virtual bool</b> doInitialization(Module &amp;M);
</pre>
<p>The <tt>doIninitialize</tt> method is allowed to do most of the things that
<tt>CallGraphSCCPass</tt>'s are not allowed to do. They can add and remove
functions, get pointers to functions, etc. The <tt>doInitialization</tt> method
is designed to do simple initialization type of stuff that does not depend on
the SCCs being processed. The <tt>doInitialization</tt> method call is not
scheduled to overlap with any other pass executions (thus it should be very
fast).</p>
</div>
<!-- _______________________________________________________________________ -->
<div class="doc_subsubsection">
<a name="runOnSCC">The <tt>runOnSCC</tt> method</a>
</div>
<div class="doc_text">
<pre>
<b>virtual bool</b> runOnSCC(const std::vector&lt;CallGraphNode *&gt; &amp;SCCM) = 0;
</pre>
<p>The <tt>runOnSCC</tt> method performs the interesting work of the pass, and
should return true if the module was modified by the transformation, false
otherwise.</p>
</div>
<!-- _______________________________________________________________________ -->
<div class="doc_subsubsection">
<a name="doFinalization_scc">The <tt>doFinalization(Module
&amp;)</tt> method</a>
</div>
<div class="doc_text">
<pre>
<b>virtual bool</b> doFinalization(Module &amp;M);
</pre>
<p>The <tt>doFinalization</tt> method is an infrequently used method that is
called when the pass framework has finished calling <a
href="#runOnFunction"><tt>runOnFunction</tt></a> for every function in the
program being compiled.</p>
</div>
<!-- ======================================================================= -->
<div class="doc_subsection">
<a name="FunctionPass">The <tt>FunctionPass</tt> class</a>
@@ -471,7 +592,7 @@ otherwise.</p>
<div class="doc_text">
<p>In contrast to direct <tt>Pass</tt> subclasses, direct <tt><a
<p>In contrast to <tt>ModulePass</tt> subclasses, <tt><a
href="http://llvm.cs.uiuc.edu/doxygen/classllvm_1_1Pass.html">FunctionPass</a></tt>
subclasses do have a predictable, local behavior that can be expected by the
system. All <tt>FunctionPass</tt> execute on each function in the program
@@ -577,8 +698,8 @@ As such, they are <b>not</b> allowed to do any of the following:</p>
<li>Modify or inspect any basic blocks outside of the current one</li>
<li>Maintain state across invocations of
<a href="#runOnBasicBlock"><tt>runOnBasicBlock</tt></a></li>
<li>Modify the constrol flow graph (by altering terminator instructions)</li>
<li>Any of the things verboten for
<li>Modify the control flow graph (by altering terminator instructions)</li>
<li>Any of the things forbidden for
<a href="#FunctionPass"><tt>FunctionPass</tt></a>es.</li>
</ol>
@@ -605,7 +726,7 @@ href="#FunctionPass"><tt>FunctionPass</tt></a>'s have, but also have the followi
<p>The <tt>doIninitialize</tt> method is allowed to do most of the things that
<tt>BasicBlockPass</tt>'s are not allowed to do, but that
<tt>FunctionPass</tt>'s can. The <tt>doInitialization</tt> method is designed
to do simple initialization type of stuff that does not depend on the
to do simple initialization that does not depend on the
BasicBlocks being processed. The <tt>doInitialization</tt> method call is not
scheduled to overlap with any other pass executions (thus it should be very
fast).</p>
@@ -826,11 +947,11 @@ object:</p>
<div class="doc_text">
<p>
If you pass requires a previous pass to be executed (an analysis for example),
If your pass requires a previous pass to be executed (an analysis for example),
it can use one of these methods to arrange for it to be run before your pass.
LLVM has many different types of analyses and passes that can be required,
spaning the range from <tt>DominatorSet</tt> to <tt>BreakCriticalEdges</tt>.
requiring <tt>BreakCriticalEdges</tt>, for example, guarantees that there will
spanning the range from <tt>DominatorSet</tt> to <tt>BreakCriticalEdges</tt>.
Requiring <tt>BreakCriticalEdges</tt>, for example, guarantees that there will
be no critical edges in the CFG when your pass has been run.
</p>
@@ -856,7 +977,7 @@ One of the jobs of the PassManager is to optimize how and when analyses are run.
In particular, it attempts to avoid recomputing data unless it needs to. For
this reason, passes are allowed to declare that they preserve (i.e., they don't
invalidate) an existing analysis if it's available. For example, a simple
constant folding pass would not modify the CFG, so it can't possible effect the
constant folding pass would not modify the CFG, so it can't possibly affect the
results of dominator analysis. By default, all passes are assumed to invalidate
all others.
</p>
@@ -890,9 +1011,9 @@ the fact that it hacks on the CFG.
<pre>
<i>// This is an example implementation from an analysis, which does not modify
// the program at all, yet has a prerequisite.</i>
<b>void</b> <a href="http://llvm.cs.uiuc.edu/doxygen/structllvm_1_1PostDominanceFrontier.html">PostDominanceFrontier</a>::getAnalysisUsage(AnalysisUsage &amp;AU) <b>const</b> {
<b>void</b> <a href="http://llvm.cs.uiuc.edu/doxygen/classllvm_1_1PostDominanceFrontier.html">PostDominanceFrontier</a>::getAnalysisUsage(AnalysisUsage &amp;AU) <b>const</b> {
AU.setPreservesAll();
AU.addRequired&lt;<a href="http://llvm.cs.uiuc.edu/doxygen/structllvm_1_1PostDominatorTree.html">PostDominatorTree</a>&gt;();
AU.addRequired&lt;<a href="http://llvm.cs.uiuc.edu/doxygen/classllvm_1_1PostDominatorTree.html">PostDominatorTree</a>&gt;();
}
</pre>
@@ -1087,6 +1208,23 @@ pass is the default implementation for the interface.</p>
</div>
<!-- *********************************************************************** -->
<div class="doc_section">
<a name="passStatistics">Pass Statistics</a>
</div>
<!-- *********************************************************************** -->
<div class="doc_text">
<p>The <a
href="http://llvm.cs.uiuc.edu/doxygen/Statistic_8h-source.html"><tt>Statistic</tt></a>
class, is designed to be an easy way to expose various success
metrics from passes. These statistics are printed at the end of a
run, when the -stats command line option is enabled on the command
line. See the <a href="http://llvm.org/docs/ProgrammersManual.html#Statistic">Statistics section</a> in the Programmer's Manual for details.
</div>
<!-- *********************************************************************** -->
<div class="doc_section">
<a name="passmanager">What PassManager does</a>
@@ -1129,7 +1267,7 @@ etc... until the entire program has been run through the passes.
the LLVM program representation for a single function at a time, instead of
traversing the entire program. It reduces the memory consumption of compiler,
because, for example, only one <a
href="http://llvm.cs.uiuc.edu/doxygen/structllvm_1_1DominatorSet.html"><tt>DominatorSet</tt></a>
href="http://llvm.cs.uiuc.edu/doxygen/classllvm_1_1DominatorSet.html"><tt>DominatorSet</tt></a>
needs to be calculated at a time. This also makes it possible some <a
href="#SMP">interesting enhancements</a> in the future.</p></li>
@@ -1153,7 +1291,7 @@ how our <a href="#basiccode">Hello World</a> pass interacts with other passes.
Lets try it out with the <tt>gcse</tt> and <tt>licm</tt> passes:</p>
<pre>
$ opt -load ../../../lib/Debug/libhello.so -gcse -licm --debug-pass=Structure &lt; hello.bc &gt; /dev/null
$ opt -load ../../../Debug/lib/Hello.so -gcse -licm --debug-pass=Structure &lt; hello.bc &gt; /dev/null
Module Pass Manager
Function Pass Manager
Dominator Set Construction
@@ -1190,7 +1328,7 @@ passes.</p>
World</a> pass in between the two passes:</p>
<pre>
$ opt -load ../../../lib/Debug/libhello.so -gcse -hello -licm --debug-pass=Structure &lt; hello.bc &gt; /dev/null
$ opt -load ../../../Debug/lib/Hello.so -gcse -hello -licm --debug-pass=Structure &lt; hello.bc &gt; /dev/null
Module Pass Manager
Function Pass Manager
Dominator Set Construction
@@ -1231,7 +1369,7 @@ href="#getAnalysisUsage"><tt>getAnalysisUsage</tt></a> method to our pass:</p>
<p>Now when we run our pass, we get this output:</p>
<pre>
$ opt -load ../../../lib/Debug/libhello.so -gcse -hello -licm --debug-pass=Structure &lt; hello.bc &gt; /dev/null
$ opt -load ../../../Debug/lib/Hello.so -gcse -hello -licm --debug-pass=Structure &lt; hello.bc &gt; /dev/null
Pass Arguments: -gcse -hello -licm
Module Pass Manager
Function Pass Manager
@@ -1339,8 +1477,8 @@ want:</p>
<pre>
(gdb) <b>break PassManager::run</b>
Breakpoint 1 at 0x2413bc: file Pass.cpp, line 70.
(gdb) <b>run test.bc -load $(LLVMTOP)/llvm/lib/Debug/[libname].so -[passoption]</b>
Starting program: opt test.bc -load $(LLVMTOP)/llvm/lib/Debug/[libname].so -[passoption]
(gdb) <b>run test.bc -load $(LLVMTOP)/llvm/Debug/lib/[libname].so -[passoption]</b>
Starting program: opt test.bc -load $(LLVMTOP)/llvm/Debug/lib/[libname].so -[passoption]
Breakpoint 1, PassManager::run (this=0xffbef174, M=@0x70b298) at Pass.cpp:70
70 bool PassManager::run(Module &amp;M) { return PM-&gt;run(M); }
(gdb)
@@ -1424,50 +1562,24 @@ Despite that, we have kept the LLVM passes SMP ready, and you should too.</p>
<!-- _______________________________________________________________________ -->
<div class="doc_subsubsection">
<a name="ModuleSource">A new <tt>ModuleSource</tt> interface</a>
<a name="PassFunctionPass"><tt>ModulePass</tt>es requiring <tt>FunctionPass</tt>es</a>
</div>
<div class="doc_text">
<p>Currently, the <tt>PassManager</tt>'s <tt>run</tt> method takes a <tt><a
href="http://llvm.cs.uiuc.edu/doxygen/classllvm_1_1Module.html">Module</a></tt>
as input, and runs all of the passes on this module. The problem with this
approach is that none of the <tt>PassManager</tt> features can be used for
timing and debugging the actual <b>loading</b> of the module from disk or
standard input.</p>
<p>To solve this problem, eventually the <tt>PassManager</tt> class will accept
a <tt>ModuleSource</tt> object instead of a Module itself. When complete, this
will also allow for streaming of functions out of the bytecode representation,
allowing us to avoid holding the entire program in memory at once if we only are
dealing with <a href="#FunctionPass">FunctionPass</a>es.</p>
<p>As part of a different issue, eventually the bytecode loader will be extended
to allow on-demand loading of functions from the bytecode representation, in
order to better support the runtime reoptimizer. The bytecode format is already
capable of this, the loader just needs to be reworked a bit.</p>
</div>
<!-- _______________________________________________________________________ -->
<div class="doc_subsubsection">
<a name="PassFunctionPass"><tt>Pass</tt>es requiring <tt>FunctionPass</tt>es</a>
</div>
<div class="doc_text">
<p>Currently it is illegal for a <a href="#Pass"><tt>Pass</tt></a> to require a
<a href="#FunctionPass"><tt>FunctionPass</tt></a>. This is because there is
only one instance of the <a href="#FunctionPass"><tt>FunctionPass</tt></a>
object ever created, thus nowhere to store information for all of the functions
in the program at the same time. Although this has come up a couple of times
before, this has always been worked around by factoring one big complicated pass
into a global and an interprocedural part, both of which are distinct. In the
future, it would be nice to have this though.</p>
<p>Currently it is illegal for a <a href="#ModulePass"><tt>ModulePass</tt></a>
to require a <a href="#FunctionPass"><tt>FunctionPass</tt></a>. This is because
there is only one instance of the <a
href="#FunctionPass"><tt>FunctionPass</tt></a> object ever created, thus nowhere
to store information for all of the functions in the program at the same time.
Although this has come up a couple of times before, this has always been worked
around by factoring one big complicated pass into a global and an
interprocedural part, both of which are distinct. In the future, it would be
nice to have this though.</p>
<p>Note that it is no problem for a <a
href="#FunctionPass"><tt>FunctionPass</tt></a> to require the results of a <a
href="#Pass"><tt>Pass</tt></a>, only the other way around.</p>
href="#ModulePass"><tt>ModulePass</tt></a>, only the other way around.</p>
</div>

View File

@@ -23,14 +23,14 @@ PROJECT_NAME = LLVM
# This could be handy for archiving the generated documentation or
# if some version control system is used.
PROJECT_NUMBER =
PROJECT_NUMBER = @PACKAGE_VERSION@
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
# base path where the generated documentation will be put.
# If a relative path is entered, it will be relative to the location
# where doxygen was started. If left blank the current directory will be used.
OUTPUT_DIRECTORY = doxygen
OUTPUT_DIRECTORY = @abs_top_builddir@/docs/doxygen
# The OUTPUT_LANGUAGE tag is used to specify the language in which all
# documentation generated by doxygen is written. Doxygen will use this
@@ -88,7 +88,7 @@ HIDE_UNDOC_CLASSES = NO
BRIEF_MEMBER_DESC = YES
# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
# the brief description of a member or function before the detailed description.
# the brief description of a member or function before the detailed description.
# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
# brief descriptions will be completely suppressed.
@@ -301,7 +301,7 @@ WARN_LOGFILE =
# directories like "/usr/src/myproject". Separate the files or directories with
# spaces.
INPUT = .. ./doxygen.intro
INPUT = @abs_top_srcdir@/include @abs_top_srcdir@/lib @abs_top_srcdir@/docs/doxygen.intro
# If the value of the INPUT tag contains directories, you can use the
# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
@@ -318,11 +318,11 @@ FILE_PATTERNS =
RECURSIVE = YES
# The EXCLUDE tag can be used to specify files and/or directories that should
# The EXCLUDE tag can be u sed to specify files and/or directories that should
# excluded from the INPUT source files. This way you can easily exclude a
# subdirectory from a directory tree whose root is specified with the INPUT tag.
EXCLUDE = ../test ../include/boost
EXCLUDE =
# If the value of the INPUT tag contains directories, you can use the
# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
@@ -334,7 +334,7 @@ EXCLUDE_PATTERNS =
# directories that contain example code fragments that are included (see
# the \include command).
EXAMPLE_PATH =
EXAMPLE_PATH = @abs_top_srcdir@/examples
# If the value of the EXAMPLE_PATH tag contains directories, you can use the
# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
@@ -348,13 +348,13 @@ EXAMPLE_PATTERNS =
# commands irrespective of the value of the RECURSIVE tag.
# Possible values are YES and NO. If left blank NO is used.
EXAMPLE_RECURSIVE = NO
EXAMPLE_RECURSIVE = YES
# The IMAGE_PATH tag can be used to specify one or more files or
# directories that contain image that are included in the documentation (see
# the \image command).
IMAGE_PATH =
IMAGE_PATH = @abs_top_srcdir@/docs/img
# The INPUT_FILTER tag can be used to specify a program that doxygen should
# invoke to filter for each input file. Doxygen will invoke the filter program
@@ -418,7 +418,7 @@ COLS_IN_ALPHA_INDEX = 4
# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
# should be ignored while generating the index headers.
IGNORE_PREFIX =
IGNORE_PREFIX = llvm::
#---------------------------------------------------------------------------
# configuration options related to the HTML output
@@ -433,26 +433,26 @@ GENERATE_HTML = YES
# If a relative path is entered the value of OUTPUT_DIRECTORY will be
# put in front of it. If left blank `html' will be used as the default path.
HTML_OUTPUT = .
HTML_OUTPUT = html
# The HTML_HEADER tag can be used to specify a personal HTML header for
# each generated HTML page. If it is left blank doxygen will generate a
# standard header.
HTML_HEADER = doxygen.header
HTML_HEADER = @abs_top_srcdir@/docs/doxygen.header
# The HTML_FOOTER tag can be used to specify a personal HTML footer for
# each generated HTML page. If it is left blank doxygen will generate a
# standard footer.
HTML_FOOTER = doxygen.footer
HTML_FOOTER = @abs_top_srcdir@/docs/doxygen.footer
# The HTML_STYLESHEET tag can be used to specify a user defined cascading
# style sheet that is used by each HTML page. It can be used to
# fine-tune the look of the HTML output. If the tag is left blank doxygen
# will generate a default style sheet
HTML_STYLESHEET = doxygen.css
HTML_STYLESHEET = @abs_top_srcdir@/docs/doxygen.css
# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
# files or namespaces will be aligned in HTML using tables. If set to
@@ -536,7 +536,7 @@ COMPACT_LATEX = NO
# by the printer. Possible values are: a4, a4wide, letter, legal and
# executive. If left blank a4wide will be used.
PAPER_TYPE = a4wide
PAPER_TYPE = letter
# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
# packages that should be included in the LaTeX output.
@@ -817,7 +817,7 @@ GRAPHICAL_HIERARCHY = YES
# The tag DOT_PATH can be used to specify the path where the dot tool can be
# found. If left blank, it is assumed the dot tool can be found on the path.
DOT_PATH =
DOT_PATH = @DOT@
# The DOTFILE_DIRS tag can be used to specify one or more directories that
# contain dot files that are included in the documentation (see the

View File

@@ -1,14 +1,7 @@
////////////////////////////////////////////////////////////////////////////////
/// @file doxygen.intro
/// @author Reid Spencer <rspencer@x10sys.com>
/// @date 2003/12/30
/// @brief LLVM API documentation introduction.
////////////////////////////////////////////////////////////////////////////////
///
/// @mainpage LLVM:Low Level Virtual Machine
/// @mainpage Low Level Virtual Machine
///
/// @section main_intro Introduction
/// Welcome to the Low Level Virtual Machine (LLVM)
/// 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

BIN
llvm/docs/img/libdeps.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 141 KiB

BIN
llvm/docs/img/objdeps.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 189 KiB

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