<html><body>
<p><font size="2" face="sans-serif">Hal,</font><br>
<br>
<font size="2" face="sans-serif">You're right, I moved those heuristics in the target-independent combiner.</font><br>
<br>
<font size="2" face="sans-serif">Thanks,</font><br>
<font size="2" face="sans-serif">Olivier</font><br>
<br>
<i>(See attached file: patch-v3.diff)</i><br>
<br>
<img width="16" height="16" src="cid:2__=0ABBF755DF98BB078f9e8a93df938@us.ibm.com" border="0" alt="Inactive hide details for Hal Finkel ---01/06/2015 06:52:06 PM-------- Original Message ----- > From: "Olivier H Sallenave" <oh"><font size="2" color="#424282" face="sans-serif">Hal Finkel ---01/06/2015 06:52:06 PM-------- Original Message ----- > From: "Olivier H Sallenave" <ohsallen@us.ibm.com></font><br>
<br>
<font size="1" color="#5F5F5F" face="sans-serif">From:      </font><font size="1" face="sans-serif">Hal Finkel <hfinkel@anl.gov></font><br>
<font size="1" color="#5F5F5F" face="sans-serif">To:        </font><font size="1" face="sans-serif">Olivier H Sallenave/Watson/IBM@IBMUS</font><br>
<font size="1" color="#5F5F5F" face="sans-serif">Cc:        </font><font size="1" face="sans-serif"><llvm-commits@cs.uiuc.edu></font><br>
<font size="1" color="#5F5F5F" face="sans-serif">Date:      </font><font size="1" face="sans-serif">01/06/2015 06:52 PM</font><br>
<font size="1" color="#5F5F5F" face="sans-serif">Subject:   </font><font size="1" face="sans-serif">Re: [PATCH] Fw: [LLVMdev] More FMA folding opportunities</font><br>
<hr width="100%" size="2" align="left" noshade style="color:#8091A5; "><br>
<br>
<br>
<tt><font size="2">----- Original Message -----<br>
> From: "Olivier H Sallenave" <ohsallen@us.ibm.com><br>
> To: llvm-commits@cs.uiuc.edu<br>
> Cc: "Hal Finkel" <hfinkel@anl.gov><br>
> Sent: Monday, January 5, 2015 9:51:22 AM<br>
> Subject: Fw: [PATCH] Fw: [LLVMdev] More FMA folding opportunities<br>
> <br>
> <br>
> <br>
> Hi,<br>
> <br>
> Here's a more comprehensive patch also handling the fact that<br>
> FP_EXTEND will later be removed for PPC. Accordingly, new patterns<br>
> are implemented in the PPC-specific combiner:<br>
<br>
Given that these are predicated on (TM.Options.UnsafeFPMath || TM.Options.AllowFPOpFusion == FPOpFusion::Fast), what makes them PPC specific? Either of those two options allow us to compute the relevant operations with extra precision, right?<br>
<br>
 -Hal<br>
<br>
> <br>
> > Finally, specifically for the PPC target, we could ignore FP_EXTEND<br>
> > in the patterns above as it will be removed by the Machine Common<br>
> > Subexpression Elimination pass. For instance:<br>
> > <br>
> > fold (fadd (fpext (fmul x, y)), z) -> (fma x, y, z)<br>
> > fold (fadd (fpext (fma x, y, (fmul u, v))), z) -> (fma x, y (fma u,<br>
> > v, z))<br>
> <br>
> I also moved the tests in new files (fma-ext.ll, fma-assoc.ll) for<br>
> more clarity.<br>
> <br>
> Thanks,<br>
> Olivier<br>
> <br>
> (See attached file: patch-v2.diff)<br>
> <br>
> <br>
> <br>
> ----- Forwarded by Olivier H Sallenave/Watson/IBM on 01/05/2015 10:44<br>
> AM -----<br>
> <br>
> From: Olivier H Sallenave/Watson/IBM<br>
> To: llvm-commits@cs.uiuc.edu<br>
> Cc: "Hal Finkel" <hfinkel@anl.gov><br>
> Date: 12/29/2014 05:09 PM<br>
> Subject: [PATCH] Fw: [LLVMdev] More FMA folding opportunities<br>
> <br>
> <br>
> <br>
> Hi,<br>
> <br>
> Attached is a patch to support more FMA folding opportunities<br>
> (especially for PPC) as discussed below.<br>
> <br>
> Thanks,<br>
> Olivier<br>
> <br>
> (See attached file: patch.diff)<br>
> <br>
> <br>
> <br>
> ----- Forwarded by Olivier H Sallenave/Watson/IBM on 12/29/2014 04:56<br>
> PM -----<br>
> <br>
> From: Hal Finkel <hfinkel@anl.gov><br>
> To: Olivier H Sallenave/Watson/IBM@IBMUS<br>
> Cc: <llvmdev@cs.uiuc.edu><br>
> Date: 09/30/2014 08:08 PM<br>
> Subject: Re: [LLVMdev] More FMA folding opportunities<br>
> <br>
> <br>
> <br>
> <br>
> ----- Original Message -----<br>
> > From: "Olivier H Sallenave" <ohsallen@us.ibm.com><br>
> > To: llvmdev@cs.uiuc.edu<br>
> > Sent: Monday, September 29, 2014 3:34:51 PM<br>
> > Subject: [LLVMdev] More FMA folding opportunities<br>
> > <br>
> > Hi,<br>
> > <br>
> > I think more opportunities might be added for FMA in the DAG<br>
> > combiner, please tell me what you think. Right now, those cases are<br>
> > implemented:<br>
> > <br>
> > fold (fadd (fmul x, y), z) -> (fma x, y, z)<br>
> > fold (fadd x, (fmul y, z)) -> (fma y, z, x)<br>
> > <br>
> > When the TLI callback "enableAggressiveFMAFusion" returns true, we<br>
> > might also support:<br>
> > <br>
> > fold (fadd (fma x, y, (fmul u, v)), z) -> (fma x, y (fma u, v, z))<br>
> > fold (fadd x, (fma y, z, (fmul u, v)) -> (fma y, z (fma u, v, x))<br>
> > <br>
> > This kind of reassociation generates two FMA for (x^2 + y^2 + z).<br>
> <br>
> Yes, this all sounds reasonable.<br>
> <br>
> Thanks again,<br>
> Hal<br>
<br>
-- <br>
Hal Finkel<br>
Assistant Computational Scientist<br>
Leadership Computing Facility<br>
Argonne National Laboratory<br>
</font></tt><br>
</body></html>