<div dir="ltr"><div><div><div>If I'm not mistaken, legalization will introduce the libcalls as per the call to `InitLibcallNames()` in `TargetLoweringBase::TargetLoweringBase()` (or anything your target overrides). This would seem to imply that your target doesn't have i64 as a legal type (or at the very least, shift-right-logical is not legal for i64 types on your target).<br><br></div>For an example of how this ends up in the code, you can compile a program such as this with triple -mtriple=powerpc64le-unknown-unknown<br>```<br>define ppc_fp128 @test(ppc_fp128 %a, ppc_fp128 %b) {<br>entry:<br> %add = fadd ppc_fp128 %a, %b<br> ret ppc_fp128 %add<br>}<br>```<br></div>You can see when the result type of the `fadd` is legalized, a libcall is added to the SDAG (since ppcf128 is not a legal type - no registers on PPC for it).<br><br></div>I hope this helps (and I hope I'm not misleading you here).<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, May 19, 2017 at 9:44 AM, 陳韋任 via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Hi All,</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"> I am looking at a linker error under O2:</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default"><font face="arial, helvetica, sans-serif"> </font><span style="font-family:arial,sans-serif;color:rgb(84,84,84)"> </span><font color="#000000">undefined symbol __lshrdi3</font></div><div class="gmail_default"><font color="#000000"><br></font></div><div class="gmail_default"><font color="#000000">I have two questions here:</font></div><div class="gmail_default"><font color="#000000"><br></font></div><div class="gmail_default"><font color="#000000"> 1. Does that mean our libgcc (?) doesn't implement __lshrdi3? Or more generally, why I have</font></div><div class="gmail_default"><font color="#000000"> such linker error?</font></div><div class="gmail_default"><font color="#000000"><br></font></div><div class="gmail_default"><font color="#000000"> 2. Seems some operations are combined, and replaced with </font><span style="color:rgb(0,0,0)">__lshrdi3 call. I am interested in</span></div><div class="gmail_default"><span style="color:rgb(0,0,0)"> when such </span><span style="color:rgb(0,0,0)">libcall will be generated? Could you show me one example so that I can trace</span></div><div class="gmail_default"><span style="color:rgb(0,0,0)"> the LLVM source code on my own?</span></div><div class="gmail_default"><span style="color:rgb(0,0,0)"><br></span></div><div class="gmail_default"><span style="color:rgb(0,0,0)">Thanks.</span></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Regards,</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">chenwj</div><span class="HOEnZb"><font color="#888888"><div><br></div>-- <br><div class="m_9200220222238225322gmail_signature"><div dir="ltr"><div>Wei-Ren Chen (陳韋任)<br>Homepage: <a href="https://people.cs.nctu.edu.tw/~chenwj" target="_blank">https://people.cs.nctu.edu.tw/<wbr>~chenwj</a></div></div></div>
</font></span></div>
<br>______________________________<wbr>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
<br></blockquote></div><br></div>