[PATCH] [LLVMdev] More FMA folding opportunities

Olivier H Sallenave ohsallen at us.ibm.com
Fri Jan 9 09:59:07 PST 2015


Hi Hal,

I am wondering if we should move the FP_EXTEND cases to the PPC-specific
combiner:

(fadd (fpext (fmul x, y)), z) -> (fma (fpext x), (fpext y), z)

We know that for PPC the FPEXT nodes will be removed, but it'll likely not
be the case for other architectures. For those, you end up with one FMADD
rather than one FMUL and one FADD, but also have two FPEXT nodes rather
than one. I would not expect this to take more cycles to run, but there's
no way to systematically check that since the cost models are not
necessarily accurate.

In the end, the "aggressive" flag only ensures that you can combine one
FMUL node with many FADD nodes.

What do you think?

Olivier



From:	Hal Finkel <hfinkel at anl.gov>
To:	Owen Anderson <resistor at mac.com>
Cc:	Olivier H Sallenave/Watson/IBM at IBMUS,
            <llvm-commits at cs.uiuc.edu>
Date:	01/08/2015 08:36 PM
Subject:	Re: [PATCH] [LLVMdev] More FMA folding opportunities



----- Original Message -----
> From: "Hal Finkel" <hfinkel at anl.gov>
> To: "Owen Anderson" <resistor at mac.com>
> Cc: "Olivier H Sallenave" <ohsallen at us.ibm.com>, llvm-commits at cs.uiuc.edu
> Sent: Thursday, January 8, 2015 6:48:34 PM
> Subject: Re: [PATCH] [LLVMdev] More FMA folding opportunities
>
> ----- Original Message -----
> > From: "Hal Finkel" <hfinkel at anl.gov>
> > To: "Owen Anderson" <resistor at mac.com>
> > Cc: "Olivier H Sallenave" <ohsallen at us.ibm.com>,
> > llvm-commits at cs.uiuc.edu
> > Sent: Thursday, January 8, 2015 6:19:14 PM
> > Subject: Re: [PATCH] [LLVMdev] More FMA folding opportunities
> >
> > ----- Original Message -----
> > > From: "Owen Anderson" <resistor at mac.com>
> > > To: "Hal Finkel" <hfinkel at anl.gov>
> > > Cc: "Olivier H Sallenave" <ohsallen at us.ibm.com>,
> > > llvm-commits at cs.uiuc.edu
> > > Sent: Thursday, January 8, 2015 6:16:57 PM
> > > Subject: Re: [PATCH] [LLVMdev] More FMA folding opportunities
> > >
> > >
> > >
> > >
> > >
> > >
> > > On Jan 8, 2015, at 6:06 PM, Hal Finkel < hfinkel at anl.gov > wrote:
> > >
> > > Olivier, Aditya is right. You need to add the FP_EXTEND to the
> > > operands of the resulting FMA as appropriate. Can you please fix
> > > that? We can also move those under the "aggressive" flag for now.
> > >
> > >
> > > Can you fix or revert this ASAP, please? The missing extends are
> > > breaking our branches pretty badly.
> >
> > Yep, will do in a few minutes.
>
> I moved the transformations behind the aggressive flag in r225485 --
> that should unbreak your builds while I fix the extends.

FP_EXTEND nodes added as of r225492. Thanks for pointing this out!

 -Hal

>
>  -Hal
>
> >
> >  -Hal
> >
> > >
> > >
> > > —Owen
> >
> > --
> > Hal Finkel
> > Assistant Computational Scientist
> > Leadership Computing Facility
> > Argonne National Laboratory
> >
> > _______________________________________________
> > llvm-commits mailing list
> > llvm-commits at cs.uiuc.edu
> > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
> >
>
> --
> Hal Finkel
> Assistant Computational Scientist
> Leadership Computing Facility
> Argonne National Laboratory
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>

--
Hal Finkel
Assistant Computational Scientist
Leadership Computing Facility
Argonne National Laboratory

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150109/326f81bc/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: graycol.gif
Type: image/gif
Size: 105 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150109/326f81bc/attachment.gif>


More information about the llvm-commits mailing list