LLVM 22.0.0git
MachineCycleAnalysis.h
Go to the documentation of this file.
1//===- MachineCycleAnalysis.h - Cycle Info for Machine IR -------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// This file defines the MachineCycleInfo class, which is a thin wrapper over
10// the Machine IR instance of GenericCycleInfo.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_CODEGEN_MACHINECYCLEANALYSIS_H
15#define LLVM_CODEGEN_MACHINECYCLEANALYSIS_H
16
22
23namespace llvm {
24
27
28/// Legacy analysis pass which computes a \ref MachineCycleInfo.
30 MachineFunction *F = nullptr;
32
33public:
34 static char ID;
35
37
39 const MachineCycleInfo &getCycleInfo() const { return CI; }
40
41 bool runOnMachineFunction(MachineFunction &F) override;
42 void getAnalysisUsage(AnalysisUsage &AU) const override;
43 void releaseMemory() override;
44 void print(raw_ostream &OS, const Module *M = nullptr) const override;
45};
46
47// TODO: add this function to GenericCycle template after implementing IR
48// version.
49LLVM_ABI bool isCycleInvariant(const MachineCycle *Cycle, MachineInstr &I);
50
51class MachineCycleAnalysis : public AnalysisInfoMixin<MachineCycleAnalysis> {
53 LLVM_ABI static AnalysisKey Key;
54
55public:
57
60};
61
63 : public PassInfoMixin<MachineCycleInfoPrinterPass> {
64 raw_ostream &OS;
65
66public:
70 static bool isRequired() { return true; }
71};
72
73} // end namespace llvm
74
75#endif // LLVM_CODEGEN_MACHINECYCLEANALYSIS_H
static void print(raw_ostream &Out, object::Archive::Kind Kind, T Val)
#define LLVM_ABI
Definition: Compiler.h:213
Find all cycles in a control-flow graph, including irreducible loops.
#define F(x, y, z)
Definition: MD5.cpp:55
#define I(x, y, z)
Definition: MD5.cpp:58
This file declares a specialization of the GenericSSAContext<X> template class for Machine IR.
raw_pwrite_stream & OS
A container for analyses that lazily runs them and caches their results.
Definition: PassManager.h:255
Represent the analysis usage information of a pass.
GenericCycle< MachineSSAContext > CycleT
LLVM_ABI Result run(MachineFunction &MF, MachineFunctionAnalysisManager &MFAM)
LLVM_ABI PreservedAnalyses run(MachineFunction &MF, MachineFunctionAnalysisManager &MFAM)
Legacy analysis pass which computes a MachineCycleInfo.
const MachineCycleInfo & getCycleInfo() const
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
A Module instance is used to store all the information related to an LLVM module.
Definition: Module.h:67
A set of analyses that are preserved following a run of a transformation pass.
Definition: Analysis.h:112
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:53
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
LLVM_ABI bool isCycleInvariant(const MachineCycle *Cycle, MachineInstr &I)
MachineCycleInfo::CycleT MachineCycle
CycleInfo::CycleT Cycle
Definition: CycleInfo.h:24
GenericCycleInfo< MachineSSAContext > MachineCycleInfo
A CRTP mix-in that provides informational APIs needed for analysis passes.
Definition: PassManager.h:93
A special type used by analysis passes to provide an address that identifies that particular analysis...
Definition: Analysis.h:29
A CRTP mix-in to automatically provide informational APIs needed for passes.
Definition: PassManager.h:70