summaryrefslogtreecommitdiff
path: root/unittests/ExecutionEngine
Commit message (Collapse)AuthorAge
* Stop building RTTI information for *most* llvm libraries. NotableChris Lattner2010-01-22
| | | | | | | | | | | | | missing ones are libsupport, libsystem and libvmcore. libvmcore is currently blocked on bugpoint, which uses EH. Once it stops using EH, we can switch it off. This #if 0's out 3 unit tests, because gtest requires RTTI information. Suggestions welcome on how to fix this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94164 91177308-0d34-0410-b5e6-96231b3b80d8
* Disable JITTest.FunctionIsRecompiledAndRelinked on ARM where it's notJeffrey Yasskin2009-12-23
| | | | | | | implemented. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91963 91177308-0d34-0410-b5e6-96231b3b80d8
* Partially revert r91626. Materializing extra functions to determine whetherJeffrey Yasskin2009-12-22
| | | | | | | | | | | | they're available_externally broke VMKit, which was relying on the fact that functions would only be materialized when they were first called. We'll have to wait for http://llvm.org/PR5737 to really fix this. I also added a test for one of the F->isDeclaration() calls which wasn't covered by anything else in the test suite. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91943 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a crash in JIT::recompileAndRelinkFunction(). It doesn't pass the MCIJeffrey Yasskin2009-12-22
| | | | | | | | | | argument to runJITOnFunction(), which caused a null pointer dereference at every call. Patch by Gianluca Guida! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91939 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't codegen available_externally functions. Fixes http://llvm.org/PR5735.Jeffrey Yasskin2009-12-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91626 91177308-0d34-0410-b5e6-96231b3b80d8
* Reinstate r91208 to fix available_externally linkage for globals, withJeffrey Yasskin2009-12-13
| | | | | | | | nlewycky's fix to add -rdynamic so the JIT can look symbols up in Linux builds of the JITTests binary. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91250 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r91208. Something on Linux prevents the JIT from looking up a symbolJeffrey Yasskin2009-12-12
| | | | | | | defined in the test, and I don't have time tonight to figure it out. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91209 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix available_externally linkage for globals. It's probably still notJeffrey Yasskin2009-12-12
| | | | | | | supported by emitGlobals, but I don't have a test case for that. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91208 91177308-0d34-0410-b5e6-96231b3b80d8
* Oops. Re-disable JITTest.NoStubs on ARM and PPC since they still use stubs toJeffrey Yasskin2009-11-24
| | | | | | | make far calls work. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89733 91177308-0d34-0410-b5e6-96231b3b80d8
* * Move stub allocation inside the JITEmitter, instead of exposing aJeffrey Yasskin2009-11-23
| | | | | | | | | | | | | | | | way for each TargetJITInfo subclass to allocate its own stubs. This means stubs aren't as exactly-sized anymore, but it lets us get rid of TargetJITInfo::emitFunctionStubAtAddr(), which lets ARM and PPC support the eager JIT, fixing http://llvm.org/PR4816. * Rename the JITEmitter's stub creation functions to describe the kind of stub they create. So far, all of them create lazy-compilation stubs, but they sometimes get used when far-call stubs are needed. Fixing http://llvm.org/PR5201 will involve fixing this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89715 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert the test from r88984. It relies on being able to mmap 16GB ofJeffrey Yasskin2009-11-16
| | | | | | | | | | | | address space (though it only uses a small fraction of that), and the buildbots disallow that. Also add a comment to the Makefile's ulimit line warning future developers that changing it won't work. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88994 91177308-0d34-0410-b5e6-96231b3b80d8
* Make X86-64 in the Large model always emit 64-bit calls.Jeffrey Yasskin2009-11-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The large code model is documented at http://www.x86-64.org/documentation/abi.pdf and says that calls should assume their target doesn't live within the 32-bit pc-relative offset that fits in the call instruction. To do this, we turn off the global-address->target-global-address conversion in X86TargetLowering::LowerCall(). The first attempt at this broke the lazy JIT because it can separate the movabs(imm->reg) from the actual call instruction. The lazy JIT receives the address of the movabs as a relocation and needs to record the return address from the call; and then when that call happens, it needs to patch the movabs with the newly-compiled target. We could thread the call instruction into the relocation and record the movabs<->call mapping explicitly, but that seems to require at least as much new complication in the code generator as this change. To fix this, we make lazy functions _always_ go through a call stub. You'd think we'd only have to force lazy calls through a stub on difficult platforms, but that turns out to break indirect calls through a function pointer. The right fix for that is to distinguish between calls and address-of operations on uncompiled functions, but that's complex enough to leave for someone else to do. Another attempt at this defined a new CALL64i pseudo-instruction, which expanded to a 2-instruction sequence in the assembly output and was special-cased in the X86CodeEmitter's emitInstruction() function. That broke indirect calls in the same way as above. This patch also removes a hack forcing Darwin to the small code model. Without far-call-stubs, the small code model requires things of the JITMemoryManager that the DefaultJITMemoryManager can't provide. Thanks to echristo for lots of testing! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88984 91177308-0d34-0410-b5e6-96231b3b80d8
* This test doesn't work on arm either.Benjamin Kramer2009-11-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88794 91177308-0d34-0410-b5e6-96231b3b80d8
* Disable the JITTest.NoStubs test for Darwin PPC. It apparently doesn't implementBill Wendling2009-11-13
| | | | | | | emitFunctionStubAtAddr. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88708 91177308-0d34-0410-b5e6-96231b3b80d8
* Use stubs when we have them, otherwise use code we already have,Eric Christopher2009-11-12
| | | | | | | | | otherwise create a stub. Add a test to make sure we don't create extraneous stubs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86941 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix JITTest.ModuleDeletion in -Asserts mode (which turns off JITEmitDebugInfoJeffrey Yasskin2009-11-11
| | | | | | | by default). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86807 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove dlsym stubs, with Nate Begeman's permission.Jeffrey Yasskin2009-11-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86606 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix the ModuleDeletion test on PPC and ARM.Jeffrey Yasskin2009-10-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85352 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert the API changes from r85295 to make it easier for people to buildJeffrey Yasskin2009-10-27
| | | | | | | against both 2.6 and HEAD. The default is still changed to eager jitting. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85330 91177308-0d34-0410-b5e6-96231b3b80d8
* Change the JIT to compile eagerly by default as agreed inJeffrey Yasskin2009-10-27
| | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85295 91177308-0d34-0410-b5e6-96231b3b80d8
* Type.h doesn't need to #include LLVMContext.hChris Lattner2009-10-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85254 91177308-0d34-0410-b5e6-96231b3b80d8
* Automatically do the equivalent of freeMachineCodeForFunction(F) when F isJeffrey Yasskin2009-10-27
| | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85182 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix http://llvm.org/PR4822: allow module deletion after a function has beenJeffrey Yasskin2009-10-23
| | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84975 91177308-0d34-0410-b5e6-96231b3b80d8
* Move the Function*->allocated blocks map from the JITMemoryManager to theJeffrey Yasskin2009-10-20
| | | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84651 91177308-0d34-0410-b5e6-96231b3b80d8
* PowerPC ifdef'ing considered more complicated than one might like.Daniel Dunbar2009-10-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84603 91177308-0d34-0410-b5e6-96231b3b80d8
* Correct test for PowerPC.Nick Lewycky2009-10-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84595 91177308-0d34-0410-b5e6-96231b3b80d8
* Also check for __POWERPC__ when skipping these tests.Daniel Dunbar2009-10-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84482 91177308-0d34-0410-b5e6-96231b3b80d8
* Disable another unittest that doesn't work on arm and ppc.Benjamin Kramer2009-10-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84186 91177308-0d34-0410-b5e6-96231b3b80d8
* The ARM and PowerPC jits are broken in this regard.Nick Lewycky2009-10-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84128 91177308-0d34-0410-b5e6-96231b3b80d8
* Keep track of stubs that are created. This fixes PR5162 and probably PR4822 andJeffrey Yasskin2009-10-13
| | | | | | | 4406. Patch by Nick Lewycky! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84032 91177308-0d34-0410-b5e6-96231b3b80d8
* Make the ExecutionEngine automatically remove global mappings on when theirJeffrey Yasskin2009-10-13
| | | | | | | | GlobalValue is destroyed. Function destruction still leaks machine code and can crash on leaked stubs, but this is some progress. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83987 91177308-0d34-0410-b5e6-96231b3b80d8
* ExecutionEngine::clearGlobalMappingsFromModule failed to remove reverseJeffrey Yasskin2009-10-09
| | | | | | | | mappings, which could cause errors and assert-failures. This patch fixes that, adds a test, and refactors the global-mapping-removal code into a single place. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83678 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix illegal cross-type aliasing. Found by baldrick on a newer gcc.Jeffrey Yasskin2009-10-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83401 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix http://llvm.org/PR5116 by rolling back r60822. This passes `make unittestsJeffrey Yasskin2009-10-06
| | | | | | | | check-lit` on both x86-64 Linux and x86-32 Darwin. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83353 91177308-0d34-0410-b5e6-96231b3b80d8
* Push LLVMContexts through the IntegerType APIs.Owen Anderson2009-08-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78948 91177308-0d34-0410-b5e6-96231b3b80d8
* Make ExecutionEngine::updateGlobalMapping(GV, NULL) properly remove GV's oldJeffrey Yasskin2009-08-04
| | | | | | | address from the reverse mapping, and add a test that this works now. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78127 91177308-0d34-0410-b5e6-96231b3b80d8
* Update unittest for LLVM API change.Benjamin Kramer2009-07-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77730 91177308-0d34-0410-b5e6-96231b3b80d8
* Move types back to the 2.5 API.Owen Anderson2009-07-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77516 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert the ConstantInt constructors back to their 2.5 forms where possible, ↵Owen Anderson2009-07-24
| | | | | | thanks to contexts-on-types. More to come. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77011 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixing unittests on 32-bit Darwin, using 0x...ULL instead of 0x...U .Reid Kleckner2009-07-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76904 91177308-0d34-0410-b5e6-96231b3b80d8
* Re-committing r76828 with the JIT memory manager changes now that the buildReid Kleckner2009-07-23
| | | | | | | bots like the BumpPtrAllocator changes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76902 91177308-0d34-0410-b5e6-96231b3b80d8
* Reverting r76825 and r76828, since they caused clang runtime errors and some ↵Reid Kleckner2009-07-23
| | | | | | build failure involving memset. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76838 91177308-0d34-0410-b5e6-96231b3b80d8
* Make the JIT code emitter properly retry and ask for more memory when it runsReid Kleckner2009-07-23
| | | | | | | | | | | | | | out of memory, and also make the default memory manager allocate more memory when it runs out. Also, switch function stubs and global data over to using the BumpPtrAllocator. This makes it so the JIT no longer mmaps (or the equivalent on Windows) 16 MB of memory, and instead allocates in 512K slabs. I suspect this size could go lower, especially on embedded platforms, now that more slabs can be allocated. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76828 91177308-0d34-0410-b5e6-96231b3b80d8
* Unbreak unittests build.Daniel Dunbar2009-07-18
| | | | | | | - Reid, please check, I'm not sure if this is what was intended. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76286 91177308-0d34-0410-b5e6-96231b3b80d8
* Add EngineBuilder to ExecutionEngine in favor of the five optional argument ↵Reid Kleckner2009-07-18
| | | | | | | | | EE::create(). Also a test commit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76276 91177308-0d34-0410-b5e6-96231b3b80d8
* Move EVER MORE stuff over to LLVMContext.Owen Anderson2009-07-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75703 91177308-0d34-0410-b5e6-96231b3b80d8
* Begin the painful process of tearing apart the rat'ss nest that is ↵Owen Anderson2009-07-13
| | | | | | | | | | Constants.cpp and ConstantFold.cpp. This involves temporarily hard wiring some parts to use the global context. This isn't ideal, but it's the only way I could figure out to make this process vaguely incremental. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75445 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't use a void return type with a function that returns a value.Dan Gohman2009-07-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75364 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix unit tests.Owen Anderson2009-07-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75262 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an option to allocate JITed global data separately from code. ByJeffrey Yasskin2009-07-08
| | | | | | | | | | | | | | | default, this option is not enabled to support clients who rely on this behavior. Fixes http://llvm.org/PR4483 A patch to allocate additional memory for globals after we run out is forthcoming. Patch by Reid Kleckner! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75059 91177308-0d34-0410-b5e6-96231b3b80d8