[all-commits] [llvm/llvm-project] ff52ad: [mlir] Change DenseArrayAttr to TensorType

Jeff Niu via All-commits all-commits at lists.llvm.org
Mon Aug 1 19:17:43 PDT 2022

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ff52ad796c971dbf805375a2140344f742db94a3
  Author: Jeff Niu <jeff at modular.com>
  Date:   2022-08-01 (Mon, 01 Aug 2022)

  Changed paths:
    M mlir/lib/IR/AsmPrinter.cpp
    M mlir/lib/IR/BuiltinAttributes.cpp

  Log Message:
  [mlir] Change DenseArrayAttr to TensorType

Previously, DenseArrayAttr used VectorType for its shaped type.
VectorType is problematic for arrays because it doesn't support zero
dimensions, meaning that an empty array would have `vector<i32>` as its
type. ElementsAttr would think that an empty dense array is size 1, not
0. This patch switches over to TensorType, which does support zero

Fixes #56860

Reviewed By: mehdi_amini

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

More information about the All-commits mailing list