<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;">Resend to the list!<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>Begin forwarded message:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"><span style="font-family:'Helvetica'; color:rgba(0, 0, 0, 1.0);"><b>From: </b></span><span style="font-family:'Helvetica';">Quentin Colombet <<a href="mailto:qcolombet@apple.com">qcolombet@apple.com</a>><br></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"><span style="font-family:'Helvetica'; color:rgba(0, 0, 0, 1.0);"><b>Subject: </b></span><span style="font-family:'Helvetica';"><b>Re: [PATCH][DAGCombiner] insert_vector_elt: Avoid to create multiple uses of the same load.</b><br></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"><span style="font-family:'Helvetica'; color:rgba(0, 0, 0, 1.0);"><b>Date: </b></span><span style="font-family:'Helvetica';">July 25, 2013 at 5:31:15 PM PDT<br></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"><span style="font-family:'Helvetica'; color:rgba(0, 0, 0, 1.0);"><b>To: </b></span><span style="font-family:'Helvetica';">Tom Stellard <<a href="mailto:thomas.stellard@amd.com">thomas.stellard@amd.com</a>><br></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;"><span style="font-family:'Helvetica'; color:rgba(0, 0, 0, 1.0);"><b>Cc: </b></span><span style="font-family:'Helvetica';">Nadav Rotem <<a href="mailto:nrotem@apple.com">nrotem@apple.com</a>>, llvm-commits <<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a>><br></span></div><br><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; 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 class="Apple-converted-space"> </span></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<span class="Apple-converted-space"> </span><font face="Menlo" style="font-size: 11px;">insertps</font><span class="Apple-converted-space"> </span>instead of <span style="font-family: Menlo; font-size: 11px;">pshufd</span>, which is good because<span class="Apple-converted-space"> </span><font face="Menlo" style="font-size: 11px;">pshufd</font><span class="Apple-converted-space"> </span>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="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-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></div></blockquote></div></div></body></html>