<div dir="ltr">This seems like the case of returning struct in registers. This is usually dictated by the ABI, not by a compiler optimization, for compatibility reasons.<div><br></div><div>Kevin</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Apr 19, 2017 at 1:38 AM, Julien Schmitt 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">Dear LLVMers,<br>
<br>
I need your help to understand my problem:<br>
<br>
I'm compiling a code for 2 different targets (x86_64 and sparc). In this code, I define a union which is basically a int32 and a function which returns this union. The compilation of this code produces 2 different IRs :<br>
<br>
* for x86, the return type is int32,<br>
<br>
* for sparc, the return type is a struct (first argument of the function with attribute sret).<br>
<br>
I guess an optimization pass is called to simplify the return type in first case but i have no idea which one ?<br>
<br>
Does anybody have an explanation ?<br>
<br>
Thanks!<br>
<br>
Julien<br>
<br>
<br>
<br>
<br>
______________________________<wbr>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">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>
</blockquote></div><br></div>