[Mlir-commits] [mlir] [MLIR][XeVM] Fix unused variable warning in 66134e7 (PR #171171)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Mon Dec 8 10:14:43 PST 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-mlir-gpu
Author: Aiden Grossman (boomanaiden154)
<details>
<summary>Changes</summary>
Inline the variable only used in an assert per the LLVM coding standards.
---
Full diff: https://github.com/llvm/llvm-project/pull/171171.diff
1 Files Affected:
- (modified) mlir/lib/Conversion/XeGPUToXeVM/XeGPUToXeVM.cpp (+2-3)
``````````diff
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());
``````````
</details>
https://github.com/llvm/llvm-project/pull/171171
More information about the Mlir-commits
mailing list