[Mlir-commits] [mlir] [MLIR][XeVM] Fix unused variable warning in 66134e7 (PR #171171)
Aiden Grossman
llvmlistbot at llvm.org
Mon Dec 8 10:14:12 PST 2025
https://github.com/boomanaiden154 created https://github.com/llvm/llvm-project/pull/171171
Inline the variable only used in an assert per the LLVM coding standards.
>From c522ed56f663319e0078da59280b58a839801e2c Mon Sep 17 00:00:00 2001
From: Aiden Grossman <aidengrossman at google.com>
Date: Mon, 8 Dec 2025 18:13:16 +0000
Subject: [PATCH] [MLIR][XeVM] Fix unused variable warning in 66134e7
Inline the variable only used in an assert per the LLVM coding
standards.
---
mlir/lib/Conversion/XeGPUToXeVM/XeGPUToXeVM.cpp | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
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