Commit Graph

19255 Commits

Author SHA1 Message Date
Andrew Lenharth 111e5e6490 update interface
llvm-svn: 22498
2005-07-22 20:49:37 +00:00
Andrew Lenharth 940b07c7fa 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
llvm-svn: 22497
2005-07-22 20:48:12 +00:00
Andrew Lenharth cf5cf4dfcd 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
llvm-svn: 22496
2005-07-22 20:46:42 +00:00
Chris Lattner 9762834a7f new testcase for PR602
llvm-svn: 22495
2005-07-21 21:55:08 +00:00
Nate Begeman a9443f29b0 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.

llvm-svn: 22494
2005-07-21 20:44:43 +00:00
Chris Lattner 53208ecf34 revert to using 4-byte alignment for doubles, as specified by the ABI
llvm-svn: 22493
2005-07-21 19:17:18 +00:00
Chris Lattner 8a8f2e5a01 llvm.sqrt somehow escaped documentation.
llvm-svn: 22490
2005-07-21 01:29:16 +00:00
Nate Begeman 15527113ab Support assembling fsqrt on darwin. This will be implemented better when
PowerPC gets subtarget support up.

llvm-svn: 22489
2005-07-21 01:25:49 +00:00
Chris Lattner 4e6c118b4d If errno doesn't matter (e.g. in -ffast-math scenarios), sqrt* should be
compiled to llvm.sqrt.

llvm-svn: 22488
2005-07-21 01:09:27 +00:00
Nate Begeman 8465fe8b4b Generate mfocrf when targeting g5. Generate fsqrt/fsqrts when targetin g5.
8-byte align doubles.

llvm-svn: 22486
2005-07-20 22:42:00 +00:00
Misha Brukman 5379a5b571 * "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

llvm-svn: 22485
2005-07-20 21:06:37 +00:00
Chris Lattner 24b350039b Allow this to pass on non-linux systems as well, such as darwin
llvm-svn: 22484
2005-07-20 19:12:00 +00:00
Chris Lattner 18aa4d8196 Do not let MaskedValueIsZero consider undef to be zero, for reasons
explained in the comment.

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

llvm-svn: 22483
2005-07-20 18:49:28 +00:00
Chris Lattner 05732c86d4 count the number of relocations performed.
llvm-svn: 22480
2005-07-20 16:29:20 +00:00
Chris Lattner 14568496c0 set the target triple so that we don't fail due to X86 abi issues
llvm-svn: 22479
2005-07-20 03:56:48 +00:00
Nate Begeman 0851f1aaa1 Integrate SelectFPExpr into SelectExpr. This gets PPC32 closer to being
automatically generated from a target description.

llvm-svn: 22470
2005-07-19 16:51:05 +00:00
Nate Begeman 1ac40a1245 Remove unnecessary FP_EXTEND. This causes worse codegen for SSE.
llvm-svn: 22469
2005-07-19 16:50:03 +00:00
Reid Spencer d37d854cb2 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.

llvm-svn: 22468
2005-07-19 04:52:44 +00:00
Chris Lattner fb6343984a remove some sparc-v9-specific information
llvm-svn: 22467
2005-07-19 03:37:48 +00:00
Reid Spencer e5dc84b73c Provide descriptions for the TargetInstrInfo and TargetFrameInfo classes.
llvm-svn: 22466
2005-07-19 01:36:35 +00:00
Chris Lattner 247aef884c 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.

llvm-svn: 22465
2005-07-18 23:07:33 +00:00
Chris Lattner b35912e421 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.

llvm-svn: 22464
2005-07-18 04:31:14 +00:00
Reid Spencer 012d35ae17 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.

llvm-svn: 22461
2005-07-17 05:30:33 +00:00
Reid Spencer e7e3c214cf 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.

llvm-svn: 22458
2005-07-17 00:50:40 +00:00
Chris Lattner a5998ce94f 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.

