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.
Just wondering, why std::tuple rather than std::pair?