<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">> 
<span style="color: rgb(31, 73, 125); font-size: 15px; "> To fix that, one need to either combine them back or change the logic of vector > type legalize.</span> <div><br></div><div>Combining them back is simple, however if a scalar operation has combined & vectorized it should not have been expanded into scalar.So changing the logic of vector type legalize seems better solution.</div><div><br></div><div>-Shahid<br><br>--- On <b>Mon, 9/24/12, Zhao, Weiming <i><weimingz@quicinc.com></i></b> wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>From: Zhao, Weiming <weimingz@quicinc.com><br>Subject: RE: [LLVMdev] Proposal: New DAG node type for reciprocal operation<br>To: "shahid shahid" <shahid77c@yahoo.com>, "Weiming Zhao" <weimingz@codeaurora.org>, "Jim Grosbach" <grosbach@apple.com><br>Cc: "llvmdev@cs.uiuc.edu" <llvmdev@cs.uiuc.edu><br>Date:
 Monday, September 24, 2012, 10:27 AM<br><br><div id="yiv553751483">

 
 
<style><!--
#yiv553751483  
 _filtered #yiv553751483 {font-family:Helvetica;
panose-1:2 11 6 4 2 2 2 2 2 4;}
 _filtered #yiv553751483 {font-family:SimSun;
panose-1:2 1 6 0 3 1 1 1 1 1;}
 _filtered #yiv553751483 {font-family:SimSun;
panose-1:2 1 6 0 3 1 1 1 1 1;}
 _filtered #yiv553751483 {font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
 _filtered #yiv553751483 {font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
 _filtered #yiv553751483 {
