LLVM
20.0.0git
include
llvm
Analysis
UniformityAnalysis.h
Go to the documentation of this file.
1
//===- UniformityAnalysis.h ---------------------*- 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
/// \file
10
/// \brief LLVM IR instance of the generic uniformity analysis
11
//
12
//===----------------------------------------------------------------------===//
13
14
#ifndef LLVM_ANALYSIS_UNIFORMITYANALYSIS_H
15
#define LLVM_ANALYSIS_UNIFORMITYANALYSIS_H
16
17
#include "
llvm/ADT/GenericUniformityInfo.h
"
18
#include "
llvm/IR/PassManager.h
"
19
#include "
llvm/IR/SSAContext.h
"
20
#include "
llvm/Pass.h
"
21
22
namespace
llvm
{
23
24
extern
template
class
GenericUniformityInfo<SSAContext>;
25
using
UniformityInfo
=
GenericUniformityInfo<SSAContext>
;
26
27
/// Analysis pass which computes \ref UniformityInfo.
28
class
UniformityInfoAnalysis
29
:
public
AnalysisInfoMixin<UniformityInfoAnalysis>
{
30
friend
AnalysisInfoMixin<UniformityInfoAnalysis>
;
31
static
AnalysisKey
Key;
32
33
public
:
34
/// Provide the result typedef for this analysis pass.
35
using
Result
=
UniformityInfo
;
36
37
/// Run the analysis pass over a function and produce a dominator tree.
38
UniformityInfo
run(
Function
&
F
,
FunctionAnalysisManager
&);
39
40
// TODO: verify analysis
41
};
42
43
/// Printer pass for the \c UniformityInfo.
44
class
UniformityInfoPrinterPass
45
:
public
PassInfoMixin<UniformityInfoPrinterPass>
{
46
raw_ostream
&
OS
;
47
48
public
:
49
explicit
UniformityInfoPrinterPass
(
raw_ostream
&
OS
);
50
51
PreservedAnalyses
run(
Function
&
F
,
FunctionAnalysisManager
&AM);
52
53
static
bool
isRequired
() {
return
true
; }
54
};
55
56
/// Legacy analysis pass which computes a \ref CycleInfo.
57
class
UniformityInfoWrapperPass
:
public
FunctionPass
{
58
Function
*m_function =
nullptr
;
59
UniformityInfo
m_uniformityInfo;
60
61
public
:
62
static
char
ID
;
63
64
UniformityInfoWrapperPass
();
65
66
UniformityInfo
&
getUniformityInfo
() {
return
m_uniformityInfo; }
67
const
UniformityInfo
&
getUniformityInfo
()
const
{
return
m_uniformityInfo; }
68
69
bool
runOnFunction
(
Function
&
F
)
override
;
70
void
getAnalysisUsage(
AnalysisUsage
&AU)
const override
;
71
void
releaseMemory()
override
;
72
void
print
(
raw_ostream
&
OS
,
const
Module
*M =
nullptr
)
const override
;
73
74
// TODO: verify analysis
75
};
76
77
}
// namespace llvm
78
79
#endif
// LLVM_ANALYSIS_UNIFORMITYANALYSIS_H
runOnFunction
static bool runOnFunction(Function &F, bool PostInlining)
Definition:
EntryExitInstrumenter.cpp:83
GenericUniformityInfo.h
PassManager.h
This header defines various interfaces for pass management in LLVM.
F
#define F(x, y, z)
Definition:
MD5.cpp:55
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:51
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::FunctionPass
FunctionPass class - This class is used to implement most global optimizations.
Definition:
Pass.h:310
llvm::Function
Definition:
Function.h:63
llvm::GenericUniformityInfo< 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::UniformityInfoAnalysis
Analysis pass which computes UniformityInfo.
Definition:
UniformityAnalysis.h:29
llvm::UniformityInfoPrinterPass
Printer pass for the UniformityInfo.
Definition:
UniformityAnalysis.h:45
llvm::UniformityInfoPrinterPass::isRequired
static bool isRequired()
Definition:
UniformityAnalysis.h:53
llvm::UniformityInfoWrapperPass
Legacy analysis pass which computes a CycleInfo.
Definition:
UniformityAnalysis.h:57
llvm::UniformityInfoWrapperPass::getUniformityInfo
const UniformityInfo & getUniformityInfo() const
Definition:
UniformityAnalysis.h:67
llvm::UniformityInfoWrapperPass::ID
static char ID
Definition:
UniformityAnalysis.h:62
llvm::UniformityInfoWrapperPass::getUniformityInfo
UniformityInfo & getUniformityInfo()
Definition:
UniformityAnalysis.h:66
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::print
Printable print(const GCNRegPressure &RP, const GCNSubtarget *ST=nullptr)
Definition:
GCNRegPressure.cpp:227
llvm::UniformityInfo
GenericUniformityInfo< SSAContext > UniformityInfo
Definition:
UniformityAnalysis.h:25
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 Fri Dec 20 2024 00:33:00 for LLVM by
1.9.6