LLVM: lib/Target/DirectX/DXILShaderFlags.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13
14#ifndef LLVM_TARGET_DIRECTX_DXILSHADERFLAGS_H
15#define LLVM_TARGET_DIRECTX_DXILSHADERFLAGS_H
16
24#include
25
26namespace llvm {
31
32namespace dxil {
33
35#define SHADER_FEATURE_FLAG(FeatureBit, DxilModuleBit, FlagName, Str) \
36 bool FlagName : 1;
37#define DXIL_MODULE_FLAG(DxilModuleBit, FlagName, Str) bool FlagName : 1;
38#include "llvm/BinaryFormat/DXContainerConstants.def"
39
40#define SHADER_FEATURE_FLAG(FeatureBit, DxilModuleBit, FlagName, Str) \
41 FlagName = false;
42#define DXIL_MODULE_FLAG(DxilModuleBit, FlagName, Str) FlagName = false;
44#include "llvm/BinaryFormat/DXContainerConstants.def"
45 }
46
48 return Bit != -1 ? 1ull << Bit : 0;
49 }
50
53#define DXIL_MODULE_FLAG(DxilModuleBit, FlagName, Str) \
54 ModuleFlags |= FlagName ? getMask(DxilModuleBit) : 0ull;
55#include "llvm/BinaryFormat/DXContainerConstants.def"
56 return ModuleFlags;
57 }
58
61#define SHADER_FEATURE_FLAG(FeatureBit, DxilModuleBit, FlagName, Str) \
62 FlagValue |= FlagName ? getMask(DxilModuleBit) : 0ull;
63#include "llvm/BinaryFormat/DXContainerConstants.def"
64 return FlagValue;
65 }
66
69#define SHADER_FEATURE_FLAG(FeatureBit, DxilModuleBit, FlagName, Str) \
70 FeatureFlags |= FlagName ? getMask(FeatureBit) : 0ull;
71#include "llvm/BinaryFormat/DXContainerConstants.def"
72 return FeatureFlags;
73 }
74
76#define SHADER_FEATURE_FLAG(FeatureBit, DxilModuleBit, FlagName, Str) \
77 FlagName |= CSF.FlagName;
78#define DXIL_MODULE_FLAG(DxilModuleBit, FlagName, Str) FlagName |= CSF.FlagName;
79#include "llvm/BinaryFormat/DXContainerConstants.def"
80 }
81
84};
85
91
92private:
93
94
95 bool CanSetResMayNotAlias;
96
97
98
99
101
103 ComputedShaderFlags gatherGlobalModuleFlags(const Module &M,
105 const ModuleMetadataInfo &);
106 void updateFunctionFlags(ComputedShaderFlags &, const Instruction &,
108};
109
113
114public:
116
118
120};
121
122
124 : public PassInfoMixin {
126
127public:
130};
131
132
133
134
135
138
139public:
141
143
145
147
149};
150
151}
152}
153
154#endif
#define LLVM_DUMP_METHOD
Mark debug helper function definitions like dump() that should not be stripped from debug builds.
This header defines various interfaces for pass management in LLVM.
Represent the analysis usage information of a pass.
A Module instance is used to store all the information related to an LLVM module.
A set of analyses that are preserved following a run of a transformation pass.
PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM)
ShaderFlagsAnalysisPrinter(raw_ostream &OS)
Definition DXILShaderFlags.h:128
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - This function should be overriden by passes that need analysis information to do t...
static char ID
Definition DXILShaderFlags.h:140
const ModuleShaderFlags & getShaderFlags()
Definition DXILShaderFlags.h:144
bool runOnModule(Module &M) override
runOnModule - Virtual method overriden by subclasses to process the module being operated on.
ShaderFlagsAnalysisWrapper()
Definition DXILShaderFlags.h:142
ModuleShaderFlags Result
Definition DXILShaderFlags.h:117
ShaderFlagsAnalysis()=default
ModuleShaderFlags run(Module &M, ModuleAnalysisManager &AM)
This class implements an extremely fast bulk output stream that can only output to a stream.
This is an optimization pass for GlobalISel generic memory operations.
LLVM_ABI raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
AnalysisManager< Module > ModuleAnalysisManager
Convenience typedef for the Module analysis manager.
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...
A CRTP mix-in to automatically provide informational APIs needed for passes.
Definition DXILShaderFlags.h:34
ComputedShaderFlags()
Definition DXILShaderFlags.h:43
void merge(const ComputedShaderFlags CSF)
Definition DXILShaderFlags.h:75
uint64_t getModuleFlags() const
Definition DXILShaderFlags.h:51
constexpr uint64_t getMask(int Bit) const
Definition DXILShaderFlags.h:47
uint64_t getFeatureFlags() const
Definition DXILShaderFlags.h:67
LLVM_DUMP_METHOD void dump() const
Definition DXILShaderFlags.h:83
void print(raw_ostream &OS=dbgs()) const
Definition DXILShaderFlags.h:86
const ComputedShaderFlags & getFunctionFlags(const Function *) const
Return the shader flags mask of the specified function Func.
void initialize(Module &, DXILResourceTypeMap &DRTM, const DXILResourceMap &DRM, const ModuleMetadataInfo &MMDI)
Construct ModuleShaderFlags for module Module M.
const ComputedShaderFlags & getCombinedFlags() const
Definition DXILShaderFlags.h:90