Lines Matching full:resources
1 //===- UnifyAliasedResourcePass.cpp - Pass to Unify Aliased Resources -----===//
9 // This file implements a pass that unifies access of multiple aliased resources
50 /// Collects all aliased resources in the given SPIR-V `moduleOp`.
85 /// resource that all resources should be unified into. Returns std::nullopt if
89 // scalarNumBits: contains all resources' scalar types' bit counts. in deduceCanonicalResource()
90 // vectorNumBits: only contains resources whose element types are vectors. in deduceCanonicalResource()
159 /// A class for analyzing aliased resources.
161 /// Resources are expected to be spirv.GlobalVarible that has a descriptor set
162 /// and binding number. Such resources are of the type
177 /// Returns all descriptors and their corresponding aliased resources.
190 /// Given the descriptor and aliased resources bound to it, analyze whether we
193 ArrayRef<spirv::GlobalVariableOp> resources);
195 /// Mapping from a descriptor to all aliased resources bound to it.
210 // Collect all aliased resources first and put them into different sets in ResourceAliasAnalysis()
272 const Descriptor &descriptor, ArrayRef<spirv::GlobalVariableOp> resources) { in recordIfUnifiable() argument
273 // Collect the element types for all resources in the current set. in recordIfUnifiable()
275 for (spirv::GlobalVariableOp resource : resources) { in recordIfUnifiable()
292 resourceMap[descriptor].assign(resources.begin(), resources.end()); in recordIfUnifiable()
293 canonicalResourceMap[descriptor] = resources[*index]; in recordIfUnifiable()
294 for (const auto &resource : llvm::enumerate(resources)) { in recordIfUnifiable()
596 // Analyze aliased resources first. in runOnOperation()
606 // Run patterns to rewrite usages of non-canonical resources. in runOnOperation()
619 const auto &resources = dr.second; in runOnOperation() local
620 if (resources.size() == 1) in runOnOperation()
621 resources.front()->removeAttr("aliased"); in runOnOperation()