summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ExecutionEngine
Commit message (Collapse)AuthorAgeFilesLines
...
* Interface changes to allow RuntimeDyld memory managers to set memory ↵Andrew Kaylor2012-11-153-3/+24
| | | | | | permissions after an object has been loaded. llvm-svn: 168114
* Remove DOS line endings.Jakub Staszak2012-11-141-76/+76
| | | | llvm-svn: 167968
* Fix build error from previous commit.Andrew Kaylor2012-11-061-1/+1
| | | | llvm-svn: 167477
* Add interface for object-based JIT events.Andrew Kaylor2012-11-063-0/+53
| | | | | | This patch adds the interface to expose events from MCJIT when an object is emitted or freed and implements the MCJIT functionality to send those events. The IntelJITEventListener implementation is left empty for now. It will be fleshed out in a future patch. llvm-svn: 167475
* Add a method to indicate section address re-assignment is finished.Andrew Kaylor2012-11-053-7/+26
| | | | | | Prior to this patch RuntimeDyld attempted to re-apply relocations every time reassignSectionAddress was called (via MCJIT::mapSectionAddress). In addition to being inefficient and redundant, this led to a problem when a section was temporarily moved too far away from another section with a relative relocation referencing the section being moved. To fix this, I'm adding a new method (finalizeObject) which the client can call to indicate that it is finished rearranging section addresses so the relocations can safely be applied. llvm-svn: 167400
* Change resolveRelocation parameters so the relocations can find placeholder ↵Andrew Kaylor2012-11-026-77/+99
| | | | | | | | values in the original object buffer. Some ELF relocations require adding the a value to the original contents of the object buffer at the specified location. In order to properly handle multiple applications of a relocation, the RuntimeDyld code should be grabbing the original value from the object buffer and writing a new value into the loaded section buffer. This patch changes the parameters passed to resolveRelocations to accommodate this need. llvm-svn: 167304
* Fixed format string to avoid pointer truncation during 64-bit debugging.Andrew Kaylor2012-11-011-2/+2
| | | | llvm-svn: 167247
* Revert the majority of the next patch in the address space series:Chandler Carruth2012-11-014-14/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r165941: Resubmit the changes to llvm core to update the functions to support different pointer sizes on a per address space basis. Despite this commit log, this change primarily changed stuff outside of VMCore, and those changes do not carry any tests for correctness (or even plausibility), and we have consistently found questionable or flat out incorrect cases in these changes. Most of them are probably correct, but we need to devise a system that makes it more clear when we have handled the address space concerns correctly, and ideally each pass that gets updated would receive an accompanying test case that exercises that pass specificaly w.r.t. alternate address spaces. However, from this commit, I have retained the new C API entry points. Those were an orthogonal change that probably should have been split apart, but they seem entirely good. In several places the changes were very obvious cleanups with no actual multiple address space code added; these I have not reverted when I spotted them. In a few other places there were merge conflicts due to a cleaner solution being implemented later, often not using address spaces at all. In those cases, I've preserved the new code which isn't address space dependent. This is part of my ongoing effort to clean out the partial address space code which carries high risk and low test coverage, and not likely to be finished before the 3.2 release looms closer. Duncan and I would both like to see the above issues addressed before we return to these changes. llvm-svn: 167222
* Streamlined memory manager hierarchy for MCJIT and RuntimeDyld.Andrew Kaylor2012-11-014-67/+1
| | | | | | Patch by Ashok Thirumurthi llvm-svn: 167192
* Fix regression in old-style JIT.Eli Friedman2012-10-301-7/+5
| | | | llvm-svn: 167057
* Make use of common-symbol alignment info in ELF loader.Tim Northover2012-10-294-18/+47
| | | | | | Patch by Amara Emerson. llvm-svn: 166919
* PowerPC: Initial support for PowerPC64 MCJITAdhemerval Zanella2012-10-254-7/+348
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds initial support for MCJIT for PPC64-elf-abi. The TOC relocation and ODP handling is implemented. It fixes the following ExecutionEngine testcases: ExecutionEngine/2003-01-04-ArgumentBug.ll ExecutionEngine/2003-01-04-LoopTest.ll ExecutionEngine/2003-01-04-PhiTest.ll ExecutionEngine/2003-01-09-SARTest.ll ExecutionEngine/2003-01-10-FUCOM.ll ExecutionEngine/2003-01-15-AlignmentTest.ll ExecutionEngine/2003-05-11-PHIRegAllocBug.ll ExecutionEngine/2003-06-04-bzip2-bug.ll ExecutionEngine/2003-06-05-PHIBug.ll ExecutionEngine/2003-08-15-AllocaAssertion.ll ExecutionEngine/2003-08-21-EnvironmentTest.ll ExecutionEngine/2003-08-23-RegisterAllocatePhysReg.ll ExecutionEngine/2003-10-18-PHINode-ConstantExpr-CondCode-Failure.ll ExecutionEngine/simplesttest.ll ExecutionEngine/simpletest.ll ExecutionEngine/stubs.ll ExecutionEngine/test-arith.ll ExecutionEngine/test-branch.ll ExecutionEngine/test-call-no-external-funcs.ll ExecutionEngine/test-cast.ll ExecutionEngine/test-common-symbols.ll ExecutionEngine/test-constantexpr.ll ExecutionEngine/test-fp-no-external-funcs.ll ExecutionEngine/test-fp.ll ExecutionEngine/test-global-init-nonzero.ll ExecutionEngine/test-global.ll ExecutionEngine/test-loadstore.ll ExecutionEngine/test-local.ll ExecutionEngine/test-logical.ll ExecutionEngine/test-loop.ll ExecutionEngine/test-phi.ll ExecutionEngine/test-ret.ll ExecutionEngine/test-return.ll ExecutionEngine/test-setcond-fp.ll ExecutionEngine/test-setcond-int.ll ExecutionEngine/test-shift.ll llvm-svn: 166678
* Add some cleanup to the DataLayout changes requested by Chandler.Micah Villmow2012-10-241-5/+6
| | | | llvm-svn: 166607
* Grammar.Eric Christopher2012-10-231-1/+1
| | | | llvm-svn: 166485
* Resubmit the changes to llvm core to update the functions to support ↵Micah Villmow2012-10-154-12/+19
| | | | | | different pointer sizes on a per address space basis. llvm-svn: 165941
* Check section type rather than assuming it's code when emitting sections ↵Andrew Kaylor2012-10-121-1/+7
| | | | | | while processing relocations. llvm-svn: 165854
* Indenting.Eric Christopher2012-10-121-11/+11
| | | | llvm-svn: 165785
* Remove unnecessary classof()'sSean Silva2012-10-111-3/+0
| | | | | | | isa<> et al. automatically infer when the cast is an upcast (including a self-cast), so these are no longer necessary. llvm-svn: 165767
* Remove buggy classof().Sean Silva2012-10-111-11/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This classof() is effectively saying that a MachineCodeEmitter "is-a" JITEmitter, but JITEmitter is in fact a descendant of MachineCodeEmitter, so this is not semantically correct. Consequently, none of the assertions that rely on these classof() actualy check anything. Remove the RTTI (which didn't actually check anything) and use static_cast<> instead. Post-Mortem Bug Analysis ======================== Cause of the bug ---------------- r55022 appears to be the source of the classof() and assertions removed by this commit. It aimed at removing some dynamic_cast<> that were solely in the assertions. A typical diff hunk from that commit looked like: - assert(dynamic_cast<JITEmitter*>(MCE) && "Unexpected MCE?"); - JITEmitter *JE = static_cast<JITEmitter*>(getCodeEmitter()); + assert(isa<JITEmitter>(MCE) && "Unexpected MCE?"); + JITEmitter *JE = cast<JITEmitter>(getCodeEmitter()); Hence, the source of the bug then seems to be an attempt to replace dynamic_cast<> with LLVM-style RTTI without properly setting up the class hierarchy for LLVM-style RTTI. The bug therefore appears to be simply a "thinko". What initially indicated the presence of the bug ------------------------------------------------ After implementing automatic upcasting for isa<>, classof() functions of the form static bool classof(const Foo *) { return true; } were removed, since they only serve the purpose of optimizing statically-OK upcasts. A subsequent recompilation triggered a build failure on the isa<> tests within the removed asserts, since the automatic upcasting (correctly) failed to substitute this classof(). Key to pinning down the root cause of the bug --------------------------------------------- After being alerted to the presence of the bug, some thought about the semantics which were being asserted by the buggy classof() revealed that it was incorrect. How the bug could have been prevented ------------------------------------- This bug could have been prevented by better documentation for how to set up LLVM-style RTTI. This should be solved by the recently added documentation HowToSetUpLLVMStyleRTTI. However, this bug suggests that the documentation should clearly explain the contract that classof() must fulfill. The HowToSetUpLLVMStyleRTTI already explains this contract, but it is a little tucked away. A future patch will expand that explanation and make it more prominent. There does not appear to be a simple way to have the compiler prevent this bug, since fundamentally it boiled down to a spurious classof() where the programmer made an erroneous statement about the conversion. This suggests that perhaps the interface to LLVM-style RTTI of classof() is not the best. There is already some evidence for this, since in a number of places Clang has classof() forward to classofKind(Kind K) which evaluates the cast in terms of just the Kind. This could probably be generalized to simply a `static const Kind MyKind;` field in leaf classes and `static const Kind firstMyKind, lastMyKind;` for non-leaf classes, and have the rest of the work be done inside Casting.h, assuming that the Kind enum is laid out in a preorder traversal of the inheritance tree. llvm-svn: 165764
* Revert 165732 for further review.Micah Villmow2012-10-114-18/+12
| | | | llvm-svn: 165747
* Add in the first iteration of support for llvm/clang/lldb to allow variable ↵Micah Villmow2012-10-114-12/+18
| | | | | | per address space pointer sizes to be optimized correctly. llvm-svn: 165726
* Adding comments to clarify the reason for non-standard style in these files.Andrew Kaylor2012-10-104-8/+30
| | | | | | Patch committed on behalf of Kirill Uhanov llvm-svn: 165589
* Move TargetData to DataLayout.Micah Villmow2012-10-0810-45/+45
| | | | llvm-svn: 165402
* Implement .rel relocation for R_ARM_ABS32 in MCJIT.Tim Northover2012-10-031-2/+10
| | | | | | Patch by Amara Emerson. llvm-svn: 165128
* Clean-up of memory buffer and object ownership model in MCJITAndrew Kaylor2012-10-0211-158/+157
| | | | llvm-svn: 165053
* Support for generating ELF objects on Windows.Andrew Kaylor2012-10-021-1/+8
| | | | | | This adds 'elf' as a recognized target triple environment value and overrides the default generated object format on Windows platforms if that value is present. This patch also enables MCJIT tests on Windows using the new environment value. llvm-svn: 165030
* Removing dependency on third party library for Intel JIT event support.Andrew Kaylor2012-09-288-10/+1350
| | | | | | Patch committed on behalf of Kirill Uhanov llvm-svn: 164831
* Fix of hang during Intel JIT profilingAndrew Kaylor2012-09-261-11/+9
| | | | | | Committed on behalf of Kirill Uhanov llvm-svn: 164736
* Mark unimplemented copy constructors and copy assignment operators as ↵Craig Topper2012-09-181-2/+2
| | | | | | LLVM_DELETED_FUNCTION. llvm-svn: 164090
* Better const handling for RuntimeDyld and MCJIT.Jim Grosbach2012-09-133-4/+5
| | | | | | mapSectionAddress() wasn't consistent. llvm-svn: 163843
* MCJIT: relocation addends encoded in the target aren't quite so easy.Jim Grosbach2012-09-131-1/+6
| | | | | | | | | | The assumption that the target address for the relocation will always be sizeof(intptr_t) and will always contain an addend for the relocation value is very wrong. Default to no addend for now. rdar://12157052 llvm-svn: 163765
* MCJIT: Make sure to mask off non-type-field bits.Jim Grosbach2012-09-131-1/+1
| | | | | | | When comparing to the macho relocation type enum value, make sure we're only comparing against the bits in the RelType that correspond. llvm-svn: 163764
* MCJIT: Pass the i386 MachO relocation type properly.Jim Grosbach2012-09-131-1/+1
| | | | llvm-svn: 163763
* [Object] Extract Elf_Ehdr. Patch by Hemant Kulkarni!Michael J. Spencer2012-09-101-2/+1
| | | | llvm-svn: 163532
* Stop casting away const qualifier needlessly.Roman Divacky2012-09-051-1/+1
| | | | llvm-svn: 163258
* MCJIT: getPointerToFunction() references target address space.Jim Grosbach2012-09-053-2/+27
| | | | | | | Make sure to return a pointer into the target memory, not the local memory. Often they are the same, but we can't assume that. llvm-svn: 163217
* Fix comment for function RuntimeDyldImpl.resolveRelocation()Danil Malyshev2012-08-271-1/+4
| | | | llvm-svn: 162677
* Add a getName function to MachineFunction. Use it in places that previously ↵Craig Topper2012-08-221-2/+2
| | | | | | did getFunction()->getName(). Remove includes of Function.h that are no longer needed. llvm-svn: 162347
* MCJIT: Tidy up the constructor.Jim Grosbach2012-08-213-13/+8
| | | | | | | | | The MCJIT doesn't need or want a TargetJITInfo. That's vestigal from the old JIT, so just remove it. rdar://12119347 llvm-svn: 162280
* Fix coding style violations in 162135 and 162136.Akira Hatanaka2012-08-202-10/+10
| | | | | | Patch by Petar Jovanovic. llvm-svn: 162213
* Correct MCJIT functionality for MIPS32 architecture.Akira Hatanaka2012-08-174-5/+121
| | | | | | | | | | No new tests are added. All tests in ExecutionEngine/MCJIT that have been failing pass after this patch is applied (when "make check" is done on a mips board). Patch by Petar Jovanovic. llvm-svn: 162135
* Fixed a problem in the JIT memory allocator whereSean Callanan2012-08-151-0/+3
| | | | | | | | | | allocations of executable memory would not be padded to account for the size of the allocation header. This resulted in undersized allocations, meaning that when the allocation was written to later the next allocation's header would be corrupted. llvm-svn: 161984
* Enable lazy compilation in MCJITAndrew Kaylor2012-08-072-13/+55
| | | | llvm-svn: 161438
* JIT::runFunction(): add a fast path for functions with a single argument ↵Nuno Lopes2012-08-021-2/+7
| | | | | | that is a pointer. llvm-svn: 161171
* Fixing problems with X86_64_32 relocations and making the assertions more ↵Andrew Kaylor2012-07-271-5/+4
| | | | | | readable. llvm-svn: 160889
* Test commit, clean up commentAndrew Kaylor2012-07-271-1/+1
| | | | llvm-svn: 160880
* Test commit, clean up commentAndrew Kaylor2012-07-271-1/+1
| | | | llvm-svn: 160873
* You cannot call removeModule on a JIT with no modules. Patch by VerenaChad Rosier2012-07-251-1/+1
| | | | | | Beckham <verena@codeplay.com>. Reviewed by Jim Grosbach. llvm-svn: 160753
* Fix a typo (the the => the)Sylvestre Ledru2012-07-231-1/+1
| | | | llvm-svn: 160621
* ExecutionEngine/TargetSelect.cpp: Override default triple as LLVM_HOSTTRIPLE.NAKAMURA Takumi2012-07-221-1/+1
| | | | | | In current implementation, JIT should run only on host. llvm-svn: 160610
OpenPOWER on IntegriCloud