summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ExecutionEngine/JIT/JIT.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* First patch in the direction of splitting MachineCodeEmitter in two subclasses:Bruno Cardoso Lopes2009-05-301-9/+9
| | | | | | JITCodeEmitter and ObjectCodeEmitter. No functional changes yet. Patch by Aaron Gray llvm-svn: 72631
* Allow the JIT ExecutionEngine to report details about the generated machine ↵Argyrios Kyrtzidis2009-05-181-1/+7
| | | | | | | | | | code. Introduce a new class (MachineCodeInfo) that the JIT can fill in with details. Right now, just the address and the size of the machine code are reported. Patch by Evan Phoenix! llvm-svn: 72040
* Rename PaddedSize to AllocSize, in the hope that thisDuncan Sands2009-05-091-2/+2
| | | | | | | will make it more obvious what it represents, and stop it being confused with the StoreSize. llvm-svn: 71349
* Instead of passing in an unsigned value for the optimization level, use an enum,Bill Wendling2009-04-291-5/+5
| | | | | | | which better identifies what the optimization is doing. And is more flexible for future uses. llvm-svn: 70440
* The second part of the change from -fast to -O#. This changes the JIT to acceptBill Wendling2009-04-291-7/+7
| | | | | | | an optimization level instead of a simple boolean telling it to generate code "fast" or the other type of "fast". llvm-svn: 70347
* make sure to unlock keymgr if the JIT is created and destroyed, allChris Lattner2009-04-161-5/+3
| | | | | | | | locks must be matched with unlocks. Also, use calloc to allocate the block so that it is properly zero'd. Thanks to Nick Kledzik for tracking this down. llvm-svn: 69314
* Mac OS X 10.6 and above do not use key manager to register EH frames.Evan Cheng2009-04-141-2/+8
| | | | llvm-svn: 69090
* Introduce new linkage types linkonce_odr, weak_odr, common_odrDuncan Sands2009-03-071-2/+2
| | | | | | | | | | | | | | | | | | | | | and extern_weak_odr. These are the same as the non-odr versions, except that they indicate that the global will only be overridden by an *equivalent* global. In C, a function with weak linkage can be overridden by a function which behaves completely differently. This means that IP passes have to skip weak functions, since any deductions made from the function definition might be wrong, since the definition could be replaced by something completely different at link time. This is not allowed in C++, thanks to the ODR (One-Definition-Rule): if a function is replaced by another at link-time, then the new function must be the same as the original function. If a language knows that a function or other global can only be overridden by an equivalent global, it can give it the weak_odr linkage type, and the optimizers will understand that it is alright to make deductions based on the function body. The code generators on the other hand map weak and weak_odr linkage to the same thing. llvm-svn: 66339
* Finish cross-process JIT work, and clean up previous work.Nate Begeman2009-03-071-1/+2
| | | | | | | | | | | | | | | | 1. When the JIT is asked to remove a function, updating it's mapping to 0, we invalidate any function stubs used only by that function. Now, also invalidate the JIT's mapping from the GV the stub pointed to, to the address of the GV. 2. When dlsym stubs for cross-process JIT are enabled, do not abort just because a named function cannot be found in the JIT's process. 3. Fix various assumptions about when it is ok to use the lazy resolver when non-lazy JITing is enabled. llvm-svn: 66324
* Fix a thinko in the JIT where the address of a GV was only recorded in the mapNate Begeman2009-03-041-2/+2
| | | | | | | | | on failure to resolve it. Do not abort on failure to resolve an external symbol when using dlsym stubs, since the symbol may not be in the JIT's address space. Just use 0. Allow dlsym stubs to differentiate between GlobalVars and Functions. llvm-svn: 66050
* don't #include a header into the middle of an anon namespace.Chris Lattner2009-03-031-7/+5
| | | | llvm-svn: 65967
* Fix the logic in this assertion to properly validate the numberDan Gohman2009-02-191-2/+3
| | | | | | of arguments. llvm-svn: 64999
* Reapply r57340. VMKit does not presently rely on materializeFunctionDan Gohman2009-02-191-2/+2
| | | | | | | being called with the lock released, and this fixes a race condition in the JIT as used by lli. llvm-svn: 64997
* Add support to the JIT for true non-lazy operation. When a call to a functionNate Begeman2009-02-181-9/+61
| | | | | | | | | | | | | | | | | | | | that has not been JIT'd yet, the callee is put on a list of pending functions to JIT. The call is directed through a stub, which is updated with the address of the function after it has been JIT'd. A new interface for allocating and updating empty stubs is provided. Add support for removing the ModuleProvider the JIT was created with, which would otherwise invalidate the JIT's PassManager, which is initialized with the ModuleProvider's Module. Add support under a new ExecutionEngine flag for emitting the infomration necessary to update Function and GlobalVariable stubs after JITing them, by recording the address of the stub and the name of the GlobalValue. This allows code to be copied from one address space to another, where libraries may live at different virtual addresses, and have the stubs updated with their new correct target addresses. llvm-svn: 64906
* Split the locking out of JIT::runJITOnFunction so that callersDan Gohman2009-02-061-3/+6
| | | | | | | that already hold the lock can call an entry point that doesn't re-acquire the lock. llvm-svn: 63965
* Fix PR3423: Link llvm on ARM EABI machines. Patch by Robert Schuster.Evan Cheng2009-02-011-3/+3
| | | | llvm-svn: 63489
* Add support for deleting a module provider from a JIT in such a way that it ↵Nate Begeman2009-01-231-0/+13
| | | | | | does not cause the owned module to be fully materialized. llvm-svn: 62864
* Change isGVCompilationDisabled() semantics again. It should abort on any GV ↵Evan Cheng2009-01-161-1/+4
| | | | | | that's not constant whether it's "internal" or not. In a server / client environment, GV is returned in the same block of memory as code. However, the memory might not be writable. llvm-svn: 62336
* Add the private linkage.Rafael Espindola2009-01-151-1/+1
| | | | llvm-svn: 62279
* Rename getABITypeSize to getTypePaddedSize, asDuncan Sands2009-01-121-2/+2
| | | | | | suggested by Chris. llvm-svn: 62099
* Handle weak_extern in the JIT. This fixesDan Gohman2009-01-051-4/+5
| | | | | | | | SingleSource/UnitTests/2007-04-25-weak.c in JIT mode. The test now passes on systems which are able to produce a correct reference output to compare with. llvm-svn: 61674
* DisableGVCompilation should not abort on internal GlobalValue's.Evan Cheng2008-12-091-2/+2
| | | | llvm-svn: 60750
* Make JIT::runFunction handle functions with non-C calling conventions.Chris Lattner2008-11-231-0/+1
| | | | llvm-svn: 59904
* For some targets, it's not possible to place GVs in the same memory buffer ↵Evan Cheng2008-11-041-0/+10
| | | | | | | | as the MachineCodeEmitter allocated memory. Code and data has different read / write / execution privilege requirements. This is a short term workaround. The current solution is for the JIT memory manager to manage code and data memory separately. llvm-svn: 58688
* Support for allocation of TLS variables in the JIT. Allocation of a globalNicolas Geoffray2008-10-251-1/+20
| | | | | | | | 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
* Revert r57340 move guard mutex in getPointerToFunction as this can causeMon P Wang2008-10-101-2/+2
| | | | | | deadlock issues with java llvm-svn: 57356
* Moved guard mutex upwards to guard materializing a functionMon P Wang2008-10-101-3/+3
| | | | | | in getPointerToFunction llvm-svn: 57340
* Add DisableGVCompilation which forces the JIT to assert when it tries to ↵Evan Cheng2008-09-241-0/+4
| | | | | | allocate space for a GlobalVariable. llvm-svn: 56557
* Add support for JIT exceptions on Darwin. Since we're dealing with libgcc,Nicolas Geoffray2008-08-281-2/+135
| | | | | | | whose darwin code was written after the ability to dynamically register frames, we need to do special hacks to make things work. llvm-svn: 55507
* Register the frame register function when allocating the JIT,Nicolas Geoffray2008-08-181-5/+5
| | | | | | so that lli works out of the box with -enable-eh. llvm-svn: 54920
* Add new parameter Fast to createJIT to enable the fast codegen path.Evan Cheng2008-08-081-4/+5
| | | | llvm-svn: 54523
* Rewrite JIT handling of GlobalVariables so theyDale Johannesen2008-08-071-15/+7
| | | | | | | | | | | | | | are allocated in the same buffer as the code, jump tables, etc. The default JIT memory manager does not handle buffer overflow well. I didn't introduce this and I'm not attempting to fix it here, but it is more likely to be hit now since we're putting more stuff in the buffer. This affects one test that I know of so far, MultiSource/Benchmarks/NPB-serial/is. llvm-svn: 54442
* Prune a few dependencies on MachineFunction.h.Dan Gohman2008-07-011-1/+0
| | | | llvm-svn: 52976
* Fix a couple issues with the JIT and multiple modules:Nate Begeman2008-05-211-7/+53
| | | | | | | | | | | | 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
* Fix a bunch of 80col violations that arose from the Create API change. Tweak ↵Gabor Greif2008-05-151-3/+4
| | | | | | makefile targets to find these better. llvm-svn: 51143
* Clean up the use of static and anonymous namespaces. This turned upDan Gohman2008-05-131-0/+4
| | | | | | | several things that were neither in an anonymous namespace nor static but not intended to be global. llvm-svn: 51017
* Do not hold the JIT lock when materializing a function and verify if theNicolas Geoffray2008-04-201-1/+6
| | | | | | | function has already been codegen'd. This is required by the Java class loading mechanism which executes Java code when materializing a function. llvm-svn: 49988
* Switch to using Simplified ConstantFP::get API.Chris Lattner2008-04-201-10/+14
| | | | llvm-svn: 49977
* API changes for class Use size reduction, wave 1.Gabor Greif2008-04-061-6/+6
| | | | | | | | Specifically, introduction of XXX::Create methods for Users that have a potentially variable number of Uses. llvm-svn: 49277
* Register EH frames emitted in JIT when using gcc unwinding runtimeAnton Korobeynikov2008-03-221-1/+9
| | | | llvm-svn: 48688
* Use getPreferredAlignmentLog or getPreferredAlignmentDuncan Sands2008-01-291-1/+1
| | | | | | | to get the alignment of global variables, rather than using hand-made versions. llvm-svn: 46495
* Remove attribution from file headers, per discussion on llvmdev.Chris Lattner2007-12-291-2/+2
| | | | llvm-svn: 45418
* add a new ExecutionEngine::createJIT which can be used if you only want Chris Lattner2007-12-061-2/+19
| | | | | | | to create a JIT. This lets you specify JIT-specific configuration items like the JITMemoryManager to use. llvm-svn: 44647
* simplify creation of the interpreter, make ExecutionEngine ctor protected,Chris Lattner2007-12-061-1/+1
| | | | | | delete one ExecutionEngine ctor, minor cleanup. llvm-svn: 44646
* Executive summary: getTypeSize -> getTypeStoreSize / getABITypeSize.Duncan Sands2007-11-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The meaning of getTypeSize was not clear - clarifying it is important now that we have x86 long double and arbitrary precision integers. The issue with long double is that it requires 80 bits, and this is not a multiple of its alignment. This gives a primitive type for which getTypeSize differed from getABITypeSize. For arbitrary precision integers it is even worse: there is the minimum number of bits needed to hold the type (eg: 36 for an i36), the maximum number of bits that will be overwriten when storing the type (40 bits for i36) and the ABI size (i.e. the storage size rounded up to a multiple of the alignment; 64 bits for i36). This patch removes getTypeSize (not really - it is still there but deprecated to allow for a gradual transition). Instead there is: (1) getTypeSizeInBits - a number of bits that suffices to hold all values of the type. For a primitive type, this is the minimum number of bits. For an i36 this is 36 bits. For x86 long double it is 80. This corresponds to gcc's TYPE_PRECISION. (2) getTypeStoreSizeInBits - the maximum number of bits that is written when storing the type (or read when reading it). For an i36 this is 40 bits, for an x86 long double it is 80 bits. This is the size alias analysis is interested in (getTypeStoreSize returns the number of bytes). There doesn't seem to be anything corresponding to this in gcc. (3) getABITypeSizeInBits - this is getTypeStoreSizeInBits rounded up to a multiple of the alignment. For an i36 this is 64, for an x86 long double this is 96 or 128 depending on the OS. This is the spacing between consecutive elements when you form an array out of this type (getABITypeSize returns the number of bytes). This is TYPE_SIZE in gcc. Since successive elements in a SequentialType (arrays, pointers and vectors) need to be aligned, the spacing between them will be given by getABITypeSize. This means that the size of an array is the length times the getABITypeSize. It also means that GEP computations need to use getABITypeSize when computing offsets. Furthermore, if an alloca allocates several elements at once then these too need to be aligned, so the size of the alloca has to be the number of elements multiplied by getABITypeSize. Logically speaking this doesn't have to be the case when allocating just one element, but it is simpler to also use getABITypeSize in this case. So alloca's and mallocs should use getABITypeSize. Finally, since gcc's only notion of size is that given by getABITypeSize, if you want to output assembler etc the same as gcc then getABITypeSize is the size you want. Since a store will overwrite no more than getTypeStoreSize bytes, and a read will read no more than that many bytes, this is the notion of size appropriate for alias analysis calculations. In this patch I have corrected all type size uses except some of those in ScalarReplAggregates, lib/Codegen, lib/Target (the hard cases). I will get around to auditing these too at some point, but I could do with some help. Finally, I made one change which I think wise but others might consider pointless and suboptimal: in an unpacked struct the amount of space allocated for a field is now given by the ABI size rather than getTypeStoreSize. I did this because every other place that reserves memory for a type (eg: alloca) now uses getABITypeSize, and I didn't want to make an exception for unpacked structs, i.e. I did it to make things more uniform. This only effects structs containing long doubles and arbitrary precision integers. If someone wants to pack these types more tightly they can always use a packed struct. llvm-svn: 43620
* Implement x86 long double in jit (not reallyDale Johannesen2007-09-171-1/+10
| | | | | | complete, but common cases work) llvm-svn: 42043
* Next round of APFloat changes.Dale Johannesen2007-09-061-2/+4
| | | | | | | | | | | | | | Use APFloat in UpgradeParser and AsmParser. Change all references to ConstantFP to use the APFloat interface rather than double. Remove the ConstantFP double interfaces. Use APFloat functions for constant folding arithmetic and comparisons. (There are still way too many places APFloat is just a wrapper around host float/double, but we're getting there.) llvm-svn: 41747
* move assertion into mutex guard, a partial fix for PR1606.Chris Lattner2007-08-131-1/+1
| | | | llvm-svn: 41050
* eliminate redundant conditions from the signless types conversion.Chris Lattner2007-08-081-7/+4
| | | | llvm-svn: 40927
* New CallInst interface to address GLIBCXX_DEBUG errors caused byDavid Greene2007-08-011-1/+1
| | | | | | | | indexing an empty std::vector. Updates to all clients. llvm-svn: 40660
OpenPOWER on IntegriCloud