History log of /llvm-project/mlir/lib/Dialect/Tosa/Utils/ConversionUtils.cpp (Results 1 – 15 of 15)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: llvmorg-21-init
# 7e622b61 22-Jan-2025 Jerry-Ge <jerry.ge@arm.com>

[TOSA] Change PadOp padding to tosa.shape (#123133)

This patch changes PadOp's padding input to type !tosa.shape<2 * rank>,
(where rank is the rank of the PadOp's input), instead of a <rank x 2>
t

[TOSA] Change PadOp padding to tosa.shape (#123133)

This patch changes PadOp's padding input to type !tosa.shape<2 * rank>,
(where rank is the rank of the PadOp's input), instead of a <rank x 2>
tensor.

This patch is also a part of TOSA v1.0 effort:
https://discourse.llvm.org/t/rfc-tosa-dialect-increment-to-v1-0/83708

This patch updates the PadOp to match all against the TOSA v1.0 form.

Original Authors include:
@Tai78641
@wonjeon

Co-authored-by: Tai Ly <tai.ly@arm.com>

show more ...


Revision tags: llvmorg-19.1.7, llvmorg-19.1.6, llvmorg-19.1.5, llvmorg-19.1.4, llvmorg-19.1.3, llvmorg-19.1.2, llvmorg-19.1.1, llvmorg-19.1.0
# c8834527 05-Sep-2024 Tai Ly <tai.ly@arm.com>

[TOSA] Move CreateOpAndInfer into ConversionUtils.h (#106122)

This moves CreateOpAndInfer from TF legalize_util.h into
ConversionUtils.h

also removed duplicate createOpAndInfer function from
To

[TOSA] Move CreateOpAndInfer into ConversionUtils.h (#106122)

This moves CreateOpAndInfer from TF legalize_util.h into
ConversionUtils.h

also removed duplicate createOpAndInfer function from
TosaDecomposeTransposeConv.cpp

Renamed to CreateOpAndInferShape so we can upstream this independently
of tensorflow (otherwise a redefinition error would break TF compile if
not upstreamed together with removal of CreateOpAndInfer in TF)

---------

Signed-off-by: Tai Ly <tai.ly@arm.com>

show more ...


Revision tags: llvmorg-19.1.0-rc4, llvmorg-19.1.0-rc3, llvmorg-19.1.0-rc2, llvmorg-19.1.0-rc1, llvmorg-20-init
# 8d237190 27-Jun-2024 Matthias Gehre <matthias.gehre@amd.com>

TosaToLinalg: Support unsigned tosa.clamp (#91749)

This implements the lowering of tosa.clamp with unsigned operand to
linalg.

We interpret the `min/max : i64` attributes on `clamp` to be signe

TosaToLinalg: Support unsigned tosa.clamp (#91749)

This implements the lowering of tosa.clamp with unsigned operand to
linalg.

We interpret the `min/max : i64` attributes on `clamp` to be signed.

This means that when the operand has type `ui64`, one cannot represent
limits across the whole range.

show more ...


Revision tags: llvmorg-18.1.8, llvmorg-18.1.7, llvmorg-18.1.6, llvmorg-18.1.5, llvmorg-18.1.4, llvmorg-18.1.3, llvmorg-18.1.2, llvmorg-18.1.1, llvmorg-18.1.0, llvmorg-18.1.0-rc4
# d4fd2025 21-Feb-2024 mlevesquedion <mlevesquedion@google.com>

[mlir] Use arith max or min ops instead of cmp + select (#82178)

I believe the semantics should be the same, but this saves 1 op and simplifies the code.

For example, the following two instructio

[mlir] Use arith max or min ops instead of cmp + select (#82178)

I believe the semantics should be the same, but this saves 1 op and simplifies the code.

For example, the following two instructions:

```
%2 = cmp sgt %0, %1
%3 = select %2, %0, %1
```

Are equivalent to:

```
%2 = maxsi %0 %1
```

show more ...


Revision tags: llvmorg-18.1.0-rc3, llvmorg-18.1.0-rc2, llvmorg-18.1.0-rc1, llvmorg-19-init, llvmorg-17.0.6, llvmorg-17.0.5, llvmorg-17.0.4, llvmorg-17.0.3, llvmorg-17.0.2, llvmorg-17.0.1, llvmorg-17.0.0
# 8a6e54c9 12-Sep-2023 Daniil Dudkin <39276703+unterumarmung@users.noreply.github.com>

[mlir][arith] Rename operations: `maxf` → `maximumf`, `minf` → `minimumf` (#65800)

This patch is part of a larger initiative aimed at fixing floating-point `max` and `min` operations in MLIR: https:

[mlir][arith] Rename operations: `maxf` → `maximumf`, `minf` → `minimumf` (#65800)

This patch is part of a larger initiative aimed at fixing floating-point `max` and `min` operations in MLIR: https://discourse.llvm.org/t/rfc-fix-floating-point-max-and-min-operations-in-mlir/72671.

This commit addresses Task 1.2 of the mentioned RFC. By renaming these operations, we align their names with LLVM intrinsics that have corresponding semantics.

show more ...


Revision tags: llvmorg-17.0.0-rc4, llvmorg-17.0.0-rc3, llvmorg-17.0.0-rc2, llvmorg-17.0.0-rc1, llvmorg-18-init, llvmorg-16.0.6, llvmorg-16.0.5
# 68f58812 26-May-2023 Tres Popp <tpopp@google.com>

[mlir] Move casting calls from methods to function calls

The MLIR classes Type/Attribute/Operation/Op/Value support
cast/dyn_cast/isa/dyn_cast_or_null functionality through llvm's doCast
functionali

[mlir] Move casting calls from methods to function calls

The MLIR classes Type/Attribute/Operation/Op/Value support
cast/dyn_cast/isa/dyn_cast_or_null functionality through llvm's doCast
functionality in addition to defining methods with the same name.
This change begins the migration of uses of the method to the
corresponding function call as has been decided as more consistent.

Note that there still exist classes that only define methods directly,
such as AffineExpr, and this does not include work currently to support
a functional cast/isa call.

Context:
- https://mlir.llvm.org/deprecation/ at "Use the free function variants
for dyn_cast/cast/isa/…"
- Original discussion at https://discourse.llvm.org/t/preferred-casting-style-going-forward/68443

Implementation:
This patch updates all remaining uses of the deprecated functionality in
mlir/. This was done with clang-tidy as described below and further
modifications to GPUBase.td and OpenMPOpsInterfaces.td.

Steps are described per line, as comments are removed by git:
0. Retrieve the change from the following to build clang-tidy with an
additional check:
main...tpopp:llvm-project:tidy-cast-check
1. Build clang-tidy
2. Run clang-tidy over your entire codebase while disabling all checks
and enabling the one relevant one. Run on all header files also.
3. Delete .inc files that were also modified, so the next build rebuilds
them to a pure state.

```
ninja -C $BUILD_DIR clang-tidy

run-clang-tidy -clang-tidy-binary=$BUILD_DIR/bin/clang-tidy -checks='-*,misc-cast-functions'\
-header-filter=mlir/ mlir/* -fix

rm -rf $BUILD_DIR/tools/mlir/**/*.inc
```

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

show more ...


# e0537d1a 24-May-2023 Tai Ly <tai.ly@arm.com>

[TOSA] Refactor TosaMakeBroadcastable pass

This refactors and exposes EqualizeRanks utility function
from within TosaMakeBroadcastable pass so it may be used to
reshape operator inputs to equal rank

[TOSA] Refactor TosaMakeBroadcastable pass

This refactors and exposes EqualizeRanks utility function
from within TosaMakeBroadcastable pass so it may be used to
reshape operator inputs to equal ranks.

Signed-off-by: Tai Ly <tai.ly@arm.com>

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

show more ...


Revision tags: llvmorg-16.0.4, llvmorg-16.0.3, llvmorg-16.0.2, llvmorg-16.0.1, llvmorg-16.0.0, llvmorg-16.0.0-rc4, llvmorg-16.0.0-rc3, llvmorg-16.0.0-rc2, llvmorg-16.0.0-rc1, llvmorg-17-init, llvmorg-15.0.7
# 69c984b6 14-Dec-2022 Rob Suderman <suderman@google.com>

[mlir][tosa] Fix padding for tosa.conv2d and tosa.depthwise_conv2d decomposition

Decomposition did not take padding into account when decomposing into fully
connected operation.

Reviewed By: Natash

[mlir][tosa] Fix padding for tosa.conv2d and tosa.depthwise_conv2d decomposition

Decomposition did not take padding into account when decomposing into fully
connected operation.

Reviewed By: NatashaKnk

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

show more ...


# 78503e1a 12-Dec-2022 Rob Suderman <suderman@google.com>

[mlir][tosa] Refactor tosa.resize

Moved to using helper lambdas to avoid code repetition. IR needed to be reordered to
accommodate which should be the only changes to the existing tests.

This chang

[mlir][tosa] Refactor tosa.resize

Moved to using helper lambdas to avoid code repetition. IR needed to be reordered to
accommodate which should be the only changes to the existing tests.

This changes the quantized test to target `i48` types to guarantee types are extended
correctly when necessary.

Reviewed By: jpienaar

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

show more ...


Revision tags: llvmorg-15.0.6, llvmorg-15.0.5
# e6598b05 10-Nov-2022 Oleg Shyshkov <shyshkov@google.com>

Revert "Revert "[mlir][linalg] Replace "string" iterator_types attr with enums in LinalgInterface.""

With python code fixed.

This reverts commit 41280908e43d47903960c66237ab49caa5641b4d.


# 41280908 09-Nov-2022 Oleg Shyshkov <shyshkov@google.com>

Revert "[mlir][linalg] Replace "string" iterator_types attr with enums in LinalgInterface."

Breaks linalg python tests. Would need to also update python/mlir/dialects/linalg/opdsl.

This reverts com

Revert "[mlir][linalg] Replace "string" iterator_types attr with enums in LinalgInterface."

Breaks linalg python tests. Would need to also update python/mlir/dialects/linalg/opdsl.

This reverts commit b809d73973bb5aeedeb6a18cac2a7b3111d0c8d2.

show more ...


# b809d739 09-Nov-2022 Oleg Shyshkov <shyshkov@google.com>

[mlir][linalg] Replace "string" iterator_types attr with enums in LinalgInterface.

[RFC: EnumAttr for iterator types in Linalg](https://discourse.llvm.org/t/rfc-enumattr-for-iterator-types-in-linalg

[mlir][linalg] Replace "string" iterator_types attr with enums in LinalgInterface.

[RFC: EnumAttr for iterator types in Linalg](https://discourse.llvm.org/t/rfc-enumattr-for-iterator-types-in-linalg/64535)

This affect touches and probably breaks most of the code that creates `linalg.generic`. A fix would be to replace calls to `getParallelIteratorTypeName/getReductionIteratorTypeName` with `mlir::utils::IteratorType::parallel/reduction` and types from `StringRef` to `mlir::utils::IteratorType`.

Due to limitations of tablegen, shared C++ definition of IteratorType enum lives in StructuredOpsUtils.td, but each dialect should have it's own EnumAttr wrapper. To avoid conflict, all enums in a dialect are put into a separate file with a separate tablegen rule.

Test dialect td files are refactored a bit.

Printed format of `linalg.generic` temporarily remains unchanged to avoid breaking code and tests in the same change.

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

show more ...


Revision tags: llvmorg-15.0.4, llvmorg-15.0.3, working, llvmorg-15.0.2, llvmorg-15.0.1, llvmorg-15.0.0, llvmorg-15.0.0-rc3
# 444b4fda 15-Aug-2022 Thomas Raoux <thomasraoux@google.com>

[mlir][tosa] Fix clamp float lowering

min and max were mixed up after switching to using float min/max

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


# 2eb50cee 09-Aug-2022 Thomas Raoux <thomasraoux@google.com>

[mlir][tosa] Use arith::maxf/arith::minf in lowering from tosa

now that `arith` dialect has maxf/minf use it instead of cmp/select.
Also refactor clamp helpers to make them simlper.

Reviewed By: rs

[mlir][tosa] Use arith::maxf/arith::minf in lowering from tosa

now that `arith` dialect has maxf/minf use it instead of cmp/select.
Also refactor clamp helpers to make them simlper.

Reviewed By: rsuderman

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

show more ...


Revision tags: llvmorg-15.0.0-rc2, llvmorg-15.0.0-rc1, llvmorg-16-init, llvmorg-14.0.6, llvmorg-14.0.5, llvmorg-14.0.4, llvmorg-14.0.3, llvmorg-14.0.2, llvmorg-14.0.1, llvmorg-14.0.0, llvmorg-14.0.0-rc4, llvmorg-14.0.0-rc3, llvmorg-14.0.0-rc2, llvmorg-14.0.0-rc1, llvmorg-15-init, llvmorg-13.0.1, llvmorg-13.0.1-rc3
# 310e9636 12-Jan-2022 natashaknk <natashaknk@google.com>

[tosa][mlir] Support dynamic batch dimension for ops where the batch dim is explicit

Dynamic batch for rescale, gather, max_pool, avg_pool, conv2D and depthwise_conv2D. Split helper functions into a

[tosa][mlir] Support dynamic batch dimension for ops where the batch dim is explicit

Dynamic batch for rescale, gather, max_pool, avg_pool, conv2D and depthwise_conv2D. Split helper functions into a separate header file.

Reviewed By: rsuderman

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

show more ...