<div dir="ltr">The ir reference for preserve_all states:<div><span style="color:rgb(0,0,0);font-family:"Lucida Grande","Lucida Sans Unicode",Geneva,Verdana,sans-serif;font-size:14px;line-height:21px"><br></span></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">This calling convention also behaves identical to the Ccalling convention on how arguments and return values are passed</blockquote><div><br></div><div>I tried the following:</div><div><br></div><div>uint64_t return_zero() __attribute__((preserve_all))</div><div>{</div><div>    return 0;</div><div>}</div><div><br></div><div>and got</div><div><br></div><div><div>0000000000000020 <return_zero>:</div><div>  20:<span class="" style="white-space:pre">   </span>50                   <span class="" style="white-space:pre">    </span>push   %rax</div><div>  21:<span class="" style="white-space:pre"> </span>31 c0                xor    %eax,%eax</div><div>  23:<span class="" style="white-space:pre">      </span>58                   <span class="" style="white-space:pre">    </span>pop    %rax</div><div>  24:<span class="" style="white-space:pre">        </span>c3                   <span class="" style="white-space:pre">    </span>retq</div></div><div><br></div><div>as you can see, the rax register is restored to its value upon entry to the function and does not contain the return value. What are the semantics here? Should this work? Should we add a verifier error for functions with this calling convention that return values?</div></div>