1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-24 05:23:45 +02:00
Commit Graph

231 Commits

Author SHA1 Message Date
Chris Lattner
66f5f27dcb Add #include for older GCC's
llvm-svn: 6670
2003-06-08 06:43:57 +00:00
Misha Brukman
1a3c1a6208 ::: 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 :::

llvm-svn: 6650
2003-06-06 06:59:55 +00:00
Misha Brukman
6762302093 Output function address as hex.
llvm-svn: 6649
2003-06-06 06:52:35 +00:00
Misha Brukman
999c7802ab Removed debug print statement.
llvm-svn: 6641
2003-06-06 00:00:54 +00:00
Misha Brukman
b2cf47cfc1 * 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.

llvm-svn: 6610
2003-06-04 19:45:25 +00:00
Misha Brukman
6e22f0fa52 Sparc's dlsym() requires the special operand RTLD_SELF to find a symbol in the
currently-running process.

llvm-svn: 6592
2003-06-04 01:57:22 +00:00
Misha Brukman
1c70c3f7a3 * 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.

llvm-svn: 6527
2003-06-02 03:23:16 +00:00
Brian Gaeke
bbbe5d71d2 The flag modifications weren't picking up the old values of the
flags before. Save them in a temporary variable, then restore them from the
temporary after creating the new constant.

llvm-svn: 6520
2003-06-02 02:10:31 +00:00
Chris Lattner
1136441fcf Remove obsolete code
llvm-svn: 6518
2003-06-02 00:09:00 +00:00
Chris Lattner
a87f53efca Move target specific code to target files. The new MachineCodeEmitter
class is actually target independent!

llvm-svn: 6517
2003-06-01 23:24:36 +00:00
Brian Gaeke
495826a0e5 Fix induction variable name clash in for loops, in finishFunction().
Modify new MachineOperand so that its flags match the old MachineOperand's
 flags, for the flags that matter.

llvm-svn: 6513
2003-06-01 22:08:29 +00:00
Misha Brukman
afa8e60f9f Fixed rewriting of branches -- they now work forward and backward.
llvm-svn: 6463
2003-05-31 06:26:48 +00:00
Misha Brukman
a9a5c77dd4 Since malloc is no longer used, no need to free() memory.
Fixed BasicBlock patching by supplying correct type for the displacement.

llvm-svn: 6453
2003-05-30 20:39:37 +00:00
Brian Gaeke
ad23dd697f Fix call to mmap, so that it can be used on sparc.
llvm-svn: 6424
2003-05-30 03:37:13 +00:00
Misha Brukman
e1a9c59304 mmap() seems to be failing on Sparc, so just use malloc()/free() .
llvm-svn: 6387
2003-05-28 18:44:38 +00:00
Misha Brukman
afffd58fe6 Allow for specification of which JIT to run on the commandline.
`lli -march=x86' or `lli -march=sparc' will forcefully select the JIT even on a
different platform. Running lli without the -march option will select the JIT
for the platform that it's currently running on.

Pro: can test Sparc JIT (debug printing mode) on X86 -- faster to compile/link
LLVM source base to test changes.
Con: Linking lli on x86 now pulls in all the Sparc libs -> longer link time
(but X86 can bear it, right?)

In the future, perhaps this should be a ./configure option to enable/disable
target JITting...

llvm-svn: 6360
2003-05-27 21:40:39 +00:00
Chris Lattner
e7f979708b Add support for atexit handlers to the JIT, fixing 2003-05-14-AtExit.c
llvm-svn: 6193
2003-05-14 13:53:40 +00:00
Chris Lattner
6f80e1b3c7 Fix compilation problems with previous checking *blush*
llvm-svn: 6191
2003-05-14 13:27:36 +00:00
Chris Lattner
bda312754a Add a framework for intercepting system calls
llvm-svn: 6190
2003-05-14 13:26:47 +00:00
Chris Lattner
46f2fc75da Make sure that globals are emitted AFTER the passmanager is set up for the JIT,
because the globals may refer to functions that need to be compiled!

llvm-svn: 6105
2003-05-12 02:14:34 +00:00
Chris Lattner
62fa228a18 Add support for function stubs, which allow calling functions which need to
have an address available, but have not yet been code generated.

llvm-svn: 6059
2003-05-09 03:30:07 +00:00
Chris Lattner
3656ffff9b Minor speedup by avoiding callbacks to functions already generated
llvm-svn: 6052
2003-05-08 21:44:21 +00:00
Chris Lattner
d397ac4aaf Improve efficiency of JIT by having it use direct function calls instead of
signals to regain control from the executing code

llvm-svn: 6051
2003-05-08 21:34:11 +00:00
Chris Lattner
35b3a10cf3 assert early instead of late for unimplemented feature
llvm-svn: 6050
2003-05-08 21:08:43 +00:00
Chris Lattner
79997d01d7 Fix warnings on sparc
llvm-svn: 5427
2003-01-29 18:02:02 +00:00
Chris Lattner
424cf48a30 Add support for named functions
llvm-svn: 5258
2003-01-13 01:00:48 +00:00
Chris Lattner
94057813b1 Dead file
llvm-svn: 5257
2003-01-13 01:00:28 +00:00
Chris Lattner
e1dc5ea665 Add support for new types of values
llvm-svn: 5256
2003-01-13 01:00:12 +00:00
Chris Lattner
c1e536c191 Bad segvs actually cause a segv now
llvm-svn: 5255
2003-01-13 01:00:02 +00:00
Chris Lattner
f67bcaf831 Initial checkin
llvm-svn: 5127
2002-12-24 00:01:22 +00:00
Chris Lattner
5fe4097f52 Initial checkin of new LLI with JIT compiler
llvm-svn: 5126
2002-12-24 00:01:05 +00:00