[Openmp-commits] [llvm] [openmp] [OpenMP][offload] Inline target reductions (PR #196061)

Robert Imschweiler via Openmp-commits openmp-commits at lists.llvm.org
Thu May 7 14:52:25 PDT 2026


ro-i wrote:

Update: it's not an attribute issue, that's just a rather imprecise diagnostic message that is being emitted there.
The same compile line I used [here](https://github.com/llvm/llvm-project/pull/196061#issuecomment-4398654689) combined with `-Xoffload-linker -mllvm=-amdgpu-inline-max-bb=5000` leads to inlining:

```
offload/test/offloading/multiple_reductions.cpp:120:67: '__kmpc_nvptx_teams_reduce_nowait_v2' inlined into '__omp_offloading_821_5185a1d_main_l120' with (cost=2200, threshold=46475) at callsite __omp_offloading_821_5185a1d_main_l120_omp_outlined:0:67 @ __omp_offloading_821_5185a1d_main_l120:0:1;
offload/test/offloading/multiple_reductions.cpp:33:67: '__kmpc_nvptx_teams_reduce_nowait_v2' inlined into '__omp_offloading_821_5185a1d__Z8run_typeIdEvv_l33' with (cost=2200, threshold=46475) at callsite __omp_offloading_821_5185a1d__Z8run_typeIdEvv_l33_omp_outlined:0:67 @ __omp_offloading_821_5185a1d__Z8run_typeIdEvv_l33:0:1;
offload/test/offloading/multiple_reductions.cpp:42:67: '__kmpc_nvptx_teams_reduce_nowait_v2' inlined into '__omp_offloading_821_5185a1d__Z8run_typeIdEvv_l42' with (cost=2200, threshold=46475) at callsite __omp_offloading_821_5185a1d__Z8run_typeIdEvv_l42_omp_outlined:0:67 @ __omp_offloading_821_5185a1d__Z8run_typeIdEvv_l42:0:1;
offload/test/offloading/multiple_reductions.cpp:50:67: '__kmpc_nvptx_teams_reduce_nowait_v2' inlined into '__omp_offloading_821_5185a1d__Z8run_typeIdEvv_l50' with (cost=2200, threshold=46475) at callsite __omp_offloading_821_5185a1d__Z8run_typeIdEvv_l50_omp_outlined:0:67 @ __omp_offloading_821_5185a1d__Z8run_typeIdEvv_l50:0:1;
...
```

The thresholds seems to be firing for these functions

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


More information about the Openmp-commits mailing list