LLVM 22.0.0git
DXILTranslateMetadata.cpp
Go to the documentation of this file.
1//===- DXILTranslateMetadata.cpp - Pass to emit DXIL metadata -------------===//
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
10#include "DXILShaderFlags.h"
11#include "DirectX.h"
13#include "llvm/ADT/Twine.h"
16#include "llvm/IR/BasicBlock.h"
17#include "llvm/IR/Constants.h"
20#include "llvm/IR/Function.h"
21#include "llvm/IR/IRBuilder.h"
22#include "llvm/IR/LLVMContext.h"
23#include "llvm/IR/MDBuilder.h"
24#include "llvm/IR/Metadata.h"
25#include "llvm/IR/Module.h"
27#include "llvm/Pass.h"
31#include <cstdint>
32
33using namespace llvm;
34using namespace llvm::dxil;
35
36namespace {
37/// A simple Wrapper DiagnosticInfo that generates Module-level diagnostic
38/// for TranslateMetadata pass
39class DiagnosticInfoTranslateMD : public DiagnosticInfo {
40private:
41 const Twine &Msg;
42 const Module &Mod;
43
44public:
45 /// \p M is the module for which the diagnostic is being emitted. \p Msg is
46 /// the message to show. Note that this class does not copy this message, so
47 /// this reference must be valid for the whole life time of the diagnostic.
48 DiagnosticInfoTranslateMD(const Module &M,
49 const Twine &Msg LLVM_LIFETIME_BOUND,
51 : DiagnosticInfo(DK_Unsupported, Severity), Msg(Msg), Mod(M) {}
52
53 void print(DiagnosticPrinter &DP) const override {
54 DP << Mod.getName() << ": " << Msg << '\n';
55 }
56};
57
58enum class EntryPropsTag {
59 ShaderFlags = 0,
60 GSState,
61 DSState,
62 HSState,
63 NumThreads,
64 AutoBindingSpace,
65 RayPayloadSize,
66 RayAttribSize,
67 ShaderKind,
68 MSState,
69 ASStateTag,
70 WaveSize,
71 EntryRootSig,
72};
73
74} // namespace
75
77 DXILResourceTypeMap &DRTM) {
78 LLVMContext &Context = M.getContext();
79
80 for (ResourceInfo &RI : DRM)
81 if (!RI.hasSymbol())
82 RI.createSymbol(M,
83 DRTM[RI.getHandleTy()].createElementStruct(RI.getName()));
84
85 SmallVector<Metadata *> SRVs, UAVs, CBufs, Smps;
86 for (const ResourceInfo &RI : DRM.srvs())
87 SRVs.push_back(RI.getAsMetadata(M, DRTM[RI.getHandleTy()]));
88 for (const ResourceInfo &RI : DRM.uavs())
89 UAVs.push_back(RI.getAsMetadata(M, DRTM[RI.getHandleTy()]));
90 for (const ResourceInfo &RI : DRM.cbuffers())
91 CBufs.push_back(RI.getAsMetadata(M, DRTM[RI.getHandleTy()]));
92 for (const ResourceInfo &RI : DRM.samplers())
93 Smps.push_back(RI.getAsMetadata(M, DRTM[RI.getHandleTy()]));
94
95 Metadata *SRVMD = SRVs.empty() ? nullptr : MDNode::get(Context, SRVs);
96 Metadata *UAVMD = UAVs.empty() ? nullptr : MDNode::get(Context, UAVs);
97 Metadata *CBufMD = CBufs.empty() ? nullptr : MDNode::get(Context, CBufs);
98 Metadata *SmpMD = Smps.empty() ? nullptr : MDNode::get(Context, Smps);
99
100 if (DRM.empty())
101 return nullptr;
102
103 NamedMDNode *ResourceMD = M.getOrInsertNamedMetadata("dx.resources");
104 ResourceMD->addOperand(
105 MDNode::get(M.getContext(), {SRVMD, UAVMD, CBufMD, SmpMD}));
106
107 return ResourceMD;
108}
109
111 switch (Env) {
112 case Triple::Pixel:
113 return "ps";
114 case Triple::Vertex:
115 return "vs";
116 case Triple::Geometry:
117 return "gs";
118 case Triple::Hull:
119 return "hs";
120 case Triple::Domain:
121 return "ds";
122 case Triple::Compute:
123 return "cs";
124 case Triple::Library:
125 return "lib";
126 case Triple::Mesh:
127 return "ms";
129 return "as";
130 default:
131 break;
132 }
133 llvm_unreachable("Unsupported environment for DXIL generation.");
134}
135
138}
139
144 ConstantInt::get(Type::getInt32Ty(Ctx), static_cast<int>(Tag))));
145 switch (Tag) {
146 case EntryPropsTag::ShaderFlags:
148 ConstantInt::get(Type::getInt64Ty(Ctx), Value)));
149 break;
150 case EntryPropsTag::ShaderKind:
152 ConstantInt::get(Type::getInt32Ty(Ctx), Value)));
153 break;
154 case EntryPropsTag::GSState:
155 case EntryPropsTag::DSState:
156 case EntryPropsTag::HSState:
157 case EntryPropsTag::NumThreads:
158 case EntryPropsTag::AutoBindingSpace:
159 case EntryPropsTag::RayPayloadSize:
160 case EntryPropsTag::RayAttribSize:
161 case EntryPropsTag::MSState:
162 case EntryPropsTag::ASStateTag:
163 case EntryPropsTag::WaveSize:
164 case EntryPropsTag::EntryRootSig:
165 llvm_unreachable("NYI: Unhandled entry property tag");
166 }
167 return MDVals;
168}
169
170static MDTuple *
172 const Triple::EnvironmentType ShaderProfile) {
174 LLVMContext &Ctx = EP.Entry->getContext();
175 if (EntryShaderFlags != 0)
176 MDVals.append(getTagValueAsMetadata(EntryPropsTag::ShaderFlags,
177 EntryShaderFlags, Ctx));
178
179 if (EP.Entry != nullptr) {
180 // FIXME: support more props.
181 // See https://github.com/llvm/llvm-project/issues/57948.
182 // Add shader kind for lib entries.
183 if (ShaderProfile == Triple::EnvironmentType::Library &&
184 EP.ShaderStage != Triple::EnvironmentType::Library)
185 MDVals.append(getTagValueAsMetadata(EntryPropsTag::ShaderKind,
186 getShaderStage(EP.ShaderStage), Ctx));
187
188 if (EP.ShaderStage == Triple::EnvironmentType::Compute) {
189 MDVals.emplace_back(ConstantAsMetadata::get(ConstantInt::get(
190 Type::getInt32Ty(Ctx), static_cast<int>(EntryPropsTag::NumThreads))));
191 Metadata *NumThreadVals[] = {ConstantAsMetadata::get(ConstantInt::get(
192 Type::getInt32Ty(Ctx), EP.NumThreadsX)),
193 ConstantAsMetadata::get(ConstantInt::get(
194 Type::getInt32Ty(Ctx), EP.NumThreadsY)),
195 ConstantAsMetadata::get(ConstantInt::get(
196 Type::getInt32Ty(Ctx), EP.NumThreadsZ))};
197 MDVals.emplace_back(MDNode::get(Ctx, NumThreadVals));
198 }
199 }
200 if (MDVals.empty())
201 return nullptr;
202 return MDNode::get(Ctx, MDVals);
203}
204
206 MDNode *Resources, MDTuple *Properties,
207 LLVMContext &Ctx) {
208 // Each entry point metadata record specifies:
209 // * reference to the entry point function global symbol
210 // * unmangled name
211 // * list of signatures
212 // * list of resources
213 // * list of tag-value pairs of shader capabilities and other properties
214 Metadata *MDVals[5];
215 MDVals[0] =
216 EntryFn ? ValueAsMetadata::get(const_cast<Function *>(EntryFn)) : nullptr;
217 MDVals[1] = MDString::get(Ctx, EntryFn ? EntryFn->getName() : "");
218 MDVals[2] = Signatures;
219 MDVals[3] = Resources;
220 MDVals[4] = Properties;
221 return MDNode::get(Ctx, MDVals);
222}
223
225 MDNode *MDResources,
226 const uint64_t EntryShaderFlags,
227 const Triple::EnvironmentType ShaderProfile) {
228 MDTuple *Properties =
229 getEntryPropAsMetadata(EP, EntryShaderFlags, ShaderProfile);
230 return constructEntryMetadata(EP.Entry, Signatures, MDResources, Properties,
231 EP.Entry->getContext());
232}
233
235 if (MMDI.ValidatorVersion.empty())
236 return;
237
238 LLVMContext &Ctx = M.getContext();
239 IRBuilder<> IRB(Ctx);
240 Metadata *MDVals[2];
241 MDVals[0] =
243 MDVals[1] = ConstantAsMetadata::get(
244 IRB.getInt32(MMDI.ValidatorVersion.getMinor().value_or(0)));
245 NamedMDNode *ValVerNode = M.getOrInsertNamedMetadata("dx.valver");
246 // Set validator version obtained from DXIL Metadata Analysis pass
247 ValVerNode->clearOperands();
248 ValVerNode->addOperand(MDNode::get(Ctx, MDVals));
249}
250
252 const ModuleMetadataInfo &MMDI) {
253 LLVMContext &Ctx = M.getContext();
254 IRBuilder<> IRB(Ctx);
255 Metadata *SMVals[3];
257 SMVals[0] = MDString::get(Ctx, getShortShaderStage(MMDI.ShaderProfile));
258 SMVals[1] = ConstantAsMetadata::get(IRB.getInt32(SM.getMajor()));
259 SMVals[2] = ConstantAsMetadata::get(IRB.getInt32(SM.getMinor().value_or(0)));
260 NamedMDNode *SMMDNode = M.getOrInsertNamedMetadata("dx.shaderModel");
261 SMMDNode->addOperand(MDNode::get(Ctx, SMVals));
262}
263
265 LLVMContext &Ctx = M.getContext();
266 IRBuilder<> IRB(Ctx);
267 VersionTuple DXILVer = MMDI.DXILVersion;
268 Metadata *DXILVals[2];
269 DXILVals[0] = ConstantAsMetadata::get(IRB.getInt32(DXILVer.getMajor()));
270 DXILVals[1] =
271 ConstantAsMetadata::get(IRB.getInt32(DXILVer.getMinor().value_or(0)));
272 NamedMDNode *DXILVerMDNode = M.getOrInsertNamedMetadata("dx.version");
273 DXILVerMDNode->addOperand(MDNode::get(Ctx, DXILVals));
274}
275
277 uint64_t ShaderFlags) {
278 LLVMContext &Ctx = M.getContext();
279 MDTuple *Properties = nullptr;
280 if (ShaderFlags != 0) {
282 MDVals.append(
283 getTagValueAsMetadata(EntryPropsTag::ShaderFlags, ShaderFlags, Ctx));
284 Properties = MDNode::get(Ctx, MDVals);
285 }
286 // Library has an entry metadata with resource table metadata and all other
287 // MDNodes as null.
288 return constructEntryMetadata(nullptr, nullptr, RMD, Properties, Ctx);
289}
290
291// TODO: We might need to refactor this to be more generic,
292// in case we need more metadata to be replaced.
294 for (Function &F : M) {
295 for (BasicBlock &BB : F) {
296 Instruction *BBTerminatorInst = BB.getTerminator();
297
298 MDNode *HlslControlFlowMD =
299 BBTerminatorInst->getMetadata("hlsl.controlflow.hint");
300
301 if (!HlslControlFlowMD)
302 continue;
303
304 assert(HlslControlFlowMD->getNumOperands() == 2 &&
305 "invalid operands for hlsl.controlflow.hint");
306
307 MDBuilder MDHelper(M.getContext());
308 ConstantInt *Op1 =
309 mdconst::extract<ConstantInt>(HlslControlFlowMD->getOperand(1));
310
312 ArrayRef<Metadata *>{MDHelper.createString("dx.controlflow.hints"),
313 MDHelper.createConstant(Op1)});
314
315 MDNode *MDNode = llvm::MDNode::get(M.getContext(), Vals);
316
317 BBTerminatorInst->setMetadata("dx.controlflow.hints", MDNode);
318 BBTerminatorInst->setMetadata("hlsl.controlflow.hint", nullptr);
319 }
320 }
321}
322
325 const ModuleShaderFlags &ShaderFlags,
326 const ModuleMetadataInfo &MMDI) {
327 LLVMContext &Ctx = M.getContext();
328 IRBuilder<> IRB(Ctx);
329 SmallVector<MDNode *> EntryFnMDNodes;
330
331 emitValidatorVersionMD(M, MMDI);
333 emitDXILVersionTupleMD(M, MMDI);
334 NamedMDNode *NamedResourceMD = emitResourceMetadata(M, DRM, DRTM);
335 auto *ResourceMD =
336 (NamedResourceMD != nullptr) ? NamedResourceMD->getOperand(0) : nullptr;
337 // FIXME: Add support to construct Signatures
338 // See https://github.com/llvm/llvm-project/issues/57928
339 MDTuple *Signatures = nullptr;
340
341 if (MMDI.ShaderProfile == Triple::EnvironmentType::Library) {
342 // Get the combined shader flag mask of all functions in the library to be
343 // used as shader flags mask value associated with top-level library entry
344 // metadata.
345 uint64_t CombinedMask = ShaderFlags.getCombinedFlags();
346 EntryFnMDNodes.emplace_back(
347 emitTopLevelLibraryNode(M, ResourceMD, CombinedMask));
348 } else if (MMDI.EntryPropertyVec.size() > 1) {
349 M.getContext().diagnose(DiagnosticInfoTranslateMD(
350 M, "Non-library shader: One and only one entry expected"));
351 }
352
353 for (const EntryProperties &EntryProp : MMDI.EntryPropertyVec) {
354 const ComputedShaderFlags &EntrySFMask =
355 ShaderFlags.getFunctionFlags(EntryProp.Entry);
356
357 // If ShaderProfile is Library, mask is already consolidated in the
358 // top-level library node. Hence it is not emitted.
359 uint64_t EntryShaderFlags = 0;
360 if (MMDI.ShaderProfile != Triple::EnvironmentType::Library) {
361 EntryShaderFlags = EntrySFMask;
362 if (EntryProp.ShaderStage != MMDI.ShaderProfile) {
363 M.getContext().diagnose(DiagnosticInfoTranslateMD(
364 M,
365 "Shader stage '" +
367 "' for entry '" + Twine(EntryProp.Entry->getName()) +
368 "' different from specified target profile '" +
370 "'"))));
371 }
372 }
373 EntryFnMDNodes.emplace_back(emitEntryMD(EntryProp, Signatures, ResourceMD,
374 EntryShaderFlags,
375 MMDI.ShaderProfile));
376 }
377
378 NamedMDNode *EntryPointsNamedMD =
379 M.getOrInsertNamedMetadata("dx.entryPoints");
380 for (auto *Entry : EntryFnMDNodes)
381 EntryPointsNamedMD->addOperand(Entry);
382}
383
388 const ModuleShaderFlags &ShaderFlags = MAM.getResult<ShaderFlagsAnalysis>(M);
390
391 translateMetadata(M, DRM, DRTM, ShaderFlags, MMDI);
393
394 return PreservedAnalyses::all();
395}
396
397namespace {
398class DXILTranslateMetadataLegacy : public ModulePass {
399public:
400 static char ID; // Pass identification, replacement for typeid
401 explicit DXILTranslateMetadataLegacy() : ModulePass(ID) {}
402
403 StringRef getPassName() const override { return "DXIL Translate Metadata"; }
404
405 void getAnalysisUsage(AnalysisUsage &AU) const override {
414 }
415
416 bool runOnModule(Module &M) override {
417 DXILResourceMap &DRM =
418 getAnalysis<DXILResourceWrapperPass>().getResourceMap();
419 DXILResourceTypeMap &DRTM =
420 getAnalysis<DXILResourceTypeWrapperPass>().getResourceTypeMap();
421 const ModuleShaderFlags &ShaderFlags =
422 getAnalysis<ShaderFlagsAnalysisWrapper>().getShaderFlags();
424 getAnalysis<DXILMetadataAnalysisWrapperPass>().getModuleMetadata();
425
426 translateMetadata(M, DRM, DRTM, ShaderFlags, MMDI);
428 return true;
429 }
430};
431
432} // namespace
433
434char DXILTranslateMetadataLegacy::ID = 0;
435
437 return new DXILTranslateMetadataLegacy();
438}
439
440INITIALIZE_PASS_BEGIN(DXILTranslateMetadataLegacy, "dxil-translate-metadata",
441 "DXIL Translate Metadata", false, false)
445INITIALIZE_PASS_END(DXILTranslateMetadataLegacy, "dxil-translate-metadata",
446 "DXIL Translate Metadata", false, false)
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
Add AMDGPU uniform metadata
#define LLVM_LIFETIME_BOUND
Definition: Compiler.h:435
This file contains the declarations for the subclasses of Constant, which represent the different fla...
static void emitDXILVersionTupleMD(Module &M, const ModuleMetadataInfo &MMDI)
static MDTuple * getEntryPropAsMetadata(const EntryProperties &EP, uint64_t EntryShaderFlags, const Triple::EnvironmentType ShaderProfile)
static void emitValidatorVersionMD(Module &M, const ModuleMetadataInfo &MMDI)
static MDTuple * emitTopLevelLibraryNode(Module &M, MDNode *RMD, uint64_t ShaderFlags)
static SmallVector< Metadata * > getTagValueAsMetadata(EntryPropsTag Tag, uint64_t Value, LLVMContext &Ctx)
static StringRef getShortShaderStage(Triple::EnvironmentType Env)
static void translateBranchMetadata(Module &M)
static void translateMetadata(Module &M, DXILResourceMap &DRM, DXILResourceTypeMap &DRTM, const ModuleShaderFlags &ShaderFlags, const ModuleMetadataInfo &MMDI)
static MDTuple * emitEntryMD(const EntryProperties &EP, MDTuple *Signatures, MDNode *MDResources, const uint64_t EntryShaderFlags, const Triple::EnvironmentType ShaderProfile)
static NamedMDNode * emitResourceMetadata(Module &M, DXILResourceMap &DRM, DXILResourceTypeMap &DRTM)
static uint32_t getShaderStage(Triple::EnvironmentType Env)
MDTuple * constructEntryMetadata(const Function *EntryFn, MDTuple *Signatures, MDNode *Resources, MDTuple *Properties, LLVMContext &Ctx)
static void emitShaderModelVersionMD(Module &M, const ModuleMetadataInfo &MMDI)
Module.h This file contains the declarations for the Module class.
#define F(x, y, z)
Definition: MD5.cpp:55
This file contains the declarations for metadata subclasses.
if(auto Err=PB.parsePassPipeline(MPM, Passes)) return wrap(std MPM run * Mod
ModuleAnalysisManager MAM
#define INITIALIZE_PASS_DEPENDENCY(depName)
Definition: PassSupport.h:42
#define INITIALIZE_PASS_END(passName, arg, name, cfg, analysis)
Definition: PassSupport.h:44
#define INITIALIZE_PASS_BEGIN(passName, arg, name, cfg, analysis)
Definition: PassSupport.h:39
This file defines the SmallVector class.
static const FuncProtoTy Signatures[]
Defines the llvm::VersionTuple class, which represents a version in the form major[....
A container for analyses that lazily runs them and caches their results.
Definition: PassManager.h:255
PassT::Result & getResult(IRUnitT &IR, ExtraArgTs... ExtraArgs)
Get the result of an analysis pass for a given IR unit.
Definition: PassManager.h:412
Represent the analysis usage information of a pass.
AnalysisUsage & addRequired()
AnalysisUsage & addPreserved()
Add the specified Pass class to the set of analyses preserved by this pass.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition: ArrayRef.h:41
LLVM Basic Block Representation.
Definition: BasicBlock.h:62
static ConstantAsMetadata * get(Constant *C)
Definition: Metadata.h:535
This is the shared class of boolean and integer constants.
Definition: Constants.h:87
iterator_range< iterator > samplers()
Definition: DXILResource.h:548
iterator_range< iterator > srvs()
Definition: DXILResource.h:519
iterator_range< iterator > cbuffers()
Definition: DXILResource.h:537
iterator_range< iterator > uavs()
Definition: DXILResource.h:528
PreservedAnalyses run(Module &M, ModuleAnalysisManager &)
This is the base abstract class for diagnostic reporting in the backend.
virtual void print(DiagnosticPrinter &DP) const =0
Print using the given DP a user-friendly message.
Interface for custom diagnostic printing.
LLVMContext & getContext() const
getContext - Return a reference to the LLVMContext associated with this function.
Definition: Function.cpp:359
ConstantInt * getInt32(uint32_t C)
Get a constant 32-bit value.
Definition: IRBuilder.h:522
This provides a uniform API for creating instructions and inserting them into a basic block: either a...
Definition: IRBuilder.h:2780
MDNode * getMetadata(unsigned KindID) const
Get the metadata of given kind attached to this Instruction.
Definition: Instruction.h:428
LLVM_ABI void setMetadata(unsigned KindID, MDNode *Node)
Set the metadata of the specified kind to the specified node.
Definition: Metadata.cpp:1718
This is an important class for using LLVM in a threaded context.
Definition: LLVMContext.h:68
LLVM_ABI ConstantAsMetadata * createConstant(Constant *C)
Return the given constant as metadata.
Definition: MDBuilder.cpp:25
LLVM_ABI MDString * createString(StringRef Str)
Return the given string as metadata.
Definition: MDBuilder.cpp:21
Metadata node.
Definition: Metadata.h:1077
const MDOperand & getOperand(unsigned I) const
Definition: Metadata.h:1445
static MDTuple * get(LLVMContext &Context, ArrayRef< Metadata * > MDs)
Definition: Metadata.h:1565
unsigned getNumOperands() const
Return number of MDNode operands.
Definition: Metadata.h:1451
static LLVM_ABI MDString * get(LLVMContext &Context, StringRef Str)
Definition: Metadata.cpp:607
Tuple of metadata.
Definition: Metadata.h:1493
Root of the metadata hierarchy.
Definition: Metadata.h:63
ModulePass class - This class is used to implement unstructured interprocedural optimizations and ana...
Definition: Pass.h:255
A Module instance is used to store all the information related to an LLVM module.
Definition: Module.h:67
A tuple of MDNodes.
Definition: Metadata.h:1753
LLVM_ABI MDNode * getOperand(unsigned i) const
Definition: Metadata.cpp:1465
LLVM_ABI void clearOperands()
Drop all references to this node's operands.
Definition: Metadata.cpp:1480
LLVM_ABI void addOperand(MDNode *M)
Definition: Metadata.cpp:1471
A set of analyses that are preserved following a run of a transformation pass.
Definition: Analysis.h:112
static PreservedAnalyses all()
Construct a special preserved set that preserves all passes.
Definition: Analysis.h:118
bool empty() const
Definition: SmallVector.h:82
reference emplace_back(ArgTypes &&... Args)
Definition: SmallVector.h:938
void append(ItTy in_start, ItTy in_end)
Add the specified range to the end of the SmallVector.
Definition: SmallVector.h:684
void push_back(const T &Elt)
Definition: SmallVector.h:414
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Definition: SmallVector.h:1197
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:55
@ Amplification
Definition: Triple.h:305
static LLVM_ABI StringRef getEnvironmentTypeName(EnvironmentType Kind)
Get the canonical name for the Kind environment.
Definition: Triple.cpp:337
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
Definition: Twine.h:82
static LLVM_ABI IntegerType * getInt32Ty(LLVMContext &C)
static LLVM_ABI IntegerType * getInt64Ty(LLVMContext &C)
static LLVM_ABI ValueAsMetadata * get(Value *V)
Definition: Metadata.cpp:502
LLVM Value Representation.
Definition: Value.h:75
LLVM_ABI StringRef getName() const
Return a constant reference to the value's name.
Definition: Value.cpp:322
Represents a version number in the form major[.minor[.subminor[.build]]].
Definition: VersionTuple.h:30
unsigned getMajor() const
Retrieve the major version number.
Definition: VersionTuple.h:72
bool empty() const
Determine whether this version information is empty (e.g., all version components are zero).
Definition: VersionTuple.h:67
std::optional< unsigned > getMinor() const
Retrieve the minor version number, if provided.
Definition: VersionTuple.h:75
Wrapper pass for the legacy pass manager.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
Definition: CallingConv.h:24
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
ModulePass * createDXILTranslateMetadataLegacyPass()
Pass to emit metadata for DXIL.
@ DK_Unsupported
@ Mod
The access may modify the value stored in memory.
DiagnosticSeverity
Defines the different supported severity of a diagnostic.
@ DS_Error
Triple::EnvironmentType ShaderStage
Triple::EnvironmentType ShaderProfile
SmallVector< EntryProperties > EntryPropertyVec