oota-llvm.git
18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 years agoRefactor things a bit to allow the ELF code emitter to run the X86 machine code emitter
Chris Lattner [Mon, 11 Jul 2005 05:17:48 +0000 (05:17 +0000)]
Refactor things a bit to allow the ELF code emitter to run the X86 machine code emitter
after itself.

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

18 years agoadd code to emit the .text section to the section header.
Chris Lattner [Mon, 11 Jul 2005 05:17:18 +0000 (05:17 +0000)]
add code to emit the .text section to the section header.

Add a *VERY INITIAL* machine code emitter class.  This is enough to take
this C function:
int foo(int X) { return X +1; }

and make objdump produce the following:

$ objdump -d t-llvm.o

t-llvm.o:     file format elf32-i386

Disassembly of section .text:

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

Anything using branches or refering to the constant pool or requiring
relocations will not work yet.

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

18 years agoexpose a new code emitter object
Chris Lattner [Mon, 11 Jul 2005 05:15:32 +0000 (05:15 +0000)]
expose a new code emitter object

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

18 years agoadd a helper method
Chris Lattner [Mon, 11 Jul 2005 04:49:33 +0000 (04:49 +0000)]
add a helper method

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

18 years agoRemove prototype for non-existant function
Chris Lattner [Mon, 11 Jul 2005 04:20:55 +0000 (04:20 +0000)]
Remove prototype for non-existant function

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

18 years agoUse a name mangler object to uniquify names and remove nonstandard
Chris Lattner [Mon, 11 Jul 2005 03:11:47 +0000 (03:11 +0000)]
Use a name mangler object to uniquify names and remove nonstandard
characters from them.

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

18 years agoadd a name mangler object
Chris Lattner [Mon, 11 Jul 2005 03:11:10 +0000 (03:11 +0000)]
add a name mangler object

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

18 years agofix long lines
Chris Lattner [Mon, 11 Jul 2005 02:49:16 +0000 (02:49 +0000)]
fix long lines

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

18 years agoChange *EXTLOAD to use an VTSDNode operand instead of being an MVTSDNode.
Chris Lattner [Sun, 10 Jul 2005 01:56:13 +0000 (01:56 +0000)]
Change *EXTLOAD to use an VTSDNode operand instead of being an MVTSDNode.
This is the last MVTSDNode.

This allows us to eliminate a bunch of special case code for handling
MVTSDNodes.

Also, remove some uses of dyn_cast that should really be cast (which is
cheaper in a release build).

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

18 years agoChange *EXTLOAD to use an VTSDNode operand instead of being an MVTSDNode.
Chris Lattner [Sun, 10 Jul 2005 01:55:33 +0000 (01:55 +0000)]
Change *EXTLOAD to use an VTSDNode operand instead of being an MVTSDNode.
This is the last MVTSDNode.

This allows us to eliminate a bunch of special case code for handling
MVTSDNodes.

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

18 years agoChange TRUNCSTORE to use a VTSDNode operand instead of being an MVTSTDNode
Chris Lattner [Sun, 10 Jul 2005 00:29:18 +0000 (00:29 +0000)]
Change TRUNCSTORE to use a VTSDNode operand instead of being an MVTSTDNode

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

18 years agoMove TRUNCSTORE to using a VTSDNode operand instead of being a MVTSDNode.
Chris Lattner [Sun, 10 Jul 2005 00:28:25 +0000 (00:28 +0000)]
Move TRUNCSTORE to using a VTSDNode operand instead of being a MVTSDNode.
Also update some comments that Andrew forgot to update when he changed
loads/stores.

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

18 years agoIntroduce a new VTSDNode class with the ultimate goal of eliminating the
Chris Lattner [Sun, 10 Jul 2005 00:07:11 +0000 (00:07 +0000)]
Introduce a new VTSDNode class with the ultimate goal of eliminating the
MVTSDNode class.  This class is used to provide an operand to operators
that require an extra type.  We start by converting FP_ROUND_INREG and
SIGN_EXTEND_INREG over to using it.

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

