Skip to content

Commit b88dfb0

Browse files
authored
Revert "[MLIR][XeGPU] Add unroll patterns and blocking pass for XeGPU [2/N]" (#142459)
Reverts #140163
1 parent f99e76b commit b88dfb0

File tree

10 files changed

+48
-965
lines changed

10 files changed

+48
-965
lines changed

mlir/include/mlir/Dialect/XeGPU/IR/XeGPUAttrs.td

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -295,17 +295,11 @@ def XeGPU_LayoutAttr : XeGPUAttr<"Layout", "layout"> {
295295
}
296296

297297
LayoutAttr dropSgLayoutAndData() {
298-
// avoid every field of the attribute is nullptr, which may lead to segment fault
299-
if (!getInstData() && !getLaneLayout())
300-
return nullptr;
301298
return LayoutAttr::get(getContext(), nullptr, nullptr, getInstData(),
302299
getLaneLayout(), getLaneData(), getOrder());
303300
}
304301

305302
LayoutAttr dropInstData() {
306-
// avoid every field of the attribute is nullptr, which may lead to segment fault
307-
if (!getSgLayout() && !getLaneLayout())
308-
return nullptr;
309303
return LayoutAttr::get(getContext(), getSgLayout(), getSgData(), nullptr,
310304
getLaneLayout(), getLaneData(), getOrder());
311305
}

mlir/include/mlir/Dialect/XeGPU/Transforms/Passes.td

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,4 @@ def XeGPUWgToSgDistribute : Pass<"xegpu-wg-to-sg-distribute"> {
4545
"gpu::GPUDialect", "index::IndexDialect"];
4646
}
4747

48-
def XeGPUBlocking: Pass<"xegpu-blocking"> {
49-
let summary = "Block XeGPU ops into smaller size.";
50-
let description = [{
51-
This pass partitions operations that process large shapes into multiple
52-
operations on smaller shapes, as specified by the inst_data in the layout
53-
attribute. This enables each resulting operation to be efficiently mapped
54-
to a hardware instruction.
55-
}];
56-
let dependentDialects = [
57-
"memref::MemRefDialect", "xegpu::XeGPUDialect", "vector::VectorDialect"
58-
];
59-
}
60-
6148
#endif // MLIR_DIALECT_XEGPU_TRANSFORMS_PASSES_TD

mlir/include/mlir/Dialect/XeGPU/Utils/XeGPUUtils.h

Lines changed: 0 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,6 @@
1313
namespace mlir {
1414

1515
class VectorType;
16-
class OpOperand;
17-
class OpResult;
18-
class OpBuilder;
19-
class ValueRange;
20-
class TypeConverter;
21-
2216
namespace xegpu {
2317
class LayoutAttr;
2418
class TensorDescType;
@@ -56,59 +50,6 @@ FailureOr<VectorType> getDistributedVectorType(xegpu::TensorDescType tdescTy);
5650
FailureOr<VectorType> getDistributedVectorType(VectorType originalType,
5751
LayoutAttr layout);
5852

59-
/// Return the attribute name for the OpOperand to attach LayoutAttr
60-
std::string getLayoutName(const OpOperand &operand);
61-
62-
/// Return the attribute name for the OpResult to attach LayoutAttr
63-
std::string getLayoutName(const OpResult result);
64-
65-
/// Retrieves the LayoutAttr associated with a given Value. For TensorDescType
66-
/// values, the LayoutAttr is extracted from the TensorDescType itself. For
67-
/// other values, it is obtained from the attributes of the defining operation.
68-
/// Returns nullptr if no LayoutAttr is found.
69-
LayoutAttr getLayoutAttr(const Value value);
70-
71-
/// Retrieves the LayoutAttr associated with a given OpOperand. It will
72-
/// first check the operand_layout_{id} of the owner operation. If not found,
73-
/// it will check the operand itself and its defining op.
74-
LayoutAttr getLayoutAttr(const OpOperand &opr);
75-
76-
/// Sets the LayoutAttr for a given OpOperand or OpResult by attaching
77-
/// it to the owner's dictionary attributes
78-
template <typename T,
79-
typename = std::enable_if_t<std::is_same_v<T, OpOperand> ||
80-
std::is_same_v<T, OpResult>>>
81-
void setLayoutAttr(const T &operandOrResult, const LayoutAttr layout);
82-
83-
/// Set the LayoutAttr for each OpOperand and OpResult of the given operation.
84-
/// If the operation contains regions, it is also applied recursively to the
85-
/// contained operations
86-
void setLayoutAttrs(Operation *op,
87-
function_ref<LayoutAttr(Value)> getLayoutImpl);
88-
89-
/// Extract a set of small vectors from a value with a given shape using
90-
/// vector.extract_stride_slice
91-
SmallVector<Value> extractVectorsWithShapeFromValue(OpBuilder &builder,
92-
Location loc, Value value,
93-
ArrayRef<int64_t> shape);
94-
95-
/// Create a vector of shape from a set of values using
96-
/// vector.insert_stride_slice.
97-
Value createVectorWithShapeFromValues(OpBuilder &builder, Location loc,
98-
ValueRange values,
99-
ArrayRef<int64_t> shape);
100-
101-
/// Do type conversion for SCF structural ops, e.g., scf.for using SCF structure
102-
/// type convertion patterns. Since VectorType cannot carry the layout
103-
/// attribute, which is needed to guide the type conversion for XeGPU, they are
104-
/// first converted into RankedTensorType, where the layout attribute can be
105-
/// attached. And then upstream SCF structural type conversion patterns are
106-
/// applied with the provided converter.
107-
/// TODO: This is a temporary solution. We should refactor it when context-aware
108-
/// type conversion is available.
109-
void doSCFStructuralTypeConversionWithTensorType(Operation *op,
110-
TypeConverter converter);
111-
11253
} // namespace xegpu
11354

11455
} // namespace mlir

mlir/lib/Dialect/XeGPU/Transforms/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
add_mlir_dialect_library(MLIRXeGPUTransforms
2-
XeGPUBlocking.cpp
32
XeGPUFoldAliasOps.cpp
43
XeGPUSubgroupDistribute.cpp
54
XeGPUUnroll.cpp

0 commit comments

Comments
 (0)