mirror of
https://github.com/RPCS3/llvm.git
synced 2025-01-12 15:30:56 +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;
|
if (DeadInsts.empty()) return;
|
||||||
|
|
||||||
while (!DeadInsts.empty()) {
|
while (!DeadInsts.empty()) {
|
||||||
Instruction *I = dyn_cast_or_null<Instruction>(DeadInsts.back());
|
Instruction *I = dyn_cast_or_null<Instruction>(DeadInsts.pop_back_val());
|
||||||
DeadInsts.pop_back();
|
|
||||||
|
|
||||||
if (I == 0 || !isInstructionTriviallyDead(I))
|
if (I == 0 || !isInstructionTriviallyDead(I))
|
||||||
continue;
|
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)) {
|
if (Instruction *U = dyn_cast<Instruction>(*OI)) {
|
||||||
*OI = 0;
|
*OI = 0;
|
||||||
if (U->use_empty())
|
if (U->use_empty())
|
||||||
DeadInsts.push_back(U);
|
DeadInsts.push_back(U);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
I->eraseFromParent();
|
I->eraseFromParent();
|
||||||
Changed = true;
|
Changed = true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user