* Elimination of operations that have no side effects and have no uses.
-* Constant folding - e.g. "(addi 1, 2)" to "3". Constand folding hooks are
+* Constant folding - e.g. "(addi 1, 2)" to "3". Constant folding hooks are
specified by operations.
* Move constant operands to commutative binary operators to the right side -
type and `<value>` must be a value that corresponds to one of the (nested)
structure element types.
-Note the use of integer literals to designate subscripts, which is made possbile
+Note the use of integer literals to designate subscripts, which is made possible
by `extractvalue` and `insertvalue` must have constant subscripts. Internally,
they are modeled as array attributes.
single output.
1. Matchers can be partially specified on the input (e.g., not all arguments
- contrained) and so multiple matchers can match the same set of nodes. The
+ constrained) and so multiple matchers can match the same set of nodes. The
most discriminative matcher (as determined by the number of
constrained/matching terms) will be selected, if two patterns are equally
discriminative then an error will be reported.
**Disclaimer / Warning**
This document is a very early design proposal (which has since been accepted)
-that explored the tradeoffs of using this simplified form vs the tranditional
+that explored the tradeoffs of using this simplified form vs the traditional
polyhedral schedule list form. At some point, this document could be dusted off
and written as a proper academic paper, but until now, it is better to included
it in this crufty form than not to. Beware that this document uses archaic
to be statically aware of all the types and ops. Since our code structure
chooses to isolate independent portions of the tutorial, and certain ops are
introduced in later parts, we explicitly separate `DialectConstruction.cpp` in
-its separate library. Linking with the proper library enables the types that
+its' separate library. Linking with the proper library enables the types that
have been declared so far.
## Putting it all together
You can reproduce this result and play with the example in the `examples/toy/Ch1/`
directory, try running `path/to/BUILD/bin/toyc-ch1 test/ast.toy -emit=ast`.
-The code for the lexer is fairly straighforward, it is all in a single header:
+The code for the lexer is fairly straightforward, it is all in a single header:
`examples/toy/Ch1/include/toy/Lexer.h`. The parser can be found in
`examples/toy/Ch1/include/toy/Parser.h`, it is a recursive descent parser. If
you are not familiar with such Lexer/Parser, these are very similar to the LLVM
```c++
/// This is the definition of the Toy dialect. A dialect inherits from
/// mlir::Dialect and registers custom operations and types (in its constructor).
-/// It can also overridde general behavior of dialects exposed as virtual
+/// It can also override general behavior of dialects exposed as virtual
/// methods, for example regarding verification and parsing/printing.
class ToyDialect : public mlir::Dialect {
public:
explicit ToyDialect(mlir::MLIRContext *ctx);
- /// Parse a type registered to this dialect. Overridding this method is
+ /// Parse a type registered to this dialect. Overriding this method is
/// required for dialects that have custom types.
/// Technically this is only needed to be able to round-trip to textual IR.
mlir::Type parseType(llvm::StringRef tyData,
mlir::Location loc) const override;
- /// Print a type registered to this dialect. Overridding this method is
+ /// Print a type registered to this dialect. Overriding this method is
/// only required for dialects that have custom types.
/// Technically this is only needed to be able to round-trip to textual IR.
void printType(mlir::Type type, llvm::raw_ostream &os) const override;
function type and the conversion generates a new prototype for the converted
function. The default implementation will call into the type conversion for
the returned values and for each of the parameters.
-- Operations convertions: each pattern is expected to generate new results
+- Operations conversions: each pattern is expected to generate new results
matching the current operations' in the new function. This may involve
generating one or multiple new operations, or possibly just remapping
existing operands (folding).
touching a single function at a time, instead of traversing the entire
program.
* This improves multi-threading performance by reducing the number of jobs
- that need to be scheduled, as well as increasing the efficency of each job.
+ that need to be scheduled, as well as increasing the efficiency of each job.
An entire function pipeline can be run on each function asynchronously.
As an example, the above pass manager would contain the following pipeline
### Standard Instrumentations
MLIR utilizes the pass instrumentation framework to provide a few useful
-developer tools and utilites. Each of these instrumentations are immediately
+developer tools and utilities. Each of these instrumentations are immediately
available to all users of the MLIR pass framework.
#### Pass Timing