[Mlir-commits] [mlir] ab43cf2 - [mlir][mesh] Fix -Wunused-variable in Spmdization.cpp (NFC)

Jie Fu llvmlistbot at llvm.org
Tue Jan 2 17:29:22 PST 2024


Author: Jie Fu
Date: 2024-01-03T09:29:14+08:00
New Revision: ab43cf26cac559187a0891c6978f07cf72ea7682

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

LOG: [mlir][mesh] Fix -Wunused-variable in Spmdization.cpp (NFC)

llvm-project/mlir/lib/Dialect/Mesh/Transforms/Spmdization.cpp:573:14:
 error: unused variable 'targetShardType' [-Werror,-Wunused-variable]
  ShapedType targetShardType =
             ^
1 error generated.

Added: 
    

Modified: 
    mlir/lib/Dialect/Mesh/Transforms/Spmdization.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Dialect/Mesh/Transforms/Spmdization.cpp b/mlir/lib/Dialect/Mesh/Transforms/Spmdization.cpp
index de8b3a98df998a..8d7e89662131a0 100644
--- a/mlir/lib/Dialect/Mesh/Transforms/Spmdization.cpp
+++ b/mlir/lib/Dialect/Mesh/Transforms/Spmdization.cpp
@@ -570,7 +570,7 @@ reshardOn1DMesh(ImplicitLocOpBuilder &builder, ClusterOp mesh,
                 TypedValue<ShapedType> sourceShard) {
   assert(sourceShard.getType() ==
          shardShapedType(sourceUnshardedValue.getType(), mesh, sourceSharding));
-  ShapedType targetShardType =
+  [[maybe_unused]] ShapedType targetShardType =
       shardShapedType(sourceUnshardedValue.getType(), mesh, targetSharding);
   assert(sourceShard.getType().getRank() == targetShardType.getRank());
   assert(mesh.getRank() == 1 && "Only 1D meshes are currently supported.");


        


More information about the Mlir-commits mailing list