[Mlir-commits] [mlir] [mlir][ArmNeon] Update `LowerContractionToSMMLAPattern` to support proper unrolling for k dimension (PR #88591)

Diego Caballero llvmlistbot at llvm.org
Tue Apr 16 08:57:06 PDT 2024


================
@@ -197,16 +201,21 @@ class LowerContractionToSMMLAPattern
       auto collapsedRes = rewriter.createOrFold<vector::ShapeCastOp>(
           tiledAcc.getLoc(), collapsedOutputType, tiledAcc);
 
+      if (kTileIndex != 0) {
+        collapsedRes = kAcc;
+      }
----------------
dcaballe wrote:

Probably good to not generate the shape cast when not needed. We could do something like:

```
Value collapsedRes;
if (kTileInidex == 0) {
  collapsedRes = rewrite.createOrFold...
}
else {
  collapsedRes = kAcc;
}
```

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


More information about the Mlir-commits mailing list