t.p.northover added a comment. I agree the underlying transformation looks sound. Stopping the scan at 1 seems a bit hacky though, and is there any particular reason you limit the transformation to loads? http://reviews.llvm.org/D14489