[all-commits] [llvm/llvm-project] 84a6da: [mlir] Fix some edge cases around 0-element Tensor...

Sean Silva via All-commits all-commits at lists.llvm.org
Fri Sep 11 10:59:05 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 84a6da67e6b2a76b15ad1862f4cbb7625fe318df
      https://github.com/llvm/llvm-project/commit/84a6da67e6b2a76b15ad1862f4cbb7625fe318df
  Author: Sean Silva <silvasean at google.com>
  Date:   2020-09-11 (Fri, 11 Sep 2020)

  Changed paths:
    M mlir/include/mlir/Dialect/StandardOps/IR/Ops.td
    M mlir/lib/Conversion/ShapeToStandard/ShapeToStandard.cpp
    M mlir/lib/Dialect/StandardOps/IR/Ops.cpp
    M mlir/test/Conversion/ShapeToStandard/shape-to-standard.mlir
    M mlir/test/IR/core-ops.mlir

  Log Message:
  -----------
  [mlir] Fix some edge cases around 0-element TensorFromElementsOp

This introduces a builder for the more general case that supports zero
elements (where the element type can't be inferred from the ValueRange,
since it might be empty).

Also, fix up some cases in ShapeToStandard lowering that hit this. It
happens very easily when dealing with shapes of 0-D tensors.

The SameOperandsAndResultElementType is redundant with the new
TypesMatchWith and prevented having zero elements.

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




More information about the All-commits mailing list