LLVM 20.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
20
21namespace llvm {
22
25
26/// Legacy analysis pass which computes a \ref MachineCycleInfo.
28 MachineFunction *F = nullptr;
30
31public:
32 static char ID;
33
35
37 const MachineCycleInfo &getCycleInfo() const { return CI; }
38
39 bool runOnMachineFunction(MachineFunction &F) override;
40 void getAnalysisUsage(AnalysisUsage &AU) const override;
41 void releaseMemory() override;
42 void print(raw_ostream &OS, const Module *M = nullptr) const override;
43};
44
45// TODO: add this function to GenericCycle template after implementing IR
46// version.
47bool isCycleInvariant(const MachineCycle *Cycle, MachineInstr &I);
48
49} // end namespace llvm
50
51#endif // LLVM_CODEGEN_MACHINECYCLEANALYSIS_H
Find all cycles in a control-flow graph, including irreducible loops.
#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
Represent the analysis usage information of a pass.
GenericCycle< MachineSSAContext > CycleT
Legacy analysis pass which computes a MachineCycleInfo.
void releaseMemory() override
releaseMemory() - This member can be implemented by a pass if it wants to be able to release its memo...
void print(raw_ostream &OS, const Module *M=nullptr) const override
print - Print out the internal state of the pass.
const MachineCycleInfo & getCycleInfo() const
bool runOnMachineFunction(MachineFunction &F) override
runOnMachineFunction - This method must be overloaded to perform the desired machine code transformat...
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - This function should be overriden by passes that need analysis information to do t...
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:65
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:52
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
bool isCycleInvariant(const MachineCycle *Cycle, MachineInstr &I)
MachineCycleInfo::CycleT MachineCycle
CycleInfo::CycleT Cycle
Definition: CycleInfo.h:24