Explicitly check for StoreInst, do not lose the chance to delete 
unused loads or bitcasts.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67202 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Transforms/Scalar/ScalarReplAggregates.cpp b/lib/Transforms/Scalar/ScalarReplAggregates.cpp
index 358b098..9cbe073 100644
--- a/lib/Transforms/Scalar/ScalarReplAggregates.cpp
+++ b/lib/Transforms/Scalar/ScalarReplAggregates.cpp
@@ -1223,7 +1223,7 @@
       CleanupGEP(GEPI);
     else if (Instruction *I = dyn_cast<Instruction>(U)) {
       SmallVector<DbgInfoIntrinsic *, 2> DbgInUses;
-      if (!I->use_empty() && OnlyUsedByDbgInfoIntrinsics(I, &DbgInUses)) {
+      if (!isa<StoreInst>(I) && OnlyUsedByDbgInfoIntrinsics(I, &DbgInUses)) {
         // Safe to remove debug info uses.
         while (!DbgInUses.empty()) {
           DbgInfoIntrinsic *DI = DbgInUses.back(); DbgInUses.pop_back();