<div dir="ltr">Hi Vaivaswatha,<div><br></div><div>I think not adding readnone/readonly to malloc/realloc is correct. malloc/free hooks can be added to most implementations (for leak checking and so on), so calling malloc could in fact call any other arbitrary code that could write to memory.</div><div><br></div><div>Cheers,</div><div><br></div><div>James</div></div><br><div class="gmail_quote"><div dir="ltr">On Wed, 2 Dec 2015 at 14:07 Vaivaswatha Nagaraj 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:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Hi,<br><br></div>GlobalsAA, during propagation of mod-ref behavior in the call graph, looks at library functions (in GlobalsAAResult::AnalyzeCallGraph: F->isDeclaration() check), for attributes, and if the function does not have the onlyReadsMemory attribute set, forgets it.<br><div><br></div><div>I noticed that library functions such as malloc/realloc do not have the attributes doesNotAccessMemory or onlyReadsMemory respectively set (FunctionAttrs.cpp). This leads to a loss of GlobalsAA information in the caller (and its caller and so on). Aren't these attributes stricter than necessary currently? I do not see why the presence of malloc/realloc in a function needs to invalidate all mod-ref info gathered for that function so far. <br></div><div><br></div><div>Please let me know if the question is not clear. I'll try to extract out a simple test case from the program I'm looking at and post it, so as to have a concrete example.<br><br></div><div>Thanks,<br></div><div><br clear="all"><div><div><div><div dir="ltr">  - Vaivaswatha<br></div></div></div>
</div></div></div>
_______________________________________________<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="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div>