I'm not sure how to describe the code pattern in the test based on:
...but if the IfCond is itself the phi that we are trying to remove, then the loop at line 2835 can end up with something like:
%cmp = select i1 %cmp, i1 false, i1 true
And that can then lead to an assert somewhere else (although I'm still not seeing that locally in my release + asserts build). I think this can only happen with unreachable code.