diff options
| author | NAKAMURA Takumi <geek4civic@gmail.com> | 2025-01-09 18:49:54 +0900 |
|---|---|---|
| committer | NAKAMURA Takumi <geek4civic@gmail.com> | 2025-01-09 18:49:54 +0900 |
| commit | e2810c9a248f4c7fbfae84bb32b6f7e01027458b (patch) | |
| tree | ae0b02a8491b969a1cee94ea16ffe42c559143c5 /mlir/lib/Conversion/TosaToTensor/TosaToTensor.cpp | |
| parent | fa04eb4af95c1ca7377279728cb004bcd2324d01 (diff) | |
| parent | bdcf47e4bcb92889665825654bb80a8bbe30379e (diff) | |
Merge branch 'users/chapuni/cov/single/base' into users/chapuni/cov/single/switchusers/chapuni/cov/single/switch
Diffstat (limited to 'mlir/lib/Conversion/TosaToTensor/TosaToTensor.cpp')
| -rw-r--r-- | mlir/lib/Conversion/TosaToTensor/TosaToTensor.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/mlir/lib/Conversion/TosaToTensor/TosaToTensor.cpp b/mlir/lib/Conversion/TosaToTensor/TosaToTensor.cpp index 6f085cb6ed06..b5a0da15e780 100644 --- a/mlir/lib/Conversion/TosaToTensor/TosaToTensor.cpp +++ b/mlir/lib/Conversion/TosaToTensor/TosaToTensor.cpp @@ -338,11 +338,6 @@ public: padOp, "tosa.pad was unable to determine the pad constant value."); } - Value lowIndex = - rewriter.create<arith::ConstantOp>(loc, rewriter.getIndexAttr(0)); - Value highIndex = - rewriter.create<arith::ConstantOp>(loc, rewriter.getIndexAttr(1)); - SmallVector<OpFoldResult, 3> lowValues; SmallVector<OpFoldResult, 3> highValues; @@ -350,11 +345,12 @@ public: highValues.reserve(rank); for (int i = 0; i < rank; i++) { - Value inputIndex = rewriter.create<arith::ConstantIndexOp>(loc, i); + Value lowIndex = rewriter.create<arith::ConstantIndexOp>(loc, 2 * i); + Value highIndex = rewriter.create<arith::ConstantIndexOp>(loc, 2 * i + 1); Value lowVal = rewriter.createOrFold<tensor::ExtractOp>( - loc, padding, ValueRange({inputIndex, lowIndex})); + loc, padding, ValueRange({lowIndex})); Value highVal = rewriter.createOrFold<tensor::ExtractOp>( - loc, padding, ValueRange({inputIndex, highIndex})); + loc, padding, ValueRange({highIndex})); lowVal = rewriter.createOrFold<arith::IndexCastOp>( loc, rewriter.getIndexType(), lowVal); |
