LGTM, thanks! Maybe LoopSimplify should create a dedicated exit block for loops like this, but that's another matter, and this seems like a reasonable change regardless (we shouldn't be sinking stores into non-dedicated exit blocks). http://reviews.llvm.org/D6414