Index: lib/Transforms/Scalar/SROA.cpp =================================================================== --- lib/Transforms/Scalar/SROA.cpp +++ lib/Transforms/Scalar/SROA.cpp @@ -4232,9 +4232,14 @@ PostPromotionWorklist.clear(); } while (!Worklist.empty()); + if (!Changed) + return PreservedAnalyses::all(); + // FIXME: Even when promoting allocas we should preserve some abstract set of // CFG-specific analyses. - return Changed ? PreservedAnalyses::none() : PreservedAnalyses::all(); + PreservedAnalyses PA; + PA.preserve(); + return PA; } PreservedAnalyses SROA::run(Function &F, AnalysisManager &AM) {