<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;"><br><br>--- On <b>Thu, 9/20/12, Jim Grosbach <i><grosbach@apple.com></i></b> wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>From: Jim Grosbach <grosbach@apple.com><br>Subject: Re: [LLVMdev] Proposal: New DAG node type for reciprocal operation<br>To: "Weiming Zhao" <weimingz@codeaurora.org><br>Cc: llvmdev@cs.uiuc.edu<br>Date: Thursday, September 20, 2012, 3:32 PM<br><br><div id="yiv2066434452"><base><div>Sounds like a reasonable fit for a target-specific DAG combine. I suspect a target specific node wouldn't be necessary and the patterns could be matched directly.<div><br></div><div>-Jim</div><div><br></div><div>Yes, a target specific node is not necessary, direct pattern matching would be enough for the required transformation.Having reciprocal node may also give opportunity for
 other target specific transformation.</div><div><br></div><div>-Shahid</div><div><br><div><div>On Sep 20, 2012, at 3:26 PM, Weiming Zhao <<a rel="nofollow" ymailto="mailto:weimingz@codeaurora.org" target="_blank" href="/mc/compose?to=weimingz@codeaurora.org">weimingz@codeaurora.org</a>> wrote:</div><br class="yiv2066434452Apple-interchange-newline"><blockquote type="cite"><div lang="EN-US" style="font-family:Helvetica;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;orphans:2;text-indent:0px;text-transform:none;white-space:normal;widows:2;word-spacing:0px;"><div class="yiv2066434452WordSection1" style=""><div style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri, sans-serif;">Hi,</div><div style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri, sans-serif;">  </div><div style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri, sans-serif;">In
 relaxed/fast math mode, if we can convert a/b to a * (1/b), we may get more performance when (1) “b” is loop invariant or (2) arch has faster reciprocal instruction (e.g. recipe/recips on ARM)  or (3) arch has no vector div, but has vector mul and recip.</div><div style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri, sans-serif;">  </div><div style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri, sans-serif;">So ,with this node type, a div node can be converted to a mul and a recip when desired. Then, each arch can further lower the recip node. Even if the arch has no recip support, allowing other passes to hoist  “1/b” out of loop may still be profitable.</div><div style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri, sans-serif;">  </div><div style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri, sans-serif;">It this feasible?</div><div style="margin:0in 0in
 0.0001pt;font-size:11pt;font-family:Calibri, sans-serif;">  </div><div style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri, sans-serif;">Thanks,</div><div style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri, sans-serif;">Weiming</div><div style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri, sans-serif;">  </div><div style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri, sans-serif;">Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation</div><div style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri, sans-serif;">  </div></div> _______________________________________________<br>LLVM Developers mailing list<br><a rel="nofollow" ymailto="mailto:LLVMdev@cs.uiuc.edu" target="_blank" href="/mc/compose?to=LLVMdev@cs.uiuc.edu" style="color:purple;text-decoration:underline;">LLVMdev@cs.uiuc.edu</a><span
 class="yiv2066434452Apple-converted-space"> </span>        <a rel="nofollow" target="_blank" href="http://llvm.cs.uiuc.edu" style="color:purple;text-decoration:underline;">http://llvm.cs.uiuc.edu</a><br><a rel="nofollow" target="_blank" href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" style="color:purple;text-decoration:underline;">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br></div></blockquote></div><br></div></div></div><br>-----Inline Attachment Follows-----<br><br><div class="plainMail">_______________________________________________<br>LLVM Developers mailing list<br><a ymailto="mailto:LLVMdev@cs.uiuc.edu" href="/mc/compose?to=LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev"
 target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br></div></blockquote></td></tr></table>