dberlin added a comment. I think it would be a lot easier to understand your example if you could produce IR that, when run through -gvn -enable-pre -jump-threading, produces the wrong result without this patch. https://reviews.llvm.org/D39637