<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Hi Nadav,<div><br></div><div>Here is a new patch that provides the fallback patterns.</div><div><br></div><div>That said, the new patterns creates less efficient code that my initial proposal.</div><div><br></div><div>I.e., fallback patterns:</div><div><div style="margin: 0px; font-size: 11px; font-family: Menlo;"><span class="Apple-tab-span" style="white-space:pre">       </span>movb<span class="Apple-tab-span" style="white-space:pre">        </span>(%rdi), %al</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;"><span class="Apple-tab-span" style="white-space:pre">      </span>vmovd<span class="Apple-tab-span" style="white-space:pre">       </span>%eax, %xmm1</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;"><span class="Apple-tab-span" style="white-space:pre">      </span>vpbroadcastb<span class="Apple-tab-span" style="white-space:pre">        </span>%xmm1, %xmm1</div></div><div style="margin: 0px;">Orignial patch:</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;"><div style="margin: 0px;"><span class="Apple-tab-span" style="white-space:pre">  </span>vpbroadcastb<span class="Apple-tab-span" style="white-space:pre">        </span>(%rdi), %xmm1</div></div><div><br></div><div>You told me that a later pass is supposed to catch the new opportunities of load folding. Looks like it does not know how to do that across copies.</div><div>We would have to fix that at some point.</div><div><br></div><div>Anyhow, I think both patches are orthogonal, having fallback patterns looks like a good idea but selection directly the instructions that match what X86ISelLowering thought it was lowering seems a good approach too :).</div><div><br></div><div>What do you think?</div><div><br></div><div>As a side question, do you happen to have a test case for the existing fallback patterns?</div><div>The original commit  r<span style="font-family: Menlo; font-size: 11px;">155437 </span>do not have any test case and I was wondering how a load could have new users added to it (some constant load?). Thus, I wanted to check we were not already working around the problem I mentioned.</div><div><br></div><div>Thanks,<br><div apple-content-edited="true">
<div style="color: rgb(0, 0, 0); font-family: Helvetica;  font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">-Quentin</div>

</div>
<div></div></div></body></html>