Index: mlir/docs/Dialects/Affine.md =================================================================== --- mlir/docs/Dialects/Affine.md +++ mlir/docs/Dialects/Affine.md @@ -13,7 +13,7 @@ ### Dimensions and Symbols Dimensions and symbols are the two kinds of identifiers that can appear in the -polyhedral structures, and are always of [`index`](Builtin.md#indextype) +polyhedral structures, and are always of [`index`](Builtin.md/#indextype) type. Dimensions are declared in parentheses and symbols are declared in square brackets. @@ -66,11 +66,11 @@ 2. a value defined at the top level of an `AffineScope` op (i.e., immediately enclosed by the latter), 3. a value that dominates the `AffineScope` op enclosing the value's use, -4. the result of a [`constant` operation](Standard.md#constant-operation), +4. the result of a [`constant` operation](Standard.md/#stdconstant-constantop), 5. the result of an [`affine.apply` -operation](#affineapply-operation) that recursively takes as arguments any valid +operation](#affineapply-affineapplyop) that recursively takes as arguments any valid symbolic identifiers, or -6. the result of a [`dim` operation](Standard.md#dim-operation) on either a +6. the result of a [`dim` operation](MemRef.md/#memrefdim-mlirmemrefdimop) on either a memref that is an argument to a `AffineScope` op or a memref where the corresponding dimension is either static or a dynamic one in turn bound to a valid symbol. @@ -80,9 +80,9 @@ Note that as a result of rule (3) above, symbol validity is sensitive to the location of the SSA use. Dimensions may be bound not only to anything that a symbol is bound to, but also to induction variables of enclosing -[`affine.for`](#affinefor-operation) and -[`affine.parallel`](#affineparallel-operation) operations, and the result of an -[`affine.apply` operation](#affineapply-operation) (which recursively may use +[`affine.for`](#affinefor-affineforop) and +[`affine.parallel`](#affineparallel-affineparallelop) operations, and the result of an +[`affine.apply` operation](#affineapply-affineapplyop) (which recursively may use other dimensions and symbols). ### Affine Expressions @@ -113,7 +113,7 @@ second argument is always positive, its results are always positive in our usage. The `integer-literal` operand for ceildiv, floordiv, and mod is always expected to be positive. `bare-id` is an identifier which must have type -[index](Builtin.md#indextype). The precedence of operations in an affine +[index](Builtin.md/#indextype). The precedence of operations in an affine expression are ordered from highest to lowest in the order: (1) parenthesization, (2) negation, (3) modulo, multiplication, floordiv, and ceildiv, and (4) addition and subtraction. All of these operators associate from @@ -157,9 +157,9 @@ combining the indices and symbols. Affine maps distinguish between [indices and symbols](#dimensions-and-symbols) because indices are inputs to the affine map when the map is called (through an operation such as -[affine.apply](#affineapply-operation)), whereas symbols are bound when +[affine.apply](#affineapply-affineapplyop)), whereas symbols are bound when the map is established (e.g. when a memref is formed, establishing a -memory [layout map](../LangRef.md#layout-map)). +memory [layout map](Builtin.md/#layout-map)). Affine maps are used for various core structures in MLIR. The restrictions we impose on their form allows powerful analysis and transformation, while keeping Index: mlir/docs/Dialects/Builtin.md =================================================================== --- mlir/docs/Dialects/Builtin.md +++ mlir/docs/Dialects/Builtin.md @@ -18,7 +18,7 @@ ## Location Attributes A subset of the builtin attribute values correspond to -[source locations](../Diagnostics.md#source-locations), that may be attached to +[source locations](../Diagnostics.md/#source-locations), that may be attached to Operations. [include "Dialects/BuiltinLocationAttributes.md"] Index: mlir/docs/Dialects/LLVM.md =================================================================== --- mlir/docs/Dialects/LLVM.md +++ mlir/docs/Dialects/LLVM.md @@ -105,7 +105,7 @@ are produced by dedicated operations that have the corresponding semantics: [`llvm.mlir.constant`](#llvmmlirconstant-mlirllvmconstantop), [`llvm.mlir.undef`](#llvmmlirundef-mlirllvmundefop), -[`llvm.mlir.null`](#llvmmlirnull-mlirnullop). Note how these operations are +[`llvm.mlir.null`](#llvmmlirnull-mlirllvmnullop). Note how these operations are prefixed with `mlir.` to indicate that they don't belong to LLVM IR but are only necessary to model it in MLIR. The values produced by these operations are usable just like any other value. @@ -194,7 +194,7 @@ MLIR does not support module-scoped named type declarations, e.g. `%s = type {i32, i32}` in LLVM IR. Instead, types must be fully specified at each use, except for recursive types where only the first reference to a named type needs -to be fully specified. MLIR [type aliases](LangRef.md#type-aliases) can be used +to be fully specified. MLIR [type aliases](../LangRef.md/#type-aliases) can be used to achieve more compact syntax. The general syntax of LLVM dialect types is `!llvm.`, followed by a type kind Index: mlir/docs/Dialects/Linalg.md =================================================================== --- mlir/docs/Dialects/Linalg.md +++ mlir/docs/Dialects/Linalg.md @@ -37,7 +37,7 @@ ## High-Level Description of Linalg Ops Linalg takes at least some inspiration from all previously -[listed prior art](#prior_art). The design enables the definition of +[listed prior art](../Rationale/RationaleLinalgDialect.md/#prior-art). The design enables the definition of ***CustomOps*** with generic properties that enable [key transformations](#key_transformations), including lowering to scalar load/store and other operations or to external library calls and intrinsics. @@ -493,7 +493,7 @@ `linalg.generic` op. It is an open question whether all of these semantics are strictly necessary in practice and whether some should or could be derived automatically while still maintaining the -[core guiding principles](#guiding_principles). +[core guiding principles](../Rationale/RationaleLinalgDialect.md/#core-guiding-principlesa-nameguiding_principlesa). For the time being, we have settled on the combination of these properties because of empirical evidence building and working on multiple high-level Index: mlir/docs/Dialects/MemRef.md =================================================================== --- mlir/docs/Dialects/MemRef.md +++ mlir/docs/Dialects/MemRef.md @@ -32,7 +32,7 @@ indices of the source memref, destination memref, and the tag memref have the same restrictions as any load/store operation in an affine context (whenever DMA operations appear in an affine context). See -[restrictions on dimensions and symbols](Affine.md#restrictions-on-dimensions-and-symbols) +[restrictions on dimensions and symbols](Affine.md/#restrictions-on-dimensions-and-symbols) in affine contexts. This allows powerful static analysis and transformations in the presence of such DMAs including rescheduling, pipelining / overlap with computation, and checking for matching start/end operations. The source and Index: mlir/docs/Dialects/SPIR-V.md =================================================================== --- mlir/docs/Dialects/SPIR-V.md +++ mlir/docs/Dialects/SPIR-V.md @@ -1388,20 +1388,19 @@ [MlirDialectConversion]: ../DialectConversion.md [StructType]: https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#Structure [SpirvTools]: https://github.com/KhronosGroup/SPIRV-Tools -[Rationale]: ../Rationale/#block-arguments-vs-phi-nodes +[Rationale]: ../Rationale/Rationale.md/#block-arguments-vs-phi-nodes [ODS]: ../OpDefinitions.md [GreedyPatternRewriter]: https://github.com/llvm/llvm-project/blob/main/mlir/lib/Transforms/Utils/GreedyPatternRewriteDriver.cpp -[MlirDialectConversionTypeConversion]: ../DialectConversion.md#type-converter -[MlirDialectConversionRewritePattern]: ../DialectConversion.md#conversion-patterns -[MlirDialectConversionSignatureConversion]: ../DialectConversion.md#region-signature-conversion +[MlirDialectConversionTypeConversion]: ../DialectConversion.md/#type-converter +[MlirDialectConversionRewritePattern]: ../DialectConversion.md/#conversion-patterns +[MlirDialectConversionSignatureConversion]: ../DialectConversion.md/#region-signature-conversion [MlirOpInterface]: ../Interfaces/#operation-interfaces -[MlirIntegerType]: Builtin.md#integertype -[MlirFloatType]: ../LangRef.md#floating-point-types -[MlirVectorType]: ../LangRef.md#vector-type -[MlirMemrefType]: ../LangRef.md#memref-type -[MlirIndexType]: Builtin.md#indextype -[MlirGpuDialect]: ../Dialects/GPU.md -[MlirStandardDialect]: ../Dialects/Standard.md +[MlirIntegerType]: Builtin.md/#integertype +[MlirVectorType]: Builtin.md/#vectortype +[MlirMemrefType]: Builtin.md/#memreftype +[MlirIndexType]: Builtin.md/#indextype +[MlirGpuDialect]: GPU.md +[MlirStandardDialect]: Standard.md [MlirSpirvHeaders]: https://github.com/llvm/llvm-project/tree/main/mlir/include/mlir/Dialect/SPIRV [MlirSpirvLibs]: https://github.com/llvm/llvm-project/tree/main/mlir/lib/Dialect/SPIRV [MlirSpirvTests]: https://github.com/llvm/llvm-project/tree/main/mlir/test/Dialect/SPIRV Index: mlir/include/mlir/Dialect/Affine/IR/AffineOps.td =================================================================== --- mlir/include/mlir/Dialect/Affine/IR/AffineOps.td +++ mlir/include/mlir/Dialect/Affine/IR/AffineOps.td @@ -133,7 +133,7 @@ containing its body. This region must contain one block that terminates with [`affine.yield`](#affineyield-affineyieldop). *Note:* when `affine.for` is printed in custom format, the terminator is omitted. The - block has one argument of [`index`](../LangRef.md#index-type) type that + block has one argument of [`index`](Builtin.md/#indextype) type that represents the induction variable of the loop. The `affine.for` operation executes its body a number of times iterating @@ -912,9 +912,9 @@ let summary = "affine vector load operation"; let description = [{ The "affine.vector_load" is the vector counterpart of - [affine.load](#affineload-operation). It reads a slice from a - [MemRef](../LangRef.md#memref-type), supplied as its first operand, - into a [vector](../LangRef.md#vector-type) of the same base elemental type. + [affine.load](#affineload-affineloadop). It reads a slice from a + [MemRef](Builtin.md/#memreftype), supplied as its first operand, + into a [vector](Builtin.md/#vectortype) of the same base elemental type. The index for each memref dimension is an affine expression of loop induction variables and symbols. These indices determine the start position of the read within the memref. The shape of the return vector type determines the shape of @@ -976,8 +976,8 @@ let description = [{ The "affine.vector_store" is the vector counterpart of [affine.store](#affinestore-affinestoreop). It writes a - [vector](../LangRef.md#vector-type), supplied as its first operand, - into a slice within a [MemRef](../LangRef.md#memref-type) of the same base + [vector](Builtin.md/#vectortype), supplied as its first operand, + into a slice within a [MemRef](Builtin.md/#memreftype) of the same base elemental type, supplied as its second operand. The index for each memref dimension is an affine expression of loop induction variables and symbols. These indices determine the start position Index: mlir/include/mlir/Dialect/MemRef/IR/MemRefOps.td =================================================================== --- mlir/include/mlir/Dialect/MemRef/IR/MemRefOps.td +++ mlir/include/mlir/Dialect/MemRef/IR/MemRefOps.td @@ -165,7 +165,7 @@ The `alloca` operation allocates memory on the stack, to be automatically released when control transfers back from the region of its closest surrounding operation with an - [`AutomaticAllocationScope`](../Traits.md#automaticallocationscope) trait. + [`AutomaticAllocationScope`](../Traits.md/#automaticallocationscope) trait. The amount of memory allocated is specified by its memref and additional operands. For example: @@ -553,8 +553,8 @@ In an `affine.if` or `affine.for` body, the indices of a load are restricted to SSA values bound to surrounding loop induction variables, - [symbols](Affine.md#dimensions-and-symbols), results of a - [`constant` operation](#stdconstant-constantop), or the result of an + [symbols](Affine.md/#dimensions-and-symbols), results of a + [`constant` operation](Standard.md/#stdconstant-constantop), or the result of an `affine.apply` operation that can in turn take as arguments all of the aforementioned SSA values or the recursively result of such an `affine.apply` operation. @@ -574,10 +574,10 @@ **Context:** The `load` and `store` operations are specifically crafted to fully resolve a reference to an element of a memref, and (in affine `affine.if` and `affine.for` operations) the compiler can follow use-def - chains (e.g. through [`affine.apply`](Affine.md#affineapply-affineapplyop) + chains (e.g. through [`affine.apply`](Affine.md/#affineapply-affineapplyop) operations) to precisely analyze references at compile-time using polyhedral techniques. This is possible because of the - [restrictions on dimensions and symbols](Affine.md#restrictions-on-dimensions-and-symbols) + [restrictions on dimensions and symbols](Affine.md/#restrictions-on-dimensions-and-symbols) in these contexts. }]; @@ -826,9 +826,9 @@ In an affine context, the indices of a store are restricted to SSA values bound to surrounding loop induction variables, - [symbols](Affine.md#restrictions-on-dimensions-and-symbols), results of a - [`constant` operation](#stdconstant-constantop), or the result of an - [`affine.apply`](Affine.md#affineapply-affineapplyop) operation that can in + [symbols](Affine.md/#restrictions-on-dimensions-and-symbols), results of a + [`constant` operation](Standard.md/#stdconstant-constantop), or the result of an + [`affine.apply`](Affine.md/#affineapply-affineapplyop) operation that can in turn take as arguments all of the aforementioned SSA values or the recursively result of such an `affine.apply` operation. @@ -841,10 +841,10 @@ **Context:** The `load` and `store` operations are specifically crafted to fully resolve a reference to an element of a memref, and (in polyhedral `affine.if` and `affine.for` operations) the compiler can follow use-def - chains (e.g. through [`affine.apply`](Affine.md#affineapply-affineapplyop) + chains (e.g. through [`affine.apply`](Affine.md/#affineapply-affineapplyop) operations) to precisely analyze references at compile-time using polyhedral techniques. This is possible because of the - [restrictions on dimensions and symbols](Affine.md#restrictions-on-dimensions-and-symbols) + [restrictions on dimensions and symbols](Affine.md/#restrictions-on-dimensions-and-symbols) in these contexts. }]; Index: mlir/include/mlir/IR/BuiltinAttributes.td =================================================================== --- mlir/include/mlir/IR/BuiltinAttributes.td +++ mlir/include/mlir/IR/BuiltinAttributes.td @@ -856,7 +856,7 @@ legally hold a symbol reference simplifies reasoning about these data accesses. - See [`Symbols And SymbolTables`](SymbolsAndSymbolTables.md) for more + See [`Symbols And SymbolTables`](../SymbolsAndSymbolTables.md) for more information. Examples: Index: mlir/include/mlir/IR/BuiltinTypes.td =================================================================== --- mlir/include/mlir/IR/BuiltinTypes.td +++ mlir/include/mlir/IR/BuiltinTypes.td @@ -327,7 +327,7 @@ ``` The core syntax and representation of a layout specification is a - [semi-affine map](Dialects/Affine.md#semi-affine-maps). Additionally, + [semi-affine map](Affine.md/#semi-affine-maps). Additionally, syntactic sugar is supported to make certain layout specifications more intuitive to read. For the moment, a `memref` supports parsing a strided form which is converted to a semi-affine map automatically. @@ -422,7 +422,7 @@ ##### Index Map An index map is a one-to-one - [semi-affine map](Dialects/Affine.md#semi-affine-maps) that transforms a + [semi-affine map](Affine.md/#semi-affine-maps) that transforms a multidimensional index from one index space to another. For example, the following figure shows an index map which maps a 2-dimensional index from a 2x2 index space to a 3x3 index space, using symbols `S0` and `S1` as @@ -440,7 +440,7 @@ ##### Layout Map - A layout map is a [semi-affine map](Dialects/Affine.md#semi-affine-maps) + A layout map is a [semi-affine map](Affine.md/#semi-affine-maps) which encodes logical to physical index space mapping, by mapping input dimensions to their ordering from most-major (slowest varying) to most-minor (fastest varying). Therefore, an identity layout map corresponds to a @@ -474,7 +474,7 @@ The semi-affine map composition specified in the memref type, maps from accesses used to index the memref in load/store operations to other index spaces (i.e. logical to physical index mapping). Each of the - [semi-affine maps](Affine.md) and thus its composition is required + [semi-affine maps](Affine.md/#semi-affine-maps) and thus its composition is required to be one-to-one. The semi-affine map composition can be used in dependence analysis, memory @@ -650,7 +650,7 @@ low level buffer access, MLIR has a [`memref` type](#memref-type). This abstracted runtime representation holds both the tensor data values as well as information about the (potentially dynamic) shape of the tensor. The - [`dim` operation](Dialects/Standard.md#dim-operation) returns the size of a + [`dim` operation](MemRef.md/#memrefdim-mlirmemrefdimop) returns the size of a dimension from a value of tensor type. The `encoding` attribute provides additional information on the tensor. @@ -730,7 +730,7 @@ **Rationale:** Though this type is first class in the type system, MLIR provides no standard operations for operating on `tuple` types - ([rationale](Rationale/Rationale.md#tuple-types)). + ([rationale](Rationale/Rationale.md/#tuple-types)). Examples: