[Mlir-commits] [mlir] [mlir][memref] Rewrite scalar `memref.copy` through reinterpret_cast into load/store (PR #186118)
ioana ghiban
llvmlistbot at llvm.org
Thu Mar 19 02:21:30 PDT 2026
================
@@ -0,0 +1,321 @@
+// RUN: mlir-opt -memref-bypass-reinterpret-cast %s -split-input-file
+// | FileCheck %s
+
+//===----------------------------------------------------------------------===//
+// Positive tests
+//===----------------------------------------------------------------------===//
+
+// CHECK-LABEL: func.func private @concat_zero_offset()
+func.func private @concat_zero_offset() {
+ // CHECK: %[[SRC:.*]] = memref.alloc() : memref<1x1xf32>
+ %alloc = memref.alloc() : memref<1x1xf32>
+ // CHECK: %[[DST:.*]] = memref.alloc() : memref<1x108xf32>
+ %alloc_0 = memref.alloc() : memref<1x108xf32>
+
+ // reinterpret_cast remains
----------------
ioghiban wrote:
Thank you for the suggestion. I chose to manually remove the rc after checking it has a single use (the copy which we rewrote). Do you agree with this approach?
https://github.com/llvm/llvm-project/pull/186118
More information about the Mlir-commits
mailing list