diff options
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); |
