On Thu Jan 25 14:58:17 2024 +0000, Conor McCarthy wrote:
Do validation failures occur without this? AFAIK it's still valid to have a `phi` incoming from the original `switch` block. If block `1` contained the `switch`, block `5` is a switch case, and the conditional branch to `5` could instead branch to a new label `11`, we can still have incomings from `1` and `5`. If control flowed through `5` it gets the second value, otherwise it get the first.
Right now if I disable this I get failures in the following pass to materialize SSAs to TEMPs, precisely because a PHI node misses a reference to one of its own immediate predecessors. I've seen this happening only with cases that have no code (i.e., `case 3: break;`), for which DXC generates a jump directly to the merge block. So the merge block has the switch block as predecessor, and then PHI nodes there must be fixed up.