[Mlir-commits] [mlir] [mlir][memref] Rewrite scalar `memref.copy` through reinterpret_cast into load/store (PR #186118)

Andrzej WarzyƄski llvmlistbot at llvm.org
Thu Mar 19 02:51:34 PDT 2026


================
@@ -11,6 +11,17 @@
 
 include "mlir/Pass/PassBase.td"
 
+def ElideReinterpretCastPass : Pass<"memref-elide-reinterpret-cast"> {
+  let summary = "Replace ops depending on redundant reinterpret_cast(s) to be "
+                "convertible to EmitC.";
+  let description = [{
+  Replace ops that move data and depend on redundant memref.reinterpret_cast(s)
+  to provide compatible shapes with other ops that achieve similar data movement,
+  without requiring memref.reinterpret_cast(s). This helps simplify the conversion
+  to EmitC.";
----------------
banach-space wrote:

[ultra-nit] The current wording is correct, but could be simplified a bit.
```suggestion
Replace data-movement ops that depend on redundant memref.reinterpret_cast operations to obtain compatible shapes with equivalent ops that operate on compatible shapes directly. This simplifies conversion to EmitC.
```

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


More information about the Mlir-commits mailing list