llvm-svn: 22457
2005-07-16 17:41:06 +00:00
Chris Lattner 2148cffae7 Add two helper methods, adjust a prototype
llvm-svn: 22456
2005-07-16 17:40:34 +00:00
Chris Lattner 363964e53d Refactor getSection() method to make it easier to use.
llvm-svn: 22455
2005-07-16 17:36:04 +00:00
Chris Lattner 2b3380b44e Add ability to set TYPE and FLAGS field for section trivially
llvm-svn: 22454
2005-07-16 17:35:26 +00:00
Chris Lattner fd44500427 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.

llvm-svn: 22453
2005-07-16 08:01:13 +00:00
Nate Begeman 7e74c834c1 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

llvm-svn: 22452
2005-07-16 02:02:34 +00:00
Nate Begeman 8293d0e232 Teach the register allocator that movaps is also a move instruction
llvm-svn: 22451
2005-07-16 02:00:20 +00:00
Nate Begeman 57b9ed522d A couple more darwinisms
llvm-svn: 22450
2005-07-16 01:59:47 +00:00
Chris Lattner 507a27592f 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

llvm-svn: 22449
2005-07-16 00:28:20 +00:00
Chris Lattner e3e847bfd7 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.

llvm-svn: 22447
2005-07-16 00:19:57 +00:00
Chris Lattner b47f5e6d54 You can't use config options without config.h
llvm-svn: 22446
2005-07-15 22:48:31 +00:00
Chris Lattner 3a6a4d3707 Fix PR595: These error messages should not be looking at CGI.Name, they
should be looking at CGI.TheDef->getName().

llvm-svn: 22445
2005-07-15 22:43:04 +00:00
John Criswell a3f5110d5e Fixed some punctuation.
llvm-svn: 22443
2005-07-15 19:25:12 +00:00
Nate Begeman a0b5e035ea Get closer to fully working scalar FP in SSE regs. This gets singlesource
working, and Olden/power.

llvm-svn: 22441
2005-07-15 00:38:55 +00:00
Nate Begeman 0f38dc4970 Add support for printing the sse scalar comparison instruction mnemonics.
llvm-svn: 22440
2005-07-14 22:52:25 +00:00
Nate Begeman 4f229d5197 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.

llvm-svn: 22439
2005-07-14 22:50:30 +00:00
John Criswell b249d409be Regression test for PR#596: Make sure that negation of a minus doesn't
turn into a C predecrement operator.

llvm-svn: 22438
2005-07-14 19:56:03 +00:00
John Criswell 3870f9d31a 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.

llvm-svn: 22437
2005-07-14 19:41:16 +00:00
Chris Lattner 46524e2573 Make this use the new autoconf support for finding the executables for
gv and Graphviz.

llvm-svn: 22434
2005-07-14 05:33:13 +00:00
Reid Spencer f284268ba5 * 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.

llvm-svn: 22433
2005-07-14 05:19:12 +00:00
Chris Lattner fcc53ad625 As discussed on IRC, this stuff is just for debugging.
llvm-svn: 22432
2005-07-14 05:17:43 +00:00
Reid Spencer 0ac41946e1 Put the path to the Graphviz program in the #defines so it can be used.
llvm-svn: 22430
2005-07-14 02:25:12 +00:00
Chris Lattner 51ded0e1ee If the Graphviz program is available, use it to visualize dot graphs.
llvm-svn: 22429
2005-07-14 01:10:55 +00:00
Reid Spencer 8640f2bdc1 Get rid of warnings on Alpha
llvm-svn: 22428
2005-07-13 23:20:24 +00:00
Reid Spencer f17006fdda 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.

llvm-svn: 22424
2005-07-13 03:20:14 +00:00
Reid Spencer 86df93a216 Don't call pthread_mutexattr_setpshared on FreeBSD because its implementation
of pthreads is missing that call (despite it violating the spec).

llvm-svn: 22423
2005-07-13 03:02:06 +00:00