Fix bugs in cfg_simplify! (#46643)
cfg_simplify! had several issues that showed up on particular IR
patterns, so this rewrites most of the problematic parts to
address the issues that I saw. Unfortunately, we currently don't
really have a good way to comprehensively test this, so we'll
probably want to build some test harnesses for this at some
point. For the time being, this works on the big IR I generated,
which I think is a reasonable some test, even if not perfect.