skatkov added a comment. The test you mentioned passes with this change because of the check if (DependenceMI->mayLoad()) return false; in canHoistLoadInst. I'm ok if you land this change. https://reviews.llvm.org/D29120