Override invalidate of ProfileSummaryInfo to return false.
authorEaswaran Raman <eraman@google.com>
Fri, 5 May 2017 22:15:09 +0000 (22:15 +0000)
committerEaswaran Raman <eraman@google.com>
Fri, 5 May 2017 22:15:09 +0000 (22:15 +0000)
Differential revision: https://reviews.llvm.org/D32775

llvm-svn: 302308

llvm/include/llvm/Analysis/ProfileSummaryInfo.h

index 1aec35c..75c4cbd 100644 (file)
@@ -54,6 +54,18 @@ public:
   ProfileSummaryInfo(Module &M) : M(M) {}
   ProfileSummaryInfo(ProfileSummaryInfo &&Arg)
       : M(Arg.M), Summary(std::move(Arg.Summary)) {}
+
+  /// Handle the invalidation of this information.
+  ///
+  /// When used as a result of \c ProfileSummaryAnalysis this method will be
+  /// called when the module this was computed for changes. Since profile
+  /// summary is immutable after it is annotated on the module, we return false
+  /// here.
+  bool invalidate(Module &, const PreservedAnalyses &,
+                  ModuleAnalysisManager::Invalidator &) {
+    return false;
+  }
+
   /// Returns the profile count for \p CallInst.
   static Optional<uint64_t> getProfileCount(const Instruction *CallInst,
                                             BlockFrequencyInfo *BFI);