[Mlir-commits] [mlir] [mlir][xegpu] Add initial support for layout conflict handling. (PR #173090)

Charitha Saumya llvmlistbot at llvm.org
Tue Jan 20 09:29:06 PST 2026


================
@@ -1180,6 +1181,77 @@ void RunLayoutInfoPropagation::printAnalysisResult(llvm::raw_ostream &os) {
     printFunctionResult(funcOp);
 }
 
+namespace {
+
+//===----------------------------------------------------------------------===//
+// ResolveLayoutConflicts
+//===----------------------------------------------------------------------===//
+struct ResolveLayoutConflicts {
+  ResolveLayoutConflicts(Operation *parentOp)
+      : parentOp(parentOp), builder(parentOp->getContext()) {}
+  LogicalResult run();
+
+private:
+  Operation *parentOp;
+  OpBuilder builder;
+  LogicalResult resolveLoadNdOp(xegpu::LoadNdOp loadNdOp);
+};
+
+} // namespace
+
+LogicalResult ResolveLayoutConflicts::run() {
+  auto r = parentOp->walk([&](Operation *op) -> WalkResult {
+    TypeSwitch<Operation *>(op).Case([&](xegpu::LoadNdOp loadNdOp) {
----------------
charithaintc wrote:

it is easier to scan from the consumer side and check for conflicts rather that from producer (cerate_nd) side.

I did not have an example for prefetch or store nd in my use case, but I can add support for them. it will be the same code, so the type switch can cover more op types. No changes in the core logic are needed to support them.  

https://github.com/llvm/llvm-project/pull/173090


More information about the Mlir-commits mailing list