[all-commits] [llvm/llvm-project] 7a1077: [mlir][sparse] Improving SparseTensorDimSliceAttr ...

wren romano via All-commits all-commits at lists.llvm.org
Tue May 30 17:31:10 PDT 2023

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7a1077baa01cd66afa193276796ee6679954d4e5
  Author: wren romano <2998727+wrengr at users.noreply.github.com>
  Date:   2023-05-30 (Tue, 30 May 2023)

  Changed paths:
    M mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensorAttrDefs.td
    M mlir/lib/Dialect/SparseTensor/IR/SparseTensorDialect.cpp

  Log Message:
  [mlir][sparse] Improving SparseTensorDimSliceAttr methods

This patch makes the following changes to `SparseTensorDimSliceAttr` methods:
* Mark `isDynamic` constexpr.
* Add new helpers `getStatic` and `getStaticString` to avoid repetition.
* Moved the definitions for `getStatic{Offset,Stride,Size}` and `isCompletelyDynamic` out of the class declaration; because there's no benefit to inlining them.
* Changed `parse` to use `kDynamic` rather than literals.
* Changed `verify` to use the `isDynamic` helper.

Reviewed By: aartbik

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

More information about the All-commits mailing list