by ridiculous_fish · 7y ago · 0 comments
This seems like a much weirder problem, in which the optimizer is unaware of control flow and so will allow a value to reference an instruction that does not dominate it.
LLVM's IR verifier ensures that instructions dominate all of their uses, which simply means that all users of an instruction must provably execute after that instruction. This verification step seems to be what's missing.
Anyways, seems to be some weird block scoping rules going on like with python.