summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ExecutionEngine/JIT
Commit message (Collapse)AuthorAgeFilesLines
...
* Revert the ConstantInt constructors back to their 2.5 forms where possible, ↵Owen Anderson2009-07-241-3/+3
| | | | | | thanks to contexts-on-types. More to come. llvm-svn: 77011
* Re-committing r76828 with the JIT memory manager changes now that the buildReid Kleckner2009-07-232-104/+311
| | | | | | bots like the BumpPtrAllocator changes. llvm-svn: 76902
* Reverting r76825 and r76828, since they caused clang runtime errors and some ↵Reid Kleckner2009-07-232-311/+104
| | | | | | build failure involving memset. llvm-svn: 76838
* Make the JIT code emitter properly retry and ask for more memory when it runsReid Kleckner2009-07-232-104/+311
| | | | | | | | | | | | | out of memory, and also make the default memory manager allocate more memory when it runs out. Also, switch function stubs and global data over to using the BumpPtrAllocator. This makes it so the JIT no longer mmaps (or the equivalent on Windows) 16 MB of memory, and instead allocates in 512K slabs. I suspect this size could go lower, especially on embedded platforms, now that more slabs can be allocated. llvm-svn: 76828
* Get rid of the Pass+Context magic.Owen Anderson2009-07-221-9/+9
| | | | llvm-svn: 76702
* Simplify / normalize some uses of Value::getName.Daniel Dunbar2009-07-212-2/+2
| | | | llvm-svn: 76553
* Add EngineBuilder to ExecutionEngine in favor of the five optional argument ↵Reid Kleckner2009-07-183-30/+42
| | | | | | | | EE::create(). Also a test commit. llvm-svn: 76276
* Add line numbers to OProfile. To do this, I added a processDebugLoc()Jeffrey Yasskin2009-07-162-4/+98
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | call to the MachineCodeEmitter interface and made copying the start line of a function not conditional on whether we're emitting Dwarf debug information. I'll propagate the processDebugLoc() calls to the non-X86 targets in a followup patch. In the long run, it'll probably be better to gather this information through the DwarfWriter, but the DwarfWriter currently depends on the AsmPrinter and TargetAsmInfo, and fixing that would be out of the way for this patch. There's a bug in OProfile 0.9.4 that makes it ignore line numbers for addresses above 4G, and a patch fixing it at http://thread.gmane.org/gmane.linux.oprofile/7634 Sample output: $ sudo opcontrol --reset; sudo opcontrol --start-daemon; sudo opcontrol --start; `pwd`/Debug/bin/lli fib.bc; sudo opcontrol --stop Signalling daemon... done Profiler running. fib(40) == 165580141 Stopping profiling. $ opreport -g -d -l `pwd`/Debug/bin/lli|head -60 Overflow stats not available CPU: Core 2, speed 1998 MHz (estimated) Counted CPU_CLK_UNHALTED events (Clock cycles when not halted) with a unit mask of 0x00 (Unhalted core cycles) count 100000 vma samples % linenr info image name symbol name 00007f67a30370b0 25489 61.2554 fib.c:24 10946.jo fib_left 00007f67a30370b0 1634 6.4106 fib.c:24 00007f67a30370b1 83 0.3256 fib.c:24 00007f67a30370b9 1997 7.8348 fib.c:24 00007f67a30370c6 2080 8.1604 fib.c:27 00007f67a30370c8 988 3.8762 fib.c:27 00007f67a30370cd 1315 5.1591 fib.c:27 00007f67a30370cf 251 0.9847 fib.c:27 00007f67a30370d3 1191 4.6726 fib.c:27 00007f67a30370d6 975 3.8252 fib.c:27 00007f67a30370db 1010 3.9625 fib.c:27 00007f67a30370dd 242 0.9494 fib.c:27 00007f67a30370e1 2782 10.9145 fib.c:28 00007f67a30370e5 3768 14.7828 fib.c:28 00007f67a30370eb 615 2.4128 (no location information) 00007f67a30370f3 6558 25.7287 (no location information) 00007f67a3037100 15603 37.4973 fib.c:29 10946.jo fib_right 00007f67a3037100 1646 10.5493 fib.c:29 00007f67a3037101 45 0.2884 fib.c:29 00007f67a3037109 2372 15.2022 fib.c:29 00007f67a3037116 2234 14.3178 fib.c:32 00007f67a3037118 612 3.9223 fib.c:32 00007f67a303711d 622 3.9864 fib.c:32 00007f67a303711f 385 2.4675 fib.c:32 00007f67a3037123 404 2.5892 fib.c:32 00007f67a3037126 634 4.0633 fib.c:32 00007f67a303712b 870 5.5759 fib.c:32 00007f67a303712d 62 0.3974 fib.c:32 00007f67a3037131 1848 11.8439 fib.c:33 00007f67a3037135 2840 18.2016 fib.c:33 00007f67a303713a 1 0.0064 fib.c:33 00007f67a303713b 1023 6.5564 (no location information) 00007f67a3037143 5 0.0320 (no location information) 000000000080c1e4 15 0.0360 MachineOperand.h:150 lli llvm::MachineOperand::isReg() const 000000000080c1e4 6 40.0000 MachineOperand.h:150 000000000080c1ec 2 13.3333 MachineOperand.h:150 ... llvm-svn: 76102
* Remove unused header.Daniel Dunbar2009-07-161-1/+1
| | | | llvm-svn: 75893
* Switch llc and createJIT to use simpler command line parsing for -march.Daniel Dunbar2009-07-161-9/+22
| | | | llvm-svn: 75890
* Reapply TargetRegistry refactoring commits.Daniel Dunbar2009-07-151-9/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | --- Reverse-merging r75799 into '.': U test/Analysis/PointerTracking U include/llvm/Target/TargetMachineRegistry.h U include/llvm/Target/TargetMachine.h U include/llvm/Target/TargetRegistry.h U include/llvm/Target/TargetSelect.h U tools/lto/LTOCodeGenerator.cpp U tools/lto/LTOModule.cpp U tools/llc/llc.cpp U lib/Target/PowerPC/PPCTargetMachine.h U lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp U lib/Target/PowerPC/PPCTargetMachine.cpp U lib/Target/PowerPC/PPC.h U lib/Target/ARM/ARMTargetMachine.cpp U lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp U lib/Target/ARM/ARMTargetMachine.h U lib/Target/ARM/ARM.h U lib/Target/XCore/XCoreTargetMachine.cpp U lib/Target/XCore/XCoreTargetMachine.h U lib/Target/PIC16/PIC16TargetMachine.cpp U lib/Target/PIC16/PIC16TargetMachine.h U lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp U lib/Target/Alpha/AlphaTargetMachine.cpp U lib/Target/Alpha/AlphaTargetMachine.h U lib/Target/X86/X86TargetMachine.h U lib/Target/X86/X86.h U lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.h U lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp U lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.h U lib/Target/X86/X86TargetMachine.cpp U lib/Target/MSP430/MSP430TargetMachine.cpp U lib/Target/MSP430/MSP430TargetMachine.h U lib/Target/CppBackend/CPPTargetMachine.h U lib/Target/CppBackend/CPPBackend.cpp U lib/Target/CBackend/CTargetMachine.h U lib/Target/CBackend/CBackend.cpp U lib/Target/TargetMachine.cpp U lib/Target/IA64/IA64TargetMachine.cpp U lib/Target/IA64/AsmPrinter/IA64AsmPrinter.cpp U lib/Target/IA64/IA64TargetMachine.h U lib/Target/IA64/IA64.h U lib/Target/MSIL/MSILWriter.cpp U lib/Target/CellSPU/SPUTargetMachine.h U lib/Target/CellSPU/SPU.h U lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp U lib/Target/CellSPU/SPUTargetMachine.cpp U lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp U lib/Target/Mips/MipsTargetMachine.cpp U lib/Target/Mips/MipsTargetMachine.h U lib/Target/Mips/Mips.h U lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp U lib/Target/Sparc/SparcTargetMachine.cpp U lib/Target/Sparc/SparcTargetMachine.h U lib/ExecutionEngine/JIT/TargetSelect.cpp U lib/Support/TargetRegistry.cpp llvm-svn: 75820
* Revert 75762, 75763, 75766..75769, 75772..75775, 75778, 75780, 75782 to ↵Stuart Hastings2009-07-151-7/+6
| | | | | | | | repair broken LLVM-GCC build. Will revert 75770 in the llvm-gcc trunk. llvm-svn: 75799
* Migrate llc and the JIT to using the TargetRegistry for lookups.Daniel Dunbar2009-07-151-6/+7
| | | | | | | | | | | | - They still use the TargetMachineRegistry to populate the contents of the -march option (via the listener interface). We can't just populate it in the option parser because we can't expect the TargetRegistry to be populated yet (we no longer rely on static constructors). - There are a couple ways to finish killing off TargetMachineRegistry, but I haven't figured out the cleanest one yet... llvm-svn: 75773
* Move EVER MORE stuff over to LLVMContext.Owen Anderson2009-07-141-8/+10
| | | | llvm-svn: 75703
* llvm_unreachable->llvm_unreachable(0), LLVM_UNREACHABLE->llvm_unreachable.Torok Edwin2009-07-142-8/+8
| | | | | | | | | 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
* Match declaration to definition.Daniel Dunbar2009-07-121-1/+1
| | | | llvm-svn: 75440
* assert(0) -> LLVM_UNREACHABLE.Torok Edwin2009-07-112-8/+9
| | | | | | | | | 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
* Convert more assert(0)+abort() -> LLVM_UNREACHABLE,Torok Edwin2009-07-114-36/+27
| | | | | | and abort()/exit() -> llvm_report_error(). llvm-svn: 75363
* 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
* Add an option to allocate JITed global data separately from code. ByJeffrey Yasskin2009-07-085-61/+126
| | | | | | | | | | | | | | 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
* Introduce new error handling API.Torok Edwin2009-07-071-3/+3
| | | | | | | | 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
* 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-241-3/+1
| | | | | | | | 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-231-1/+1
| | | | | | | cleans up the CMake-based build system a bit. Started by a patch from Xerxes Rånby. llvm-svn: 73969
* 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-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-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-092-5/+5
| | | | | | | 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
* Instead of passing in an unsigned value for the optimization level, use an enum,Bill Wendling2009-04-293-9/+12
| | | | | | | 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-293-13/+13
| | | | | | | 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
* Use CHAR_BIT instead of hard-coding 8 in several places where itDan Gohman2009-04-011-1/+2
| | | | | | | is appropriate. This helps visually differentiate host-oriented calculations from target-oriented calculations. llvm-svn: 68227
* 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
OpenPOWER on IntegriCloud