[Mlir-commits] [mlir] b0d5753 - [mlir][Linalg] Fix ignoring nodiscard return value

Nicolas Vasilache llvmlistbot at llvm.org
Fri Jan 20 04:51:35 PST 2023


Author: Tom Eccles
Date: 2023-01-20T04:51:21-08:00
New Revision: b0d575310f2ee660dadfdaf1e06bac148a575754

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

LOG: [mlir][Linalg] Fix ignoring nodiscard return value

ff94419a287c changed the return value of appendMangledType() to
LogicalResult, which is marked as nodiscard. Ignoring the result
generates a warning when building with clang.

Reviewed By: nicolasvasilache, chelini

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

Added: 
    

Modified: 
    mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp b/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp
index ebfb8ef1fe57c..dc0b39afbf28f 100644
--- a/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp
+++ b/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp
@@ -1803,14 +1803,16 @@ static LogicalResult appendMangledType(llvm::raw_string_ostream &ss, Type t) {
         ss << "sx";
       else
         ss << size << "x";
-    appendMangledType(ss, memref.getElementType());
+    if (failed(appendMangledType(ss, memref.getElementType())))
+      return failure();
     return success();
   }
   if (auto vec = t.dyn_cast<VectorType>()) {
     ss << "vector";
     llvm::interleave(
         vec.getShape(), [&](int64_t i) { ss << i; }, [&]() { ss << "x"; });
-    appendMangledType(ss, vec.getElementType());
+    if (failed(appendMangledType(ss, vec.getElementType())))
+      return failure();
     return success();
   } else if (t.isSignlessIntOrIndexOrFloat()) {
     ss << t;


        


More information about the Mlir-commits mailing list