Related to https://reviews.llvm.org/D80916
When calling on-the-fly passes from the legacy pass manager, the modification status is not reported, which is a problem in case we depend on an acutal transformation pass, and not only analyse.
Update the Legacy PM API to optionally report the changed status, assert if a change is detected but this change is lost.
Use that API for LoopExtractor where it's mandatory to pass the validation.
Maybe I am missing something, but isn't LoopExtractor dependent on BreakCriticalEdges? I mean, what are the transformations that the LoopInfo analysis depends on?