[Mlir-commits] [mlir] 5f9bf3f - [MLIR][NFC] Move test/Transforms/lower-affine.mlir -> test/Conversion

Uday Bondhugula llvmlistbot at llvm.org
Tue Mar 31 11:07:27 PDT 2020


Author: Uday Bondhugula
Date: 2020-03-31T23:34:50+05:30
New Revision: 5f9bf3f656146d1987b471f3c1aaf2f13e8c385a

URL: https://github.com/llvm/llvm-project/commit/5f9bf3f656146d1987b471f3c1aaf2f13e8c385a
DIFF: https://github.com/llvm/llvm-project/commit/5f9bf3f656146d1987b471f3c1aaf2f13e8c385a.diff

LOG: [MLIR][NFC] Move test/Transforms/lower-affine.mlir -> test/Conversion

Move lower-affine.mlir from test/Transforms to
test/Conversion/AffineToStandard/. Other related NFC.

Signed-off-by: Uday Bondhugula <uday at polymagelabs.com>

Differential Revision: https://reviews.llvm.org/D77008

Added: 
    mlir/test/Conversion/AffineToStandard/lower-affine.mlir

Modified: 
    mlir/docs/Passes.md
    mlir/lib/Conversion/AffineToStandard/AffineToStandard.cpp

Removed: 
    mlir/test/Transforms/lower-affine.mlir


################################################################################
diff  --git a/mlir/docs/Passes.md b/mlir/docs/Passes.md
index 78ea257b57bc..231594b82fc7 100644
--- a/mlir/docs/Passes.md
+++ b/mlir/docs/Passes.md
@@ -4,21 +4,21 @@ This document describes the available MLIR passes and their contracts.
 
 [TOC]
 
-## Affine control lowering (`-lower-affine`)
+## Affine dialect lowering (`-lower-affine`)
 
-Convert operations related to affine control into a graph of blocks using
-operations from the standard dialect.
+Convert operations from the affine dialect into operations from the loop and
+standard dialects.
 
-Loop statements are converted to a subgraph of blocks (initialization, condition
-checking, subgraph of body blocks) with loop induction variable being passed as
-the block argument of the condition checking block. Conditional statements are
-converted to a subgraph of blocks (chain of condition checking with
-short-circuit logic, subgraphs of 'then' and 'else' body blocks). `affine.apply`
-operations are converted into sequences of primitive arithmetic operations that
-have the same effect, using operands of the `index` type. Consequently, named
-maps and sets may be removed from the module.
+`affine.for` operations are converted to `loop.for` operations that are free of
+certain structural restrictions (on their bounds and step). `affine.if` is
+similarly converted to the `loop.if` operation. `affine.apply` operations are
+converted into sequences of primitive arithmetic operations from the standard
+dialect that have the same effect, using operands of the `index` type.
+Consequently, named maps and sets thare are no longer in use may be removed from
+the module.
 
-For example, `%r = affine.apply (d0, d1)[s0] -> (d0 + 2*d1 + s0)(%d0, %d1)[%s0]`
+For example, `%r = affine.apply affine_map<(d0, d1)[s0] -> (d0 + 2*d1 +
+s0)>(%d0, %d1)[%s0]`
 can be converted into:
 
 ```mlir

diff  --git a/mlir/lib/Conversion/AffineToStandard/AffineToStandard.cpp b/mlir/lib/Conversion/AffineToStandard/AffineToStandard.cpp
index 026952f32b9f..ba9c02b452c8 100644
--- a/mlir/lib/Conversion/AffineToStandard/AffineToStandard.cpp
+++ b/mlir/lib/Conversion/AffineToStandard/AffineToStandard.cpp
@@ -597,4 +597,4 @@ std::unique_ptr<OpPassBase<FuncOp>> mlir::createLowerAffinePass() {
 
 static PassRegistration<LowerAffinePass>
     pass("lower-affine",
-         "Lower If, For, AffineApply operations to primitive equivalents");
+         "Lower affine dialect operations to loop/standard dialect ones");

diff  --git a/mlir/test/Transforms/lower-affine.mlir b/mlir/test/Conversion/AffineToStandard/lower-affine.mlir
similarity index 100%
rename from mlir/test/Transforms/lower-affine.mlir
rename to mlir/test/Conversion/AffineToStandard/lower-affine.mlir


        


More information about the Mlir-commits mailing list