llvm/utils/lit
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
..
ExampleTests lit: Add ExampleTests, for testing lit and demonstrating test suite features. 2009-11-10 02:41:17 +00:00
ExampleTests.ObjDir lit: Add ExampleTests, for testing lit and demonstrating test suite features. 2009-11-10 02:41:17 +00:00
lit.py lit: Add --repeat=N option, for running each test N times. 2009-11-15 01:02:09 +00:00
LitConfig.py lit: Add --param NAME=VALUE option, for test suite specific use (to communicate 2009-11-05 16:27:33 +00:00
LitFormats.py lit: Factor a new OneCommandPerFileTest out of SyntaxCheckTest. 2009-11-15 08:10:29 +00:00
ProgressBar.py
ShCommands.py Fix typo that worked on python 2.6. 2009-09-08 05:46:28 +00:00
ShUtil.py
TclUtil.py Fix typo that worked on python 2.6. 2009-09-08 05:46:28 +00:00
Test.py lit: Add --repeat=N option, for running each test N times. 2009-11-15 01:02:09 +00:00
TestFormats.py Make X86-64 in the Large model always emit 64-bit calls. 2009-11-16 22:41:33 +00:00
TestingConfig.py lit: Preserve the PATHEXT variable when running subcommands, this is important on Win32 2009-11-08 03:35:19 +00:00
TestRunner.py lit: Add --repeat=N option, for running each test N times. 2009-11-15 01:02:09 +00:00
TODO
Util.py Delete a spurious semicolon. 2009-10-24 23:24:45 +00:00