Skip to content

Commit 75b6df8

Browse files
committed
Minor fixes
* Fix typo * initialize bool to false * remove redundant comment and put a small explanation instead
1 parent 3326d8e commit 75b6df8

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,12 @@ struct TosaFoldConstantMul : public OpRewritePattern<MulOp> {
7575
isa<IntegerType>(resultElementType));
7676
auto resultElementWidth = resultElementType.getIntOrFloatBitWidth();
7777
assert(resultElementWidth >= lhsElemType.getIntOrFloatBitWidth() &&
78-
"The multiplication is expected to have an at least a big output "
78+
"The multiplication is expected to have an at least as big output "
7979
"as input type");
80-
// TODO: To implement shifts > 0, capture the shift value stored in the
81-
// mul here
82-
bool mulOverflowed;
80+
81+
// Compute the multiplication and track if an overflow occurred to enable
82+
// emitting a warning
83+
bool mulOverflowed = false;
8384
auto intMulFun = [&resultElementWidth, &mulOverflowed](
8485
const APInt &first, const APInt &second) {
8586
bool didOverflow;

0 commit comments

Comments
 (0)