oota-llvm.git
19 years agoPowerPC no-pic code is not quite ready for prime-time
Chris Lattner [Fri, 22 Jul 2005 22:58:34 +0000 (22:58 +0000)]
PowerPC no-pic code is not quite ready for prime-time

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22507 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoNo, really, it's an Alpha! And you probably thought it was a PowerPC.
Misha Brukman [Fri, 22 Jul 2005 22:43:40 +0000 (22:43 +0000)]
No, really, it's an Alpha!  And you probably thought it was a PowerPC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22506 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoHandle more imm forms, and load small negative i32 constants without hitting memory...
Andrew Lenharth [Fri, 22 Jul 2005 22:24:01 +0000 (22:24 +0000)]
Handle more imm forms, and load small negative i32 constants without hitting memory (should do the same for arbitrary zero extended small negative constants)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22505 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoI know PowerPC wishes it could be alpha, but it cannot. so there
Andrew Lenharth [Fri, 22 Jul 2005 22:00:24 +0000 (22:00 +0000)]
I know PowerPC wishes it could be alpha, but it cannot.  so there

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22504 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agomake sure we always handle small negatives well
Andrew Lenharth [Fri, 22 Jul 2005 21:53:35 +0000 (21:53 +0000)]
make sure we always handle small negatives well

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22503 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agofinally found the gcc defined constants
Andrew Lenharth [Fri, 22 Jul 2005 21:00:30 +0000 (21:00 +0000)]
finally found the gcc defined constants

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22502 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoAlpha has JIT
Andrew Lenharth [Fri, 22 Jul 2005 20:54:01 +0000 (20:54 +0000)]
Alpha has JIT

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22501 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoAlpha JIT (beta)
Andrew Lenharth [Fri, 22 Jul 2005 20:52:16 +0000 (20:52 +0000)]
Alpha JIT (beta)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22500 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agosimpilfy instruction encoding (and make the lines way shorter, aka Misha happification)
Andrew Lenharth [Fri, 22 Jul 2005 20:50:29 +0000 (20:50 +0000)]
simpilfy instruction encoding (and make the lines way shorter, aka Misha happification)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22499 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoupdate interface
Andrew Lenharth [Fri, 22 Jul 2005 20:49:37 +0000 (20:49 +0000)]
update interface

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22498 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agothe JIT memory manager will construct a GOT if you want it too. Also, it places...
Andrew Lenharth [Fri, 22 Jul 2005 20:48:12 +0000 (20:48 +0000)]
the JIT memory manager will construct a GOT if you want it too.  Also, it places the constants in the allocated memory, rather than a malloc area

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22497 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoallow constants to be relocated like GV (necessary for alpha, as constants are reloca...
Andrew Lenharth [Fri, 22 Jul 2005 20:46:42 +0000 (20:46 +0000)]
allow constants to be relocated like GV (necessary for alpha, as constants are relocated with globals, not with .text), and allow targets to have a GOT managed for them

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22496 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agonew testcase for PR602
Chris Lattner [Thu, 21 Jul 2005 21:55:08 +0000 (21:55 +0000)]
new testcase for PR602

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22495 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoSupport building non-PIC
Nate Begeman [Thu, 21 Jul 2005 20:44:43 +0000 (20:44 +0000)]
Support building non-PIC
Remove the LoadHiAddr pseudo-instruction.
Optimization of stores to and loads from statics.
Force JIT to use new non-PIC codepaths.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22494 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agorevert to using 4-byte alignment for doubles, as specified by the ABI
Chris Lattner [Thu, 21 Jul 2005 19:17:18 +0000 (19:17 +0000)]
revert to using 4-byte alignment for doubles, as specified by the ABI

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22493 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agollvm.sqrt somehow escaped documentation.
Chris Lattner [Thu, 21 Jul 2005 01:29:16 +0000 (01:29 +0000)]
llvm.sqrt somehow escaped documentation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22490 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoSupport assembling fsqrt on darwin. This will be implemented better when
Nate Begeman [Thu, 21 Jul 2005 01:25:49 +0000 (01:25 +0000)]
Support assembling fsqrt on darwin.  This will be implemented better when
PowerPC gets subtarget support up.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22489 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoIf errno doesn't matter (e.g. in -ffast-math scenarios), sqrt* should be
Chris Lattner [Thu, 21 Jul 2005 01:09:27 +0000 (01:09 +0000)]
If errno doesn't matter (e.g. in -ffast-math scenarios), sqrt* should be
compiled to llvm.sqrt.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22488 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoGenerate mfocrf when targeting g5. Generate fsqrt/fsqrts when targetin g5.
Nate Begeman [Wed, 20 Jul 2005 22:42:00 +0000 (22:42 +0000)]
Generate mfocrf when targeting g5.  Generate fsqrt/fsqrts when targetin g5.
8-byte align doubles.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22486 91177308-0d34-0410-b5e6-96231b3b80d8

19 years ago* "GNU Compiler Collection's gcc tool" is redundant
Misha Brukman [Wed, 20 Jul 2005 21:06:37 +0000 (21:06 +0000)]
* "GNU Compiler Collection's gcc tool" is redundant
* Made bullet points start with a verb and lowercase, since they are not
  complete sentences
* Cleaned up grammar, removed extraneous verbosity

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22485 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoAllow this to pass on non-linux systems as well, such as darwin
Chris Lattner [Wed, 20 Jul 2005 19:12:00 +0000 (19:12 +0000)]
Allow this to pass on non-linux systems as well, such as darwin

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22484 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoDo not let MaskedValueIsZero consider undef to be zero, for reasons
Chris Lattner [Wed, 20 Jul 2005 18:49:28 +0000 (18:49 +0000)]
Do not let MaskedValueIsZero consider undef to be zero, for reasons
explained in the comment.

This fixes UnitTests/2003-09-18-BitFieldTest on darwin

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22483 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agocount the number of relocations performed.
Chris Lattner [Wed, 20 Jul 2005 16:29:20 +0000 (16:29 +0000)]
count the number of relocations performed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22480 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoset the target triple so that we don't fail due to X86 abi issues
Chris Lattner [Wed, 20 Jul 2005 03:56:48 +0000 (03:56 +0000)]
set the target triple so that we don't fail due to X86 abi issues

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22479 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoIntegrate SelectFPExpr into SelectExpr. This gets PPC32 closer to being
Nate Begeman [Tue, 19 Jul 2005 16:51:05 +0000 (16:51 +0000)]
Integrate SelectFPExpr into SelectExpr.  This gets PPC32 closer to being
automatically generated from a target description.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22470 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoRemove unnecessary FP_EXTEND. This causes worse codegen for SSE.
Nate Begeman [Tue, 19 Jul 2005 16:50:03 +0000 (16:50 +0000)]
Remove unnecessary FP_EXTEND. This causes worse codegen for SSE.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22469 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoFor: memory operations -> stores
Reid Spencer [Tue, 19 Jul 2005 04:52:44 +0000 (04:52 +0000)]
For: memory operations -> stores
This is the first incremental patch to implement this feature. It adds no
functionality to LLVM but setup up the information needed from targets in
order to implement the optimization correctly. Each target needs to specify
the maximum number of store operations for conversion of the llvm.memset,
llvm.memcpy, and llvm.memmove intrinsics into a sequence of store operations.
The limit needs to be chosen at the threshold of performance for such an
optimization (generally smallish). The target also needs to specify whether
the target can support unaligned stores for multi-byte store operations.
This helps ensure the optimization doesn't generate code that will trap on
an alignment errors.
More patches to follow.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22468 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoremove some sparc-v9-specific information
Chris Lattner [Tue, 19 Jul 2005 03:37:48 +0000 (03:37 +0000)]
remove some sparc-v9-specific information

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22467 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoProvide descriptions for the TargetInstrInfo and TargetFrameInfo classes.
Reid Spencer [Tue, 19 Jul 2005 01:36:35 +0000 (01:36 +0000)]
Provide descriptions for the TargetInstrInfo and TargetFrameInfo classes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22466 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoWhen transforming &A[i] < &A[j] -> i < j, make sure to perform the comparison
Chris Lattner [Mon, 18 Jul 2005 23:07:33 +0000 (23:07 +0000)]
When transforming &A[i] < &A[j]  ->  i < j, make sure to perform the comparison
as a signed compare.  This patch may fix PR597, but is correct in any case.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22465 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoThe assertion was wrong: the code only worked for i64. While we're at it,
Chris Lattner [Mon, 18 Jul 2005 04:31:14 +0000 (04:31 +0000)]
The assertion was wrong: the code only worked for i64.  While we're at it,
expand the code to work for all integer datatypes.  This should unbreak
alpha.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22464 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoAdd a parameter to the FIND_STD_PROGRAM macro that allows an alternate name
Reid Spencer [Sun, 17 Jul 2005 05:30:33 +0000 (05:30 +0000)]
Add a parameter to the FIND_STD_PROGRAM macro that allows an alternate name
for the command line options. This helps with situations where the executable
name sought is too generic and a more meaningful name needs to be used for
the command line options. It also helps satisfy picky project leaders.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22461 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoAdd two new checks for use in LLVM configuration files:
Reid Spencer [Sun, 17 Jul 2005 00:50:40 +0000 (00:50 +0000)]
Add two new checks for use in LLVM configuration files:
* FIND_STD_PROGRAM will find a program in the path or using --with options
  and verify that the path/bin/program is executable. Also allows checking
  for include files and libraries. If found, USE_PROGRAM is set, otherwise
  its not set. Also sets PROGRAM_BIN (bin directory), and PROGRAM_DIR (top
  level directory). If headers are found, sets PROGRAM_INC. If libraries
  are found, sets PROGRAM_LIB.
* CHECK_PROGRAM_SANITY can be used to run a program with some option that
  only produces information output and requires no input. If the output
  matches a regular expression, the program passes the sanity check.
  Otherwise, an error occurs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22458 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoOnly get the .bss and .data sections when needed instead of unconditionally.
Chris Lattner [Sat, 16 Jul 2005 17:41:06 +0000 (17:41 +0000)]
Only get the .bss and .data sections when needed instead of unconditionally.
This allows is to not emit empty sections when .data or .bss is not used.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22457 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoAdd two helper methods, adjust a prototype
Chris Lattner [Sat, 16 Jul 2005 17:40:34 +0000 (17:40 +0000)]
Add two helper methods, adjust a prototype

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22456 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoRefactor getSection() method to make it easier to use.
Chris Lattner [Sat, 16 Jul 2005 17:36:04 +0000 (17:36 +0000)]
Refactor getSection() method to make it easier to use.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22455 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoAdd ability to set TYPE and FLAGS field for section trivially
Chris Lattner [Sat, 16 Jul 2005 17:35:26 +0000 (17:35 +0000)]
Add ability to set TYPE and FLAGS field for section trivially

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22454 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoMajor refactor of the ELFWriter code. Instead of building up one big
Chris Lattner [Sat, 16 Jul 2005 08:01:13 +0000 (08:01 +0000)]
Major refactor of the ELFWriter code.  Instead of building up one big
vector that represents the .o file at once, build up a vector for each
section of the .o file.  This is needed because the .o file writer needs
to be able to switch between sections as it emits them (e.g. switch
between the .text section and the .rel section when emitting code).

This patch has no functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22453 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoTeach the legalizer how to promote SINT_TO_FP to a wider SINT_TO_FP that
Nate Begeman [Sat, 16 Jul 2005 02:02:34 +0000 (02:02 +0000)]
Teach the legalizer how to promote SINT_TO_FP to a wider SINT_TO_FP that
the target natively supports.  This eliminates some special-case code from
the x86 backend and generates better code as well.

For an i8 to f64 conversion, before & after:

_x87 before:
        subl $2, %esp
        movb 6(%esp), %al
        movsbw %al, %ax
        movw %ax, (%esp)
        filds (%esp)
        addl $2, %esp
        ret

_x87 after:
        subl $2, %esp
        movsbw 6(%esp), %ax
        movw %ax, (%esp)
        filds (%esp)
        addl $2, %esp
        ret

_sse before:
        subl $12, %esp
        movb 16(%esp), %al
        movsbl %al, %eax
        cvtsi2sd %eax, %xmm0
        addl $12, %esp
        ret

_sse after:
        subl $12, %esp
        movsbl 16(%esp), %eax
        cvtsi2sd %eax, %xmm0
        addl $12, %esp
        ret

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22452 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoTeach the register allocator that movaps is also a move instruction
Nate Begeman [Sat, 16 Jul 2005 02:00:20 +0000 (02:00 +0000)]
Teach the register allocator that movaps is also a move instruction

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22451 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoA couple more darwinisms
Nate Begeman [Sat, 16 Jul 2005 01:59:47 +0000 (01:59 +0000)]
A couple more darwinisms

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22450 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoRemove all knowledge of UINT_TO_FP from the X86 backend, relying on the
Chris Lattner [Sat, 16 Jul 2005 00:28:20 +0000 (00:28 +0000)]
Remove all knowledge of UINT_TO_FP from the X86 backend, relying on the
legalizer to eliminate them.  With this comes the expected code quality
improvements, such as, for this:

double foo(unsigned short X) { return X; }

we now generate this:

_foo:
        subl $4, %esp
        movzwl 8(%esp), %eax
        movl %eax, (%esp)
        fildl (%esp)
        addl $4, %esp
        ret

instead of this:

_foo:
        subl $4, %esp
        movw 8(%esp), %ax
        movzwl %ax, %eax   ;; Load not folded into this.
        movl %eax, (%esp)
        fildl (%esp)
        addl $4, %esp
        ret

-Chris

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22449 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoBreak the code for expanding UINT_TO_FP operations out into its own
Chris Lattner [Sat, 16 Jul 2005 00:19:57 +0000 (00:19 +0000)]
Break the code for expanding UINT_TO_FP operations out into its own
SelectionDAGLegalize::ExpandLegalUINT_TO_FP method.

Add a new method, PromoteLegalUINT_TO_FP, which allows targets to request
that UINT_TO_FP operations be promoted to a larger input type.  This is
useful for targets that have some UINT_TO_FP or SINT_TO_FP operations but
not all of them (like X86).

The same should be done with SINT_TO_FP, but this patch does not do that
yet.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22447 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoYou can't use config options without config.h
Chris Lattner [Fri, 15 Jul 2005 22:48:31 +0000 (22:48 +0000)]
You can't use config options without config.h

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22446 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoFix PR595: These error messages should not be looking at CGI.Name, they
Chris Lattner [Fri, 15 Jul 2005 22:43:04 +0000 (22:43 +0000)]
Fix PR595: These error messages should not be looking at CGI.Name, they
should be looking at CGI.TheDef->getName().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22445 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoFixed some punctuation.
John Criswell [Fri, 15 Jul 2005 19:25:12 +0000 (19:25 +0000)]
Fixed some punctuation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22443 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoGet closer to fully working scalar FP in SSE regs. This gets singlesource
Nate Begeman [Fri, 15 Jul 2005 00:38:55 +0000 (00:38 +0000)]
Get closer to fully working scalar FP in SSE regs.  This gets singlesource
working, and Olden/power.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22441 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoAdd support for printing the sse scalar comparison instruction mnemonics.
Nate Begeman [Thu, 14 Jul 2005 22:52:25 +0000 (22:52 +0000)]
Add support for printing the sse scalar comparison instruction mnemonics.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22440 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoAdd support for a TODO; instructions in .td files can now have arguments
Nate Begeman [Thu, 14 Jul 2005 22:50:30 +0000 (22:50 +0000)]
Add support for a TODO; instructions in .td files can now have arguments
printed as part of the opcode.  This allows something like
cmp${cc}ss in the x86 backed to be printed as cmpltss, cmpless, etc.
depending on what the value of $cc is.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22439 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoRegression test for PR#596: Make sure that negation of a minus doesn't
John Criswell [Thu, 14 Jul 2005 19:56:03 +0000 (19:56 +0000)]
Regression test for PR#596: Make sure that negation of a minus doesn't
turn into a C predecrement operator.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22438 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoFixed PR#596:
John Criswell [Thu, 14 Jul 2005 19:41:16 +0000 (19:41 +0000)]
Fixed PR#596:
Add parenthesis around the value being negated; that way, if the value
begins with a minus sign (e.g. negative integer), we won't generate a
C predecrement operator by mistake.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22437 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoMake this use the new autoconf support for finding the executables for
Chris Lattner [Thu, 14 Jul 2005 05:33:13 +0000 (05:33 +0000)]
Make this use the new autoconf support for finding the executables for
gv and Graphviz.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22434 91177308-0d34-0410-b5e6-96231b3b80d8

19 years ago* Correct the AC_DEFINE for LLVM_PATH_GRAPHVIZ to use AC_DEFINE_UNQUOTED so
Reid Spencer [Thu, 14 Jul 2005 05:19:12 +0000 (05:19 +0000)]
* Correct the AC_DEFINE for LLVM_PATH_GRAPHVIZ to use AC_DEFINE_UNQUOTED so
  we actually get the path and not $GRAPHVIZ as the value.
* Add a #define for the gv program (HAVE_GV) and its value LLVM_PATH_GV.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22433 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoAs discussed on IRC, this stuff is just for debugging.
Chris Lattner [Thu, 14 Jul 2005 05:17:43 +0000 (05:17 +0000)]
As discussed on IRC, this stuff is just for debugging.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22432 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoPut the path to the Graphviz program in the #defines so it can be used.
Reid Spencer [Thu, 14 Jul 2005 02:25:12 +0000 (02:25 +0000)]
Put the path to the Graphviz program in the #defines so it can be used.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22430 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoIf the Graphviz program is available, use it to visualize dot graphs.
Chris Lattner [Thu, 14 Jul 2005 01:10:55 +0000 (01:10 +0000)]
If the Graphviz program is available, use it to visualize dot graphs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22429 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoGet rid of warnings on Alpha
Reid Spencer [Wed, 13 Jul 2005 23:20:24 +0000 (23:20 +0000)]
Get rid of warnings on Alpha

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22428 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoImplement a test for the Graphviz program for Chris Lattner. The symbol
Reid Spencer [Wed, 13 Jul 2005 03:20:14 +0000 (03:20 +0000)]
Implement a test for the Graphviz program for Chris Lattner. The symbol
GRAPHVIZ will contain the path to the program if its found (or "echo Graphviz"
if not) and the #define HAVE_GRAPHVIZ will be defined if its found.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22424 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoDon't call pthread_mutexattr_setpshared on FreeBSD because its implementation
Reid Spencer [Wed, 13 Jul 2005 03:02:06 +0000 (03:02 +0000)]
Don't call pthread_mutexattr_setpshared on FreeBSD because its implementation
of pthreads is missing that call (despite it violating the spec).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22423 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoNote to self: don't introduce memory leaks.
Jeff Cohen [Wed, 13 Jul 2005 02:58:04 +0000 (02:58 +0000)]
Note to self: don't introduce memory leaks.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22422 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoEliminate tabs
Jeff Cohen [Wed, 13 Jul 2005 02:19:59 +0000 (02:19 +0000)]
Eliminate tabs

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22421 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoWin32 support for Mutex class.
Jeff Cohen [Wed, 13 Jul 2005 02:15:18 +0000 (02:15 +0000)]
Win32 support for Mutex class.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22420 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoFix Alpha/2005-07-12-TwoMallocCalls.ll and PR593.
Chris Lattner [Wed, 13 Jul 2005 02:00:04 +0000 (02:00 +0000)]
Fix Alpha/2005-07-12-TwoMallocCalls.ll and PR593.

It is not safe to call LegalizeOp on something that has already been legalized.
Instead, just force another iteration of legalization.

This could affect all platforms but X86, as this codepath is dynamically
dead on X86 (ISD::MEMSET and friends are legal).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22419 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agonew testcase for PR593
Chris Lattner [Wed, 13 Jul 2005 01:57:39 +0000 (01:57 +0000)]
new testcase for PR593

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22418 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoFix test/Regression/CodeGen/Generic/2005-07-12-memcpy-i64-length.ll
Chris Lattner [Wed, 13 Jul 2005 01:42:45 +0000 (01:42 +0000)]
Fix test/Regression/CodeGen/Generic/2005-07-12-memcpy-i64-length.ll

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22417 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agonew testcase that crashes llc on x86/ppc. Not generated by C/C++ or LLVM
Chris Lattner [Wed, 13 Jul 2005 01:42:03 +0000 (01:42 +0000)]
new testcase that crashes llc on x86/ppc.  Not generated by C/C++ or LLVM
though.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22416 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoAdd a test that runs the ParallelJIT example program to ensure that the
Reid Spencer [Wed, 13 Jul 2005 00:35:12 +0000 (00:35 +0000)]
Add a test that runs the ParallelJIT example program to ensure that the
JIT can run against a multi-threaded program without getting its data
structures messed up. Also had to add the examples directory to the path
for the tests so that ParallelJIT can be found.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22415 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoCorrect the file title.
Reid Spencer [Tue, 12 Jul 2005 22:00:29 +0000 (22:00 +0000)]
Correct the file title.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22414 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoFor PR418:
Reid Spencer [Tue, 12 Jul 2005 21:51:33 +0000 (21:51 +0000)]
For PR418:
Add an example program that utilizes multiple threads in the JIT to process
work. This was used by Evan Jones as the original test case for ensuring
that the ExecutionEngine was thread safe.

Original source by Evan Jones (adapted from other LLVM JIT examples) and
made LLVM style compliant by Reid Spencer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22411 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoCheck in the last of the darwin-specific code necessary to get shootout
Nate Begeman [Tue, 12 Jul 2005 18:34:58 +0000 (18:34 +0000)]
Check in the last of the darwin-specific code necessary to get shootout
working before modifying the asm printer to use the subtarget info.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22408 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoRemove some code that moved to the generic asm printer a long time ago.
Nate Begeman [Tue, 12 Jul 2005 18:34:15 +0000 (18:34 +0000)]
Remove some code that moved to the generic asm printer a long time ago.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22407 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoUpdate release notes regarding thread-safe JIT.
Reid Spencer [Tue, 12 Jul 2005 16:36:24 +0000 (16:36 +0000)]
Update release notes regarding thread-safe JIT.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22405 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoFor PR540:
Reid Spencer [Tue, 12 Jul 2005 15:51:55 +0000 (15:51 +0000)]
For PR540:
This patch completes the changes for making lli thread-safe. Here's the list
of changes:
* The Support/ThreadSupport* files were removed and replaced with the
  MutexGuard.h file since all ThreadSupport* declared was a Mutex Guard.
  The implementation of MutexGuard.h is now based on sys::Mutex which hides
  its implementation and makes it unnecessary to have the -NoSupport.h and
  -PThreads.h versions of ThreadSupport.

* All places in ExecutionEngine that previously referred to "Mutex" now
  refer to sys::Mutex

* All places in ExecutionEngine that previously referred to "MutexLocker"
  now refer to MutexGuard (this is frivolous but I believe the technically
  correct name for such a class is "Guard" not a "Locker").

These changes passed all of llvm-test. All we need now are some test cases
that actually use multiple threads.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22404 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoFor PR540:
Reid Spencer [Tue, 12 Jul 2005 15:37:43 +0000 (15:37 +0000)]
For PR540:
Add a Mutex class for thread synchronization in a platform-independent way.
The current implementation only supports pthreads. Win32 use of Critical
Sections will be added later. The design permits other threading models to
be used if (and only if) pthreads is not available.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22403 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoFor PR540:
Reid Spencer [Tue, 12 Jul 2005 15:24:20 +0000 (15:24 +0000)]
For PR540:
* Add check for pthread.h
* Make sure -lpthread gets added to LIBS if its available

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22402 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoIn support of PR418:
Reid Spencer [Tue, 12 Jul 2005 07:19:13 +0000 (07:19 +0000)]
In support of PR418:
Make sure that -lpthread gets added to LIBS variable which puts it at the
end of the tools' link commands, if libpthread.a is found.

Add a test for pthread.h so we can use #ifdef HAVE_PTHREAD_H

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22401 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoAdd support for 64-bit elf files
Chris Lattner [Tue, 12 Jul 2005 06:57:52 +0000 (06:57 +0000)]
Add support for 64-bit elf files

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22400 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoAdd support for emitting 64-bit integers
Chris Lattner [Tue, 12 Jul 2005 06:57:26 +0000 (06:57 +0000)]
Add support for emitting 64-bit integers

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22399 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoAdd some apparently undocumented ELF section header flags
Chris Lattner [Tue, 12 Jul 2005 06:40:29 +0000 (06:40 +0000)]
Add some apparently undocumented ELF section header flags

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22398 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoFix povray and minor cleanups
Andrew Lenharth [Tue, 12 Jul 2005 04:20:52 +0000 (04:20 +0000)]
Fix povray and minor cleanups

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22397 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoClean up and add comments to the newly implemented subtarget code.
Nate Begeman [Tue, 12 Jul 2005 03:04:49 +0000 (03:04 +0000)]
Clean up and add comments to the newly implemented subtarget code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22396 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoAdd new files to Visual Studio projects.
Jeff Cohen [Tue, 12 Jul 2005 03:00:20 +0000 (03:00 +0000)]
Add new files to Visual Studio projects.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22395 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoI don't know how this ever compiled with gcc, but VC++ correctly rejects it.
Jeff Cohen [Tue, 12 Jul 2005 02:59:38 +0000 (02:59 +0000)]
I don't know how this ever compiled with gcc, but VC++ correctly rejects it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22394 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoVC++ demands that the function returns a value
Jeff Cohen [Tue, 12 Jul 2005 02:53:33 +0000 (02:53 +0000)]
VC++ demands that the function returns a value

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22393 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoClean up the TargetSubtarget class a bit, removing an unnecessary argument
Nate Begeman [Tue, 12 Jul 2005 02:41:19 +0000 (02:41 +0000)]
Clean up the TargetSubtarget class a bit, removing an unnecessary argument
to the constructor.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22392 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoMinor changes to improve comments and fix the build on _WIN32 systems.
Chris Lattner [Tue, 12 Jul 2005 02:36:10 +0000 (02:36 +0000)]
Minor changes to improve comments and fix the build on _WIN32 systems.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22391 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoAdd a note
Chris Lattner [Tue, 12 Jul 2005 02:35:36 +0000 (02:35 +0000)]
Add a note

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22390 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoImplement Subtarget support
Nate Begeman [Tue, 12 Jul 2005 01:41:54 +0000 (01:41 +0000)]
Implement Subtarget support
Implement the X86 Subtarget.

This consolidates the checks for target triple, and setting options based
on target triple into one place.  This allows us to convert the asm printer
and isel over from being littered with "forDarwin", "forCygwin", etc. into
just having the appropriate flags for each subtarget feature controlling
the code for that feature.

This patch also implements indirect external and weak references in the
X86 pattern isel, for darwin.  Next up is to convert over the asm printers
to use this new interface.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22389 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoCommit some pending darwin changes before subtarget support.
Nate Begeman [Tue, 12 Jul 2005 01:37:28 +0000 (01:37 +0000)]
Commit some pending darwin changes before subtarget support.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22388 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoFix PR576.
Chris Lattner [Tue, 12 Jul 2005 01:00:32 +0000 (01:00 +0000)]
Fix PR576.

Instead of emitting a JIT stub that looks like this:

internal void %l1_main_entry_2E_ce_wrapper(int) {
header:
        %resolver = call sbyte* %getPointerToNamedFunction( sbyte* getelementptr ([20 x sbyte]* %l1_main_entry_2E_ce_name, int 0, int 0) )           ; <sbyte*> [#uses=1]
        %resolverCast = cast sbyte* %resolver to void (int)*            ; <void (int)*> [#uses=1]
        call void %resolverCast( int %0 )
        ret void
}

Emit one that looks like this:

internal void %l1_main_entry_2E_ce_wrapper(int) {
Entry:
%fpcache = load void (int)** %l1_main_entry_2E_ce.fpcache               ; <void (int)*> [#uses=2]
        %isNull = seteq void (int)* %fpcache, null              ; <bool> [#uses=1]
        br bool %isNull, label %lookupfp, label %usecache

usecache:               ; preds = %lookupfp, %Entry
        %fp = phi void (int)* [ %resolverCast, %lookupfp ], [ %fpcache, %Entry ]            ; <void (int)*> [#uses=1]
        call void %fp( int %0 )
        ret void

lookupfp:               ; preds = %Entry
        %resolver = call sbyte* %getPointerToNamedFunction( sbyte* getelementptr ([20 x sbyte]* %l1_main_entry_2E_ce_name, int 0, int 0) )           ; <sbyte*> [#uses=1]
        %resolverCast = cast sbyte* %resolver to void (int)*            ; <void (int)*> [#uses=2]
        store void (int)* %resolverCast, void (int)** %l1_main_entry_2E_ce.fpcache
        br label %usecache
}

This makes the JIT debugger *MUCH* faster on large programs, as
getPointerToNamedFunction takes time linear with the size of the program, and
before we would call it every time a function in the text module was called from
the safe module (ouch!).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22387 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoadd a note so I can remember the common t-t's
Chris Lattner [Tue, 12 Jul 2005 00:20:49 +0000 (00:20 +0000)]
add a note so I can remember the common t-t's

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22386 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agofix a warning
Chris Lattner [Mon, 11 Jul 2005 22:46:18 +0000 (22:46 +0000)]
fix a warning

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22385 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoRemove glibc specific functions, and mark a couple as C99
Andrew Lenharth [Mon, 11 Jul 2005 20:35:20 +0000 (20:35 +0000)]
Remove glibc specific functions, and mark a couple as C99

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22384 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agobecause on alpha:
Andrew Lenharth [Mon, 11 Jul 2005 17:41:12 +0000 (17:41 +0000)]
because on alpha:
#   define errno (*__errno_location ())

*shakes head

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22383 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoClean up code, no functionality changes.
Chris Lattner [Mon, 11 Jul 2005 06:34:30 +0000 (06:34 +0000)]
Clean up code, no functionality changes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22382 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoOutput .size directives to tell the assembler the size of each function.
Chris Lattner [Mon, 11 Jul 2005 06:29:14 +0000 (06:29 +0000)]
Output .size directives to tell the assembler the size of each function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22381 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoFix crazy indentation
Chris Lattner [Mon, 11 Jul 2005 06:25:47 +0000 (06:25 +0000)]
Fix crazy indentation

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22380 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoconvert dos newlines to unix. No other changes.
Chris Lattner [Mon, 11 Jul 2005 06:25:34 +0000 (06:25 +0000)]
convert dos newlines to unix.  No other changes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22379 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoEmit a symbol table entry for each function we output to the ELF file. This
Chris Lattner [Mon, 11 Jul 2005 06:17:35 +0000 (06:17 +0000)]
Emit a symbol table entry for each function we output to the ELF file.  This
allows objdump to know which function we are emitting to:

00000000 <foo>:     <----
   0:   b8 01 00 00 00          mov    $0x1,%eax
   5:   03 44 24 04             add    0x4(%esp,1),%eax
   9:   c3                      ret

... and allows .o files to be useful for linking :)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22378 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoThe symbol table just needs a const GlobalValue*, not a non-const one.
Chris Lattner [Mon, 11 Jul 2005 06:16:24 +0000 (06:16 +0000)]
The symbol table just needs a const GlobalValue*, not a non-const one.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22377 91177308-0d34-0410-b5e6-96231b3b80d8