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/Analysis/CycleAnalysis.h
"
19
20
namespace
llvm
{
21
22
extern
template
class
GenericUniformityInfo<SSAContext>;
23
using
UniformityInfo
=
GenericUniformityInfo<SSAContext>
;
24
25
/// Analysis pass which computes \ref UniformityInfo.
26
class
UniformityInfoAnalysis
27
:
public
AnalysisInfoMixin<UniformityInfoAnalysis>
{
28
friend
AnalysisInfoMixin<UniformityInfoAnalysis>
;
29
static
AnalysisKey
Key;
30
31
public
:
32
/// Provide the result typedef for this analysis pass.
33
using
Result
=
UniformityInfo
;
34
35
/// Run the analysis pass over a function and produce a dominator tree.
36
UniformityInfo
run(
Function
&
F
,
FunctionAnalysisManager
&);
37
38
// TODO: verify analysis
39
};
40
41
/// Printer pass for the \c UniformityInfo.
42
class
UniformityInfoPrinterPass
43
:
public
PassInfoMixin<UniformityInfoPrinterPass>
{
44
raw_ostream
&
OS
;
45
46
public
:
47
explicit
UniformityInfoPrinterPass
(
raw_ostream
&
OS
);
48
49
PreservedAnalyses
run(
Function
&
F
,
FunctionAnalysisManager
&AM);
50
51
static
bool
isRequired
() {
return
true
; }
52
};
53
54
/// Legacy analysis pass which computes a \ref CycleInfo.
55
class
UniformityInfoWrapperPass
:
public
FunctionPass
{
56
Function
*m_function =
nullptr
;
57
UniformityInfo
m_uniformityInfo;
58
59
public
:
60
static
char
ID
;
61
62
UniformityInfoWrapperPass
();
63
64
UniformityInfo
&
getUniformityInfo
() {
return
m_uniformityInfo; }
65
const
UniformityInfo
&
getUniformityInfo
()
const
{
return
m_uniformityInfo; }
66
67
bool
runOnFunction
(
Function
&
F
)
override
;
68
void
getAnalysisUsage(
AnalysisUsage
&AU)
const override
;
69
void
releaseMemory()
override
;
70
void
print
(
raw_ostream
&
OS
,
const
Module
*M =
nullptr
)
const override
;
71
72
// TODO: verify analysis
73
};
74
75
}
// namespace llvm
76
77
#endif
// LLVM_ANALYSIS_UNIFORMITYANALYSIS_H
CycleAnalysis.h
This file declares an analysis pass that computes CycleInfo for LLVM IR, specialized from GenericCycl...
runOnFunction
static bool runOnFunction(Function &F, bool PostInlining)
Definition:
EntryExitInstrumenter.cpp:83
GenericUniformityInfo.h
F
#define F(x, y, z)
Definition:
MD5.cpp:55
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::FunctionPass
FunctionPass class - This class is used to implement most global optimizations.
Definition:
Pass.h:310
llvm::Function
Definition:
Function.h:64
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:27
llvm::UniformityInfoPrinterPass
Printer pass for the UniformityInfo.
Definition:
UniformityAnalysis.h:43
llvm::UniformityInfoPrinterPass::isRequired
static bool isRequired()
Definition:
UniformityAnalysis.h:51
llvm::UniformityInfoWrapperPass
Legacy analysis pass which computes a CycleInfo.
Definition:
UniformityAnalysis.h:55
llvm::UniformityInfoWrapperPass::getUniformityInfo
const UniformityInfo & getUniformityInfo() const
Definition:
UniformityAnalysis.h:65
llvm::UniformityInfoWrapperPass::ID
static char ID
Definition:
UniformityAnalysis.h:60
llvm::UniformityInfoWrapperPass::getUniformityInfo
UniformityInfo & getUniformityInfo()
Definition:
UniformityAnalysis.h:64
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:226
llvm::UniformityInfo
GenericUniformityInfo< SSAContext > UniformityInfo
Definition:
UniformityAnalysis.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 00:36:55 for LLVM by
1.9.6