[llvm-dev] Clang IR Compile Bug?

platin21 via llvm-dev llvm-dev at lists.llvm.org
Mon Dec 27 13:46:53 PST 2021


Ok this seems to be a weird ness that llvm does if the ABI is not happy with doing what one does.
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.

So all in all it’s just not ABI compliant todo what I did and as such ok to create crap code. 

Best regards,
Platin21

> Am 27.12.2021 um 20:15 schrieb platin21 via llvm-dev <llvm-dev at lists.llvm.org>:
> 
> Hello Everyone,
> 
> May I ask is there anything different in clang when compiling ir than to when compiling with llc.
> In particular it seems to cause some problems with returning floats directly but only if they are over 8 bytes in size. 
> 
> I added the ir as attachment when compiled on arm-macOS via:
>> clang trs.ll 
> It causes this code to not work correctly.
> 
> If compiled with llc and then linked with clang it works:
>> llc  -filetype=obj trs.ll -o trs.o
>> clang trs.o -o trs
> 
> I yet have to find out why this happens when using clang directly. If anyone has a guess would be nice to know.
> 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. 
> 
> Link to IL Code => https://1drv.ms/u/s!Atg5BVAOHU2EgaBr2UaRfTgjUsUgHw?e=TmGbo5 <https://1drv.ms/u/s!Atg5BVAOHU2EgaBr2UaRfTgjUsUgHw?e=TmGbo5>
> 
> Best regards,
> Platin21
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20211227/083319c2/attachment.html>


More information about the llvm-dev mailing list