| Issue |
162733
|
| Summary |
[flang][openmp] double precision sinh fails to link when offloading to amdgpu
|
| Labels |
flang
|
| Assignees |
|
| Reporter |
VeeEM
|
```
program use_sinh
implicit none
real :: x
x = 0.5
!$omp target map(x)
x = sinh(x)
!$omp end target
print *, x
end program
```
```
$ flang -fdefault-real-8 -fopenmp --offload-arch=gfx90a use_sinh.f90
ld.lld: error: undefined symbol: sinh
>>> referenced by /tmp/a.out.amdgcn.gfx90a-1b4acf.img.lto.o:(__omp_offloading_eeba6730_c800bec3__QQmain_l5)
>>> referenced by /tmp/a.out.amdgcn.gfx90a-1b4acf.img.lto.o:(__omp_offloading_eeba6730_c800bec3__QQmain_l5)
clang: error: ld.lld command failed with exit code 1 (use -v to see invocation)
/pfs/lustrep1/scratch/project_462000700/vimaylis/llvm/install_20251009/bin/clang-linker-wrapper: error: 'clang' failed
flang-22: error: linker command failed with exit code 1 (use -v to see invocation)
```
There used to be a stub for a double precision sinh in libm, but this has since been removed, breaking sinh.
I noticed that cosh still works and that flang treats it a bit differently from sinh. For cosh a call to ROCDL is generated instead of a libm call. Changing sinh to work like cosh in this regard fixes the problem. I have a patch for this.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs