[llvm] [OpenMP] Analyze the loop-body callback of the static-loop runtime entries (PR #211287)

Spencer Bryngelson via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 31 05:44:28 PDT 2026


sbryngelson wrote:

Ping @jdoerfert @shiltian @skatrak @abidh. Open since 07-22, no review yet.

Short version: `AAKernelInfo` treats the loop-body callback passed to the `__kmpc_*_static_loop_*` entries as opaque, so `MayUseNestedParallelism` is written as 1 for any kernel whose parallel region contains a device workshare loop, where it should be 0. The callback is a direct function operand, so it can just be resolved, the same way the `__kmpc_parallel_60` handling already treats its parallel-region operand a few lines away. Only flang lowers through these entries, so flang and clang kernels disagree on identical source.

Effect on the #211132 reproducer, gfx90a: VGPRs 212 to 94, scratch 48 to 0 B/lane, occupancy 2 to 5. End-to-end 1.28x to 1.47x on MFC at gfx942.

Rebased onto current main and green. The earlier red AArch64 mark was an unrelated lldb flake, not this change.


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


More information about the llvm-commits mailing list