<div dir="ltr">Hi David,<div><br></div><div>Thank you for your detailed response. </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 Wed, 5 May 2021 at 14:20, David Chisnall via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</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>
I believe this is to permit local reasoning.  A method call is not <br>
necessarily a real safe point, but if the callee reaches a safe point <br>
then the entire stack must be treated as a safe point.  Without this <br>
assumption, you could reach a safe point in the current leaf function <br>
but the caller would not be in a safe point and so your stack would be <br>
in an inconsistent state.<br>
<br>
In theory, you could make may-be-a-safepoint an attribute on methods and <br>
avoid making the call site a safe point for cases where you can <br>
statically prove that nothing reachable from the callee contains a safe <br>
point.<br>
<br>
In practice, if you have sufficient analysis to be able to guarantee <br>
that the callee doesn't contain safe points (which also implies that it <br>
has a sufficiently short execution time that the lack of safepoints will <br>
not impact overall performance) then you probably want to inline it.  At <br>
this point, the method call no longer exists and so you don't have to <br>
worry about it as a potential safe point.<br>
<br>
David<br>
<br>
On 05/05/2021 05:26, Kavindu Gimhan Zoysa via llvm-dev wrote:<br>
> Hi all,<br>
> <br>
> In the LLVM GC framework, we are talking about the safe points which are <br>
> used to run the GC. When selecting the safe points, methods call are <br>
> considered as safe points. I cannot understand the reason to treat <br>
> method calls as safe points. Can you explain the reason?<br>
> <br>
> Thank you,<br>
> Kavindu<br>
> <br>
> Kavindu Gimhan Zoysa,<br>
> BSc(Hons) | ENTC | UoM,<br>
> SSE | WSO2<br>
> <br>
> GitHub <<a href="https://github.com/KavinduZoysa" rel="noreferrer" target="_blank">https://github.com/KavinduZoysa</a>> LinkedIn <br>
> <<a href="https://www.linkedin.com/in/kavindu-gimhan-zoysa-85939a122/" rel="noreferrer" target="_blank">https://www.linkedin.com/in/kavindu-gimhan-zoysa-85939a122/</a>> Medium <br>
> <<a href="https://medium.com/@kavindugimhanzoysa" rel="noreferrer" target="_blank">https://medium.com/@kavindugimhanzoysa</a>><br>
> <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>
_______________________________________________<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>
</blockquote></div>