Commit Graph

74 Commits

Author SHA1 Message Date
Brian Gaeke
0bb3c2b854 Remove #include of PassManager.h which was marked FIXME, and apparently is no
longer used.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9823 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-09 03:15:40 +00:00
Misha Brukman
cb93d8d3a9 Remove the *BIG UGLY HACK* from the JIT: PreSelection is now a FunctionPass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9790 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-07 20:32:08 +00:00
Brian Gaeke
11911abf5c In VM::create(), comment out almost the whole function if NO_JITS_ENABLED,
because the Arch variable will likely be undefined.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9576 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-29 04:24:09 +00:00
Brian Gaeke
242978cdee Destroy MachineFunction for any Function that we are about to
recompile and relink. This keeps it from failing an assertion when
it goes and tries to construct a new MachineFunction for that Function.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9459 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-24 03:55:37 +00:00
John Criswell
856ba76200 Added LLVM copyright header.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9321 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-21 15:17:13 +00:00
John Criswell
e488e9360b Added LLVM copyright notice to Makefiles.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9312 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-20 22:26:57 +00:00
John Criswell
b576c94c15 Added LLVM project notice to the top of every C++ source file.
Header files will be on the way.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9298 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-20 19:43:21 +00:00
Chris Lattner
e738656c0b Hrm, a relic from the past. How cute :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9283 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-20 05:45:49 +00:00
Brian Gaeke
55c0f02cbf Tidy up doxygen comment for getPointerToFunction().
Add prototypes for recompileAndRelinkFunction() and runJITOnFunction().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9200 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-17 18:27:12 +00:00
Brian Gaeke
cd64ddfafe Refactor running the JIT passes on a single function into the new method,
runJITOnFunction().

Add new method for recompiling and patching in new versions of functions,
recompileAndRelinkFunction().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9199 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-17 18:27:00 +00:00
Brian Gaeke
6020ddd57e Fix a typo in a comment, and zap a blank line.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9184 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-16 23:33:38 +00:00
Misha Brukman
0f4f7d9eb7 JIT.cpp:
* #include "llvm/ModuleProvider"
* alphabetize #includes
* omit extraneous parens in pointer expressions

VM.cpp:
* #include "llvm/ModuleProvider"
* alphabetize #includes


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9182 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-16 21:19:34 +00:00
Misha Brukman
005e5e9a48 Enabling incremental bytecode loading in the JIT:
* The VM is now constructed with a ModuleProvider


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9125 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-14 21:37:41 +00:00
Brian Gaeke
364f86d4df Make mmap's fd for anonymous memory acquisition default to -1, except on
Linux. This is consistent with what FreeBSD and Solaris both want.
This makes the JIT work on FreeBSD 5.1-RELEASE. Whee.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9045 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-11 03:51:18 +00:00
Brian Gaeke
e24b616faa Don't include Config/stdio.h or <stdio.h>.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9031 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-10 18:46:29 +00:00
Brian Gaeke
322cdb2e63 Change to use GetAddressOfSymbol instead of dlsym.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9012 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-10 17:02:42 +00:00
Chris Lattner
011efae2f0 Actually _PASS IN_ NO_RESERVE if we have it.
Thanks to Brian for fixing this obvious oops


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8899 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-06 19:07:41 +00:00
Misha Brukman
36d10ef7e7 * Move include files from middle of file to the top where they belong, moving
the #define up there too
* Since we're including system headers, use the ones in include/llvm/Config
* While we're here, use the canonical LLVM header ordering algorithm


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8463 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-10 20:52:05 +00:00
Misha Brukman
88b4855499 Fix warning when _POSIX_MAPPED_FILES is already defined in unistd.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8436 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-10 15:09:45 +00:00
Brian Gaeke
9722294d30 ExecutionEngine.h, GenericValue.h --> include/llvm/ExecutionEngine/
Build ExecutionEngine as library.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8370 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-05 19:39:22 +00:00
Brian Gaeke
70975eef57 Make CreateArgv part of lli rather than part of ExecutionEngine.
Switch Interpreter and JIT's "run" methods to take a Function and a vector of
 GenericValues.
