1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 19:42:54 +02:00
Commit Graph

1268 Commits

Author SHA1 Message Date
Jim Grosbach
137b521254 MCJIT: Tidy up the constructor.
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
2012-08-21 15:42:49 +00:00
Akira Hatanaka
b64681df6d Fix coding style violations in 162135 and 162136.
Patch by Petar Jovanovic.

llvm-svn: 162213
2012-08-20 17:53:24 +00:00
Akira Hatanaka
a50e7bd0a6 Correct MCJIT functionality for MIPS32 architecture.
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
2012-08-17 21:28:04 +00:00
Sean Callanan
de18bba4c8 Fixed a problem in the JIT memory allocator where
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
2012-08-15 20:53:52 +00:00
Andrew Kaylor
adda20daff Enable lazy compilation in MCJIT
llvm-svn: 161438
2012-08-07 18:33:00 +00:00
Nuno Lopes
a101ed3bc8 JIT::runFunction(): add a fast path for functions with a single argument that is a pointer.
llvm-svn: 161171
2012-08-02 12:09:32 +00:00
Andrew Kaylor
06f27a2297 Fixing problems with X86_64_32 relocations and making the assertions more readable.
llvm-svn: 160889
2012-07-27 20:30:12 +00:00
Andrew Kaylor
b417406b7b Test commit, clean up comment
llvm-svn: 160880
2012-07-27 18:39:47 +00:00
Andrew Kaylor
4ef7c7305d Test commit, clean up comment
llvm-svn: 160873
2012-07-27 17:52:42 +00:00
Chad Rosier
588e6e09d2 You cannot call removeModule on a JIT with no modules. Patch by Verena
Beckham <verena@codeplay.com>.  Reviewed by Jim Grosbach.

llvm-svn: 160753
2012-07-25 19:06:29 +00:00
Sylvestre Ledru
bf8acb65ac Fix a typo (the the => the)
llvm-svn: 160621
2012-07-23 08:51:15 +00:00
NAKAMURA Takumi
d1e66968e3 ExecutionEngine/TargetSelect.cpp: Override default triple as LLVM_HOSTTRIPLE.
In current implementation, JIT should run only on host.

llvm-svn: 160610
2012-07-22 03:04:57 +00:00
Bill Wendling
343eebdbe4 Remove tabs.
llvm-svn: 160475
2012-07-19 00:04:14 +00:00
Bill Wendling
e8949ecfa6 Move lib/Analysis/DebugInfo.cpp to lib/VMCore/DebugInfo.cpp and
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
2012-06-28 00:05:13 +00:00
NAKAMURA Takumi
4599dee67a llvm/lib: [CMake] Add explicit dependency to intrinsics_gen.
llvm-svn: 159112
2012-06-24 13:32:01 +00:00
Stepan Dyatkovskiy
bc2affc34a Optimized usage of new SwitchInst case values (IntegersSubset type) in 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
2012-06-23 10:58:58 +00:00
Benjamin Kramer
6da242cf71 Disable the right instance of TheJIT, this one is only used in asserts.
llvm-svn: 158610
2012-06-16 21:55:52 +00:00
Benjamin Kramer
cd70a90dd5 Guard private fields that are unused in Release builds with #ifndef NDEBUG.
llvm-svn: 158608
2012-06-16 21:48:13 +00:00
Benjamin Kramer
58b98297ac Round 2 of dead private variable removal.
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
2012-06-06 19:47:08 +00:00
Benjamin Kramer
bb30e1face Fix typos found by http://github.com/lyda/misspell-check
llvm-svn: 157885
2012-06-02 10:20:22 +00:00
Stepan Dyatkovskiy
4246540c22 PR1255: case ranges.
IntRange converted from struct to class. So main change everywhere is replacement of ".Low/High" with ".getLow/getHigh()"

llvm-svn: 157884
2012-06-02 09:42:43 +00:00
Stepan Dyatkovskiy
4f89bda8fb PR1255: case ranges.
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
2012-06-01 10:06:14 +00:00
Stepan Dyatkovskiy
23fa9fd605 ConstantRangesSet renamed to IntegersSubset. CRSBuilder renamed to IntegersSubsetMapping.
llvm-svn: 157612
2012-05-29 12:26:47 +00:00
Stepan Dyatkovskiy
d534e24968 PR1255: Case Ranges
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
2012-05-28 12:39:09 +00:00
Owen Anderson
6187e32939 Make it so that the MArch, MCPU, MAttrs passed to EngineBuilder are actually used.
Patch by Jose Fonseca.

