[Mlir-commits] [mlir] fc73736 - [mlir] Fix -Wunused-variable in MeshOps.cpp (NFC)
Jie Fu
llvmlistbot at llvm.org
Wed Aug 7 06:47:27 PDT 2024
Author: Jie Fu
Date: 2024-08-07T21:46:29+08:00
New Revision: fc737368fe6e27d6ecf76e522cb43a32aaca992a
URL: https://github.com/llvm/llvm-project/commit/fc737368fe6e27d6ecf76e522cb43a32aaca992a
DIFF: https://github.com/llvm/llvm-project/commit/fc737368fe6e27d6ecf76e522cb43a32aaca992a.diff
LOG: [mlir] Fix -Wunused-variable in MeshOps.cpp (NFC)
/llvm-project/mlir/lib/Dialect/Mesh/IR/MeshOps.cpp:182:16:
error: unused variable 'inAxis' [-Werror,-Wunused-variable]
auto inAxis = dimSz % inShape.size();
^
Added:
Modified:
mlir/lib/Dialect/Mesh/IR/MeshOps.cpp
Removed:
################################################################################
diff --git a/mlir/lib/Dialect/Mesh/IR/MeshOps.cpp b/mlir/lib/Dialect/Mesh/IR/MeshOps.cpp
index 8e34497f81a92..b26e97940d7d8 100644
--- a/mlir/lib/Dialect/Mesh/IR/MeshOps.cpp
+++ b/mlir/lib/Dialect/Mesh/IR/MeshOps.cpp
@@ -178,11 +178,13 @@ static void shardShape(const InShape &inShape, const MeshShape &meshShape,
if (!shardedDimsSizes.empty()) {
for (auto [tensorAxis, innerSplitAxes] : llvm::enumerate(splitAxes)) {
if (innerSplitAxes.empty()) {
+#ifndef NDEBUG
for (auto dimSz : shardedDimsSizes) {
auto inAxis = dimSz % inShape.size();
assert(inShape[inAxis] == dimSz || dimSz == ShapedType::kDynamic ||
inShape[inAxis] == ShapedType::kDynamic);
}
+#endif // NDEBUG
} else {
// find sharded dims in sharded_dims_sizes with same static size on
// all devices. Use kDynamic for dimensions with dynamic or non-uniform
More information about the Mlir-commits
mailing list