[Mlir-commits] [mlir] 8436dd4 - [mlir][NVVM] Move MMA verifier type sets (NFC) (#221712)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Mon Sep 7 05:14:08 PDT 2026


Author: Mehdi Amini
Date: 2026-09-07T12:14:03Z
New Revision: 8436dd4a2bfe57d0b3fb6c9c11c69d75c1d1bccb

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

LOG: [mlir][NVVM] Move MMA verifier type sets (NFC) (#221712)

Build the fixed-size operand type collection by moving the locally
computed allowed-type sets. The verifier does not use the individual
sets afterward, so copying their nested vectors is unnecessary.

Found by Coverity.

Assisted-by: Codex

Added: 
    

Modified: 
    mlir/lib/Dialect/LLVMIR/IR/NVVMDialect.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Dialect/LLVMIR/IR/NVVMDialect.cpp b/mlir/lib/Dialect/LLVMIR/IR/NVVMDialect.cpp
index 6bf52e218aae7..c6ed0a840a1b0 100644
--- a/mlir/lib/Dialect/LLVMIR/IR/NVVMDialect.cpp
+++ b/mlir/lib/Dialect/LLVMIR/IR/NVVMDialect.cpp
@@ -37,10 +37,12 @@
 #include "llvm/Support/FormatVariadic.h"
 #include "llvm/Support/NVPTXAddrSpace.h"
 #include "llvm/Support/raw_ostream.h"
+#include <array>
 #include <cassert>
 #include <cmath>
 #include <optional>
 #include <string>
+#include <utility>
 
 using namespace mlir;
 using namespace NVVM;
@@ -1399,7 +1401,9 @@ LogicalResult MmaOp::verify() {
   // Verify the operand types for segments of A, B, and C operands.
   std::array<StringRef, 3> operandNames{"A", "B", "C"};
   for (const auto &iter : llvm::enumerate(
-           SmallVector<AllowedTypes, 3>{expectedA, expectedB, expectedC})) {
+           std::array<AllowedTypes, 3>{std::move(expectedA),
+                                       std::move(expectedB),
+                                       std::move(expectedC)})) {
     auto spec = this->getODSOperandIndexAndLength(iter.index());
     SmallVector<Type, 4> operandTySeg(operand_type_begin() + spec.first,
                                       operand_type_begin() + spec.first +
@@ -1918,7 +1922,9 @@ LogicalResult MmaSpOp::verify() {
   // Verify the operand types for segments of A, B, and C operands.
   std::array<StringRef, 3> operandNames{"A", "B", "C"};
   for (const auto &iter : llvm::enumerate(
-           SmallVector<AllowedTypes, 3>{expectedA, expectedB, expectedC})) {
+           std::array<AllowedTypes, 3>{std::move(expectedA),
+                                       std::move(expectedB),
+                                       std::move(expectedC)})) {
     auto spec = this->getODSOperandIndexAndLength(iter.index());
     SmallVector<Type, 4> operandTySeg(operand_type_begin() + spec.first,
                                       operand_type_begin() + spec.first +


        


More information about the Mlir-commits mailing list