<div dir="ltr"><div>Hi Vanessa,</div><div><br></div>I think the two users of the final classification, X86_64ABIInfo::classifyReturnType and X86_64ABIInfo::classifyArgumentType, don't look at Hi if Lo == Memory. They both return from their respective "switch (Lo)". So I guess the code took a shortcut and didn't bother updating Hi.<div><br></div><div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature">~Craig</div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Sep 14, 2021 at 5:15 PM Sochat, Vanessa via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">





<div lang="EN-US" style="overflow-wrap: break-word;">
<div class="gmail-m_-8969999653160052970WordSection1">
<p class="MsoNormal"><span style="color:black">Hi LLVM Community,<u></u><u></u></span></p>
<p class="MsoNormal" style="font-variant-caps:normal;text-align:start;word-spacing:0px">
<span style="color:black"> <u></u><u></u></span></p>
<p class="MsoNormal" style="font-variant-caps:normal;text-align:start;word-spacing:0px">
<span style="color:black">I’m hoping for some insight to a question I stumbled on – I’ve been trying various social networks and contacts to no avail! I was recently looking at the System V ABI Document for X86 and comparing to the LLVM source code, and I had
 a few questions about register allocation. Basically, when we are doing the post merge step in classifying, say, a struct, the first rule says that we check for either lo<span class="gmail-m_-8969999653160052970apple-converted-space"> </span><i>or</i><span class="gmail-m_-8969999653160052970apple-converted-space"> </span>hi
 to be in memory, and then set the whole thing to memory. But in the implementation, it only checks hi (and then changes lo). I thought if it’s not an oversight, it might be the case that lo can never be set to memory, or something like that? I’m hoping that
 you have some insight because I’m not sure if this is an oversight on my part! I shared some screenshots here:<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black"> <u></u><u></u></span></p>
<p class="MsoNormal" style="font-variant-caps:normal;text-align:start;word-spacing:0px">
<span style="color:black"><a href="https://twitter.com/vsoch/status/1435687187979268099" target="_blank"><span style="color:rgb(5,99,193)">https://twitter.com/vsoch/status/1435687187979268099</span></a><u></u><u></u></span></p>
<p class="MsoNormal" style="font-variant-caps:normal;text-align:start;word-spacing:0px">
<span style="color:black"> <u></u><u></u></span></p>
<p class="MsoNormal" style="font-variant-caps:normal;text-align:start;word-spacing:0px">
<span style="color:black">And the link to the code in question is here:<u></u><u></u></span></p>
<p class="MsoNormal" style="font-variant-caps:normal;text-align:start;word-spacing:0px">
<span style="color:black"> <u></u><u></u></span></p>
<p class="MsoNormal" style="font-variant-caps:normal;text-align:start;word-spacing:0px">
<span style="color:black"><a href="https://github.com/llvm/llvm-project/blob/main/clang/lib/CodeGen/TargetInfo.cpp#L2726" target="_blank"><span style="color:rgb(5,99,193)">https://github.com/llvm/llvm-project/blob/main/clang/lib/CodeGen/TargetInfo.cpp#L2726</span></a><u></u><u></u></span></p>
<p class="MsoNormal" style="font-variant-caps:normal;text-align:start;word-spacing:0px">
<span style="color:black">Thank you so much for your help!<span class="gmail-m_-8969999653160052970apple-converted-space"> </span></span><span style="font-family:"Apple Color Emoji";color:black">😊</span><span style="color:black"><u></u><u></u></span></p>
<p class="MsoNormal" style="font-variant-caps:normal;text-align:start;word-spacing:0px">
<span style="color:black"> <u></u><u></u></span></p>
<p class="MsoNormal" style="font-variant-caps:normal;text-align:start;word-spacing:0px">
<span style="color:black">Best,<u></u><u></u></span></p>
<p class="MsoNormal" style="font-variant-caps:normal;text-align:start;word-spacing:0px">
<span style="color:black"> <u></u><u></u></span></p>
<p class="MsoNormal" style="font-variant-caps:normal;text-align:start;word-spacing:0px">
<span style="color:black">Vanessa<u></u><u></u></span></p>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>

_______________________________________________<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="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div>