[Mlir-commits] [mlir] cac7aab - Apply clang-tidy fixes for readability-identifier-naming to MLIR (NFC)

Mehdi Amini llvmlistbot at llvm.org
Thu Jan 13 18:28:10 PST 2022


Author: Mehdi Amini
Date: 2022-01-14T02:26:28Z
New Revision: cac7aabbd8236bef2909bfc0dbba17644f7aaade

URL: https://github.com/llvm/llvm-project/commit/cac7aabbd8236bef2909bfc0dbba17644f7aaade
DIFF: https://github.com/llvm/llvm-project/commit/cac7aabbd8236bef2909bfc0dbba17644f7aaade.diff

LOG: Apply clang-tidy fixes for readability-identifier-naming to MLIR (NFC)

Added: 
    

Modified: 
    mlir/examples/toy/Ch1/include/toy/AST.h
    mlir/examples/toy/Ch2/include/toy/AST.h
    mlir/examples/toy/Ch3/include/toy/AST.h
    mlir/examples/toy/Ch4/include/toy/AST.h
    mlir/examples/toy/Ch5/include/toy/AST.h
    mlir/examples/toy/Ch6/include/toy/AST.h
    mlir/examples/toy/Ch7/include/toy/AST.h
    mlir/include/mlir/Analysis/Utils.h
    mlir/include/mlir/Dialect/Affine/IR/AffineOps.h
    mlir/include/mlir/Dialect/SPIRV/IR/SPIRVOps.h
    mlir/include/mlir/ExecutionEngine/CRunnerUtils.h
    mlir/include/mlir/ExecutionEngine/ExecutionEngine.h
    mlir/include/mlir/ExecutionEngine/RunnerUtils.h
    mlir/include/mlir/IR/BuiltinOps.h
    mlir/include/mlir/IR/Dominance.h
    mlir/include/mlir/IR/SymbolTable.h
    mlir/include/mlir/Support/DebugStringHelper.h
    mlir/include/mlir/TableGen/GenNameParser.h
    mlir/lib/Conversion/GPUCommon/IndexIntrinsicsOpLowering.h
    mlir/lib/Conversion/GPUCommon/OpToFuncCallLowering.h
    mlir/lib/Parser/Token.h
    mlir/lib/Tools/PDLL/Parser/Lexer.h

Removed: 
    


