Breaking critical edges

Is the pass "Break Critical edges" acheives the same as edge-splitting
SSA, i.e., a node has either multiple predecessors or multiple
successors but not both. A node with multiple predecessors and
multiple successors is replaced by two consecutive nodes joined
together. The first node has multiple predecessors and second node as
its only successor. The second node has first node as its only
predecessor and has mutliple successors.

Hi Surinder,

Being “critical” is a property of an edge, rather than a node. An edge e = (n1, n2) is a critical edge if n1 has multiple successors and n2 has multiple predecessors. Once BreakCriticalEdges is run there will be no edge in the CFG with this property.

The way this works is that the BreakCriticalEdges pass will scan every edge e in the CFG. If e is critical then a new node, ne, will be inserted, along with new edges e1 = (n1, ne), and e2 = (ne, n2), and edge e will be removed. The edge e1 is not critical (it has only one successor, which is ne), and the edge e2 is not critical (it has only one predecessor, which is ne). So this eliminates the critical edge.