Simplify back-edge logic.

This commit is contained in:
Camille GILLOT 2023-05-17 12:18:55 +00:00
parent ada7f1c2c4
commit 8c2c695c9e

View File

@ -47,7 +47,7 @@ fn has_back_edge(
return false;
}
// Check if any of the dominators of the node are also the node's successor.
doms.dominators(node).any(|dom| node_data.terminator().successors().any(|succ| succ == dom))
node_data.terminator().successors().any(|succ| doms.dominates(succ, node))
}
fn insert_counter(basic_block_data: &mut BasicBlockData<'_>) {