File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
mlir/lib/Dialect/XeGPU/Transforms Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -398,6 +398,11 @@ struct XeGPUWgToSgDistributePass
398398} // namespace
399399
400400void XeGPUWgToSgDistributePass::runOnOperation () {
401+ // Track existing UnrealizedConversionCastOps
402+ SmallVector<Operation *> existingCastOps;
403+ getOperation ()->walk ([&](UnrealizedConversionCastOp castOp) {
404+ existingCastOps.push_back (castOp.getOperation ());
405+ });
401406
402407 TypeConverter converter;
403408 converter.addConversion ([&](Type type) -> Type { return type; });
@@ -478,7 +483,10 @@ void XeGPUWgToSgDistributePass::runOnOperation() {
478483 return isLegal (layout);
479484 });
480485
481- target.addIllegalOp <UnrealizedConversionCastOp>();
486+ target.addDynamicallyLegalOp <UnrealizedConversionCastOp>(
487+ [=](UnrealizedConversionCastOp op) {
488+ return llvm::is_contained (existingCastOps, op.getOperation ());
489+ });
482490
483491 target.markUnknownOpDynamicallyLegal ([](Operation *) { return true ; });
484492
You can’t perform that action at this time.
0 commit comments