1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 03:23:01 +02:00
Commit Graph

1017 Commits

Author SHA1 Message Date
Jeffrey Yasskin
1604115c5a Move --march, --mcpu, and --mattr from JIT/TargetSelect.cpp to lli.cpp.
llc.cpp also defined these flags, meaning that when I linked all of LLVM's
libraries into a single shared library, llc crashed on startup with duplicate
flag definitions.  This patch passes them through the EngineBuilder into
JIT::selectTarget().

llvm-svn: 95390
2010-02-05 16:19:36 +00:00
Jeffrey Yasskin
92abe5abcc r94686 changed all ModuleProvider parameters to Modules, which made the
1-argument ExecutionEngine::create(Module*) ambiguous with the signature that
used to be ExecutionEngine::create(ModuleProvider*, defaulted_params).  Fixed
by removing the 1-argument create().  Fixes PR6221.

llvm-svn: 95236
2010-02-03 19:18:04 +00:00
Benjamin Kramer
3b01285b76 Replace strcpy with memcpy when we have the length around anyway.
llvm-svn: 94746
2010-01-28 18:04:38 +00:00
Jeffrey Yasskin
fb10587e50 Kill ModuleProvider and ghost linkage by inverting the relationship between
Modules and ModuleProviders. Because the "ModuleProvider" simply materializes
GlobalValues now, and doesn't provide modules, it's renamed to
"GVMaterializer". Code that used to need a ModuleProvider to materialize
Functions can now materialize the Functions directly. Functions no longer use a
magic linkage to record that they're materializable; they simply ask the
GVMaterializer.

Because the C ABI must never change, we can't remove LLVMModuleProviderRef or
the functions that refer to it. Instead, because Module now exposes the same
functionality ModuleProvider used to, we store a Module* in any
LLVMModuleProviderRef and translate in the wrapper methods.  The bindings to
other languages still use the ModuleProvider concept.  It would probably be
worth some time to update them to follow the C++ more closely, but I don't
intend to do it.

Fixes http://llvm.org/PR5737 and http://llvm.org/PR5735.

llvm-svn: 94686
2010-01-27 20:34:15 +00:00
Chris Lattner
5ee5b62838 Add support for target-specific 32-bit custom-lowered
jump table entries.

llvm-svn: 94505
2010-01-26 04:05:28 +00:00
Chris Lattner
643adc5090 make jit jump table emission be based on the EntryKind instead of magic variables.
JITInfo::getPICJumpTableEntry can probably be removed now, but I don't plan to do 
this.

llvm-svn: 94501
2010-01-26 03:47:15 +00:00
Chris Lattner
efdc572e44 Rearrange handling of jump tables. Highlights:
1. MachineJumpTableInfo is now created lazily for a function the first time
   it actually makes a jump table instead of for every function.
2. The encoding of jump table entries is now described by the
   MachineJumpTableInfo::JTEntryKind enum.  This enum is determined by the
   TLI::getJumpTableEncoding() hook, instead of by lots of code scattered
   throughout the compiler that "knows" that jump table entries are always
   32-bits in pic mode (for example).
3. The size and alignment of jump table entries is now calculated based on
   their kind, instead of at machinefunction creation time.

Future work includes using the EntryKind in more places in the compiler,
eliminating other logic that "knows" the layout of jump tables in various
situations.

llvm-svn: 94470
2010-01-25 23:26:13 +00:00
Chris Lattner
5a57121631 make -fno-rtti the default unless a directory builds with REQUIRES_RTTI.
llvm-svn: 94378
2010-01-24 20:43:08 +00:00
Jeffrey Yasskin
c200d5e99f Make OProfile support compile again after r93630 removed
DebugLocTuple.  Also use an AssertingVH to ensure that MDNodes aren't
destroyed while the FilenameCache is using them.

llvm-svn: 94245
2010-01-22 23:04:39 +00:00
Chris Lattner
276811b58a Stop building RTTI information for *most* llvm libraries. Notable
missing ones are libsupport, libsystem and libvmcore.  libvmcore is
currently blocked on bugpoint, which uses EH.  Once it stops using
EH, we can switch it off.

This #if 0's out 3 unit tests, because gtest requires RTTI information.
Suggestions welcome on how to fix this.

llvm-svn: 94164
2010-01-22 06:49:46 +00:00
Devang Patel
bb63f9dd91 Avoid including DebugInfo.h in AsmPrinter.h
llvm-svn: 93864
2010-01-19 06:09:04 +00:00
Devang Patel
3bbca51dcd Replace DebugLocTuple with DILocation.
llvm-svn: 93630
2010-01-16 06:09:35 +00:00
Jay Foad
2277dd737c Fix http://llvm.org/PR6028, an assertion failure when an UndefValue of
integer type is used.

