<div dir="ltr"><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Mar 10, 2021 at 11:41 AM Johannes Doerfert <<a href="mailto:johannesdoerfert@gmail.com">johannesdoerfert@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Artem, Justin,<br>
<br>
I am running into a problem and I'm curious if I'm missing something or <br>
if the support is simply missing.<br>
Am I correct to assume the NVPTX backend does not deal with `llvm.sin` <br>
and friends?<br></blockquote><div><br></div><div><div class="gmail_default" style="font-family:verdana,sans-serif">Correct. It can't deal with anything that may need to lower to a standard library call. </div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
This is what I see, with some variations: <a href="https://godbolt.org/z/PxsEWs" rel="noreferrer" target="_blank">https://godbolt.org/z/PxsEWs</a><br>
<br>
If this is missing in the backend, is there a plan to get this working, <br>
I'd really like to have the<br>
intrinsics in the middle end rather than __nv_cos, not to mention that <br>
-ffast-math does emit intrinsics<br>
and crashes.<br></blockquote><div><br></div><div><div class="gmail_default" style="font-family:verdana,sans-serif">It all boils down to the fact that PTX does not have the standard libc/libm which LLVM could lower the calls to, nor does it have a 'linking' phase where we could link such a library in, if we had it.</div><div class="gmail_default" style="font-family:verdana,sans-serif"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif">Libdevice bitcode does provide the implementations for some of the functions (though with a __nv_ prefix) and clang links it in in order to avoid generating IR that LLVM can't handle, but that's a workaround that does not help LLVM itself.</div><div class="gmail_default" style="font-family:verdana,sans-serif"><br></div></div><div class="gmail_default" style="font-family:verdana,sans-serif">--Artem<br></div><div class="gmail_default" style="font-family:verdana,sans-serif"><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
~ Johannes<br>
<br>
<br>
-- <br>
───────────────────<br>
∽ Johannes (he/his)<br>
<br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr">--Artem Belevich</div></div></div>