summaryrefslogtreecommitdiff
path: root/lib/Target/X86/X86JITInfo.cpp
Commit message (Collapse)AuthorAge
* 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
* Correlate stubs with functions in JIT: when emitting a stub, the JIT tells ↵Nicolas Geoffray2008-04-16
| | | | | | | | | | the memory manager which function the stub will resolve. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49814 91177308-0d34-0410-b5e6-96231b3b80d8
* Add Win64 compilation callback. This allows easy examples to be JITed on Win64!Anton Korobeynikov2008-03-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48706 91177308-0d34-0410-b5e6-96231b3b80d8
* Code cleanup. Provide generic way of selecting JIT pointer bitwidth regardlessAnton Korobeynikov2008-03-23
| | | | | | | of compiler used. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48702 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove old-standing obsolete code.Anton Korobeynikov2008-03-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48701 91177308-0d34-0410-b5e6-96231b3b80d8
* Unbreak build with gcc 4.3: provide missed includes and silence most ↵Anton Korobeynikov2008-02-20
| | | | | | annoying warnings. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47367 91177308-0d34-0410-b5e6-96231b3b80d8
* Silence warning about loss of precision.Bill Wendling2008-01-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45731 91177308-0d34-0410-b5e6-96231b3b80d8
* X86 JIT PIC jumptable support.Evan Cheng2008-01-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45616 91177308-0d34-0410-b5e6-96231b3b80d8
* X86 PIC JIT support fixes: encoding bugs, add lazy pointer stubs support.Evan Cheng2008-01-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45575 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove attribution from file headers, per discussion on llvmdev.Chris Lattner2007-12-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45418 91177308-0d34-0410-b5e6-96231b3b80d8
* Erm, really disable :)Anton Korobeynikov2007-12-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45319 91177308-0d34-0410-b5e6-96231b3b80d8
* Disable, until we'll really need itAnton Korobeynikov2007-12-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45318 91177308-0d34-0410-b5e6-96231b3b80d8