summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ExecutionEngine
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* Remove tabs.Bill Wendling2012-07-191-2/+2
| | | | llvm-svn: 160475
* Move lib/Analysis/DebugInfo.cpp to lib/VMCore/DebugInfo.cpp andBill Wendling2012-06-284-5/+5
| | | | | | | | | include/llvm/Analysis/DebugInfo.h to include/llvm/DebugInfo.h. The reasoning is because the DebugInfo module is simply an interface to the debug info MDNodes and has nothing to do with analysis. llvm-svn: 159312
* llvm/lib: [CMake] Add explicit dependency to intrinsics_gen.NAKAMURA Takumi2012-06-241-0/+2
| | | | llvm-svn: 159112
* Optimized usage of new SwitchInst case values (IntegersSubset type) in ↵Stepan Dyatkovskiy2012-06-231-9/+29
| | | | | | | | Local.cpp, Execution.cpp and BitcodeWriter.cpp. I got about 1% of compile-time improvement on my machines (Ubuntu 11.10 i386 and Ubuntu 12.04 x64). llvm-svn: 159076
* Disable the right instance of TheJIT, this one is only used in asserts.Benjamin Kramer2012-06-161-8/+8
| | | | llvm-svn: 158610
* Guard private fields that are unused in Release builds with #ifndef NDEBUG.Benjamin Kramer2012-06-161-1/+6
| | | | llvm-svn: 158608
* Round 2 of dead private variable removal.Benjamin Kramer2012-06-062-8/+4
| | | | | | | | LLVM is now -Wunused-private-field clean except for - lib/MC/MCDisassembler/Disassembler.h. Not sure why it keeps all those unaccessible fields. - gtest. llvm-svn: 158096
* Fix typos found by http://github.com/lyda/misspell-checkBenjamin Kramer2012-06-021-1/+1
| | | | llvm-svn: 157885
* PR1255: case ranges.Stepan Dyatkovskiy2012-06-021-2/+2
| | | | | | IntRange converted from struct to class. So main change everywhere is replacement of ".Low/High" with ".getLow/getHigh()" llvm-svn: 157884
* PR1255: case ranges.Stepan Dyatkovskiy2012-06-011-2/+2
| | | | | | | | | IntItem cleanup. IntItemBase, IntItemConstantIntImp and IntItem merged into IntItem. All arithmetic operators was propogated from APInt. Also added comparison operators <,>,<=,>=. Currently you will find set of macros that propogates operators from APInt to IntItem in the beginning of IntegerSubset. Note that THESE MACROS WILL REMOVED after all passes will case-ranges compatible. Also note that these macros much smaller pain that something like this: if (V->getValue().ugt(AnotherV->getValue()) { ... } These changes made IntItem full featured integer object. It allows to make IntegerSubset class generic (move out all ConstantInt references inside and add unit-tests) in next commits. llvm-svn: 157810
* ConstantRangesSet renamed to IntegersSubset. CRSBuilder renamed to ↵Stepan Dyatkovskiy2012-05-291-2/+2
| | | | | | IntegersSubsetMapping. llvm-svn: 157612
* PR1255: Case RangesStepan Dyatkovskiy2012-05-281-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | Implemented IntItem - the wrapper around APInt. Why not to use APInt item directly right now? 1. It will very difficult to implement case ranges as series of small patches. We got several large and heavy patches. Each patch will about 90-120 kb. If you replace ConstantInt with APInt in SwitchInst you will need to changes at the same time all Readers,Writers and absolutely all passes that uses SwitchInst. 2. We can implement APInt pool inside and save memory space. E.g. we use several switches that works with 256 bit items (switch on signatures, or strings). We can avoid value duplicates in this case. 3. IntItem can be easyly easily replaced with APInt. 4. Currenly we can interpret IntItem both as ConstantInt and as APInt. It allows to provide SwitchInst methods that works with ConstantInt for non-updated passes. Why I need it right now? Currently I need to update SimplifyCFG pass (EqualityComparisons). I need to work with APInts directly a lot, so peaces of code ConstantInt *V = ...; if (V->getValue().ugt(AnotherV->getValue()) { ... } will look awful. Much more better this way: IntItem V = ConstantIntVal->getValue(); if (AnotherV < V) { } Of course any reviews are welcome. P.S.: I'm also going to rename ConstantRangesSet to IntegersSubset, and CRSBuilder to IntegersSubsetMapping (allows to map individual subsets of integers to the BasicBlocks). Since in future these classes will founded on APInt, it will possible to use them in more generic ways. llvm-svn: 157576
* Make it so that the MArch, MCPU, MAttrs passed to EngineBuilder are actually ↵Owen Anderson2012-05-211-4/+0
| | | | | | | | used. Patch by Jose Fonseca. llvm-svn: 157191
OpenPOWER on IntegriCloud