https://bugs.freedesktop.org/show_bug.cgi?id=103743
--- Comment #6 from Nicolai Hähnle nhaehnle@gmail.com --- Thanks. To give you an update, this is a super subtle control flow handling bug in LLVM -- and the difference between the original shader and your modification at the LLVM input is merely that the sense of one branch is (correctly) inverted, leading LLVM down a subtly different path in the end.
A sledge-hammer fix is quite simple, but I'm still thinking about how to get a better fix which doesn't pessimize a bunch of cases.