sriramshastry wrote:

Thanks @arsenm, @jhuber6. Agreed: preserving the `sin` libcall in the frontend 
doesn't solve the problem, which is that intrinsics (written directly or 
recreated by optimization) have no symbol for archive resolution to find before 
the backend lowers them.

Direction I would like to try, before touching the PR:

Make the libcall dependencies visible before device LTO resolves archives, 
either by lowering the intrinsics to calls before linking (as jhuber6 
described) or by teaching LTO's runtime-libcall symbol lookup about the 
libcalls the NVPTX backend can emit. The second needs a backend declaration; 
I'd like to know which you prefer.
Diagnose any dependency that is still unresolved after the LTO input set is 
fixed, rather than failing late in the backend.
Evidence so far: with a local patch, f64 `sin` and `atan` link against a real 
LLVM-libc NVPTX `libm.a` and emit calls at `sm_120`. I have not run on a GPU, 
and f32/ThinLTO are untested.

https://github.com/llvm/llvm-project/pull/243003
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to