LLVM 23.0.0git
DXILMetadataAnalysis.h
Go to the documentation of this file.
1//=- DXILMetadataAnalysis.h - Representation of Module metadata --*- 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#ifndef LLVM_ANALYSIS_DXILMETADATA_H
10#define LLVM_ANALYSIS_DXILMETADATA_H
11
13#include "llvm/IR/PassManager.h"
15#include "llvm/Pass.h"
18
19namespace llvm {
20
21class Function;
22namespace dxil {
23
25 const Function *Entry{nullptr};
26 // Specific target shader stage may be specified for entry functions
28 unsigned NumThreadsX{0}; // X component
29 unsigned NumThreadsY{0}; // Y component
30 unsigned NumThreadsZ{0}; // Z component
31 unsigned WaveSizeMin{0}; // Minimum component
32 unsigned WaveSizeMax{0}; // Maximum component
33 unsigned WaveSizePref{0}; // Preferred component
34
35 EntryProperties(const Function *Fn = nullptr) : Entry(Fn) {};
36};
37
47
48} // namespace dxil
49
50// Module metadata analysis pass for new pass manager
51class DXILMetadataAnalysis : public AnalysisInfoMixin<DXILMetadataAnalysis> {
53
54 static AnalysisKey Key;
55
56public:
58 /// Gather module metadata info for the module \c M.
60};
61
62/// Printer pass for the \c DXILMetadataAnalysis results.
64 : public RequiredPassInfoMixin<DXILMetadataAnalysisPrinterPass> {
65 raw_ostream &OS;
66
67public:
69
71};
72
73/// Legacy pass
75 std::unique_ptr<dxil::ModuleMetadataInfo> MetadataInfo;
76
77public:
78 static char ID; // Class identification, replacement for typeinfo
79
82
84 return *MetadataInfo;
85 }
86 dxil::ModuleMetadataInfo &getModuleMetadata() { return *MetadataInfo; }
87
88 void getAnalysisUsage(AnalysisUsage &AU) const override;
89 bool runOnModule(Module &M) override;
90 void releaseMemory() override;
91
92 void print(raw_ostream &OS, const Module *M) const override;
93 void dump() const;
94};
95
96} // namespace llvm
97
98#endif // LLVM_ANALYSIS_DXILMETADATA_H
static void print(raw_ostream &Out, object::Archive::Kind Kind, T Val)
#define LLVM_ABI
Definition Compiler.h:215
This header defines various interfaces for pass management in LLVM.
This file defines the SmallVector class.
Defines the llvm::VersionTuple class, which represents a version in the form major[....
Represent the analysis usage information of a pass.
LLVM_ABI PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM)
dxil::ModuleMetadataInfo & getModuleMetadata()
const dxil::ModuleMetadataInfo & getModuleMetadata() const
LLVM_ABI dxil::ModuleMetadataInfo run(Module &M, ModuleAnalysisManager &AM)
Gather module metadata info for the module M.
dxil::ModuleMetadataInfo Result
ModulePass(char &pid)
Definition Pass.h:257
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 is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
@ UnknownEnvironment
Definition Triple.h:267
Represents a version number in the form major[.minor[.subminor[.build]]].
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.
void dump(const SparseBitVector< ElementSize > &LHS, raw_ostream &out)
AnalysisManager< Module > ModuleAnalysisManager
Convenience typedef for the Module analysis manager.
Definition MIRParser.h:39
A CRTP mix-in that provides informational APIs needed for analysis passes.
A special type used by analysis passes to provide an address that identifies that particular analysis...
Definition Analysis.h:29
A CRTP mix-in for passes that should not be skipped.
EntryProperties(const Function *Fn=nullptr)
Triple::EnvironmentType ShaderStage
std::optional< mcdxbc::SourceInfoBuilder > SourceInfo
Triple::EnvironmentType ShaderProfile
LLVM_ABI void print(raw_ostream &OS) const
SmallVector< EntryProperties > EntryPropertyVec