[LLVMdev] GC plugin: Not add (postcall) safe point after tail-call

Yiannis Tsiouris yiannis.tsiouris at gmail.com
Wed Nov 23 08:27:50 PST 2011


Hi all,

I have implemented a GC plugin and i want to exclude Tail-call instructions
from being considered as Safe Points. For that reason I have overwritten
the "findCustomSafePoints" function with something like that:

 bool ErlangGC::findCustomSafePoints(GCFunctionInfo &FI, MachineFunction
&MF) {
   for (MachineFunction::iterator BBI = MF.begin(),
                                              BBE = MF.end(); BBI != BBE;
++BBI)
     for (MachineBasicBlock::iterator MI = BBI->begin(),
                                                    ME = BBI->end(); MI !=
ME; ++MI)
       if (MI->getDesc().isCall() && !isTailCall(MI))
 VisitCallPoint(FI, MI);

  return false;
}

using Nicolas' patch [1] and his code in VMkit as a template [2].

My problem is that I am not sure how i should define the "isTailCall"
function in order to be target-independent. Any advice is welcome!


Thank you in advance,
Yiannis


[1]:
https://groups.google.com/group/llvm-dev/browse_thread/thread/c866ef40b31504cb/46ab6820f20aba38?show_docid=46ab6820f20aba38&pli=1
[2]:
http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/vmkit/StaticGCPrinter/VmkitGCPrinter.cpp?view=markup
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20111123/b70b4d17/attachment.html>


More information about the llvm-dev mailing list