diff --git a/lib/Transforms/Scalar/Reassociate.cpp b/lib/Transforms/Scalar/Reassociate.cpp index 6b761c5bec7..75f646d1d43 100644 --- a/lib/Transforms/Scalar/Reassociate.cpp +++ b/lib/Transforms/Scalar/Reassociate.cpp @@ -2227,8 +2227,13 @@ PreservedAnalyses ReassociatePass::run(Function &F) { RankMap.clear(); ValueRankMap.clear(); - if (MadeChange) - return PreservedAnalyses::none(); + if (MadeChange) { + // FIXME: Reassociate should also 'preserve the CFG'. + // The new pass manager has currently no way to do it. + auto PA = PreservedAnalyses(); + PA.preserve(); + return PA; + } return PreservedAnalyses::all(); }