[all-commits] [llvm/llvm-project] e9cb58: [mlir][TOSA] Fix shape inference when operand was ...

maxbartel via All-commits all-commits at lists.llvm.org
Fri Sep 22 14:10:04 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e9cb5828dceed982ea5f87b4d9b63ab0728a66f3
      https://github.com/llvm/llvm-project/commit/e9cb5828dceed982ea5f87b4d9b63ab0728a66f3
  Author: maxbartel <maximilian.bartel at amd.com>
  Date:   2023-09-22 (Fri, 22 Sep 2023)

  Changed paths:
    M mlir/include/mlir/Interfaces/InferTypeOpInterface.td
    M mlir/lib/Dialect/Tosa/Transforms/TosaInferShapes.cpp
    M mlir/test/Dialect/Tosa/tosa-infer-shapes.mlir

  Log Message:
  -----------
  [mlir][TOSA] Fix shape inference when operand was inferred (#66906)

https://github.com/llvm/llvm-project/commit/057fc8e7d8a3593f98930b8b91f80b9dd9b5fd4a
Introduces a bug in the `TosaInferShapesPass` when an operand type was
already inferred.
https://github.com/llvm/llvm-project/blob/f7bfa583b7a5ff0e9954d2810006b7a71123be88/mlir/include/mlir/Interfaces/InferTypeOpInterface.td#L248
interprets the `ValueShapeRange` as a normal `ValueRange` and looses the
information of the inference.

This PR changes the logic of the shape inference a bit. Instead of
saving the type information in a `DenseMap` and updating the types after
the whole analysis for a region, it now updates the types directly in
each iteration. That way the operands always have the inferred type.




More information about the All-commits mailing list