Have dead-branch-elim handle conditional exits from selections. (#1850)
When dead-branch-elim folds a conditional branch, it also deletes the OpSelectionMerge instruction. If that construct contains a conditional branch to the merge node, it will not have its own OpSelectionMerge. When the headers merge instruction is deleted, the the inner conditional branch will no longer be legal. It will be a selection to a node that is not a merge node. We fix this up by moving the OpSelectionMerge to a new location if it is still needed.
Loading
Please register or sign in to comment