LLVM 23.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
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.
34 const MachineDominatorTree &DT,
35 bool HasBranchDivergence);
36
37/// Legacy analysis pass which computes a \ref MachineUniformityInfo.
40
41public:
42 static char ID;
43
45
47 const MachineUniformityInfo &getUniformityInfo() const { return UI; }
48
49 bool runOnMachineFunction(MachineFunction &F) override;
50 void getAnalysisUsage(AnalysisUsage &AU) const override;
51 void print(raw_ostream &OS, const Module *M = nullptr) const override;
52
53 // TODO: verify analysis
54};
55
65
68 raw_ostream &OS;
69
70public:
71 explicit MachineUniformityPrinterPass(raw_ostream &OS) : OS(OS) {}
74 static bool isRequired() { return true; }
75};
76
77} // namespace llvm
78
79#endif // LLVM_CODEGEN_MACHINEUNIFORMITYANALYSIS_H
#define F(x, y, z)
Definition MD5.cpp:54
This file declares a specialization of the GenericSSAContext<X> template class for Machine IR.
Represent the analysis usage information of a pass.
DominatorTree Class - Concrete subclass of DominatorTreeBase that is used to compute a normal dominat...
const MachineUniformityInfo & getUniformityInfo() const
Result run(MachineFunction &MF, MachineFunctionAnalysisManager &MFAM)
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.
GenericUniformityInfo< MachineSSAContext > MachineUniformityInfo
MachineUniformityInfo computeMachineUniformityInfo(MachineFunction &F, const MachineCycleInfo &CI, const MachineDominatorTree &DT, bool HasBranchDivergence)
Compute uniformity information for a Machine IR function.
Printable print(const GCNRegPressure &RP, const GCNSubtarget *ST=nullptr, unsigned DynamicVGPRBlockSize=0)
AnalysisManager< MachineFunction > MachineFunctionAnalysisManager
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