[Mlir-commits] [mlir] [mlir][tosa] Add row_gather operator (PR #202895)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Wed Jun 10 01:51:42 PDT 2026
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 origin/main HEAD --extensions inc,cpp,h -- mlir/include/mlir/Dialect/Tosa/IR/TosaComplianceData.h.inc mlir/include/mlir/Dialect/Tosa/Utils/ConversionUtils.h mlir/lib/Dialect/Tosa/IR/TosaCanonicalizations.cpp mlir/lib/Dialect/Tosa/IR/TosaOps.cpp mlir/lib/Dialect/Tosa/Transforms/TosaProfileCompliance.cpp mlir/lib/Dialect/Tosa/Transforms/TosaValidation.cpp mlir/lib/Dialect/Tosa/Utils/ConversionUtils.cpp --diff_from_common_commit
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/mlir/lib/Dialect/Tosa/IR/TosaCanonicalizations.cpp b/mlir/lib/Dialect/Tosa/IR/TosaCanonicalizations.cpp
index 20463bdb3..20f9d002f 100644
--- a/mlir/lib/Dialect/Tosa/IR/TosaCanonicalizations.cpp
+++ b/mlir/lib/Dialect/Tosa/IR/TosaCanonicalizations.cpp
@@ -1243,7 +1243,8 @@ struct RowGatherToGather : public OpRewritePattern<tosa::RowGatherOp> {
LogicalResult matchAndRewrite(tosa::RowGatherOp op,
PatternRewriter &rewriter) const override {
- const FailureOr<int32_t> rowCount = mlir::tosa::getConstantScalarIntValue<int32_t>(op.getRowCount());
+ const FailureOr<int32_t> rowCount =
+ mlir::tosa::getConstantScalarIntValue<int32_t>(op.getRowCount());
if (failed(rowCount) || rowCount.value() != 1)
return failure();
diff --git a/mlir/lib/Dialect/Tosa/IR/TosaOps.cpp b/mlir/lib/Dialect/Tosa/IR/TosaOps.cpp
index 83c537309..c10fa69e3 100644
--- a/mlir/lib/Dialect/Tosa/IR/TosaOps.cpp
+++ b/mlir/lib/Dialect/Tosa/IR/TosaOps.cpp
@@ -3426,7 +3426,8 @@ LogicalResult tosa::RowGatherBlockScaledOp::inferReturnTypeComponents(
if (dataShape[0] == ShapedType::kDynamic)
dataShape[0] = indicesShape.getDimSize(0);
- if (auto rowCount = getConstantScalarIntValue<int32_t>(adaptor.getRowCount());
+ if (auto rowCount =
+ getConstantScalarIntValue<int32_t>(adaptor.getRowCount());
succeeded(rowCount) && rowCount.value() > 0) {
const int64_t indicesW = indicesShape.getDimSize(1);
if (ShapedType::isStatic(indicesW))
``````````
</details>
https://github.com/llvm/llvm-project/pull/202895
More information about the Mlir-commits
mailing list