<div dir="ltr"><div><div>Hi Taewook -<br><br></div><div>There's a discussion about the underlying x86 micro-arch details here:<br><a href="http://comments.gmane.org/gmane.comp.compilers.llvm.cvs/167221" target="_blank">http://comments.gmane.org/gmane.comp.compilers.llvm.cvs/167221</a><br></div><div><br></div><div>The conclusion was that we should change how we currently handle these, but we don't want to regress the case that was addressed by:<br><a href="http://reviews.llvm.org/rL195496">http://reviews.llvm.org/rL195496</a><br></div><div><br></div>There are open bugs with more discussion related to this:<br><a href="https://llvm.org/bugs/show_bug.cgi?id=17113" target="_blank">https://llvm.org/bugs/show_bug.cgi?id=17113</a><br><a href="https://llvm.org/bugs/show_bug.cgi?id=22473" target="_blank">https://llvm.org/bugs/show_bug.cgi?id=22473</a><br><a href="https://llvm.org/bugs/show_bug.cgi?id=22532" target="_blank">https://llvm.org/bugs/show_bug.cgi?id=22532</a><br><a href="https://llvm.org/bugs/show_bug.cgi?id=23155" target="_blank">https://llvm.org/bugs/show_bug.cgi?id=23155</a>  (cc'ing Kevin in case there's any update on this one)<br><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jan 29, 2016 at 10:04 PM, Taewook Oh 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">



<div style="word-wrap:break-word;color:rgb(0,0,0);font-size:14px;font-family:Calibri,sans-serif">
<div>
<div>Hello, </div>
<div><br>
</div>
<div>While looking at some internal benchmarks, I found that llvm generates codes with redundant promotion, something like:</div>
<div><br>
</div>
<div>xor %al, %cl</div>
<div>movzbl %cl, %ecx</div>
<div>cmp $0x20, %ecx</div>
<div><br>
</div>
<div>I believe that the promotion stems from the logic in X86TargetLowering::EmitCmp. Comments in the code says, </div>
<div><br>
</div>
<div>"Do the comparison at i32 if it's smaller, besides the Atom case. This avoids subregister aliasing issues. Keep the smaller reference if we're optimizing for size, however, as that'll allow better folding of memory operations."</div>
<div><br>
</div>
<div>Can anybody please explain me more in detail about the subregister aliasing issues?</div>
<div><br>
</div>
<div>Thanks,</div>
<div>Taewook</div>
</div>
</div>

<br>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org">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/mailman/listinfo/llvm-dev</a><br>
<br></blockquote></div><br></div>