[clang] [llvm] [WIP][OpenMP] Remove dependency on `libffi` from offloading runtime (PR #91264)

Joseph Huber via cfe-commits cfe-commits at lists.llvm.org
Tue May 7 12:16:40 PDT 2024


jhuber6 wrote:

>
> Maybe. The message is emitted on the host, so there is something wrong with the host code or runtime library.

This might be some issue with the host codegen actually.
```console
> clang malloc.c -fopenmp -fopenmp-targets=x86_64-pc-linux-gnu                                                    
> ./a.out 
10
131675107360774
131675107360778
110294760161286
18446744073709551615
10
131675107360774
131675107360778
110294760161286
OMP: Warning #96: Cannot form a team with 48 threads, using 21 instead.
OMP: Hint Consider unsetting KMP_DEVICE_THREAD_LIMIT (KMP_ALL_THREADS), KMP_TEAMS_THREAD_LIMIT, and OMP_THREAD_LIMIT (if any are set).
> clang malloc.c -fopenmp -fopenmp-targets=x86_64-pc-linux-gnu -O3
> ./a.out 
10
6
10
6
18446744073709551615
10
6
10
6
```

With optimization on, I see what I expect. With `-O0` it seems to give me garbage. Looking at the ASM also suggests that only the `0x10` value is written for some reason? https://godbolt.org/z/86hTjjaa8 is the host-IR I get without optimizations. 

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


More information about the cfe-commits mailing list