[Mlir-commits] [mlir] [mlir][ArmSVE][NFC] Remove redundant scalability checks in contract lowering (PR #233868)
Andrzej WarzyĆski
llvmlistbot at llvm.org
Tue Oct 20 07:49:28 PDT 2026
https://github.com/banach-space created https://github.com/llvm/llvm-project/pull/233868
Replace
```cpp
if ( ... || !rhsType.getScalableDims()[0]) ...
!rhsType.getScalableDims()[0])
```
with
```cpp
if ( ... || !rhsType.getScalableDims()[0]) ... )
```
>From c6225c0223e237215b44610e0de48df9261c2bd6 Mon Sep 17 00:00:00 2001
From: Andrzej Warzynski <andrzej.warzynski at arm.com>
Date: Tue, 20 Oct 2026 14:45:10 +0000
Subject: [PATCH] [mlir][ArmSVE][NFC] Remove redundant scalability checks in
contract lowering
Replace
```cpp
if ( ... || !rhsType.getScalableDims()[0]) ...
!rhsType.getScalableDims()[0])
```
with
```cpp
if ( ... || !rhsType.getScalableDims()[0]) ... )
```
---
.../ArmSVE/Transforms/LowerContractToSVEPatterns.cpp | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
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.
More information about the Mlir-commits
mailing list