1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 11:42:57 +01:00

don't put erase or query for non-allocainst pointers in an set of allocainsts*'s

llvm-svn: 43779
This commit is contained in:
Chris Lattner 2007-11-06 22:07:22 +00:00
parent 907b9b92fe
commit 2a909d32b6

View File

@ -271,7 +271,8 @@ bool DSE::handleEndBlock(BasicBlock& BB,
// 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 @@ bool DSE::handleEndBlock(BasicBlock& BB,
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 @@ bool DSE::RemoveUndeadPointers(Value* killPointer,
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;
}