lebedev.ri added a comment. Judging by the pattern, i would almost guess every single transform in instcombine will need such a fix? Can this be generalized somehow, fixing the outer place which actually applies replacements? https://reviews.llvm.org/D49270