================
@@ -2053,24 +2041,11 @@ void XeGPUSubgroupDistributePass::runOnOperation() {
// 1) It is assumed that there are no layout conflicts.
// 2) Any existing layout attributes attached to the operands are ignored.
Operation *op = getOperation();
- op->walk([&](Operation *op) {
- for (OpOperand &operand : op->getOpOperands()) {
- // Layouts are needed for vector type only.
- if (!isa<VectorType>(operand.get().getType()))
- continue;
- if (isa<xegpu::LoadMatrixOp, xegpu::StoreMatrixOp>(op))
- continue;
-
- auto layout = xegpu::getDistributeLayoutAttr(operand.get());
- if (!layout) {
- op->emitError("Could not find layout attribute for operand ")
- << operand.getOperandNumber() << " of operation " << op->getName();
- signalPassFailure();
- return;
- }
- xegpu::setDistributeLayoutAttr(operand, layout);
- }
- });
+ if (!xegpu::localPropagateLayoutsFromAnchor(op)) {
----------------
Jianhui-Li wrote:
Change name to "recoverLocalLayouts".
Yes every pass should call this method upfront.
https://github.com/llvm/llvm-project/pull/172125
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits