<div dir="ltr">Did you mean to phrase this as a proposed approach and ask for feasibility?<div>Or are you more interested in the question "Rust has these language semantics, how can I get LLVM to best exploit this?"? LLVM may have an existing mechanism which would serve your needs.</div>
<div><br></div><div>Do you have some concrete examples of IR produced by the Rust frontend that you are seeing LLVM not optimize as well as it could?</div><div><br></div><div>-- Sean Silva</div></div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Mon, Jul 28, 2014 at 6:35 PM, John Kåre Alsaker <span dir="ltr"><<a href="mailto:john.mailinglists@gmail.com" target="_blank">john.mailinglists@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Since Rust references usually never aliases it would be nice if we could exploit this for code generation. One idea I had to improve alias analysis is to insert metadata on pointer loads. !inheritalias could be added to load instructions to indicate that if we know all the aliases of the pointer we load from, then we also know all the aliases of the pointer value loaded. Given that pointer loads are common and things are likely marked with `noalias` in Rust, this seems like useful metadata. It could also for example apply to loading C++'s unique_ptr fields.<br>

<div><br></div><div>I'm wondering what the feasibility of extending BasicAliasAnalysis to utilize the proposed metadata would be.</div></div>
<br>_______________________________________________<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></blockquote></div><br></div>