From 64bb0ae75f44ee6a09e749164edfac247a3e1a10 Mon Sep 17 00:00:00 2001 From: Alex Zinenko Date: Tue, 2 Aug 2022 13:22:40 +0200 Subject: [PATCH] [mlir] add TOC to top-level documents Multiple top-level MLIR documents did not have a table of contents tag, making them harder to nagivate. --- mlir/docs/BufferDeallocationInternals.md | 2 ++ mlir/docs/CAPI.md | 2 ++ mlir/docs/Canonicalization.md | 2 ++ mlir/docs/DataLayout.md | 2 ++ mlir/docs/DebugActions.md | 4 ++-- mlir/docs/DeclarativeRewrites.md | 2 ++ mlir/docs/DialectConversion.md | 4 ++-- mlir/docs/Interfaces.md | 2 ++ mlir/docs/OpDefinitions.md | 2 ++ mlir/docs/ShapeInference.md | 2 ++ 10 files changed, 20 insertions(+), 4 deletions(-) diff --git a/mlir/docs/BufferDeallocationInternals.md b/mlir/docs/BufferDeallocationInternals.md index 3d528afe1c3a..3078cfbf5933 100644 --- a/mlir/docs/BufferDeallocationInternals.md +++ b/mlir/docs/BufferDeallocationInternals.md @@ -5,6 +5,8 @@ transformation. The transformation consists of several passes. The main pass called BufferDeallocation can be applied via “-buffer-deallocation” on MLIR programs. +[TOC] + ## Requirements In order to use BufferDeallocation on an arbitrary dialect, several control-flow diff --git a/mlir/docs/CAPI.md b/mlir/docs/CAPI.md index 1dd224731ac3..71a674aacc5c 100644 --- a/mlir/docs/CAPI.md +++ b/mlir/docs/CAPI.md @@ -2,6 +2,8 @@ **Current status: Under development, API unstable, built by default.** +[TOC] + ## Design Many languages can interoperate with C but have a harder time with C++ due to diff --git a/mlir/docs/Canonicalization.md b/mlir/docs/Canonicalization.md index 556ef4e704f3..71707cac41c6 100644 --- a/mlir/docs/Canonicalization.md +++ b/mlir/docs/Canonicalization.md @@ -15,6 +15,8 @@ reuse it across many different IRs that it represents. This document describes the general approach, global canonicalizations performed, and provides sections to capture IR-specific rules for reference. +[TOC] + ## General Design MLIR has a single canonicalization pass, which iteratively applies diff --git a/mlir/docs/DataLayout.md b/mlir/docs/DataLayout.md index a1eda21dab5b..e246e66c7fe2 100644 --- a/mlir/docs/DataLayout.md +++ b/mlir/docs/DataLayout.md @@ -21,6 +21,8 @@ Built-in types are handled specially to decrease the overall query cost. Similarly, built-in `ModuleOp` supports data layouts without going through the interface. +[TOC] + ## Usage ### Scoping diff --git a/mlir/docs/DebugActions.md b/mlir/docs/DebugActions.md index 585a6541c799..777be8eaf4b1 100644 --- a/mlir/docs/DebugActions.md +++ b/mlir/docs/DebugActions.md @@ -1,7 +1,5 @@ # Debug Actions -[TOC] - This file documents the infrastructure for `Debug Actions`. This is a DEBUG only API that allows for external entities to control various aspects of compiler execution. This is conceptually similar to something like `DebugCounters` in @@ -23,6 +21,8 @@ The exact definition of an `external entity` is left opaque, to allow for more interesting handlers. The set of possible action queries is detailed in the [`action manager`](#debug-action-manager) section below. +[TOC] + ## Debug Action A `debug action` is essentially a marker for a type of action that may be diff --git a/mlir/docs/DeclarativeRewrites.md b/mlir/docs/DeclarativeRewrites.md index 7a9a001ca264..6443fce9297c 100644 --- a/mlir/docs/DeclarativeRewrites.md +++ b/mlir/docs/DeclarativeRewrites.md @@ -17,6 +17,8 @@ for the latter. Given that declarative rewrite rules depend on op definition specification, this manual assumes knowledge of the [ODS](OpDefinitions.md) doc. +[TOC] + ## Benefits Compared to the hand-written C++ classes, this declarative approach has several diff --git a/mlir/docs/DialectConversion.md b/mlir/docs/DialectConversion.md index 8cba74ab47a5..9f9b95de879f 100644 --- a/mlir/docs/DialectConversion.md +++ b/mlir/docs/DialectConversion.md @@ -5,14 +5,14 @@ conversions between, and within dialects. This framework allows for transforming illegal operations to those supported by a provided conversion target, via a set of pattern-based operation rewriting patterns. -[TOC] - The dialect conversion framework consists of the following components: * A [Conversion Target](#conversion-target) * A set of [Rewrite Patterns](#rewrite-pattern-specification) * A [Type Converter](#type-conversion) (Optional) +[TOC] + ## Modes of Conversion When applying a conversion to a set of operations, there are several different diff --git a/mlir/docs/Interfaces.md b/mlir/docs/Interfaces.md index 8ec20a912456..15e35d08407a 100644 --- a/mlir/docs/Interfaces.md +++ b/mlir/docs/Interfaces.md @@ -8,6 +8,8 @@ to account for the semantics of every operation, or be overly conservative. Without care, this can result in code with special-cases for each supported operation type. To combat this, MLIR provides a concept of `interfaces`. +[TOC] + ## Motivation Interfaces provide a generic way of interacting with the IR. The goal is to be diff --git a/mlir/docs/OpDefinitions.md b/mlir/docs/OpDefinitions.md index b3399d89c698..eea9ad79bf54 100644 --- a/mlir/docs/OpDefinitions.md +++ b/mlir/docs/OpDefinitions.md @@ -16,6 +16,8 @@ for the latter. In addition to detailing each mechanism, this manual also tries to capture best practices. They are rendered as quoted bullet points. +[TOC] + ## Motivation MLIR allows pluggable dialects, and dialects contain, among others, a list of diff --git a/mlir/docs/ShapeInference.md b/mlir/docs/ShapeInference.md index af2eb3419be0..d3f4155337f6 100644 --- a/mlir/docs/ShapeInference.md +++ b/mlir/docs/ShapeInference.md @@ -17,6 +17,8 @@ inference. The return type can often be deduced from the deduced return shape and elemental type (queryable from `InferShapedTypeOpInterface`) and so type inference for tensor types can be implemented with `InferShapedTypeOpInterface`. +[TOC] + ## Shape functions The C++ interfaces are the base mechanism whereby shape inference is queried and