Apply clang-tidy fixes for readability-identifier-naming to MLIR (NFC)
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user