<div dir="ltr">Hi Manman, Mehdi,<div><br></div><div>Yes, I agree. The implementation in FunctionAttrs is more conservative than it could be here (for simplicity) - I will change the comment to make that explicit.</div><div><br></div><div>Cheers,</div><div><br></div><div>James</div></div><br><div class="gmail_quote"><div dir="ltr">On Wed, 4 Nov 2015 at 21:30 Manman Ren via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">manmanren added inline comments.<br>
<br>
================<br>
Comment at: lib/Transforms/IPO/FunctionAttrs.cpp:1832<br>
@@ +1831,3 @@<br>
+ // For a function not to recurse, it must be in its own SCC and must not<br>
+ // call itself or be callable by external functions.<br>
+ if (!SCC.isSingular())<br>
----------------<br>
joker.eph wrote:<br>
> manmanren wrote:<br>
> > This comment seems to be incorrect. Should it be "must not call itself or any function that may be recursive"?<br>
> ><br>
> It can call a recursive function, as long at it is not involved in the recursion.<br>
><br>
> i.e. if:<br>
> a() calls b()<br>
> b() calls c()<br>
> c() calls b()<br>
><br>
> a is not recursive, but b() and c() are.<br>
><br>
> The issue with external function is that you don't know if they can call back into a() or one of its callers.<br>
> Or did I misunderstand what you meant?<br>
I was talking about what is actually implemented. But it is not the necessary condition.<br>
<br>
// For a function not to recurse, it must be in its own SCC and must not<br>
// call itself or any function that may be recursive.<br>
is incorrect.<br>
<br>
But this makes sense:<br>
// We mark a function as norecurse if it is in its own SCC and it does not call itself<br>
// or any function that may be recursive.<br>
<br>
<br>
<br>
Repository:<br>
rL LLVM<br>
<br>
<a href="http://reviews.llvm.org/D14228" rel="noreferrer" target="_blank">http://reviews.llvm.org/D14228</a><br>
<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div>