[flang-commits] [flang] [flang] Introduce omp_target_allocmem and omp_target_freemem fir ops. (PR #145464)

Kareem Ergawy via flang-commits flang-commits at lists.llvm.org
Thu Jun 26 03:49:01 PDT 2025


ergawy wrote:

Thanks @skc7 for the PR! I have a few concerns about this approach, please let me know if I am missing anything:

1. I am bit skeptical about leaking OpenMP specific ops to the `fir` dialect. The reason I see we have to do that is that we need to return a `fir_HeapType` from the `omp_target_allocmem` op, right? If there are not other reasons, why don't we introduce the op in the OpenMP dialect where it naturally fits, let it return an `Int64` type and use `fir.convert` to target type?
2. In general though, why are we introducing a new op for the runtime API? Can't we directly emit these a call ops instead of having to introduce an op and then lower the op to a call? Are we planning to use these ops later somehow in some other way than lowering to the target call?

I am probably missing some context here though so my question might not be totally informed.

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


More information about the flang-commits mailing list