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;
20
20
// / Calls simplifyInstruction in each instruction in functions, and replaces
21
21
// / their values.
22
22
void llvm::simplifyInstructionsDeltaPass (Oracle &O, ReducerWorkItem &WorkItem) {
23
- std::vector<Instruction *> InstsToDelete;
24
-
25
23
Module &Program = WorkItem.getModule ();
26
24
const DataLayout &DL = Program.getDataLayout ();
27
25
28
- std::vector<Instruction *> InstToDelete;
29
26
for (auto &F : Program) {
30
27
for (auto &BB : F) {
31
- for (auto &Inst : BB) {
32
-
28
+ for (auto &Inst : make_early_inc_range (BB)) {
33
29
SimplifyQuery Q (DL, &Inst);
34
30
if (Value *Simplified = simplifyInstruction (&Inst, Q)) {
35
31
if (O.shouldKeep ())
36
32
continue ;
37
33
Inst.replaceAllUsesWith (Simplified);
38
- InstToDelete. push_back (&Inst );
34
+ Inst. eraseFromParent ( );
39
35
}
40
36
}
41
37
}
42
38
}
43
-
44
- for (Instruction *I : InstToDelete)
45
- I->eraseFromParent ();
46
39
}
You can’t perform that action at this time.
0 commit comments