[LLVMdev] Enhancing BasicAliasAnalysis for Rust

Sean Silva chisophugis at gmail.com
Tue Jul 29 09:14:54 PDT 2014


Did you mean to phrase this as a proposed approach and ask for feasibility?
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.

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?

-- Sean Silva


On Mon, Jul 28, 2014 at 6:35 PM, John Kåre Alsaker <
john.mailinglists at gmail.com> wrote:

> 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.
>
> I'm wondering what the feasibility of extending BasicAliasAnalysis to
> utilize the proposed metadata would be.
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140729/b7d43162/attachment.html>


More information about the llvm-dev mailing list