[LLVMdev] RFC: Add ISD nodes for mad

Hal Finkel hfinkel at anl.gov
Wed Feb 4 15:20:08 PST 2015


----- Original Message -----
> From: "Matt Arsenault" <Matthew.Arsenault at amd.com>
> To: "Hal Finkel" <hfinkel at anl.gov>, "Owen Anderson" <resistor at mac.com>
> Cc: "llvmdev at cs.uiuc.edu" <LLVMdev at cs.uiuc.edu>
> Sent: Wednesday, February 4, 2015 5:03:44 PM
> Subject: Re: [LLVMdev] RFC: Add ISD nodes for mad
> 
> On 01/28/2015 07:06 PM, Hal Finkel wrote:
> > ----- Original Message -----
> >> From: "Owen Anderson" <resistor at mac.com>
> >> To: "Hal Finkel" <hfinkel at anl.gov>
> >> Cc: "Matt Arsenault" <Matthew.Arsenault at amd.com>,
> >> "llvmdev at cs.uiuc.edu" <LLVMdev at cs.uiuc.edu>
> >> Sent: Wednesday, January 28, 2015 6:54:23 PM
> >> Subject: Re: [LLVMdev] RFC: Add ISD nodes for mad
> >>
> >> On Jan 28, 2015, at 3:47 PM, Hal Finkel < hfinkel at anl.gov > wrote:
> >>
> >> ----- Original Message -----
> >>
> >>
> >> From: "Matt Arsenault" < Matthew.Arsenault at amd.com >
> >> To: " llvmdev at cs.uiuc.edu " < LLVMdev at cs.uiuc.edu >
> >> Sent: Wednesday, January 28, 2015 1:52:59 PM
> >> Subject: [LLVMdev] RFC: Add ISD nodes for mad
> >>
> >> Hi,
> >>
> >> I would like to add an ISD node for an fmad operation (named
> >> either
> >> FMAD
> >> or FMULADD). It will have the semantics of returning the same
> >> result
> >> as
> >> the separate multiply and add with the intermediate rounding step,
> >> and
> >> not a differently rounded result. The motivation is to share code
> >> with
> >> the various FMA forming DAG combines, but will be generally more
> >> useful
> >> on targets that support it since it is OK to form without
> >> non-default
> >> -fp-contract modes.
> >>
> >> Why not just reuse the existing FMA node, but add an additional
> >> parameter to indicate whether enhanced intermediate precision is
> >> required?
> >>
> >> Because that would break a lot of existing backends?
> > Fair enough.
> >
> > Generally speaking, I think that having some mechanism to share the
> > DAGCombines between the two kinds of FMAs is a good idea (I took a
> > quick look through the existing DAGCombine code, and it seems
> > worth sharing and most of them (except for the combines including
> > fpext nodes) won't be affected by the precision changes). I'd need
> > to see a patch to be sure, however.
> >
> >   -Hal
> 
> So do you think I should attempt to write a patch that adds this
> node,
> or find some other method for sharing these? Would something
> analogous
> to TLI.getRecipEstimate() be preferrable?

Try a patch adding the new ISD node; that's probably the more straightforward way.

 -Hal

> 
> -Matt
> 

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



More information about the llvm-dev mailing list