[PATCH] D21040: [PM] Preserve GlobalsAA for SROA

Davide Italiano via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 6 13:20:57 PDT 2016


davide created this revision.
davide added reviewers: chandlerc, bogner, sanjoy, dberlin.
davide added a subscriber: llvm-commits.

Same question as GVN, is this really just an oversight or something intended?
Also, this should "preserve the CFG" but we all know there's no way to do that in the new PM yet etc..  

http://reviews.llvm.org/D21040

Files:
  lib/Transforms/Scalar/SROA.cpp

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<GlobalsAA>();
+  return PA;
 }
 
 PreservedAnalyses SROA::run(Function &F, AnalysisManager<Function> &AM) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D21040.59773.patch
Type: text/x-patch
Size: 658 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160606/ca92430e/attachment.bin>


More information about the llvm-commits mailing list