Conversation

What are the performance consequences in practice of disabling strict aliasing in C, anyway? Rust doesn't have it and it didn't actually tell LLVM about noalias until relatively recently, and I think enabling noalias only got ~ 5% avg so far (though that'll probably improve).
2
Show replies
&T for any type T without interior mutability (which is tracked by the type system) and any &mut U type can be marked with the same noalias markers used by Clang for restrict since noalias means no memory dependencies between them and is valid even if the address is the same.
2
4
Rust doesn't need to come up with type-based alias analysis rules beyond what & and &mut already provide themselves. The vast majority of types don't have interior mutability (Cell, RefCell, Mutex) so nearly all references could be marked noalias... if it worked properly in LLVM.