LLVM  17.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 
21 namespace llvm {
22 
23 extern template class GenericCycleInfo<MachineSSAContext>;
24 extern template class GenericCycle<MachineSSAContext>;
25 
28 
29 /// Legacy analysis pass which computes a \ref MachineCycleInfo.
31  MachineFunction *F = nullptr;
33 
34 public:
35  static char ID;
36 
38 
39  MachineCycleInfo &getCycleInfo() { return CI; }
40  const MachineCycleInfo &getCycleInfo() const { return CI; }
41 
42  bool runOnMachineFunction(MachineFunction &F) override;
43  void getAnalysisUsage(AnalysisUsage &AU) const override;
44  void releaseMemory() override;
45  void print(raw_ostream &OS, const Module *M = nullptr) const override;
46 };
47 
48 // TODO: add this function to GenericCycle template after implementing IR
49 // version.
50 bool isCycleInvariant(const MachineCycle *Cycle, MachineInstr &I);
51 
52 } // end namespace llvm
53 
54 #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:27
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:229
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:94
llvm::MachineCycleInfoWrapperPass::getCycleInfo
const MachineCycleInfo & getCycleInfo() const
Definition: MachineCycleAnalysis.h:40
llvm::raw_ostream
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:52
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:65
llvm::MachineFunction
Definition: MachineFunction.h:258
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:35
llvm::Cycle
CycleInfo::CycleT Cycle
Definition: CycleAnalysis.h:28
llvm::MachineCycleInfoWrapperPass
Legacy analysis pass which computes a MachineCycleInfo.
Definition: MachineCycleAnalysis.h:30
llvm::MachineCycleInfoWrapperPass::getCycleInfo
MachineCycleInfo & getCycleInfo()
Definition: MachineCycleAnalysis.h:39