Skip to content

Commit a19f60f

Browse files
committed
Fix pre-commit
1 parent 6d4aa6a commit a19f60f

File tree

2 files changed

+12
-14
lines changed

2 files changed

+12
-14
lines changed

lib/Dialect/XeTile/Transforms/WgToSg.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -585,9 +585,9 @@ class WGToSGVectorTranspose
585585
// 3. Load the vector from slm using the result layout
586586

587587
// Example:
588-
// WG IR
589-
// #wg_map_b = #xetile.wg_map<sg_layout = [8, 4], sg_data = [32, 64]>
590-
// #wg_map_a = #xetile.wg_map<sg_layout = [32, 1], sg_data = [8, 256]>
588+
// WG IR
589+
// #wg_map_b = #xetile.wg_map<sg_layout = [8, 4], sg_data = [32, 64]>
590+
// #wg_map_a = #xetile.wg_map<sg_layout = [32, 1], sg_data = [8, 256]>
591591
// %vector_a = xetile.tile_conv_layout %vector_b {wg_map_result = #wg_map_a, wg_map_source = #wg_map_b}: vector<256x256xfloat> into vector<256x256xfloat>
592592

593593
// SG IR
@@ -613,7 +613,7 @@ class WGToSGXeTileConvertLayout
613613
auto elemTy = resType.getElementType();
614614
auto resShape = resType.getShape();
615615

616-
auto dstMapAttr =
616+
auto dstMapAttr =
617617
llvm::dyn_cast_or_null<xetile::WorkGroupMapAttr>(op->getAttr("wg_map_result"));
618618

619619
xetile::WorkGroupMapAttr srcMapAttr;
@@ -622,7 +622,7 @@ class WGToSGXeTileConvertLayout
622622
if (!dstMapAttr) {
623623
return mlir::failure();
624624
}
625-
625+
626626
if(!srcMapAttr) {
627627
// Get the map from operand
628628
auto operand = op.getSource().getDefiningOp();
@@ -642,7 +642,7 @@ class WGToSGXeTileConvertLayout
642642
return rewriter.create<mlir::arith::ConstantOp>(loc, type, attr);
643643
};
644644

645-
rewriter.setInsertionPoint(op);
645+
rewriter.setInsertionPoint(op);
646646
// Allocate SLM
647647
// TODO: Allocate slm as 1D array of i8, and then create the expected view on it.
648648
auto slmTy = mlir::MemRefType::get({resShape[0], resShape[1]}, elemTy, {}, 3);
@@ -675,25 +675,25 @@ class WGToSGXeTileConvertLayout
675675
nullptr /*scatterAttr*/);
676676
xetile::TileType srcTileTy =
677677
imex::xetile::TileType::get({srcMapSgData[0], srcMapSgData[1]}, elemTy, attr);
678-
678+
679679
auto storeOffsetX = rewriter.createOrFold<mlir::index::MulOp>(
680680
loc, storeSgIdX, createIndexConstant(indexType, srcMapSgData[0]));
681681
auto storeOffsetY = rewriter.createOrFold<mlir::index::MulOp>(
682-
loc, storeSgIdY, createIndexConstant(indexType, srcMapSgData[1]));
682+
loc, storeSgIdY, createIndexConstant(indexType, srcMapSgData[1]));
683683
auto storeInitTileOp = rewriter.create<xetile::InitTileOp>(
684684
loc, srcTileTy, slm, llvm::ArrayRef<mlir::OpFoldResult>({storeOffsetX, storeOffsetY}));
685685
rewriter.create<xetile::StoreTileOp>(loc, adaptor.getSource()[0],
686686
storeInitTileOp);
687687

688688
// Add barrier
689689
rewriter.create<mlir::gpu::BarrierOp>(loc);
690-
690+
691691
// Load from SLM with result map
692692
xetile::TileType dstTileTy =
693693
imex::xetile::TileType::get({dstMapSgData[0], dstMapSgData[1]}, elemTy, attr);
694694
auto newResTy =
695695
mlir::VectorType::get({dstMapSgData[0], dstMapSgData[1]}, elemTy);
696-
696+
697697
auto dstMapDimY = createIndexConstant(indexType, dstSgLayout[1]);
698698
auto loadSgIdX = rewriter.create<mlir::index::FloorDivSOp>(loc, sgId, dstMapDimY);
699699
auto loadSgIdY = rewriter.create<mlir::index::RemUOp>(loc, sgId, dstMapDimY);
@@ -705,7 +705,7 @@ class WGToSGXeTileConvertLayout
705705
loc, dstTileTy, slm, llvm::ArrayRef<mlir::OpFoldResult>({loadOffsetX, loadOffsetY}));
706706
auto loadTile = rewriter.create<xetile::LoadTileOp>(
707707
loc, newResTy, loadInitTileOp, mlir::Attribute());
708-
708+
709709
rewriter.replaceOp(op, loadTile);
710710
return mlir::success();
711711
}

test/Dialect/XeTile/Transforms/wg_to_sg_convert_layout.mlir

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,5 @@ gpu.module @test_convert_layout{
3232
%convert_layout = xetile.convert_layout %cst {wg_map_result = #xetile.wg_map<sg_layout = [32, 1], sg_data = [8, 256]>, wg_map_source = #xetile.wg_map<sg_layout = [8, 4], sg_data = [32, 64]>} : vector<256x256xf32>
3333
%add = arith.addf %cst_temp, %convert_layout {map = #xetile.wg_map<sg_layout = [32, 1], sg_data = [8, 256]>} : vector<256x256xf32>
3434
gpu.return
35-
}
35+
}
3636
}
37-
38-

0 commit comments

Comments
 (0)