Unbreak tailcall opt in JIT.
authorEvan Cheng <evan.cheng@apple.com>
Fri, 4 Jan 2008 10:50:28 +0000 (10:50 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Fri, 4 Jan 2008 10:50:28 +0000 (10:50 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45576 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86CodeEmitter.cpp

index 150d1a1..24d75b6 100644 (file)
@@ -619,7 +619,8 @@ void Emitter::emitInstruction(const MachineInstr &MI) {
       if (MO.isMachineBasicBlock()) {
         emitPCRelativeBlockAddress(MO.getMBB());
       } else if (MO.isGlobalAddress()) {
-        bool NeedStub = Is64BitMode && TM.getCodeModel() == CodeModel::Large;
+        bool NeedStub = (Is64BitMode && TM.getCodeModel() == CodeModel::Large)
+          || Opcode == X86::TAILJMPd;
         emitGlobalAddress(MO.getGlobal(), X86::reloc_pcrel_word,
                           0, 0, NeedStub);
       } else if (MO.isExternalSymbol()) {