[Mlir-commits] [mlir] 59405cd - Apply clang-tidy fixes for readability-identifier-naming in TosaCanonicalizations.cpp (NFC)
Mehdi Amini
llvmlistbot at llvm.org
Thu Oct 13 14:50:23 PDT 2022
Author: Mehdi Amini
Date: 2022-10-13T21:49:18Z
New Revision: 59405cddb8321874875eb8d936a9b688b098055b
URL: https://github.com/llvm/llvm-project/commit/59405cddb8321874875eb8d936a9b688b098055b
DIFF: https://github.com/llvm/llvm-project/commit/59405cddb8321874875eb8d936a9b688b098055b.diff
LOG: Apply clang-tidy fixes for readability-identifier-naming in TosaCanonicalizations.cpp (NFC)
Added:
Modified:
mlir/lib/Dialect/Tosa/IR/TosaCanonicalizations.cpp
Removed:
################################################################################
diff --git a/mlir/lib/Dialect/Tosa/IR/TosaCanonicalizations.cpp b/mlir/lib/Dialect/Tosa/IR/TosaCanonicalizations.cpp
index 57519fd8bfd00..9016e41ee1b7e 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 <typename IntFolder, typename FloatFolder>
-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<ShapedType>().getElementType();
@@ -504,7 +504,7 @@ OpFoldResult AddOp::fold(ArrayRef<Attribute> operands) {
if (!lhsAttr || !rhsAttr)
return {};
- return BinaryFolder<std::plus<APInt>, std::plus<APFloat>>(lhsAttr, rhsAttr,
+ return binaryFolder<std::plus<APInt>, std::plus<APFloat>>(lhsAttr, rhsAttr,
lhsTy);
}
@@ -543,7 +543,7 @@ OpFoldResult DivOp::fold(ArrayRef<Attribute> 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<IntegerType>()) {
@@ -626,7 +626,7 @@ OpFoldResult MulOp::fold(ArrayRef<Attribute> operands) {
return lhs;
}
- return MulBinaryFolder(lhsAttr, rhsAttr, lhsTy, getShift());
+ return mulBinaryFolder(lhsAttr, rhsAttr, lhsTy, getShift());
}
OpFoldResult SubOp::fold(ArrayRef<Attribute> operands) {
@@ -655,7 +655,7 @@ OpFoldResult SubOp::fold(ArrayRef<Attribute> operands) {
if (!lhsAttr || !rhsAttr)
return {};
- return BinaryFolder<std::minus<APInt>, std::minus<APFloat>>(lhsAttr, rhsAttr,
+ return binaryFolder<std::minus<APInt>, std::minus<APFloat>>(lhsAttr, rhsAttr,
lhsTy);
}
@@ -695,7 +695,7 @@ OpFoldResult GreaterOp::fold(ArrayRef<Attribute> operands) {
if (!lhsAttr || !rhsAttr)
return {};
- return BinaryFolder<APIntFoldGreater, ComparisonFold<std::greater<APFloat>>>(
+ return binaryFolder<APIntFoldGreater, ComparisonFold<std::greater<APFloat>>>(
lhsAttr, rhsAttr, resultTy);
}
@@ -707,7 +707,7 @@ OpFoldResult GreaterEqualOp::fold(ArrayRef<Attribute> operands) {
if (!lhsAttr || !rhsAttr)
return {};
- return BinaryFolder<APIntFoldGreaterEqual,
+ return binaryFolder<APIntFoldGreaterEqual,
ComparisonFold<std::greater_equal<APFloat>>>(
lhsAttr, rhsAttr, resultTy);
}
@@ -730,7 +730,7 @@ OpFoldResult EqualOp::fold(ArrayRef<Attribute> operands) {
if (!lhsAttr || !rhsAttr)
return {};
- return BinaryFolder<ComparisonFold<std::equal_to<APInt>>,
+ return binaryFolder<ComparisonFold<std::equal_to<APInt>>,
ComparisonFold<std::equal_to<APFloat>>>(lhsAttr, rhsAttr,
resultTy);
}
More information about the Mlir-commits
mailing list