[all-commits] [llvm/llvm-project] bfda0e: [mlir][EmitC] Expand the MemRefToEmitC pass - Lowe...

Jaden Angella via All-commits all-commits at lists.llvm.org
Thu Aug 14 05:26:17 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: bfda0e777de985e9412317be190bdbbe504dd9dd
      https://github.com/llvm/llvm-project/commit/bfda0e777de985e9412317be190bdbbe504dd9dd
  Author: Jaden Angella <ajaden at google.com>
  Date:   2025-08-14 (Thu, 14 Aug 2025)

  Changed paths:
    M mlir/include/mlir/Conversion/MemRefToEmitC/MemRefToEmitC.h
    M mlir/lib/Conversion/MemRefToEmitC/MemRefToEmitC.cpp
    M mlir/lib/Conversion/MemRefToEmitC/MemRefToEmitCPass.cpp
    A mlir/test/Conversion/MemRefToEmitC/memref-to-emitc-alloc-copy.mlir
    A mlir/test/Conversion/MemRefToEmitC/memref-to-emitc-copy.mlir
    M mlir/test/Conversion/MemRefToEmitC/memref-to-emitc-failed.mlir

  Log Message:
  -----------
  [mlir][EmitC] Expand the MemRefToEmitC pass - Lowering `CopyOp` (#151206)

This patch lowers `memref.copy` to `emitc.call_opaque "memcpy"`.
From:
```
func.func @copying(%arg0 : memref<9x4x5x7xf32>, %arg1 : memref<9x4x5x7xf32>) {
  memref.copy %arg0, %arg1 : memref<9x4x5x7xf32> to memref<9x4x5x7xf32>
  return
}
```
To:
```cpp
#include <cstring>
void copying(float v1[9][4][5][7], float v2[9][4][5][7]) {
  size_t v3 = 0;
  float* v4 = &v2[v3][v3][v3][v3];
  float* v5 = &v1[v3][v3][v3][v3];
  size_t v6 = sizeof(float);
  size_t v7 = 1260;
  size_t v8 = v6 * v7;
  memcpy(v5, v4, v8);
  return;
}
```



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list