[mlir][Linalg] Fix ignoring nodiscard return value
authorTom Eccles <tom.eccles@arm.com>
Fri, 20 Jan 2023 12:51:11 +0000 (04:51 -0800)
committerNicolas Vasilache <nicolas.vasilache@gmail.com>
Fri, 20 Jan 2023 12:51:21 +0000 (04:51 -0800)
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

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

index ebfb8ef..dc0b39a 100644 (file)
@@ -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;