Move (almost all of) the stuff that constructs a canonical call to main()
 into lli (new methods "callAsMain", "makeStringVector").
Nuke getCurrentExecutablePath(), enableTracing(), getCurrentFunction(),
 isStopped(), and many dead decls from interpreter.
Add linux strdup() support to interpreter.
Make interpreter's atexit handler runner and JIT's runAtExitHandlers() look
 more alike, in preparation for refactoring.
atexit() is spelled "atexit", not "at_exit".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8366 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-05 18:42:01 +00:00
Brian Gaeke
82d8277ad5 ExecutionEngine.cpp: Move execution engine creation stuff into a new
static method here.
 Remove some extra blank lines.
ExecutionEngine.h: Add its prototype.
lli.cpp: Call it.

Make creation method for each type of EE into a static method of its
own subclass.

Interpreter/Interpreter.cpp: ExecutionEngine::createInterpreter -->
 Interpreter::create
Interpreter/Interpreter.h: Likewise.
JIT/JIT.cpp: ExecutionEngine::createJIT --> VM::create
JIT/VM.h: Likewise.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8343 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-03 20:34:19 +00:00
Chris Lattner
39c07264da Targets now configure themselves based on the source module, not on the
ad-hoc "Config" flags


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8134 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-24 19:50:53 +00:00
Chris Lattner
05a1a306bc Minor cleanups: wrap at 80 lines. Convert file comment to doxygen format and
llvm style


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8024 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-21 21:32:12 +00:00
John Criswell
69582b35b6 The JIT now passes the environment pointer to the main() function when it
starts a program.  This allows the GNU env program to compile and JIT under
LLVM.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8022 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-21 21:12:30 +00:00
Chris Lattner
688506de24 Implement a _REAL_ memory manager for the code generated by the JIT. This
speeds up program execution by 15% pretty consistently for large programs


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7845 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-14 18:35:27 +00:00
Brian Gaeke
c227c1fc7f Deconstify parameter to getPointerToFunction().
Use a FunctionPassManager instead of a PassManager.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7820 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-13 18:16:50 +00:00
Brian Gaeke
71d8478117 Deconstify parameter to getPointerToFunction().
Run passes on single function (hey, just-in-time compilation!)
 instead of the entire module that contains it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7819 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-13 18:16:34 +00:00
Chris Lattner
3785fad56e Specify DEBUG_TYPE's for the JIT debug messages
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7604 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-05 17:00:32 +00:00
Chris Lattner
c648dabf65 DEBUG got moved to Debug.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7491 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-01 22:13:59 +00:00
Misha Brukman
89e8be00c5 * Stop hard-coding a value for beginning of emitted code on Sparc since we can
now handle far calls (i.e., beyond the 30-bit limit in call instructions).
* As a side-effect, this allows us to unify and clean up the mmap() call and
  code around it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7381 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-29 16:57:16 +00:00
