Explicitly check for StoreInst, do not lose the chance to delete

unused loads or bitcasts.

llvm-svn: 67202
This commit is contained in:
Zhou Sheng 2009-03-18 12:48:48 +00:00
parent fd26fc58bd
commit 4e5f2198ff

@ -1223,7 +1223,7 @@ void SROA::CleanupAllocaUsers(AllocationInst *AI) {
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();