LLVM 20.0.0git
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
18#include "llvm/IR/PassManager.h"
19#include "llvm/IR/SSAContext.h"
20#include "llvm/Pass.h"
21
22namespace llvm {
23
24extern template class GenericUniformityInfo<SSAContext>;
26
27/// Analysis pass which computes \ref UniformityInfo.
31 static AnalysisKey Key;
32
33public:
34 /// Provide the result typedef for this analysis pass.
36
37 /// Run the analysis pass over a function and produce a dominator tree.
39
40 // TODO: verify analysis
41};
42
43/// Printer pass for the \c UniformityInfo.
47
48public:
50
52
53 static bool isRequired() { return true; }
54};
55
56/// Legacy analysis pass which computes a \ref CycleInfo.
58 Function *m_function = nullptr;
59 UniformityInfo m_uniformityInfo;
60
61public:
62 static char ID;
63
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
static bool runOnFunction(Function &F, bool PostInlining)
This header defines various interfaces for pass management in LLVM.
#define F(x, y, z)
Definition: MD5.cpp:55
This file declares a specialization of the GenericSSAContext<X> class template for LLVM IR.
raw_pwrite_stream & OS
A container for analyses that lazily runs them and caches their results.
Definition: PassManager.h:253
Represent the analysis usage information of a pass.
FunctionPass class - This class is used to implement most global optimizations.
Definition: Pass.h:310
A Module instance is used to store all the information related to an LLVM module.
Definition: Module.h:65
A set of analyses that are preserved following a run of a transformation pass.
Definition: Analysis.h:111
Analysis pass which computes UniformityInfo.
Printer pass for the UniformityInfo.
Legacy analysis pass which computes a CycleInfo.
const UniformityInfo & getUniformityInfo() const
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:52
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
Printable print(const GCNRegPressure &RP, const GCNSubtarget *ST=nullptr)
GenericUniformityInfo< SSAContext > UniformityInfo
A CRTP mix-in that provides informational APIs needed for analysis passes.
Definition: PassManager.h:92
A special type used by analysis passes to provide an address that identifies that particular analysis...
Definition: Analysis.h:28
A CRTP mix-in to automatically provide informational APIs needed for passes.
Definition: PassManager.h:69