Hacker News new | past | comments | ask | show | jobs | submit login

For one, in typical code, the Rust compiler can make more aggressive optimizations because every `&mut` is guaranteed not to alias. The C++ equivalent, from the optimizer's standpoint, is `T * restrict`, which is rarely used (and harder to use correctly) by comparison.



But is it used? From what I remember aliasing information provided was not used by LLVM. Did anything changed?


I believe the code miscompilation bug in LLVM that was blocking enabling it was fixed. That said, it's gone back and forth now several times as new bugs get discovered. The code paths in GCC and LLVM for noalias optimizations aren't particularly battle-tested because C and C++ basically don't use them.




Consider applying for YC's Summer 2025 batch! Applications are open till May 13

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: