[CGP] Extends the scope of optimizeMemoryInst optimization. NFC

Commit tests for previous commit.

Reviewers: efriedma, dberlin, mkazantsev, reames, john.brawn
Reviewed By: john.brawn
Subscribers: javed.absar, john.brawn, dneilson, llvm-commits
Differential Revision: https://reviews.llvm.org/D36073


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@317430 91177308-0d34-0410-b5e6-96231b3b80d8
2 files changed