[Mlir-commits] [mlir] [mlir][ArmNeon] Updates LowerContractionToSMMLAPattern with vecmat unroll patterns (PR #86005)
Kojo Acquah
llvmlistbot at llvm.org
Thu Mar 21 09:07:08 PDT 2024
================
@@ -150,16 +150,30 @@ class LowerContractionToSMMLAPattern
Value tiledAcc =
extractOperand(op.getAcc(), accPermutationMap, accOffsets);
+ // With vecmat, tiled LHS and ACC will contain only one of 2 necessary
+ // rows along dimM. Broadcast both to the full width
+ if (isVecmat) {
+ auto lhsBroadcastType = VectorType::get(
+ {2, 8}, tiledLhs.getType().cast<ShapedType>().getElementType());
+ tiledLhs = rewriter.create<vector::BroadcastOp>(loc, lhsBroadcastType,
+ tiledLhs);
+ auto accBroadcastType = VectorType::get(
+ {2, 2}, tiledAcc.getType().cast<ShapedType>().getElementType());
+ tiledAcc = rewriter.create<vector::BroadcastOp>(loc, accBroadcastType,
+ tiledAcc);
----------------
KoolJBlack wrote:
@dcaballe I couldn't find an equivalent vector op for `tensor::empty` so using a broadcast here. Half the matmul is not needed so the data can be anything. If there is something simpler, let me know.
https://github.com/llvm/llvm-project/pull/86005
More information about the Mlir-commits
mailing list