[Mlir-commits] [mlir] 03e6d10 - Apply clang-tidy fixes for readability-identifier-naming to MLIR (NFC)
Mehdi Amini
llvmlistbot at llvm.org
Mon Mar 7 02:42:10 PST 2022
Author: Mehdi Amini
Date: 2022-03-07T10:41:45Z
New Revision: 03e6d10cac866e7593845c967d727ce094255909
URL: https://github.com/llvm/llvm-project/commit/03e6d10cac866e7593845c967d727ce094255909
DIFF: https://github.com/llvm/llvm-project/commit/03e6d10cac866e7593845c967d727ce094255909.diff
LOG: Apply clang-tidy fixes for readability-identifier-naming to MLIR (NFC)
Added:
Modified:
mlir/lib/Dialect/Shape/IR/Shape.cpp
mlir/lib/ExecutionEngine/CRunnerUtils.cpp
Removed:
################################################################################
diff --git a/mlir/lib/Dialect/Shape/IR/Shape.cpp b/mlir/lib/Dialect/Shape/IR/Shape.cpp
index 9396cab054701..4a2108107a329 100644
--- a/mlir/lib/Dialect/Shape/IR/Shape.cpp
+++ b/mlir/lib/Dialect/Shape/IR/Shape.cpp
@@ -469,8 +469,8 @@ struct MergeAssumingAllOps : public OpRewritePattern<AssumingAllOp> {
SmallVector<Value> operands;
for (Value operand : op.getInputs()) {
- if (auto assume_all = operand.getDefiningOp<AssumingAllOp>())
- operands.append(assume_all.operand_begin(), assume_all->operand_end());
+ if (auto assumeAll = operand.getDefiningOp<AssumingAllOp>())
+ operands.append(assumeAll.operand_begin(), assumeAll->operand_end());
else
operands.push_back(operand);
}
@@ -530,8 +530,8 @@ struct AssumingAllOfCstrBroadcastable : public OpRewritePattern<AssumingAllOp> {
// Collect shapes checked by `cstr_broadcastable` operands.
SmallVector<std::pair<CstrBroadcastableOp, DenseSet<Value>>> shapes;
for (auto cstr : operands) {
- DenseSet<Value> shapes_set(cstr->operand_begin(), cstr->operand_end());
- shapes.emplace_back(cstr, std::move(shapes_set));
+ DenseSet<Value> shapesSet(cstr->operand_begin(), cstr->operand_end());
+ shapes.emplace_back(cstr, std::move(shapesSet));
}
// Sort by the number of shape operands (larger to smaller).
@@ -543,7 +543,7 @@ struct AssumingAllOfCstrBroadcastable : public OpRewritePattern<AssumingAllOp> {
// shape operands, and remove redundant `cst_broadcastable` operations. We
// do this until we find a set of `cst_broadcastable` operations with
// non-overlapping constraints.
- SmallVector<CstrBroadcastableOp> marked_for_erase;
+ SmallVector<CstrBroadcastableOp> markedForErase;
for (unsigned i = 0; i < shapes.size(); ++i) {
auto isSubset = [&](auto pair) {
@@ -553,24 +553,24 @@ struct AssumingAllOfCstrBroadcastable : public OpRewritePattern<AssumingAllOp> {
// Keep redundant `cstr_broadcastable` operations to be erased.
auto *it = std::remove_if(shapes.begin() + i + 1, shapes.end(), isSubset);
for (auto *it0 = it; it0 < shapes.end(); ++it0)
- marked_for_erase.push_back(it0->first);
+ markedForErase.push_back(it0->first);
shapes.erase(it, shapes.end());
}
// We didn't find any operands that could be removed.
- if (marked_for_erase.empty())
+ if (markedForErase.empty())
return failure();
// Collect non-overlapping `cst_broadcastable` constraints.
- SmallVector<Value> unique_constraints;
+ SmallVector<Value> uniqueConstraints;
for (auto &shape : shapes)
- unique_constraints.push_back(shape.first.getResult());
+ uniqueConstraints.push_back(shape.first.getResult());
// Replace with a new `assuming_all` operation ...
- rewriter.replaceOpWithNewOp<AssumingAllOp>(op, unique_constraints);
+ rewriter.replaceOpWithNewOp<AssumingAllOp>(op, uniqueConstraints);
// ... and maybe erase `cstr_broadcastable` ops without uses.
- for (auto &op : marked_for_erase)
+ for (auto &op : markedForErase)
if (op->use_empty())
rewriter.eraseOp(op);
diff --git a/mlir/lib/ExecutionEngine/CRunnerUtils.cpp b/mlir/lib/ExecutionEngine/CRunnerUtils.cpp
index da284294df373..ccdf76b58cfb0 100644
--- a/mlir/lib/ExecutionEngine/CRunnerUtils.cpp
+++ b/mlir/lib/ExecutionEngine/CRunnerUtils.cpp
@@ -101,7 +101,7 @@ memrefCopy(int64_t elemSize, UnrankedMemRefType<char> *srcArg,
}
/// Prints GFLOPS rating.
-extern "C" void print_flops(double flops) {
+extern "C" void printFlops(double flops) {
fprintf(stderr, "%lf GFLOPS\n", flops / 1.0E9);
}
More information about the Mlir-commits
mailing list