[MLIR][Toy] Fix a few typos in the comments/docs.

Fixes a few typos and errors in MLIR's Toy tutorial docs and comments.

Differential Revision: https://reviews.llvm.org/D81406
This commit is contained in:
KareemErgawy 2020-06-08 18:18:06 -04:00 committed by Lei Zhang
parent 603d58b5e4
commit a6d6b0ac93
13 changed files with 40 additions and 22 deletions

View File

@ -98,7 +98,7 @@ void ConstantOp::build(mlir::OpBuilder &builder, mlir::OperationState &state,
ConstantOp::build(builder, state, dataType, dataAttribute);
}
/// The 'OpAsmPrinter' class provides a collection of methods for parsing
/// The 'OpAsmParser' class provides a collection of methods for parsing
/// various punctuation, as well as attributes, operands, types, etc. Each of
/// these methods returns a `ParseResult`. This class is a wrapper around
/// `LogicalResult` that can be converted to a boolean `true` value on failure,
@ -116,7 +116,7 @@ static mlir::ParseResult parseConstantOp(mlir::OpAsmParser &parser,
return success();
}
/// The 'OpAsmPrinter' class is a stream that will allows for formatting
/// The 'OpAsmPrinter' class is a stream that allows for formatting
/// strings, attributes, operands, types, etc.
static void print(mlir::OpAsmPrinter &printer, ConstantOp op) {
printer << "toy.constant ";

View File

@ -98,7 +98,7 @@ void ConstantOp::build(mlir::OpBuilder &builder, mlir::OperationState &state,
ConstantOp::build(builder, state, dataType, dataAttribute);
}
/// The 'OpAsmPrinter' class provides a collection of methods for parsing
/// The 'OpAsmParser' class provides a collection of methods for parsing
/// various punctuation, as well as attributes, operands, types, etc. Each of
/// these methods returns a `ParseResult`. This class is a wrapper around
/// `LogicalResult` that can be converted to a boolean `true` value on failure,
@ -116,7 +116,7 @@ static mlir::ParseResult parseConstantOp(mlir::OpAsmParser &parser,
return success();
}
/// The 'OpAsmPrinter' class is a stream that will allows for formatting
/// The 'OpAsmPrinter' class is a stream that allows for formatting
/// strings, attributes, operands, types, etc.
static void print(mlir::OpAsmPrinter &printer, ConstantOp op) {
printer << "toy.constant ";

View File

@ -24,7 +24,7 @@ namespace {
} // end anonymous namespace
/// This is an example of a c++ rewrite pattern for the TransposeOp. It
/// optimizes the following scenario: transpose(transpose(x)) -> transpose(x)
/// optimizes the following scenario: transpose(transpose(x)) -> x
struct SimplifyRedundantTranspose : public mlir::OpRewritePattern<TransposeOp> {
/// We register this pattern to match every toy.transpose in the IR.
/// The "benefit" is used by the framework to order the patterns and process

View File

@ -166,7 +166,7 @@ static mlir::ParseResult parseConstantOp(mlir::OpAsmParser &parser,
return success();
}
/// The 'OpAsmPrinter' class is a stream that will allows for formatting
/// The 'OpAsmPrinter' class is a stream that allows for formatting
/// strings, attributes, operands, types, etc.
static void print(mlir::OpAsmPrinter &printer, ConstantOp op) {
printer << "toy.constant ";

View File

@ -29,7 +29,7 @@ OpFoldResult CastOp::fold(ArrayRef<Attribute> operands) {
}
/// This is an example of a c++ rewrite pattern for the TransposeOp. It
/// optimizes the following scenario: transpose(transpose(x)) -> transpose(x)
/// optimizes the following scenario: transpose(transpose(x)) -> x
struct SimplifyRedundantTranspose : public mlir::OpRewritePattern<TransposeOp> {
/// We register this pattern to match every toy.transpose in the IR.
/// The "benefit" is used by the framework to order the patterns and process

View File

@ -148,7 +148,7 @@ void ConstantOp::build(mlir::OpBuilder &builder, mlir::OperationState &state,
ConstantOp::build(builder, state, dataType, dataAttribute);
}
/// The 'OpAsmPrinter' class provides a collection of methods for parsing
/// The 'OpAsmParser' class provides a collection of methods for parsing
/// various punctuation, as well as attributes, operands, types, etc. Each of
/// these methods returns a `ParseResult`. This class is a wrapper around
/// `LogicalResult` that can be converted to a boolean `true` value on failure,
@ -166,7 +166,7 @@ static mlir::ParseResult parseConstantOp(mlir::OpAsmParser &parser,
return success();
}
/// The 'OpAsmPrinter' class is a stream that will allows for formatting
/// The 'OpAsmPrinter' class is a stream that allows for formatting
/// strings, attributes, operands, types, etc.
static void print(mlir::OpAsmPrinter &printer, ConstantOp op) {
printer << "toy.constant ";

View File

@ -29,7 +29,7 @@ OpFoldResult CastOp::fold(ArrayRef<Attribute> operands) {
}
/// This is an example of a c++ rewrite pattern for the TransposeOp. It
/// optimizes the following scenario: transpose(transpose(x)) -> transpose(x)
/// optimizes the following scenario: transpose(transpose(x)) -> x
struct SimplifyRedundantTranspose : public mlir::OpRewritePattern<TransposeOp> {
/// We register this pattern to match every toy.transpose in the IR.
/// The "benefit" is used by the framework to order the patterns and process

View File

@ -148,7 +148,7 @@ void ConstantOp::build(mlir::OpBuilder &builder, mlir::OperationState &state,
ConstantOp::build(builder, state, dataType, dataAttribute);
}
/// The 'OpAsmPrinter' class provides a collection of methods for parsing
/// The 'OpAsmParser' class provides a collection of methods for parsing
/// various punctuation, as well as attributes, operands, types, etc. Each of
/// these methods returns a `ParseResult`. This class is a wrapper around
/// `LogicalResult` that can be converted to a boolean `true` value on failure,
@ -166,7 +166,7 @@ static mlir::ParseResult parseConstantOp(mlir::OpAsmParser &parser,
return success();
}
/// The 'OpAsmPrinter' class is a stream that will allows for formatting
/// The 'OpAsmPrinter' class is a stream that allows for formatting
/// strings, attributes, operands, types, etc.
static void print(mlir::OpAsmPrinter &printer, ConstantOp op) {
printer << "toy.constant ";

View File

@ -6,9 +6,18 @@
//
//===----------------------------------------------------------------------===//
//
// This file implements a partial lowering of Toy operations to a combination of
// affine loops and standard operations. This lowering expects that all calls
// have been inlined, and all shapes have been resolved.
// This file implements full lowering of Toy operations to LLVM MLIR dialect.
// 'toy.print' is lowered to a loop nest that calls `printf` on each element of
// the input array. The file also sets up the ToyToLLVMLoweringPass. This pass
// lowers the combination of Affine + SCF + Standard dialects to the LLVM one:
//
// Affine --
// |
// v
// Standard --> LLVM (Dialect)
// ^
// |
// 'toy.print' --> Loop (SCF) --
//
//===----------------------------------------------------------------------===//

View File

@ -29,7 +29,7 @@ OpFoldResult CastOp::fold(ArrayRef<Attribute> operands) {
}
/// This is an example of a c++ rewrite pattern for the TransposeOp. It
/// optimizes the following scenario: transpose(transpose(x)) -> transpose(x)
/// optimizes the following scenario: transpose(transpose(x)) -> x
struct SimplifyRedundantTranspose : public mlir::OpRewritePattern<TransposeOp> {
/// We register this pattern to match every toy.transpose in the IR.
/// The "benefit" is used by the framework to order the patterns and process

View File

@ -161,7 +161,7 @@ void ConstantOp::build(mlir::OpBuilder &builder, mlir::OperationState &state,
ConstantOp::build(builder, state, dataType, dataAttribute);
}
/// The 'OpAsmPrinter' class provides a collection of methods for parsing
/// The 'OpAsmParser' class provides a collection of methods for parsing
/// various punctuation, as well as attributes, operands, types, etc. Each of
/// these methods returns a `ParseResult`. This class is a wrapper around
/// `LogicalResult` that can be converted to a boolean `true` value on failure,
@ -179,7 +179,7 @@ static mlir::ParseResult parseConstantOp(mlir::OpAsmParser &parser,
return success();
}
/// The 'OpAsmPrinter' class is a stream that will allows for formatting
/// The 'OpAsmPrinter' class is a stream that allows for formatting
/// strings, attributes, operands, types, etc.
static void print(mlir::OpAsmPrinter &printer, ConstantOp op) {
printer << "toy.constant ";

View File

@ -6,9 +6,18 @@
//
//===----------------------------------------------------------------------===//
//
// This file implements a partial lowering of Toy operations to a combination of
// affine loops and standard operations. This lowering expects that all calls
// have been inlined, and all shapes have been resolved.
// This file implements full lowering of Toy operations to LLVM MLIR dialect.
// 'toy.print' is lowered to a loop nest that calls `printf` on each element of
// the input array. The file also sets up the ToyToLLVMLoweringPass. This pass
// lowers the combination of Affine + SCF + Standard dialects to the LLVM one:
//
// Affine --
// |
// v
// Standard --> LLVM (Dialect)
// ^
// |
// 'toy.print' --> Loop (SCF) --
//
//===----------------------------------------------------------------------===//

View File

@ -47,7 +47,7 @@ OpFoldResult StructAccessOp::fold(ArrayRef<Attribute> operands) {
}
/// This is an example of a c++ rewrite pattern for the TransposeOp. It
/// optimizes the following scenario: transpose(transpose(x)) -> transpose(x)
/// optimizes the following scenario: transpose(transpose(x)) -> x
struct SimplifyRedundantTranspose : public mlir::OpRewritePattern<TransposeOp> {
/// We register this pattern to match every toy.transpose in the IR.
/// The "benefit" is used by the framework to order the patterns and process