[Mlir-commits] [mlir] 474a73d - [mlir] Fix build failure in MeshShardingInterfaceImpl.cpp (NFC)

Jie Fu llvmlistbot at llvm.org
Thu Mar 7 17:40:26 PST 2024


Author: Jie Fu
Date: 2024-03-08T09:38:29+08:00
New Revision: 474a73d979bdab8782c17829d72386e0da39eb39

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

LOG: [mlir] Fix build failure in MeshShardingInterfaceImpl.cpp (NFC)

llvm-project/mlir/lib/Dialect/Linalg/Transforms/MeshShardingInterfaceImpl.cpp:96:8:
error: unused variable 'resultElementType' [-Werror,-Wunused-variable]
  Type resultElementType =
       ^
llvm-project/mlir/lib/Dialect/Linalg/Transforms/MeshShardingInterfaceImpl.cpp:122:1:
error: non-void function does not return a value in all control paths [-Werror,-Wreturn-type]
}
^
2 errors generated.

Added: 
    

Modified: 
    mlir/lib/Dialect/Linalg/Transforms/MeshShardingInterfaceImpl.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Dialect/Linalg/Transforms/MeshShardingInterfaceImpl.cpp b/mlir/lib/Dialect/Linalg/Transforms/MeshShardingInterfaceImpl.cpp
index 7ac45dc3eb3efc..146e880765668b 100644
--- a/mlir/lib/Dialect/Linalg/Transforms/MeshShardingInterfaceImpl.cpp
+++ b/mlir/lib/Dialect/Linalg/Transforms/MeshShardingInterfaceImpl.cpp
@@ -93,7 +93,7 @@ static ReductionKind getReductionKindOfLinalgOp(LinalgOp op) {
   if (!reductionOp) {
     return ReductionKind::Generic;
   }
-  Type resultElementType =
+  [[maybe_unused]] Type resultElementType =
       llvm::cast<RankedTensorType>(op->getResult(0).getType()).getElementType();
   // TODO: handle case when result type of the reduction op does not match the
   // element type of the result tensor.
@@ -119,6 +119,7 @@ static MeshOp getMesh(Operation *op,
   }
 
   assert(false);
+  return nullptr;
 }
 
 // Choose the operand based on the current process index along the reduction


        


More information about the Mlir-commits mailing list