[all-commits] [llvm/llvm-project] b364c7: [mlir][sparse] Using non-empty function name suffi...

wren romano via All-commits all-commits at lists.llvm.org
Wed Jun 1 14:18:57 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b364c76683f8ef241025a9556300778c07b590c2
      https://github.com/llvm/llvm-project/commit/b364c76683f8ef241025a9556300778c07b590c2
  Author: wren romano <2998727+wrengr at users.noreply.github.com>
  Date:   2022-06-01 (Wed, 01 Jun 2022)

  Changed paths:
    M mlir/include/mlir/ExecutionEngine/SparseTensorUtils.h
    M mlir/lib/Dialect/SparseTensor/Transforms/CodegenUtils.cpp
    M mlir/test/Dialect/SparseTensor/conversion.mlir
    M mlir/test/Dialect/SparseTensor/sparse_lower.mlir
    M mlir/test/Dialect/SparseTensor/sparse_lower_col.mlir
    M mlir/test/Dialect/SparseTensor/sparse_lower_inplace.mlir

  Log Message:
  -----------
  [mlir][sparse] Using non-empty function name suffix for OverheadType::kIndex

The trick of using an empty token in the `FOREVERY_O` x-macro relies on preprocessor behavior which is only standard since C99 6.10.3/4 and C++11 N3290 16.3/4 (whereas it was undefined behavior up through C++03 16.3/10).  Since the `ExecutionEngine/SparseTensorUtils.cpp` file is required to be compile-able under C++98 compatibility mode (unlike the C++11 used elsewhere in MLIR), we shouldn't rely on that behavior.

Also, using a non-empty suffix helps improve uniformity of the API, since all other primary/overhead suffixes are also non-empty.  I'm using the suffix `0` since that's the value used by the `SparseTensorEncoding` attribute for indicating the index overhead-type.

Depends On D126720

Reviewed By: aartbik

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




More information about the All-commits mailing list