You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Utils] Fix incorrect LCSSA PHI nodes when splitting critical edges with MergeIdenticalEdges
When splitting a critical edge from a block with multiple identical
edges to an exit block while both `PreserveLCSSA` and
`MergeIdenticalEdges` are enabled, the generated LCSSA PHI
nodes in the split block would miss incoming values from merged edges.
This occurs because:
1. `MergeIdenticalEdges` merges multiple identical edges into a single
edge to the new split block.
2. `PreserveLCSSA` (in `createPHIsForSplitLoopExit`) previously assumed
only one incoming edge from the original block, creating PHI nodes
with incomplete predecessors.
The fix modifies `createPHIsForSplitLoopExit` to account for merged
edges by passing all original predecessor entries (matching the number
of merged edges) when creating PHI nodes.
This ensures all incoming values are properly reflected in the split
block's PHI nodes.
Add unittest case in `BasicBlockUtilsTest.cpp` to verify the correction
of PHI node generation in this scenario.
0 commit comments