Misha Brukman
fd31a78124 Add rationale for the MAP_ANONYMOUS vs. MAP_ANON flags.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7368 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-28 19:26:19 +00:00
Misha Brukman
d69c1e6dc2 Add ability for external C code to get pointers to functions given their name.
This us used by bugpoint -- when code is compiled to a shared object to be
JITted, it must use the JIT's lazy resolution method to find function addresses,
because some functions will not be available at .so load time, as they are in
the bytecode file.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7363 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-28 19:09:06 +00:00
Misha Brukman
d94a50f99d Clean up code dealing with RTLD_SELF differences on Sparc and X86.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7362 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-28 19:07:30 +00:00
Misha Brukman
df38dae949 Fix reference to architecture.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7361 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-28 19:06:50 +00:00
Chris Lattner
a84983ea72 Fix space
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7273 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-23 20:21:06 +00:00
Misha Brukman
82742916f3 * If compiling on X86 or Sparc, automagically enable the JIT for that arch
* Setting ENABLE_X86_JIT or ENABLE_SPARC_JIT on the `make' command-line will
  force the inclusion of that JIT on a different architecture
* If neither JIT is enabled (e.g., compiling on a different architecture), the
  -march option will not be available to LLI.
* As a side effect of the $ARCH variable, the Sparc LLI can now link just a bit
  faster by not including the x86 library.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7070 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-02 17:53:19 +00:00
John Criswell
7a73b80b90 Merged in autoconf branch. This provides configuration via the autoconf
system.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7014 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-30 21:59:07 +00:00
Brian Gaeke
02c26b681e Get rid of the duplicate '0x' in debug mode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7012 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-30 18:06:20 +00:00
Brian Gaeke
4399a4982a Add #ifdef hack for MAP_ANONYMOUS being spelled MAP_ANON on some platforms.
(We're already talking about autoconf'ing this, so I'm assuming this hack
will be short-lived...I just don't want it to get lost in my working files.)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6761 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-17 23:14:06 +00:00
Chris Lattner
de3209bfdb Apparently "sparc" is a macro on sparcs. Ugh. :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6744 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-17 15:54:02 +00:00
Chris Lattner
97ac14f33c Use more structured command line option processing
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6742 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-17 15:43:13 +00:00
Chris Lattner
7aefa966cd #ifdef out code that only applies when the HOSTARCH = sparc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6741 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-17 15:32:38 +00:00
Chris Lattner
08d5e1f718 Add #include for older GCC's
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6670 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-08 06:43:57 +00:00
Misha Brukman
4e8c999518 ::: HACK ALERT ::: HACK ALERT ::: HACK ALERT ::: HACK ALERT ::: HACK ALERT :::
The JIT is designed to code-generate a function at-a-time. That means that any
pass can only make local changes to its function. Period.

Because the Sparc PreSelection pass claims to be a BasicBlock pass while adding
globals to the Module, it cannot be run with the other passes, because by this
time, the globals have been output already by the JIT, and the addresses of any
globals appearing AFTER this point are not recognized.

However, the PreSelection pass is a requirement for correctness in the Sparc
codegen path, so it MUST be run.

::: HACK ALERT ::: HACK ALERT ::: HACK ALERT ::: HACK ALERT ::: HACK ALERT :::


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6650 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-06 06:59:55 +00:00
Misha Brukman
1d4408506b Output function address as hex.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6649 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-06 06:52:35 +00:00
Misha Brukman
cf614a32d5 Removed debug print statement.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6641 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-06 00:00:54 +00:00
Misha Brukman
3a55e8aae4 * Institute a hack for the Sparc call to mmap() to get our generated code to be
laid out closer to the VM so that calls to library functions (e.g. puts()) and
  callback (e.g.  JITResolver::CompilationCallback) fit into 30 bits of the call
  instruction.
* Abort if architecture is not yet supported (not X86 or Sparc) because it
  likely requires a different set of parameters to mmap() .
* Stop using hard-coded values for page size; use sysconf(_SC_PAGESIZE) instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6610 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-04 19:45:25 +00:00
Misha Brukman
88fe358f8a Sparc's dlsym() requires the special operand RTLD_SELF to find a symbol in the
currently-running process.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6592 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-04 01:57:22 +00:00
Misha Brukman
906f5fa5c8 * Removed SparcEmitter.cpp; rolled into lib/Target/Sparc/SparcV9CodeEmitter.cpp
* No more createX86Emitter() vs. createSparcEmitter() -- there can be only one
* As a result, the memory management semantics must be handled according to
  platform -- the parameters to mmap() are particularly sensitive to the host
  architecture.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6527 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-02 03:23:16 +00:00