<div class="gmail_quote">I completely agree with you.</div><div class="gmail_quote"> </div><div class="gmail_quote">The source code I wrote here has the main function and is a complete code. That's why I was expecting load/store analysis could have been incorporated across the module. Thanks. </div>
<div class="gmail_quote"> </div><div class="gmail_quote">On Fri, Jan 4, 2013 at 10:43 PM, Daniel Berlin <span dir="ltr"><<a href="mailto:dberlin@dberlin.org" target="_blank">dberlin@dberlin.org</a>></span> wrote:<br>
<blockquote style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid" class="gmail_quote">I'm not sure what you mean by "use" check.<br>
If you compile this with LTO and multiple modules, and guarantee that<br>
you have the main function, yes, you could optimize this.<br>
In all other cases, it's not possible to eliminate any of the<br>
remaining loads or stores you see, because you have no guarantee about<br>
what else could read it.<br>
<br>
Heck, a conforming implementation of printf could read from any of<br>
these globals, so you don't even need other modules.<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
<br>
<br>
<br>
On Fri, Jan 4, 2013 at 11:45 AM, Somenath Chakraborty<br>
<<a href="mailto:some.chak@gmail.com">some.chak@gmail.com</a>> wrote:<br>
> Thanks for your reply. So, we don't do any "use" check (for globals<br>
> variables) beyond a module scope. If so, it answers my question.<br>
><br>
> On Fri, Jan 4, 2013 at 6:53 PM, Justin Holewinski<br>
> <<a href="mailto:justin.holewinski@gmail.com">justin.holewinski@gmail.com</a>> wrote:<br>
>><br>
>> Since a, b, and c are globals, how does the optimize *know* they are not<br>
>> used elsewhere (e.g. another module)?<br>
><br>
><br>
><br>
</div></div><div class="HOEnZb"><div class="h5">> _______________________________________________<br>
> LLVM Developers mailing list<br>
> <a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a> <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
><br>
</div></div></blockquote></div><br>