This does some non-functional cleanup of exit folding during unrolling. The two main changes are:
- First rewrite latch->header edges, which is unrelated to exit folding.
- Combine folding for latch and non-latch exits. After the previous change, these use the same logic, with the caveat that for non-latch exits we currently only fold "known non-exit" cases, but not "known exit" cases.
I think this helps a lot to clarify this code and prepare it for future changes.