[all-commits] [llvm/llvm-project] d1560f: [mlir] scf::ForOp: provide builders with callbacks...

ftynse via All-commits all-commits at lists.llvm.org
Tue May 19 07:26:50 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: d1560f3956f6396a2b10c721b96b4c7394019cc2
      https://github.com/llvm/llvm-project/commit/d1560f3956f6396a2b10c721b96b4c7394019cc2
  Author: Alex Zinenko <zinenko at google.com>
  Date:   2020-05-19 (Tue, 19 May 2020)

  Changed paths:
    M mlir/include/mlir/Dialect/SCF/EDSC/Builders.h
    M mlir/include/mlir/Dialect/SCF/SCF.h
    M mlir/include/mlir/Dialect/SCF/SCFOps.td
    M mlir/lib/Conversion/VectorToSCF/VectorToSCF.cpp
    M mlir/lib/Dialect/GPU/Transforms/MemoryPromotion.cpp
    M mlir/lib/Dialect/SCF/EDSC/Builders.cpp
    M mlir/lib/Dialect/SCF/SCF.cpp
    M mlir/test/EDSC/builder-api-test.cpp

  Log Message:
  -----------
  [mlir] scf::ForOp: provide builders with callbacks for loop body

Thanks to a recent change that made `::build` functions take an instance of
`OpBuilder`, it is now possible to build operations within a region attached to
the operation about to be created. Exercise this on `scf::ForOp` by taking a
callback that populates the loop body while the loop is being created.

Additionally, provide helper functions to build perfect nests of `ForOp`s,
with support for iteration arguments. These functions provide the same
functionality as EDSC LoopNestBuilder with simpler implementation, without
relying on edsc::ScopedContext, and using `OpBuilder` in an unambiguous way.
Compatibility functions for EDSC are provided, but may be removed in the
future.

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




More information about the All-commits mailing list