Index: mlir/lib/Conversion/SCFToGPU/SCFToGPU.cpp =================================================================== --- mlir/lib/Conversion/SCFToGPU/SCFToGPU.cpp +++ mlir/lib/Conversion/SCFToGPU/SCFToGPU.cpp @@ -517,6 +517,16 @@ } cloningMap.map(iv, newIndex); } + + // Propagate custom user defined optional attributes, that can be used at + // later stage, such as extension data for GPU kernel dispatch + for (const auto &namedAttr : parallelOp.getAttrs()) { + if (namedAttr.first == gpu::getMappingAttrName() || + namedAttr.first == ParallelOp::getOperandSegmentSizeAttr()) + continue; + launchOp.setAttr(namedAttr.first, namedAttr.second); + } + Block *body = parallelOp.getBody(); worklist.reserve(worklist.size() + body->getOperations().size()); for (Operation &op : llvm::reverse(body->without_terminator()))