Skip to content

Commit d356cdc

Browse files
ps-19AaronBallman
authored andcommitted
Fix grammar and punctuation across several docs; NFC
1 parent 094e808 commit d356cdc

File tree

6 files changed

+35
-34
lines changed

6 files changed

+35
-34
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# The LLVM Compiler Infrastructure
22

3-
This directory and its sub-directories contain source code for LLVM,
3+
This directory and its sub-directories contain the source code for LLVM,
44
a toolkit for the construction of highly optimized compilers,
55
optimizers, and run-time environments.
66

@@ -33,7 +33,7 @@ the [LLD linker](https://lld.llvm.org), and more.
3333

3434
### Getting the Source Code and Building LLVM
3535

36-
The LLVM Getting Started documentation may be out of date. The [Clang
36+
The LLVM Getting Started documentation may be out of date. The [Clang
3737
Getting Started](http://clang.llvm.org/get_started.html) page might have more
3838
accurate information.
3939

@@ -101,7 +101,7 @@ This is an example work-flow and configuration to get and build the LLVM source:
101101
LLVM sub-projects generate their own ``check-<project>`` target.
102102

103103
* Running a serial build will be **slow**. To improve speed, try running a
104-
parallel build. That's done by default in Ninja; for ``make``, use the option
104+
parallel build. That's done by default in Ninja; for ``make``, use the option
105105
``-j NNN``, where ``NNN`` is the number of parallel jobs to run.
106106
In most cases, you get the best performance if you specify the number of CPU threads you have.
107107
On some Unix systems, you can specify this with ``-j$(nproc)``.

mlir/docs/Interfaces.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ utilities for registering an interface with a dialect so that it can be
3737
referenced later. Once the interface has been defined, dialects can override it
3838
using dialect-specific information. The interfaces defined by a dialect are
3939
registered via `addInterfaces<>`, a similar mechanism to Attributes, Operations,
40-
Types, etc
40+
Types, etc.
4141

4242
```c++
4343
/// Define a base inlining interface class to allow for dialects to opt-in to
@@ -86,7 +86,7 @@ if (DialectInlinerInterface *interface = dyn_cast<DialectInlinerInterface>(diale
8686
#### DialectInterfaceCollection
8787

8888
An additional utility is provided via `DialectInterfaceCollection`. This class
89-
allows for collecting all of the dialects that have registered a given interface
89+
allows collecting all of the dialects that have registered a given interface
9090
within an instance of the `MLIRContext`. This can be useful to hide and optimize
9191
the lookup of a registered dialect interface.
9292

@@ -394,8 +394,8 @@ comprised of the following components:
394394
accessed with full name qualification.
395395
* Extra Shared Class Declarations (Optional: `extraSharedClassDeclaration`)
396396
- Additional C++ code that is injected into the declarations of both the
397-
interface and trait class. This allows for defining methods and more
398-
that are exposed on both the interface and trait class, e.g. to inject
397+
interface and the trait class. This allows for defining methods and more
398+
that are exposed on both the interface and the trait class, e.g. to inject
399399
utilties on both the interface and the derived entity implementing the
400400
interface (e.g. attribute, operation, etc.).
401401
- In non-static methods, `$_attr`/`$_op`/`$_type`
@@ -617,7 +617,7 @@ def MyInterface : OpInterface<"MyInterface"> {
617617
}
618618
619619
// Operation interfaces can optionally be wrapped inside
620-
// DeclareOpInterfaceMethods. This would result in autogenerating declarations
620+
// `DeclareOpInterfaceMethods`. This would result in autogenerating declarations
621621
// for members `foo`, `bar` and `fooStatic`. Methods with bodies are not
622622
// declared inside the op declaration but instead handled by the op interface
623623
// trait directly.

mlir/docs/OpDefinitions.md

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ operations. This open and extensible ecosystem leads to the "stringly" type IR
2323
problem, e.g., repetitive string comparisons during optimization and analysis
2424
passes, unintuitive accessor methods (e.g., generic/error prone `getOperand(3)`
2525
vs self-documenting `getStride()`) with more generic return types, verbose and
26-
generic constructors without default arguments, verbose textual IR dump, and so
26+
generic constructors without default arguments, verbose textual IR dumps, and so
2727
on. Furthermore, operation verification is:
2828

2929
1. best case: a central string-to-verification-function map,
@@ -57,7 +57,7 @@ including but not limited to:
5757

5858
We use TableGen as the language for specifying operation information. TableGen
5959
itself just provides syntax for writing records; the syntax and constructs
60-
allowed in a TableGen file (typically with filename suffix `.td`) can be found
60+
allowed in a TableGen file (typically with the filename suffix `.td`) can be found
6161
[here][TableGenProgRef].
6262

6363
* TableGen `class` is similar to C++ class; it can be templated and
@@ -80,7 +80,7 @@ types and expressions supported by TableGen.
8080
MLIR defines several common constructs to help operation definition and provide
8181
their semantics via a special [TableGen backend][TableGenBackend]:
8282
[`OpDefinitionsGen`][OpDefinitionsGen]. These constructs are defined in
83-
[`OpBase.td`][OpBase]. The main ones are
83+
[`OpBase.td`][OpBase]. The main ones are:
8484

8585
* The `Op` class: It is the main construct for defining operations. All facts
8686
regarding the operation are specified when specializing this class, with the
@@ -91,7 +91,7 @@ their semantics via a special [TableGen backend][TableGenBackend]:
9191
and constraints of the operation, including whether the operation has side
9292
effect or whether its output has the same shape as the input.
9393
* The `ins`/`outs` marker: These are two special markers builtin to the
94-
`OpDefinitionsGen` backend. They lead the definitions of operands/attributes
94+
`OpDefinitionsGen` backend. They lead to the definitions of operands/attributes
9595
and results respectively.
9696
* The `TypeConstraint` class hierarchy: They are used to specify the
9797
constraints over operands or results. A notable subclass hierarchy is
@@ -134,7 +134,7 @@ the `Op` class for the complete list of fields supported.
134134

135135
### Operation name
136136

137-
The operation name is a unique identifier of the operation within MLIR, e.g.,
137+
The operation name is a unique identifier for the operation within MLIR, e.g.,
138138
`tf.Add` for addition operation in the TensorFlow dialect. This is the
139139
equivalent of the mnemonic in assembly language. It is used for parsing and
140140
printing in the textual format. It is also used for pattern matching in graph
@@ -207,12 +207,13 @@ named argument a named getter will be generated that returns the argument with
207207
the return type (in the case of attributes the return type will be constructed
208208
from the storage type, while for operands it will be `Value`). Each attribute's
209209
raw value (e.g., as stored) can also be accessed via generated `<name>Attr`
210-
getters for use in transformation passes where the more user friendly return
210+
getters for use in transformation passes where the more user-friendly return
211211
type is less suitable.
212212

213-
All the arguments should be named to 1) provide documentation, 2) drive
214-
auto-generation of getter methods, 3) provide a handle to reference for other
215-
places like constraints.
213+
All the arguments should be named to:
214+
- provide documentation,
215+
- drive auto-generation of getter methods, and
216+
- provide a handle to reference for other places like constraints.
216217

217218
#### Variadic operands
218219

@@ -221,7 +222,7 @@ To declare a variadic operand, wrap the `TypeConstraint` for the operand with
221222

222223
Normally operations have no variadic operands or just one variadic operand. For
223224
the latter case, it is easy to deduce which dynamic operands are for the static
224-
variadic operand definition. Though, if an operation has more than one variable
225+
variadic operand definition. However, if an operation has more than one variable
225226
length operands (either optional or variadic), it would be impossible to
226227
attribute dynamic operands to the corresponding static variadic operand
227228
definitions without further information from the operation. Therefore, either
@@ -247,7 +248,7 @@ To declare an optional operand, wrap the `TypeConstraint` for the operand with
247248

248249
Normally operations have no optional operands or just one optional operand. For
249250
the latter case, it is easy to deduce which dynamic operands are for the static
250-
operand definition. Though, if an operation has more than one variable length
251+
operand definition. However, if an operation has more than one variable length
251252
operands (either optional or variadic), it would be impossible to attribute
252253
dynamic operands to the corresponding static variadic operand definitions
253254
without further information from the operation. Therefore, either the
@@ -425,7 +426,7 @@ The first form provides basic uniformity so that we can create ops using the
425426
same form regardless of the exact op. This is particularly useful for
426427
implementing declarative pattern rewrites.
427428
428-
The second and third forms are good for use in manually written code given that
429+
The second and third forms are good for use in manually written code, given that
429430
they provide better guarantee via signatures.
430431
431432
The third form will be generated if any of the op's attribute has different
@@ -434,14 +435,14 @@ from an unwrapped value (i.e., `Attr.constBuilderCall` is defined.)
434435
Additionally, for the third form, if an attribute appearing later in the
435436
`arguments` list has a default value, the default value will be supplied in the
436437
declaration. This works for `BoolAttr`, `StrAttr`, `EnumAttr` for now and the
437-
list can grow in the future. So if possible, default valued attribute should be
438+
list can grow in the future. So if possible, the default-valued attribute should be
438439
placed at the end of the `arguments` list to leverage this feature. (This
439440
behavior is essentially due to C++ function parameter default value placement
440441
restrictions.) Otherwise, the builder of the third form will still be generated
441442
but default values for the attributes not at the end of the `arguments` list
442443
will not be supplied in the builder's signature.
443444
444-
ODS will generate a builder that doesn't require return type specified if
445+
ODS will generate a builder that doesn't require the return type specified if
445446
446447
* Op implements InferTypeOpInterface interface;
447448
* All return types are either buildable types or are the same as a given
@@ -581,18 +582,18 @@ of these verification methods.
581582
The verification of an operation involves several steps,
582583

583584
1. StructuralOpTrait will be verified first, they can be run independently.
584-
1. `verifyInvariants` which is constructed by ODS, it verifies the type,
585+
2. `verifyInvariants` which is constructed by ODS, it verifies the type,
585586
attributes, .etc.
586-
1. Other Traits/Interfaces that have marked their verifier as `verifyTrait` or
587+
3. Other Traits/Interfaces that have marked their verifier as `verifyTrait` or
587588
`verifyWithRegions=0`.
588-
1. Custom verifier which is defined in the op and has marked `hasVerifier=1`
589+
4. Custom verifier which is defined in the op and has been marked `hasVerifier=1`
589590

590591
If an operation has regions, then it may have the second phase,
591592

592593
1. Traits/Interfaces that have marked their verifier as `verifyRegionTrait` or
593594
`verifyWithRegions=1`. This implies the verifier needs to access the
594595
operations in its regions.
595-
1. Custom verifier which is defined in the op and has marked
596+
2. Custom verifier which is defined in the op and has been marked
596597
`hasRegionVerifier=1`
597598

598599
Note that the second phase will be run after the operations in the region are

mlir/docs/PDLL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ that no longer exist.
3333

3434
### Why build a new language instead of improving TableGen DRR?
3535

36-
Note: The section assumes familiarity with
36+
Note: This section assumes familiarity with
3737
[TDRR](https://mlir.llvm.org/docs/DeclarativeRewrites/), please refer the
3838
relevant documentation before continuing.
3939

mlir/docs/PassManagement.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ Dialects must be loaded in the MLIRContext before entities from these dialects
128128
(operations, types, attributes, ...) can be created. Dialects must also be
129129
loaded before starting the execution of a multi-threaded pass pipeline. To this
130130
end, a pass that may create an entity from a dialect that isn't guaranteed to
131-
already ne loaded must express this by overriding the `getDependentDialects()`
131+
already be loaded must express this by overriding the `getDependentDialects()`
132132
method and declare this list of Dialects explicitly.
133133

134134
### Initialization
@@ -818,7 +818,7 @@ string corresponding to the operation type that the pass operates on. The class
818818
contains the following fields:
819819
820820
* `summary`
821-
- A short one line summary of the pass, used as the description when
821+
- A short one-line summary of the pass, used as the description when
822822
registering the pass.
823823
* `description`
824824
- A longer, more detailed description of the pass. This is used when
@@ -847,7 +847,7 @@ class takes the following template parameters:
847847
* default value
848848
- The default option value.
849849
* description
850-
- A one line description of the option.
850+
- A one-line description of the option.
851851
* additional option flags
852852
- A string containing any additional options necessary to construct the
853853
option.
@@ -870,7 +870,7 @@ The `ListOption` class takes the following fields:
870870
* element type
871871
- The C++ type of the list element.
872872
* description
873-
- A one line description of the option.
873+
- A one-line description of the option.
874874
* additional option flags
875875
- A string containing any additional options necessary to construct the
876876
option.
@@ -894,7 +894,7 @@ template parameters:
894894
* display name
895895
- The name used when displaying the statistic.
896896
* description
897-
- A one line description of the statistic.
897+
- A one-line description of the statistic.
898898

899899
```tablegen
900900
def MyPass : Pass<"my-pass"> {
@@ -938,7 +938,7 @@ PassInstrumentation instances may be registered directly with a
938938
Instrumentations added to the PassManager are run in a stack like fashion, i.e.
939939
the last instrumentation to execute a `runBefore*` hook will be the first to
940940
execute the respective `runAfter*` hook. The hooks of a `PassInstrumentation`
941-
class are guaranteed to be executed in a thread safe fashion, so additional
941+
class are guaranteed to be executed in a thread-safe fashion, so additional
942942
synchronization is not necessary. Below in an example instrumentation that
943943
counts the number of times the `DominanceInfo` analysis is computed:
944944

mlir/docs/PatternRewriter.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ creation, as well as many useful attribute and type construction methods.
232232
## Pattern Application
233233
234234
After a set of patterns have been defined, they are collected and provided to a
235-
specific driver for application. A driver consists of several high levels parts:
235+
specific driver for application. A driver consists of several high level parts:
236236
237237
* Input `RewritePatternSet`
238238

0 commit comments

Comments
 (0)