Changeset View
Changeset View
Standalone View
Standalone View
llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
Show First 20 Lines • Show All 91 Lines • ▼ Show 20 Lines | |||||
Instruction *DeadInst = NowDeadInsts.pop_back_val(); | Instruction *DeadInst = NowDeadInsts.pop_back_val(); | ||||
// Mark the DeadInst as dead in the list of throwable instructions. | // Mark the DeadInst as dead in the list of throwable instructions. | ||||
auto It = ThrowableInst.find(DeadInst); | auto It = ThrowableInst.find(DeadInst); | ||||
if (It != ThrowableInst.end()) | if (It != ThrowableInst.end()) | ||||
ThrowableInst[It->first] = false; | ThrowableInst[It->first] = false; | ||||
++NumFastOther; | ++NumFastOther; | ||||
// Try to preserve debug information attached to the dead instruction. | // Try to preserve debug information attached to the dead instruction. | ||||
salvageDebugInfoOrMarkUndef(*DeadInst); | salvageDebugInfo(*DeadInst); | ||||
salvageKnowledge(DeadInst); | salvageKnowledge(DeadInst); | ||||
// This instruction is dead, zap it, in stages. Start by removing it from | // This instruction is dead, zap it, in stages. Start by removing it from | ||||
// MemDep, which needs to know the operands and needs it to be in the | // MemDep, which needs to know the operands and needs it to be in the | ||||
// function. | // function. | ||||
MD.removeInstruction(DeadInst); | MD.removeInstruction(DeadInst); | ||||
for (unsigned op = 0, e = DeadInst->getNumOperands(); op != e; ++op) { | for (unsigned op = 0, e = DeadInst->getNumOperands(); op != e; ++op) { | ||||
▲ Show 20 Lines • Show All 91 Lines • Show Last 20 Lines |