llvm-svn: 93509
2010-01-15 08:32:58 +00:00
Chris Lattner
953394de82 "In order to ease automatic bindings generation, it would be helpful if boolean values were distinguishable from integers. The attached patch introduces "typedef int LLVMBool;", and uses LLVMBool instead of int throughout the C API, wherever a boolean value is called for."
Patch by James Y Knight!

llvm-svn: 93079
2010-01-09 22:27:07 +00:00
Benjamin Kramer
0ba7479f2c Move remaining stuff to the isInteger predicate.
llvm-svn: 92771
2010-01-05 21:05:54 +00:00
Benjamin Kramer
c233521d45 Convert a ton of simple integer type equality tests to the new predicate.
llvm-svn: 92760
2010-01-05 20:07:06 +00:00
Benjamin Kramer
e90a3c66c4 Avoid going through the LLVMContext for type equality where it's safe to dereference the type pointer.
llvm-svn: 92726
2010-01-05 13:12:22 +00:00
David Greene
28c02548d3 These should probably be errs().
llvm-svn: 92673
2010-01-05 01:53:59 +00:00
David Greene
b4740e7802 Change errs() to dbgs().
llvm-svn: 92621
2010-01-05 01:27:39 +00:00
David Greene
7da633ede5 Change errs() to dbgs().
llvm-svn: 92618
2010-01-05 01:27:26 +00:00
David Greene
e874c127bd Change errs() to dbgs().
llvm-svn: 92616
2010-01-05 01:27:23 +00:00
David Greene
d72cbd94d9 Change errs() to dbgs().
llvm-svn: 92562
2010-01-05 01:23:38 +00:00
David Greene
f091f28719 Change errs() to dbgs().
llvm-svn: 92561
2010-01-05 01:23:36 +00:00
David Greene
c6bb507854 Change errs() to dbgs().
llvm-svn: 92560
2010-01-05 01:23:34 +00:00
Bill Wendling
32467ad0f7 Remove dead store and simplify code.
llvm-svn: 92191
2009-12-28 01:53:00 +00:00
Jeffrey Yasskin
0c46d96fd0 Partially revert r91626. Materializing extra functions to determine whether
they're available_externally broke VMKit, which was relying on the fact that
functions would only be materialized when they were first called.  We'll have
to wait for http://llvm.org/PR5737 to really fix this.

I also added a test for one of the F->isDeclaration() calls which wasn't
covered by anything else in the test suite.

llvm-svn: 91943
2009-12-22 23:47:23 +00:00
Jeffrey Yasskin
412172866e Fix a crash in JIT::recompileAndRelinkFunction(). It doesn't pass the MCI
argument to runJITOnFunction(), which caused a null pointer dereference at
every call.

Patch by Gianluca Guida!

llvm-svn: 91939
2009-12-22 23:18:18 +00:00
Jeffrey Yasskin
f4d06414ec Don't codegen available_externally functions. Fixes http://llvm.org/PR5735.
llvm-svn: 91626
2009-12-17 21:35:29 +00:00
Jeffrey Yasskin
d50951dc1e Change indirect-globals to use a dedicated allocIndirectGV. This lets us
remove start/finishGVStub and the BufferState helper class from the
MachineCodeEmitter interface.  It has the side-effect of not setting the
indirect global writable and then executable on ARM, but that shouldn't be
necessary.

llvm-svn: 91464
2009-12-15 22:42:46 +00:00
Chris Lattner
587962c667 Remove isPod() from DenseMapInfo, splitting it out to its own
isPodLike type trait.  This is a generally useful type trait for
more than just DenseMap, and we really care about whether something
acts like a pod, not whether it really is a pod.

llvm-svn: 91421
2009-12-15 07:26:43 +00:00
Eric Christopher
3abcd3f41c Formatting.
llvm-svn: 91377
2009-12-15 00:40:55 +00:00
Jeffrey Yasskin
d06c7e46a2 Reinstate r91208 to fix available_externally linkage for globals, with
nlewycky's fix to add -rdynamic so the JIT can look symbols up in Linux builds
of the JITTests binary.

llvm-svn: 91250
2009-12-13 20:30:32 +00:00
Jeffrey Yasskin
f79c7c85f7 Revert r91208. Something on Linux prevents the JIT from looking up a symbol
defined in the test, and I don't have time tonight to figure it out.

llvm-svn: 91209
2009-12-12 06:18:46 +00:00
Jeffrey Yasskin
b34198b7ff Fix available_externally linkage for globals. It's probably still not
supported by emitGlobals, but I don't have a test case for that.

llvm-svn: 91208
2009-12-12 05:58:14 +00:00
Torok Edwin
7879b5fae2 Comparing std::string with NULL is a bad idea, so just check whether its empty.
This code was crashing always with oprofile enabled, since it tried to create a StringRef
out of NULL, which run strlen on NULL.

