LLVM
20.0.0git
include
llvm
Analysis
CycleAnalysis.h
Go to the documentation of this file.
1
//===- CycleAnalysis.h - Cycle Info for LLVM 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
/// \file
9
///
10
/// This file declares an analysis pass that computes CycleInfo for
11
/// LLVM IR, specialized from GenericCycleInfo.
12
///
13
//===----------------------------------------------------------------------===//
14
15
#ifndef LLVM_ANALYSIS_CYCLEANALYSIS_H
16
#define LLVM_ANALYSIS_CYCLEANALYSIS_H
17
18
#include "
llvm/IR/CycleInfo.h
"
19
#include "
llvm/IR/PassManager.h
"
20
#include "
llvm/IR/SSAContext.h
"
21
#include "
llvm/Pass.h
"
22
23
namespace
llvm
{
24
25
/// Legacy analysis pass which computes a \ref CycleInfo.
26
class
CycleInfoWrapperPass
:
public
FunctionPass
{
27
Function
*F =
nullptr
;
28
CycleInfo
CI;
29
30
public
:
31
static
char
ID
;
32
33
CycleInfoWrapperPass
();
34
35
CycleInfo
&
getResult
() {
return
CI; }
36
const
CycleInfo
&
getResult
()
const
{
return
CI; }
37
38
bool
runOnFunction
(
Function
&F)
override
;
39
void
getAnalysisUsage
(
AnalysisUsage
&AU)
const override
;
40
void
releaseMemory
()
override
;
41
void
print
(
raw_ostream
&
OS
,
const
Module
*M =
nullptr
)
const override
;
42
43
// TODO: verify analysis?
44
};
45
46
/// Analysis pass which computes a \ref CycleInfo.
47
class
CycleAnalysis
:
public
AnalysisInfoMixin
<CycleAnalysis> {
48
friend
AnalysisInfoMixin<CycleAnalysis>
;
49
static
AnalysisKey
Key;
50
51
public
:
52
/// Provide the result typedef for this analysis pass.
53
using
Result
=
CycleInfo
;
54
55
using
LegacyWrapper
=
CycleInfoWrapperPass
;
56
57
/// Run the analysis pass over a function and produce a dominator tree.
58
CycleInfo
run
(
Function
&
F
,
FunctionAnalysisManager
&);
59
60
// TODO: verify analysis?
61
};
62
63
/// Printer pass for the \c DominatorTree.
64
class
CycleInfoPrinterPass
:
public
PassInfoMixin
<CycleInfoPrinterPass> {
65
raw_ostream
&OS;
66
67
public
:
68
explicit
CycleInfoPrinterPass
(
raw_ostream
&
OS
);
69
70
PreservedAnalyses
run
(
Function
&
F
,
FunctionAnalysisManager
&AM);
71
72
static
bool
isRequired
() {
return
true
; }
73
};
74
75
}
// end namespace llvm
76
77
#endif
// LLVM_ANALYSIS_CYCLEANALYSIS_H
CycleInfo.h
This file declares the LLVM IR specialization of the GenericCycle templates.
F
#define F(x, y, z)
Definition:
MD5.cpp:55
PassManager.h
This header defines various interfaces for pass management in LLVM.
Pass.h
SSAContext.h
This file declares a specialization of the GenericSSAContext<X> class template for LLVM IR.
OS
raw_pwrite_stream & OS
Definition:
SampleProfWriter.cpp:53
llvm::AnalysisManager
A container for analyses that lazily runs them and caches their results.
Definition:
PassManager.h:253
llvm::AnalysisUsage
Represent the analysis usage information of a pass.
Definition:
PassAnalysisSupport.h:47
llvm::CycleAnalysis
Analysis pass which computes a CycleInfo.
Definition:
CycleAnalysis.h:47
llvm::CycleAnalysis::run
CycleInfo run(Function &F, FunctionAnalysisManager &)
Run the analysis pass over a function and produce a dominator tree.
Definition:
CycleAnalysis.cpp:20
llvm::CycleInfoPrinterPass
Printer pass for the DominatorTree.
Definition:
CycleAnalysis.h:64
llvm::CycleInfoPrinterPass::isRequired
static bool isRequired()
Definition:
CycleAnalysis.h:72
llvm::CycleInfoPrinterPass::run
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM)
Definition:
CycleAnalysis.cpp:30
llvm::CycleInfoWrapperPass
Legacy analysis pass which computes a CycleInfo.
Definition:
CycleAnalysis.h:26
llvm::CycleInfoWrapperPass::getAnalysisUsage
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - This function should be overriden by passes that need analysis information to do t...
Definition:
CycleAnalysis.cpp:58
llvm::CycleInfoWrapperPass::CycleInfoWrapperPass
CycleInfoWrapperPass()
Definition:
CycleAnalysis.cpp:49
llvm::CycleInfoWrapperPass::ID
static char ID
Definition:
CycleAnalysis.h:31
llvm::CycleInfoWrapperPass::print
void print(raw_ostream &OS, const Module *M=nullptr) const override
print - Print out the internal state of the pass.
Definition:
CycleAnalysis.cpp:70
llvm::CycleInfoWrapperPass::runOnFunction
bool runOnFunction(Function &F) override
runOnFunction - Virtual method overriden by subclasses to do the per-function processing of the pass.
Definition:
CycleAnalysis.cpp:62
llvm::CycleInfoWrapperPass::getResult
CycleInfo & getResult()
Definition:
CycleAnalysis.h:35
llvm::CycleInfoWrapperPass::releaseMemory
void releaseMemory() override
releaseMemory() - This member can be implemented by a pass if it wants to be able to release its memo...
Definition:
CycleAnalysis.cpp:75
llvm::CycleInfoWrapperPass::getResult
const CycleInfo & getResult() const
Definition:
CycleAnalysis.h:36
llvm::FunctionPass
FunctionPass class - This class is used to implement most global optimizations.
Definition:
Pass.h:310
llvm::Function
Definition:
Function.h:64
llvm::GenericCycleInfo< SSAContext >
llvm::Module
A Module instance is used to store all the information related to an LLVM module.
Definition:
Module.h:65
llvm::PreservedAnalyses
A set of analyses that are preserved following a run of a transformation pass.
Definition:
Analysis.h:111
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::CycleInfo
GenericCycleInfo< SSAContext > CycleInfo
Definition:
CycleInfo.h:23
llvm::AnalysisInfoMixin
A CRTP mix-in that provides informational APIs needed for analysis passes.
Definition:
PassManager.h:92
llvm::AnalysisKey
A special type used by analysis passes to provide an address that identifies that particular analysis...
Definition:
Analysis.h:28
llvm::PassInfoMixin
A CRTP mix-in to automatically provide informational APIs needed for passes.
Definition:
PassManager.h:69
Generated on Mon Oct 7 2024 19:01:59 for LLVM by
1.9.6