LLVM 24.0.0git
DXILShaderFlags.cpp
Go to the documentation of this file.
1//===- DXILShaderFlags.cpp - DXIL Shader Flags helper objects -------------===//
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 This file contains helper objects and APIs for working with DXIL
10/// Shader Flags.
11///
12//===----------------------------------------------------------------------===//
13
14#include "DXILShaderFlags.h"
16#include "DirectX.h"
21#include "llvm/IR/Attributes.h"
23#include "llvm/IR/Instruction.h"
26#include "llvm/IR/Intrinsics.h"
27#include "llvm/IR/IntrinsicsDirectX.h"
28#include "llvm/IR/Module.h"
32
33using namespace llvm;
34using namespace llvm::dxil;
35
36static bool hasUAVsAtEveryStage(const DXILResourceMap &DRM,
37 const ModuleMetadataInfo &MMDI) {
38 // Heap resources do not count towards hasUAVsAtEveryStage.
39 bool HasUAVWithBinding = any_of(
40 DRM.uavs(), [](const ResourceInfo &RI) { return RI.hasBinding(); });
41 if (!HasUAVWithBinding)
42 return false;
43
44 switch (MMDI.ShaderProfile) {
45 default:
46 return false;
49 return false;
54 return true;
64 return MMDI.ValidatorVersion < VersionTuple(1, 8);
65 }
66}
67
68static bool checkWaveOps(Intrinsic::ID IID) {
69 // Currently unsupported intrinsics
70 // case Intrinsic::dx_wave_readfirst:
71 // case Intrinsic::dx_wave_reduce.and:
72 // case Intrinsic::dx_wave_reduce.or:
73 // case Intrinsic::dx_wave_reduce.xor:
74 // case Intrinsic::dx_wave_prefixop:
75 // case Intrinsic::dx_quad.readat:
76 // case Intrinsic::dx_quad.readacrossy:
77 // case Intrinsic::dx_quad.readacrossdiagonal:
78 // case Intrinsic::dx_wave_prefixballot:
79 // case Intrinsic::dx_wave_match:
80 // case Intrinsic::dx_wavemulti.*:
81 // case Intrinsic::dx_wavemulti.ballot:
82 // case Intrinsic::dx_quad.vote:
83 switch (IID) {
84 default:
85 return false;
86 case Intrinsic::dx_wave_is_first_lane:
87 case Intrinsic::dx_wave_getlaneindex:
88 case Intrinsic::dx_wave_get_lane_count:
89 case Intrinsic::dx_wave_any:
90 case Intrinsic::dx_wave_all_equal:
91 case Intrinsic::dx_wave_all:
92 case Intrinsic::dx_wave_readlane:
93 case Intrinsic::dx_wave_readlane_first:
94 case Intrinsic::dx_wave_active_countbits:
95 case Intrinsic::dx_wave_ballot:
96 case Intrinsic::dx_wave_prefix_bit_count:
97 // Wave Active Op Variants
98 case Intrinsic::dx_wave_reduce_or:
99 case Intrinsic::dx_wave_reduce_xor:
100 case Intrinsic::dx_wave_reduce_and:
101 case Intrinsic::dx_wave_reduce_sum:
102 case Intrinsic::dx_wave_reduce_usum:
103 case Intrinsic::dx_wave_product:
104 case Intrinsic::dx_wave_uproduct:
105 case Intrinsic::dx_wave_reduce_max:
106 case Intrinsic::dx_wave_reduce_umax:
107 case Intrinsic::dx_wave_reduce_min:
108 case Intrinsic::dx_wave_reduce_umin:
109 // Wave Prefix Op Variants
110 case Intrinsic::dx_wave_prefix_sum:
111 case Intrinsic::dx_wave_prefix_usum:
112 case Intrinsic::dx_wave_prefix_product:
113 case Intrinsic::dx_wave_prefix_uproduct:
114 // Quad Op Variants
115 case Intrinsic::dx_quad_read_across_x:
116 case Intrinsic::dx_quad_read_across_y:
117 case Intrinsic::dx_quad_read_across_diagonal:
118 return true;
119 }
120}
121
123 switch (IID) {
124 default:
125 return false;
126 case Intrinsic::fma:
127 return true;
128 }
129}
130
131/// Texture load and sample operations accept "programmable offsets", i.e.
132/// offsets that are not compile-time constants. Such offsets require the
133/// AdvancedTextureOps shader feature flag. Returns true if \p II is one of
134/// those operations and its offsets operand is not a constant.
136 // TODO: (#116137) Several other DXIL ops also require this feature flag, but
137 // none of them can be generated yet:
138 // - SampleCmp, SampleCmpBias, SampleCmpGrad and SampleCmpLevelZero set the
139 // flag for non-constant offsets, exactly like the ops handled below.
140 // - SampleCmpLevel, TextureGatherRaw and TextureStoreSample set the flag
141 // unconditionally, and have no intrinsics yet.
142
143 // The offsets operand index differs between the intrinsics.
144 unsigned OffsetsIdx;
145 switch (II.getIntrinsicID()) {
146 default:
147 return false;
148 case Intrinsic::dx_resource_load_level:
149 case Intrinsic::dx_resource_sample:
150 case Intrinsic::dx_resource_sample_clamp:
151 OffsetsIdx = 3;
152 break;
153 case Intrinsic::dx_resource_samplebias:
154 case Intrinsic::dx_resource_samplebias_clamp:
155 case Intrinsic::dx_resource_samplelevel:
156 OffsetsIdx = 4;
157 break;
158 case Intrinsic::dx_resource_samplegrad:
159 case Intrinsic::dx_resource_samplegrad_clamp:
160 OffsetsIdx = 5;
161 break;
162 }
163 return !isa<Constant>(II.getArgOperand(OffsetsIdx));
164}
165
166static bool isOptimizationDisabled(const Module &M) {
167 const StringRef Key = "dx.disable_optimizations";
168 if (auto *Flag = mdconst::extract_or_null<ConstantInt>(M.getModuleFlag(Key)))
169 return Flag->getValue().getBoolValue();
170 return false;
171}
172
173// Checks to see if the status bit from a load with status
174// instruction is ever extracted. If it is, the module needs
175// to have the TiledResources shader flag set.
177 [[maybe_unused]] Intrinsic::ID IID = II.getIntrinsicID();
178 assert(IID == Intrinsic::dx_resource_load_typedbuffer ||
179 IID == Intrinsic::dx_resource_load_rawbuffer &&
180 "unexpected intrinsic ID");
181 for (const User *U : II.users()) {
182 if (const ExtractValueInst *EVI = dyn_cast<ExtractValueInst>(U)) {
183 // Resource load operations return a {result, status} pair.
184 // Check if we extract the status
185 if (EVI->getNumIndices() == 1 && EVI->getIndices()[0] == 1)
186 return true;
187 }
188 }
189
190 return false;
191}
192
193/// Update the shader flags mask based on the given instruction.
194/// \param CSF Shader flags mask to update.
195/// \param I Instruction to check.
196void ModuleShaderFlags::updateFunctionFlags(ComputedShaderFlags &CSF,
197 const Instruction &I,
199 const ModuleMetadataInfo &MMDI) {
200 if (!CSF.Doubles)
201 CSF.Doubles = I.getType()->getScalarType()->isDoubleTy();
202
203 if (!CSF.Doubles) {
204 for (const Value *Op : I.operands()) {
205 if (Op->getType()->getScalarType()->isDoubleTy()) {
206 CSF.Doubles = true;
207 break;
208 }
209 }
210 }
211
212 if (CSF.Doubles) {
213 switch (I.getOpcode()) {
214 case Instruction::FDiv:
215 case Instruction::UIToFP:
216 case Instruction::SIToFP:
217 case Instruction::FPToUI:
218 case Instruction::FPToSI:
219 CSF.DX11_1_DoubleExtensions = true;
220 break;
221 }
222 }
223
224 if (!CSF.LowPrecisionPresent)
225 CSF.LowPrecisionPresent = I.getType()->getScalarType()->isIntegerTy(16) ||
226 I.getType()->getScalarType()->isHalfTy();
227
228 if (!CSF.LowPrecisionPresent) {
229 for (const Value *Op : I.operands()) {
230 if (Op->getType()->getScalarType()->isIntegerTy(16) ||
231 Op->getType()->getScalarType()->isHalfTy()) {
232 CSF.LowPrecisionPresent = true;
233 break;
234 }
235 }
236 }
237
238 if (CSF.LowPrecisionPresent) {
239 if (CSF.NativeLowPrecisionMode)
240 CSF.NativeLowPrecision = true;
241 else
242 CSF.MinimumPrecision = true;
243 }
244
245 if (!CSF.Int64Ops)
246 CSF.Int64Ops = I.getType()->getScalarType()->isIntegerTy(64);
247
248 if (!CSF.Int64Ops && !isa<LifetimeIntrinsic>(&I)) {
249 for (const Value *Op : I.operands()) {
250 if (Op->getType()->getScalarType()->isIntegerTy(64)) {
251 CSF.Int64Ops = true;
252 break;
253 }
254 }
255 }
256
257 if (const auto *II = dyn_cast<IntrinsicInst>(&I)) {
258 CSF.AdvancedTextureOps |= checkAdvancedTextureOps(*II);
259
260 switch (II->getIntrinsicID()) {
261 default:
262 break;
263 case Intrinsic::dx_resource_handlefrombinding: {
264 dxil::ResourceTypeInfo &RTI = DRTM[cast<TargetExtType>(II->getType())];
265
266 // Set ResMayNotAlias if DXIL validator version >= 1.8 and the function
267 // uses UAVs
268 if (!CSF.ResMayNotAlias && CanSetResMayNotAlias &&
269 MMDI.ValidatorVersion >= VersionTuple(1, 8) && RTI.isUAV())
270 CSF.ResMayNotAlias = true;
271
272 switch (RTI.getResourceKind()) {
275 CSF.EnableRawAndStructuredBuffers = true;
276 break;
277 default:
278 break;
279 }
280 break;
281 }
282 case Intrinsic::dx_resource_handlefromheap: {
283 dxil::ResourceTypeInfo &RTI = DRTM[cast<TargetExtType>(II->getType())];
284 bool IsSamplerHeap = RTI.isSampler();
285 CSF.SamplerDescriptorHeapIndexing |= IsSamplerHeap;
286 CSF.ResourceDescriptorHeapIndexing |= !IsSamplerHeap;
287
288 if (!CSF.ResMayNotAlias && CanSetResMayNotAlias && RTI.isUAV() &&
289 MMDI.ValidatorVersion >= VersionTuple(1, 8)) {
290 CSF.ResMayNotAlias = true;
291 }
292 break;
293 }
294 case Intrinsic::dx_resource_load_level:
295 case Intrinsic::dx_resource_load_typedbuffer: {
296 dxil::ResourceTypeInfo &RTI =
297 DRTM[cast<TargetExtType>(II->getArgOperand(0)->getType())];
298 if (RTI.isTyped() && RTI.isUAV())
299 CSF.TypedUAVLoadAdditionalFormats |= RTI.getTyped().ElementCount > 1;
300 if (II->getIntrinsicID() == Intrinsic::dx_resource_load_typedbuffer &&
301 !CSF.TiledResources && checkIfStatusIsExtracted(*II))
302 CSF.TiledResources = true;
303 break;
304 }
305 case Intrinsic::dx_resource_load_rawbuffer: {
306 if (!CSF.TiledResources && checkIfStatusIsExtracted(*II))
307 CSF.TiledResources = true;
308 break;
309 }
310 case Intrinsic::dx_resource_atomic_binop:
311 case Intrinsic::dx_resource_atomic_compare_exchange: {
312 if (II->getType()->isIntegerTy(64)) {
313 dxil::ResourceTypeInfo &RTI =
314 DRTM[cast<TargetExtType>(II->getArgOperand(0)->getType())];
315 if (RTI.isTyped())
316 CSF.AtomicInt64OnTypedResource = true;
317 // TODO(https://github.com/llvm/llvm-project/issues/116152): Set
318 // AtomicInt64OnHeapResource when heap-resource intrinsics are added.
319 }
320 break;
321 }
322 }
323 }
324 // 64-bit atomics on groupshared memory (address space 3).
325 if (const auto *ARMW = dyn_cast<AtomicRMWInst>(&I)) {
326 if (ARMW->getValOperand()->getType()->isIntegerTy(64) &&
327 ARMW->getPointerAddressSpace() == 3)
328 CSF.AtomicInt64OnGroupShared = true;
329 } else if (const auto *AXCG = dyn_cast<AtomicCmpXchgInst>(&I)) {
330 if (AXCG->getNewValOperand()->getType()->isIntegerTy(64) &&
331 AXCG->getPointerAddressSpace() == 3)
332 CSF.AtomicInt64OnGroupShared = true;
333 }
334 // Handle call instructions
335 if (auto *CI = dyn_cast<CallInst>(&I)) {
336 const Function *CF = CI->getCalledFunction();
337 // Merge-in shader flags mask of the called function in the current module
338 if (FunctionFlags.contains(CF))
339 CSF.merge(FunctionFlags[CF]);
340
341 CSF.DX11_1_DoubleExtensions |=
342 checkDoubleExtensionOps(CI->getIntrinsicID());
343 CSF.WaveOps |= checkWaveOps(CI->getIntrinsicID());
344 }
345}
346
347/// Set shader flags that apply to all functions within the module
349ModuleShaderFlags::gatherGlobalModuleFlags(const Module &M,
350 const DXILResourceMap &DRM,
351 const ModuleMetadataInfo &MMDI) {
352
353 ComputedShaderFlags CSF;
354
355 CSF.DisableOptimizations = isOptimizationDisabled(M);
356
357 CSF.UAVsAtEveryStage = hasUAVsAtEveryStage(DRM, MMDI);
358
359 // Set the Max64UAVs flag if the number of UAVs is > 8
360 uint32_t NumUAVs = 0;
361 for (auto &UAV : DRM.uavs()) {
362 // Heap resources do not count towards Max64UAVs flag.
363 if (!UAV.hasBinding())
364 continue;
365 if (MMDI.ValidatorVersion < VersionTuple(1, 6)) {
366 NumUAVs++;
367 } else { // MMDI.ValidatorVersion >= VersionTuple(1, 6)
368 uint32_t Size = UAV.getSize();
369 uint32_t NewNum = NumUAVs + (Size == 0 ? ~0U : Size);
370 if (NewNum < NumUAVs)
371 NewNum = ~0U;
372 NumUAVs = NewNum;
373 }
374 }
375 if (NumUAVs > 8)
376 CSF.Max64UAVs = true;
377
378 // Set the module flag that enables native low-precision execution mode.
379 // NativeLowPrecisionMode can only be set when the command line option
380 // -enable-16bit-types is provided. This is indicated by the dx.nativelowprec
381 // module flag being set
382 // This flag is needed even if the module does not use 16-bit types because a
383 // corresponding debug module may include 16-bit types, and tools that use the
384 // debug module may expect it to have the same flags as the original
385 if (auto *NativeLowPrec = mdconst::extract_or_null<ConstantInt>(
386 M.getModuleFlag("dx.nativelowprec")))
387 if (MMDI.ShaderModelVersion >= VersionTuple(6, 2))
388 CSF.NativeLowPrecisionMode = NativeLowPrec->getValue().getBoolValue();
389
390 // Set ResMayNotAlias to true if DXIL validator version < 1.8 and there
391 // are UAVs present globally.
392 if (CanSetResMayNotAlias && MMDI.ValidatorVersion < VersionTuple(1, 8))
393 CSF.ResMayNotAlias = !DRM.uavs().empty();
394
395 // The command line option -all-resources-bound will set the
396 // dx.allresourcesbound module flag to 1
397 if (auto *AllResourcesBound = mdconst::extract_or_null<ConstantInt>(
398 M.getModuleFlag("dx.allresourcesbound")))
399 if (AllResourcesBound->getValue().getBoolValue())
400 CSF.AllResourcesBound = true;
401
402 return CSF;
403}
404
405/// Construct ModuleShaderFlags for module Module M
407 const DXILResourceMap &DRM,
408 const ModuleMetadataInfo &MMDI,
409 const ModuleSignatureInfo &Signatures) {
410
411 CanSetResMayNotAlias = MMDI.DXILVersion >= VersionTuple(1, 7);
412 // The command line option -res-may-alias will set the dx.resmayalias module
413 // flag to 1, thereby disabling the ability to set the ResMayNotAlias flag
414 if (auto *ResMayAlias = mdconst::extract_or_null<ConstantInt>(
415 M.getModuleFlag("dx.resmayalias")))
416 if (ResMayAlias->getValue().getBoolValue())
417 CanSetResMayNotAlias = false;
418
419 ComputedShaderFlags GlobalSFMask = gatherGlobalModuleFlags(M, DRM, MMDI);
420
421 CallGraph CG(M);
422
423 // Compute Shader Flags Mask for all functions using post-order visit of SCC
424 // of the call graph.
425 for (scc_iterator<CallGraph *> SCCI = scc_begin(&CG); !SCCI.isAtEnd();
426 ++SCCI) {
427 const std::vector<CallGraphNode *> &CurSCC = *SCCI;
428
429 // Union of shader masks of all functions in CurSCC
431 // List of functions in CurSCC that are neither external nor declarations
432 // and hence whose flags are collected
433 SmallVector<Function *> CurSCCFuncs;
434 for (CallGraphNode *CGN : CurSCC) {
435 Function *F = CGN->getFunction();
436 if (!F)
437 continue;
438
439 if (F->isDeclaration()) {
440 assert(!F->getName().starts_with("dx.op.") &&
441 "DXIL Shader Flag analysis should not be run post-lowering.");
442 continue;
443 }
444
445 ComputedShaderFlags CSF = GlobalSFMask;
446 for (const auto &BB : *F)
447 for (const auto &I : BB)
448 updateFunctionFlags(CSF, I, DRTM, MMDI);
449 // An unused signature element still contributes to the shader's type
450 // requirements even when no instruction uses that component type.
451 if (const EntrySignature *Sig = Signatures.get(F)) {
452 CSF.Barycentrics |= llvm::any_of(Sig->Inputs, [](const auto &E) {
453 return E.SemanticKind == dxbc::PSV::SemanticKind::Barycentrics;
454 });
455 auto HasLowPrecision = [](const auto &Elements) {
456 return llvm::any_of(Elements, [](const auto &E) {
457 return E.CompType == ElementType::F16 ||
458 E.CompType == ElementType::I16 ||
459 E.CompType == ElementType::U16;
460 });
461 };
462 if (HasLowPrecision(Sig->Inputs) || HasLowPrecision(Sig->Outputs)) {
463 CSF.LowPrecisionPresent = true;
464 if (Sig->UseNative16Bit)
465 CSF.NativeLowPrecision = true;
466 else
467 CSF.MinimumPrecision = true;
468 }
469 // Declaring SV_ShadingRate in either signature requires the feature,
470 // regardless of whether it is accessed.
471 auto HasShadingRate = [](const auto &Elements) {
472 return llvm::any_of(Elements, [](const auto &E) {
473 return E.SemanticKind == dxbc::PSV::SemanticKind::ShadingRate;
474 });
475 };
476 if (HasShadingRate(Sig->Inputs) || HasShadingRate(Sig->Outputs))
477 CSF.ShadingRate = true;
478 }
479 // Update combined shader flags mask for all functions in this SCC
480 SCCSF.merge(CSF);
481
482 CurSCCFuncs.push_back(F);
483 }
484
485 // Update combined shader flags mask for all functions of the module
486 CombinedSFMask.merge(SCCSF);
487
488 // Shader flags mask of each of the functions in an SCC of the call graph is
489 // the union of all functions in the SCC. Update shader flags masks of
490 // functions in CurSCC accordingly. This is trivially true if SCC contains
491 // one function.
492 for (Function *F : CurSCCFuncs)
493 // Merge SCCSF with that of F
494 FunctionFlags[F].merge(SCCSF);
495 }
496}
497
499 uint64_t FlagVal = (uint64_t) * this;
500 OS << formatv("; Shader Flags Value: {0:x8}\n;\n", FlagVal);
501 if (FlagVal == 0)
502 return;
503 OS << "; Note: shader requires additional functionality:\n";
504#define SHADER_FEATURE_FLAG(FeatureBit, DxilModuleNum, FlagName, Str) \
505 if (FlagName) \
506 (OS << ";").indent(7) << Str << "\n";
507#include "llvm/BinaryFormat/DXContainerConstants.def"
508 OS << "; Note: extra DXIL module flags:\n";
509#define DXIL_MODULE_FLAG(DxilModuleBit, FlagName, Str) \
510 if (FlagName) \
511 (OS << ";").indent(7) << Str << "\n";
512#include "llvm/BinaryFormat/DXContainerConstants.def"
513 OS << ";\n";
514}
515
516/// Return the shader flags mask of the specified function Func.
519 auto Iter = FunctionFlags.find(Func);
520 assert((Iter != FunctionFlags.end() && Iter->first == Func) &&
521 "Get Shader Flags : No Shader Flags Mask exists for function");
522 return Iter->second;
523}
524
525//===----------------------------------------------------------------------===//
526// ShaderFlagsAnalysis and ShaderFlagsAnalysisPrinterPass
527
528// Provide an explicit template instantiation for the static ID.
529AnalysisKey ShaderFlagsAnalysis::Key;
530
542
545 const ModuleShaderFlags &FlagsInfo = AM.getResult<ShaderFlagsAnalysis>(M);
546 // Print description of combined shader flags for all module functions
547 OS << "; Combined Shader Flags for Module\n";
548 FlagsInfo.getCombinedFlags().print(OS);
549 // Print shader flags mask for each of the module functions
550 OS << "; Shader Flags for Module Functions\n";
551 for (const auto &F : M.getFunctionList()) {
552 if (F.isDeclaration())
553 continue;
554 const ComputedShaderFlags &SFMask = FlagsInfo.getFunctionFlags(&F);
555 OS << formatv("; Function {0} : {1:x8}\n;\n", F.getName(),
556 (uint64_t)(SFMask));
557 }
558
559 return PreservedAnalyses::all();
560}
561
562//===----------------------------------------------------------------------===//
563// ShaderFlagsAnalysis and ShaderFlagsAnalysisPrinterPass
564
566 DXILResourceTypeMap &DRTM =
567 getAnalysis<DXILResourceTypeWrapperPass>().getResourceTypeMap();
568 DXILResourceMap &DRM =
569 getAnalysis<DXILResourceWrapperPass>().getResourceMap();
570 const ModuleMetadataInfo MMDI =
572
573 MSFI.initialize(M, DRTM, DRM, MMDI,
574 getAnalysis<SignatureAnalysisWrapper>().getSignatureInfo());
575 return false;
576}
577
585
587
589 "DXIL Shader Flag Analysis", true, true)
594 "DXIL Shader Flag Analysis", true, true)
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
This file contains the simple types necessary to represent the attributes associated with functions a...
This file provides interfaces used to build and manipulate a call graph, which is a very useful tool ...
bool checkIfStatusIsExtracted(const IntrinsicInst &II)
static bool isOptimizationDisabled(const Module &M)
static bool hasUAVsAtEveryStage(const DXILResourceMap &DRM, const ModuleMetadataInfo &MMDI)
static bool checkDoubleExtensionOps(Intrinsic::ID IID)
static bool checkAdvancedTextureOps(const IntrinsicInst &II)
Texture load and sample operations accept "programmable offsets", i.e.
static bool checkWaveOps(Intrinsic::ID IID)
Module.h This file contains the declarations for the Module class.
#define F(x, y, z)
Definition MD5.cpp:54
#define I(x, y, z)
Definition MD5.cpp:57
uint64_t IntrinsicInst * II
#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 builds on the llvm/ADT/GraphTraits.h file to find the strongly connected components (SCCs) of a ...
This file defines the SmallVector class.
PassT::Result & getResult(IRUnitT &IR, ExtraArgTs... ExtraArgs)
Get the result of an analysis pass for a given IR unit.
Represent the analysis usage information of a pass.
AnalysisUsage & addRequired()
void setPreservesAll()
Set by analyses that do not transform their input at all.
AnalysisUsage & addRequiredTransitive()
A node in the call graph for a module.
Definition CallGraph.h:162
The basic data container for the call graph of a Module of IR.
Definition CallGraph.h:72
iterator_range< iterator > uavs()
This instruction extracts a struct member or array element value from an aggregate value.
A wrapper class for inspecting calls to intrinsic functions.
A Module instance is used to store all the information related to an LLVM module.
Definition Module.h:68
AnalysisType & getAnalysis() const
getAnalysis<AnalysisType>() - This function is used by subclasses to get to the analysis information ...
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
void push_back(const T &Elt)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Represent a constant reference to a string, i.e.
Definition StringRef.h:56
@ RayGeneration
Definition Triple.h:405
@ Amplification
Definition Triple.h:412
Represents a version number in the form major[.minor[.subminor[.build]]].
const EntrySignature * get(const Function *F) const
LLVM_ABI bool isUAV() const
LLVM_ABI bool isSampler() const
LLVM_ABI bool isTyped() const
LLVM_ABI TypedInfo getTyped() const
dxil::ResourceKind getResourceKind() const
PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM)
Wrapper pass for the legacy pass manager.
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - This function should be overriden by passes that need analysis information to do t...
bool runOnModule(Module &M) override
runOnModule - Virtual method overriden by subclasses to process the module being operated on.
ModuleShaderFlags run(Module &M, ModuleAnalysisManager &AM)
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition raw_ostream.h:53
Enumerate the SCCs of a directed graph in reverse topological order of the SCC DAG.
Definition SCCIterator.h:48
bool isAtEnd() const
Direct loop termination test which is more efficient than comparison with end().
std::enable_if_t< detail::IsValidPointer< X, Y >::value, X * > extract_or_null(Y &&MD)
Extract a Value from Metadata, allowing null.
Definition Metadata.h:694
This is an optimization pass for GlobalISel generic memory operations.
decltype(auto) dyn_cast(const From &Val)
dyn_cast<X> - Return the argument parameter cast to the specified type.
Definition Casting.h:643
scc_iterator< T > scc_begin(const T &G)
Construct the begin iterator for a deduced graph type T.
RelativeUniformCounterPtr ValuesPtrExpr VTableAddr Value
Definition InstrProf.h:143
bool any_of(R &&range, UnaryPredicate P)
Provide wrappers to std::any_of which take ranges instead of having to pass begin/end explicitly.
Definition STLExtras.h:1762
auto formatv(bool Validate, const char *Fmt, Ts &&...Vals)
bool isa(const From &Val)
isa<X> - Return true if the parameter to the template is an instance of one of the template type argu...
Definition Casting.h:547
LLVM_ATTRIBUTE_VISIBILITY_DEFAULT AnalysisKey InnerAnalysisManagerProxy< AnalysisManagerT, IRUnitT, ExtraArgTs... >::Key
DWARFExpression::Operation Op
decltype(auto) cast(const From &Val)
cast<X> - Return the argument parameter cast to the specified type.
Definition Casting.h:559
AnalysisManager< Module > ModuleAnalysisManager
Convenience typedef for the Module analysis manager.
Definition MIRParser.h:39
A special type used by analysis passes to provide an address that identifies that particular analysis...
Definition Analysis.h:29
void merge(const ComputedShaderFlags CSF)
void print(raw_ostream &OS=dbgs()) const
Triple::EnvironmentType ShaderProfile
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, const ModuleSignatureInfo &Signatures)
Construct ModuleShaderFlags for module Module M.
const ComputedShaderFlags & getCombinedFlags() const