mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-14 11:32:34 +00:00
Minor code cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91280 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
ffe966c15b
commit
b058ceda56
@ -228,19 +228,17 @@ void LoopStrengthReduce::DeleteTriviallyDeadInstructions() {
|
||||
if (DeadInsts.empty()) return;
|
||||
|
||||
while (!DeadInsts.empty()) {
|
||||
Instruction *I = dyn_cast_or_null<Instruction>(DeadInsts.back());
|
||||
DeadInsts.pop_back();
|
||||
Instruction *I = dyn_cast_or_null<Instruction>(DeadInsts.pop_back_val());
|
||||
|
||||
if (I == 0 || !isInstructionTriviallyDead(I))
|
||||
continue;
|
||||
|
||||
for (User::op_iterator OI = I->op_begin(), E = I->op_end(); OI != E; ++OI) {
|
||||
for (User::op_iterator OI = I->op_begin(), E = I->op_end(); OI != E; ++OI)
|
||||
if (Instruction *U = dyn_cast<Instruction>(*OI)) {
|
||||
*OI = 0;
|
||||
if (U->use_empty())
|
||||
DeadInsts.push_back(U);
|
||||
}
|
||||
}
|
||||
|
||||
I->eraseFromParent();
|
||||
Changed = true;
|
||||
|
Loading…
Reference in New Issue
Block a user