Nicolas Geoffray
ce30b5caf0
Support for allocation of TLS variables in the JIT. Allocation of a global
...
variable is moved to the execution engine. The JIT calls the TargetJITInfo
to allocate thread local storage. Currently, only linux/x86 knows how to
allocate thread local global variables.
llvm-svn: 58142
2008-10-25 15:41:43 +00:00
Nuno Lopes
112ac04abd
fix a tricky bug in the JIT global variable emitter, that was triggered when JITing a variable independently of a function. This lead to sharing memory memory between functions and GVs thus changing the value of a GV could change the code in execution. more details on the ML.
...
llvm-svn: 57900
2008-10-21 11:42:16 +00:00
Jim Grosbach
a49386d8e7
On Darwin ARM, memory needs special handling to do JIT. This patch expands
...
this handling to work properly for modifying stub functions, relocations
back to entry points after JIT compilation, etc..
llvm-svn: 57013
2008-10-03 16:17:20 +00:00
Evan Cheng
7eea8fb7cd
Add runStaticConstructorsDestructors which runs ctors / dtors of a single module. Patch by David Chisnall.
...
llvm-svn: 56849
2008-09-30 15:51:21 +00:00
Evan Cheng
0ed8f5b185
Add DisableGVCompilation which forces the JIT to assert when it tries to allocate space for a GlobalVariable.
...
llvm-svn: 56557
2008-09-24 16:25:55 +00:00
Evan Cheng
054bbb0dd8
Add new parameter Fast to createJIT to enable the fast codegen path.
...
llvm-svn: 54523
2008-08-08 08:11:34 +00:00
Chris Lattner
b2c9317b8d
Add a new flag that disables symbol lookup with dlsym when set. This allows
...
a JIT client to completely control symbol lookup with the LazyFunctionCreator
interface.
llvm-svn: 52335
2008-06-16 17:44:14 +00:00
Nate Begeman
26bb02a23a
Fix a couple issues with the JIT and multiple modules:
...
1. The "JITState" object creates a PassManager with the ModuleProvider that the
jit is created with. If the ModuleProvider is removed and deleted, the
PassManager is invalid.
2. The Global maps in the JIT were not invalidated with a ModuleProvider was
removed. This could lead to a case where the Module would be freed, and a
new Module with Globals at the same addresses could return invalid results.
llvm-svn: 51384
2008-05-21 16:34:48 +00:00
Bill Wendling
1866fa680f
Remove warnings about unused parameters and shadowed variables.
...
llvm-svn: 51266
2008-05-19 20:15:12 +00:00
Nicolas Geoffray
c80229e1c7
Cosmetic changes, as suggested by Evan. No functionality changes.
...
llvm-svn: 49993
2008-04-20 17:44:19 +00:00
Nicolas Geoffray
f005e6fa3b
Enable jitting with a known memory size.
...
llvm-svn: 49924
2008-04-18 20:59:31 +00:00
Nicolas Geoffray
1f3211af01
Correlate stubs with functions in JIT: when emitting a stub, the JIT tells the memory manager which function
...
the stub will resolve.
llvm-svn: 49814
2008-04-16 20:46:05 +00:00
Chris Lattner
0891662a49
Make ExecutionEngine::updateGlobalMapping return the old mapping.
...
llvm-svn: 49206
2008-04-04 04:47:41 +00:00
Nicolas Geoffray
72fa78e195
Enable exception handling int JIT
...
llvm-svn: 47079
2008-02-13 18:39:37 +00:00
Chris Lattner
e0b1ee937a
Don't attribute in file headers anymore. See llvmdev for the
...
discussion of this change. Boy are my fingers tired. ;-)
llvm-svn: 45411
2007-12-29 19:59:42 +00:00
Dan Gohman
80af3e255d
Add explicit keywords, and fix a minor typo that they uncovered.
...
llvm-svn: 45034
2007-12-14 15:41:34 +00:00
Chris Lattner
a7caf360c9
add a new ExecutionEngine::createJIT which can be used if you only want
...
to create a JIT. This lets you specify JIT-specific configuration items
like the JITMemoryManager to use.
llvm-svn: 44647
2007-12-06 01:34:04 +00:00
Chris Lattner
e297cb5408
simplify creation of the interpreter, make ExecutionEngine ctor protected,
...
delete one ExecutionEngine ctor, minor cleanup.
llvm-svn: 44646
2007-12-06 01:08:09 +00:00
Chris Lattner
fefff1c2f7
improve header guard
...
llvm-svn: 44641
2007-12-05 23:45:41 +00:00
Chris Lattner
3043dc44cd
split the JIT memory management code out from the main JIT logic into its
...
own JITMemoryManager interface. There is no functionality change with
this patch.
llvm-svn: 44640
2007-12-05 23:39:57 +00:00
Chris Lattner
ecea068eb2
add a mechanism for the JIT to invoke a function to lazily create functions as they are referenced.
...
llvm-svn: 43210
2007-10-22 02:50:12 +00:00
Chris Lattner
712119a5ed
Add a convenience method for creating EE's.
...
llvm-svn: 43206
2007-10-21 22:57:11 +00:00
Devang Patel
b4a9a2e418
Add removeModuleProvider()
...
llvm-svn: 43002
2007-10-15 19:56:32 +00:00
Dale Johannesen
9ce8a9d633
Implement x86 long double in jit (not really
...
complete, but common cases work)
llvm-svn: 42043
2007-09-17 18:44:13 +00:00
Reid Spencer
564f193ad0
Make StoreValueToMemory a little more efficient by not copying a
...
GenericValue to a temporary.
llvm-svn: 34957
2007-03-06 05:02:28 +00:00
Reid Spencer
b5e0b0bc5e
Make GenericeValue into a struct with a union instead of just a union. This
...
allows an APInt value to be constructed. Remove all the native integer types
from the union. These are replaced with the single IntVal of type APInt.
llvm-svn: 34945
2007-03-06 03:01:54 +00:00
Reid Spencer
cdb5aa2805
Make the creation functions take an error string. This will help the
...
ExecutionEngine report errors on creation (like bytecode stuff) and also
help to get rid of exception handling.
llvm-svn: 34886
2007-03-03 18:18:11 +00:00
Reid Spencer
e96b55e61f
Require the destination GlobalValue for LoadValueFromMemory to be passed
...
in as a parameter instead of returned.
llvm-svn: 34882
2007-03-03 08:35:14 +00:00
Reid Spencer
36fb227e99
Add APIntVal as a possible GenericeValue.
...
llvm-svn: 34879
2007-03-03 07:36:44 +00:00
Reid Spencer
f3265181e2
Rename BoolTy as Int1Ty. Patch by Sheng Zhou.
...
llvm-svn: 33076
2007-01-11 18:21:29 +00:00
Reid Spencer
a7eaf62ace
For PR950:
...
Change integer type names for signless integer types
llvm-svn: 32777
2006-12-31 05:23:18 +00:00
Chris Lattner
89e9bb620a
allow clients to indicate that they never want lazy compilation.
...
llvm-svn: 31600
2006-11-09 19:30:47 +00:00
Chris Lattner
cccfd59edf
add a way to have multiple modules in a JIT :)
...
llvm-svn: 29723
2006-08-16 02:53:27 +00:00
Chris Lattner
1eabe5fb58
initial changes to support JIT'ing from multiple module providers, implicitly
...
linking the program on the fly.
llvm-svn: 29721
2006-08-16 01:24:12 +00:00
Chris Lattner
2a1973c8c2
Move methods out of line so that MutexGuard.h isn't required in the header.
...
llvm-svn: 28178
2006-05-08 22:00:26 +00:00
Owen Anderson
71bc529dfa
Refactor TargetMachine, pushing handling of TargetData into the target-specific subclasses. This has one caller-visible change: getTargetData() now returns a pointer instead of a reference.
...
This fixes PR 759.
llvm-svn: 28074
2006-05-03 01:29:57 +00:00
Jeff Cohen
3fb8f32540
Fix headers
...
llvm-svn: 27043
2006-03-24 06:07:16 +00:00
Jeff Cohen
1dcffcaf83
Minor corrections.
...
llvm-svn: 27041
2006-03-24 02:58:54 +00:00
Jeff Cohen
dab30f45d8
Get JIT/Interpreter working on Windows again.
...
llvm-svn: 27037
2006-03-24 02:53:49 +00:00
Chris Lattner
2aa3f9a6b5
remove the intrinsiclowering hook
...
llvm-svn: 26970
2006-03-23 05:22:51 +00:00
Chris Lattner
05c3c52edf
wrap lines to 80 columns.
...
Add static JITCtor/InterpCtor fields
llvm-svn: 26945
2006-03-22 06:06:37 +00:00
Chris Lattner
0b736a0d1e
Add a helper method for running static ctors/dtors in the module.
...
llvm-svn: 26619
2006-03-08 18:42:46 +00:00
Reid Spencer
78910545f0
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.
llvm-svn: 22404
2005-07-12 15:51:55 +00:00
Misha Brukman
4ad5efd1a9
Remove trailing whitespace
...
llvm-svn: 21409
2005-04-21 20:39:54 +00:00
Reid Spencer
f7cd830e8d
Add a convenience function for clearing the two global areas.
...
Patch contributed by Morten Ofsted.
llvm-svn: 18890
2004-12-13 16:22:32 +00:00
Chris Lattner
2dbdf38808
This is the proper code for this method, thanks to Reid for getting CVS working
...
again.
llvm-svn: 18103
2004-11-22 16:54:54 +00:00
Reid Spencer
7aa1c0b8fb
Implement a missing function called by JIT/Emitter.cpp but never defined.
...
NOTE: Its not clear that this implementation is correct.
CHRIS: Please review this!
llvm-svn: 18101
2004-11-22 12:38:36 +00:00
Misha Brukman
14f6ade91b
Add method to delete machine code generated for a Function
...
llvm-svn: 17600
2004-11-07 23:58:02 +00:00
Alkis Evlogimenos
0c50e0f211
Fixes to make LLVM compile with vc7.1.
...
Patch contributed by Paolo Invernizzi!
llvm-svn: 16152
2004-09-03 18:19:51 +00:00
Reid Spencer
c4abcbefb1
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/.
llvm-svn: 16137
2004-09-01 22:55:40 +00:00
Brian Gaeke
aba4159be8
Represent va_list in interpreter as a (ec-stack-depth . var-arg-index)
...
pair, and look up varargs in the execution stack every time, instead of
just pushing iterators (which can be invalidated during callFunction())
around. (union GenericValue now has a "pair of uints" member, to support
this mechanism.) Fixes Bug 234.
llvm-svn: 11845
2004-02-25 23:01:48 +00:00
Chris Lattner
d11cffdfc6
Add new ExecutionEngine::getGlobalValueAtAddress method, which can efficiently
...
turn a memory address back into the LLVM global object that starts at that
address. Note that this won't cause any additional datastructures to be built
for clients of the EE that don't need this information.
llvm-svn: 10673
2003-12-31 20:19:31 +00:00
Chris Lattner
869549f54b
We may now pass IntrinsicLowering implementations into these methods
...
llvm-svn: 10630
2003-12-28 09:48:17 +00:00
Chris Lattner
7e4c7347ad
New method
...
llvm-svn: 10615
2003-12-26 06:50:15 +00:00
Chris Lattner
4f8b788c30
Rename 'run' to 'runFunction' to emphasize that it is usable to run any
...
function in a module, not just main
llvm-svn: 10608
2003-12-26 06:12:25 +00:00
Chris Lattner
cfa59c4d89
Cleanups to implement PR135
...
llvm-svn: 10548
2003-12-20 03:35:50 +00:00
Chris Lattner
8fdf8b8d71
Simple refactorings to prepare for lazy global emission
...
llvm-svn: 10546
2003-12-20 02:45:16 +00:00
Chris Lattner
f0ded5c697
Doxygenify comments, remove extraneous #include
...
llvm-svn: 10428
2003-12-12 06:31:42 +00:00
Brian Gaeke
a7db493d85
Use uintptr_t for pointer values in the ExecutionEngine.
...
llvm-svn: 10425
2003-12-12 05:06:09 +00:00
Chris Lattner
c6d99b5894
add two new virtual functions:
...
The first returns a function pointer or a stub if it's not already generated
The second exposes what was previously JIT specific state to general clients
llvm-svn: 10319
2003-12-08 08:22:01 +00:00
Brian Gaeke
d25f86d683
Put all LLVM code into the llvm namespace, as per bug 109.
...
llvm-svn: 9903
2003-11-11 22:41:34 +00:00
Brian Gaeke
d857892674
ExecutionEngine::create no longer takes a TraceMode argument.
...
llvm-svn: 9488
2003-10-24 19:58:38 +00:00
John Criswell
16c6cda9d5
Added LLVM copyright header (for lack of a better term).
...
llvm-svn: 9304
2003-10-20 20:19:47 +00:00
Misha Brukman
99daf743bb
If we move the constructors to the .cpp file, we can drop the #include
...
llvm-svn: 9180
2003-10-16 21:16:21 +00:00
Misha Brukman
2ab03faac1
Enabling incremental bytecode loading in the JIT:
...
* ExecutionEngine can be constructed from a ModuleProvider
* Alphabetized order of forward-declared classes
llvm-svn: 9123
2003-10-14 21:35:52 +00:00
Brian Gaeke
8e1bb0bcb2
Make getOperandValue and executeCastOperation methods of Interpreter.
...
This lets us protect a few more ExecutionEngine methods.
llvm-svn: 8367
2003-09-05 18:55:03 +00:00
Brian Gaeke
e157a77485
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".
llvm-svn: 8366
2003-09-05 18:42:01 +00:00
Brian Gaeke
b42efb0e33
Zap some more unused static method decls
...
llvm-svn: 8364
2003-09-05 06:10:50 +00:00
Brian Gaeke
6d7d9f9cd9
Interpreter cleanups:
...
Get rid of support for DebugMode (make it always off).
Mung some comments.
Get rid of interpreter's PROFILE_STRUCTURE_FIELDS and PerformExitStuff
which have been disabled forever.
Get rid of -abort-on-exception (make it always on).
Get rid of user interaction stuff (debug mode innards).
Simplify Interpreter's callMainFunction().
llvm-svn: 8344
2003-09-04 22:21:24 +00:00
Brian Gaeke
cec978e0ed
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.
llvm-svn: 8343
2003-09-03 20:34:19 +00:00
Chris Lattner
24b58d4b81
Targets now configure themselves based on the source module, not on the
...
ad-hoc "Config" flags
llvm-svn: 8134
2003-08-24 19:50:53 +00:00
John Criswell
8bc390da1b
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.
llvm-svn: 8022
2003-08-21 21:12:30 +00:00
Brian Gaeke
2e59087317
Deconstify parameter to getPointerToFunction().
...
llvm-svn: 7822
2003-08-13 18:17:54 +00:00
Chris Lattner
d68c05b473
More cassert inclusion for GCC 3.3
...
llvm-svn: 7318
2003-07-25 18:06:53 +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
451890e365
Add new method to check to see if a global is available
...
llvm-svn: 6058
2003-05-09 03:29:03 +00:00
Chris Lattner
ba9142280a
Add a pointersize/endianness safe load routine to match the store routine
...
llvm-svn: 6042
2003-05-08 16:52:16 +00:00
Chris Lattner
5fe4097f52
Initial checkin of new LLI with JIT compiler
...
llvm-svn: 5126
2002-12-24 00:01:05 +00:00