[PATCH] D152552: [CodeGenPrepare] Implement releaseMemory

Sven van Haastregt via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 9 09:29:09 PDT 2023


svenvh created this revision.
svenvh added a project: LLVM.
Herald added subscribers: hiraditya, kristof.beyls.
Herald added a project: All.
svenvh requested review of this revision.
Herald added a subscriber: llvm-commits.

Release BlockFrequencyInfo and BranchProbabilityInfo results
immediately afterwards, instead of holding onto the memory until the
next `CodeGenPrepare::runOnFunction` call.

Co-authored-by: Erik Hogeman <erik.hogeman at arm.com>


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D152552

Files:
  llvm/lib/CodeGen/CodeGenPrepare.cpp


Index: llvm/lib/CodeGen/CodeGenPrepare.cpp
===================================================================
--- llvm/lib/CodeGen/CodeGenPrepare.cpp
+++ llvm/lib/CodeGen/CodeGenPrepare.cpp
@@ -377,6 +377,11 @@
 
   bool runOnFunction(Function &F) override;
 
+  void releaseMemory() override {
+    BPI.reset();
+    BFI.reset();
+  }
+
   StringRef getPassName() const override { return "CodeGen Prepare"; }
 
   void getAnalysisUsage(AnalysisUsage &AU) const override {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D152552.529986.patch
Type: text/x-patch
Size: 474 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230609/ce614d7b/attachment.bin>


More information about the llvm-commits mailing list