-
Couldn't load subscription status.
- Fork 13.9k
Description
Rust could pass along lots of aliasing information to LLVM via the new metadata.
http://llvm.org/docs/LangRef.html#noalias-and-alias-scope-metadata
UPDATE(@eddyb): Currently blocked on an Unsafe Code Guidelines decision, regarding the exact cases we can treat as UB, and optimize - see #16515 (comment) below, and further comments.
While LLVM can and will convert noalias attributes in function signatures into scoped !noalias metadata on instructions, when inlining, we never emit any such metadata ourselves.
Furthermore, the LLVM conversion is conservative (i.e. scoped to the entire callee) in a way that can't easily be generalized intra-function, without deciding on what to define and what to leave as UB.