summaryrefslogtreecommitdiff
path: root/lib/Target/X86/X86JITInfo.cpp
Commit message (Collapse)AuthorAge
* Move LLVM_LIBRARY_VISIBILITY for consistency with what was done toRafael Espindola2013-02-19
| | | | | | PPCJITInfo.cpp in r175394. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175531 91177308-0d34-0410-b5e6-96231b3b80d8
* Give these callbacks hidden visibility. It is better to not export them moreRafael Espindola2013-02-15
| | | | | | | than we need to and some ELF linkers complain about directly accessing symbols with default visibility. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175268 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't make assumptions about the mangling of static functions in extern "C"Rafael Espindola2013-02-15
| | | | | | | | blocks. We still don't have consensus if we should try to change clang or the standard, but llvm should work with compilers that implement the current standard and mangle those functions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175267 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r175120 and r175121. Clang is producing the expected asm names again.Rafael Espindola2013-02-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175133 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't assume the mangling of static functions.Rafael Espindola2013-02-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175121 91177308-0d34-0410-b5e6-96231b3b80d8
* More MSan/ASan annotations.Evgeniy Stepanov2013-02-04
| | | | | | | | | | | | | | | This change lets us bootstrap LLVM/Clang under ASan and MSan. It contains fixes for 2 issues: - X86JIT reads return address from stack, which MSan does not know is initialized. - bugpoint tests run binaries with RLIMIT_AS. This does not work with certain Sanitizers. We are no longer including config.h in Compiler.h with this change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174306 91177308-0d34-0410-b5e6-96231b3b80d8
* Move all of the header files which are involved in modelling the LLVM IRChandler Carruth2013-01-02
| | | | | | | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171366 91177308-0d34-0410-b5e6-96231b3b80d8
* Make helper function static.Benjamin Kramer2012-08-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162843 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix unaligned memory accesses when performing relocations in X86 JIT. There'sRichard Smith2012-08-21
| | | | | | | | no cost to using memcpy here: the fixed code is optimized by LLVM to perfect machine code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162311 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix various issues (or do cleanups) found by enabling certain MSVC warnings.Ahmed Charles2012-02-13
| | | | | | | | | - Use unsigned literals when the desired result is unsigned. This mostly allows unsigned/signed mismatch warnings to be less noisy even if they aren't on by default. - Remove misplaced llvm_unreachable. - Add static to a declaration of a function on MSVC x86 only. - Change some instances of calling a static function through a variable to simply calling that function while removing the unused variable. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150364 91177308-0d34-0410-b5e6-96231b3b80d8
* More dead code removal (using -Wunreachable-code)David Blaikie2012-01-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148578 91177308-0d34-0410-b5e6-96231b3b80d8
* Creating multiple JITs on X86 in multiple threads causes multiple writes (ofNick Lewycky2011-12-03
| | | | | | | | | the same value) to this variable. This code could be refactored, but it doesn't matter since the old JIT is going away. Add tsan annotations to ignore the race. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145745 91177308-0d34-0410-b5e6-96231b3b80d8
* lib/Target/X86/X86JITInfo.cpp: Add Win64 stuff.NAKAMURA Takumi2011-02-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124947 91177308-0d34-0410-b5e6-96231b3b80d8
* Target/X86: Fix whitespace.NAKAMURA Takumi2011-02-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124946 91177308-0d34-0410-b5e6-96231b3b80d8
* Merge System into Support.Michael J. Spencer2010-11-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120298 91177308-0d34-0410-b5e6-96231b3b80d8
* Switch attribute macros to use 'LLVM_' as a prefix. We retain the old namesChandler Carruth2010-10-23
| | | | | | | until other LLVM projects using these are cleaned up. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117200 91177308-0d34-0410-b5e6-96231b3b80d8
* Tell Valgrind when we modify already-executed machine code so it knowsJeffrey Yasskin2010-03-15
| | | | | | | | | to re-instrument the code. We depend on the system valgrind.h to avoid adding a new license. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98529 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix x86 JIT stub on MSVC.Torok Edwin2010-02-08
| | | | | | | Thanks to Kristaps Straupe for noticing the bug. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95537 91177308-0d34-0410-b5e6-96231b3b80d8
* Change errs() to dbgs().David Greene2010-01-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92651 91177308-0d34-0410-b5e6-96231b3b80d8
* Change indirect-globals to use a dedicated allocIndirectGV. This lets usJeffrey Yasskin2009-12-15
| | | | | | | | | | remove start/finishGVStub and the BufferState helper class from the MachineCodeEmitter interface. It has the side-effect of not setting the indirect global writable and then executable on ARM, but that shouldn't be necessary. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91464 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
* Allow more than one stub to be being generated at the same time.Jeffrey Yasskin2009-11-23
| | | | | | | | | | It's probably better in the long run to replace the indirect-GlobalVariable system. That'll be done after a subsequent patch. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89708 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
* Change the marker byte for stubs from 0xcd to 0xce (another form ofDale Johannesen2009-09-15
| | | | | | | | | | | interrupt instruction, which shouldn't arise any other way). 0xcd is also used by JITMemoryManager to initialize the buffer to garbage, which means it could appear following a noreturn call even when that is not a stub, confusing X86CompilationCallback2. PR 4929. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81888 91177308-0d34-0410-b5e6-96231b3b80d8
* Do not create calls via PLT in compilation callback - this is higly platformAnton Korobeynikov2009-09-06
| | | | | | dependent. Hopefully, this will fix PR3801. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81132 91177308-0d34-0410-b5e6-96231b3b80d8
* Unbreak x86_64 build.Evan Cheng2009-09-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80885 91177308-0d34-0410-b5e6-96231b3b80d8
* X86JITInfo::getLazyResolverFunction() should not read cpu id to determine ↵Evan Cheng2009-09-03
| | | | | | | | | whether sse is available. Just use consult subtarget. No functionality changes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80880 91177308-0d34-0410-b5e6-96231b3b80d8
* Short-term workaround for frame-related weirdness on win64.Anton Korobeynikov2009-08-28
| | | | | | | | Some other minor win64 fixes as well. Patch by Michael Beck! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80370 91177308-0d34-0410-b5e6-96231b3b80d8
* remove the last uses of Config/alloca.hChris Lattner2009-08-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79873 91177308-0d34-0410-b5e6-96231b3b80d8
* Modify an assert to avoid what looks like a GCC 4.2.4 signed-ness bug.Reid Kleckner2009-08-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79494 91177308-0d34-0410-b5e6-96231b3b80d8
* 1) Proper emit displacements for x86, using absolute relocations where necessaryBruno Cardoso Lopes2009-08-05
| | | | | | | | | | | for ELF to work. 2) RIP addressing: Use SIB bytes for absolute relocations where RegBase=0, IndexReg=0. 3) The JIT can get the real address of cstpools and jmptables during code emission, fix that for object code emission git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78129 91177308-0d34-0410-b5e6-96231b3b80d8
* - s/DOUT/DEBUG(errs()/gBill Wendling2009-08-03
| | | | | | | - Tidy up some headers. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77929 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm_unreachable->llvm_unreachable(0), LLVM_UNREACHABLE->llvm_unreachable.Torok Edwin2009-07-14
| | | | | | | | | | This adds location info for all llvm_unreachable calls (which is a macro now) in !NDEBUG builds. In NDEBUG builds location info and the message is off (it only prints "UREACHABLE executed"). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75640 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove extra \n from LLVM_UNREACHABLE calls.Torok Edwin2009-07-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75416 91177308-0d34-0410-b5e6-96231b3b80d8
* assert(0) -> LLVM_UNREACHABLE.Torok Edwin2009-07-11
| | | | | | | | | | Make llvm_unreachable take an optional string, thus moving the cerr<< out of line. LLVM_UNREACHABLE is now a simple wrapper that makes the message go away for NDEBUG builds. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75379 91177308-0d34-0410-b5e6-96231b3b80d8
* Start converting to new error handling API.Torok Edwin2009-07-08
| | | | | | | | cerr+abort -> llvm_report_error assert(0)+abort -> LLVM_UNREACHABLE (assert(0)+llvm_unreachable-> abort() included) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75018 91177308-0d34-0410-b5e6-96231b3b80d8
* First patch in the direction of splitting MachineCodeEmitter in two subclasses:Bruno Cardoso Lopes2009-05-30
| | | | | | | | JITCodeEmitter and ObjectCodeEmitter. No functional changes yet. Patch by Aaron Gray git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72631 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support to the JIT for true non-lazy operation. When a call to a functionNate Begeman2009-02-18
| | | | | | | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64906 91177308-0d34-0410-b5e6-96231b3b80d8
* Use .size and .type on ELF systems; this helps tools that mapDan Gohman2009-02-06
| | | | | | | addresses to symbols. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63962 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix MachineCodeEmitter to use uintptr_t instead of intptr_t. This avoids ↵Evan Cheng2008-12-10
| | | | | | some overflow issues. Patch by Thomas Jablin. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60828 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename isGVNonLazyPtr to isIndirectSym to reflect how it will be used.Evan Cheng2008-11-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58949 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename startFunctionStub to startGVStub since it's also used for GV non-lazy ↵Evan Cheng2008-11-08
| | | | | | ptr. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58897 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename isGVLazyPtr to isGVNonLazyPtr relocation. This represents Mac OS XEvan Cheng2008-11-05
| | | | | | | indirect gv reference. Please don't call it lazy. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58746 91177308-0d34-0410-b5e6-96231b3b80d8
* Support for allocation of TLS variables in the JIT. Allocation of a globalNicolas Geoffray2008-10-25
| | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58142 91177308-0d34-0410-b5e6-96231b3b80d8
* When resolving a stub in x86-64 JIT, use a PC-relative branchDale Johannesen2008-08-12
| | | | | | | | rather than the absolute address if the target is within range. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54708 91177308-0d34-0410-b5e6-96231b3b80d8
* Mark function used by asm block as used, otherwise optimizer may not see the ↵Devang Patel2008-07-16
| | | | | | use and may delete the function. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53692 91177308-0d34-0410-b5e6-96231b3b80d8
* X86-64 PIC jump table values are different from x86-32 cases, they are dest ↵Evan Cheng2008-07-16
| | | | | | - table base. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53660 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixes for being compiled PIC on Linux. This isn't the mostDan Gohman2008-06-24
| | | | | | | | general solution possible, but it's a fairly simple one. Based on a patch from the OpenGTL project! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52662 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't break strict aliasing.Evan Cheng2008-06-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52026 91177308-0d34-0410-b5e6-96231b3b80d8
* Unbreak build on x86-64.Dale Johannesen2008-04-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49822 91177308-0d34-0410-b5e6-96231b3b80d8