From b0c4199a55d72fb9560f00b84a92a062fb8e79ea Mon Sep 17 00:00:00 2001 From: Zhou Sheng Date: Wed, 18 Mar 2009 12:48:48 +0000 Subject: [PATCH] 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 --- lib/Transforms/Scalar/ScalarReplAggregates.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Transforms/Scalar/ScalarReplAggregates.cpp b/lib/Transforms/Scalar/ScalarReplAggregates.cpp index 358b0981cc8..9cbe073e292 100644 --- a/lib/Transforms/Scalar/ScalarReplAggregates.cpp +++ b/lib/Transforms/Scalar/ScalarReplAggregates.cpp @@ -1223,7 +1223,7 @@ void SROA::CleanupAllocaUsers(AllocationInst *AI) { CleanupGEP(GEPI); else if (Instruction *I = dyn_cast(U)) { SmallVector DbgInUses; - if (!I->use_empty() && OnlyUsedByDbgInfoIntrinsics(I, &DbgInUses)) { + if (!isa(I) && OnlyUsedByDbgInfoIntrinsics(I, &DbgInUses)) { // Safe to remove debug info uses. while (!DbgInUses.empty()) { DbgInfoIntrinsic *DI = DbgInUses.back(); DbgInUses.pop_back();