[llvm-branch-commits] [llvm] [CodeGen][NPM] Introduce FreeAllAnalysesPass (PR #139517)
via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Mon May 12 02:48:22 PDT 2025
================
@@ -45,3 +45,9 @@ MachineFunctionAnalysis::run(Function &F, FunctionAnalysisManager &FAM) {
return Result(std::move(MF));
}
+
+PreservedAnalyses FreeAllAnalysesPass::run(Function &F,
+ FunctionAnalysisManager &FAM) {
+ FAM.clear(F, F.getName());
----------------
paperchalice wrote:
That is too aggressive, `clear` is used when corresponding IR (here is the function) is removed. I'd prefer a full template specialization for `InvalidateAnalysisPass`, which release the machine function and related analysis results.
https://github.com/llvm/llvm-project/pull/139517
More information about the llvm-branch-commits
mailing list