LLVM  16.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 #include "llvm/InitializePasses.h"
21 
22 namespace llvm {
23 
24 extern template class GenericCycleInfo<MachineSSAContext>;
25 extern template class GenericCycle<MachineSSAContext>;
26 
29 
30 /// Legacy analysis pass which computes a \ref MachineCycleInfo.
32  MachineFunction *F = nullptr;
34 
35 public:
36  static char ID;
37 
39 
40  MachineCycleInfo &getCycleInfo() { return CI; }
41  const MachineCycleInfo &getCycleInfo() const { return CI; }
42 
43  bool runOnMachineFunction(MachineFunction &F) override;
44  void getAnalysisUsage(AnalysisUsage &AU) const override;
45  void releaseMemory() override;
46  void print(raw_ostream &OS, const Module *M = nullptr) const override;
47 };
48 
49 // TODO: add this function to GenericCycle template after implementing IR
50 // version.
51 bool isCycleInvariant(const MachineCycle *Cycle, MachineInstr &I);
52 
53 } // end namespace llvm
54 
55 #endif // LLVM_CODEGEN_MACHINECYCLEANALYSIS_H
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
llvm::MachineCycle
MachineCycleInfo::CycleT MachineCycle
Definition: MachineCycleAnalysis.h:28
llvm::MachineFunctionPass
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
Definition: MachineFunctionPass.h:30
F
#define F(x, y, z)
Definition: MD5.cpp:55
llvm::GenericCycleInfo< MachineSSAContext >::CycleT
GenericCycle< MachineSSAContext > CycleT
Definition: GenericCycleInfo.h:227
llvm::AnalysisUsage
Represent the analysis usage information of a pass.
Definition: PassAnalysisSupport.h:47
llvm::isCycleInvariant
bool isCycleInvariant(const MachineCycle *Cycle, MachineInstr &I)
Definition: MachineCycleAnalysis.cpp:90
llvm::MachineCycleInfoWrapperPass::getCycleInfo
const MachineCycleInfo & getCycleInfo() const
Definition: MachineCycleAnalysis.h:41
llvm::raw_ostream
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:53
GenericCycleInfo.h
Find all cycles in a control-flow graph, including irreducible loops.
I
#define I(x, y, z)
Definition: MD5.cpp:58
MachineFunctionPass.h
llvm::Module
A Module instance is used to store all the information related to an LLVM module.
Definition: Module.h:66
llvm::MachineFunction
Definition: MachineFunction.h:257
llvm::print
Printable print(const GCNRegPressure &RP, const GCNSubtarget *ST=nullptr)
Definition: GCNRegPressure.cpp:138
MachineSSAContext.h
llvm::GenericCycleInfo< MachineSSAContext >
llvm::MachineCycleInfoWrapperPass::ID
static char ID
Definition: MachineCycleAnalysis.h:36
llvm::Cycle
CycleInfo::CycleT Cycle
Definition: CycleAnalysis.h:28
llvm::MachineCycleInfoWrapperPass
Legacy analysis pass which computes a MachineCycleInfo.
Definition: MachineCycleAnalysis.h:31
llvm::MachineCycleInfoWrapperPass::getCycleInfo
MachineCycleInfo & getCycleInfo()
Definition: MachineCycleAnalysis.h:40
InitializePasses.h