Add a linalg.for operation to support non-affine loop constructs
authorNicolas Vasilache <ntv@google.com>
Tue, 28 May 2019 22:05:51 +0000 (15:05 -0700)
committerMehdi Amini <joker.eph@gmail.com>
Sun, 2 Jun 2019 03:06:21 +0000 (20:06 -0700)
commit3ad0fa95d1eab30c517817a6bcc191ecdf77a1e8
tree86214290e7714ba7f8fa4deed7050f282b4d8488
parente828c7e1e110ffb4c77188b40ec29917b69b6e4c
Add a linalg.for operation to support non-affine loop constructs

    The affine.for operation has restrictions that make it suitable for dependence analysis. The Linalg dialect aims at being more general.
    This CL introduces linalg.for, and its associated terminator, along with a simple roundtripping test.
    A `linalg.for` only takes one value of index type for lower bound, upper bound and step.

    Example usage:
    ```
    linalg.for %iv = %lb to %ub step %step {
      ... // body
    }
    ```

--

PiperOrigin-RevId: 250369722
mlir/include/mlir/Linalg/IR/LinalgOps.h
mlir/include/mlir/Linalg/IR/LinalgOps.td
mlir/lib/Linalg/IR/LinalgOps.cpp
mlir/lib/Linalg/IR/LinalgTypes.cpp
mlir/test/Linalg/roundtrip.mlir