Skip to content

Commit 41b09f4

Browse files
committed
[mlir] NFC: fix trivial typos
fix typos in comments and documents Reviewed By: jpienaar Differential Revision: https://reviews.llvm.org/D90089
1 parent 220293d commit 41b09f4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+86
-86
lines changed

mlir/docs/OpDefinitions.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -797,7 +797,7 @@ A custom directive has two main parts: The `UserDirective` and the `Params`. A
797797
custom directive is transformed into a call to a `print*` and a `parse*` method
798798
when generating the C++ code for the format. The `UserDirective` is an
799799
identifier used as a suffix to these two calls, i.e., `custom<MyDirective>(...)`
800-
would result in calls to `parseMyDirective` and `printMyDirective` wihtin the
800+
would result in calls to `parseMyDirective` and `printMyDirective` within the
801801
parser and printer respectively. `Params` may be any combination of variables
802802
(i.e. Attribute, Operand, Successor, etc.), type directives, and `attr-dict`.
803803
The type directives must refer to a variable, but that variable need not also
@@ -1515,7 +1515,7 @@ def IntegerType : Test_Type<"TestInteger"> {
15151515

15161516
The name of the C++ class which gets generated defaults to
15171517
`<classParamName>Type` (e.g. `TestIntegerType` in the above example). This
1518-
can be overridden via the the `cppClassName` field. The field `mnemonic` is
1518+
can be overridden via the `cppClassName` field. The field `mnemonic` is
15191519
to specify the asm name for parsing. It is optional and not specifying it
15201520
will imply that no parser or printer methods are attached to this class.
15211521

@@ -1554,7 +1554,7 @@ The default storage constructor blindly copies fields by value. It does not
15541554
know anything about the types. In this case, the ArrayRef<int> requires
15551555
allocation with `dims = allocator.copyInto(dims)`.
15561556

1557-
You can specify the necessary constuctor by specializing the `TypeParameter`
1557+
You can specify the necessary constructor by specializing the `TypeParameter`
15581558
tblgen class:
15591559

15601560
```tablegen

mlir/include/mlir-c/Diagnostics.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
extern "C" {
2222
#endif
2323

24-
/** An opaque reference to a dignostic, always owned by the diagnostics engine
24+
/** An opaque reference to a diagnostic, always owned by the diagnostics engine
2525
* (context). Must not be stored outside of the diagnostic handler. */
2626
struct MlirDiagnostic {
2727
void *ptr;

mlir/include/mlir-c/StandardAttributes.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ MlirAttribute mlirSymbolRefAttrGet(MlirContext ctx, intptr_t length,
203203
* live as long as the context in which the attribute lives. */
204204
MlirStringRef mlirSymbolRefAttrGetRootReference(MlirAttribute attr);
205205

206-
/** Returns the stirng reference to the leaf referenced symbol. The data remains
206+
/** Returns the string reference to the leaf referenced symbol. The data remains
207207
* live as long as the context in which the attribute lives. */
208208
MlirStringRef mlirSymbolRefAttrGetLeafReference(MlirAttribute attr);
209209

mlir/include/mlir/Dialect/Async/IR/AsyncOps.td

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def Async_ExecuteOp :
4343
(`async.token` or `async.value`).
4444

4545
`async.execute` operation takes `async.token` dependencies and `async.value`
46-
operands separatly, and starts execution of the attached body region only
46+
operands separately, and starts execution of the attached body region only
4747
when all tokens and values become ready.
4848

4949
Example:

mlir/include/mlir/IR/OpBase.td

+3-3
Original file line numberDiff line numberDiff line change
@@ -913,7 +913,7 @@ class SignlessIntegerAttrBase<I attrValType, string descr> :
913913
let returnType = [{ ::llvm::APInt }];
914914
}
915915
// Base class for signless integer attributes of fixed width that have a
916-
// correpsonding C++ type.
916+
// corresponding C++ type.
917917
class TypedSignlessIntegerAttrBase<I attrValType, string retType, string descr>
918918
: SignlessIntegerAttrBase<attrValType, descr> {
919919
let returnType = retType;
@@ -942,7 +942,7 @@ class SignedIntegerAttrBase<SI attrValType, string descr> :
942942
let returnType = [{ ::llvm::APInt }];
943943
}
944944
// Base class for signed integer attributes of fixed width that have a
945-
// correpsonding C++ type.
945+
// corresponding C++ type.
946946
class TypedSignedIntegerAttrBase<SI attrValType, string retType, string descr>
947947
: SignedIntegerAttrBase<attrValType, descr> {
948948
let returnType = retType;
@@ -971,7 +971,7 @@ class UnsignedIntegerAttrBase<UI attrValType, string descr> :
971971
let returnType = [{ ::llvm::APInt }];
972972
}
973973
// Base class for unsigned integer attributes of fixed width that have a
974-
// correpsonding C++ type.
974+
// corresponding C++ type.
975975
class TypedUnsignedIntegerAttrBase<UI attrValType, string retType, string descr>
976976
: UnsignedIntegerAttrBase<attrValType, descr> {
977977
let returnType = retType;

mlir/include/mlir/Reducer/Passes/OpReducer.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
//
99
// This file defines the OpReducer class. It defines a variant generator method
1010
// with the purpose of producing different variants by eliminating a
11-
// parametarizable type of operations from the parent module.
11+
// parameterizable type of operations from the parent module.
1212
//
1313
//===----------------------------------------------------------------------===//
1414

mlir/include/mlir/Support/IndentedOstream.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class raw_indented_ostream : public raw_ostream {
5151
}
5252

5353
/// Re-indents by removing the leading whitespace from the first non-empty
54-
/// line from every line of the the string, skipping over empty lines at the
54+
/// line from every line of the string, skipping over empty lines at the
5555
/// start.
5656
raw_indented_ostream &reindent(StringRef str);
5757

mlir/integration_test/Dialect/Vector/CPU/test-create-mask-v4i1.mlir

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// RUN: FileCheck %s
55

66
// NOTE: This is similar to test-create-mask.mlir, but with a different length,
7-
// because the v4i1 vector specifially exposed bugs in the LLVM backend.
7+
// because the v4i1 vector specifically exposed bugs in the LLVM backend.
88

99
func @entry() {
1010
%c0 = constant 0 : index

mlir/lib/Analysis/Presburger/Simplex.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ void Simplex::markEmpty() {
351351
}
352352

353353
/// Add an inequality to the tableau. If coeffs is c_0, c_1, ... c_n, where n
354-
/// is the curent number of variables, then the corresponding inequality is
354+
/// is the current number of variables, then the corresponding inequality is
355355
/// c_n + c_0*x_0 + c_1*x_1 + ... + c_{n-1}*x_{n-1} >= 0.
356356
///
357357
/// We add the inequality and mark it as restricted. We then try to make its
@@ -367,7 +367,7 @@ void Simplex::addInequality(ArrayRef<int64_t> coeffs) {
367367
}
368368

369369
/// Add an equality to the tableau. If coeffs is c_0, c_1, ... c_n, where n
370-
/// is the curent number of variables, then the corresponding equality is
370+
/// is the current number of variables, then the corresponding equality is
371371
/// c_n + c_0*x_0 + c_1*x_1 + ... + c_{n-1}*x_{n-1} == 0.
372372
///
373373
/// We simply add two opposing inequalities, which force the expression to
@@ -383,7 +383,7 @@ void Simplex::addEquality(ArrayRef<int64_t> coeffs) {
383383
unsigned Simplex::numVariables() const { return var.size(); }
384384
unsigned Simplex::numConstraints() const { return con.size(); }
385385

386-
/// Return a snapshot of the curent state. This is just the current size of the
386+
/// Return a snapshot of the current state. This is just the current size of the
387387
/// undo log.
388388
unsigned Simplex::getSnapshot() const { return undoLog.size(); }
389389

mlir/lib/Bindings/Python/IRModules.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ class PyBlockIterator {
326326
};
327327

328328
/// Blocks are exposed by the C-API as a forward-only linked list. In Python,
329-
/// we present them as a more full-featured list-like container but optimzie
329+
/// we present them as a more full-featured list-like container but optimize
330330
/// it for forward iteration. Blocks are always owned by a region.
331331
class PyBlockList {
332332
public:
@@ -424,7 +424,7 @@ class PyOperationIterator {
424424

425425
/// Operations are exposed by the C-API as a forward-only linked list. In
426426
/// Python, we present them as a more full-featured list-like container but
427-
/// optimzie it for forward iteration. Iterable operations are always owned
427+
/// optimize it for forward iteration. Iterable operations are always owned
428428
/// by a block.
429429
class PyOperationList {
430430
public:

mlir/lib/Conversion/GPUToSPIRV/ConvertGPUToSPIRV.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class LaunchConfigConversion : public SPIRVOpLowering<SourceOp> {
3434
ConversionPatternRewriter &rewriter) const override;
3535
};
3636

37-
/// Pattern lowering subgoup size/id to loading SPIR-V invocation
37+
/// Pattern lowering subgroup size/id to loading SPIR-V invocation
3838
/// builtin variables.
3939
template <typename SourceOp, spirv::BuiltIn builtin>
4040
class SingleDimLaunchConfigConversion : public SPIRVOpLowering<SourceOp> {

mlir/lib/Conversion/SPIRVToLLVM/ConvertSPIRVToLLVM.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ static Value createFPConstant(Location loc, Type srcType, Type dstType,
108108
loc, dstType, rewriter.getFloatAttr(floatType, value));
109109
}
110110

111-
/// Utility function for bitfiled ops:
111+
/// Utility function for bitfield ops:
112112
/// - `BitFieldInsert`
113113
/// - `BitFieldSExtract`
114114
/// - `BitFieldUExtract`
@@ -163,7 +163,7 @@ static Value optionallyBroadcast(Location loc, Value value, Type srcType,
163163
return value;
164164
}
165165

166-
/// Utility function for bitfiled ops: `BitFieldInsert`, `BitFieldSExtract` and
166+
/// Utility function for bitfield ops: `BitFieldInsert`, `BitFieldSExtract` and
167167
/// `BitFieldUExtract`.
168168
/// Broadcast `Offset` and `Count` to match the type of `Base`. If `Base` is of
169169
/// a vector type, construct a vector that has:
@@ -971,8 +971,8 @@ class LoopPattern : public SPIRVToLLVMConversion<spirv::LoopOp> {
971971

972972
Location loc = loopOp.getLoc();
973973

974-
// Split the current block after `spv.loop`. The remaing ops will be used in
975-
// `endBlock`.
974+
// Split the current block after `spv.loop`. The remaining ops will be used
975+
// in `endBlock`.
976976
Block *currentBlock = rewriter.getBlock();
977977
auto position = Block::iterator(loopOp);
978978
Block *endBlock = rewriter.splitBlock(currentBlock, position);
@@ -1028,7 +1028,7 @@ class SelectionPattern : public SPIRVToLLVMConversion<spirv::SelectionOp> {
10281028

10291029
Location loc = op.getLoc();
10301030

1031-
// Split the current block after `spv.selection`. The remaing ops will be
1031+
// Split the current block after `spv.selection`. The remaining ops will be
10321032
// used in `continueBlock`.
10331033
auto *currentBlock = rewriter.getInsertionBlock();
10341034
rewriter.setInsertionPointAfter(op);
@@ -1387,7 +1387,7 @@ void mlir::populateSPIRVToLLVMConversionPatterns(
13871387

13881388
// Entry points and execution mode
13891389
// Module generated from SPIR-V could have other "internal" functions, so
1390-
// having entry point and execution mode metadat can be useful. For now,
1390+
// having entry point and execution mode metadata can be useful. For now,
13911391
// simply remove them.
13921392
// TODO: Support EntryPoint/ExecutionMode properly.
13931393
ErasePattern<spirv::EntryPointOp>, ErasePattern<spirv::ExecutionModeOp>,

mlir/lib/Conversion/ShapeToStandard/ShapeToStandard.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ LogicalResult BroadcastOpConverter::matchAndRewrite(
132132
},
133133
[&](OpBuilder &b, Location loc) {
134134
// The broadcasting logic is:
135-
// - if one extent (here we arbitrariliy choose the extent from
135+
// - if one extent (here we arbitrarily choose the extent from
136136
// the greater-rank operand) is equal to 1, then take the extent
137137
// from the other operand
138138
// - otherwise, take the extent as-is.

mlir/lib/Conversion/StandardToLLVM/StandardToLLVM.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ SmallVector<Type, 2> LLVMTypeConverter::convertUnrankedMemRefSignature() {
249249
LLVM::LLVMType LLVMTypeConverter::convertFunctionSignature(
250250
FunctionType funcTy, bool isVariadic,
251251
LLVMTypeConverter::SignatureConversion &result) {
252-
// Select the argument converter depending on the calling convetion.
252+
// Select the argument converter depending on the calling convention.
253253
auto funcArgConverter = options.useBarePtrCallConv
254254
? barePtrFuncArgTypeConverter
255255
: structFuncArgTypeConverter;

mlir/lib/Conversion/StandardToSPIRV/ConvertStandardToSPIRV.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ class CmpFOpPattern final : public SPIRVOpLowering<CmpFOp> {
414414
ConversionPatternRewriter &rewriter) const override;
415415
};
416416

417-
/// Converts integer compare operation on i1 type opearnds to SPIR-V ops.
417+
/// Converts integer compare operation on i1 type operands to SPIR-V ops.
418418
class BoolCmpIOpPattern final : public SPIRVOpLowering<CmpIOp> {
419419
public:
420420
using SPIRVOpLowering<CmpIOp>::SPIRVOpLowering;

mlir/lib/Conversion/VectorToROCDL/VectorToROCDL.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ class VectorTransferConversion : public ConvertToLLVMPattern {
100100
return failure();
101101

102102
// Note that the dataPtr starts at the offset address specified by
103-
// indices, so no need to calculat offset size in bytes again in
103+
// indices, so no need to calculate offset size in bytes again in
104104
// the MUBUF instruction.
105105
Value dataPtr = getDataPtr(loc, memRefType, adaptor.memref(),
106106
adaptor.indices(), rewriter);

mlir/lib/Dialect/GPU/Transforms/KernelOutlining.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ extractBeneficiaryOps(Operation *op,
8484
return false;
8585

8686
for (Value operand : op->getOperands()) {
87-
// It is already visisble in the kernel, keep going.
87+
// It is already visible in the kernel, keep going.
8888
if (availableValues.count(operand))
8989
continue;
9090
// Else check whether it can be made available via sinking or already is a

mlir/lib/Dialect/LLVMIR/IR/TypeDetail.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ struct LLVMStructTypeStorage : public TypeStorage {
7979
bool isIdentified() const { return identified; }
8080
bool isPacked() const {
8181
assert(!isIdentified() &&
82-
"'packed' bit is not part of the key for identified stucts");
82+
"'packed' bit is not part of the key for identified structs");
8383
return packed;
8484
}
8585
bool isOpaque() const {
@@ -196,7 +196,7 @@ struct LLVMStructTypeStorage : public TypeStorage {
196196
/// Constructs the storage from the given key. This sets up the uniquing key
197197
/// components and optionally the mutable component if they construction key
198198
/// has the relevant information. In the latter case, the struct is considered
199-
/// as initalized and can no longer be mutated.
199+
/// as initialized and can no longer be mutated.
200200
LLVMStructTypeStorage(const KeyTy &key) {
201201
if (!key.isIdentified()) {
202202
ArrayRef<LLVMType> types = key.getTypeList();

mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -711,10 +711,10 @@ static SmallVector<SmallVector<AffineExpr, 2>, 2>
711711
convertReassociationIndicesToMaps(
712712
OpBuilder &b, ArrayRef<ReassociationIndices> reassociationIndices) {
713713
SmallVector<SmallVector<AffineExpr, 2>, 2> reassociationMaps;
714-
for (const auto &indicies : reassociationIndices) {
714+
for (const auto &indices : reassociationIndices) {
715715
SmallVector<AffineExpr, 2> reassociationMap;
716-
reassociationMap.reserve(indicies.size());
717-
for (int64_t index : indicies)
716+
reassociationMap.reserve(indices.size());
717+
for (int64_t index : indices)
718718
reassociationMap.push_back(b.getAffineDimExpr(index));
719719
reassociationMaps.push_back(std::move(reassociationMap));
720720
}

mlir/lib/Dialect/Linalg/Transforms/FusionOnTensors.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ static void generateFusedTensorOpRegion(PatternRewriter &rewriter,
147147
}
148148

149149
// If consumer is an indexed_generic op, map the indices to the block
150-
// arguments directly. Otherwise, add the same type of arugment and map to
150+
// arguments directly. Otherwise, add the same type of argument and map to
151151
// it.
152152
if (consumerArg.index() < numConsumerIndices) {
153153
mapper.map(consumerArg.value(),

mlir/lib/Dialect/Linalg/Transforms/Hoisting.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ void mlir::linalg::hoistViewAllocOps(FuncOp func) {
8080
}
8181
}
8282

83-
/// Return true if we can prove that the transfer operations access dijoint
83+
/// Return true if we can prove that the transfer operations access disjoint
8484
/// memory.
8585
static bool isDisjoint(VectorTransferOpInterface transferA,
8686
VectorTransferOpInterface transferB) {

mlir/lib/Dialect/Linalg/Transforms/Promotion.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ struct LinalgOpInstancePromotionOptions {
161161
CopyCallbackFn copyInFn;
162162
CopyCallbackFn copyOutFn;
163163

164-
/// Allow the use of dynamicaly-sized buffers.
164+
/// Allow the use of dynamically-sized buffers.
165165
bool dynamicBuffers;
166166
/// Alignment of promoted buffer.
167167
Optional<unsigned> alignment;

mlir/lib/Dialect/SPIRV/SPIRVDialect.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ static Type parseArrayType(SPIRVDialect const &dialect,
302302
}
303303

304304
// cooperative-matrix-type ::= `!spv.coopmatrix` `<` element-type ',' scope ','
305-
// rows ',' coloumns>`
305+
// rows ',' columns>`
306306
static Type parseCooperativeMatrixType(SPIRVDialect const &dialect,
307307
DialectAsmParser &parser) {
308308
if (parser.parseLess())
@@ -621,7 +621,7 @@ static Type parseStructType(SPIRVDialect const &dialect,
621621

622622
StringRef identifier;
623623

624-
// Check if this is an idenitifed struct type.
624+
// Check if this is an identified struct type.
625625
if (succeeded(parser.parseOptionalKeyword(&identifier))) {
626626
// Check if this is a possible recursive reference.
627627
if (succeeded(parser.parseOptionalGreater())) {

mlir/lib/Dialect/SPIRV/SPIRVOps.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -217,9 +217,9 @@ static ParseResult parseMemoryAccessAttributes(OpAsmParser &parser,
217217
}
218218

219219
// TODO Make sure to merge this and the previous function into one template
220-
// parameterized by memroy access attribute name and alignment. Doing so now
220+
// parameterized by memory access attribute name and alignment. Doing so now
221221
// results in VS2017 in producing an internal error (at the call site) that's
222-
// not detailed enough to understand what is happenning.
222+
// not detailed enough to understand what is happening.
223223
static ParseResult parseSourceMemoryAccessAttributes(OpAsmParser &parser,
224224
OperationState &state) {
225225
// Parse an optional list of attributes staring with '['
@@ -274,9 +274,9 @@ static void printMemoryAccessAttribute(
274274
}
275275

276276
// TODO Make sure to merge this and the previous function into one template
277-
// parameterized by memroy access attribute name and alignment. Doing so now
277+
// parameterized by memory access attribute name and alignment. Doing so now
278278
// results in VS2017 in producing an internal error (at the call site) that's
279-
// not detailed enough to understand what is happenning.
279+
// not detailed enough to understand what is happening.
280280
template <typename MemoryOpTy>
281281
static void printSourceMemoryAccessAttribute(
282282
MemoryOpTy memoryOp, OpAsmPrinter &printer,
@@ -393,9 +393,9 @@ static LogicalResult verifyMemoryAccessAttribute(MemoryOpTy memoryOp) {
393393
}
394394

395395
// TODO Make sure to merge this and the previous function into one template
396-
// parameterized by memroy access attribute name and alignment. Doing so now
396+
// parameterized by memory access attribute name and alignment. Doing so now
397397
// results in VS2017 in producing an internal error (at the call site) that's
398-
// not detailed enough to understand what is happenning.
398+
// not detailed enough to understand what is happening.
399399
template <typename MemoryOpTy>
400400
static LogicalResult verifySourceMemoryAccessAttribute(MemoryOpTy memoryOp) {
401401
// ODS checks for attributes values. Just need to verify that if the

mlir/lib/Dialect/SPIRV/SPIRVTypes.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -810,7 +810,7 @@ struct spirv::detail::StructTypeStorage : public TypeStorage {
810810
std::tuple<StringRef, ArrayRef<Type>, ArrayRef<StructType::OffsetInfo>,
811811
ArrayRef<StructType::MemberDecorationInfo>>;
812812

813-
/// For idetified structs, return true if the given key contains the same
813+
/// For identified structs, return true if the given key contains the same
814814
/// identifier.
815815
///
816816
/// For literal structs, return true if the given key contains a matching list

mlir/lib/Dialect/SPIRV/Serialization/Serializer.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1033,7 +1033,7 @@ bool Serializer::isInterfaceStructPtrType(Type type) const {
10331033
LogicalResult Serializer::processType(Location loc, Type type,
10341034
uint32_t &typeID) {
10351035
// Maintains a set of names for nested identified struct types. This is used
1036-
// to properly seialize resursive references.
1036+
// to properly serialize resursive references.
10371037
llvm::SetVector<StringRef> serializationCtx;
10381038
return processTypeImpl(loc, type, typeID, serializationCtx);
10391039
}
@@ -1170,7 +1170,7 @@ LogicalResult Serializer::prepareBasicType(
11701170
spirv::Opcode::OpTypeForwardPointer,
11711171
forwardPtrOperands);
11721172

1173-
// 2. Find the the pointee (enclosing) struct.
1173+
// 2. Find the pointee (enclosing) struct.
11741174
auto structType = spirv::StructType::getIdentified(
11751175
module.getContext(), pointeeStruct.getIdentifier());
11761176

0 commit comments

Comments
 (0)