From 16e96d4b168786676350904bd6c3449d42875550 Mon Sep 17 00:00:00 2001 From: Davide Italiano Date: Tue, 7 Jun 2016 13:21:17 +0000 Subject: [PATCH] [PM] Preserve GlobalsAA for SROA. Differential Revision: http://reviews.llvm.org/D21040 llvm-svn: 272009 --- llvm/lib/Transforms/Scalar/SROA.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/llvm/lib/Transforms/Scalar/SROA.cpp b/llvm/lib/Transforms/Scalar/SROA.cpp index dbc49930f83b..cbe36861a67d 100644 --- a/llvm/lib/Transforms/Scalar/SROA.cpp +++ b/llvm/lib/Transforms/Scalar/SROA.cpp @@ -4232,9 +4232,14 @@ PreservedAnalyses SROA::runImpl(Function &F, DominatorTree &RunDT, 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) {