[Mlir-commits] [mlir] [mlir][tosa] Fix indexing in TosaToTensor (PR #140903)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Wed May 21 07:07:21 PDT 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-mlir-tosa
Author: Shay Kleiman (shay-kl)
<details>
<summary>Changes</summary>
Changed the indexing used in the extractOp from one that is intended for 0d tensors to one that is intended for 1d tensors.
---
Full diff: https://github.com/llvm/llvm-project/pull/140903.diff
1 Files Affected:
- (modified) mlir/lib/Conversion/TosaToTensor/TosaToTensor.cpp (+1-1)
``````````diff
diff --git a/mlir/lib/Conversion/TosaToTensor/TosaToTensor.cpp b/mlir/lib/Conversion/TosaToTensor/TosaToTensor.cpp
index 5f23a33049f87..6c68a7fc25103 100644
--- a/mlir/lib/Conversion/TosaToTensor/TosaToTensor.cpp
+++ b/mlir/lib/Conversion/TosaToTensor/TosaToTensor.cpp
@@ -362,7 +362,7 @@ class PadConverter : public OpConversionPattern<tosa::PadOp> {
// Setup the default constantAttr.
Value padConstant = rewriter.createOrFold<tensor::ExtractOp>(
- loc, padOp.getPadConst(), ValueRange({}));
+ loc, padOp.getPadConst(), ValueRange({rewriter.create<arith::ConstantIndexOp>(loc, 0)}));
if (!padConstant) {
return rewriter.notifyMatchFailure(
``````````
</details>
https://github.com/llvm/llvm-project/pull/140903
More information about the Mlir-commits
mailing list