diff --git a/mlir/lib/Dialect/SPIRV/Transforms/UnifyAliasedResourcePass.cpp b/mlir/lib/Dialect/SPIRV/Transforms/UnifyAliasedResourcePass.cpp --- a/mlir/lib/Dialect/SPIRV/Transforms/UnifyAliasedResourcePass.cpp +++ b/mlir/lib/Dialect/SPIRV/Transforms/UnifyAliasedResourcePass.cpp @@ -41,16 +41,16 @@ /// Collects all aliased resources in the given SPIR-V `moduleOp`. static AliasedResourceMap collectAliasedResources(spirv::ModuleOp moduleOp) { - AliasedResourceMap aliasedResoruces; - moduleOp->walk([&aliasedResoruces](spirv::GlobalVariableOp varOp) { + AliasedResourceMap aliasedResources; + moduleOp->walk([&aliasedResources](spirv::GlobalVariableOp varOp) { if (varOp->getAttrOfType("aliased")) { Optional set = varOp.descriptor_set(); Optional binding = varOp.binding(); if (set && binding) - aliasedResoruces[{*set, *binding}].push_back(varOp); + aliasedResources[{*set, *binding}].push_back(varOp); } }); - return aliasedResoruces; + return aliasedResources; } /// Returns the element type if the given `type` is a runtime array resource: @@ -146,13 +146,13 @@ ResourceAliasAnalysis::ResourceAliasAnalysis(Operation *root) { // Collect all aliased resources first and put them into different sets // according to the descriptor. - AliasedResourceMap aliasedResoruces = + AliasedResourceMap aliasedResources = collectAliasedResources(cast(root)); // For each resource set, analyze whether we can unify; if so, try to identify // a canonical resource, whose element type has the largest bitwidth. - for (const auto &descriptorResoruce : aliasedResoruces) { - recordIfUnifiable(descriptorResoruce.first, descriptorResoruce.second); + for (const auto &descriptorResource : aliasedResources) { + recordIfUnifiable(descriptorResource.first, descriptorResource.second); } } @@ -259,9 +259,9 @@ //===----------------------------------------------------------------------===// template -class ConvertAliasResoruce : public OpConversionPattern { +class ConvertAliasResource : public OpConversionPattern { public: - ConvertAliasResoruce(const ResourceAliasAnalysis &analysis, + ConvertAliasResource(const ResourceAliasAnalysis &analysis, MLIRContext *context, PatternBenefit benefit = 1) : OpConversionPattern(context, benefit), analysis(analysis) {} @@ -269,8 +269,8 @@ const ResourceAliasAnalysis &analysis; }; -struct ConvertVariable : public ConvertAliasResoruce { - using ConvertAliasResoruce::ConvertAliasResoruce; +struct ConvertVariable : public ConvertAliasResource { + using ConvertAliasResource::ConvertAliasResource; LogicalResult matchAndRewrite(spirv::GlobalVariableOp varOp, OpAdaptor adaptor, @@ -282,8 +282,8 @@ } }; -struct ConvertAddressOf : public ConvertAliasResoruce { - using ConvertAliasResoruce::ConvertAliasResoruce; +struct ConvertAddressOf : public ConvertAliasResource { + using ConvertAliasResource::ConvertAliasResource; LogicalResult matchAndRewrite(spirv::AddressOfOp addressOp, OpAdaptor adaptor, @@ -298,8 +298,8 @@ } }; -struct ConvertAccessChain : public ConvertAliasResoruce { - using ConvertAliasResoruce::ConvertAliasResoruce; +struct ConvertAccessChain : public ConvertAliasResource { + using ConvertAliasResource::ConvertAliasResource; LogicalResult matchAndRewrite(spirv::AccessChainOp acOp, OpAdaptor adaptor, @@ -353,8 +353,8 @@ } }; -struct ConvertLoad : public ConvertAliasResoruce { - using ConvertAliasResoruce::ConvertAliasResoruce; +struct ConvertLoad : public ConvertAliasResource { + using ConvertAliasResource::ConvertAliasResource; LogicalResult matchAndRewrite(spirv::LoadOp loadOp, OpAdaptor adaptor, @@ -380,8 +380,8 @@ } }; -struct ConvertStore : public ConvertAliasResoruce { - using ConvertAliasResoruce::ConvertAliasResoruce; +struct ConvertStore : public ConvertAliasResource { + using ConvertAliasResource::ConvertAliasResource; LogicalResult matchAndRewrite(spirv::StoreOp storeOp, OpAdaptor adaptor,