kumasento / polsca

Polyhedral High-Level Synthesis in MLIR
MIT License
29 stars 7 forks source link

[Mem2arr] fix dangling users/[Dummy] add static #46

Closed kumasento closed 3 years ago

kumasento commented 3 years ago

As in -

func @foo(%A: memref<10xf32>) {
  %c0 = arith.constant 0: index
  %0 = memref.load %A[%c0] : memref<10xf32>
  return
}
func @bar(%A: memref<10xf32>) {
  %c0 = arith.constant 0: index
  %0 = memref.load %A[%c0] : memref<10xf32>
  return
}
func @main() {
  %A = memref.alloc() : memref<10xf32>
  call @foo(%A): (memref<10xf32>) -> ()
  call @bar(%A): (memref<10xf32>) -> ()
  return
}

static is added by default to the dummy.c generated to avoid segfault in cosim.