llvm-svn: 157191
2012-05-21 16:57:17 +00:00
Stepan Dyatkovskiy
98d41ce6af PR1255 (case ranges: work with ConstantRangesSet instead of ConstantInt) related changes for Execution and Verifier.
llvm-svn: 157183
2012-05-21 10:44:40 +00:00
Danil Malyshev
6fbce86b24 Added LLIMCJITMemoryManager to the lli. This manager will be used for MCJIT instead of DefaultJIMMemoryManager.
It's more flexible for MCJIT tasks, in addition it's provides a invalidation instruction cache for code sections which will be used before JIT code will be executed.

llvm-svn: 156933
2012-05-16 18:50:11 +00:00
Jim Grosbach
29d464dff0 ExecutionEngine: Check for NULL ErrorStr before using it.
Patch by Yury Mikhaylov <yury.mikhaylov@gmail.com>.

llvm-svn: 156523
2012-05-10 00:31:50 +00:00
Preston Gurd
cd8273f842 Make IntelJITEvents and OProfileJIT as optional libraries and add
optional library support to the llvm-build tool:
 - Add new command line parameter to llvm-build: “--enable-optional-libraries”
 - Add handing of new llvm-build library type “OptionalLibrary”
 - Update Cmake and automake build systems to pass correct flags to llvm-build
   based on configuration

Patch by Dan Malea!

llvm-svn: 156319
2012-05-07 19:38:40 +00:00
Eli Bendersky
d4602dc254 RuntimeDyld cleanup:
- Improved parameter names for clarity
- Added comments
- emitCommonSymbols should return void because its return value is not being
  used anywhere
- Attempt to reduce the usage of the RelocationValueRef type. Restricts it 
  for a single goal and may serve as a step for eventual removal.

llvm-svn: 155908
2012-05-01 10:41:12 +00:00
Eli Bendersky
1ff96f5ca9 RuntimeDyld code cleanup:
- There's no point having a different type for the local and global symbol
  tables.
- Renamed SymbolTable to GlobalSymbolTable to clarify the intention
- Improved const correctness where relevant

llvm-svn: 155898
2012-05-01 06:58:59 +00:00
Eli Bendersky
801d9e8ff6 It doesn't make sense to move symbol relocations to section relocations when
relocations are resolved.  It's much more reasonable to do this decision when
relocations are just being added - we have all the information at that point.

Also a bit of renaming and extra comments to clarify extensions.

llvm-svn: 155819
2012-04-30 12:15:58 +00:00
Eli Bendersky
c20521ffc1 Code cleanup in RuntimeDyld:
- Add comments
- Change field names to be more reasonable
- Fix indentation and naming to conform to coding conventions
- Remove unnecessary includes / replace them by forward declatations

llvm-svn: 155815
2012-04-30 10:06:27 +00:00
Eli Bendersky
69e2bfda68 Fix some formatting, grammar and style issues and add a couple of missing comments.
llvm-svn: 155793
2012-04-29 12:40:47 +00:00
Danil Malyshev
8b77bb6238 Fix incorrect call of resolveRelocation() for ARM ELF stub relocations.
llvm-svn: 154948
2012-04-17 20:10:16 +00:00
Preston Gurd
0a341aa416 Add files which were not included by commit 154868.
llvm-svn: 154872
2012-04-16 22:26:48 +00:00
Preston Gurd
e52a5ca15b Implement GDB integration for source level debugging of code JITed using
the MCJIT execution engine.

The GDB JIT debugging integration support works by registering a loaded
object image with a pre-defined function that GDB will monitor if GDB
is attached. GDB integration support is implemented for ELF only at this
time. This integration requires GDB version 7.0 or newer.

Patch by Andy Kaylor!

 

llvm-svn: 154868
2012-04-16 22:12:58 +00:00
Preston Gurd
6e9bcca355 This patch improves the MCJIT runtime dynamic loader by adding new handling
of zero-initialized sections, virtual sections and common symbols
and preventing the loading of sections which are not required for
execution such as debug information.

