[Mlir-commits] [mlir] [mlir][xegpu] Fix operand layouts when rematerializing on layout conflict (PR #224730)

Jianhui Li llvmlistbot at llvm.org
Thu Oct 1 16:52:17 PDT 2026


================
@@ -1652,6 +1652,36 @@ LogicalResult ResolveLayoutConflicts::assignResultLayout(OpResult &result) {
   return success();
 }
 
+// Recursively rematerialize a trivially-rematerializable producer subtree so
+// that the clone yields `layout`. Cloning only the producer would leave its
+// operands pointing at values that carry the original (conflicting) layout,
+// making the clone's operand and result layouts disagree. Stamp `layout` on the
----------------
Jianhui-Li wrote:

Please consider removing these comments describe incorrect implementation: "Cloning only the producer".  These comments are confusing. The rematerialize must be recursive here since xegpu::isTriviallyRematerializable() guarantees the producers are recursively materializable, and the path optimizes the layout conversion away by duplicating these ops, if not recursively duplicating, it defeats the optimization's purpose. 

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


More information about the Mlir-commits mailing list