LLVM
20.0.0git
include
llvm
CodeGen
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
17
#include "
llvm/ADT/GenericCycleInfo.h
"
18
#include "
llvm/CodeGen/MachineFunctionPass.h
"
19
#include "
llvm/CodeGen/MachineSSAContext.h
"
20
21
namespace
llvm
{
22
23
using
MachineCycleInfo
=
GenericCycleInfo<MachineSSAContext>
;
24
using
MachineCycle
=
MachineCycleInfo::CycleT
;
25
26
/// Legacy analysis pass which computes a \ref MachineCycleInfo.
27
class
MachineCycleInfoWrapperPass
:
public
MachineFunctionPass
{
28
MachineFunction
*F =
nullptr
;
29
MachineCycleInfo
CI;
30
31
public
:
32
static
char
ID
;
33
34
MachineCycleInfoWrapperPass
();
35
36
MachineCycleInfo
&
getCycleInfo
() {
return
CI; }
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.
47
bool
isCycleInvariant
(
const
MachineCycle
*
Cycle
, MachineInstr &
I
);
48
49
}
// end namespace llvm
50
51
#endif
// LLVM_CODEGEN_MACHINECYCLEANALYSIS_H
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
MachineSSAContext.h
This file declares a specialization of the GenericSSAContext<X> template class for Machine IR.
OS
raw_pwrite_stream & OS
Definition:
SampleProfWriter.cpp:53
llvm::AnalysisUsage
Represent the analysis usage information of a pass.
Definition:
PassAnalysisSupport.h:47
llvm::GenericCycleInfo< MachineSSAContext >
llvm::GenericCycleInfo< MachineSSAContext >::CycleT
GenericCycle< MachineSSAContext > CycleT
Definition:
GenericCycleInfo.h:229
llvm::MachineCycleInfoWrapperPass
Legacy analysis pass which computes a MachineCycleInfo.
Definition:
MachineCycleAnalysis.h:27
llvm::MachineCycleInfoWrapperPass::releaseMemory
void releaseMemory() override
releaseMemory() - This member can be implemented by a pass if it wants to be able to release its memo...
Definition:
MachineCycleAnalysis.cpp:52
llvm::MachineCycleInfoWrapperPass::MachineCycleInfoWrapperPass
MachineCycleInfoWrapperPass()
Definition:
MachineCycleAnalysis.cpp:24
llvm::MachineCycleInfoWrapperPass::print
void print(raw_ostream &OS, const Module *M=nullptr) const override
print - Print out the internal state of the pass.
Definition:
MachineCycleAnalysis.cpp:47
llvm::MachineCycleInfoWrapperPass::getCycleInfo
const MachineCycleInfo & getCycleInfo() const
Definition:
MachineCycleAnalysis.h:37
llvm::MachineCycleInfoWrapperPass::runOnMachineFunction
bool runOnMachineFunction(MachineFunction &F) override
runOnMachineFunction - This method must be overloaded to perform the desired machine code transformat...
Definition:
MachineCycleAnalysis.cpp:39
llvm::MachineCycleInfoWrapperPass::getCycleInfo
MachineCycleInfo & getCycleInfo()
Definition:
MachineCycleAnalysis.h:36
llvm::MachineCycleInfoWrapperPass::ID
static char ID
Definition:
MachineCycleAnalysis.h:32
llvm::MachineCycleInfoWrapperPass::getAnalysisUsage
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - This function should be overriden by passes that need analysis information to do t...
Definition:
MachineCycleAnalysis.cpp:34
llvm::MachineFunctionPass
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
Definition:
MachineFunctionPass.h:30
llvm::MachineFunction
Definition:
MachineFunction.h:257
llvm::Module
A Module instance is used to store all the information related to an LLVM module.
Definition:
Module.h:65
llvm::raw_ostream
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition:
raw_ostream.h:52
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition:
AddressRanges.h:18
llvm::isCycleInvariant
bool isCycleInvariant(const MachineCycle *Cycle, MachineInstr &I)
Definition:
MachineCycleAnalysis.cpp:94
llvm::MachineCycle
MachineCycleInfo::CycleT MachineCycle
Definition:
MachineCycleAnalysis.h:24
llvm::Cycle
CycleInfo::CycleT Cycle
Definition:
CycleInfo.h:24
Generated on Mon Oct 14 2024 13:24:54 for LLVM by
1.9.6