panose-1:2 1 6 0 3 1 1 1 1 1;}
#yiv553751483  
#yiv553751483 p.yiv553751483MsoNormal, #yiv553751483 li.yiv553751483MsoNormal, #yiv553751483 div.yiv553751483MsoNormal
        {margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman", "serif";}
#yiv553751483 a:link, #yiv553751483 span.yiv553751483MsoHyperlink
        {
color:blue;
text-decoration:underline;}
#yiv553751483 a:visited, #yiv553751483 span.yiv553751483MsoHyperlinkFollowed
        {
color:purple;
text-decoration:underline;}
#yiv553751483 span.yiv553751483apple-converted-space
        {}
#yiv553751483 span.yiv553751483EmailStyle18
        {
font-family:"Calibri", "sans-serif";
color:#1F497D;}
#yiv553751483 .yiv553751483MsoChpDefault
        {
font-family:"Calibri", "sans-serif";}
 _filtered #yiv553751483 {
margin:1.0in 1.0in 1.0in 1.0in;}
#yiv553751483 div.yiv553751483WordSection1
        {}
--></style>

<div>
<div class="yiv553751483WordSection1">
<p class="yiv553751483MsoNormal"><span style="font-size:11.0pt;color:#1F497D;">Yes, what I mean is a target independent node in the ISD::NodeType enum.</span></p> 
<p class="yiv553751483MsoNormal"><span style="font-size:11.0pt;color:#1F497D;">I already did the node transformation DAGCombiner and target-specific lowering in the first place. It worked. But introducing a specific node will make the
 logic more clear. </span></p> 
<p class="yiv553751483MsoNormal"><span style="font-size:11.0pt;color:#1F497D;">For example, in ARM, FDIV is a scalar operation. So, after DAGCombiner and Vector Type legalize, vectorized FDIV has been expanded into scalar versions, which
 breaks the intention of utilizaing vectorizable mul/recip to implement a vectorized fdiv. To fix that, one need to either combine them back or change the logic of vector type legalize.</span></p> 
<p class="yiv553751483MsoNormal"><span style="font-size:11.0pt;color:#1F497D;">  </span></p> 
<p class="yiv553751483MsoNormal"><span style="font-size:11.0pt;color:#1F497D;">Thanks,</span></p> 
<p class="yiv553751483MsoNormal"><span style="font-size:11.0pt;color:#1F497D;">Weiming</span></p> 
<p class="yiv553751483MsoNormal"><span style="font-size:11.0pt;color:#1F497D;">  </span></p> 
<p class="yiv553751483MsoNormal"><b><span style="font-size:10.0pt;">From:</span></b><span style="font-size:10.0pt;"> llvmdev-bounces@cs.uiuc.edu [mailto:llvmdev-bounces@cs.uiuc.edu]
<b>On Behalf Of </b>shahid shahid<br>
<b>Sent:</b> Thursday, September 20, 2012 10:06 PM<br>
<b>To:</b> Weiming Zhao; Jim Grosbach<br>
<b>Cc:</b> llvmdev@cs.uiuc.edu<br>
<b>Subject:</b> Re: [LLVMdev] Proposal: New DAG node type for reciprocal operation</span></p> 
<p class="yiv553751483MsoNormal">  </p> 
<table class="yiv553751483MsoNormalTable" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top" style="padding:0in 0in 0in 0in;">
<p class="yiv553751483MsoNormal"><br>
<br>
--- On <b>Thu, 9/20/12, Jim Grosbach <i><<a rel="nofollow" ymailto="mailto:grosbach@apple.com" target="_blank" href="/mc/compose?to=grosbach@apple.com">grosbach@apple.com</a>></i></b> wrote:</p> 
<p class="yiv553751483MsoNormal" style="margin-bottom:12.0pt;"><br>
From: Jim Grosbach <<a rel="nofollow" ymailto="mailto:grosbach@apple.com" target="_blank" href="/mc/compose?to=grosbach@apple.com">grosbach@apple.com</a>><br>
Subject: Re: [LLVMdev] Proposal: New DAG node type for reciprocal operation<br>
To: "Weiming Zhao" <<a rel="nofollow" ymailto="mailto:weimingz@codeaurora.org" target="_blank" href="/mc/compose?to=weimingz@codeaurora.org">weimingz@codeaurora.org</a>><br>
Cc: <a rel="nofollow" ymailto="mailto:llvmdev@cs.uiuc.edu" target="_blank" href="/mc/compose?to=llvmdev@cs.uiuc.edu">llvmdev@cs.uiuc.edu</a><br>
Date: Thursday, September 20, 2012, 3:32 PM</p> 
<div id="yiv553751483">
<div>
<p class="yiv553751483MsoNormal">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.</p> 
<div>
<p class="yiv553751483MsoNormal">  </p> 
</div>
<div>
<p class="yiv553751483MsoNormal">-Jim</p> 
</div>
<div>
<p class="yiv553751483MsoNormal">  </p> 
</div>
<div>
<p class="yiv553751483MsoNormal">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.</p> 
</div>
<div>
<p class="yiv553751483MsoNormal">  </p> 
</div>
<div>
<p class="yiv553751483MsoNormal">-Shahid</p> 
</div>
<div>
<p class="yiv553751483MsoNormal">  </p> 
<div>
<div>
<p class="yiv553751483MsoNormal">On Sep 20, 2012, at 3:26 PM, Weiming Zhao <<a rel="nofollow">weimingz@codeaurora.org</a>> wrote:</p> 
</div>
<p class="yiv553751483MsoNormal"><br>
<br>
</p> 
<div>
<div>
<div>
<p class="yiv553751483MsoNormal"><span style="font-size:11.0pt;">Hi,</span></p> 
</div>
<div>
<p class="yiv553751483MsoNormal"><span style="font-size:11.0pt;"> </span></p> 
</div>
<div>
<p class="yiv553751483MsoNormal"><span style="font-size:11.0pt;">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.</span></p> 
</div>
<div>
<p class="yiv553751483MsoNormal"><span style="font-size:11.0pt;"> </span></p> 
</div>
<div>
<p class="yiv553751483MsoNormal"><span style="font-size:11.0pt;">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.</span></p> 
</div>
<div>
<p class="yiv553751483MsoNormal"><span style="font-size:11.0pt;"> </span></p> 
</div>
<div>
<p class="yiv553751483MsoNormal"><span style="font-size:11.0pt;">It this feasible?</span></p> 
</div>
<div>
<p class="yiv553751483MsoNormal"><span style="font-size:11.0pt;"> </span></p> 
</div>
<div>
<p class="yiv553751483MsoNormal"><span style="font-size:11.0pt;">Thanks,</span></p> 
</div>
<div>
<p class="yiv553751483MsoNormal"><span style="font-size:11.0pt;">Weiming</span></p> 
</div>
<div>
<p class="yiv553751483MsoNormal"><span style="font-size:11.0pt;"> </span></p> 
</div>
<div>
<p class="yiv553751483MsoNormal"><span style="font-size:11.0pt;">Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation</span></p> 
</div>
<div>
<p class="yiv553751483MsoNormal"><span style="font-size:11.0pt;"> </span></p> 
</div>
</div>
<p class="yiv553751483MsoNormal"><span style="font-size:13.5pt;">_______________________________________________<br>
LLVM Developers mailing list<br>
<a rel="nofollow"><span style="color:purple;">LLVMdev@cs.uiuc.edu</span></a><span class="yiv553751483apple-converted-space"> </span>        <a rel="nofollow" target="_blank" href="http://llvm.cs.uiuc.edu"><span style="color:purple;">http://llvm.cs.uiuc.edu</span></a><br>
<a rel="nofollow" target="_blank" href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev"><span style="color:purple;">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</span></a></span></p> 
</div>
</div>
<p class="yiv553751483MsoNormal">  </p> 
</div>
</div>
</div>
<p class="yiv553751483MsoNormal" style="margin-bottom:12.0pt;"><br>
-----Inline Attachment Follows-----</p> 
<div>
<p class="yiv553751483MsoNormal">_______________________________________________<br>
LLVM Developers mailing list<br>
<a rel="nofollow">LLVMdev@cs.uiuc.edu</a>         <a rel="nofollow" target="_blank" href="http://llvm.cs.uiuc.edu">http://llvm.cs.uiuc.edu</a><br>
<a rel="nofollow" target="_blank" href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a></p> 
</div>
</td>
</tr>
</tbody>
</table>
<p class="yiv553751483MsoNormal"><span style="font-size:10.0pt;">  </span></p> 
</div>
</div>

</div></blockquote></div></td></tr></table>