[Mlir-commits] [mlir] b5936d4 - [MLIR][XeGPU] Remove verifyLayouts from sg to wi pass (#190360)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Fri Apr 3 17:00:10 PDT 2026
Author: Nishant Patel
Date: 2026-04-03T17:00:05-07:00
New Revision: b5936d49892aad74601f0d806c64252c42b5e536
URL: https://github.com/llvm/llvm-project/commit/b5936d49892aad74601f0d806c64252c42b5e536
DIFF: https://github.com/llvm/llvm-project/commit/b5936d49892aad74601f0d806c64252c42b5e536.diff
LOG: [MLIR][XeGPU] Remove verifyLayouts from sg to wi pass (#190360)
The verifyLayouts function walked the IR before distribution and failed
the pass if any XeGPU anchor op or vector-typed result was missing a
layout attribute. This was added as a temporary guard while the pass was
being developed.
Now we add target check for each op.
Added:
Modified:
mlir/lib/Dialect/XeGPU/Transforms/XeGPUSgToWiDistributeExperimental.cpp
Removed:
################################################################################
diff --git a/mlir/lib/Dialect/XeGPU/Transforms/XeGPUSgToWiDistributeExperimental.cpp b/mlir/lib/Dialect/XeGPU/Transforms/XeGPUSgToWiDistributeExperimental.cpp
index b2f51ed912dad..e3227c7f5b149 100644
--- a/mlir/lib/Dialect/XeGPU/Transforms/XeGPUSgToWiDistributeExperimental.cpp
+++ b/mlir/lib/Dialect/XeGPU/Transforms/XeGPUSgToWiDistributeExperimental.cpp
@@ -62,34 +62,6 @@ static Value castValueTo(ConversionPatternRewriter &rewriter,
return newOp.getResult(0);
}
-/// Checks if all XeGPU anchor ops and vector results have valid layouts.
-static LogicalResult verifyLayouts(Operation *root) {
- auto walkResult = root->walk([&](Operation *nestedOp) -> WalkResult {
- if (auto anchorOp = dyn_cast<xegpu::AnchorLayoutInterface>(nestedOp)) {
- auto layout = anchorOp.getAnchorLayout();
- if (!layout) {
- nestedOp->emitError("expected anchor layout attribute on operation");
- return WalkResult::interrupt();
- }
- return WalkResult::advance();
- }
- // For each vector result, check if the op contains a result layout
- // attribute.
- for (OpResult result : nestedOp->getResults()) {
- if (isa<VectorType>(result.getType())) {
- auto layout = xegpu::getDistributeLayoutAttr(result);
- if (!layout) {
- nestedOp->emitError(
- "expected result layout attribute on vector result");
- return WalkResult::interrupt();
- }
- }
- }
- return WalkResult::advance();
- });
- return walkResult.wasInterrupted() ? failure() : success();
-}
-
/// A vector::MultiDimReductionOp at subgroup level in expected form if, it has
/// exactly 1 reduction dimension, it had valid result layout attribute, and
/// result type can be distributed to lanes using the layout.
@@ -1551,14 +1523,6 @@ void XeGPUSgToWiDistributeExperimentalPass::runOnOperation() {
return;
}
- // Verify if all XeGPU anchor ops and vector ops have result layouts.
- // TODO: This can be removed once the full layout refactoring is done.
- if (failed(verifyLayouts(root))) {
- LLVM_DEBUG(DBGS() << "XeGPUSgToWiDistributeExperimentalPass: layout "
- "verification failed\n");
- signalPassFailure();
- return;
- }
// Collect existing UnrealizedConversionCastOps. These must be preserved.
llvm::SmallSetVector<UnrealizedConversionCastOp, 8> existingCasts;
root->walk(
More information about the Mlir-commits
mailing list