diff --git a/mlir/lib/Dialect/Tosa/IR/TosaCanonicalizations.cpp b/mlir/lib/Dialect/Tosa/IR/TosaCanonicalizations.cpp index 57519fd8bfd0..9016e41ee1b7 100644 --- a/mlir/lib/Dialect/Tosa/IR/TosaCanonicalizations.cpp +++ b/mlir/lib/Dialect/Tosa/IR/TosaCanonicalizations.cpp @@ -442,7 +442,7 @@ void ClampOp::getCanonicalizationPatterns(RewritePatternSet &results, //===----------------------------------------------------------------------===// template -DenseElementsAttr BinaryFolder(DenseElementsAttr lhs, DenseElementsAttr rhs, +DenseElementsAttr binaryFolder(DenseElementsAttr lhs, DenseElementsAttr rhs, RankedTensorType returnTy) { if (rhs && lhs && rhs.isSplat() && lhs.isSplat()) { auto lETy = lhs.getType().cast().getElementType(); @@ -504,7 +504,7 @@ OpFoldResult AddOp::fold(ArrayRef operands) { if (!lhsAttr || !rhsAttr) return {}; - return BinaryFolder, std::plus>(lhsAttr, rhsAttr, + return binaryFolder, std::plus>(lhsAttr, rhsAttr, lhsTy); } @@ -543,7 +543,7 @@ OpFoldResult DivOp::fold(ArrayRef operands) { } namespace { -DenseElementsAttr MulBinaryFolder(DenseElementsAttr lhs, DenseElementsAttr rhs, +DenseElementsAttr mulBinaryFolder(DenseElementsAttr lhs, DenseElementsAttr rhs, RankedTensorType ty, int32_t shift) { if (rhs && lhs && rhs.isSplat() && lhs.isSplat()) { if (ty.getElementType().isa()) { @@ -626,7 +626,7 @@ OpFoldResult MulOp::fold(ArrayRef operands) { return lhs; } - return MulBinaryFolder(lhsAttr, rhsAttr, lhsTy, getShift()); + return mulBinaryFolder(lhsAttr, rhsAttr, lhsTy, getShift()); } OpFoldResult SubOp::fold(ArrayRef operands) { @@ -655,7 +655,7 @@ OpFoldResult SubOp::fold(ArrayRef operands) { if (!lhsAttr || !rhsAttr) return {}; - return BinaryFolder, std::minus>(lhsAttr, rhsAttr, + return binaryFolder, std::minus>(lhsAttr, rhsAttr, lhsTy); } @@ -695,7 +695,7 @@ OpFoldResult GreaterOp::fold(ArrayRef operands) { if (!lhsAttr || !rhsAttr) return {}; - return BinaryFolder>>( + return binaryFolder>>( lhsAttr, rhsAttr, resultTy); } @@ -707,7 +707,7 @@ OpFoldResult GreaterEqualOp::fold(ArrayRef operands) { if (!lhsAttr || !rhsAttr) return {}; - return BinaryFolder>>( lhsAttr, rhsAttr, resultTy); } @@ -730,7 +730,7 @@ OpFoldResult EqualOp::fold(ArrayRef operands) { if (!lhsAttr || !rhsAttr) return {}; - return BinaryFolder>, + return binaryFolder>, ComparisonFold>>(lhsAttr, rhsAttr, resultTy); }