18 years agoFix bugs also fixed in Unix version, plus other general cleanup.
Jeff Cohen [Sat, 9 Jul 2005 18:42:49 +0000 (18:42 +0000)]
Fix bugs also fixed in Unix version, plus other general cleanup.

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

18 years ago1. Fix bug in getBaseName where it mishandles suffixes
Jeff Cohen [Sat, 9 Jul 2005 18:42:02 +0000 (18:42 +0000)]
1. Fix bug in getBaseName where it mishandles suffixes
2. Fix bug in eraseSuffix where it allows /path/.suffix to become /path/

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

18 years agoEnsure that functions like isDirectory don't fail if the file doesn't
Reid Spencer [Fri, 8 Jul 2005 17:46:10 +0000 (17:46 +0000)]
Ensure that functions like isDirectory don't fail if the file doesn't
exist but just return false instead.

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

18 years agoMake sure we don't error out if an invalid path is used, just simply
Reid Spencer [Fri, 8 Jul 2005 16:48:52 +0000 (16:48 +0000)]
Make sure we don't error out if an invalid path is used, just simply
exit from isBytecodeLPath with "false".

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

18 years agoTwo changes:
Reid Spencer [Fri, 8 Jul 2005 06:53:26 +0000 (06:53 +0000)]
Two changes:
1. Use isValid() to check validity of the resulting path name in the
   eraseSuffix even though we can't think of a case where eraseSuffix could
   possibly cause an invalid path name.
2. Rewrite isValid() to not use the deprecated realpath function any more.
   It now just uses isascii to make sure all the characters are legit.

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

18 years agoAdd support for emitting a .data section and .bss section.
Chris Lattner [Fri, 8 Jul 2005 05:47:00 +0000 (05:47 +0000)]
Add support for emitting a .data section and .bss section.
Add support for emitting external and .bss symbols.

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

18 years agoStamp out tabs
Jeff Cohen [Fri, 8 Jul 2005 05:02:13 +0000 (05:02 +0000)]
Stamp out tabs

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

18 years agoMake Win32 implementation conform to new paradigm
Jeff Cohen [Fri, 8 Jul 2005 04:50:08 +0000 (04:50 +0000)]
Make Win32 implementation conform to new paradigm

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

18 years agoFix eraseSuffix()
Jeff Cohen [Fri, 8 Jul 2005 04:49:16 +0000 (04:49 +0000)]
Fix eraseSuffix()

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

18 years agoFinal Changes For PR495:
Reid Spencer [Fri, 8 Jul 2005 03:08:58 +0000 (03:08 +0000)]
Final Changes For PR495:

This chagne just renames some sys::Path methods to ensure they are not
misused. The Path documentation now divides methods into two dimensions:
Path/Disk and accessor/mutator. Path accessors and mutators only operate
on the Path object itself without making any disk accesses. Disk accessors
and mutators will also access or modify the file system. Because of the
potentially destructive nature of disk mutators, it was decided that all
such methods should end in the work "Disk" to ensure the user recognizes
that the change will occur on the file system. This patch makes that
change. The method name changes are:

makeReadable        -> makeReadableOnDisk
makeWriteable       -> makeWriteableOnDisk
makeExecutable      -> makeExecutableOnDisk
setStatusInfo       -> setStatusInfoOnDisk
createDirectory     -> createDirectoryOnDisk
createFile          -> createFileOnDisk
createTemporaryFile -> createTemporaryFileOnDisk
destroy             -> eraseFromDisk
rename              -> renamePathOnDisk

These changes pass the Linux Deja Gnu tests.

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

18 years agoFix VC++ breakage
Jeff Cohen [Fri, 8 Jul 2005 02:48:42 +0000 (02:48 +0000)]
Fix VC++ breakage

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

18 years agofix typo
Jeff Cohen [Fri, 8 Jul 2005 02:48:04 +0000 (02:48 +0000)]
fix typo

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

18 years agoAdd support for assembling .s files on mac os x for intel
Nate Begeman [Fri, 8 Jul 2005 00:23:26 +0000 (00:23 +0000)]
Add support for assembling .s files on mac os x for intel
Add support for running bugpoint on mac os x for intel

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

