Skip to content

Commit 7c7a68b

Browse files
committed
Use range based for loop and fix typo
1 parent 20d9c53 commit 7c7a68b

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

mlir/lib/Dialect/Tosa/Transforms/TosaFoldConstantReciprocal.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,10 @@ struct TosaFoldConstantReciprocal : public OpRewritePattern<ReciprocalOp> {
4646

4747
// Compute the reciprocal for each tensor element
4848
llvm::SmallVector<APFloat, 1> transformedValues;
49-
// We already know the amount of values we will insert, reserver space for
49+
// We already know the amount of values we will insert, reserve space for
5050
// all of them to avoid dynamic resizing
5151
transformedValues.reserve(inputValues.getNumElements());
52-
for (auto it = inputValues.value_begin<APFloat>();
53-
it != inputValues.value_end<APFloat>(); it++) {
54-
auto val = *it;
52+
for (auto val : inputValues.getValues<APFloat>()) {
5553
auto recipVal = computeReciprocal(val, inputValues.getElementType());
5654
transformedValues.push_back(recipVal);
5755
}

0 commit comments

Comments
 (0)