[Mlir-commits] [mlir] 89df483 - [mlir] Fix warnings.

Alexander Belyaev llvmlistbot at llvm.org
Thu Jun 3 08:09:30 PDT 2021


Author: Alexander Belyaev
Date: 2021-06-03T17:09:09+02:00
New Revision: 89df483d30bb22cdbc330553a13dd4761992bba0

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

LOG: [mlir] Fix warnings.

Added: 
    

Modified: 
    mlir/include/mlir/ExecutionEngine/MemRefUtils.h
    mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp
    mlir/lib/Dialect/Linalg/Transforms/Detensorize.cpp
    mlir/lib/Dialect/Linalg/Transforms/FusionOnTensors.cpp
    mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorConversion.cpp
    mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorPasses.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/include/mlir/ExecutionEngine/MemRefUtils.h b/mlir/include/mlir/ExecutionEngine/MemRefUtils.h
index 53227e9f4eae1..13778e9af1e72 100644
--- a/mlir/include/mlir/ExecutionEngine/MemRefUtils.h
+++ b/mlir/include/mlir/ExecutionEngine/MemRefUtils.h
@@ -130,7 +130,7 @@ using ElementWiseVisitor = llvm::function_ref<void(T &ptr, ArrayRef<int64_t>)>;
 
 /// Owning MemRef type that abstracts over the runtime type for ranked strided
 /// memref.
-template <typename T, int Rank>
+template <typename T, unsigned Rank>
 class OwningMemRef {
 public:
   using DescriptorType = StridedMemRefType<T, Rank>;

diff  --git a/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp b/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp
index 89387b08c11c1..c2c1633376595 100644
--- a/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp
+++ b/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp
@@ -1349,8 +1349,6 @@ struct CollapseReshapeOps : public OpRewritePattern<ReshapeOpTy> {
     if (!srcReshapeOp)
       return failure();
 
-    ShapedType srcReshapeSrcType = srcReshapeOp.getSrcType();
-    ShapedType intermediateType = reshapeOp.getSrcType();
     ShapedType resultType = reshapeOp.getResultType();
     Optional<SmallVector<ReassociationIndices>> reassociationIndices =
         collapseReassociationIndices(srcReshapeOp.getReassociationMaps(),

diff  --git a/mlir/lib/Dialect/Linalg/Transforms/Detensorize.cpp b/mlir/lib/Dialect/Linalg/Transforms/Detensorize.cpp
index fd26f671c9b98..920e348997558 100644
--- a/mlir/lib/Dialect/Linalg/Transforms/Detensorize.cpp
+++ b/mlir/lib/Dialect/Linalg/Transforms/Detensorize.cpp
@@ -193,7 +193,8 @@ struct ExtractFromReshapeFromElements
 /// @see LinalgDetensorize in Linalg/Passes.td for more details.
 struct LinalgDetensorize : public LinalgDetensorizeBase<LinalgDetensorize> {
   LinalgDetensorize() = default;
-  LinalgDetensorize(const LinalgDetensorize &pass) {}
+  LinalgDetensorize(const LinalgDetensorize &pass)
+      : LinalgDetensorizeBase<LinalgDetensorize>() {}
 
   class CostModel {
   public:

diff  --git a/mlir/lib/Dialect/Linalg/Transforms/FusionOnTensors.cpp b/mlir/lib/Dialect/Linalg/Transforms/FusionOnTensors.cpp
index e202e627a18f7..d4dbb5aeb7c27 100644
--- a/mlir/lib/Dialect/Linalg/Transforms/FusionOnTensors.cpp
+++ b/mlir/lib/Dialect/Linalg/Transforms/FusionOnTensors.cpp
@@ -815,8 +815,6 @@ struct FoldProducerReshapeOpByLinearization
       if (!reshapeOp)
         continue;
 
-      Value src = reshapeOp.src();
-      RankedTensorType operandType = reshapeOp.getSrcType();
       RankedTensorType returnType = reshapeOp.getResultType();
 
       if (!isTensorReshapeOpFoldableByLinearization(

diff  --git a/mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorConversion.cpp b/mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorConversion.cpp
index ed1413d5f4bd5..a2c11555d3460 100644
--- a/mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorConversion.cpp
+++ b/mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorConversion.cpp
@@ -52,6 +52,7 @@ getDimLevelTypeEncoding(SparseTensorEncodingAttr::DimLevelType dlt) {
   case SparseTensorEncodingAttr::DimLevelType::Singleton:
     return 2;
   }
+  llvm_unreachable("Unknown SparseTensorEncodingAttr::DimLevelType");
 }
 
 /// Returns integers of given width and values as a constant tensor.

diff  --git a/mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorPasses.cpp b/mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorPasses.cpp
index 7159c6a2745c0..dee741e851d28 100644
--- a/mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorPasses.cpp
+++ b/mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorPasses.cpp
@@ -32,7 +32,8 @@ namespace {
 struct SparsificationPass : public SparsificationBase<SparsificationPass> {
 
   SparsificationPass() = default;
-  SparsificationPass(const SparsificationPass &pass) {}
+  SparsificationPass(const SparsificationPass &pass)
+      : SparsificationBase<SparsificationPass>() {}
 
   Option<int32_t> parallelization{
       *this, "parallelization-strategy",


        


More information about the Mlir-commits mailing list