18 years agoChanges to mimic those in Unix/Path.inc in support of PR495. This hasn't
Reid Spencer [Thu, 7 Jul 2005 23:35:23 +0000 (23:35 +0000)]
Changes to mimic those in Unix/Path.inc in support of PR495. This hasn't
been compiled or tested.

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

18 years agoFor PR495:
Reid Spencer [Thu, 7 Jul 2005 23:21:43 +0000 (23:21 +0000)]
For PR495:
Get rid of the difference between file paths and directory paths. The Path
class now simply stores a path that can refer to either a file or a
directory. This required various changes in the implementation and interface
of the class with the corresponding impact to its users. Doxygen comments were
also updated to reflect these changes. Interface changes are:

appendDirectory -> appendComponent
appendFile -> appendComponent
elideDirectory -> eraseComponent
elideFile -> eraseComponent
elideSuffix -> eraseSuffix
renameFile -> rename
setDirectory -> set
setFile -> set

Changes pass Dejagnu and llvm-test/SingleSource tests.

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

18 years agoFix a problem that instcombine would hit when dealing with unreachable code.
Chris Lattner [Thu, 7 Jul 2005 20:40:38 +0000 (20:40 +0000)]
Fix a problem that instcombine would hit when dealing with unreachable code.
Because the instcombine has to scan the entire function when it starts up
to begin with, we might as well do it in DFO so we can nuke unreachable code.

This fixes: Transforms/InstCombine/2005-07-07-DeadPHILoop.ll

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

18 years agoNew testcase distilled from a large chunk of code Misha sent me.
Chris Lattner [Thu, 7 Jul 2005 20:39:45 +0000 (20:39 +0000)]
New testcase distilled from a large chunk of code Misha sent me.

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

18 years agoclean up prolouge and epilouge
Andrew Lenharth [Thu, 7 Jul 2005 19:52:58 +0000 (19:52 +0000)]
clean up prolouge and epilouge

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

18 years agoFor PR495:
Reid Spencer [Thu, 7 Jul 2005 18:21:42 +0000 (18:21 +0000)]
For PR495:
Change interface to Path class:
readable -> canRead
writable -> canWrite
executable -> canExecute

More (incremental) changes coming to close 495.

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

18 years agoRestore some code that was accidentally removed by Nate's patch yesterday.
Chris Lattner [Thu, 7 Jul 2005 17:12:53 +0000 (17:12 +0000)]
Restore some code that was accidentally removed by Nate's patch yesterday.
This fixes the regressions from last night.

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

18 years agoAdd support for emitting the symbol table (and its string table) of the
Chris Lattner [Thu, 7 Jul 2005 07:02:20 +0000 (07:02 +0000)]
Add support for emitting the symbol table (and its string table) of the
module to the ELF file.  Test it by adding support for emitting common
symbols.  This allows us to compile this:

%X = weak global int 0
%Y = weak global int 0
%Z = weak global int 0

to an elf file that 'readelf's this:

Symbol table '.symtab' contains 4 entries:
   Num:    Value  Size Type    Bind   Vis      Ndx Name
     0: 00000000     0 NOTYPE  LOCAL  DEFAULT  UND
     1: 00000004     4 OBJECT  GLOBAL DEFAULT  COM X
     2: 00000004     4 OBJECT  GLOBAL DEFAULT  COM Y
     3: 00000004     4 OBJECT  GLOBAL DEFAULT  COM Z

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

18 years agoAdd support for building/representing the symbol table, add some enum constants
Chris Lattner [Thu, 7 Jul 2005 07:00:37 +0000 (07:00 +0000)]
Add support for building/representing the symbol table, add some enum constants

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

18 years agoFix a typo in my checkin today that caused regressions. Oops!
Nate Begeman [Thu, 7 Jul 2005 06:32:01 +0000 (06:32 +0000)]
Fix a typo in my checkin today that caused regressions.  Oops!

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

18 years agoFirst round of support for doing scalar FP using the SSE2 ISA extension and
Nate Begeman [Wed, 6 Jul 2005 18:59:04 +0000 (18:59 +0000)]
First round of support for doing scalar FP using the SSE2 ISA extension and
XMM registers.  There are many known deficiencies and fixmes, which will be
addressed ASAP.  The major benefit of this work is that it will allow the
LLVM register allocator to allocate FP registers across basic blocks.

