[llvm-commits] [llvm] r43779 - /llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp
Chris Lattner
sabre at nondot.org
Tue Nov 6 14:07:22 PST 2007
Author: lattner
Date: Tue Nov 6 16:07:22 2007
New Revision: 43779
URL: http://llvm.org/viewvc/llvm-project?rev=43779&view=rev
Log:
don't put erase or query for non-allocainst pointers in an set of allocainsts*'s
Modified:
llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp?rev=43779&r1=43778&r2=43779&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp Tue Nov 6 16:07:22 2007
@@ -271,7 +271,8 @@
// See through pointer-to-pointer bitcasts
TranslatePointerBitCasts(pointerOperand);
- if (deadPointers.count(pointerOperand)){
+ if (isa<AllocaInst>(pointerOperand) &&
+ deadPointers.count(cast<AllocaInst>(pointerOperand))) {
// Remove it!
MD.removeInstruction(S);
@@ -345,7 +346,8 @@
for (std::vector<Instruction*>::iterator I = dead.begin(), E = dead.end();
I != E; ++I)
- deadPointers.erase(*I);
+ if (AllocaInst *AI = dyn_cast<AllocaInst>(*I))
+ deadPointers.erase(AI);
continue;
}
@@ -427,7 +429,8 @@
for (std::vector<Instruction*>::iterator I = undead.begin(), E = undead.end();
I != E; ++I)
- deadPointers.erase(*I);
+ if (AllocaInst *AI = dyn_cast<AllocaInst>(*I))
+ deadPointers.erase(AI);
return MadeChange;
}
More information about the llvm-commits
mailing list