Fork of llvm with experimental commits and workarounds for RPCS3
Go to file
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
autoconf Add configure options for specifying where to look for libstdc++. 2009-11-16 19:46:55 +00:00
bindings Expose the rest of the attribute settings. 2009-09-28 04:42:47 +00:00
cmake CMake: Pass -lm to check_symbol_exists for detecting several math 2009-11-12 05:36:09 +00:00
docs lit: Add --repeat=N option, for running each test N times. 2009-11-15 01:02:09 +00:00
examples Re-commit r86077 now that r86290 fixes the 179.art and 175.vpr ARM regressions. 2009-11-07 00:16:28 +00:00
include Fix unused variables warnings. 2009-11-16 22:34:32 +00:00
lib Make X86-64 in the Large model always emit 64-bit calls. 2009-11-16 22:41:33 +00:00
projects Move DataTypes.h to include/llvm/System, update all users. This breaks the last 2009-10-26 01:35:46 +00:00
runtime OptimalEdgeProfiling: Creation of profiles. 2009-09-01 19:03:44 +00:00
test Make X86-64 in the Large model always emit 64-bit calls. 2009-11-16 22:41:33 +00:00
tools Add compare_lower and equals_lower methods to StringRef. Switch all users of 2009-11-12 20:36:59 +00:00
unittests Make X86-64 in the Large model always emit 64-bit calls. 2009-11-16 22:41:33 +00:00
utils Make X86-64 in the Large model always emit 64-bit calls. 2009-11-16 22:41:33 +00:00
website Prepare for "core" website. 2007-08-03 05:43:35 +00:00
Xcode Remove the IA-64 backend. 2009-07-24 00:30:09 +00:00
build-for-llvm-top.sh Patch to build llvm with srcdir != objdir from 2009-01-23 08:42:38 +00:00
CMakeLists.txt CMake: Hopefully unbreak the build by mimicking the changes on the 2009-11-12 06:48:09 +00:00
configure Add configure options for specifying where to look for libstdc++. 2009-11-16 19:46:55 +00:00
CREDITS.TXT Add myself to the blame list. 2009-08-20 15:20:15 +00:00
LICENSE.TXT Add regular expression matching support, based on OpenBSD regexec()/regcomp() 2009-08-30 08:24:09 +00:00
llvm.spec.in
Makefile Don't build examples by default, use BUILD_EXAMPLES=1 to build them. The only utility of this is testing that we keep the examples up to date, I will just make the buildbots run with this flag. 2009-11-16 22:38:00 +00:00
Makefile.common Removed trailing whitespace from Makefiles. 2009-01-09 16:44:42 +00:00
Makefile.config.in Add configure options for specifying where to look for libstdc++. 2009-11-16 19:46:55 +00:00
Makefile.rules Add "Unoptimized" build (NO_DEBUG_SYMBOLS=1 ENABLE_OPTIMIZED=1), for reducing 2009-11-16 22:37:52 +00:00
ModuleInfo.txt Patch to build llvm with srcdir != objdir from 2009-01-23 08:42:38 +00:00
README.txt First test commit 2009-10-05 22:29:11 +00:00

Low Level Virtual Machine (LLVM)
================================

This directory and its subdirectories contain source code for the Low Level
Virtual Machine, a toolkit for the construction of highly optimized compilers,
optimizers, and runtime environments.

LLVM is open source software. You may freely distribute it under the terms of
the license agreement found in LICENSE.txt.

Please see the HTML documentation provided in docs/index.html for further
assistance with LLVM.