[Mlir-commits] [mlir] 2dfefe0 - [mlir][spirv] NFC: fix typo in UnifyAliasedResourcePass pass
Lei Zhang
llvmlistbot at llvm.org
Wed Jun 8 08:18:18 PDT 2022
Author: Lei Zhang
Date: 2022-06-08T08:18:12-07:00
New Revision: 2dfefe02832ad7e9604e466a66884039521a9147
URL: https://github.com/llvm/llvm-project/commit/2dfefe02832ad7e9604e466a66884039521a9147
DIFF: https://github.com/llvm/llvm-project/commit/2dfefe02832ad7e9604e466a66884039521a9147.diff
LOG: [mlir][spirv] NFC: fix typo in UnifyAliasedResourcePass pass
Reviewed By: ThomasRaoux, hanchung
Differential Revision: https://reviews.llvm.org/D127265
Added:
Modified:
mlir/lib/Dialect/SPIRV/Transforms/UnifyAliasedResourcePass.cpp
Removed:
################################################################################
diff --git a/mlir/lib/Dialect/SPIRV/Transforms/UnifyAliasedResourcePass.cpp b/mlir/lib/Dialect/SPIRV/Transforms/UnifyAliasedResourcePass.cpp
index 5968cebfd3dd..e2b83a8ba22f 100644
--- a/mlir/lib/Dialect/SPIRV/Transforms/UnifyAliasedResourcePass.cpp
+++ b/mlir/lib/Dialect/SPIRV/Transforms/UnifyAliasedResourcePass.cpp
@@ -41,16 +41,16 @@ using AliasedResourceMap =
/// 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<UnitAttr>("aliased")) {
Optional<uint32_t> set = varOp.descriptor_set();
Optional<uint32_t> 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 @@ class ResourceAliasAnalysis {
ResourceAliasAnalysis::ResourceAliasAnalysis(Operation *root) {
// Collect all aliased resources first and put them into
diff erent sets
// according to the descriptor.
- AliasedResourceMap aliasedResoruces =
+ AliasedResourceMap aliasedResources =
collectAliasedResources(cast<spirv::ModuleOp>(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 @@ void ResourceAliasAnalysis::recordIfUnifiable(
//===----------------------------------------------------------------------===//
template <typename OpTy>
-class ConvertAliasResoruce : public OpConversionPattern<OpTy> {
+class ConvertAliasResource : public OpConversionPattern<OpTy> {
public:
- ConvertAliasResoruce(const ResourceAliasAnalysis &analysis,
+ ConvertAliasResource(const ResourceAliasAnalysis &analysis,
MLIRContext *context, PatternBenefit benefit = 1)
: OpConversionPattern<OpTy>(context, benefit), analysis(analysis) {}
@@ -269,8 +269,8 @@ class ConvertAliasResoruce : public OpConversionPattern<OpTy> {
const ResourceAliasAnalysis &analysis;
};
-struct ConvertVariable : public ConvertAliasResoruce<spirv::GlobalVariableOp> {
- using ConvertAliasResoruce::ConvertAliasResoruce;
+struct ConvertVariable : public ConvertAliasResource<spirv::GlobalVariableOp> {
+ using ConvertAliasResource::ConvertAliasResource;
LogicalResult
matchAndRewrite(spirv::GlobalVariableOp varOp, OpAdaptor adaptor,
@@ -282,8 +282,8 @@ struct ConvertVariable : public ConvertAliasResoruce<spirv::GlobalVariableOp> {
}
};
-struct ConvertAddressOf : public ConvertAliasResoruce<spirv::AddressOfOp> {
- using ConvertAliasResoruce::ConvertAliasResoruce;
+struct ConvertAddressOf : public ConvertAliasResource<spirv::AddressOfOp> {
+ using ConvertAliasResource::ConvertAliasResource;
LogicalResult
matchAndRewrite(spirv::AddressOfOp addressOp, OpAdaptor adaptor,
@@ -298,8 +298,8 @@ struct ConvertAddressOf : public ConvertAliasResoruce<spirv::AddressOfOp> {
}
};
-struct ConvertAccessChain : public ConvertAliasResoruce<spirv::AccessChainOp> {
- using ConvertAliasResoruce::ConvertAliasResoruce;
+struct ConvertAccessChain : public ConvertAliasResource<spirv::AccessChainOp> {
+ using ConvertAliasResource::ConvertAliasResource;
LogicalResult
matchAndRewrite(spirv::AccessChainOp acOp, OpAdaptor adaptor,
@@ -353,8 +353,8 @@ struct ConvertAccessChain : public ConvertAliasResoruce<spirv::AccessChainOp> {
}
};
-struct ConvertLoad : public ConvertAliasResoruce<spirv::LoadOp> {
- using ConvertAliasResoruce::ConvertAliasResoruce;
+struct ConvertLoad : public ConvertAliasResource<spirv::LoadOp> {
+ using ConvertAliasResource::ConvertAliasResource;
LogicalResult
matchAndRewrite(spirv::LoadOp loadOp, OpAdaptor adaptor,
@@ -380,8 +380,8 @@ struct ConvertLoad : public ConvertAliasResoruce<spirv::LoadOp> {
}
};
-struct ConvertStore : public ConvertAliasResoruce<spirv::StoreOp> {
- using ConvertAliasResoruce::ConvertAliasResoruce;
+struct ConvertStore : public ConvertAliasResource<spirv::StoreOp> {
+ using ConvertAliasResource::ConvertAliasResource;
LogicalResult
matchAndRewrite(spirv::StoreOp storeOp, OpAdaptor adaptor,
More information about the Mlir-commits
mailing list