[flang-commits] [flang] [flang][OpenMP] Avoid marking named main programs as declare target (PR #190250)

via flang-commits flang-commits at lists.llvm.org
Tue Apr 7 17:10:40 PDT 2026


https://github.com/agozillon approved this pull request.

This LGTM, but I am going to add @skatrak to review this as well so please wait on a second approval from him before landing.

The main reason being that we depend on the function or program (a condensed/cutdown version I believe) wrapping the target region for device side lowering to LLVM-IR and we filter it out by having device_type host on a declare target attribute.

>From my understanding this behavior is kept in this PR though, and we're avoiding accidentally pushing it to device_type(any) (which is problematic as you've shown as the function will not be discarded as intended) in scenarios like the reproducer with this fix.

Mainly just wanting a second set of eyes that's more up-to-date with the function discard mechanism we have, but otherwise it looks reasonable to me, thank you very much for the fix  :-) 



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


More information about the flang-commits mailing list