[Mlir-commits] [mlir] [mlir] Bug fixes in TOSA shape inference pass (PR #104146)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Wed Aug 14 11:40:04 PDT 2024
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff eae1d65f3435b1399e1468cb27bfe745f95d4df2 b0bec6e5be64d7a2571bc86ae20ef9361bf7ece2 --extensions cpp -- mlir/lib/Dialect/Tosa/Transforms/TosaInferShapes.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/mlir/lib/Dialect/Tosa/Transforms/TosaInferShapes.cpp b/mlir/lib/Dialect/Tosa/Transforms/TosaInferShapes.cpp
index 90c40c09d7..bab60d8ab6 100644
--- a/mlir/lib/Dialect/Tosa/Transforms/TosaInferShapes.cpp
+++ b/mlir/lib/Dialect/Tosa/Transforms/TosaInferShapes.cpp
@@ -92,17 +92,14 @@ public:
// iterator used to traverse op uses, so it is important to make a copy of
// these first.
llvm::SmallVector<OpOperand *> uses = llvm::map_to_vector(
- value.getUses(),
- [](OpOperand &use) -> OpOperand * {
- return &use;
- });
+ value.getUses(), [](OpOperand &use) -> OpOperand * { return &use; });
// A 'tensor.cast' op is emitted only if needed. Once emitted, it is
// cached and reused by all consumers.
tensor::CastOp castValue;
// Traverse all uses
- for (OpOperand* use : uses) {
+ for (OpOperand *use : uses) {
if (canBeRefined(use->getOwner()))
continue;
@@ -113,8 +110,8 @@ public:
// they appear in the use list.
OpBuilder builder{value.getContext()};
builder.setInsertionPointAfter(value.getDefiningOp());
- castValue = builder.create<tensor::CastOp>(
- value.getLoc(), oldType, value);
+ castValue =
+ builder.create<tensor::CastOp>(value.getLoc(), oldType, value);
}
use->set(castValue);
``````````
</details>
https://github.com/llvm/llvm-project/pull/104146
More information about the Mlir-commits
mailing list