From 03e6d10cac866e7593845c967d727ce094255909 Mon Sep 17 00:00:00 2001 From: Mehdi Amini Date: Mon, 7 Mar 2022 10:12:47 +0000 Subject: [PATCH] Apply clang-tidy fixes for readability-identifier-naming to MLIR (NFC) --- mlir/lib/Dialect/Shape/IR/Shape.cpp | 22 +++++++++++----------- mlir/lib/ExecutionEngine/CRunnerUtils.cpp | 2 +- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/mlir/lib/Dialect/Shape/IR/Shape.cpp b/mlir/lib/Dialect/Shape/IR/Shape.cpp index 9396cab..4a21081 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 { SmallVector operands; for (Value operand : op.getInputs()) { - if (auto assume_all = operand.getDefiningOp()) - operands.append(assume_all.operand_begin(), assume_all->operand_end()); + if (auto assumeAll = operand.getDefiningOp()) + operands.append(assumeAll.operand_begin(), assumeAll->operand_end()); else operands.push_back(operand); } @@ -530,8 +530,8 @@ struct AssumingAllOfCstrBroadcastable : public OpRewritePattern { // Collect shapes checked by `cstr_broadcastable` operands. SmallVector>> shapes; for (auto cstr : operands) { - DenseSet shapes_set(cstr->operand_begin(), cstr->operand_end()); - shapes.emplace_back(cstr, std::move(shapes_set)); + DenseSet 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 { // 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 marked_for_erase; + SmallVector markedForErase; for (unsigned i = 0; i < shapes.size(); ++i) { auto isSubset = [&](auto pair) { @@ -553,24 +553,24 @@ struct AssumingAllOfCstrBroadcastable : public OpRewritePattern { // 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 unique_constraints; + SmallVector 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(op, unique_constraints); + rewriter.replaceOpWithNewOp(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 da28429..ccdf76b 100644 --- a/mlir/lib/ExecutionEngine/CRunnerUtils.cpp +++ b/mlir/lib/ExecutionEngine/CRunnerUtils.cpp @@ -101,7 +101,7 @@ memrefCopy(int64_t elemSize, UnrankedMemRefType *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); } -- 2.7.4