Simplifying a loop latch changes the IR and we need to make sure the pass manager knows to invalidate analysis passes if that happened.
PR35210 discovered a case where we failed to invalidate the post dominator tree after this simplification because we no changes other than simplifying the loop latch.
I'm still trying to put together a reduced test that triggers only the latch simplification, but I don't know anything about this pass so if anyone wants to help that would be great.
Fixes PR35210.
I don't remember this exactly, but DEBUG implies REQUIRES: assert?