Conversation

Most of the complexity where everything can go wrong are the optimizations consuming the information. Compared to that, the alias analysis deciding whether to answer NoAlias doesn't seem particularly hard to get right. Of course, maybe it's still broken or propagation is broken.
1
1
Rust was even hitting lots of these issues just from marking parameters as noalias, not even from applying it aggressively. LLVM happily generates scoped noalias metadata itself when inlining, etc. LTO + nearly all pointers marked noalias seems inherently prone to finding bugs.
2
1
Replying to and
I really liked the infinite loop / infinite recursion example that's now finally fixed. It was a pretty shocking bug in a language like Java or Rust. In C, no one cares. The code is already wrong and horribly broken anyway. Just needs to go fast and appear to still mostly work.
2
2
Replying to and
it's not that nobody cares, it's that the standards committees explicitly decided to make compiler writers' jobs easier by making certain loops UB, and the LLVM compiler writers took advantage of the allowed leeway
1
and as far as I can remember I found three major C implementations that would terminate an infinite loop, so even if you're sure about the standard then this ends up being one of those things where the standard is wrong since it disagrees with prevailing practice
1
Replying to and
sure, many things are a mess. returning to noalias, either it has a semantics or not at the LLVM level. assuming that it does, there'll be some set of optimizations that disrespect the semantics, and I doubt this set will be huge.
2
1
some of the issues won't be load-bearing and it's not hard to get those fixed. the remaining ones may well be hard, but the LLVM community understands perfectly well that C/C++ are not the only use cases. anyway, the way forward is clear and probably not extremely difficult...