Skip to content

Conversation

@boomanaiden154
Copy link
Contributor

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

Inline the variable only used in an assert per the LLVM coding
standards.
@llvmbot
Copy link
Member

llvmbot commented Dec 8, 2025

@llvm/pr-subscribers-mlir

@llvm/pr-subscribers-mlir-gpu

Author: Aiden Grossman (boomanaiden154)

Changes

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 --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());

@boomanaiden154 boomanaiden154 enabled auto-merge (squash) December 8, 2025 18:19
@boomanaiden154 boomanaiden154 merged commit c6e23ab into llvm:main Dec 8, 2025
13 checks passed
@boomanaiden154 boomanaiden154 deleted the fix-66134e7136154cbb839484afd8f356cc4ed4a021 branch December 8, 2025 18:26
honeygoyal pushed a commit to honeygoyal/llvm-project that referenced this pull request Dec 9, 2025
Inline the variable only used in an assert per the LLVM coding
standards.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants