Skip to content

Commit 9b72ac0

Browse files
committed
save work
1 parent 8728eee commit 9b72ac0

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

mlir/lib/Dialect/XeGPU/Transforms/XeGPUSubgroupDistribute.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,14 @@ namespace {
5858
//===----------------------------------------------------------------------===//
5959
// SIMT Distribution Patterns
6060
//===----------------------------------------------------------------------===//
61+
62+
/// In certain cases, we may need to favor XeGPU specific distribution patterns
63+
/// over generic vector distribution patterns. In such cases, we can assign
64+
/// priorities to patterns.
65+
enum class PatternPriority : int { Regular = 1, High = 2 };
66+
67+
/// Helper function to compute the effective lane layout from a
68+
/// DistributeLayoutAttr which can be either a LayoutAttr or a SliceAttr.
6169
static SmallVector<int64_t>
6270
computeEffectiveLaneLayout(const xegpu::DistributeLayoutAttr layout) {
6371
SmallVector<int64_t> effectiveLaneLayout;
@@ -1034,6 +1042,8 @@ struct VectorMultiReductionDistribution : public gpu::WarpDistributionPattern {
10341042
}
10351043
};
10361044

1045+
/// Distribute a `vector.shape_cast` op feeding into yield op of an enclosing
1046+
/// `gpu.warp_execute_on_lane_0` region.
10371047
struct VectorShapeCastDistribution : public gpu::WarpDistributionPattern {
10381048
using gpu::WarpDistributionPattern::WarpDistributionPattern;
10391049
LogicalResult matchAndRewrite(gpu::WarpExecuteOnLane0Op warpOp,
@@ -1098,7 +1108,7 @@ void xegpu::populateXeGPUSubgroupDistributePatterns(
10981108
GpuBarrierDistribution, VectorMultiReductionDistribution>(
10991109
patterns.getContext());
11001110
patterns.add<VectorShapeCastDistribution>(patterns.getContext(),
1101-
/*benefit=*/2);
1111+
/*benefit=*/PatternPriority::High);
11021112
}
11031113

11041114
void XeGPUSubgroupDistributePass::runOnOperation() {

0 commit comments

Comments
 (0)