[all-commits] [llvm/llvm-project] 24e33b: [mlir] Implement DestinationStyleOpInterface for s...

Felix Schneider via All-commits all-commits at lists.llvm.org
Mon Sep 25 00:06:39 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 24e33b594503f0283d31b89e2694e3d798def5ac
      https://github.com/llvm/llvm-project/commit/24e33b594503f0283d31b89e2694e3d798def5ac
  Author: Felix Schneider <30509320+ubfx at users.noreply.github.com>
  Date:   2023-09-25 (Mon, 25 Sep 2023)

  Changed paths:
    M mlir/include/mlir/Dialect/SCF/IR/SCF.h
    M mlir/include/mlir/Dialect/SCF/IR/SCFOps.td
    M mlir/lib/Dialect/Tensor/IR/TensorOps.cpp

  Log Message:
  -----------
  [mlir] Implement DestinationStyleOpInterface for scf::ForallOp (#66981)

`scf::ForallOp` has `shared_outs` tensor operands which are used to
insert partial results into in the parallel terminator. The
`scf::ForallOp` returns one tensor for each `shared_out` which then
contains the combined result from all threads. Since the parallel
terminator cannot change the shape of the `shared_out`, ForallOp is a
`DestinationStyleOp` and this patch implements the interface by
declaring the `outputs` operands as `inits` in the language of the DPS
interface.

For this change to work, we need to add an exception to the Pattern that
folds `tensor.cast` Ops into DPS Ops because `scf::Forall` needs special
handling of its `BlockArgument` Type during this folding.




More information about the All-commits mailing list