In the example based on:
https://llvm.org/PR49218
...we are crashing because poison is a subclass of undef, so we merge blocks and create:
PHI node has multiple entries for the same basic block with different incoming values! %k3 = phi i64 [ poison, %entry ], [ %k3, %g ], [ undef, %entry ]
I think we could soften the poison to undef, but it seems unlikely that this would matter in any real code.
It looks like we didn't merge them after all?