<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Hi Elena,<div><br></div><div>This is looking good with some minor comments:</div><div>- Could you paste the comment on the additional argument for IsProfitableToFold in the header file too?</div><div>- Add a test case.</div><div><br></div><div>Thanks,</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>
<br><div><div>On Jul 10, 2013, at 12:27 AM, "Demikhovsky, Elena" <<a href="mailto:elena.demikhovsky@intel.com">elena.demikhovsky@intel.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><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;"><font face="Calibri" size="2"><span style="font-size: 11pt;"><div><font color="#1F497D">Hi, please review this patch.</font></div><div><font color="#1F497D"> </font></div><div><font color="#1F497D">Thanks.</font></div><div><font color="#1F497D"> </font></div><ul style="margin: 0px; padding-left: 36pt;"><font face="Times New Roman" size="3" color="#31849B"><span style="font-size: 12pt;"><li><b><i>Elena</i></b></li></span></font></ul><div><font color="#1F497D"> </font></div><div><font color="#1F497D"> </font></div><div><font face="Tahoma" size="2"><span style="font-size: 10pt;">_____________________________________________<br><b>From:</b><span class="Apple-converted-space"> </span>Demikhovsky, Elena<span class="Apple-converted-space"> </span><br><b>Sent:</b><span class="Apple-converted-space"> </span>Monday, July 08, 2013 14:48<br><b>To:</b><span class="Apple-converted-space"> </span><a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br><b>Cc:</b><span class="Apple-converted-space"> </span>Demikhovsky, Elena; Nadav Rotem <nrotem@apple.com> (nrotem@apple.com)<br><b>Subject:</b><span class="Apple-converted-space"> </span>Folding nodes in instruction selection - please review</span></font></div><div> </div><div> </div><div>Hi,</div><div> </div><div>I analyzed the folding DAG nodes algorithm in LLVM, compared to code generated by Intel compiler and got into conclusion that the LLVM code is not always optimal.</div><div>This is an example:</div><div> </div><div>  %b1 = fadd <8 x float> %a1, <float AAA, float AAA, float AAA, float AAA, float AAA, float AAA, float AAA, float AAA ></div><div>  %b2 = fadd <8 x float> %a2, <float AAA, float AAA, float AAA, float AAA, float AAA, float AAA, float AAA, float AAA ></div><div>  %c = fmul <8 x float> %b1, %b2</div><div> </div><div>The result (1) bellow is not better than (2), because loading constant is not a problem, but spilling %ymm2 that may be required  in (1) is not cheap.</div><div> </div><div>(1)</div><div>        vmovaps .LCPI1_0(%rip), %ymm2</div><div>        vaddps  %ymm2, %ymm1, %ymm1</div><div>        vaddps  %ymm2, %ymm0, %ymm0</div><div>        vmulps  %ymm1, %ymm0, %ymm0</div><div> </div><div>(2)</div><div>        vaddps  .LCPI1_0(%rip), %ymm1, %ymm1</div><div>        vaddps  .LCPI1_0(%rip),  %ymm0, %ymm0</div><div>        vmulps  %ymm1, %ymm0, %ymm0</div><div> </div><div>In the attached patch I did a minor thing that does not change the current algorithm, but allows to add some target-specific analysis.</div><div></div><div>Please review.</div><div> </div><div>Thank you.</div><div> </div><ul style="margin: 0px; padding-left: 36pt;"><font face="Times New Roman" size="3" color="#31849B"><span style="font-size: 12pt;"><li><b><i>Elena</i></b></li></span></font></ul><div> </div><div> </div><div> </div></span></font><p>---------------------------------------------------------------------<br>Intel Israel (74) Limited</p><p>This e-mail and any attachments may contain confidential material for<br>the sole use of the intended recipient(s). Any review or distribution<br>by others is strictly prohibited. If you are not the intended<br>recipient, please contact the sender and delete all copies.</p><span><folding.diff></span>_______________________________________________<br>llvm-commits mailing list<br><a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</div></blockquote></div><br></div></body></html>