mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-07-08 18:30:04 +00:00
don't put erase or query for non-allocainst pointers in an set of allocainsts*'s
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43779 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
cf5008a792
commit
6390ae0a4a
@ -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
Block a user