Conversation

Replying to
There were literally dozens of bugs uncovered in LLVM as part of trying to fix this for Rust. It's also incredibly broken in GCC and it isn't getting fixed there because this incentive doesn't exist. Using restrict is probably a bad idea with either, especially combined with LTO.
1
2
Replying to and
I don't remember the precise rules for restrict off the top of my head, but for noalias in LLVM, it can also largely be applied to immutable references in Rust because it's really about memory dependencies and Rust can track when types have 'internal mutability' via Cell, etc.
1
1
Replying to and
The vast majority of immutable references can also be noalias, particularly all the trivial cases like &u32. It's just not going to be possible until LLVM has a better implementation and the Rust memory model for the superset including unsafe code also needs to be ironed out.
1