Simplified version of the example. As I eventually uncovered in #1342, the issue is cascading redundant phis not getting rewritten.