[all-commits] [llvm/llvm-project] 86f91e: [mlir][sparse] Cleaning up the dim/lvl distinction...

wren romano via All-commits all-commits at lists.llvm.org
Mon Dec 5 16:59:57 PST 2022

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 86f91e45a22bbb981ede3439c7241ee92ea522ec
  Author: wren romano <2998727+wrengr at users.noreply.github.com>
  Date:   2022-12-05 (Mon, 05 Dec 2022)

  Changed paths:
    M mlir/include/mlir/ExecutionEngine/SparseTensor/Storage.h
    M mlir/include/mlir/ExecutionEngine/SparseTensorRuntime.h
    M mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorConversion.cpp
    M mlir/lib/ExecutionEngine/SparseTensorRuntime.cpp
    M mlir/test/Dialect/SparseTensor/conversion.mlir
    M mlir/test/Dialect/SparseTensor/convert_sparse2dense.mlir
    M mlir/test/Dialect/SparseTensor/sparse_expand.mlir
    M mlir/test/Dialect/SparseTensor/sparse_perm_lower.mlir

  Log Message:
  [mlir][sparse] Cleaning up the dim/lvl distinction in SparseTensorConversion

This change cleans up the conversion pass re the "dim"-vs-"lvl" and "sizes"-vs-"shape" distinctions of the runtime. A quick synopsis includes:

* Adds new `SparseTensorStorageBase::getDimSize` method, with `sparseDimSize` wrapper in SparseTensorRuntime.h, and `genDimSizeCall` generator in SparseTensorConversion.cpp
* Changes `genLvlSizeCall` to perform no logic, just generate the function call.
* Adds `createOrFold{Dim,Lvl}Call` functions to handle the logic of replacing `gen{Dim,Lvl}SizeCall` with constants whenever possible. The `createOrFoldDimCall` function replaces the old `sizeFromPtrAtDim`.
* Adds `{get,fill}DimSizes` functions for iterating `createOrFoldDimCall` across the whole type. These functions replace the old `sizesFromPtr`.
* Adds `{get,fill}DimShape` functions for lowering a `ShapedType` into constants. These functions replace the old `sizesFromType`.
* Changes the `DimOp` rewrite to do the right thing.
* Changes the `ExpandOp` rewrite to compute the proper expansion size.

Depends On D138365

Reviewed By: aartbik

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

More information about the All-commits mailing list