Skip to content

Commit 98e8862

Browse files
committed
fuzz: avoid needless iteration over blocks
This change avoids iterating over the blocks twice--once will do fine. It is unclear, though, whether this loop should even exist: it seems like it is re-doing the "connect block successors and predecessors" work that `Func::add_edge` is already doing (TODO).
1 parent eb0db5b commit 98e8862

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

src/fuzzing/func.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -343,18 +343,14 @@ impl Func {
343343
let succ = *u.choose(&in_blocks[..])?;
344344
builder.add_edge(Block::new(pred), Block::new(succ));
345345
}
346-
347346
builder.compute_doms();
348347

349348
for block in 0..num_blocks {
350349
builder.f.block_preds[block].clear();
351-
}
352-
for block in 0..num_blocks {
353350
for &succ in &builder.f.block_succs[block] {
354351
builder.f.block_preds[succ.index()].push(Block::new(block));
355352
}
356353
}
357-
358354
builder.compute_doms();
359355

360356
let alloc_vreg = |builder: &mut FuncBuilder, u: &mut Unstructured| {

0 commit comments

Comments
 (0)