@@ -79,7 +79,7 @@ The SPIR-V dialect adopts the following conventions for IR:
7979* The prefix for all SPIR-V types and operations are ` spv. ` .
8080* All instructions in an extended instruction set are further qualified with
8181 the extended instruction set's prefix. For example, all operations in the
82- GLSL extended instruction set is has the prefix of ` spv.GLSL. ` .
82+ GLSL extended instruction set have the prefix of ` spv.GLSL. ` .
8383* Ops that directly mirror instructions in the specification have ` CamelCase `
8484 names that are the same as the instruction opnames (without the ` Op `
8585 prefix). For example, ` spv.FMul ` is a direct mirror of ` OpFMul ` in the
@@ -93,7 +93,7 @@ The SPIR-V dialect adopts the following conventions for IR:
9393* Ops with ` _snake_case ` names are those that have no corresponding
9494 instructions (or concepts) in the binary format. They are introduced to
9595 satisfy MLIR structural requirements. For example, ` spv._module_end ` and
96- ` spv._merge ` . They maps to no instructions during (de)serialization.
96+ ` spv._merge ` . They map to no instructions during (de)serialization.
9797
9898(TODO: consider merging the last two cases and adopting ` spv.mlir. ` prefix for
9999them.)
@@ -148,7 +148,7 @@ instructions are represented in the SPIR-V dialect:
148148#### Use MLIR attributes for metadata
149149
150150* Requirements for capabilities, extensions, extended instruction sets,
151- addressing model, and memory model is conveyed using ` spv.module `
151+ addressing model, and memory model are conveyed using ` spv.module `
152152 attributes. This is considered better because these information are for the
153153 execution environment. It's easier to probe them if on the module op itself.
154154* Annotations/decoration instructions are "folded" into the instructions they
@@ -172,17 +172,17 @@ instructions are represented in the SPIR-V dialect:
172172* Normal constants are not placed in ` spv.module ` 's region; they are localized
173173 into functions. This is to make functions in the SPIR-V dialect to be
174174 isolated and explicit capturing. Constants are cheap to duplicate given
175- attributes are uniqued in ` MLIRContext ` .
175+ attributes are made unique in ` MLIRContext ` .
176176
177177#### Adopt symbol-based global variables and specialization constant
178178
179179* Global variables are defined with the ` spv.globalVariable ` op. They do not
180180 generate SSA values. Instead they have symbols and should be referenced via
181- symbols. To use a global variables in a function block, ` spv._address_of ` is
182- needed to turn the symbol into a SSA value.
181+ symbols. To use global variables in a function block, ` spv._address_of ` is
182+ needed to turn the symbol into an SSA value.
183183* Specialization constants are defined with the ` spv.specConstant ` op. Similar
184184 to global variables, they do not generate SSA values and have symbols for
185- reference, too. ` spv._reference_of ` is needed to turn the symbol into a SSA
185+ reference, too. ` spv._reference_of ` is needed to turn the symbol into an SSA
186186 value for use in a function block.
187187
188188The above choices enables functions in the SPIR-V dialect to be isolated and
@@ -415,13 +415,13 @@ functions or non-SPIR-V operations. `spv.module` verifies these requirements.
415415
416416A major difference between the SPIR-V dialect and the SPIR-V specification for
417417functions is that the former are isolated and require explicit capturing, while
418- the latter allow implicit capturing. In SPIR-V specification, functions can
418+ the latter allows implicit capturing. In SPIR-V specification, functions can
419419refer to SSA values (generated by constants, global variables, etc.) defined in
420420modules. The SPIR-V dialect adjusted how constants and global variables are
421421modeled to enable isolated functions. Isolated functions are more friendly to
422422compiler analyses and transformations. This also enables the SPIR-V dialect to
423423better utilize core infrastructure: many functionalities in the core
424- infrastructure requires ops to be isolated, e.g., the
424+ infrastructure require ops to be isolated, e.g., the
425425[ greedy pattern rewriter] [ GreedyPatternRewriter ] can only act on ops isolated
426426from above.
427427
@@ -742,23 +742,23 @@ func @foo() -> () {
742742SPIR-V supports versions, extensions, and capabilities as ways to indicate the
743743availability of various features (types, ops, enum cases) on target hardware.
744744For example, non-uniform group operations were missing before v1.3, and they
745- require special capabilites like ` GroupNonUniformArithmetic ` to be used. These
745+ require special capabilities like ` GroupNonUniformArithmetic ` to be used. These
746746availability information relates to [ target environment] ( #target-environment )
747747and affects the legality of patterns during dialect conversion.
748748
749749SPIR-V ops' availability requirements are modeled with
750750[ op interfaces] [ MlirOpInterface ] :
751751
752- * ` QueryMinVersionInterface ` and ` QueryMaxVersionInterface ` for vesion
752+ * ` QueryMinVersionInterface ` and ` QueryMaxVersionInterface ` for version
753753 requirements
754754* ` QueryExtensionInterface ` for extension requirements
755755* ` QueryCapabilityInterface ` for capability requirements
756756
757- These interface declarations are auto-generated from TableGen defintions
757+ These interface declarations are auto-generated from TableGen definitions
758758included in [ ` SPIRVBase.td ` ] [ MlirSpirvBase ] . At the moment all SPIR-V ops
759- implements the above interfaces.
759+ implement the above interfaces.
760760
761- SPIR-V ops' availability implemention methods are automatically synthesized
761+ SPIR-V ops' availability implementation methods are automatically synthesized
762762from the availability specification on each op and enum attribute in TableGen.
763763An op needs to look into not only the opcode but also operands to derive its
764764availability requirements. For example, ` spv.ControlBarrier ` requires no
@@ -917,9 +917,9 @@ interface.
917917Although the main objective of the SPIR-V dialect is to act as a proper IR for
918918compiler transformations, being able to serialize to and deserialize from the
919919binary format is still very valuable for many good reasons. Serialization
920- enables the artifacts of SPIR-V compilation to be consumed by a execution
920+ enables the artifacts of SPIR-V compilation to be consumed by an execution
921921environment; deserialization allows us to import SPIR-V binary modules and run
922- transformations on them. So serialization and deserialization is supported from
922+ transformations on them. So serialization and deserialization are supported from
923923the very beginning of the development of the SPIR-V dialect.
924924
925925The serialization library provides two entry points, ` mlir::spirv::serialize() `
@@ -1009,21 +1009,21 @@ Standard scalar types are converted to their corresponding SPIR-V scalar types.
10091009it will be unconditionally converted to 32-bit. This should be switched to
10101010properly emulating non-32-bit scalar types.)
10111011
1012- [ Standard index Type ] [ MlirIndexType ] need special handling since they are not
1012+ [ Standard index type ] [ MlirIndexType ] need special handling since they are not
10131013directly supported in SPIR-V. Currently the ` index ` type is converted to ` i32 ` .
10141014
10151015(TODO: Allow for configuring the integer width to use for ` index ` types in the
10161016SPIR-V dialect)
10171017
10181018SPIR-V only supports vectors of 2/3/4 elements; so
1019- [ standard vector types] [ MlirVectorType ] of these length can be converted
1019+ [ standard vector types] [ MlirVectorType ] of these lengths can be converted
10201020directly.
10211021
10221022(TODO: Convert other vectors of lengths to scalars or arrays)
10231023
10241024[ Standard memref types] [ MlirMemrefType ] with static shape and stride are
10251025converted to ` spv.ptr<spv.struct<spv.array<...>>> ` s. The resultant SPIR-V array
1026- types has the same element type as the source memref and its number of elements
1026+ types have the same element type as the source memref and its number of elements
10271027is obtained from the layout specification of the memref. The storage class of
10281028the pointer type are derived from the memref's memory space with
10291029` SPIRVTypeConverter::getStorageClassForMemorySpace() ` .
@@ -1068,7 +1068,7 @@ returns an SSA value generated from an `spv._address_of` operation.
10681068
10691069### Current conversions to SPIR-V
10701070
1071- Using the above infrastructure, conversion are implemented from
1071+ Using the above infrastructure, conversions are implemented from
10721072
10731073* [ Standard Dialect] [ MlirStandardDialect ] : Only arithmetic and logical
10741074 operations conversions are implemented.
@@ -1240,7 +1240,7 @@ static LogicalResult verify(spirv::<spirv-op-symbol>Op op);
12401240
12411241See any such function in [ ` SPIRVOps.cpp ` ] [ MlirSpirvOpsCpp ] as an example.
12421242
1243- If no additional verification is needed, one need to add the following to
1243+ If no additional verification is needed, one needs to add the following to
12441244the op's Op Definition Spec:
12451245
12461246```
0 commit comments