<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Ok this seems to be a weird ness that llvm does if the ABI is not happy with doing what one does.<div class="">As in if you return something bigger than 4 bytes with default return on aarch64 it seems like it’s not happy an creates trash code because it would expect this code to make a sret instead. Which is understandable still a bit annoying that it doesn’t give any hint that this is wrong.</div><div class=""><br class=""></div><div class="">So all in all it’s just not ABI compliant todo what I did and as such ok to create crap code. </div><div class=""><br class=""></div><div class="">Best regards,</div><div class="">Platin21<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">Am 27.12.2021 um 20:15 schrieb platin21 via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>>:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html; charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><span style="caret-color: rgb(0, 0, 0);" class="">Hello Everyone,</span><br style="caret-color: rgb(0, 0, 0);" class=""><br style="caret-color: rgb(0, 0, 0);" class=""><span style="caret-color: rgb(0, 0, 0);" class="">May I ask is there anything different in clang when compiling ir than to when compiling with llc.</span><br style="caret-color: rgb(0, 0, 0);" class=""><span style="caret-color: rgb(0, 0, 0);" class="">In particular it seems to cause some problems with returning floats directly but only if they are over 8 bytes in size. </span><br style="caret-color: rgb(0, 0, 0);" class=""><br style="caret-color: rgb(0, 0, 0);" class=""><span style="caret-color: rgb(0, 0, 0);" class="">I added the ir as attachment when compiled on arm-macOS via:</span><br style="caret-color: rgb(0, 0, 0);" class=""><blockquote type="cite" class="">clang trs.ll <br class=""></blockquote><span style="caret-color: rgb(0, 0, 0);" class="">It causes this code to not work correctly.</span><br style="caret-color: rgb(0, 0, 0);" class=""><br style="caret-color: rgb(0, 0, 0);" class=""><span style="caret-color: rgb(0, 0, 0);" class="">If compiled with llc and then linked with clang it works:</span><br style="caret-color: rgb(0, 0, 0);" class=""><blockquote type="cite" class="">llc  -filetype=obj trs.ll -o trs.o<br class="">clang trs.o -o trs<br class=""></blockquote><br style="caret-color: rgb(0, 0, 0);" class=""><span style="caret-color: rgb(0, 0, 0);" class="">I yet have to find out why this happens when using clang directly. If anyone has a guess would be nice to know.</span><div class=""><font class="">The same problem also happens in the backend which I’m currently helping with to develop here i though don’t know how to fix that as I can’t simply call llc as it’s using the llvm-c api todo all of this. </font></div><div class=""><font class=""><br class=""></font></div><div class=""><font class="">Link to IL Code => <span style="caret-color: rgb(0, 0, 0);" class=""><a href="https://1drv.ms/u/s!Atg5BVAOHU2EgaBr2UaRfTgjUsUgHw?e=TmGbo5" class="">https://1drv.ms/u/s!Atg5BVAOHU2EgaBr2UaRfTgjUsUgHw?e=TmGbo5</a></span></font></div><div class=""><font class=""><br class=""></font></div><div class=""><font class="">Best regards,</font></div><div class=""><font class=""><span style="caret-color: rgb(0, 0, 0);" class="">Platin21</span></font></div></div>_______________________________________________<br class="">LLVM Developers mailing list<br class=""><a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a><br class="">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev<br class=""></div></blockquote></div><br class=""></div></body></html>