[mlir] Fix two build warnings in VectorToGPU (NFC)
authorJie Fu <jiefu@tencent.com>
Wed, 15 Feb 2023 01:31:16 +0000 (09:31 +0800)
committerJie Fu <jiefu@tencent.com>
Wed, 15 Feb 2023 01:35:49 +0000 (09:35 +0800)
In file included from /data/llvm-project/mlir/lib/Conversion/VectorToGPU/VectorToGPU.cpp:13:
/data/llvm-project/mlir/include/mlir/Conversion/VectorToGPU/VectorToGPU.h:15:1: error: class 'LogicalResult' was previously declared as a struct; this is valid, but may result in linker errors under the Microsoft C++ ABI [-Werror,-Wmismatched-tags]
class LogicalResult;
^
/data/llvm-project/mlir/include/mlir/Support/LogicalResult.h:26:22: note: previous use is here
struct [[nodiscard]] LogicalResult {
                     ^
/data/llvm-project/mlir/include/mlir/Conversion/VectorToGPU/VectorToGPU.h:15:1: note: did you mean struct here?
class LogicalResult;
^~~~~
struct

/data/llvm-project/mlir/lib/Conversion/VectorToGPU/VectorToGPU.cpp:724:5: error: ignoring return value of function declared with 'nodiscard' attribute [-Werror,-Wunused-result]
    rewriter.notifyMatchFailure(
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~
2 errors generated.

mlir/include/mlir/Conversion/VectorToGPU/VectorToGPU.h
mlir/lib/Conversion/VectorToGPU/VectorToGPU.cpp

index d8231fc..3530eb5 100644 (file)
@@ -12,7 +12,7 @@
 #include "mlir/IR/PatternMatch.h"
 
 namespace mlir {
-class LogicalResult;
+struct LogicalResult;
 class MLIRContext;
 class Pass;
 class RewritePatternSet;
index 0266ba1..d870359 100644 (file)
@@ -721,7 +721,7 @@ createNonLdMatrixLoads(RewriterBase &rewriter, vector::TransferReadOp op,
   FailureOr<nvgpu::FragmentElementInfo> regInfo =
       nvgpu::getMmaSyncRegisterType(*warpMatrixInfo);
   if (failed(regInfo)) {
-    rewriter.notifyMatchFailure(
+    return rewriter.notifyMatchFailure(
         op, "Failed to deduce register fragment type during "
             "conversion to distributed non-ldmatrix compatible load");
   }