[all-commits] [llvm/llvm-project] 14da25: [mlir][sparse] scalarize reductions in for-loops d...

Aart Bik via All-commits all-commits at lists.llvm.org
Thu Dec 17 16:17:29 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 14da25b4b2eedf8a16aae34edfefd7bcaa5ceae5
      https://github.com/llvm/llvm-project/commit/14da25b4b2eedf8a16aae34edfefd7bcaa5ceae5
  Author: Aart Bik <ajcbik at google.com>
  Date:   2020-12-17 (Thu, 17 Dec 2020)

  Changed paths:
    M mlir/lib/Dialect/Linalg/Transforms/Sparsification.cpp
    M mlir/test/Dialect/Linalg/sparse_1d.mlir
    M mlir/test/Dialect/Linalg/sparse_2d.mlir
    M mlir/test/Dialect/Linalg/sparse_3d.mlir

  Log Message:
  -----------
  [mlir][sparse] scalarize reductions in for-loops during sparse codegen

Reductions in innermost loops become harder for the backend to disambiguate
after bufferization into memrefs, resulting in less efficient load-update-store
cycles. By scalarizing innermost reductions, the backend is more likely to assign
a register to perform the reduction (also prepares vectorization). Even though
we could scalarize reductions for more outer loops and while-loops as well,
currently scalarization is only done for chains of innermost for-loops, where
it matters most, to avoid complicating codegen unnecessary (viz. adding lots
of yield instructions).

This CL also refactors condition simplification into the merger class,
where it belongs, so that conditions are simplified only once per loop
nest and not repeatedly as was currently done. This CL also fixes a few
minor bugs, some layout issues, and comments.

Reviewed By: penpornk

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




More information about the All-commits mailing list