llvm-svn: 91046
2009-12-10 10:01:47 +00:00
Jeffrey Yasskin
d9047c44e4 Fix the OProfileJITEventListener for StringRef being returned from debug info.
llvm-svn: 90813
2009-12-07 22:32:38 +00:00
Jeffrey Yasskin
0a0b21f8c5 * Move stub allocation inside the JITEmitter, instead of exposing a
way for each TargetJITInfo subclass to allocate its own stubs. This
means stubs aren't as exactly-sized anymore, but it lets us get rid of
TargetJITInfo::emitFunctionStubAtAddr(), which lets ARM and PPC
support the eager JIT, fixing http://llvm.org/PR4816.

* Rename the JITEmitter's stub creation functions to describe the kind
of stub they create. So far, all of them create lazy-compilation
stubs, but they sometimes get used when far-call stubs are needed.
Fixing http://llvm.org/PR5201 will involve fixing this.

llvm-svn: 89715
2009-11-23 23:35:19 +00:00
Jeffrey Yasskin
ed6d1ce9ae Allow more than one stub to be being generated at the same time.
It's probably better in the long run to replace the
indirect-GlobalVariable system. That'll be done after a subsequent
patch.

llvm-svn: 89708
2009-11-23 22:49:00 +00:00
Jeffrey Yasskin
29eef4f15a Try to fix JITTest.FarCallToKnownFunction on ARM and PPC.
llvm-svn: 89410
2009-11-19 23:42:58 +00:00
Nick Lewycky
ac0e7c8aca Fix passing of float arguments through ffi.
llvm-svn: 89198
2009-11-18 05:43:15 +00:00
Eric Christopher
7a90b50fc6 Add ability to set code model within the execution engine builders
and creation interfaces.

llvm-svn: 89151
2009-11-17 21:58:16 +00:00
Nick Lewycky
f6d8788686 Fail less mysteriously; inform the user that their LLVM was not built with
libffi support and that the interpreter can't call external functions without
it. Patch by Timo Juhani Lindfors! Fixes PR5466.

llvm-svn: 89062
2009-11-17 07:52:09 +00:00
Jeffrey Yasskin
0f846dbb3e Make X86-64 in the Large model always emit 64-bit calls.
The large code model is documented at
http://www.x86-64.org/documentation/abi.pdf and says that calls should
assume their target doesn't live within the 32-bit pc-relative offset
that fits in the call instruction.

To do this, we turn off the global-address->target-global-address
conversion in X86TargetLowering::LowerCall(). The first attempt at
this broke the lazy JIT because it can separate the movabs(imm->reg)
from the actual call instruction. The lazy JIT receives the address of
the movabs as a relocation and needs to record the return address from
the call; and then when that call happens, it needs to patch the
movabs with the newly-compiled target. We could thread the call
instruction into the relocation and record the movabs<->call mapping
explicitly, but that seems to require at least as much new
complication in the code generator as this change.

To fix this, we make lazy functions _always_ go through a call
stub. You'd think we'd only have to force lazy calls through a stub on
difficult platforms, but that turns out to break indirect calls
through a function pointer. The right fix for that is to distinguish
between calls and address-of operations on uncompiled functions, but
that's complex enough to leave for someone else to do.

Another attempt at this defined a new CALL64i pseudo-instruction,
which expanded to a 2-instruction sequence in the assembly output and
was special-cased in the X86CodeEmitter's emitInstruction()
function. That broke indirect calls in the same way as above.

This patch also removes a hack forcing Darwin to the small code model.
Without far-call-stubs, the small code model requires things of the
JITMemoryManager that the DefaultJITMemoryManager can't provide.

Thanks to echristo for lots of testing!

llvm-svn: 88984
2009-11-16 22:41:33 +00:00
Benjamin Kramer
e9ba686ab8 Implement DISABLE_INLINE for MSVC. This required changing the position in all
forward declaration and patching tblgen to emit it right. Patch by Amine Khaldi!

llvm-svn: 88798
2009-11-14 16:37:18 +00:00
Eric Christopher
42c58d5ea6 Use stubs when we have them, otherwise use code we already have,
otherwise create a stub.

Add a test to make sure we don't create extraneous stubs.

llvm-svn: 86941
2009-11-12 03:12:18 +00:00
Eric Christopher
1764cc3934 Fix typo, cleanup whitespace.
llvm-svn: 86917
2009-11-12 01:06:08 +00:00
Jeffrey Yasskin
7ad82ff8cf Remove dlsym stubs, with Nate Begeman's permission.
llvm-svn: 86606
2009-11-09 22:34:19 +00:00
Daniel Dunbar
c2a6a7dea5 Remove ByteswapSCANFResults, it is dead.
llvm-svn: 86458
2009-11-08 09:46:57 +00:00
Nick Lewycky
1909b23533 We don't need to byteswap, the interpreter assumes the program is running
native anyways. This fixes a crash using %d and similar in a scanf statement.

llvm-svn: 86440
2009-11-08 05:45:04 +00:00
Nick Lewycky
21dd3f31b0 Fix the interpreter to not crash due to zeroext/signext
llvm-svn: 86428
2009-11-08 00:45:29 +00:00