This patch precommits tests that expose bugs in BasicBlock::removePredecessor.
In certain cases calling this function breaks SSA form.
Those bugs will be fixed in upcoming patches.
I think it doesn't happen for non-dead code. Otherwise, verifier would tell us about that.
Please can you be more specific?
I don't have a test case for LLVM where this would cause miscompilation or compiler crash. But I ran into issues in our downstream. If you look from an API perspective, BasicBlock::removePredecessor violates its 'contract'. I mean it could leave broken code after itself. And we are not sure noone will use this code afterwards.
Moreover, implementation of BasicBlock::removePredecessor has serious issue and happens to work just by luck. I will upload the fix to showcase this.
As for the second part, yes, the repro in the LLVM bug tracker is no longer valid. You can find small examples in the unittests attached to this patch.