summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ExecutionEngine/JIT
Commit message (Collapse)AuthorAgeFilesLines
...
* Change the JIT to compile eagerly by default as agreed inJeffrey Yasskin2009-10-272-10/+10
| | | | | | | 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
* Fix OProfileJITEventListener after r85182.Jeffrey Yasskin2009-10-271-1/+1
| | | | llvm-svn: 85192
* Automatically do the equivalent of freeMachineCodeForFunction(F) when F isJeffrey Yasskin2009-10-274-21/+40
| | | | | | | | | | | | | 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
* Move DataTypes.h to include/llvm/System, update all users. This breaks the lastChandler Carruth2009-10-261-1/+1
| | | | | | direct inclusion edge from System to Support. llvm-svn: 85086
* 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
* Fix http://llvm.org/PR4822: allow module deletion after a function has beenJeffrey Yasskin2009-10-231-9/+41
| | | | | | | | | | | | | | compiled. When functions are compiled, they accumulate references in the JITResolver's stub maps. This patch removes those references when the functions are destroyed. It's illegal to destroy a Function when any thread may still try to call its machine code. This patch also updates r83987 to use ValueMap instead of explicit CallbackVHs and fixes a couple "do stuff inside assert()" bugs from r84522. llvm-svn: 84975
* Random include cleanup.Benjamin Kramer2009-10-221-0/+1
| | | | llvm-svn: 84898
* Fix OProfileJITEventListener after r84054 renamed CompileUnit to Scope.Jeffrey Yasskin2009-10-221-6/+6
| | | | llvm-svn: 84895
* Verify that the function and exception table have been allocatedNicolas Geoffray2009-10-221-2/+2
| | | | | | before freeing them. llvm-svn: 84859
* De-bork CMake buildDouglas Gregor2009-10-211-1/+0
| | | | llvm-svn: 84744
* Delete the MacOSJITEventListener per echristo's request. It was disabled byJeffrey Yasskin2009-10-211-172/+0
| | | | | | default and didn't work anyway. llvm-svn: 84720
* Move the Function*->allocated blocks map from the JITMemoryManager to theJeffrey Yasskin2009-10-202-34/+30
| | | | | | | | | | | | | | | JITEmitter. I'm gradually making Functions auto-remove themselves from the JIT when they're destroyed. In this case, the Function needs to be removed from the JITEmitter, but the map recording which Functions need to be removed lived behind the JITMemoryManager interface, which made things difficult. This patch replaces the deallocateMemForFunction(Function*) method with a pair of methods deallocateFunctionBody(void *) and deallocateExceptionTable(void *) corresponding to the two startFoo/endFoo pairs. llvm-svn: 84651
* Clean up the JITResolver stub/callsite<->function maps.Jeffrey Yasskin2009-10-191-44/+100
| | | | | | | | | | | | | | | | | The JITResolver maps Functions to their canonical stubs and all callsites for lazily-compiled functions to their target Functions. To make Function destruction work, I'm going to need to remove all callsites on destruction, so this patch also adds the reverse mapping for that. There was an incorrect assumption in here that the only stub for a function would be the one caused by needing to lazily compile it, while x86-64 far calls and dlsym-stubs could also cause such stubs, but I didn't look for a test case that the assumption broke. This also adds DenseMapInfo<AssertingVH> so I can use DenseMaps instead of std::maps. llvm-svn: 84522
* s/DebugLoc.CompileUnit/DebugLoc.Scope/gDevang Patel2009-10-131-1/+1
| | | | | | s/DebugLoc.InlinedLoc/DebugLoc.InlinedAtLoc/g llvm-svn: 84054
* Keep track of stubs that are created. This fixes PR5162 and probably PR4822 andJeffrey Yasskin2009-10-132-11/+9
| | | | | | 4406. Patch by Nick Lewycky! llvm-svn: 84032
* Update processDebugLoc() to handle requests to process debug info, before ↵Devang Patel2009-10-061-9/+11
| | | | | | and after emitting instructions. llvm-svn: 83364
* Fix http://llvm.org/PR5116 by rolling back r60822. This passes `make unittestsJeffrey Yasskin2009-10-061-1/+1
| | | | | | check-lit` on both x86-64 Linux and x86-32 Darwin. llvm-svn: 83353
* Fix compile error as debug interface changed.Nick Lewycky2009-09-301-6/+4
| | | | | | | By the way, this code is buggy. You can't keep a map<MDNode *, something> because the MDNode may be destroyed and reused for something else. llvm-svn: 83141
* Fix a struct/class mismatch.Benjamin Kramer2009-09-231-1/+1
| | | | llvm-svn: 82622
* Use Compiler.h macro instead of __attribute__.Daniel Dunbar2009-09-221-1/+1
| | | | llvm-svn: 82532
* Update cmake.Xerxes Ranby2009-09-211-0/+1
| | | | llvm-svn: 82449
* Register the MachineModuleInfo for the ARM JIT, and update JITDwarfEmitter toDaniel Dunbar2009-09-211-1/+5
| | | | | | assert if the setModuleInfo hasn't been called. llvm-svn: 82441
* Implement the JIT side of the GDB JIT debugging interface. To enable thisReid Kleckner2009-09-207-17/+374
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* remove a dead variable.Chris Lattner2009-09-162-3/+0
| | | | llvm-svn: 81985
* Fix PR4865. This syncs up the JIT's DWARF emitter with what's in theBill Wendling2009-09-091-20/+21
| | | | | | | 'DwarfException.cpp' file, which changed how CIEs were emitted, the sizes of some fields, etc. llvm-svn: 81295
* Improve JIT error message for users crazy enough to use -march with JIT, andDaniel Dunbar2009-09-081-2/+4
| | | | | | mention -version in messages about missing targets. llvm-svn: 81272
* Fix PR4845: r77946 completely broke x86_64 Darwin (or any situation where theEvan Cheng2009-09-021-10/+32
| | | | | | | | desired triplet is a sub-target, e.g. thumbv7 vs. arm host). Reverting the patch isn't quite right either since the previous behavior does not allow the triplet to be overridden with -march. llvm-svn: 80742
* Fix OProfile support after r80406 changed the DebugInfo interface fromJeffrey Yasskin2009-08-291-3/+3
| | | | | | GlobalVariables to MDNodes. llvm-svn: 80411
* Initialize the PoisonMemory member before initializingDan Gohman2009-08-271-7/+7
| | | | | | | | | members that call methods that read the PoisonMemory member. This fixes potential spurious (though probably otherwise harmless) poising of unused memory, and fixes the associated valgrind error. llvm-svn: 80192
* Fix PR4772 ARM JIT.GlobalInFuction unittest by explicitly initialize MMI Xerxes Ranby2009-08-251-1/+1
| | | | | | | | | to 0 during JITEmitter constructor. Modified: lib/ExecutionEngine/JIT/JITEmitter.cpp llvm-svn: 79982
* remove some uses of llvm/Support/Streams.hChris Lattner2009-08-231-1/+0
| | | | llvm-svn: 79842
* remove a few DOUTs here and there.Chris Lattner2009-08-233-46/+46
| | | | llvm-svn: 79832
* Rename TargetAsmInfo (and its subclasses) to MCAsmInfo.Chris Lattner2009-08-221-41/+41
| | | | llvm-svn: 79763
* Fix a bug where the DWARF emitter in the JIT was not initializing alignmentReid Kleckner2009-08-212-28/+22
| | | | | | | | | | bytes. libgcc doesn't seem to mind, but if you pass this DWARF to GDB, it doesn't like it. Also make the JIT memory manager to initialize it's memory to garbage in debug mode, so that it's easier to find bugs like these in the future. llvm-svn: 79674
* Push LLVMContexts through the IntegerType APIs.Owen Anderson2009-08-131-10/+14
| | | | llvm-svn: 78948
* This void is implicit in C++.Dan Gohman2009-08-123-5/+5
| | | | llvm-svn: 78848
* SjLj based exception handling unwinding support. This patch is nasty, brutishJim Grosbach2009-08-111-4/+4
| | | | | | | | | | | | | and short. Well, it's kinda short. Definitely nasty and brutish. The front-end generates the register/unregister calls into the SjLj runtime, call-site indices and landing pad dispatch. The back end fills in the LSDA with the call-site information provided by the front end. Catch blocks are not yet implemented. Built on Darwin and verified no llvm-core "make check" regressions. llvm-svn: 78625
* Fix a bunch of namespace pollution.Dan Gohman2009-08-071-0/+2
| | | | llvm-svn: 78363
* No really, it's unused.Daniel Dunbar2009-08-041-2/+1
| | | | llvm-svn: 78047
* llvm_report_error already prints "LLVM ERROR:". So stop reporting errors ↵Benjamin Kramer2009-08-031-1/+1
| | | | | | like "LLVM ERROR: llvm: error:" or "LLVM ERROR: ERROR:". llvm-svn: 77971
* Remove now unused arguments from TargetRegistry::lookupTarget.Daniel Dunbar2009-08-031-4/+1
| | | | llvm-svn: 77950
* Pass target triple string in to TargetMachine constructor.Daniel Dunbar2009-08-031-28/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | This is not just a matter of passing in the target triple from the module; currently backends are making decisions based on the build and host architecture. The goal is to migrate to making these decisions based off of the triple (in conjunction with the feature string). Thus most clients pass in the target triple, or the host triple if that is empty. This has one important change in the way behavior of the JIT and llc. For the JIT, it was previously selecting the Target based on the host (naturally), but it was setting the target machine features based on the triple from the module. Now it is setting the target machine features based on the triple of the host. For LLC, -march was previously only used to select the target, the target machine features were initialized from the module's triple (which may have been empty). Now the target triple is taken from the module, or the host's triple is used if that is empty. Then the triple is adjusted to match -march. The take away is that -march for llc is now used in conjunction with the host triple to initialize the subtarget. If users want more deterministic behavior from llc, they should use -mtriple, or set the triple in the input module. llvm-svn: 77946
* Fix the build for people with oprofile installed.Nick Lewycky2009-08-021-3/+4
| | | | llvm-svn: 77914
* In TrimAllocationToSize, if a block is below the minimum allocation size,Nicolas Geoffray2009-07-291-1/+4
| | | | | | | there is no new block added to the free list. Therefore on the next startFunctionBody call, a new slab must be allocated. llvm-svn: 77520
* 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
* Remove Value::getName{Start,End}, the last of the old Name APIs.Daniel Dunbar2009-07-262-11/+11
| | | | llvm-svn: 77152
* Simplify JIT target selection.Daniel Dunbar2009-07-251-1/+1
| | | | | | | | | | - Instead of requiring targets to define a JIT quality match function, we just have them specify if they support a JIT. - Target selection for the JIT just gets the host triple and looks for the best target which matches the triple and has a JIT. llvm-svn: 77060
* More migration to raw_ostream, the water has dried up around the iostream hole.Daniel Dunbar2009-07-251-13/+13
| | | | | | | | | | - Some clients which used DOUT have moved to DEBUG. We are deprecating the "magic" DOUT behavior which avoided calling printing functions when the statement was disabled. In addition to being unnecessary magic, it had the downside of leaving code in -Asserts builds, and of hiding potentially unnecessary computations. llvm-svn: 77019
OpenPOWER on IntegriCloud