[all-commits] [llvm/llvm-project] bbd2b0: [mlir][vector] Make `TransposeOpLowering` configur...

Andrzej Warzyński via All-commits all-commits at lists.llvm.org
Mon Dec 4 08:56:57 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: bbd2b08b95fe76bea138c1b03c1cd42ed3ee04df
      https://github.com/llvm/llvm-project/commit/bbd2b08b95fe76bea138c1b03c1cd42ed3ee04df
  Author: Andrzej Warzyński <andrzej.warzynski at arm.com>
  Date:   2023-12-04 (Mon, 04 Dec 2023)

  Changed paths:
    M mlir/include/mlir/Dialect/Vector/Transforms/VectorTransforms.h
    M mlir/lib/Dialect/Vector/Transforms/LowerVectorTranspose.cpp

  Log Message:
  -----------
  [mlir][vector] Make `TransposeOpLowering` configurable (#73915)

Following the discussion here:

  * https://github.com/llvm/llvm-project/pull/72105

this patch makes the `TransposeOpLowering` configurable so that one can select
whether to favour `vector.shape_cast` over `vector.transpose`.

As per the discussion in #72105, using `vector.shape_cast` is very beneficial
and desirable when targeting `LLVM IR` (CPU lowering), but won't work when
targeting `SPIR-V` today (GPU lowering). Hence the need for a mechanism to be
able to disable/enable the pattern introduced in #72105. This patch proposes one
such mechanism.

While this should solve the problem that we are facing today, it's understood to
be a temporary workaround. It should be removed once support for lowering
`vector.shape_cast` to SPIR-V is added. Also, (once implemented) the following
proposal might make this workaround redundant:

  * https://discourse.llvm.org/t/improving-handling-of-unit-dimensions-in-the-vector-dialect/




More information about the All-commits mailing list