Skip to content

Commit 1373bbe

Browse files
committed
Fixups
1 parent 607170f commit 1373bbe

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

mlir/lib/Conversion/ArmSMEToLLVM/ArmSMEToLLVM.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ struct ConvertArmSMESpillsAndFillsToLLVM : public ConvertToLLVMPattern {
259259

260260
VectorType tileVectorType = tileOp.getTileType();
261261
auto sliceType = VectorType::Builder(tileVectorType).dropDim(0);
262-
auto emitTileSwap = [&] {
262+
auto swapInMemoryTileWithSMETileZero = [&] {
263263
emitFullTileSwap(rewriter, loc, tileAlloca,
264264
*arm_sme::getSMETileType(tileVectorType), sliceType,
265265
zeroTileId);
@@ -271,10 +271,10 @@ struct ConvertArmSMESpillsAndFillsToLLVM : public ConvertToLLVMPattern {
271271
{
272272
rewriter.setInsertionPoint(op);
273273
// Swap the contents of ZA and the in-memory tile before the op.
274-
emitTileSwap();
274+
swapInMemoryTileWithSMETileZero();
275275
rewriter.setInsertionPointAfter(op);
276276
// Swap the tile back out to memory again after the op.
277-
emitTileSwap();
277+
swapInMemoryTileWithSMETileZero();
278278
}
279279

280280
return success();

mlir/test/Conversion/ArmSMEToLLVM/tile-spills-and-fills.mlir

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
/// Checks tile spill/reloads are inserted around in-memory tiles (i.e. tiles
88
/// that were not assigned a physical SME tile).
99
///
10-
/// These spills are currently very naive and paranoid and will spill/reload
11-
/// entire tiles around ArmSME ops.
10+
/// These spills are currently very naive and will spill/reload entire tiles
11+
/// around ArmSME ops.
1212
///
1313
/// The general pattern is:
1414
///
@@ -34,19 +34,17 @@
3434
/// Then around the op:
3535
///
3636
/// // Swap contents of %tileAlloca and tile 0
37-
/// scf.for %sliceIdx ... {
37+
/// scf.for %sliceIdx ...
3838
/// %currentSlice = arm_sme.intr.read.horiz {tile_id = 0}
3939
/// arm_sme.intr.ld1h.horiz %tileAlloca[%sliceIdx, %c0] {tile_id = 0}
4040
/// vector.store %currentSlice, %tileAlloca[%sliceIdx, %c0]
41-
/// }
4241
/// // Execute the op using tile 0
4342
/// arm_sme.intr.zero
4443
/// // Swap contents of %tileAlloca and tile 0
45-
/// scf.for %sliceIdx ... {
44+
/// scf.for %sliceIdx ...
4645
/// %currentSlice = arm_sme.intr.read.horiz {tile_id = 0}
4746
/// arm_sme.intr.ld1h.horiz %tileAlloca[%sliceIdx, %c0] {tile_id = 0}
4847
/// vector.store %currentSlice, %tileAlloca[%sliceIdx, %c0]
49-
/// }
5048
///
5149

5250
// -----
@@ -78,10 +76,12 @@ func.func @use_too_many_tiles() {
7876
// AFTER-LLVM-LOWERING-SAME: {arm_sme.in_memory_tile_id = 16 : i32} : memref<?x?xi16>
7977
//
8078
// AFTER-LLVM-LOWERING-NOT: scf.for
81-
// AFTER-LLVM-LOWERING: arm_sme.intr.zero
79+
// Note: 17 is the mask for the 32-bit tile 0.
80+
// AFTER-LLVM-LOWERING: "arm_sme.intr.zero"() <{tile_mask = 17 : i32}>
8281
//
8382
// AFTER-LLVM-LOWERING-NOT: scf.for
84-
// AFTER-LLVM-LOWERING: arm_sme.intr.zero
83+
// Note: 34 is the mask for the 32-bit tile 1.
84+
// AFTER-LLVM-LOWERING: "arm_sme.intr.zero"() <{tile_mask = 34 : i32}>
8585
//
8686
// AFTER-LLVM-LOWERING: scf.for
8787
// AFTER-LLVM-LOWERING-SAME: %[[C0]] to %[[SVL_H]] step %[[C1]] {
@@ -92,7 +92,8 @@ func.func @use_too_many_tiles() {
9292
// AFTER-LLVM-LOWERING-NEXT: "arm_sme.intr.ld1h.horiz"({{.*}}, %[[SLICE_PTR]], {{.*}}) <{tile_id = 0 : i32}>
9393
// AFTER-LLVM-LOWERING-NEXT: vector.store %[[SLICE]], %[[TILE_ALLOCA]]
9494
// AFTER-LLVM-LOWERING-NEXT: }
95-
// AFTER-LLVM-LOWERING: arm_sme.intr.zero
95+
// Note: 85 is the mask for the 16-bit tile 0.
96+
// AFTER-LLVM-LOWERING: "arm_sme.intr.zero"() <{tile_mask = 85 : i32}>
9697
// AFTER-LLVM-LOWERING: scf.for
9798
// AFTER-LLVM-LOWERING-SAME: %[[C0]] to %[[SVL_H]] step %[[C1]] {
9899
// AFTER-LLVM-LOWERING: %[[MEM_DESC:.*]] = builtin.unrealized_conversion_cast %[[TILE_ALLOCA]]

0 commit comments

Comments
 (0)