[Mlir-commits] [mlir] [mlir][ArmSVE][NFC] Remove redundant scalability checks in contract lowering (PR #233868)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Tue Oct 20 07:50:13 PDT 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-mlir

Author: Andrzej WarzyƄski (banach-space)

<details>
<summary>Changes</summary>

Replace
```cpp
if ( ... || !rhsType.getScalableDims()[0]) ...
  !rhsType.getScalableDims()[0])
```
with
```cpp
if ( ... || !rhsType.getScalableDims()[0]) ... )
```


---
Full diff: https://github.com/llvm/llvm-project/pull/233868.diff


1 Files Affected:

- (modified) mlir/lib/Dialect/ArmSVE/Transforms/LowerContractToSVEPatterns.cpp (+2-4) 


``````````diff
diff --git a/mlir/lib/Dialect/ArmSVE/Transforms/LowerContractToSVEPatterns.cpp b/mlir/lib/Dialect/ArmSVE/Transforms/LowerContractToSVEPatterns.cpp
index 86fd0bf2661ed..1c82297a9e0c0 100644
--- a/mlir/lib/Dialect/ArmSVE/Transforms/LowerContractToSVEPatterns.cpp
+++ b/mlir/lib/Dialect/ArmSVE/Transforms/LowerContractToSVEPatterns.cpp
@@ -444,8 +444,7 @@ class VectorContractRewriterI8MM : public VectorContractRewriter {
     //  * M and N even and at least 2
     if (lhsType.isScalable() || !rhsType.getScalableDims()[0] ||
         rhsType.getScalableDims()[1] || lhsType.getDimSize(1) != k || k != 8 ||
-        m < 2 || m % 2 != 0 || n < 2 || n % 2 != 0 ||
-        !rhsType.getScalableDims()[0])
+        m < 2 || m % 2 != 0 || n < 2 || n % 2 != 0)
       return rewriter.notifyMatchFailure(op, "non-matching operand shape");
 
     // Check the output is a vector of i32 elements.
@@ -516,8 +515,7 @@ class VectorContractRewriterBfloat : public VectorContractRewriter {
     //  * M and N even and at least 2
     if (lhsType.isScalable() || !rhsType.getScalableDims()[0] ||
         rhsType.getScalableDims()[1] || lhsType.getDimSize(1) != k || k != 4 ||
-        m < 2 || m % 2 != 0 || n < 2 || n % 2 != 0 ||
-        !rhsType.getScalableDims()[0])
+        m < 2 || m % 2 != 0 || n < 2 || n % 2 != 0)
       return rewriter.notifyMatchFailure(op, "non-matching operand shape");
 
     // Check the output is a vector of Float32 elements.

``````````

</details>


https://github.com/llvm/llvm-project/pull/233868


More information about the Mlir-commits mailing list