[LLVMdev] Tailcall optimization in jit stopped working
Evan Cheng
evan.cheng at apple.com
Fri Jan 4 02:42:20 PST 2008
My bad. I'll fix it after I commit next batch of JIT changes.
Evan
On Jan 3, 2008, at 10:48 AM, Arnold Schwaighofer wrote:
> tailcall optimization stop working in jit (lli) in revision 45527. i
> guess this is because the jit is tailjmping to the wrong function
> address. the following change would reenable tailcallopt in jit. But
> i am pretty sure that this is not the correct fix (since i don't
> really understand what is going on :). maybe evan can comment on this?
>
> regards arnold
>
> Index: lib/Target/X86/X86CodeEmitter.cpp
> ===================================================================
> --- lib/Target/X86/X86CodeEmitter.cpp (revision 45541)
> +++ lib/Target/X86/X86CodeEmitter.cpp (working copy)
> @@ -601,7 +601,8 @@
> if (MO.isMachineBasicBlock()) {
> emitPCRelativeBlockAddress(MO.getMBB());
> } else if (MO.isGlobalAddress()) {
> - bool NeedStub = !IsStatic ||
> + bool NeedStub = Opcode == X86::TAILJMPd || Opcode ==
> X86::TAILJMPr ||
> + Opcode == X86::TAILJMPm || !IsStatic ||
> (Is64BitMode && TM.getCodeModel() == CodeModel::Large);
> emitGlobalAddress(MO.getGlobal(), X86::reloc_pcrel_word,
> 0, 0, NeedStub);
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
More information about the llvm-dev
mailing list