Commit Graph

3219 Commits

Author SHA1 Message Date
Chris Lattner
27631a30eb add two helper methods
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22735 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-09 23:36:18 +00:00
Chris Lattner
4cf009f49c I can't believe I caught this before Misha! :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22733 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-09 23:08:53 +00:00
Chris Lattner
7cf7e3f33f Eliminate the SetCCSDNode in favor of a CondCodeSDNode class. This pulls the
CC out of the SetCC operation, making SETCC a standard ternary operation and
CC's a standard DAG leaf.  This will make it possible for other node to use
CC's as operands in the future...


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22728 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-09 20:20:18 +00:00
Chris Lattner
287921d188 add a new helper method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22697 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-08 05:21:33 +00:00
Chris Lattner
5ab8363206 Since getSubtarget() always provides a const Subtarget, dont' require the user
to pass it in.  Also, since it always returns a non-null pointer, make it
return a reference instead for easier use.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22686 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-05 21:53:21 +00:00
Chris Lattner
9acbd611ec Mark hasConstantValue as a const method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22666 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-05 00:49:06 +00:00
Nate Begeman
c523f4c096 Add an extra parameter that Chris requested
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22665 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-04 23:50:43 +00:00
Nate Begeman
a83ba0f5c9 Fix a fixme in CondPropagate.cpp by moving a PhiNode optimization into
BasicBlock's removePredecessor routine.  This requires shuffling around
the definition and implementation of hasContantValue from Utils.h,cpp into
Instructions.h,cpp


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22664 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-04 23:24:19 +00:00
Chris Lattner
2be12faabb Fix an obvious bug in the Log2 stuff that broke SingleSource/UnitTests/2005-05-12-Int64ToFP
last night.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22630 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-03 20:53:19 +00:00
Chris Lattner
89bfcd34cb Wrap comments to 80 cols, fix code sequence for CountLeadingZeros_64 on
non-ppc GCC 4.0 machines.  Patch by Jim Laskey!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22618 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-03 16:53:58 +00:00
Chris Lattner
865dc8f64f Fix another bug in the clz patch that caused miscompilations when !gcc4
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22616 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-03 01:04:40 +00:00
Chris Lattner
e6ec587059 Fix the non-gcc 4.0 paths for countleadingzeros
Patch fixed by Jim Laskey


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22598 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-02 20:21:33 +00:00
Chris Lattner
591083a5c7 Fix inverted conditionals
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22597 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-02 20:06:18 +00:00
Chris Lattner
3b65576527 Fix the non-gcc 4.0 path to compile
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22593 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-02 19:21:51 +00:00
Chris Lattner
88c606eb0c Consolidate all of the various log2 computing functions into MathExtras.h.
Also, provide accelerated implementations when building with GCC.
Patch contributed by Jim Laskey!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22591 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-02 19:15:30 +00:00
Jeff Cohen
ee841a1a87 Implement SetInterruptFunction for Windows.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22582 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-02 03:04:47 +00:00
Chris Lattner
e62321ac41 add a new function proto
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22577 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-02 02:13:42 +00:00
Chris Lattner
e84d2066ce Mark these as V9 specific
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22572 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-01 20:38:31 +00:00
Jeff Cohen
d29b6aa608 Keep tabs and trailing spaces out.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22565 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-30 18:33:25 +00:00
Nate Begeman
36f891bdf6 Break SCEVExpander out of IndVarSimplify into its own .h/.cpp file so that
other passes may use it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22557 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-30 00:12:19 +00:00
Andrew Lenharth
a00269bc3e support near allocations for the JIT
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22554 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-29 23:40:16 +00:00
Andrew Lenharth
fe660397e1 new is not a valid default anywhere, so make this pure virtual
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22542 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-28 18:13:59 +00:00
Andrew Lenharth
6a9746127a Like constants, globals on some platforms are GOT relative. This means they have to be allocated
near the GOT, which new doesn't do.  So break out the allocate into a new function.

Also move GOT index handling into JITResolver.  This lets it update the mapping when a Lazy
function is JITed.  It doesn't managed the table, just the mapping.  Note that this is
still non-ideal, as any function that takes a function address should also take a GOT
index, but that is a lot of changes.  The relocation resolve process updates any GOT entry
it sees is out of date.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22537 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-28 12:44:13 +00:00
Jeff Cohen
832481fd99 Please do not reintroduce tabs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22531 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-28 02:04:44 +00:00
Reid Spencer
bc9e49c77d Fix PR608:
Previously the script assumed the version number was the last field, now
it assumes it is the first sequence of digits.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22527 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-27 21:58:38 +00:00
Jeff Cohen
9eb59ec548 Eliminate tabs and trailing spaces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22520 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-27 05:53:44 +00:00
Andrew Lenharth
6a6b2dbd3a 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
2005-07-22 20:46:42 +00:00
Reid Spencer
a0f5bf306c 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
2005-07-19 04:52:44 +00:00
Chris Lattner
56c3261e34 Add two helper methods, adjust a prototype
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22456 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-16 17:40:34 +00:00
Chris Lattner
5f9cb59f05 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
2005-07-16 17:35:26 +00:00
Chris Lattner
5f48ff7d1f 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
2005-07-16 08:01:13 +00:00
Reid Spencer
be13028264 * 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
2005-07-14 05:19:12 +00:00
Reid Spencer
c232a65827 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
2005-07-14 02:25:12 +00:00
Reid Spencer
8a2246f32e 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
2005-07-13 03:20:14 +00:00
Jeff Cohen
b639f1461e Eliminate tabs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22421 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-13 02:19:59 +00:00
Jeff Cohen
6d2352249a Win32 support for Mutex class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22420 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-13 02:15:18 +00:00
Reid Spencer
ee448630bd 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
2005-07-12 15:51:55 +00:00
Reid Spencer
b2164e5cb5 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
2005-07-12 15:37:43 +00:00
Reid Spencer
22177fe580 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
2005-07-12 15:24:20 +00:00
Chris Lattner
39429617e0 Add support for emitting 64-bit integers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22399 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-12 06:57:26 +00:00
Chris Lattner
f5d507e905 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
2005-07-12 06:40:29 +00:00
Nate Begeman
8d2623d49a 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
2005-07-12 03:04:49 +00:00
Nate Begeman
0e219eb9b8 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
2005-07-12 02:41:19 +00:00
Nate Begeman
fb5792f416 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
2005-07-12 01:41:54 +00:00
Chris Lattner
f0cf1b7e5f 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
2005-07-11 06:16:24 +00:00
Chris Lattner
6871aed032 expose a new code emitter object
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22374 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-11 05:15:32 +00:00
Chris Lattner
1ed38fb9a7 add a helper method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22373 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-11 04:49:33 +00:00
Chris Lattner
75bbdff3d3 add a name mangler object
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22370 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-11 03:11:10 +00:00
Chris Lattner
5f056bf4b8 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
2005-07-10 01:55:33 +00:00
Chris Lattner
f7db8c69a1 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
2005-07-10 00:28:25 +00:00