[Mlir-commits] [mlir] c6e23ab - [MLIR][XeVM] Fix unused variable warning in 66134e7 (#171171)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Mon Dec 8 10:26:34 PST 2025


Author: Aiden Grossman
Date: 2025-12-08T18:26:29Z
New Revision: c6e23ab80753a01dce270f5f8a133fbec942315d

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

LOG: [MLIR][XeVM] Fix unused variable warning in 66134e7 (#171171)

Inline the variable only used in an assert per the LLVM coding
standards.

Added: 
    

Modified: 
    mlir/lib/Conversion/XeGPUToXeVM/XeGPUToXeVM.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Conversion/XeGPUToXeVM/XeGPUToXeVM.cpp b/mlir/lib/Conversion/XeGPUToXeVM/XeGPUToXeVM.cpp
index 54254be007788..0ecb50e719d58 100644
--- a/mlir/lib/Conversion/XeGPUToXeVM/XeGPUToXeVM.cpp
+++ b/mlir/lib/Conversion/XeGPUToXeVM/XeGPUToXeVM.cpp
@@ -682,9 +682,8 @@ class LoadStoreMatrixToXeVMPattern : public OpConversionPattern<OpType> {
       // Some transforms may leave unit dimension in the 2D vector, adaptors do
       // not catch it for results.
       if (auto vecType = dyn_cast<VectorType>(resType)) {
-        auto nonUnitDims = llvm::count_if(vecType.getShape(),
-                                          [](int64_t d) { return d != 1; });
-        assert(nonUnitDims <= 1 &&
+        assert(llvm::count_if(vecType.getShape(),
+                              [](int64_t d) { return d != 1; }) <= 1 &&
                "Expected either 1D vector or nD with unit dimensions");
         resType = VectorType::get({vecType.getNumElements()},
                                   vecType.getElementType());


        


More information about the Mlir-commits mailing list