[Mlir-commits] [mlir] [MLIR][XeGPU] Use context-aware type converter in WgToSgDistribute and Blocking pass (PR #194685)
Nishant Patel
llvmlistbot at llvm.org
Thu May 28 07:26:06 PDT 2026
================
@@ -986,3 +842,169 @@ bool xegpu::matchSplitDimExpansion(
}
return srcIdx == src.size();
}
+
+//===----------------------------------------------------------------------===//
+// Context-aware type conversion utilities
+//===----------------------------------------------------------------------===//
+
+void xegpu::addSCFStructuralMaterializations(TypeConverter &converter) {
+ auto materializeCast = [](OpBuilder &builder, Type type, ValueRange inputs,
+ Location loc) -> Value {
+ return UnrealizedConversionCastOp::create(builder, loc, type, inputs)
+ .getResult(0);
+ };
+ // Source materialization: N:1 (N converted values -> 1 original value).
+ converter.addSourceMaterialization(materializeCast);
+ // Target materialization: 1:1 (single value type conversion).
+ converter.addTargetMaterialization(materializeCast);
+}
+
+void xegpu::addContextAwareVectorTypeConversion(
----------------
nbpatel wrote:
changed name to addVectorTypeConversion and decoupled the precomputation of while args in a different function
https://github.com/llvm/llvm-project/pull/194685
More information about the Mlir-commits
mailing list