Patch by Andy Kaylor!

llvm-svn: 154610
2012-04-12 20:13:57 +00:00
Benjamin Kramer
2f6ec0fcc0 EngineBuilder::create is expected to take ownership of the TargetMachine passed to it. Delete it on error or when we create an interpreter that doesn't need it.
llvm-svn: 154288
2012-04-08 14:53:14 +00:00
Eli Bendersky
f79279db2f Removing a file that's no longer being used after the recent refactorings
llvm-svn: 153825
2012-04-01 06:50:01 +00:00
Danil Malyshev
df8df843d9 Re-factored RuntimeDyLd:
1. The main works will made in the RuntimeDyLdImpl with uses the ObjectFile class. RuntimeDyLdMachO and RuntimeDyLdELF now only parses relocations and resolve it. This is allows to make improvements of the RuntimeDyLd more easily. In addition the support for COFF can be easily added.

2. Added ARM relocations to RuntimeDyLdELF.

3. Added support for stub functions for the ARM, allowing to do a long branch.

4. Added support for external functions that are not loaded from the object files, but can be loaded from external libraries. Now MCJIT can correctly execute the code containing the printf, putc, and etc.

5. The sections emitted instead functions, thanks Jim Grosbach. MemoryManager.startFunctionBody() and MemoryManager.endFunctionBody() have been removed.
6. MCJITMemoryManager.allocateDataSection() and MCJITMemoryManager. allocateCodeSection() used JMM->allocateSpace() instead of JMM->allocateCodeSection() and JMM->allocateDataSection(), because I got an error: "Cannot allocate an allocated block!" with object file contains more than one code or data sections.

llvm-svn: 153754
2012-03-30 16:45:19 +00:00
Bill Wendling
86e08bb6de Revert r153694. It was causing failures in the buildbots.
llvm-svn: 153701
2012-03-29 23:23:59 +00:00
Danil Malyshev
d66f6a3b28 Re-factored RuntimeDyld.
Added ExecutionEngine/MCJIT tests.

llvm-svn: 153694
2012-03-29 21:46:18 +00:00
Danil Malyshev
aba46febe1 Move getPointerToNamedFunction() from JIT/MCJIT to JITMemoryManager.
llvm-svn: 153607
2012-03-28 21:46:36 +00:00
Sean Callanan
f9dbc34a73 Made RuntimeDyldMachO support vanilla i386
relocations.  The algorithm is the same as
that for x86_64.  Scattered relocations, a
feature present in i386 but not on x86_64,
are not yet supported.

llvm-svn: 153466
2012-03-26 20:45:52 +00:00
Owen Anderson
7da86bf59f Make it feasible for clients using EngineBuilder to capture the TargetMachine that is created as part of selecting the appropriate target.
This is necessary if the client wants to be able to mutate TargetOptions (for example, fast FP math mode) after the initial creation of the ExecutionEngine.

llvm-svn: 153342
2012-03-23 17:40:56 +00:00
Chandler Carruth
8243f2a6d4 Revert a series of commits to MCJIT to get the build working in CMake
(and hopefully on Windows). The bots have been down most of the day
because of this, and it's not clear to me what all will be required to
fix it.

The commits started with r153205, then r153207, r153208, and r153221.
The first commit seems to be the real culprit, but I couldn't revert
a smaller number of patches.

When resubmitting, r153207 and r153208 should be folded into r153205,
they were simple build fixes.

llvm-svn: 153241
2012-03-22 05:44:06 +00:00
Danil Malyshev
88676c0b84 Re-factored RuntimeDyld.
Added ExecutionEngine/MCJIT tests.

llvm-svn: 153221
2012-03-21 21:06:29 +00:00
Danil Malyshev
ed57f105a2 (no commit message)
llvm-svn: 153208
2012-03-21 19:13:08 +00:00
Danil Malyshev
f6bfe93d8f Based on this discussion: http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20120305/138477.html
1. Declare a virtual function getPointerToNamedFunction() in JITMemoryManager
2. Move the implementation of getPointerToNamedFunction() form JIT/MCJIT to DefaultJITMemoryManager.

llvm-svn: 153205
2012-03-21 18:26:47 +00:00