Taming Undefined Behavior in LLVM https://www.cs.utah.edu/~regehr/papers/undef-pldi17.pdf (very readable paper on UB behaviour at the level of compiler IR semantics)