summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ExecutionEngine
Commit message (Collapse)AuthorAgeFilesLines
...
* Oops. s/#if defined(USE_OPROFILE)/#if USE_OPROFILE/. We #defineJeffrey Yasskin2009-07-101-3/+3
| | | | | | | USE_OPROFILE to 0 on some paths through configure, which does the wrong thing with #if defined(). llvm-svn: 75300
* Add a --with-oprofile flag to configure, which uses OProfile's agentJeffrey Yasskin2009-07-102-0/+110
| | | | | | | | | | | | | | | | | | library to tell it the addresses of JITted functions. For a particular program, this changes the opreport -l output from: samples % image name symbol name 48182 98.9729 anon (tgid:19412 range:0x7f12ccaab000-0x7f12cdaab000) anon (tgid:19412 range:0x7f12ccaab000-0x7f12cdaab000) 11 0.0226 libstdc++.so.6.0.9 /usr/lib/libstdc++.so.6.0.9 to: samples % image name symbol name 24565 60.7308 19814.jo fib_left 15365 37.9861 19814.jo fib_right 22 0.0544 ld-2.7.so do_lookup_x llvm-svn: 75279
* remove dead function.Chris Lattner2009-07-091-9/+0
| | | | llvm-svn: 75143
* Add an option to allocate JITed global data separately from code. ByJeffrey Yasskin2009-07-088-67/+134
| | | | | | | | | | | | | | 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! llvm-svn: 75059
* Have scoped mutexes take referenes instead of pointers.Owen Anderson2009-07-071-2/+2
| | | | llvm-svn: 74931
* Introduce new error handling API.Torok Edwin2009-07-072-7/+7
| | | | | | | | This will replace exit()/abort() style error handling with an API that allows clients to register custom error handling hooks. The default is to call exit(1) when no error handler is provided. llvm-svn: 74922
* improve the APIs for creating struct and function types with no ↵Chris Lattner2009-07-011-1/+1
| | | | | | | | arguments/elements to not have to create a temporary vector (in the API at least). Patch by Jay Foad! llvm-svn: 74584
* Get rid of unnecessary global variables.Owen Anderson2009-06-262-7/+2
| | | | llvm-svn: 74291
* add file to cmakeChris Lattner2009-06-251-0/+1
| | | | llvm-svn: 74159
* Add a JITEventListener interface that gets called back when a new function isJeffrey Yasskin2009-06-254-163/+248
| | | | | | | | | 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
* Fix the Ocaml bindings for the ExecutionEngine: with the change to buildBob Wilson2009-06-242-7/+2
| | | | | | | | libraries instead of relinked objects, the interpreter, JIT, and native target libraries were not being linked in to an ocaml program using the ExecutionEngine. llvm-svn: 74117
* Eliminate object-relinking support from CMake. Fixes PR 4429 andDouglas Gregor2009-06-233-3/+3
| | | | | | | cleans up the CMake-based build system a bit. Started by a patch from Xerxes Rånby. llvm-svn: 73969
* Add locking around the external function lookup table for the interpreter.Owen Anderson2009-06-221-1/+12
| | | | llvm-svn: 73912
* Fix the EE bindings to use the proper EE interfaces for creating a JIT.Chris Lattner2009-06-161-1/+1
| | | | | | Calling into createJIT directly creates a circular dependency between libjit and lib ee. llvm-svn: 73567
* After obtaining the lock, look if the function has been codegen'd byNicolas Geoffray2009-06-121-0/+5
| | | | | | another thread. llvm-svn: 73227
* Split the Add, Sub, and Mul instruction opcodes into separateDan Gohman2009-06-043-39/+41
| | | | | | | | | | | | | | | 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-042-35/+33
| | | | llvm-svn: 72821
* Revert 72650Bruno Cardoso Lopes2009-06-032-33/+35
| | | | llvm-svn: 72783
* Fix new CodeEmitter stuff to follow LLVM codying style. Patch by Aaron GrayBruno Cardoso Lopes2009-06-011-1/+1
| | | | llvm-svn: 72697
* Use uint8_t and int32_t in {JIT,Machine}CodeEmitersBruno Cardoso Lopes2009-05-302-35/+33
| | | | llvm-svn: 72650
* First patch in the direction of splitting MachineCodeEmitter in two subclasses:Bruno Cardoso Lopes2009-05-305-121/+121
| | | | | | JITCodeEmitter and ObjectCodeEmitter. No functional changes yet. Patch by Aaron Gray llvm-svn: 72631
* stat64/open64/lseek64 for the interpreterTorok Edwin2009-05-231-1/+4
| | | | llvm-svn: 72329
* Allow the JIT ExecutionEngine to report details about the generated machine ↵Argyrios Kyrtzidis2009-05-183-6/+38
| | | | | | | | | | 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-094-12/+12
| | | | | | | 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
* Fix the JIT bindings for ocaml.Bill Wendling2009-04-301-3/+4
| | | | llvm-svn: 70454
* Instead of passing in an unsigned value for the optimization level, use an enum,Bill Wendling2009-04-297-13/+16
| | | | | | | which better identifies what the optimization is doing. And is more flexible for future uses. llvm-svn: 70440
* The second part of the change from -fast to -O#. This changes the JIT to acceptBill Wendling2009-04-297-20/+20
| | | | | | | an optimization level instead of a simple boolean telling it to generate code "fast" or the other type of "fast". llvm-svn: 70347
* 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
* make sure to unlock keymgr if the JIT is created and destroyed, allChris Lattner2009-04-161-5/+3
| | | | | | | | locks must be matched with unlocks. Also, use calloc to allocate the block so that it is properly zero'd. Thanks to Nick Kledzik for tracking this down. llvm-svn: 69314
* Mac OS X 10.6 and above do not use key manager to register EH frames.Evan Cheng2009-04-141-2/+8
| | | | llvm-svn: 69090
* Link against libffi if available, fall back to "no external calls fromNick Lewycky2009-04-131-8/+8
| | | | | | interpreter mode" when it's not. llvm-svn: 68937
* Use CHAR_BIT instead of hard-coding 8 in several places where itDan Gohman2009-04-012-3/+4
| | | | | | | is appropriate. This helps visually differentiate host-oriented calculations from target-oriented calculations. llvm-svn: 68227
* fix one more fp80 case (used only by Interpreter)Dale Johannesen2009-03-241-21/+5
| | | | | | and streamline code here a bit. llvm-svn: 67636
* Change JIT for different layout of fp80.Dale Johannesen2009-03-241-5/+5
| | | | llvm-svn: 67629
* 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
* Fix PR3724 by searching for the largest free block when Chris Lattner2009-03-091-2/+19
| | | | | | | | | allocating memory in the JIT. This is insanely inefficient, but hey, most people implement their own memory managers anyway. Patch by Eric Yew! llvm-svn: 66472
* Introduce new linkage types linkonce_odr, weak_odr, common_odrDuncan Sands2009-03-071-2/+2
| | | | | | | | | | | | | | | | | | | | | and extern_weak_odr. These are the same as the non-odr versions, except that they indicate that the global will only be overridden by an *equivalent* global. In C, a function with weak linkage can be overridden by a function which behaves completely differently. This means that IP passes have to skip weak functions, since any deductions made from the function definition might be wrong, since the definition could be replaced by something completely different at link time. This is not allowed in C++, thanks to the ODR (One-Definition-Rule): if a function is replaced by another at link-time, then the new function must be the same as the original function. If a language knows that a function or other global can only be overridden by an equivalent global, it can give it the weak_odr linkage type, and the optimizers will understand that it is alright to make deductions based on the function body. The code generators on the other hand map weak and weak_odr linkage to the same thing. llvm-svn: 66339
* Finish cross-process JIT work, and clean up previous work.Nate Begeman2009-03-072-30/+40
| | | | | | | | | | | | | | | | 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-042-6/+16
| | | | | | | | | 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
* don't #include a header into the middle of an anon namespace.Chris Lattner2009-03-031-7/+5
| | | | llvm-svn: 65967
* Fix the calculation for how big the allocated stub needs to be.Nate Begeman2009-03-021-1/+1
| | | | llvm-svn: 65895
* Fix the logic in this assertion to properly validate the numberDan Gohman2009-02-191-2/+3
| | | | | | of arguments. llvm-svn: 64999
* Reapply r57340. VMKit does not presently rely on materializeFunctionDan Gohman2009-02-191-2/+2
| | | | | | | being called with the lock released, and this fixes a race condition in the JIT as used by lli. llvm-svn: 64997
* Add support to the JIT for true non-lazy operation. When a call to a functionNate Begeman2009-02-185-40/+225
| | | | | | | | | | | | | | | | | | | | 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
* On 64bit we may have a personality function which requires 64 bits toNicolas Geoffray2009-02-151-7/+13
| | | | | | be encoded. llvm-svn: 64600
OpenPOWER on IntegriCloud