1
- From e689c226f0d1cfc3353225e2c9f0c45d307fd960 Mon Sep 17 00:00:00 2001
1
+ From 6a3b9a4936f774957b6a1cedcae40a355fb9670e Mon Sep 17 00:00:00 2001
2
2
From: Garra1980 <
[email protected] >
3
- Date: Tue, 5 Aug 2025 23:19:34 +0200
3
+ Date: Wed, 20 Aug 2025 01:20:08 +0200
4
4
Subject: [PATCH] xegpu temporary downstream defintion changes and vec
5
5
6
6
---
7
- mlir/include/mlir/Dialect/XeGPU/IR/XeGPUOps.td | 6 + +++++
8
- mlir/lib/Conversion/VectorToXeGPU/VectorToXeGPU.cpp | 7 ++++++-
9
- mlir/lib/Dialect/XeGPU/IR/XeGPUOps.cpp | 7 ++++---
10
- 3 files changed, 16 insertions(+), 4 deletions(-)
7
+ mlir/include/mlir/Dialect/XeGPU/IR/XeGPUOps.td | 5 +++++
8
+ mlir/lib/Conversion/VectorToXeGPU/VectorToXeGPU.cpp | 7 ++++++-
9
+ mlir/lib/Dialect/XeGPU/IR/XeGPUOps.cpp | 10 ++++++- ---
10
+ 3 files changed, 17 insertions(+), 5 deletions(-)
11
11
12
12
diff --git a/mlir/include/mlir/Dialect/XeGPU/IR/XeGPUOps.td b/mlir/include/mlir/Dialect/XeGPU/IR/XeGPUOps.td
13
- index 7f4d4f1381df..ebd4f1a3f66a 100644
13
+ index eb54d6887681..b849c6b97d9d 100644
14
14
--- a/mlir/include/mlir/Dialect/XeGPU/IR/XeGPUOps.td
15
15
+++ b/mlir/include/mlir/Dialect/XeGPU/IR/XeGPUOps.td
16
- @@ -373 ,6 +373 ,7 @@ def XeGPU_LoadNdOp : XeGPU_Op<"load_nd", [
16
+ @@ -329 ,6 +329 ,7 @@ def XeGPU_LoadNdOp : XeGPU_Op<"load_nd", [
17
17
OptionalAttr<DenseI64ArrayAttr>: $const_offsets,
18
18
OptionalAttr<UnitAttr>: $packed,
19
19
OptionalAttr<DenseI64ArrayAttr>: $transpose,
20
20
+ OptionalAttr<I32Attr>: $transpose_bit_width,
21
21
OptionalAttr<XeGPU_CacheHintAttr>: $l1_hint,
22
22
OptionalAttr<XeGPU_CacheHintAttr>: $l2_hint,
23
23
OptionalAttr<XeGPU_CacheHintAttr>: $l3_hint);
24
- @@ -1147,4 +1148 ,9 @@ def XeGPU_ConvertLayoutOp : XeGPU_Op<"convert_layout", [Pure, AllTypesMatch<["sou
25
- let hasCanonicalizer = 1;
24
+ @@ -1260,5 +1261 ,9 @@ def XeGPU_MemDescSubviewOp : XeGPU_Op<"mem_desc_subview",
25
+ let hasVerifier = 1;
26
26
}
27
27
28
28
+ def XeGPU_CompileHintOp : XeGPU_Op<"compile_hint", []> {
29
29
+ let summary = "prevents the compiler from scheduling.";
30
30
+ let assemblyFormat = [{ attr-dict }];
31
31
+ }
32
- +
32
+
33
33
#endif // MLIR_DIALECT_XEGPU_IR_XEGPUOPS_TD
34
34
diff --git a/mlir/lib/Conversion/VectorToXeGPU/VectorToXeGPU.cpp b/mlir/lib/Conversion/VectorToXeGPU/VectorToXeGPU.cpp
35
- index 80107554144c..4050a12f2eb8 100644
35
+ index 819c2e5973ff..545f1d77156c 100644
36
36
--- a/mlir/lib/Conversion/VectorToXeGPU/VectorToXeGPU.cpp
37
37
+++ b/mlir/lib/Conversion/VectorToXeGPU/VectorToXeGPU.cpp
38
- @@ -201 ,7 +201 ,9 @@ struct TransferReadLowering : public OpRewritePattern<vector::TransferReadOp> {
38
+ @@ -485 ,7 +485 ,9 @@ struct TransferReadLowering : public OpRewritePattern<vector::TransferReadOp> {
39
39
// By default, no specific caching policy is assigned.
40
40
xegpu::CachePolicyAttr hint = nullptr;
41
41
auto loadOp = xegpu::LoadNdOp::create(rewriter, loc, vecTy, ndDesc,
@@ -45,7 +45,7 @@ index 80107554144c..4050a12f2eb8 100644
45
45
/*l1_hint=*/hint,
46
46
/*l2_hint=*/hint, /*l3_hint=*/hint);
47
47
rewriter.replaceOp(readOp, loadOp);
48
- @@ -270 ,7 +272 ,10 @@ struct LoadLowering : public OpRewritePattern<vector::LoadOp> {
48
+ @@ -569 ,7 +571 ,10 @@ struct LoadLowering : public OpRewritePattern<vector::LoadOp> {
49
49
// By default, no specific caching policy is assigned.
50
50
xegpu::CachePolicyAttr hint = nullptr;
51
51
auto loadNdOp = xegpu::LoadNdOp::create(
@@ -58,29 +58,39 @@ index 80107554144c..4050a12f2eb8 100644
58
58
/*l2_hint=*/hint, /*l3_hint=*/hint);
59
59
rewriter.replaceOp(loadOp, loadNdOp);
60
60
diff --git a/mlir/lib/Dialect/XeGPU/IR/XeGPUOps.cpp b/mlir/lib/Dialect/XeGPU/IR/XeGPUOps.cpp
61
- index 33450f3fa229..528b9d55ee61 100644
61
+ index 906c71d8b8da..ecee53c56a54 100644
62
62
--- a/mlir/lib/Dialect/XeGPU/IR/XeGPUOps.cpp
63
63
+++ b/mlir/lib/Dialect/XeGPU/IR/XeGPUOps.cpp
64
- @@ -65 ,6 +65 ,7 @@ static bool isWriteHintOrNone(const CachePolicyAttr &attr) {
64
+ @@ -78 ,6 +78 ,7 @@ static bool isWriteHintOrNone(const CachePolicyAttr &attr) {
65
65
return true;
66
66
auto kind = attr.getValue();
67
67
return kind == CachePolicy::CACHED || kind == CachePolicy::UNCACHED ||
68
68
+ kind == CachePolicy::STREAMING ||
69
69
kind == CachePolicy::WRITE_BACK || kind == CachePolicy::WRITE_THROUGH;
70
70
}
71
71
72
- @@ -419 ,8 +420 ,8 @@ void LoadNdOp::build(OpBuilder &builder, OperationState &state, Type retType,
72
+ @@ -438 ,8 +439 ,8 @@ void LoadNdOp::build(OpBuilder &builder, OperationState &state, Type retType,
73
73
xegpu::CachePolicyAttr l3_hint) {
74
74
75
75
return build(builder, state, retType, tensorDesc, ValueRange(),
76
76
- DenseI64ArrayAttr(), packed, transpose, l1_hint, l2_hint,
77
77
- l3_hint);
78
- + DenseI64ArrayAttr(), packed, transpose, nullptr,
78
+ + DenseI64ArrayAttr(), packed, transpose, nullptr, /*transpose_bit_width*/
79
79
+ l1_hint, l2_hint, l3_hint);
80
80
}
81
81
82
+ void LoadNdOp::build(OpBuilder &builder, OperationState &state, Type retType,
83
+ @@ -455,7 +456,8 @@ void LoadNdOp::build(OpBuilder &builder, OperationState &state, Type retType,
84
+ auto staticOffsetsAttr = builder.getDenseI64ArrayAttr(staticOffsets);
85
+
86
+ build(builder, state, retType, tensorDesc, dynamicOffsets, staticOffsetsAttr,
87
+ - packed, transpose, l1_hint, l2_hint, l3_hint);
88
+ + packed, transpose, nullptr, /*transpose_bit_width*/
89
+ + l1_hint, l2_hint, l3_hint);
90
+ }
91
+
82
92
LogicalResult LoadNdOp::verify() {
83
- @@ -482 ,7 +483 ,7 @@ LogicalResult LoadNdOp::verify() {
93
+ @@ -517 ,7 +519 ,7 @@ LogicalResult LoadNdOp::verify() {
84
94
mlir::emitWarning(getLoc()) << "Invalid transpose attr. It is ignored.";
85
95
}
86
96
0 commit comments