According to the comment in the code SIFixSGPRCopies claims that it check if PHI is uniform by examination of the terminator of the nearest common dominator of the joined values.
- nearest common dominator check is not sufficient for control dependency analysis (see https://www.cs.rice.edu/~keith/EMBED/dom.pdf for details)
- Current code does not even does what the comments claims. It really turn PHI (and all it's uses) to vector if any of the PHI's parent block predecessors is divergent.
This change introduces post-dominance frontiers computing procedure and uses the results to decide if the PHI is divergent.