summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ExecutionEngine/JIT/JIT.cpp
Commit message (Collapse)AuthorAgeFilesLines
* land David Blaikie's patch to de-constify Type, with a few tweaks.Chris Lattner2011-07-181-4/+4
| | | | llvm-svn: 135375
* Convert CallInst and InvokeInst APIs to use ArrayRef.Jay Foad2011-07-151-2/+1
| | | | llvm-svn: 135265
* ExecutionEngine: move createJIT() definition (v2)Dylan Noblesmith2011-05-131-19/+0
| | | | | | | As an ExecutionEngine class function, its definition really belongs in ExecutionEngine.cpp, not JIT.cpp. llvm-svn: 131320
* ExecutionEngine: push TargetMachine creation into clients (v2)Dylan Noblesmith2011-05-131-16/+7
| | | | | | | | In particular, into EngineBuilder. This should only impact the private API between the EE and EB classes, not external clients, since JITCtor and MCJITCtor are both protected members. llvm-svn: 131317
* ExecutionEngine: fix JIT/MCJIT selectTarget() duplication (v2)Dylan Noblesmith2011-05-131-2/+9
| | | | | | | This prepares for making JITCtor/MCJITCtor take a TargetMachine* directly from clients like EngineBuilder. llvm-svn: 131316
* Revert ExecutionEngine patches, they either failed to build or broke unit tests.Jakob Stoklund Olesen2011-05-071-4/+25
| | | | | | Please ensure the build is clean and tests are passing when recommitting. llvm-svn: 131044
* ExecutionEngine: move createJIT() definitionDylan Noblesmith2011-05-061-19/+0
| | | | | | | As an ExecutionEngine class function, its definition really belongs in ExecutionEngine.cpp, not JIT.cpp. llvm-svn: 131027
* ExecutionEngine: push TargetMachine creation into clientsDylan Noblesmith2011-05-061-16/+7
| | | | | | | | In particular, into EngineBuilder. This should only impact the private API between the EE and EB classes, not external clients, since JITCtor and MCJITCtor are both protected members. llvm-svn: 131026
* ExecutionEngine: fix JIT/MCJIT selectTarget() duplicationDylan Noblesmith2011-05-061-2/+9
| | | | | | | This prepares for making JITCtor/MCJITCtor take a TargetMachine* directly from clients like EngineBuilder. llvm-svn: 131025
* Fix a ton of comment typos found by codespell. Patch byChris Lattner2011-04-151-1/+1
| | | | | | Luis Felipe Strano Moraes! llvm-svn: 129558
* Trailing whitespae.Jim Grosbach2011-03-151-34/+34
| | | | llvm-svn: 127691
* Merge System into Support.Michael J. Spencer2010-11-291-1/+1
| | | | llvm-svn: 120298
* Fix some more 80-col violas.Daniel Dunbar2010-11-131-4/+11
| | | | llvm-svn: 118959
* Fix the cleanup process of exception information in JIT. Now JITDuncan Sands2010-10-211-0/+6
| | | | | | | deregisters registered by it FDE structures allowing consecutive JIT runs to succeed. Patch by Yuri. Fixes PR8285. llvm-svn: 117004
* When creating a JIT, try to load the program so that we can resolve symbolsNick Lewycky2010-08-171-0/+3
| | | | | | against it. This affects Windows. llvm-svn: 111240
* Stop the JIT from refusing to work just because the program it was compiled intoNick Lewycky2010-08-091-5/+0
| | | | | | was built with -static. llvm-svn: 110564
* Don't call __register_frame from the JIT on systems that use setjmp/longjmpBob Wilson2010-07-261-2/+2
| | | | | | | exception handling. Also fix an extra underscore typo in one instance of "__ARM_EABI__". Radar 8236264. llvm-svn: 109451
* first part of JIT support for address of labels, part of PR7264,Chris Lattner2010-07-111-8/+46
| | | | | | patch by Yuri! llvm-svn: 108107
* rename llvm::llvm_report_error -> llvm::report_fatal_errorChris Lattner2010-04-071-6/+6
| | | | llvm-svn: 100709
* There are two ways of checking for a given type, for example isa<PointerType>(T)Duncan Sands2010-02-161-3/+3
| | | | | | | and T->isPointerTy(). Convert most instances of the first form to the second form. Requested by Chris. llvm-svn: 96344
* Uniformize the names of type predicates: rather than having isFloatTy andDuncan Sands2010-02-151-4/+4
| | | | | | isInteger, we now have isFloatTy and isIntegerTy. Requested by Chris! llvm-svn: 96223
* Make JIT::runFunction clean up the generated stub function.Jeffrey Yasskin2010-02-121-2/+6
| | | | | | Patch by Shivram K! llvm-svn: 96037
* Make it possible to create multiple JIT instances at the same time, by removingJeffrey Yasskin2010-02-111-2/+51
| | | | | | | | | | the global TheJIT and TheJITResolver variables. Lazy compilation is supported by a global map from a stub address to the JITResolver that knows how to compile it. Patch by Olivier Meurant! llvm-svn: 95837
* Fix "the the" and similar typos.Dan Gohman2010-02-101-1/+1
| | | | llvm-svn: 95781
* Move --march, --mcpu, and --mattr from JIT/TargetSelect.cpp to lli.cpp.Jeffrey Yasskin2010-02-051-4/+13
| | | | | | | | | llc.cpp also defined these flags, meaning that when I linked all of LLVM's libraries into a single shared library, llc crashed on startup with duplicate flag definitions. This patch passes them through the EngineBuilder into JIT::selectTarget(). llvm-svn: 95390
* Kill ModuleProvider and ghost linkage by inverting the relationship betweenJeffrey Yasskin2010-01-271-79/+20
| | | | | | | | | | | | | | | | | | | | | Modules and ModuleProviders. Because the "ModuleProvider" simply materializes GlobalValues now, and doesn't provide modules, it's renamed to "GVMaterializer". Code that used to need a ModuleProvider to materialize Functions can now materialize the Functions directly. Functions no longer use a magic linkage to record that they're materializable; they simply ask the GVMaterializer. Because the C ABI must never change, we can't remove LLVMModuleProviderRef or the functions that refer to it. Instead, because Module now exposes the same functionality ModuleProvider used to, we store a Module* in any LLVMModuleProviderRef and translate in the wrapper methods. The bindings to other languages still use the ModuleProvider concept. It would probably be worth some time to update them to follow the C++ more closely, but I don't intend to do it. Fixes http://llvm.org/PR5737 and http://llvm.org/PR5735. llvm-svn: 94686
* Move remaining stuff to the isInteger predicate.Benjamin Kramer2010-01-051-1/+1
| | | | llvm-svn: 92771
* Convert a ton of simple integer type equality tests to the new predicate.Benjamin Kramer2010-01-051-3/+3
| | | | llvm-svn: 92760
* Avoid going through the LLVMContext for type equality where it's safe to ↵Benjamin Kramer2010-01-051-3/+2
| | | | | | dereference the type pointer. llvm-svn: 92726
* Fix a crash in JIT::recompileAndRelinkFunction(). It doesn't pass the MCIJeffrey Yasskin2009-12-221-2/+4
| | | | | | | | | argument to runJITOnFunction(), which caused a null pointer dereference at every call. Patch by Gianluca Guida! llvm-svn: 91939
* Don't codegen available_externally functions. Fixes http://llvm.org/PR5735.Jeffrey Yasskin2009-12-171-27/+39
| | | | llvm-svn: 91626
* Formatting.Eric Christopher2009-12-151-1/+1
| | | | llvm-svn: 91377
* Reinstate r91208 to fix available_externally linkage for globals, withJeffrey Yasskin2009-12-131-1/+1
| | | | | | | nlewycky's fix to add -rdynamic so the JIT can look symbols up in Linux builds of the JITTests binary. llvm-svn: 91250
* Revert r91208. Something on Linux prevents the JIT from looking up a symbolJeffrey Yasskin2009-12-121-1/+1
| | | | | | defined in the test, and I don't have time tonight to figure it out. llvm-svn: 91209
* Fix available_externally linkage for globals. It's probably still notJeffrey Yasskin2009-12-121-1/+1
| | | | | | supported by emitGlobals, but I don't have a test case for that. llvm-svn: 91208
* Add ability to set code model within the execution engine buildersEric Christopher2009-11-171-3/+6
| | | | | | and creation interfaces. llvm-svn: 89151
* Remove dlsym stubs, with Nate Begeman's permission.Jeffrey Yasskin2009-11-091-8/+2
| | | | llvm-svn: 86606
* Change the JIT to compile eagerly by default as agreed inJeffrey Yasskin2009-10-271-2/+2
| | | | | | | http://llvm.org/PR5184, and beef up the comments to describe what both options do and the risks of lazy compilation in the presence of threads. llvm-svn: 85295
* Automatically do the equivalent of freeMachineCodeForFunction(F) when F isJeffrey Yasskin2009-10-271-2/+2
| | | | | | | | | | | | | being destroyed. This allows users to run global optimizations like globaldce even after some functions have been jitted. This patch also removes the Function* parameter to JITEventListener::NotifyFreeingMachineCode() since it can cause that to be called when the Function is partially destroyed. This change will be even more helpful later when I think we'll want to allow machine code to actually outlive its Function. llvm-svn: 85182
* fix PR5186: the JIT shouldn't try to codegen available_externallyChris Lattner2009-10-251-1/+1
| | | | | | functions it should just look them up like declarations. llvm-svn: 85077
* Implement the JIT side of the GDB JIT debugging interface. To enable thisReid Kleckner2009-09-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | feature, either build the JIT in debug mode to enable it by default or pass -jit-emit-debug to lli. Right now, the only debug information that this communicates to GDB is call frame information, since it's already being generated to support exceptions in the JIT. Eventually, when DWARF generation isn't tied so tightly to AsmPrinter, it will be easy to push that information to GDB through this interface. Here's a step-by-step breakdown of how the feature works: - The JIT generates the machine code and DWARF call frame info (.eh_frame/.debug_frame) for a function into memory. - The JIT copies that info into an in-memory ELF file with a symbol for the function. - The JIT creates a code entry pointing to the ELF buffer and adds it to a linked list hanging off of a global descriptor at a special symbol that GDB knows about. - The JIT calls a function marked noinline that GDB knows about and has put an internal breakpoint in. - GDB catches the breakpoint and reads the global descriptor to look for new code. - When sees there is new code, it reads the ELF from the inferior's memory and adds it to itself as an object file. - The JIT continues, and the next time we stop the program, we are able to produce a proper backtrace. Consider running the following program through the JIT: #include <stdio.h> void baz(short z) { long w = z + 1; printf("%d, %x\n", w, *((int*)NULL)); // SEGFAULT here } void bar(short y) { int z = y + 1; baz(z); } void foo(char x) { short y = x + 1; bar(y); } int main(int argc, char** argv) { char x = 1; foo(x); } Here is a backtrace before this patch: Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x2aaaabdfbd10 (LWP 25476)] 0x00002aaaabe7d1a8 in ?? () (gdb) bt #0 0x00002aaaabe7d1a8 in ?? () #1 0x0000000000000003 in ?? () #2 0x0000000000000004 in ?? () #3 0x00032aaaabe7cfd0 in ?? () #4 0x00002aaaabe7d12c in ?? () #5 0x00022aaa00000003 in ?? () #6 0x00002aaaabe7d0aa in ?? () #7 0x01000002abe7cff0 in ?? () #8 0x00002aaaabe7d02c in ?? () #9 0x0100000000000001 in ?? () #10 0x00000000014388e0 in ?? () #11 0x00007fff00000001 in ?? () #12 0x0000000000b870a2 in llvm::JIT::runFunction (this=0x1405b70, F=0x14024e0, ArgValues=@0x7fffffffe050) at /home/rnk/llvm-gdb/lib/ExecutionEngine/JIT/JIT.cpp:395 #13 0x0000000000baa4c5 in llvm::ExecutionEngine::runFunctionAsMain (this=0x1405b70, Fn=0x14024e0, argv=@0x13f06f8, envp=0x7fffffffe3b0) at /home/rnk/llvm-gdb/lib/ExecutionEngine/ExecutionEngine.cpp:377 #14 0x00000000007ebd52 in main (argc=2, argv=0x7fffffffe398, envp=0x7fffffffe3b0) at /home/rnk/llvm-gdb/tools/lli/lli.cpp:208 And a backtrace after this patch: Program received signal SIGSEGV, Segmentation fault. 0x00002aaaabe7d1a8 in baz () (gdb) bt #0 0x00002aaaabe7d1a8 in baz () #1 0x00002aaaabe7d12c in bar () #2 0x00002aaaabe7d0aa in foo () #3 0x00002aaaabe7d02c in main () #4 0x0000000000b870a2 in llvm::JIT::runFunction (this=0x1405b70, F=0x14024e0, ArgValues=...) at /home/rnk/llvm-gdb/lib/ExecutionEngine/JIT/JIT.cpp:395 #5 0x0000000000baa4c5 in llvm::ExecutionEngine::runFunctionAsMain (this=0x1405b70, Fn=0x14024e0, argv=..., envp=0x7fffffffe3c0) at /home/rnk/llvm-gdb/lib/ExecutionEngine/ExecutionEngine.cpp:377 #6 0x00000000007ebd52 in main (argc=2, argv=0x7fffffffe3a8, envp=0x7fffffffe3c0) at /home/rnk/llvm-gdb/tools/lli/lli.cpp:208 llvm-svn: 82418
* Push LLVMContexts through the IntegerType APIs.Owen Anderson2009-08-131-10/+14
| | | | llvm-svn: 78948
* Move types back to the 2.5 API.Owen Anderson2009-07-291-2/+1
| | | | llvm-svn: 77516
* Move ConstantExpr to 2.5 API.Owen Anderson2009-07-291-1/+1
| | | | llvm-svn: 77494
* Move ConstantFP construction back to the 2.5-ish API.Owen Anderson2009-07-271-3/+3
| | | | llvm-svn: 77247
* Revert the ConstantInt constructors back to their 2.5 forms where possible, ↵Owen Anderson2009-07-241-3/+3
| | | | | | thanks to contexts-on-types. More to come. llvm-svn: 77011
* Get rid of the Pass+Context magic.Owen Anderson2009-07-221-9/+9
| | | | llvm-svn: 76702
* Simplify / normalize some uses of Value::getName.Daniel Dunbar2009-07-211-1/+1
| | | | llvm-svn: 76553
* Add EngineBuilder to ExecutionEngine in favor of the five optional argument ↵Reid Kleckner2009-07-181-6/+23
| | | | | | | | EE::create(). Also a test commit. llvm-svn: 76276
* Move EVER MORE stuff over to LLVMContext.Owen Anderson2009-07-141-8/+10
| | | | llvm-svn: 75703
OpenPOWER on IntegriCloud