Hi Elena,<div><br></div><div>The second DAG combine looks a bit off:</div><div><br></div><div><div>+    // fold (fsub x, -(fmul, y, z)) -> (fma (fneg y), z, x)</div><div><br></div><div>That implies:</div><div><br></div>
<div>x - -(y * z) ==> -y * z + a</div><div><br></div><div>Which isn't a valid transformation. You probably don't want the negate on 'y'.</div><div><br></div><div>+    if (N1.getOpcode() == ISD::FNEG && </div>
<div>+        N1.getOperand(0).getOpcode() == ISD::FMUL &&</div><div>+        N1->hasOneUse() && N1.getOperand(0).hasOneUse()) {</div><div>+      SDValue N10 = N1.getOperand(0).getOperand(0);</div><div>
+      SDValue N11 = N1.getOperand(0).getOperand(1);</div><div>+      return DAG.getNode(ISD::FMA, dl, VT,</div><div>+                         DAG.getNode(ISD::FNEG, N1->getDebugLoc(), VT, N10),</div><div>+                         N11, N1);</div>
</div><div><br></div><div>Given the observation above, I think the ISD::FNEG should go away here. Also N1 is being used as the RHS addend. I think that should be N0?</div><div><br></div><div>Otherwise it looks good to me.</div>
<div><br></div><div>Cheers,</div><div>Lang.</div><div><br></div><div>
<br><div class="gmail_quote">On Mon, Jul 23, 2012 at 8:43 AM, Demikhovsky, Elena <span dir="ltr"><<a href="mailto:elena.demikhovsky@intel.com" target="_blank">elena.demikhovsky@intel.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<br>
I added code generation for FMA patterns on AVX2 architecture.<br>
<br>
- Elena<br>
<br>
<br>
---------------------------------------------------------------------<br>
Intel Israel (74) Limited<br>
<br>
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.<br>
<br>_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
<br></blockquote></div><br></div>