Skip to content

Commit

Permalink
Revert unintended changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
silee2 committed Nov 16, 2023
1 parent a082e62 commit bbe117e
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 13 deletions.
16 changes: 12 additions & 4 deletions lib/Conversion/XeGPUToSPIRV/XeGPUToSPIRV.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,10 @@ void lookupOrInsertIntrinsic(ConversionPatternRewriter &rewriter, Operation *op,
}
}

/// @brief
/// convert the tensor descriptor to [2xi64] which is of the format
/// -> [base pointer: i64, offsetX: i32, offsetY: i32] for 2D tensor desc
/// -> [base pointer: i64, unused] for 1D and scattered tensor desc
class CreateNdDescToVCPattern : public OpConversionPattern<CreateNdDescOp> {
public:
using OpConversionPattern<CreateNdDescOp>::OpConversionPattern;
Expand Down Expand Up @@ -494,7 +498,7 @@ class LoadStorePrefetchNdToLsc : public OpConversionPattern<OpType> {
}
};

xegpu::CreateNdDescOp findDescOp(mlir::Value val) {
std::optional<xegpu::CreateNdDescOp> findDescOp(mlir::Value val) {
if (auto op = val.getDefiningOp()) {
if (auto descOp = dyn_cast<xegpu::CreateNdDescOp>(op)) {
return descOp;
Expand All @@ -506,9 +510,9 @@ xegpu::CreateNdDescOp findDescOp(mlir::Value val) {
auto forOp = cast<scf::ForOp>(ownerOp);
auto init = forOp.getInits()[arg.getArgNumber() - 1];
return findDescOp(init);
} else {
assert(0 && "add more support");
}
// Add more support
return std::nullopt;
}

template <typename OpType>
Expand Down Expand Up @@ -602,8 +606,12 @@ class LoadStorePrefetchNdToRawSend : public OpConversionPattern<OpType> {
}
auto msg = createIntConstant(i32Type, rawSendMsg);
// payload
// payload is v8i32 = [base:i64, surfaceWidth:i32, surfaceHeight:i32,
// surefacePitch:i32, offsetX:i32, offsetY:i32, blockInfo:i32]
// the base/surfaceInfo/blockInfo are staticly from the tensor desc
// while the offsetX/Y are dynamicly udpated
auto insertPoint = rewriter.saveInsertionPoint();
CreateNdDescOp createDescOp = findDescOp(op.template getTensorDesc());
CreateNdDescOp createDescOp = *findDescOp(op.template getTensorDesc());
rewriter.setInsertionPointAfter(createDescOp);
auto v8i32 = VectorType::get(8, i32Type);
auto v4i64 = VectorType::get(4, i64Type);
Expand Down
2 changes: 1 addition & 1 deletion lib/Conversion/XeTileToXeGPU/SCFOpConversion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ bool isLegalSCFOp(mlir::Operation *op) {

if (llvm::isa<mlir::scf::YieldOp>(op)) {
auto yieldOp = llvm::cast<mlir::scf::YieldOp>(op);
for (auto arg : yieldOp.getResults()) {
for (const auto &arg : yieldOp.getResults()) {
auto type = arg.getType();
result &= !type.isa<imex::xetile::TileType>();
if (type.isa<mlir::VectorType>())
Expand Down
2 changes: 1 addition & 1 deletion lib/Conversion/XeTileToXeGPU/XeTileOpConversion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ struct SgUpdateTileOffsetOpPattern
auto tiles = adaptor.getTile();

llvm::SmallVector<mlir::Value> xegpuOps;
for (auto tile : tiles) {
for (const auto &tile : tiles) {
auto xegpuTile = rewriter.create<xegpu::UpdateNDOffsetOp>(
op.getLoc(), tile.getType(), tile, mlir::ValueRange{offsetX, offsetY},
imex::xegpu::Mode::VC);
Expand Down
9 changes: 2 additions & 7 deletions test/Integration/Dialect/XeGPU/lit.local.cfg
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
local_excludes = [
'gemm_1024x1024xf16.mlir',
'gemm_1024x1016x1016_f16_f16_f32.mlir',
'load2d_dpas_store2d.mlir',
'load2d-padding-f32.mlir',
'load2d-padding.mlir'
]
local_excludes = ['gemm_1024x1024xf16.mlir']

config.excludes.update(local_excludes)

0 comments on commit bbe117e

Please sign in to comment.