<div dir="ltr">Hi David,<div><br></div><div>The only use of C code is to generate the LLVM IR using -emit-llvm flags. Because I need to generate an LLVM IR. My actual use case is to implement accurate GC for LLVM. So I want to know how to generate statepoints for given LLVM IR?</div><div><br clear="all"><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>Kavindu Gimhan Zoysa,</div><div>BSc(Hons) | ENTC | UoM,<br></div><div dir="ltr">SSE | WSO2<div><br></div><div><a href="https://github.com/KavinduZoysa" target="_blank">GitHub</a> <a href="https://www.linkedin.com/in/kavindu-gimhan-zoysa-85939a122/" target="_blank">LinkedIn</a> <a href="https://medium.com/@kavindugimhanzoysa" target="_blank">Medium</a></div></div></div></div></div></div></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, 8 May 2021 at 16:35, David Chisnall <<a href="mailto:David.Chisnall@cl.cam.ac.uk">David.Chisnall@cl.cam.ac.uk</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
<br>
It’s not clear what you’re actually trying to do.  Are you trying to write a garbage collector for C?  That’s unlikely to benefit from the statepoint work because it’s designed for accurate GCs, whereas C intrinsically requires conservative GC (or some compiler or hardware changes to track pointer provenance through integer casts).<br>
<br>
David<br>
<br>
> On 7 May 2021, at 17:23, Kavindu Gimhan Zoysa via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<br>
> <br>
> Hi All,<br>
> <br>
> I am currently working on evaluating the support of the LLVM GC framework in order to design a garbage collector. <br>
> <br>
> I have followed the below docs.<br>
> <a href="https://releases.llvm.org/11.0.0/docs/GarbageCollection.html" rel="noreferrer" target="_blank">https://releases.llvm.org/11.0.0/docs/GarbageCollection.html</a><br>
> <a href="https://releases.llvm.org/11.0.0/docs/Statepoints.html" rel="noreferrer" target="_blank">https://releases.llvm.org/11.0.0/docs/Statepoints.html</a><br>
> <a href="https://releases.llvm.org/11.0.0/docs/StackMaps.html" rel="noreferrer" target="_blank">https://releases.llvm.org/11.0.0/docs/StackMaps.html</a><br>
> <br>
> I am trying to generate the llvm IR with safepoints for the given C code. This repository contains relevant source files. <br>
> <a href="https://github.com/KavinduZoysa/test-GCs/tree/master/statepoints" rel="noreferrer" target="_blank">https://github.com/KavinduZoysa/test-GCs/tree/master/statepoints</a><br>
> <br>
> I generated statepoints for main.ll file I used the command opt-11 --rewrite-statepoints-for-gc main.ll -S -o main-statepoints.ll<br>
> <br>
> I want to know the way I followed to generate statepoints is correct? If not the what is the best practice of generating statepoints(for give LLVM IR) for a garbage collector?<br>
> <br>
> Thank you,<br>
> Kavindu<br>
> <br>
> Kavindu Gimhan Zoysa,<br>
> BSc(Hons) | ENTC | UoM,<br>
> SSE | WSO2<br>
> <br>
> GitHub LinkedIn Medium<br>
> _______________________________________________<br>
> LLVM Developers mailing list<br>
> <a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
> <a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
<br>
</blockquote></div>