[Mlir-commits] [mlir] [WIP][flang][OpenMP] Translate OpenMP scopes when compiling for target device (PR #130078)

Sergio Afonso llvmlistbot at llvm.org
Thu Mar 6 07:20:49 PST 2025


https://github.com/skatrak commented:

Thank you for this work Kareem. I think this approach should work, but we need to keep an eye out in case there are other edge cases that break this, since we're translating inapplicable operations that we discard later.

Long term, I think we should try to go the opposite direction and keep as few host operations as we can get away with (possibly just `omp.map.info`, `omp.map.bounds`, global definitions and recipe ops, like `omp.declare_reduction`, `omp.private`, etc). The root issue appears to be that we're gathering non-static map information during compilation for both host and device that only actually exists in the host and is only used there, and this wasn't crashing the compiler because top-level operations inside of an `llvm.func` are translated to LLVM IR. I think we should probably work on avoiding doing that and to stop keeping and translating these top-level operations at all, but something for the near future IMO.

One other nit: We would probably want to rename `convertTargetOpsInNest` to something like `convertHostOpsForDevice`, since that's what it would be doing now.

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


More information about the Mlir-commits mailing list