LLVM 22.0.0git
MachineUniformityAnalysis.h
Go to the documentation of this file.
1//===- MachineUniformityAnalysis.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 Machine IR instance of the generic uniformity analysis
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_CODEGEN_MACHINEUNIFORMITYANALYSIS_H
15#define LLVM_CODEGEN_MACHINEUNIFORMITYANALYSIS_H
16
22
23namespace llvm {
24
25extern template class GenericUniformityInfo<MachineSSAContext>;
27
28/// \brief Compute uniformity information for a Machine IR function.
29///
30/// If \p HasBranchDivergence is false, produces a dummy result which assumes
31/// everything is uniform.
33 MachineFunction &F, const MachineCycleInfo &cycleInfo,
34 const MachineDominatorTree &domTree, bool HasBranchDivergence);
35
36/// Legacy analysis pass which computes a \ref MachineUniformityInfo.
39
40public:
41 static char ID;
42
44
46 const MachineUniformityInfo &getUniformityInfo() const { return UI; }
47
48 bool runOnMachineFunction(MachineFunction &F) override;
49 void getAnalysisUsage(AnalysisUsage &AU) const override;
50 void print(raw_ostream &OS, const Module *M = nullptr) const override;
51
52 // TODO: verify analysis
53};
54
58 static AnalysisKey Key;
59
60public:
63};
64
68
69public:
73 static bool isRequired() { return true; }
74};
75
76} // namespace llvm
77
78#endif // LLVM_CODEGEN_MACHINEUNIFORMITYANALYSIS_H
#define F(x, y, z)
Definition: MD5.cpp:55
This file declares a specialization of the GenericSSAContext<X> template class for Machine IR.
raw_pwrite_stream & OS
A container for analyses that lazily runs them and caches their results.
Definition: PassManager.h:255
Represent the analysis usage information of a pass.
DominatorTree Class - Concrete subclass of DominatorTreeBase that is used to compute a normal dominat...
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
Legacy analysis pass which computes a MachineUniformityInfo.
const MachineUniformityInfo & getUniformityInfo() const
A Module instance is used to store all the information related to an LLVM module.
Definition: Module.h:67
A set of analyses that are preserved following a run of a transformation pass.
Definition: Analysis.h:112
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:53
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
Printable print(const GCNRegPressure &RP, const GCNSubtarget *ST=nullptr, unsigned DynamicVGPRBlockSize=0)
GenericUniformityInfo< MachineSSAContext > MachineUniformityInfo
MachineUniformityInfo computeMachineUniformityInfo(MachineFunction &F, const MachineCycleInfo &cycleInfo, const MachineDominatorTree &domTree, bool HasBranchDivergence)
Compute uniformity information for a Machine IR function.
A CRTP mix-in that provides informational APIs needed for analysis passes.
Definition: PassManager.h:93
A special type used by analysis passes to provide an address that identifies that particular analysis...
Definition: Analysis.h:29
A CRTP mix-in to automatically provide informational APIs needed for passes.
Definition: PassManager.h:70