diff options
author | Dale Johannesen <dalej@apple.com> | 2008-08-11 23:46:25 +0000 |
---|---|---|
committer | Dale Johannesen <dalej@apple.com> | 2008-08-11 23:46:25 +0000 |
commit | 50dd1d028021bd7fd8bca3f33633ea59577c9d5e (patch) | |
tree | 6ad12938b4220e46b67e485c4f921edf7810736c /lib/Target/X86/X86TargetMachine.cpp | |
parent | 0eab5e2efa0741b766f71a75626f7598990d5c3d (diff) | |
download | external_llvm-50dd1d028021bd7fd8bca3f33633ea59577c9d5e.zip external_llvm-50dd1d028021bd7fd8bca3f33633ea59577c9d5e.tar.gz external_llvm-50dd1d028021bd7fd8bca3f33633ea59577c9d5e.tar.bz2 |
Some fixes for x86-64 JIT. Make it use small code
model, except for external calls; this makes
addressing modes PC-relative. Incomplete.
The assertion at the top of Emitter::runOnMachineFunction
was obviously bogus (always true) so I removed it.
If someone knows what the correct test should be to cover
all the various targets, please fix.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54656 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86/X86TargetMachine.cpp')
-rw-r--r-- | lib/Target/X86/X86TargetMachine.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/Target/X86/X86TargetMachine.cpp b/lib/Target/X86/X86TargetMachine.cpp index e163956..8e10ee9 100644 --- a/lib/Target/X86/X86TargetMachine.cpp +++ b/lib/Target/X86/X86TargetMachine.cpp @@ -194,12 +194,14 @@ bool X86TargetMachine::addAssemblyEmitter(PassManagerBase &PM, bool Fast, bool X86TargetMachine::addCodeEmitter(PassManagerBase &PM, bool Fast, bool DumpAsm, MachineCodeEmitter &MCE) { // FIXME: Move this to TargetJITInfo! - if (DefRelocModel == Reloc::Default) + // Do not override 64-bit setting made in X86TargetMachine(). + if (DefRelocModel == Reloc::Default && !Subtarget.is64Bit()) setRelocationModel(Reloc::Static); - // JIT cannot ensure globals are placed in the lower 4G of address. + // 64-bit JIT places everything in the same buffer except external functions. + // Use small code model but hack the call instruction for externals. if (Subtarget.is64Bit()) - setCodeModel(CodeModel::Large); + setCodeModel(CodeModel::Small); PM.add(createX86CodeEmitterPass(*this, MCE)); if (DumpAsm) |