################################################################################
diff  --git a/mlir/examples/toy/Ch1/include/toy/AST.h b/mlir/examples/toy/Ch1/include/toy/AST.h
index 962a1624be88e..7f45530a45e47 100644
--- a/mlir/examples/toy/Ch1/include/toy/AST.h
+++ b/mlir/examples/toy/Ch1/include/toy/AST.h
@@ -62,13 +62,13 @@ using ExprASTList = std::vector<std::unique_ptr<ExprAST>>;
 
 /// Expression class for numeric literals like "1.0".
 class NumberExprAST : public ExprAST {
-  double Val;
+  double val;
 
 public:
   NumberExprAST(Location loc, double val)
-      : ExprAST(Expr_Num, std::move(loc)), Val(val) {}
+      : ExprAST(Expr_Num, std::move(loc)), val(val) {}
 
-  double getValue() { return Val; }
+  double getValue() { return val; }
 
   /// LLVM style RTTI
   static bool classof(const ExprAST *c) { return c->getKind() == Expr_Num; }
@@ -154,9 +154,9 @@ class BinaryExprAST : public ExprAST {
   ExprAST *getLHS() { return lhs.get(); }
   ExprAST *getRHS() { return rhs.get(); }
 
-  BinaryExprAST(Location loc, char Op, std::unique_ptr<ExprAST> lhs,
+  BinaryExprAST(Location loc, char op, std::unique_ptr<ExprAST> lhs,
                 std::unique_ptr<ExprAST> rhs)
-      : ExprAST(Expr_BinOp, std::move(loc)), op(Op), lhs(std::move(lhs)),
+      : ExprAST(Expr_BinOp, std::move(loc)), op(op), lhs(std::move(lhs)),
         rhs(std::move(rhs)) {}
 
   /// LLVM style RTTI

diff  --git a/mlir/examples/toy/Ch2/include/toy/AST.h b/mlir/examples/toy/Ch2/include/toy/AST.h
index 962a1624be88e..7f45530a45e47 100644
--- a/mlir/examples/toy/Ch2/include/toy/AST.h
+++ b/mlir/examples/toy/Ch2/include/toy/AST.h
@@ -62,13 +62,13 @@ using ExprASTList = std::vector<std::unique_ptr<ExprAST>>;
 
 /// Expression class for numeric literals like "1.0".
 class NumberExprAST : public ExprAST {
-  double Val;
+  double val;
 
 public:
   NumberExprAST(Location loc, double val)
-      : ExprAST(Expr_Num, std::move(loc)), Val(val) {}
+      : ExprAST(Expr_Num, std::move(loc)), val(val) {}
 
-  double getValue() { return Val; }
+  double getValue() { return val; }
 
   /// LLVM style RTTI
   static bool classof(const ExprAST *c) { return c->getKind() == Expr_Num; }
@@ -154,9 +154,9 @@ class BinaryExprAST : public ExprAST {
   ExprAST *getLHS() { return lhs.get(); }
   ExprAST *getRHS() { return rhs.get(); }
 
-  BinaryExprAST(Location loc, char Op, std::unique_ptr<ExprAST> lhs,
+  BinaryExprAST(Location loc, char op, std::unique_ptr<ExprAST> lhs,
                 std::unique_ptr<ExprAST> rhs)
-      : ExprAST(Expr_BinOp, std::move(loc)), op(Op), lhs(std::move(lhs)),
+      : ExprAST(Expr_BinOp, std::move(loc)), op(op), lhs(std::move(lhs)),
         rhs(std::move(rhs)) {}
 
   /// LLVM style RTTI

diff  --git a/mlir/examples/toy/Ch3/include/toy/AST.h b/mlir/examples/toy/Ch3/include/toy/AST.h
index 962a1624be88e..7f45530a45e47 100644
--- a/mlir/examples/toy/Ch3/include/toy/AST.h
+++ b/mlir/examples/toy/Ch3/include/toy/AST.h
@@ -62,13 +62,13 @@ using ExprASTList = std::vector<std::unique_ptr<ExprAST>>;
 
 /// Expression class for numeric literals like "1.0".
 class NumberExprAST : public ExprAST {
-  double Val;
+  double val;
 
 public:
   NumberExprAST(Location loc, double val)
-      : ExprAST(Expr_Num, std::move(loc)), Val(val) {}
+      : ExprAST(Expr_Num, std::move(loc)), val(val) {}
 
-  double getValue() { return Val; }
+  double getValue() { return val; }
 
   /// LLVM style RTTI
   static bool classof(const ExprAST *c) { return c->getKind() == Expr_Num; }
@@ -154,9 +154,9 @@ class BinaryExprAST : public ExprAST {
   ExprAST *getLHS() { return lhs.get(); }
   ExprAST *getRHS() { return rhs.get(); }
 
-  BinaryExprAST(Location loc, char Op, std::unique_ptr<ExprAST> lhs,
+  BinaryExprAST(Location loc, char op, std::unique_ptr<ExprAST> lhs,
                 std::unique_ptr<ExprAST> rhs)
-      : ExprAST(Expr_BinOp, std::move(loc)), op(Op), lhs(std::move(lhs)),
+      : ExprAST(Expr_BinOp, std::move(loc)), op(op), lhs(std::move(lhs)),
         rhs(std::move(rhs)) {}
 
   /// LLVM style RTTI

diff  --git a/mlir/examples/toy/Ch4/include/toy/AST.h b/mlir/examples/toy/Ch4/include/toy/AST.h
index 962a1624be88e..7f45530a45e47 100644
--- a/mlir/examples/toy/Ch4/include/toy/AST.h
+++ b/mlir/examples/toy/Ch4/include/toy/AST.h
@@ -62,13 +62,13 @@ using ExprASTList = std::vector<std::unique_ptr<ExprAST>>;
 
 /// Expression class for numeric literals like "1.0".
 class NumberExprAST : public ExprAST {
-  double Val;
+  double val;
 
 public:
   NumberExprAST(Location loc, double val)
-      : ExprAST(Expr_Num, std::move(loc)), Val(val) {}
+      : ExprAST(Expr_Num, std::move(loc)), val(val) {}
 
-  double getValue() { return Val; }
+  double getValue() { return val; }
 
   /// LLVM style RTTI
   static bool classof(const ExprAST *c) { return c->getKind() == Expr_Num; }
@@ -154,9 +154,9 @@ class BinaryExprAST : public ExprAST {
   ExprAST *getLHS() { return lhs.get(); }
   ExprAST *getRHS() { return rhs.get(); }
 
-  BinaryExprAST(Location loc, char Op, std::unique_ptr<ExprAST> lhs,
+  BinaryExprAST(Location loc, char op, std::unique_ptr<ExprAST> lhs,
                 std::unique_ptr<ExprAST> rhs)
-      : ExprAST(Expr_BinOp, std::move(loc)), op(Op), lhs(std::move(lhs)),
+      : ExprAST(Expr_BinOp, std::move(loc)), op(op), lhs(std::move(lhs)),
         rhs(std::move(rhs)) {}
 
   /// LLVM style RTTI

diff  --git a/mlir/examples/toy/Ch5/include/toy/AST.h b/mlir/examples/toy/Ch5/include/toy/AST.h
index 962a1624be88e..7f45530a45e47 100644
--- a/mlir/examples/toy/Ch5/include/toy/AST.h
+++ b/mlir/examples/toy/Ch5/include/toy/AST.h
@@ -62,13 +62,13 @@ using ExprASTList = std::vector<std::unique_ptr<ExprAST>>;
 
 /// Expression class for numeric literals like "1.0".
 class NumberExprAST : public ExprAST {
-  double Val;
+  double val;
 
 public:
   NumberExprAST(Location loc, double val)
-      : ExprAST(Expr_Num, std::move(loc)), Val(val) {}
+      : ExprAST(Expr_Num, std::move(loc)), val(val) {}
 
-  double getValue() { return Val; }
+  double getValue() { return val; }
 
   /// LLVM style RTTI
   static bool classof(const ExprAST *c) { return c->getKind() == Expr_Num; }
@@ -154,9 +154,9 @@ class BinaryExprAST : public ExprAST {
   ExprAST *getLHS() { return lhs.get(); }
   ExprAST *getRHS() { return rhs.get(); }
 
-  BinaryExprAST(Location loc, char Op, std::unique_ptr<ExprAST> lhs,
+  BinaryExprAST(Location loc, char op, std::unique_ptr<ExprAST> lhs,
                 std::unique_ptr<ExprAST> rhs)
-      : ExprAST(Expr_BinOp, std::move(loc)), op(Op), lhs(std::move(lhs)),
+      : ExprAST(Expr_BinOp, std::move(loc)), op(op), lhs(std::move(lhs)),
         rhs(std::move(rhs)) {}
 
   /// LLVM style RTTI

diff  --git a/mlir/examples/toy/Ch6/include/toy/AST.h b/mlir/examples/toy/Ch6/include/toy/AST.h
index 962a1624be88e..7f45530a45e47 100644
--- a/mlir/examples/toy/Ch6/include/toy/AST.h
+++ b/mlir/examples/toy/Ch6/include/toy/AST.h
@@ -62,13 +62,13 @@ using ExprASTList = std::vector<std::unique_ptr<ExprAST>>;
 
 /// Expression class for numeric literals like "1.0".
 class NumberExprAST : public ExprAST {
-  double Val;
+  double val;
 
 public:
   NumberExprAST(Location loc, double val)
-      : ExprAST(Expr_Num, std::move(loc)), Val(val) {}
+      : ExprAST(Expr_Num, std::move(loc)), val(val) {}
 
-  double getValue() { return Val; }
+  double getValue() { return val; }
 
   /// LLVM style RTTI
   static bool classof(const ExprAST *c) { return c->getKind() == Expr_Num; }
@@ -154,9 +154,9 @@ class BinaryExprAST : public ExprAST {
   ExprAST *getLHS() { return lhs.get(); }
   ExprAST *getRHS() { return rhs.get(); }
 
-  BinaryExprAST(Location loc, char Op, std::unique_ptr<ExprAST> lhs,
+  BinaryExprAST(Location loc, char op, std::unique_ptr<ExprAST> lhs,
                 std::unique_ptr<ExprAST> rhs)
-      : ExprAST(Expr_BinOp, std::move(loc)), op(Op), lhs(std::move(lhs)),
+      : ExprAST(Expr_BinOp, std::move(loc)), op(op), lhs(std::move(lhs)),
         rhs(std::move(rhs)) {}
 
   /// LLVM style RTTI

diff  --git a/mlir/examples/toy/Ch7/include/toy/AST.h b/mlir/examples/toy/Ch7/include/toy/AST.h
index ca4c0df358032..f0f369a3fa01b 100644
--- a/mlir/examples/toy/Ch7/include/toy/AST.h
+++ b/mlir/examples/toy/Ch7/include/toy/AST.h
@@ -64,13 +64,13 @@ using ExprASTList = std::vector<std::unique_ptr<ExprAST>>;
 
 /// Expression class for numeric literals like "1.0".
 class NumberExprAST : public ExprAST {
-  double Val;
+  double val;
 
 public:
   NumberExprAST(Location loc, double val)
-      : ExprAST(Expr_Num, std::move(loc)), Val(val) {}
+      : ExprAST(Expr_Num, std::move(loc)), val(val) {}
 
-  double getValue() { return Val; }
+  double getValue() { return val; }
 
   /// LLVM style RTTI
   static bool classof(const ExprAST *c) { return c->getKind() == Expr_Num; }
@@ -174,9 +174,9 @@ class BinaryExprAST : public ExprAST {
   ExprAST *getLHS() { return lhs.get(); }
   ExprAST *getRHS() { return rhs.get(); }
 
-  BinaryExprAST(Location loc, char Op, std::unique_ptr<ExprAST> lhs,
+  BinaryExprAST(Location loc, char op, std::unique_ptr<ExprAST> lhs,
                 std::unique_ptr<ExprAST> rhs)
-      : ExprAST(Expr_BinOp, std::move(loc)), op(Op), lhs(std::move(lhs)),
+      : ExprAST(Expr_BinOp, std::move(loc)), op(op), lhs(std::move(lhs)),
         rhs(std::move(rhs)) {}
 
   /// LLVM style RTTI
@@ -264,8 +264,8 @@ class FunctionAST : public RecordAST {
   ExprASTList *getBody() { return body.get(); }
 
   /// LLVM style RTTI
-  static bool classof(const RecordAST *R) {
-    return R->getKind() == Record_Function;
+  static bool classof(const RecordAST *r) {
+    return r->getKind() == Record_Function;
   }
 };
 
@@ -288,8 +288,8 @@ class StructAST : public RecordAST {
   }
 
   /// LLVM style RTTI
-  static bool classof(const RecordAST *R) {
-    return R->getKind() == Record_Struct;
+  static bool classof(const RecordAST *r) {
+    return r->getKind() == Record_Struct;
   }
 };
 

diff  --git a/mlir/include/mlir/Analysis/Utils.h b/mlir/include/mlir/Analysis/Utils.h
index ee231e1713e0c..fb586af7d7d56 100644
--- a/mlir/include/mlir/Analysis/Utils.h
+++ b/mlir/include/mlir/Analysis/Utils.h
@@ -362,7 +362,7 @@ LogicalResult boundCheckLoadOrStoreOp(LoadOrStoreOpPointer loadOrStoreOp,
                                       bool emitError = true);
 
 /// Returns the number of surrounding loops common to both A and B.
-unsigned getNumCommonSurroundingLoops(Operation &A, Operation &B);
+unsigned getNumCommonSurroundingLoops(Operation &a, Operation &b);
 
 /// Gets the memory footprint of all data touched in the specified memory space
 /// in bytes; if the memory space is unspecified, considers all memory spaces.

diff  --git a/mlir/include/mlir/Dialect/Affine/IR/AffineOps.h b/mlir/include/mlir/Dialect/Affine/IR/AffineOps.h
index 72b41b58b0e65..c350a53b1fb77 100644
--- a/mlir/include/mlir/Dialect/Affine/IR/AffineOps.h
+++ b/mlir/include/mlir/Dialect/Affine/IR/AffineOps.h
@@ -440,9 +440,9 @@ class AffineBound {
   using operand_iterator = AffineForOp::operand_iterator;
   using operand_range = AffineForOp::operand_range;
 
-  operand_iterator operand_begin() { return op.operand_begin() + opStart; }
-  operand_iterator operand_end() { return op.operand_begin() + opEnd; }
-  operand_range getOperands() { return {operand_begin(), operand_end()}; }
+  operand_iterator operandBegin() { return op.operand_begin() + opStart; }
+  operand_iterator operandEnd() { return op.operand_begin() + opEnd; }
+  operand_range getOperands() { return {operandBegin(), operandEnd()}; }
 
 private:
   // 'affine.for' operation that contains this bound.

diff  --git a/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVOps.h b/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVOps.h
index 2e01ff236b524..8806d1dbffd95 100644
--- a/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVOps.h
+++ b/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVOps.h
@@ -45,13 +45,13 @@ namespace llvm {
 template <>
 struct PointerLikeTypeTraits<mlir::spirv::FuncOp> {
 public:
-  static inline void *getAsVoidPointer(mlir::spirv::FuncOp I) {
-    return const_cast<void *>(I.getAsOpaquePointer());
+  static inline void *getAsVoidPointer(mlir::spirv::FuncOp i) {
+    return const_cast<void *>(i.getAsOpaquePointer());
   }
-  static inline mlir::spirv::FuncOp getFromVoidPointer(void *P) {
-    return mlir::spirv::FuncOp::getFromOpaquePointer(P);
+  static inline mlir::spirv::FuncOp getFromVoidPointer(void *p) {
+    return mlir::spirv::FuncOp::getFromOpaquePointer(p);
   }
-  static constexpr int NumLowBitsAvailable = 3;
+  static constexpr int numLowBitsAvailable = 3;
 };
 
 } // namespace llvm

diff  --git a/mlir/include/mlir/ExecutionEngine/CRunnerUtils.h b/mlir/include/mlir/ExecutionEngine/CRunnerUtils.h
index 8cfc34ef07c4b..44eab5057786e 100644
--- a/mlir/include/mlir/ExecutionEngine/CRunnerUtils.h
+++ b/mlir/include/mlir/ExecutionEngine/CRunnerUtils.h
@@ -43,10 +43,10 @@
 namespace mlir {
 namespace detail {
 
-constexpr bool isPowerOf2(int N) { return (!(N & (N - 1))); }
+constexpr bool isPowerOf2(int n) { return (!(n & (n - 1))); }
 
-constexpr unsigned nextPowerOf2(int N) {
-  return (N <= 1) ? 1 : (isPowerOf2(N) ? N : (2 * nextPowerOf2((N + 1) / 2)));
+constexpr unsigned nextPowerOf2(int n) {
+  return (n <= 1) ? 1 : (isPowerOf2(n) ? n : (2 * nextPowerOf2((n + 1) / 2)));
 }
 
 template <typename T, int Dim, bool IsPowerOf2>
@@ -305,17 +305,16 @@ struct UnrankedMemRefType {
 template <typename T>
 class DynamicMemRefType {
 public:
-  explicit DynamicMemRefType(const StridedMemRefType<T, 0> &mem_ref)
-      : rank(0), basePtr(mem_ref.basePtr), data(mem_ref.data),
-        offset(mem_ref.offset), sizes(nullptr), strides(nullptr) {}
+  explicit DynamicMemRefType(const StridedMemRefType<T, 0> &memRef)
+      : rank(0), basePtr(memRef.basePtr), data(memRef.data),
+        offset(memRef.offset), sizes(nullptr), strides(nullptr) {}
   template <int N>
-  explicit DynamicMemRefType(const StridedMemRefType<T, N> &mem_ref)
-      : rank(N), basePtr(mem_ref.basePtr), data(mem_ref.data),
-        offset(mem_ref.offset), sizes(mem_ref.sizes), strides(mem_ref.strides) {
-  }
-  explicit DynamicMemRefType(const UnrankedMemRefType<T> &mem_ref)
-      : rank(mem_ref.rank) {
-    auto *desc = static_cast<StridedMemRefType<T, 1> *>(mem_ref.descriptor);
+  explicit DynamicMemRefType(const StridedMemRefType<T, N> &memRef)
+      : rank(N), basePtr(memRef.basePtr), data(memRef.data),
+        offset(memRef.offset), sizes(memRef.sizes), strides(memRef.strides) {}
+  explicit DynamicMemRefType(const UnrankedMemRefType<T> &memRef)
+      : rank(memRef.rank) {
+    auto *desc = static_cast<StridedMemRefType<T, 1> *>(memRef.descriptor);
     basePtr = desc->basePtr;
     data = desc->data;
     offset = desc->offset;
@@ -353,7 +352,7 @@ extern "C" MLIR_CRUNNERUTILS_EXPORT void printNewline();
 //===----------------------------------------------------------------------===//
 // Small runtime support library for timing execution and printing GFLOPS
 //===----------------------------------------------------------------------===//
-extern "C" MLIR_CRUNNERUTILS_EXPORT void print_flops(double flops);
+extern "C" MLIR_CRUNNERUTILS_EXPORT void printFlops(double flops);
 extern "C" MLIR_CRUNNERUTILS_EXPORT double rtclock();
 
 #endif // MLIR_EXECUTIONENGINE_CRUNNERUTILS_H

diff  --git a/mlir/include/mlir/ExecutionEngine/ExecutionEngine.h b/mlir/include/mlir/ExecutionEngine/ExecutionEngine.h
index 0b74c115b0bdf..058c55efaaddf 100644
--- a/mlir/include/mlir/ExecutionEngine/ExecutionEngine.h
+++ b/mlir/include/mlir/ExecutionEngine/ExecutionEngine.h
@@ -37,9 +37,9 @@ class ModuleOp;
 /// A simple object cache following Lang's LLJITWithObjectCache example.
 class SimpleObjectCache : public llvm::ObjectCache {
 public:
-  void notifyObjectCompiled(const llvm::Module *M,
-                            llvm::MemoryBufferRef ObjBuffer) override;
-  std::unique_ptr<llvm::MemoryBuffer> getObject(const llvm::Module *M) override;
+  void notifyObjectCompiled(const llvm::Module *m,
+                            llvm::MemoryBufferRef objBuffer) override;
+  std::unique_ptr<llvm::MemoryBuffer> getObject(const llvm::Module *m) override;
 
   /// Dump cached object to output file `filename`.
   void dumpToObjectFile(StringRef filename);

diff  --git a/mlir/include/mlir/ExecutionEngine/RunnerUtils.h b/mlir/include/mlir/ExecutionEngine/RunnerUtils.h
index 61561aae04dc0..c8b7972308ffc 100644
--- a/mlir/include/mlir/ExecutionEngine/RunnerUtils.h
+++ b/mlir/include/mlir/ExecutionEngine/RunnerUtils.h
@@ -38,34 +38,34 @@
 #include "mlir/ExecutionEngine/CRunnerUtils.h"
 
 template <typename T, typename StreamType>
-void printMemRefMetaData(StreamType &os, const DynamicMemRefType<T> &V) {
-  os << "base@ = " << reinterpret_cast<void *>(V.data) << " rank = " << V.rank
-     << " offset = " << V.offset;
+void printMemRefMetaData(StreamType &os, const DynamicMemRefType<T> &v) {
+  os << "base@ = " << reinterpret_cast<void *>(v.data) << " rank = " << v.rank
+     << " offset = " << v.offset;
   auto print = [&](const int64_t *ptr) {
-    if (V.rank == 0)
+    if (v.rank == 0)
       return;
     os << ptr[0];
-    for (int64_t i = 1; i < V.rank; ++i)
+    for (int64_t i = 1; i < v.rank; ++i)
       os << ", " << ptr[i];
   };
   os << " sizes = [";
-  print(V.sizes);
+  print(v.sizes);
   os << "] strides = [";
-  print(V.strides);
+  print(v.strides);
   os << "]";
 }
 
 template <typename StreamType, typename T, int N>
-void printMemRefMetaData(StreamType &os, StridedMemRefType<T, N> &V) {
+void printMemRefMetaData(StreamType &os, StridedMemRefType<T, N> &v) {
   static_assert(N >= 0, "Expected N > 0");
   os << "MemRef ";
-  printMemRefMetaData(os, DynamicMemRefType<T>(V));
+  printMemRefMetaData(os, DynamicMemRefType<T>(v));
 }
 
 template <typename StreamType, typename T>
-void printUnrankedMemRefMetaData(StreamType &os, UnrankedMemRefType<T> &V) {
+void printUnrankedMemRefMetaData(StreamType &os, UnrankedMemRefType<T> &v) {
   os << "Unranked MemRef ";
-  printMemRefMetaData(os, DynamicMemRefType<T>(V));
+  printMemRefMetaData(os, DynamicMemRefType<T>(v));
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -192,39 +192,41 @@ void MemRefDataPrinter<T>::printLast(std::ostream &os, T *base, int64_t dim,
   os << "]";
 }
 
-template <typename T, int N> void printMemRefShape(StridedMemRefType<T, N> &M) {
+template <typename T, int N>
+void printMemRefShape(StridedMemRefType<T, N> &m) {
   std::cout << "Memref ";
-  printMemRefMetaData(std::cout, DynamicMemRefType<T>(M));
+  printMemRefMetaData(std::cout, DynamicMemRefType<T>(m));
 }
 
-template <typename T> void printMemRefShape(UnrankedMemRefType<T> &M) {
+template <typename T>
+void printMemRefShape(UnrankedMemRefType<T> &m) {
   std::cout << "Unranked Memref ";
-  printMemRefMetaData(std::cout, DynamicMemRefType<T>(M));
+  printMemRefMetaData(std::cout, DynamicMemRefType<T>(m));
 }
 
 template <typename T>
-void printMemRef(const DynamicMemRefType<T> &M) {
-  printMemRefMetaData(std::cout, M);
+void printMemRef(const DynamicMemRefType<T> &m) {
+  printMemRefMetaData(std::cout, m);
   std::cout << " data = " << std::endl;
-  if (M.rank == 0)
+  if (m.rank == 0)
     std::cout << "[";
-  MemRefDataPrinter<T>::print(std::cout, M.data, M.rank, M.rank, M.offset,
-                              M.sizes, M.strides);
-  if (M.rank == 0)
+  MemRefDataPrinter<T>::print(std::cout, m.data, m.rank, m.rank, m.offset,
+                              m.sizes, m.strides);
+  if (m.rank == 0)
     std::cout << "]";
   std::cout << std::endl;
 }
 
 template <typename T, int N>
-void printMemRef(StridedMemRefType<T, N> &M) {
+void printMemRef(StridedMemRefType<T, N> &m) {
   std::cout << "Memref ";
-  printMemRef(DynamicMemRefType<T>(M));
+  printMemRef(DynamicMemRefType<T>(m));
 }
 
 template <typename T>
-void printMemRef(UnrankedMemRefType<T> &M) {
+void printMemRef(UnrankedMemRefType<T> &m) {
   std::cout << "Unranked Memref ";
-  printMemRef(DynamicMemRefType<T>(M));
+  printMemRef(DynamicMemRefType<T>(m));
 }
 
 /// Verify the result of two computations are equivalent up to a small
@@ -339,54 +341,49 @@ int64_t verifyMemRef(UnrankedMemRefType<T> &actual,
 // Currently exposed C API.
 ////////////////////////////////////////////////////////////////////////////////
 extern "C" MLIR_RUNNERUTILS_EXPORT void
-_mlir_ciface_print_memref_shape_i8(UnrankedMemRefType<int8_t> *M);
+mlirCifacePrintMemrefShapeI8(UnrankedMemRefType<int8_t> *m);
 extern "C" MLIR_RUNNERUTILS_EXPORT void
-_mlir_ciface_print_memref_shape_i32(UnrankedMemRefType<int32_t> *M);
+mlirCifacePrintMemrefShapeI32(UnrankedMemRefType<int32_t> *m);
 extern "C" MLIR_RUNNERUTILS_EXPORT void
-_mlir_ciface_print_memref_shape_i64(UnrankedMemRefType<int64_t> *M);
+mlirCifacePrintMemrefShapeI64(UnrankedMemRefType<int64_t> *m);
 extern "C" MLIR_RUNNERUTILS_EXPORT void
-_mlir_ciface_print_memref_shape_f32(UnrankedMemRefType<float> *M);
+mlirCifacePrintMemrefShapeF32(UnrankedMemRefType<float> *m);
 extern "C" MLIR_RUNNERUTILS_EXPORT void
-_mlir_ciface_print_memref_shape_f64(UnrankedMemRefType<double> *M);
+mlirCifacePrintMemrefShapeF64(UnrankedMemRefType<double> *m);
 
 extern "C" MLIR_RUNNERUTILS_EXPORT void
-_mlir_ciface_print_memref_i8(UnrankedMemRefType<int8_t> *M);
+mlirCifacePrintMemrefI8(UnrankedMemRefType<int8_t> *m);
 extern "C" MLIR_RUNNERUTILS_EXPORT void
-_mlir_ciface_print_memref_i32(UnrankedMemRefType<int32_t> *M);
+mlirCifacePrintMemrefI32(UnrankedMemRefType<int32_t> *m);
 extern "C" MLIR_RUNNERUTILS_EXPORT void
-_mlir_ciface_print_memref_f32(UnrankedMemRefType<float> *M);
+mlirCifacePrintMemrefF32(UnrankedMemRefType<float> *m);
 extern "C" MLIR_RUNNERUTILS_EXPORT void
-_mlir_ciface_print_memref_f64(UnrankedMemRefType<double> *M);
+mlirCifacePrintMemrefF64(UnrankedMemRefType<double> *m);
 
-extern "C" MLIR_RUNNERUTILS_EXPORT void print_memref_i32(int64_t rank,
-                                                         void *ptr);
-extern "C" MLIR_RUNNERUTILS_EXPORT void print_memref_i64(int64_t rank,
-                                                         void *ptr);
-extern "C" MLIR_RUNNERUTILS_EXPORT void print_memref_f32(int64_t rank,
-                                                         void *ptr);
-extern "C" MLIR_RUNNERUTILS_EXPORT void print_memref_f64(int64_t rank,
-                                                         void *ptr);
+extern "C" MLIR_RUNNERUTILS_EXPORT void printMemrefI32(int64_t rank, void *ptr);
+extern "C" MLIR_RUNNERUTILS_EXPORT void printMemrefI64(int64_t rank, void *ptr);
+extern "C" MLIR_RUNNERUTILS_EXPORT void printMemrefF32(int64_t rank, void *ptr);
+extern "C" MLIR_RUNNERUTILS_EXPORT void printMemrefF64(int64_t rank, void *ptr);
 
 extern "C" MLIR_RUNNERUTILS_EXPORT void
-_mlir_ciface_print_memref_0d_f32(StridedMemRefType<float, 0> *M);
+mlirCifacePrintMemref0dF32(StridedMemRefType<float, 0> *m);
 extern "C" MLIR_RUNNERUTILS_EXPORT void
-_mlir_ciface_print_memref_1d_f32(StridedMemRefType<float, 1> *M);
+mlirCifacePrintMemref1dF32(StridedMemRefType<float, 1> *m);
 extern "C" MLIR_RUNNERUTILS_EXPORT void
-_mlir_ciface_print_memref_2d_f32(StridedMemRefType<float, 2> *M);
+mlirCifacePrintMemref2dF32(StridedMemRefType<float, 2> *m);
 extern "C" MLIR_RUNNERUTILS_EXPORT void
-_mlir_ciface_print_memref_3d_f32(StridedMemRefType<float, 3> *M);
+mlirCifacePrintMemref3dF32(StridedMemRefType<float, 3> *m);
 extern "C" MLIR_RUNNERUTILS_EXPORT void
-_mlir_ciface_print_memref_4d_f32(StridedMemRefType<float, 4> *M);
+mlirCifacePrintMemref4dF32(StridedMemRefType<float, 4> *m);
 
-extern "C" MLIR_RUNNERUTILS_EXPORT void
-_mlir_ciface_print_memref_vector_4x4xf32(
-    StridedMemRefType<Vector2D<4, 4, float>, 2> *M);
+extern "C" MLIR_RUNNERUTILS_EXPORT void mlirCifacePrintMemrefVector4x4xf32(
+    StridedMemRefType<Vector2D<4, 4, float>, 2> *m);
 
-extern "C" MLIR_RUNNERUTILS_EXPORT int64_t _mlir_ciface_verifyMemRefI32(
+extern "C" MLIR_RUNNERUTILS_EXPORT int64_t mlirCifaceVerifyMemRefI32(
     UnrankedMemRefType<int32_t> *actual, UnrankedMemRefType<int32_t> *expected);
-extern "C" MLIR_RUNNERUTILS_EXPORT int64_t _mlir_ciface_verifyMemRefF32(
+extern "C" MLIR_RUNNERUTILS_EXPORT int64_t mlirCifaceVerifyMemRefF32(
     UnrankedMemRefType<float> *actual, UnrankedMemRefType<float> *expected);
-extern "C" MLIR_RUNNERUTILS_EXPORT int64_t _mlir_ciface_verifyMemRefF64(
+extern "C" MLIR_RUNNERUTILS_EXPORT int64_t mlirCifaceVerifyMemRefF64(
     UnrankedMemRefType<double> *actual, UnrankedMemRefType<double> *expected);
 
 extern "C" MLIR_RUNNERUTILS_EXPORT int64_t verifyMemRefI32(int64_t rank,

diff  --git a/mlir/include/mlir/IR/BuiltinOps.h b/mlir/include/mlir/IR/BuiltinOps.h
index 36bc4379b1bda..0021deee0ca36 100644
--- a/mlir/include/mlir/IR/BuiltinOps.h
+++ b/mlir/include/mlir/IR/BuiltinOps.h
@@ -58,7 +58,7 @@ struct PointerLikeTypeTraits<mlir::FuncOp> {
   static inline mlir::FuncOp getFromVoidPointer(void *p) {
     return mlir::FuncOp::getFromOpaquePointer(p);
   }
-  static constexpr int NumLowBitsAvailable = 3;
+  static constexpr int numLowBitsAvailable = 3;
 };
 
 /// Allow stealing the low bits of ModuleOp.
@@ -71,7 +71,7 @@ struct PointerLikeTypeTraits<mlir::ModuleOp> {
   static inline mlir::ModuleOp getFromVoidPointer(void *p) {
     return mlir::ModuleOp::getFromOpaquePointer(p);
   }
-  static constexpr int NumLowBitsAvailable = 3;
+  static constexpr int numLowBitsAvailable = 3;
 };
 } // namespace llvm
 

diff  --git a/mlir/include/mlir/IR/Dominance.h b/mlir/include/mlir/IR/Dominance.h
index d94d5be3c53e5..1aab9fd1fdad2 100644
--- a/mlir/include/mlir/IR/Dominance.h
+++ b/mlir/include/mlir/IR/Dominance.h
@@ -207,9 +207,9 @@ struct GraphTraits<mlir::DominanceInfoNode *> {
   using ChildIteratorType = mlir::DominanceInfoNode::const_iterator;
   using NodeRef = mlir::DominanceInfoNode *;
 
-  static NodeRef getEntryNode(NodeRef N) { return N; }
-  static inline ChildIteratorType child_begin(NodeRef N) { return N->begin(); }
-  static inline ChildIteratorType child_end(NodeRef N) { return N->end(); }
+  static NodeRef getEntryNode(NodeRef n) { return n; }
+  static inline ChildIteratorType childBegin(NodeRef n) { return n->begin(); }
+  static inline ChildIteratorType childEnd(NodeRef n) { return n->end(); }
 };
 
 template <>
@@ -217,9 +217,9 @@ struct GraphTraits<const mlir::DominanceInfoNode *> {
   using ChildIteratorType = mlir::DominanceInfoNode::const_iterator;
   using NodeRef = const mlir::DominanceInfoNode *;
 
-  static NodeRef getEntryNode(NodeRef N) { return N; }
-  static inline ChildIteratorType child_begin(NodeRef N) { return N->begin(); }
-  static inline ChildIteratorType child_end(NodeRef N) { return N->end(); }
+  static NodeRef getEntryNode(NodeRef n) { return n; }
+  static inline ChildIteratorType childBegin(NodeRef n) { return n->begin(); }
+  static inline ChildIteratorType childEnd(NodeRef n) { return n->end(); }
 };
 
 } // namespace llvm

diff  --git a/mlir/include/mlir/IR/SymbolTable.h b/mlir/include/mlir/IR/SymbolTable.h
index c02bcc2ad0482..f1e443ab7a2ea 100644
--- a/mlir/include/mlir/IR/SymbolTable.h
+++ b/mlir/include/mlir/IR/SymbolTable.h
@@ -302,7 +302,7 @@ class SymbolUserMap {
   }
 
   /// Return true if the given symbol has no uses.
-  bool use_empty(Operation *symbol) const {
+  bool useEmpty(Operation *symbol) const {
     return !symbolToUsers.count(symbol);
   }
 

diff  --git a/mlir/include/mlir/Support/DebugStringHelper.h b/mlir/include/mlir/Support/DebugStringHelper.h
index 4a78b3291e4ca..fffc2e3be0aaf 100644
--- a/mlir/include/mlir/Support/DebugStringHelper.h
+++ b/mlir/include/mlir/Support/DebugStringHelper.h
@@ -26,8 +26,8 @@ namespace mlir {
 // Simple helper function that returns a string as printed from a op.
 template <typename T>
 static std::string debugString(T &&op) {
-  std::string instr_str;
-  llvm::raw_string_ostream os(instr_str);
+  std::string instrStr;
+  llvm::raw_string_ostream os(instrStr);
   op.print(os);
   return os.str();
 }

diff  --git a/mlir/include/mlir/TableGen/GenNameParser.h b/mlir/include/mlir/TableGen/GenNameParser.h
index 437306735ab50..208866b29b80e 100644
--- a/mlir/include/mlir/TableGen/GenNameParser.h
+++ b/mlir/include/mlir/TableGen/GenNameParser.h
@@ -23,8 +23,8 @@ class GenInfo;
 struct GenNameParser : public llvm::cl::parser<const GenInfo *> {
   GenNameParser(llvm::cl::Option &opt);
 
-  void printOptionInfo(const llvm::cl::Option &O,
-                       size_t GlobalWidth) const override;
+  void printOptionInfo(const llvm::cl::Option &o,
+                       size_t globalWidth) const override;
 };
 } // namespace mlir
 

diff  --git a/mlir/lib/Conversion/GPUCommon/IndexIntrinsicsOpLowering.h b/mlir/lib/Conversion/GPUCommon/IndexIntrinsicsOpLowering.h
index 416964d4e3db6..3adbaa8f04a81 100644
--- a/mlir/lib/Conversion/GPUCommon/IndexIntrinsicsOpLowering.h
+++ b/mlir/lib/Conversion/GPUCommon/IndexIntrinsicsOpLowering.h
@@ -23,11 +23,11 @@ namespace mlir {
 template <typename Op, typename XOp, typename YOp, typename ZOp>
 struct GPUIndexIntrinsicOpLowering : public ConvertOpToLLVMPattern<Op> {
 private:
-  enum dimension { X = 0, Y = 1, Z = 2, invalid };
+  enum Dimension { X = 0, Y = 1, Z = 2, invalid };
   unsigned indexBitwidth;
 
-  static dimension dimensionToIndex(Op op) {
-    return StringSwitch<dimension>(op.dimension())
+  static Dimension dimensionToIndex(Op op) {
+    return StringSwitch<Dimension>(op.dimension())
         .Case("x", X)
         .Case("y", Y)
         .Case("z", Z)

diff  --git a/mlir/lib/Conversion/GPUCommon/OpToFuncCallLowering.h b/mlir/lib/Conversion/GPUCommon/OpToFuncCallLowering.h
index 2c1c0e107a578..00230c906dc2b 100644
--- a/mlir/lib/Conversion/GPUCommon/OpToFuncCallLowering.h
+++ b/mlir/lib/Conversion/GPUCommon/OpToFuncCallLowering.h
@@ -31,9 +31,9 @@ namespace mlir {
 template <typename SourceOp>
 struct OpToFuncCallLowering : public ConvertOpToLLVMPattern<SourceOp> {
 public:
-  explicit OpToFuncCallLowering(LLVMTypeConverter &lowering_, StringRef f32Func,
+  explicit OpToFuncCallLowering(LLVMTypeConverter &lowering, StringRef f32Func,
                                 StringRef f64Func)
-      : ConvertOpToLLVMPattern<SourceOp>(lowering_), f32Func(f32Func),
+      : ConvertOpToLLVMPattern<SourceOp>(lowering), f32Func(f32Func),
         f64Func(f64Func) {}
 
   LogicalResult

diff  --git a/mlir/lib/Parser/Token.h b/mlir/lib/Parser/Token.h
index 4f5e948e6aab1..ad9c23cd60be1 100644
--- a/mlir/lib/Parser/Token.h
+++ b/mlir/lib/Parser/Token.h
@@ -34,7 +34,7 @@ class Token {
 
   // Token classification.
   Kind getKind() const { return kind; }
-  bool is(Kind K) const { return kind == K; }
+  bool is(Kind k) const { return kind == k; }
 
   bool isAny(Kind k1, Kind k2) const { return is(k1) || is(k2); }
 

diff  --git a/mlir/lib/Tools/PDLL/Parser/Lexer.h b/mlir/lib/Tools/PDLL/Parser/Lexer.h
index 19474479f3608..bf6f2a686fbee 100644
--- a/mlir/lib/Tools/PDLL/Parser/Lexer.h
+++ b/mlir/lib/Tools/PDLL/Parser/Lexer.h
@@ -130,7 +130,7 @@ class Token {
   }
 
   /// Return if the token has the given kind.
-  bool is(Kind K) const { return kind == K; }
+  bool is(Kind k) const { return kind == k; }
 
   /// Return a location for the start of this token.
   llvm::SMLoc getStartLoc() const {


        


More information about the Mlir-commits mailing list