summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Add a JITEventListener interface that gets called back when a new function isJeffrey Yasskin2009-06-251-157/+8
| | | | | | | | | emitted or the machine code for a function is freed. Chris mentioned that we may also want a notification when a stub is emitted, but that'll be a future change. I intend to use this to tell oprofile where functions are emitted and what lines correspond to what addresses. llvm-svn: 74157
* Split the Add, Sub, and Mul instruction opcodes into separateDan Gohman2009-06-041-0/+3
| | | | | | | | | | | | | | | integer and floating-point opcodes, introducing FAdd, FSub, and FMul. For now, the AsmParser, BitcodeReader, and IRBuilder all preserve backwards compatability, and the Core LLVM APIs preserve backwards compatibility for IR producers. Most front-ends won't need to change immediately. This implements the first step of the plan outlined here: http://nondot.org/sabre/LLVMNotes/IntegerOverflow.txt llvm-svn: 72897
* Use uint8_t and int32_t in {JIT,Machine}CodeEmitersBruno Cardoso Lopes2009-06-041-7/+7
| | | | llvm-svn: 72821
* Revert 72650Bruno Cardoso Lopes2009-06-031-7/+7
| | | | llvm-svn: 72783
* Use uint8_t and int32_t in {JIT,Machine}CodeEmitersBruno Cardoso Lopes2009-05-301-7/+7
| | | | llvm-svn: 72650
* First patch in the direction of splitting MachineCodeEmitter in two subclasses:Bruno Cardoso Lopes2009-05-301-18/+18
| | | | | | 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-2/+23
| | | | | | | | | | 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-3/+3
| | | | | | | will make it more obvious what it represents, and stop it being confused with the StoreSize. llvm-svn: 71349
* Set FnEnd in JITEmitter::finishFunction to point strictly to the end of ↵Argyrios Kyrtzidis2009-04-301-3/+6
| | | | | | | | function's machine code. Don't include memory allocated for global variables during relocations resolution. llvm-svn: 70517
* Under unusual circumstances (jitting a function that causes the creation ofNick Lewycky2009-04-271-17/+23
| | | | | | | | | | | | another stub, but then never calling the jitted function) can cause the JIT to leave a stub in place. Judging by the comments this is a known deficiency, so we're just not going to use AssertingVH for the StubToFunctionTy map. Also shorten some lines longer than 80 columns. This fixes the "make check" failure with ocaml on x86-64 linux. llvm-svn: 70185
* Use an AssertingVH to detect the case where the Function was deleted butNick Lewycky2009-04-191-10/+11
| | | | | | freeMachineCodeForFunction was never called. llvm-svn: 69531
* Fix some significant problems with constant pools that resulted in ↵Evan Cheng2009-03-131-23/+35
| | | | | | | | | | | | | | | | | | | | | | | unnecessary paddings between constant pool entries, larger than necessary alignments (e.g. 8 byte alignment for .literal4 sections), and potentially other issues. 1. ConstantPoolSDNode alignment field is log2 value of the alignment requirement. This is not consistent with other SDNode variants. 2. MachineConstantPool alignment field is also a log2 value. 3. However, some places are creating ConstantPoolSDNode with alignment value rather than log2 values. This creates entries with artificially large alignments, e.g. 256 for SSE vector values. 4. Constant pool entry offsets are computed when they are created. However, asm printer group them by sections. That means the offsets are no longer valid. However, asm printer uses them to determine size of padding between entries. 5. Asm printer uses expensive data structure multimap to track constant pool entries by sections. 6. Asm printer iterate over SmallPtrSet when it's emitting constant pool entries. This is non-deterministic. Solutions: 1. ConstantPoolSDNode alignment field is changed to keep non-log2 value. 2. MachineConstantPool alignment field is also changed to keep non-log2 value. 3. Functions that create ConstantPool nodes are passing in non-log2 alignments. 4. MachineConstantPoolEntry no longer keeps an offset field. It's replaced with an alignment field. Offsets are not computed when constant pool entries are created. They are computed on the fly in asm printer and JIT. 5. Asm printer uses cheaper data structure to group constant pool entries. 6. Asm printer compute entry offsets after grouping is done. 7. Change JIT code to compute entry offsets on the fly. llvm-svn: 66875
* Allow cross-process JIT to handle MachineRelocations of the ExternalSymbolNate Begeman2009-03-111-13/+82
| | | | | | | variety. For example, an i64 div might turn into a call to __divdi3 during legalization. llvm-svn: 66646
* Finish cross-process JIT work, and clean up previous work.Nate Begeman2009-03-071-29/+38
| | | | | | | | | | | | | | | | 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
* switch this message back to only being in -debug mode.Chris Lattner2009-03-051-1/+1
| | | | llvm-svn: 66143
* When allocating stubs, keep track of which Functions are referencing the stub.Nate Begeman2009-03-051-17/+120
| | | | | | | | This invalidates the stubs in the resolver map when they are no longer referenced, and should the JIT memory manager ever pick up a deallocateStub interface, the JIT could reclaim the memory for unused stubs as well. llvm-svn: 66141
* Fix a thinko in the JIT where the address of a GV was only recorded in the mapNate Begeman2009-03-041-4/+14
| | | | | | | | | 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
* Fix the calculation for how big the allocated stub needs to be.Nate Begeman2009-03-021-1/+1
| | | | llvm-svn: 65895
* Add support to the JIT for true non-lazy operation. When a call to a functionNate Begeman2009-02-181-19/+134
| | | | | | | | | | | | | | | | | | | | 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
* Rename getABITypeSize to getTypePaddedSize, asDuncan Sands2009-01-121-3/+3
| | | | | | suggested by Chris. llvm-svn: 62099
* Handle weak_extern in the JIT. This fixesDan Gohman2009-01-051-2/+8
| | | | | | | | 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
* Fix MachineCodeEmitter to use uintptr_t instead of intptr_t. This avoids ↵Evan Cheng2008-12-101-14/+21
| | | | | | some overflow issues. Patch by Thomas Jablin. llvm-svn: 60828
* Fix a bug introduced by r59265. If lazy compilation is disabled, return ↵Evan Cheng2008-12-101-1/+1
| | | | | | actual function ptr instead of ptr to stub if function is already compiled. llvm-svn: 60822
* Always emit a function pointer as a pointer to the function stub (if there ↵Evan Cheng2008-11-131-1/+20
| | | | | | is one). This makes it possible to compare function pointer values in lazy compilation mode. This fixes PR3043. llvm-svn: 59265
* Change binary dump format.Evan Cheng2008-11-121-9/+21
| | | | llvm-svn: 59119
* Comments and indentation.Evan Cheng2008-11-101-3/+3
| | | | llvm-svn: 59007
* Forgot these.Evan Cheng2008-11-101-19/+19
| | | | llvm-svn: 58952
* Remove a InvalidateInstructionCache call with incorrect size.Evan Cheng2008-11-081-4/+0
| | | | llvm-svn: 58898
* Rename startFunctionStub to startGVStub since it's also used for GV non-lazy ↵Evan Cheng2008-11-081-6/+6
| | | | | | ptr. llvm-svn: 58897
* Rename isString -> isExternalSymbol; getString -> getExternalSymbol since ↵Evan Cheng2008-11-081-3/+3
| | | | | | these work on externsym machine relocations. llvm-svn: 58895
* More debug output.Evan Cheng2008-11-081-0/+2
| | | | llvm-svn: 58894
* More debug output.Evan Cheng2008-11-071-1/+3
| | | | llvm-svn: 58868
* Jump tables may be emitted by target.Evan Cheng2008-11-071-9/+13
| | | | llvm-svn: 58835
* Improve JIT debugging outputs format consistency.Evan Cheng2008-11-061-11/+14
| | | | llvm-svn: 58807
* Need a \n.Evan Cheng2008-11-061-1/+2
| | | | llvm-svn: 58788
* Undo 58778 but makes the binary dump prettier.Evan Cheng2008-11-051-3/+21
| | | | llvm-svn: 58782
* Remove debug output that's not really useful.Evan Cheng2008-11-051-13/+0
| | | | llvm-svn: 58778
* Rename isGVLazyPtr to isGVNonLazyPtr relocation. This represents Mac OS XEvan Cheng2008-11-051-22/+22
| | | | | | indirect gv reference. Please don't call it lazy. llvm-svn: 58746
* Silence a compiler warning.Evan Cheng2008-11-031-1/+1
| | | | llvm-svn: 58598
* Revert errant deletion. The target needs to be able to specify that it ↵Jim Grosbach2008-10-301-0/+5
| | | | | | doesn't want the generic constant pool to be emitted. llvm-svn: 58475
* Let target resolve some relocation results.Evan Cheng2008-10-291-30/+23
| | | | llvm-svn: 58407
* Support for constant islands in the ARM JIT.Jim Grosbach2008-10-281-0/+9
| | | | | | | | | | | | | | | | Since the ARM constant pool handling supercedes the standard LLVM constant pool entirely, the JIT emitter does not allocate space for the constants, nor initialize the memory. The constant pool is considered part of the instruction stream. Likewise, when resolving relocations into the constant pool, a hook into the target back end is used to resolve from the constant ID# to the address where the constant is stored. For now, the support in the ARM emitter is limited to 32-bit integer. Future patches will expand this to the full range of constants necessary. llvm-svn: 58338
* fix a tricky bug in the JIT global variable emitter, that was triggered when ↵Nuno Lopes2008-10-211-5/+22
| | | | | | JITing a variable independently of a function. This lead to sharing memory memory between functions and GVs thus changing the value of a GV could change the code in execution. more details on the ML. llvm-svn: 57900
* On Darwin ARM, memory needs special handling to do JIT. This patch expandsJim Grosbach2008-10-031-1/+11
| | | | | | | this handling to work properly for modifying stub functions, relocations back to entry points after JIT compilation, etc.. llvm-svn: 57013
* Switch the MachineOperand accessors back to the short names likeDan Gohman2008-10-031-1/+1
| | | | | | isReg, etc., from isRegister, etc. llvm-svn: 57006
* Acquire the lock only when necessary. More precisely, do not acquireNicolas Geoffray2008-10-031-10/+22
| | | | | | the lock when calling a method which may materialize the llvm::Function. llvm-svn: 56995
* Preliminary support for systems which require changing JIT memory regions ↵Evan Cheng2008-09-181-0/+3
| | | | | | privilege from read / write to read / executable. llvm-svn: 56303
* Make safer variant of alias resolution routine to be defaultAnton Korobeynikov2008-09-091-1/+1
| | | | llvm-svn: 56005
* MMI may be null.Evan Cheng2008-09-021-1/+3
| | | | llvm-svn: 55626
* Get rid of a couple of dynamic_cast.Evan Cheng2008-08-201-4/+10
| | | | llvm-svn: 55022
OpenPOWER on IntegriCloud