[llvm] [NewPM][CodeGen] Add `FunctionToMachineFunctionAnalysis` (PR #88610)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 18 00:34:04 PDT 2024
================
@@ -0,0 +1,48 @@
+//===- FunctionToMachineFunctionAnalysis.cpp ------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// This file contains the definitions of the FunctionToMachineFunctionAnalysis
+// members.
+//
+//===----------------------------------------------------------------------===//
+
+#include "llvm/CodeGen/FunctionToMachineFunctionAnalysis.h"
+#include "llvm/CodeGen/MachineFunction.h"
+#include "llvm/CodeGen/MachineModuleInfo.h"
+#include "llvm/Target/TargetMachine.h"
+#include <atomic>
+
+using namespace llvm;
+
+AnalysisKey FunctionToMachineFunctionAnalysis::Key;
+
+bool FunctionToMachineFunctionAnalysis::Result::invalidate(
+ Function &, const PreservedAnalyses &PA,
+ FunctionAnalysisManager::Invalidator &) {
+ // Unless it is invalidated explicitly, it should remain preserved.
+ auto PAC = PA.getChecker<FunctionToMachineFunctionAnalysis>();
----------------
paperchalice wrote:
IR analyses are unconditional preserved in `MachinePassModel`.
https://github.com/llvm/llvm-project/pull/88610
More information about the llvm-commits
mailing list