don't put erase or query for non-allocainst pointers in an set of allocainsts*'s
llvm-svn: 43779
This commit is contained in:
parent
f76f2b0c1c
commit
cbad11e027
|
@ -271,7 +271,8 @@ bool DSE::handleEndBlock(BasicBlock& BB,
|
||||||
// See through pointer-to-pointer bitcasts
|
// See through pointer-to-pointer bitcasts
|
||||||
TranslatePointerBitCasts(pointerOperand);
|
TranslatePointerBitCasts(pointerOperand);
|
||||||
|
|
||||||
if (deadPointers.count(pointerOperand)){
|
if (isa<AllocaInst>(pointerOperand) &&
|
||||||
|
deadPointers.count(cast<AllocaInst>(pointerOperand))) {
|
||||||
// Remove it!
|
// Remove it!
|
||||||
MD.removeInstruction(S);
|
MD.removeInstruction(S);
|
||||||
|
|
||||||
|
@ -345,7 +346,8 @@ bool DSE::handleEndBlock(BasicBlock& BB,
|
||||||
|
|
||||||
for (std::vector<Instruction*>::iterator I = dead.begin(), E = dead.end();
|
for (std::vector<Instruction*>::iterator I = dead.begin(), E = dead.end();
|
||||||
I != E; ++I)
|
I != E; ++I)
|
||||||
deadPointers.erase(*I);
|
if (AllocaInst *AI = dyn_cast<AllocaInst>(*I))
|
||||||
|
deadPointers.erase(AI);
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -427,7 +429,8 @@ bool DSE::RemoveUndeadPointers(Value* killPointer,
|
||||||
|
|
||||||
for (std::vector<Instruction*>::iterator I = undead.begin(), E = undead.end();
|
for (std::vector<Instruction*>::iterator I = undead.begin(), E = undead.end();
|
||||||
I != E; ++I)
|
I != E; ++I)
|
||||||
deadPointers.erase(*I);
|
if (AllocaInst *AI = dyn_cast<AllocaInst>(*I))
|
||||||
|
deadPointers.erase(AI);
|
||||||
|
|
||||||
return MadeChange;
|
return MadeChange;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue