1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 04:02:41 +01:00
llvm-mirror/test
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
..
Analysis Update computeArraySize() to use ComputeMultiple() to determine the array size associated with a malloc; also extend PerformHeapAllocSRoA() to check if the optimized malloc's arg had its highest bit set, so that it is safe for ComputeMultiple() to look through sext instructions while determining the optimized malloc's array size 2009-11-10 08:32:25 +00:00
Archive
Assembler
Bindings/Ocaml
Bitcode
BugPoint
CodeGen - Check memoperand alignment instead of checking stack alignment. Most load / store folding instructions are not referencing spill stack slots. 2009-11-16 21:56:03 +00:00
DebugInfo Add missing run line. Devang, please check. 2009-11-11 03:10:03 +00:00
ExecutionEngine Remove test. Execution tests are slow and generally not worth it. 2009-11-08 02:23:15 +00:00
Feature add bitcode reader support for blockaddress. We can now fully 2009-10-28 05:53:48 +00:00
FrontendAda
FrontendC Use ',' separation in XFAILs, lit doesn't evaluate them as regexs (easy to add, 2009-11-09 16:38:15 +00:00
FrontendC++ Move DebugInfo checks into EmitComments and remove them from 2009-11-13 21:34:57 +00:00
FrontendFortran
FrontendObjC
FrontendObjC++
Integer
lib
Linker
LLVMC Cleanup some unused RUN lines. 2009-11-08 09:07:42 +00:00
MC
Other Update these tests to match what Loop::print now prints. 2009-10-24 23:52:07 +00:00
Scripts Teach macho-dump to dump UUIDs. 2009-10-24 20:32:36 +00:00
TableGen
Transforms Revert r88830 and r88831 which appear to have caused a selfhost buildbot some 2009-11-15 07:47:32 +00:00
Unit Switch to using 'lit.site.cfg.in' for the site config template for Unit tests, 2009-11-08 09:07:51 +00:00
Verifier
CMakeLists.txt Two small fixes for site.exp for cmake. 2009-11-08 09:29:52 +00:00
lit.cfg Derive the right paths to use during testing instead of passing it in via make. 2009-11-08 09:08:00 +00:00
lit.site.cfg.in
Makefile Make X86-64 in the Large model always emit 64-bit calls. 2009-11-16 22:41:33 +00:00
Makefile.tests
site.exp.in Two small fixes for site.exp for cmake. 2009-11-08 09:29:52 +00:00
TestRunner.sh