[Mlir-commits] [mlir] e9ac792 - [mlir] Fix some of the warnings in MLIR code.

Alexander Belyaev llvmlistbot at llvm.org
Thu Jun 11 13:18:51 PDT 2020


Author: Alexander Belyaev
Date: 2020-06-11T22:18:32+02:00
New Revision: e9ac7927483ce2e2d92eb188c20332a1049bb69e

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

LOG: [mlir] Fix some of the warnings in MLIR code.

Summary:
* extra ';' in the following files:
    mlir/lib/Dialect/Linalg/Transforms/Transforms.cpp
    mlir/lib/Dialect/Shape/IR/Shape.cpp

* base class ‘mlir::ConvertVectorToSCFBase<ConvertVectorToSCFPass>’
  should be explicitly initialized in the copy constructor [-Wextra] in
    mlir/lib/Conversion/VectorToSCF/VectorToSCF.cpp

* warning: ‘bool Expression::operator==(const Expression&) const’
  defined but not used [-Wunused-function] in
    mlir/tools/mlir-linalg-ods-gen/mlir-linalg-ods-gen.cpp

Differential Revision: https://reviews.llvm.org/D81673

Added: 
    

Modified: 
    mlir/lib/Conversion/VectorToSCF/VectorToSCF.cpp
    mlir/lib/Dialect/Linalg/Transforms/Transforms.cpp
    mlir/lib/Dialect/Shape/IR/Shape.cpp
    mlir/tools/mlir-linalg-ods-gen/mlir-linalg-ods-gen.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Conversion/VectorToSCF/VectorToSCF.cpp b/mlir/lib/Conversion/VectorToSCF/VectorToSCF.cpp
index 329b0086364f..f7bdd53233ae 100644
--- a/mlir/lib/Conversion/VectorToSCF/VectorToSCF.cpp
+++ b/mlir/lib/Conversion/VectorToSCF/VectorToSCF.cpp
@@ -651,7 +651,6 @@ namespace {
 struct ConvertVectorToSCFPass
     : public ConvertVectorToSCFBase<ConvertVectorToSCFPass> {
   ConvertVectorToSCFPass() = default;
-  ConvertVectorToSCFPass(const ConvertVectorToSCFPass &pass) {}
   ConvertVectorToSCFPass(const VectorTransferToSCFOptions &options) {
     this->fullUnroll = options.unroll;
   }

diff  --git a/mlir/lib/Dialect/Linalg/Transforms/Transforms.cpp b/mlir/lib/Dialect/Linalg/Transforms/Transforms.cpp
index f46d08f099ab..402200f6b1ca 100644
--- a/mlir/lib/Dialect/Linalg/Transforms/Transforms.cpp
+++ b/mlir/lib/Dialect/Linalg/Transforms/Transforms.cpp
@@ -101,7 +101,7 @@ mlir::linalg::LinalgTilingOptions::setTileSizes(ArrayRef<int64_t> ts) {
     }));
   };
   return *this;
-};
+}
 
 /// Linalg base tiling pattern.
 mlir::linalg::LinalgBaseTilingPattern::LinalgBaseTilingPattern(

diff  --git a/mlir/lib/Dialect/Shape/IR/Shape.cpp b/mlir/lib/Dialect/Shape/IR/Shape.cpp
index 07913273b810..4a876e16bcec 100644
--- a/mlir/lib/Dialect/Shape/IR/Shape.cpp
+++ b/mlir/lib/Dialect/Shape/IR/Shape.cpp
@@ -187,7 +187,7 @@ struct AssumingWithTrue : public OpRewritePattern<AssumingOp> {
     return success();
   }
 };
-}; // namespace
+} // namespace
 
 void AssumingOp::getCanonicalizationPatterns(OwningRewritePatternList &patterns,
                                              MLIRContext *context) {

diff  --git a/mlir/tools/mlir-linalg-ods-gen/mlir-linalg-ods-gen.cpp b/mlir/tools/mlir-linalg-ods-gen/mlir-linalg-ods-gen.cpp
index d2dd1f5d9738..c417995e67ec 100644
--- a/mlir/tools/mlir-linalg-ods-gen/mlir-linalg-ods-gen.cpp
+++ b/mlir/tools/mlir-linalg-ods-gen/mlir-linalg-ods-gen.cpp
@@ -846,9 +846,8 @@ struct Expression {
   };
 
   explicit Expression(Kind k = Kind::Uninitialized) : kind(k) {}
-  virtual ~Expression() = 0;
+  virtual ~Expression() = default;
 
-  bool operator==(const Expression &e) const;
   operator bool() const { return kind != Kind::Uninitialized; }
 
   Kind kind;
@@ -930,20 +929,6 @@ struct TensorExpr : public Expression {
   SetVector<unsigned> reductionDimensions;
 };
 
-Expression::~Expression() {}
-
-bool Expression::operator==(const Expression &e) const {
-  if (this->kind != e.kind)
-    return false;
-  if (e.kind == Expression::Kind::TensorUse)
-    return static_cast<const TensorUse &>(*this) ==
-           static_cast<const TensorUse &>(e);
-  if (e.kind == Expression::Kind::TensorExpr)
-    return static_cast<const TensorExpr &>(*this) ==
-           static_cast<const TensorExpr &>(e);
-  llvm_unreachable("Unexpected case");
-}
-
 /// This is a specialized parser for a TCDef.
 /// This maintains the dims it finds in an eager fashion.
 class TCParser {


        


More information about the Mlir-commits mailing list