The x86 backend will still default to x87 style FP.  To enable this work,
you must pass -enable-sse-scalar-fp and either -sse2 or -sse3 to llc.

An example before and after would be for:
double foo(double *P) { double Sum = 0; int i; for (i = 0; i < 1000; ++i)
                        Sum += P[i]; return Sum; }

The inner loop looks like the following:
x87:
.LBB_foo_1:     # no_exit
        fldl (%esp)
        faddl (%eax,%ecx,8)
        fstpl (%esp)
        incl %ecx
        cmpl $1000, %ecx
        #FP_REG_KILL
        jne .LBB_foo_1  # no_exit

SSE2:
        addsd (%eax,%ecx,8), %xmm0
        incl %ecx
        cmpl $1000, %ecx
        #FP_REG_KILL
        jne .LBB_foo_1  # no_exit

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

18 years agoMake several cleanups to Andrews varargs change:
Chris Lattner [Tue, 5 Jul 2005 19:58:54 +0000 (19:58 +0000)]
Make several cleanups to Andrews varargs change:

1. Pass Value*'s into lowering methods so that the proper pointers can be
   added to load/stores from the valist
2. Intrinsics that return void should only return a token chain, not a token
   chain/retval pair.
3. Rename LowerVAArgNext -> LowerVAArg, because VANext is long gone.
4. Now that we have Value*'s available in the lowering methods, pass them
   into any load/stores from the valist that are emitted

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

18 years agoMake several cleanups to Andrews varargs change:
Chris Lattner [Tue, 5 Jul 2005 19:57:53 +0000 (19:57 +0000)]
Make several cleanups to Andrews varargs change:

1. Pass Value*'s into lowering methods so that the proper pointers can be
   added to load/stores from the valist
2. Intrinsics that return void should only return a token chain, not a token
   chain/retval pair.
3. Rename LowerVAArgNext -> LowerVAArg, because VANext is long gone.

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

18 years ago2 fixes:
Andrew Lenharth [Tue, 5 Jul 2005 19:52:39 +0000 (19:52 +0000)]
2 fixes:

1: Legalize operand in UINT_TO_FP expanision

2: SRA x, const i8 was not promoting the constant to shift amount type.

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

18 years agoFit to 80 columns
Chris Lattner [Tue, 5 Jul 2005 17:50:16 +0000 (17:50 +0000)]
Fit to 80 columns

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

18 years agoFix PowerPC varargs
Chris Lattner [Tue, 5 Jul 2005 17:48:31 +0000 (17:48 +0000)]
Fix PowerPC varargs

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

18 years agooops
Andrew Lenharth [Tue, 5 Jul 2005 16:36:18 +0000 (16:36 +0000)]
oops

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

18 years agoupdates
Andrew Lenharth [Tue, 5 Jul 2005 15:18:33 +0000 (15:18 +0000)]
updates

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

18 years agocheck the correct VT
Andrew Lenharth [Mon, 4 Jul 2005 20:07:21 +0000 (20:07 +0000)]
check the correct VT

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

18 years agofix loading address of fp symbols
Andrew Lenharth [Sun, 3 Jul 2005 20:06:13 +0000 (20:06 +0000)]
fix loading address of fp symbols

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

18 years agoPercolate the call up to the right superclass
Chris Lattner [Sun, 3 Jul 2005 17:34:39 +0000 (17:34 +0000)]
Percolate the call up to the right superclass

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

18 years agoI really didn't think this was necessary. But, Legalize wasn't running again
Andrew Lenharth [Sat, 2 Jul 2005 20:58:53 +0000 (20:58 +0000)]
I really didn't think this was necessary.  But, Legalize wasn't running again
and legalizing the extload.  Strange.  Should fix most alpha regressions.

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

18 years agoAdding new files to Visual Studio projects.
Jeff Cohen [Sat, 2 Jul 2005 02:04:26 +0000 (02:04 +0000)]
Adding new files to Visual Studio projects.

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