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
This commit is contained in:
Zhou Sheng 2009-03-18 12:48:48 +00:00
parent 16767c6b49
commit b0c4199a55

View File

@ -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();