Commit Graph

79 Commits

Author SHA1 Message Date
Evan Cheng
b8973bd8f5 Allow the specification of explicit alignments for constant pool entries.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25855 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-31 22:23:14 +00:00
Chris Lattner
ca26180d39 Add #include of <iostream>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25516 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-22 23:41:42 +00:00
Chris Lattner
2199877563 Wrap long lines.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25140 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-07 06:20:51 +00:00
Andrew Lenharth
2b3b89c28e one cannot allocate a global, until one is done initializing the global pointers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22568 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-01 17:35:40 +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
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
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
00b16889ab Eliminate all remaining tabs and trailing spaces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22523 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-27 06:12:32 +00:00
Chris Lattner
d6bbac500b fix a warning on 32-bit systems
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22513 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-25 23:42:58 +00:00
Andrew Lenharth
16ec33c6ef 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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22497 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-22 20:48:12 +00:00
Chris Lattner
e884dc2c58 count the number of relocations performed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22480 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-20 16:29:20 +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
Misha Brukman
3c94497ec7 Convert tabs to spaces
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21440 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-22 04:08:30 +00:00
Misha Brukman
f976c856fc Remove trailing whitespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21422 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-21 22:55:34 +00:00
Chris Lattner
d91ff7cd3b Add support for targets that require stubs for external functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21313 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-18 01:44:27 +00:00
Chris Lattner
5b3a4553c1 Fix the missing symbols problem Bill was hitting. Patch contributed by
Bill Wendling!!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20649 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-17 15:38:16 +00:00
Chris Lattner
6943570f3a Fix problems running the HowToUseJIT on powerpc, and probably problems with
ANY program that does not have all functions internalized.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20258 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-20 18:43:35 +00:00
Chris Lattner
281a601198 Rework constant pool handling so that function constant pools are no longer
leaked to the system.  Now they are destroyed with the JITMemoryManager is
destroyed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19434 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-10 18:23:22 +00:00
Chris Lattner
a8101c163d Silence VS warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19390 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-08 20:07:03 +00:00
Reid Spencer
4af3da6e6b Get rid of some leaks found by VC leak detector.
Patch contributed by Morten Ofsted.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18889 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-13 16:04:04 +00:00
Chris Lattner
e518b7170b Properly implement a fix for PR475
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18537 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-05 07:19:16 +00:00
Chris Lattner
f71755dc56 Remove unneeded cast.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18405 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-01 17:13:05 +00:00
Chris Lattner
532343b24e Fix the JIT when being used from llvm-db
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18391 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-30 17:41:49 +00:00
Chris Lattner
166f2269f5 Rename Emitter.cpp -> JITEmitter.cpp
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18132 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-22 22:00:25 +00:00
Chris Lattner
cf88d324a8 Fix the FIXME, nuke the JIT specific forceCompilationOf method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18131 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-22 21:54:35 +00:00
Chris Lattner
6f71720be3 These methods are obsolete
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18129 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-22 21:48:33 +00:00
Chris Lattner
b43dbdcb20 Support targets that require stubs for external functions better
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18098 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-22 07:24:43 +00:00
Chris Lattner
cb47941556 Clean up DEBUG output
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18081 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-21 03:44:32 +00:00
Chris Lattner
5e22558853 Allow targets to avoid emitting a stub for EVERY lazily resolved call. In
most cases (e.g. direct calls) no stub is needed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18080 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-21 03:37:42 +00:00
Chris Lattner
5426652c25 Implement relocation support by adding a target independent resolver interface.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18069 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-20 23:57:07 +00:00
Chris Lattner
5be478f360 Add getCurrentPCOffset() and addRelocation() methods.
Add stub support for relocations to finishFunction


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18035 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-20 03:46:14 +00:00
Chris Lattner
45730d71b6 Match change in MachineCodeEmitter prototype.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18009 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-19 20:56:46 +00:00
Chris Lattner
02376e3f29 Now that we have ghost linkage, we can force resolution of external symbols
immediately instead of lazily.

In this program, for example:

int main() {
  printf("hello world\n");
  printf("hello world\n");
  printf("hello world\n");
  printf("hello world\n");
}

We used to have to go through compilation callback 4 times (once for each
call to printf), now we don't go to it at all.

Thanks to Misha for noticing this, and for adding the initial ghost linkage
patches.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17864 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-15 23:20:04 +00:00
Brian Gaeke
88560c3a42 When emitting debug msgs for function stubs, don't truncate the
printed pointer value if sizeof(unsigned) != pointer size.  Instead,
use uintptr_t.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17338 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-29 18:22:45 +00:00
Reid Spencer
33189e787b Simplify the sys::Memory interface per Chris' request.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16318 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-13 22:38:11 +00:00
Reid Spencer
52b0ba6873 Convert the Emitter to use the lib/System "Memory" interface instead of the
old SystemUtils.h interface to allocate RWX blocks of memory.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16286 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-11 04:31:03 +00:00
Reid Spencer
551ccae044 Changes For Bug 352
Move include/Config and include/Support into include/llvm/Config,
include/llvm/ADT and include/llvm/Support. From here on out, all LLVM
public header files must be under include/llvm/.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16137 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-01 22:55:40 +00:00
Chris Lattner
0cb162b3bb Use the SystemUtils.h file to do our dirty work.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13868 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-28 00:57:27 +00:00
Chris Lattner
c52663c4ed This code is a real mess, but at least get the JIT *building* on platforms
(such as plan 9) without mmap.  Of course it won't RUN... but that's another
step.  :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13839 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-27 18:03:56 +00:00
Brian Gaeke
aea1b58f1e Implement emitWordAt() for the JIT emitter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13118 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-23 17:11:14 +00:00
Chris Lattner
6c0398ed47 There is no reason to #define fd
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11190 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-08 19:33:07 +00:00
Chris Lattner
c07ed13875 Implement PR135, lazy emission of global variables
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10549 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-20 03:36:47 +00:00
Chris Lattner
4d326fa9be Cleanup the JIT as per PR176. This renames the VM class to JIT, and merges the
VM.cpp and JIT.cpp files into JIT.cpp.  This also splits some nasty code out
into TargetSelect.cpp so that people hopefully won't notice it.  :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10544 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-20 01:46:27 +00:00
Chris Lattner
c19aadee66 Finegrainify namespacification
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10318 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-08 08:06:28 +00:00
Chris Lattner
2c0a6a19ef Emit constants to one contiguous block, but this time, respect alignment constraints.
If this doesn't work Misha, feel free to revert it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10267 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-30 04:23:21 +00:00
Misha Brukman
91de352796 Go back to allocating memory for each constant separately. Since SPARCs do not
allow unaligned loads, that is probably the problem I've been seeing in numerous
SPARC test cases failing. X86, on the other hand, just slows down unaligned
accesses, since it must make 2 aligned accesses for each unaligned one.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10266 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-30 00:50:53 +00:00
Misha Brukman
ef7e57018d Emit the MachineConstantPool constants in one contiguous memory `pool'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10060 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-17 20:40:07 +00:00
Brian Gaeke
d0fde30ce8 Put all LLVM code into the llvm namespace, as per bug 109.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9903 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-11 22:41:34 +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