Skip to content

Commit

Permalink
footer needs to be empty too
Browse files Browse the repository at this point in the history
  • Loading branch information
oflatt committed Oct 30, 2024
1 parent f2f40cc commit 7122432
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/rvsdg/optimize_direct_jumps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use bril_rs::{Instruction, ValueOps};
use indexmap::IndexMap;
use petgraph::{
stable_graph::{NodeIndex, StableDiGraph, StableGraph},
visit::{DfsPostOrder, EdgeRef, IntoEdgeReferences},
visit::{DfsPostOrder, EdgeRef},
Direction,
};

Expand Down Expand Up @@ -176,7 +176,7 @@ impl SimpleCfgFunction {
let mut to_remove = vec![];
for node in self.graph.node_indices().collect::<Vec<_>>() {
// empty block with a single direct jump out
if self.graph[node].instrs.is_empty() {
if self.graph[node].instrs.is_empty() && self.graph[node].footer.is_empty() {
if let [single_child] = self
.graph
.edges_directed(node, Direction::Outgoing)
Expand Down

0 comments on commit 7122432

Please sign in to comment.