summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Re-sort all of the includes with ./utils/sort_includes.py so thatChandler Carruth2014-01-071-1/+1
| | | | | | | | | | subsequent changes are easier to review. About to fix some layering issues, and wanted to separate out the necessary churn. Also comment and sink the include of "Windows.h" in three .inc files to match the usage in Memory.inc. llvm-svn: 198685
* Make the llvm mangler depend only on DataLayout.Rafael Espindola2014-01-031-2/+2
| | | | | | | | | | | | | | Before this patch any program that wanted to know the final symbol name of a GlobalValue had to link with Target. This patch implements a compromise solution where the mangler uses DataLayout. This way, any tool that already links with Target (llc, clang) gets the exact behavior as before and new IR files can be mangled without linking with Target. With this patch the mangler is constructed with just a DataLayout and DataLayout is extended to include the information the Mangler needs. llvm-svn: 198438
* Revert r196639 while I investigate a bot failure.Lang Hames2013-12-071-51/+5
| | | | llvm-svn: 196641
* Add support for archives and object file caching under MCJIT.Lang Hames2013-12-071-5/+51
| | | | | | Patch by Andy Kaylor, with minor edits to resolve merge conflicts. llvm-svn: 196639
* Remove the isImplicitlyPrivate argument of getNameWithPrefix.Rafael Espindola2013-12-051-1/+1
| | | | | | | | | | | | getSymbolWithGlobalValueBase use is to create a name of a new symbol based on the name of an existing GV. Assert that and then remove the last call to pass true to isImplicitlyPrivate. This gives the mangler API a 1:1 mapping from GV to names, which is what we need to drop the mangler dependency on the target (and use an extended datalayout instead). llvm-svn: 196472
* Use the mangler consistently instead of using getGlobalPrefix directly.Rafael Espindola2013-11-281-11/+9
| | | | llvm-svn: 195911
* Fix a problem in MCJIT identifying the module containing a global variable.Andrew Kaylor2013-11-151-2/+2
| | | | | | Patch by Keno Fischer! llvm-svn: 194859
* Revert part of r193291, restoring the deletion of loaded objects.Chandler Carruth2013-10-241-0/+9
| | | | | | | | | | | Without this, customers of the MCJIT were leaking memory like crazy. It's not really clear what the *right* memory management is here, so I'm not trying to add lots of tests or other logic, just trying to get us back to a better baseline. I'll follow up on the original commit to figure out the right path forward. llvm-svn: 193323
* Optimizing MCJIT module state trackingAndrew Kaylor2013-10-241-100/+87
| | | | | | Patch co-developed with Yaron Keren. llvm-svn: 193291
* Improving MCJIT/RuntimeDyld thread safetyAndrew Kaylor2013-10-211-8/+21
| | | | llvm-svn: 193094
* Adding support for deregistering EH frames with MCJIT.Andrew Kaylor2013-10-161-0/+2
| | | | | | Patch by Yaron Keren llvm-svn: 192753
* Adding multiple object support to MCJIT EH frame handlingAndrew Kaylor2013-10-111-12/+5
| | | | llvm-svn: 192504
* Adding support and tests for multiple module handling in lliAndrew Kaylor2013-10-041-0/+1
| | | | llvm-svn: 191938
* Fixing MCJIT multiple module linking for OSXAndrew Kaylor2013-10-011-0/+4
| | | | llvm-svn: 191780
* Adding multiple module support for MCJIT.Andrew Kaylor2013-10-011-55/+210
| | | | | | | | Tests to follow. PIC with small code model and EH frame handling will not work with multiple modules. There are also some rough edges to be smoothed out for remote target support. llvm-svn: 191722
* Revising the MCJIT ObjectCache interface to allow subclasses to avoid ↵Andrew Kaylor2013-06-281-1/+1
| | | | | | retaining references to returned objects llvm-svn: 185221
* Minor changes to the MCJITTest unittests to use the correct API for finalizingDavid Tweed2013-05-171-1/+1
| | | | | | | the JIT object (including XFAIL an ARM test that now needs fixing). Also renames internal function for consistency. llvm-svn: 182085
* SectionMemoryManager shouldn't be a JITMemoryManager. Previously, the Filip Pizlo2013-05-141-5/+5
| | | | | | | | | | | | | | | | | EngineBuilder interface required a JITMemoryManager even if it was being used to construct an MCJIT. But the MCJIT actually wants a RTDyldMemoryManager. Consequently, the SectionMemoryManager, which is meant for MCJIT, derived from the JITMemoryManager and then stubbed out a bunch of JITMemoryManager methods that weren't relevant to the MCJIT. This patch fixes the situation: it teaches the EngineBuilder that RTDyldMemoryManager is a supertype of JITMemoryManager, and that it's appropriate to pass a RTDyldMemoryManager instead of a JITMemoryManager if we're using the MCJIT. This allows us to remove the stub methods from SectionMemoryManager, and make SectionMemoryManager a direct subtype of RTDyldMemoryManager. llvm-svn: 181820
* Add EH support to the MCJIT.Rafael Espindola2013-05-051-7/+6
| | | | | | | | | This gets exception handling working on ELF and Macho (x86-64 at least). Other than the EH frame registration, this patch also implements support for GOT relocations which are used to locate the personality function on MachO. llvm-svn: 181167
* This exposes more MCJIT options via the C API:Filip Pizlo2013-05-011-1/+2
| | | | | | | | | | | | | | | | | | | | | CodeModel: It's now possible to create an MCJIT instance with any CodeModel you like. Previously it was only possible to create an MCJIT that used CodeModel::JITDefault. EnableFastISel: It's now possible to turn on the fast instruction selector. The CodeModel option required some trickery. The problem is that previously, we were ensuring future binary compatibility in the MCJITCompilerOptions by mandating that the user bzero's the options struct and passes the sizeof() that he saw; the bindings then bzero the remaining bits. This works great but assumes that the bitwise zero equivalent of any field is a sensible default value. But this is not the case for LLVMCodeModel, or its internal equivalent, llvm::CodeModel::Model. In both of those, the default for a JIT is CodeModel::JITDefault (or LLVMCodeModelJITDefault), which is not bitwise zero. Hence this change introduces LLVMInitializeMCJITCompilerOptions(), which will initialize the user's options struct with defaults. The user will use this in the same way that they would have previously used memset() or bzero(). MCJITCAPITest.cpp illustrates the change, as does the comment in ExecutionEngine.h. llvm-svn: 180893
* Exposing MCJIT through C APIAndrew Kaylor2013-04-291-1/+2
| | | | | | | | Re-submitting with fix for OCaml dependency problems (removing dependency on SectionMemoryManager when it isn't used). Patch by Fili Pizlo llvm-svn: 180720
* Re-enabling MCJIT object caching with memory leak fixedAndrew Kaylor2013-04-251-16/+56
| | | | llvm-svn: 180575
* Revert "Adding object caching support to MCJIT"Rafael Espindola2013-04-251-53/+16
| | | | | | | | | | This reverts commit 07f03923137a91e3cca5d7fc075a22f8c9baf33a. Looks like it broke the valgrind bot: http://lab.llvm.org:8011/builders/llvm-x86_64-linux-vg_leak/builds/649 llvm-svn: 180249
* Adding object caching support to MCJITAndrew Kaylor2013-04-231-16/+53
| | | | llvm-svn: 180146
* Move all of the header files which are involved in modelling the LLVM IRChandler Carruth2013-01-021-3/+3
| | | | | | | | | | | | | | | | | | | | | into their new header subdirectory: include/llvm/IR. This matches the directory structure of lib, and begins to correct a long standing point of file layout clutter in LLVM. There are still more header files to move here, but I wanted to handle them in separate commits to make tracking what files make sense at each layer easier. The only really questionable files here are the target intrinsic tablegen files. But that's a battle I'd rather not fight today. I've updated both CMake and Makefile build systems (I think, and my tests think, but I may have missed something). I've also re-sorted the includes throughout the project. I'll be committing updates to Clang, DragonEgg, and Polly momentarily. llvm-svn: 171366
* Use the new script to sort the includes of every file under lib.Chandler Carruth2012-12-031-3/+3
| | | | | | | | | | | | | | | | | Sooooo many of these had incorrect or strange main module includes. I have manually inspected all of these, and fixed the main module include to be the nearest plausible thing I could find. If you own or care about any of these source files, I encourage you to take some time and check that these edits were sensible. I can't have broken anything (I strictly added headers, and reordered them, never removed), but they may not be the headers you'd really like to identify as containing the API being implemented. Many forward declarations and missing includes were added to a header files to allow them to parse cleanly when included first. The main module rule does in fact have its merits. =] llvm-svn: 169131
* Interface changes to allow RuntimeDyld memory managers to set memory ↵Andrew Kaylor2012-11-151-0/+9
| | | | | | permissions after an object has been loaded. llvm-svn: 168114
* Fix build error from previous commit.Andrew Kaylor2012-11-061-1/+1
| | | | llvm-svn: 167477
* Add interface for object-based JIT events.Andrew Kaylor2012-11-061-0/+35
| | | | | | This patch adds the interface to expose events from MCJIT when an object is emitted or freed and implements the MCJIT functionality to send those events. The IntelJITEventListener implementation is left empty for now. It will be fleshed out in a future patch. llvm-svn: 167475
* Add a method to indicate section address re-assignment is finished.Andrew Kaylor2012-11-051-0/+15
| | | | | | Prior to this patch RuntimeDyld attempted to re-apply relocations every time reassignSectionAddress was called (via MCJIT::mapSectionAddress). In addition to being inefficient and redundant, this led to a problem when a section was temporarily moved too far away from another section with a relative relocation referencing the section being moved. To fix this, I'm adding a new method (finalizeObject) which the client can call to indicate that it is finished rearranging section addresses so the relocations can safely be applied. llvm-svn: 167400
* Streamlined memory manager hierarchy for MCJIT and RuntimeDyld.Andrew Kaylor2012-11-011-2/+1
| | | | | | Patch by Ashok Thirumurthi llvm-svn: 167192
* Move TargetData to DataLayout.Micah Villmow2012-10-081-3/+3
| | | | llvm-svn: 165402
* Clean-up of memory buffer and object ownership model in MCJITAndrew Kaylor2012-10-021-13/+17
| | | | llvm-svn: 165053
* MCJIT: getPointerToFunction() references target address space.Jim Grosbach2012-09-051-2/+10
| | | | | | | Make sure to return a pointer into the target memory, not the local memory. Often they are the same, but we can't assume that. llvm-svn: 163217
* MCJIT: Tidy up the constructor.Jim Grosbach2012-08-211-10/+4
| | | | | | | | | The MCJIT doesn't need or want a TargetJITInfo. That's vestigal from the old JIT, so just remove it. rdar://12119347 llvm-svn: 162280
* Enable lazy compilation in MCJITAndrew Kaylor2012-08-071-7/+42
| | | | llvm-svn: 161438
* Round 2 of dead private variable removal.Benjamin Kramer2012-06-061-1/+1
| | | | | | | | LLVM is now -Wunused-private-field clean except for - lib/MC/MCDisassembler/Disassembler.h. Not sure why it keeps all those unaccessible fields. - gtest. llvm-svn: 158096
* Fix some formatting, grammar and style issues and add a couple of missing ↵Eli Bendersky2012-04-291-2/+2
| | | | | | comments. llvm-svn: 155793
* This patch improves the MCJIT runtime dynamic loader by adding new handlingPreston Gurd2012-04-121-3/+3
| | | | | | | | | | of zero-initialized sections, virtual sections and common symbols and preventing the loading of sections which are not required for execution such as debug information. Patch by Andy Kaylor! llvm-svn: 154610
* Move getPointerToNamedFunction() from JIT/MCJIT to JITMemoryManager.Danil Malyshev2012-03-281-0/+20
| | | | llvm-svn: 153607
* Revert a series of commits to MCJIT to get the build working in CMakeChandler Carruth2012-03-221-20/+0
| | | | | | | | | | | | | | | (and hopefully on Windows). The bots have been down most of the day because of this, and it's not clear to me what all will be required to fix it. The commits started with r153205, then r153207, r153208, and r153221. The first commit seems to be the real culprit, but I couldn't revert a smaller number of patches. When resubmitting, r153207 and r153208 should be folded into r153205, they were simple build fixes. llvm-svn: 153241
* Based on this discussion: ↵Danil Malyshev2012-03-211-0/+20
| | | | | | | | | http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20120305/138477.html 1. Declare a virtual function getPointerToNamedFunction() in JITMemoryManager 2. Move the implementation of getPointerToNamedFunction() form JIT/MCJIT to DefaultJITMemoryManager. llvm-svn: 153205
* Convert assert(0) to llvm_unreachableCraig Topper2012-02-071-2/+1
| | | | llvm-svn: 149967
* More dead code removal (using -Wunreachable-code)David Blaikie2012-01-201-2/+0
| | | | llvm-svn: 148578
* Fix MCJIT memory leak of owned TargetMachine.Jim Grosbach2012-01-171-0/+1
| | | | | | | The JIT is expected to take ownership of the TM that's passed in. The MCJIT wasn't freeing it, resulting in leaks. llvm-svn: 148356
* ExecutionEngine: refactor interfaceDylan Noblesmith2011-12-121-5/+2
| | | | | | | | The OptLevel is now redundant with the TargetMachine*. And selectTarget() isn't really JIT-specific and could probably get refactored into one of the lower level libraries. llvm-svn: 146355
* Sink codegen optimization level into MCCodeGenInfo along side relocation modelEvan Cheng2011-11-161-1/+1
| | | | | | | and code model. This eliminates the need to pass OptLevel flag all over the place and makes it possible for any codegen pass to use this information. llvm-svn: 144788
* MCJIT initialization TargetDataDanil Malyshev2011-09-301-0/+1
| | | | llvm-svn: 140856
* Fix the asserts in lib/Target/X86/X86ELFWriterInfo.cpp andRichard Trieu2011-09-101-1/+1
| | | | | | | | | | | | lib/ExecutionEngine/MCJIT/MCJIT.cpp from: assert("error"); to: assert(0 && "error"); llvm-svn: 139456
* land David Blaikie's patch to de-constify Type, with a few tweaks.Chris Lattner2011-07-181-2/+2
| | | | llvm-svn: 135375
OpenPOWER on IntegriCloud