<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,<div><br></div><div>After discussing with Nadav offline, we decide to block the optimization when the input vector is used more than once. Indeed, building a vector may be expensive and we think it should be profitable to reuse part of an existing vector instead of creating a new one.</div><div><br></div><div>I have updated a bunch of tests to reflect this. We went through the test cases that were regressing and fixed them:</div><div>- Dead-code: <span style="font-family: Menlo; font-size: 11px;">CodeGen/X86/vshift-1.ll </span>to<span style="font-family: Menlo; font-size: 11px;"> </span><span style="font-family: Menlo; font-size: 11px;">CodeGen/X86/vshift-4.ll.</span></div><div>- Use of <font face="Menlo" style="font-size: 11px;">insertps</font> instead of <span style="font-family: Menlo; font-size: 11px;">pshufd</span>, which is good because <font face="Menlo" style="font-size: 11px;">pshufd</font> is expensive: <span style="font-family: Menlo; font-size: 11px;">test/CodeGen/X86/fold-load-vec.ll.</span></div><div><br></div><div>It remains one “regression”:</div><div>- Tons of move inserted: <span style="font-family: Menlo; font-size: 11px;">test/CodeGen/R600/swizzle-export.ll.</span></div><div><br></div><div>I have marked this test as XFAIL at this point.</div><div><br></div><div>Tom, I believe the lowering of R600 can be improved here. One easy fix could be to replicate the old behavior of DAGCombine on insert_vector_elt nodes in a target specific dag combine if you think it is the best lowering for you.</div><div>If you have other suggestions, let me know.</div><div><br></div><div>Thanks for your reviews.</div><div><br></div><div>Cheers,</div><div><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><br></div><div></div></div></body></html>