summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/X86/X86JITInfo.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Make helper function static.Benjamin Kramer2012-08-291-1/+1
| | | | llvm-svn: 162843
* Fix unaligned memory accesses when performing relocations in X86 JIT. There'sRichard Smith2012-08-211-4/+13
| | | | | | | no cost to using memcpy here: the fixed code is optimized by LLVM to perfect machine code. llvm-svn: 162311
* Fix various issues (or do cleanups) found by enabling certain MSVC warnings.Ahmed Charles2012-02-131-1/+4
| | | | | | | | | - 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. llvm-svn: 150364
* More dead code removal (using -Wunreachable-code)David Blaikie2012-01-201-1/+0
| | | | llvm-svn: 148578
* Creating multiple JITs on X86 in multiple threads causes multiple writes (ofNick Lewycky2011-12-031-0/+2
| | | | | | | | 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. llvm-svn: 145745
* lib/Target/X86/X86JITInfo.cpp: Add Win64 stuff.NAKAMURA Takumi2011-02-051-0/+8
| | | | llvm-svn: 124947
* Target/X86: Fix whitespace.NAKAMURA Takumi2011-02-051-2/+2
| | | | llvm-svn: 124946
* Merge System into Support.Michael J. Spencer2010-11-291-1/+1
| | | | llvm-svn: 120298
* Switch attribute macros to use 'LLVM_' as a prefix. We retain the old namesChandler Carruth2010-10-231-1/+1
| | | | | | until other LLVM projects using these are cleaned up. llvm-svn: 117200
* Tell Valgrind when we modify already-executed machine code so it knowsJeffrey Yasskin2010-03-151-0/+7
| | | | | | | to re-instrument the code. We depend on the system valgrind.h to avoid adding a new license. llvm-svn: 98529
* Fix x86 JIT stub on MSVC.Torok Edwin2010-02-081-0/+1
| | | | | | Thanks to Kristaps Straupe for noticing the bug. llvm-svn: 95537
* Change errs() to dbgs().David Greene2010-01-051-1/+1
| | | | llvm-svn: 92651
* Change indirect-globals to use a dedicated allocIndirectGV. This lets usJeffrey Yasskin2009-12-151-8/+10
| | | | | | | | | 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. llvm-svn: 91464
* * Move stub allocation inside the JITEmitter, instead of exposing aJeffrey Yasskin2009-11-231-34/+25
| | | | | | | | | | | | | | 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. llvm-svn: 89715
* Allow more than one stub to be being generated at the same time.Jeffrey Yasskin2009-11-231-11/+14
| | | | | | | | It's probably better in the long run to replace the indirect-GlobalVariable system. That'll be done after a subsequent patch. llvm-svn: 89708
* Make X86-64 in the Large model always emit 64-bit calls.Jeffrey Yasskin2009-11-161-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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! llvm-svn: 88984
* Change the marker byte for stubs from 0xcd to 0xce (another form ofDale Johannesen2009-09-151-3/+6
| | | | | | | | | 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. llvm-svn: 81888
* Do not create calls via PLT in compilation callback - this is higly platformAnton Korobeynikov2009-09-061-11/+12
| | | | | | dependent. Hopefully, this will fix PR3801. llvm-svn: 81132
* Unbreak x86_64 build.Evan Cheng2009-09-031-2/+6
| | | | llvm-svn: 80885
* X86JITInfo::getLazyResolverFunction() should not read cpu id to determine ↵Evan Cheng2009-09-031-17/+8
| | | | | | | | whether sse is available. Just use consult subtarget. No functionality changes. llvm-svn: 80880
* Short-term workaround for frame-related weirdness on win64.Anton Korobeynikov2009-08-281-1/+1
| | | | | | | | Some other minor win64 fixes as well. Patch by Michael Beck! llvm-svn: 80370
* remove the last uses of Config/alloca.hChris Lattner2009-08-231-1/+0
| | | | llvm-svn: 79873
* Modify an assert to avoid what looks like a GCC 4.2.4 signed-ness bug.Reid Kleckner2009-08-191-3/+5
| | | | llvm-svn: 79494
* 1) Proper emit displacements for x86, using absolute relocations where necessaryBruno Cardoso Lopes2009-08-051-0/+1
| | | | | | | | | | 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 llvm-svn: 78129
* - s/DOUT/DEBUG(errs()/gBill Wendling2009-08-031-4/+4
| | | | | | - Tidy up some headers. llvm-svn: 77929
* llvm_unreachable->llvm_unreachable(0), LLVM_UNREACHABLE->llvm_unreachable.Torok Edwin2009-07-141-2/+2
| | | | | | | | | 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"). llvm-svn: 75640
* Remove extra \n from LLVM_UNREACHABLE calls.Torok Edwin2009-07-121-2/+2
| | | | llvm-svn: 75416
* assert(0) -> LLVM_UNREACHABLE.Torok Edwin2009-07-111-1/+1
| | | | | | | | | 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. llvm-svn: 75379
* Start converting to new error handling API.Torok Edwin2009-07-081-2/+2
| | | | | | | cerr+abort -> llvm_report_error assert(0)+abort -> LLVM_UNREACHABLE (assert(0)+llvm_unreachable-> abort() included) llvm-svn: 75018
* First patch in the direction of splitting MachineCodeEmitter in two subclasses:Bruno Cardoso Lopes2009-05-301-41/+40
| | | | | | JITCodeEmitter and ObjectCodeEmitter. No functional changes yet. Patch by Aaron Gray llvm-svn: 72631
* Add support to the JIT for true non-lazy operation. When a call to a functionNate Begeman2009-02-181-0/+15
| | | | | | | | | | | | | | | | | | | | 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
* Use .size and .type on ELF systems; this helps tools that mapDan Gohman2009-02-061-3/+19
| | | | | | addresses to symbols. llvm-svn: 63962
* Fix MachineCodeEmitter to use uintptr_t instead of intptr_t. This avoids ↵Evan Cheng2008-12-101-1/+1
| | | | | | some overflow issues. Patch by Thomas Jablin. llvm-svn: 60828
* Rename isGVNonLazyPtr to isIndirectSym to reflect how it will be used.Evan Cheng2008-11-101-2/+2
| | | | llvm-svn: 58949
* Rename startFunctionStub to startGVStub since it's also used for GV non-lazy ↵Evan Cheng2008-11-081-9/+9
| | | | | | ptr. llvm-svn: 58897
* Rename isGVLazyPtr to isGVNonLazyPtr relocation. This represents Mac OS XEvan Cheng2008-11-051-2/+2
| | | | | | indirect gv reference. Please don't call it lazy. llvm-svn: 58746
* Support for allocation of TLS variables in the JIT. Allocation of a globalNicolas Geoffray2008-10-251-0/+10
| | | | | | | | 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
* When resolving a stub in x86-64 JIT, use a PC-relative branchDale Johannesen2008-08-121-2/+14
| | | | | | rather than the absolute address if the target is within range. llvm-svn: 54708
* Mark function used by asm block as used, otherwise optimizer may not see the ↵Devang Patel2008-07-161-1/+3
| | | | | | use and may delete the function. llvm-svn: 53692
* X86-64 PIC jump table values are different from x86-32 cases, they are dest ↵Evan Cheng2008-07-161-0/+4
| | | | | | - table base. llvm-svn: 53660
* Fixes for being compiled PIC on Linux. This isn't the mostDan Gohman2008-06-241-3/+10
| | | | | | | general solution possible, but it's a fairly simple one. Based on a patch from the OpenGTL project! llvm-svn: 52662
* Don't break strict aliasing.Evan Cheng2008-06-051-6/+6
| | | | llvm-svn: 52026
* Unbreak build on x86-64.Dale Johannesen2008-04-161-1/+1
| | | | llvm-svn: 49822
* Correlate stubs with functions in JIT: when emitting a stub, the JIT tells ↵Nicolas Geoffray2008-04-161-13/+16
| | | | | | | | the memory manager which function the stub will resolve. llvm-svn: 49814
* Add Win64 compilation callback. This allows easy examples to be JITed on Win64!Anton Korobeynikov2008-03-231-5/+4
| | | | llvm-svn: 48706
* Code cleanup. Provide generic way of selecting JIT pointer bitwidth regardlessAnton Korobeynikov2008-03-231-22/+30
| | | | | | of compiler used. llvm-svn: 48702
* Remove old-standing obsolete code.Anton Korobeynikov2008-03-231-9/+11
| | | | llvm-svn: 48701
* Unbreak build with gcc 4.3: provide missed includes and silence most ↵Anton Korobeynikov2008-02-201-0/+1
| | | | | | annoying warnings. llvm-svn: 47367
* Silence warning about loss of precision.Bill Wendling2008-01-081-1/+1
| | | | llvm-svn: 45731
* X86 JIT PIC jumptable support.Evan Cheng2008-01-051-0/+6
| | | | llvm-svn: 45616
OpenPOWER on IntegriCloud