llvm/test
Jeffrey Yasskin d1ba06bf13 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!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88984 91177308-0d34-0410-b5e6-96231b3b80d8
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 Merge Archive/extract* tests into one; this avoids a race when tests are run in 2009-09-08 23:44:24 +00:00
Assembler Adjust testcases for msasm -> alignstack. 2009-10-21 23:29:12 +00:00
Bindings/Ocaml Fix test/Bindings/Ocaml/vmcore.ml. When IRBuilder::CreateMalloc was removed, 2009-10-17 23:52:26 +00:00
Bitcode Change tests from "opt %s" to "opt < %s" so that opt doesn't see the 2009-09-11 18:01:28 +00:00
BugPoint Use -output-prefix in bugpoint tests so that outputs go in temp directory (and 2009-09-07 19:26:18 +00:00
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 Check that accessing a struct field that occurs before the start 2009-10-22 12:53:25 +00:00
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 These tests are x86 specific. 2009-04-22 10:39:51 +00:00
FrontendObjC These tests now pass. 2009-10-13 20:45:18 +00:00
FrontendObjC++ This is an objective-c test, not an objective-c++ one. 2008-10-06 18:42:48 +00:00
Integer Eliminate some Tclisms. 2009-09-05 11:34:46 +00:00
lib tests: Add llvm_supports_binding predicate. 2009-09-13 01:41:18 +00:00
Linker When a constant's type is refined, update the constant in place 2009-09-15 15:58:07 +00:00
LLVMC Cleanup some unused RUN lines. 2009-11-08 09:07:42 +00:00
MC Force triple in tests. 2009-10-16 16:30:02 +00:00
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 Add some tests of advanced TableGen list functionality. 2009-06-29 20:07:17 +00:00
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 Remove obsolete -f flags. 2009-08-25 15:38:29 +00:00
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 Generate lit.site.cfg from a .in file, as clang does. 2009-09-22 07:38:33 +00:00
Makefile Make X86-64 in the Large model always emit 64-bit calls. 2009-11-16 22:41:33 +00:00
Makefile.tests Remove obsolete -f flags. 2009-08-25 15:38:29 +00:00
site.exp.in Two small fixes for site.exp for cmake. 2009-11-08 09:29:52 +00:00
TestRunner.sh Fix a bashism in TestRunner.sh. 2008-07-28 18:41:03 +00:00