[all-commits] [llvm/llvm-project] fcd4ee: [mlir] Make ShapedTypeComponents contructible from...

ChiaHungDuan via All-commits all-commits at lists.llvm.org
Tue Mar 8 19:38:53 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: fcd4ee52cd6dc80a8ae4b7af68d13a37fb761cfe
      https://github.com/llvm/llvm-project/commit/fcd4ee52cd6dc80a8ae4b7af68d13a37fb761cfe
  Author: Chia-hung Duan <chiahungduan at google.com>
  Date:   2022-03-09 (Wed, 09 Mar 2022)

  Changed paths:
    M mlir/include/mlir/Interfaces/InferTypeOpInterface.h

  Log Message:
  -----------
  [mlir] Make ShapedTypeComponents contructible from ShapeAdaptor

ValueShapeRange::getShape() returns ShapeAdaptor rather than ShapedType
and ShapeAdaptor allows implicit conversion to bool. It ends up that
ShapedTypeComponents can be constructed with ShapeAdaptor incorrectly.
The reason is that the type trait
  std::is_constructible<ShapeStorageT, Arg>::value
is fulfilled because ShapeAdaptor can be converted to bool and it can be
used to construct ShapeStorageT. In the end, we won't give any warning
or error message when doing things like
  inferredReturnShapes.emplace_back(valueShapeRange.getShape(0));

Reviewed By: jpienaar

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




More information about the All-commits mailing list