File tree Expand file tree Collapse file tree 1 file changed +2
-9
lines changed
llvm/tools/llvm-reduce/deltas Expand file tree Collapse file tree 1 file changed +2
-9
lines changed Original file line number Diff line number Diff line change @@ -20,27 +20,20 @@ using namespace llvm;
2020// / Calls simplifyInstruction in each instruction in functions, and replaces
2121// / their values.
2222void llvm::simplifyInstructionsDeltaPass (Oracle &O, ReducerWorkItem &WorkItem) {
23- std::vector<Instruction *> InstsToDelete;
24-
2523 Module &Program = WorkItem.getModule ();
2624 const DataLayout &DL = Program.getDataLayout ();
2725
28- std::vector<Instruction *> InstToDelete;
2926 for (auto &F : Program) {
3027 for (auto &BB : F) {
31- for (auto &Inst : BB) {
32-
28+ for (auto &Inst : make_early_inc_range (BB)) {
3329 SimplifyQuery Q (DL, &Inst);
3430 if (Value *Simplified = simplifyInstruction (&Inst, Q)) {
3531 if (O.shouldKeep ())
3632 continue ;
3733 Inst.replaceAllUsesWith (Simplified);
38- InstToDelete. push_back (&Inst );
34+ Inst. eraseFromParent ( );
3935 }
4036 }
4137 }
4238 }
43-
44- for (Instruction *I : InstToDelete)
45- I->eraseFromParent ();
4639}
You can’t perform that action at this time.
0 commit comments