[all-commits] [llvm/llvm-project] 852f6b: [mlir][tosa] Improve tosa-infer-shapes for ops con...

Spenser Bauman via All-commits all-commits at lists.llvm.org
Fri Dec 1 07:08:30 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 852f6be6967911de8ab6fe61b5a632366cc0804e
      https://github.com/llvm/llvm-project/commit/852f6be6967911de8ab6fe61b5a632366cc0804e
  Author: Spenser Bauman <sbauman at mathworks.com>
  Date:   2023-12-01 (Fri, 01 Dec 2023)

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

  Log Message:
  -----------
  [mlir][tosa] Improve tosa-infer-shapes for ops consumed by non-TOSA operators (#72715)

TOSA operators consumed by non-TOSA ops generally do not have their
types inferred, as that would alter the types expected by their
consumers. This prevents type refinement on many TOSA operators when the
IR contains a mix of dialects.

This change modifies tosa-infer-shapes to update the types of all TOSA
operators during inference. When a consumer of that TOSA op is not safe
to update, a tensor.cast is inserted back to the original type. This
behavior is similar to how TOSA ops consumed by func.return are handled.

This allows for more type refinement of TOSA ops, and the additional
tensor.cast operators may be removed by later canonicalizations.




More information about the All-commits mailing list