Displaying 9 results from an estimated 9 matches for "hasfmad".
2018 Aug 20
3
Condition code in DAGCombiner::visitFADDForFMACombine?
I'm curious why the condition to fuse is this:
// Floating-point multiply-add with intermediate rounding.
bool HasFMAD = (LegalOperations && TLI.isOperationLegal(ISD::FMAD, VT));
static bool isContractable(SDNode *N) {
SDNodeFlags F = N->getFlags();
return F.hasAllowContract() || F.hasAllowReassociation();
}
bool CanFuse = Options.UnsafeFPMath || isContractable(N);
bool AllowFusionGlobally = (Optio...
2018 Aug 22
2
Condition code in DAGCombiner::visitFADDForFMACombine?
...hanks.
>
> On Mon, Aug 20, 2018 at 12:56 PM Ryan Taylor <ryta1203 at gmail.com
> <mailto:ryta1203 at gmail.com>> wrote:
>
> I'm curious why the condition to fuse is this:
>
> // Floating-point multiply-add with intermediate rounding.
> bool HasFMAD = (LegalOperations &&
> TLI.isOperationLegal(ISD::FMAD, VT));
>
> static bool isContractable(SDNode *N) {
> SDNodeFlags F = N->getFlags();
> return F.hasAllowContract() || F.hasAllowReassociation();
> }
>
> bool CanFuse = Options.Un...
2018 Aug 22
4
Condition code in DAGCombiner::visitFADDForFMACombine?
...> <mailto:ryta1203 at gmail.com <mailto:ryta1203 at gmail.com>>> wrote:
> >
> > I'm curious why the condition to fuse is this:
> >
> > // Floating-point multiply-add with intermediate rounding.
> > bool HasFMAD = (LegalOperations &&
> > TLI.isOperationLegal(ISD::FMAD, VT));
> >
> > static bool isContractable(SDNode *N) {
> > SDNodeFlags F = N->getFlags();
> > return F.hasAllowContract() || F.hasAllowReassociation();
&g...
2018 Aug 22
2
Condition code in DAGCombiner::visitFADDForFMACombine?
...ryta1203 at gmail.com>>>> wrote:
> > >
> > > I'm curious why the condition to fuse is this:
> > >
> > > // Floating-point multiply-add with intermediate rounding.
> > > bool HasFMAD = (LegalOperations &&
> > > TLI.isOperationLegal(ISD::FMAD, VT));
> > >
> > > static bool isContractable(SDNode *N) {
> > > SDNodeFlags F = N->getFlags();
> > > return F.h...
2018 Aug 23
2
Condition code in DAGCombiner::visitFADDForFMACombine?
...om <mailto:ryta1203 at gmail.com>>> wrote:
>>> >
>>> > I'm curious why the condition to fuse is this:
>>> >
>>> > // Floating-point multiply-add with intermediate rounding.
>>> > bool HasFMAD = (LegalOperations &&
>>> > TLI.isOperationLegal(ISD::FMAD, VT));
>>> >
>>> > static bool isContractable(SDNode *N) {
>>> > SDNodeFlags F = N->getFlags();
>>> > return F.hasAllowCon...
2018 Aug 23
2
Condition code in DAGCombiner::visitFADDForFMACombine?
...03 at gmail.com>>> wrote:
>>>> >
>>>> > I'm curious why the condition to fuse is this:
>>>> >
>>>> > // Floating-point multiply-add with intermediate rounding.
>>>> > bool HasFMAD = (LegalOperations &&
>>>> > TLI.isOperationLegal(ISD::FMAD, VT));
>>>> >
>>>> > static bool isContractable(SDNode *N) {
>>>> > SDNodeFlags F = N->getFlags();
>>>> >...
2018 Aug 23
3
Condition code in DAGCombiner::visitFADDForFMACombine?
...gt;> wrote:
>>>>> >
>>>>> > I'm curious why the condition to fuse is this:
>>>>> >
>>>>> > // Floating-point multiply-add with intermediate rounding.
>>>>> > bool HasFMAD = (LegalOperations &&
>>>>> > TLI.isOperationLegal(ISD::FMAD, VT));
>>>>> >
>>>>> > static bool isContractable(SDNode *N) {
>>>>> > SDNodeFlags F = N->getFlags();
>>>>&g...
2018 Aug 23
2
Condition code in DAGCombiner::visitFADDForFMACombine?
...fuse
>>>> is this:
>>>> >
>>>> > // Floating-point multiply-add with
>>>> intermediate rounding.
>>>> > bool HasFMAD = (LegalOperations &&
>>>> > TLI.isOperationLegal(ISD::FMAD, VT));
>>>> >
>>>> > static bool isContractable(SDNode *N) {
>>>> >...
2019 Jul 10
2
RFC: change -fp-contract=off to actually disable FMAs
...d213sd %xmm2, %xmm1, %xmm0 # xmm0 = (xmm1 * xmm0) + xmm2
It still generates an fma due to the logic in DAGCombiner:
bool CanFuse = Options.UnsafeFPMath || isContractable(N);
bool AllowFusionGlobally = (Options.AllowFPOpFusion == FPOpFusion::Fast ||
CanFuse || HasFMAD);
In this case, UnsafeFPMath is false but isContractable() is true since the
FADD node is tagged as 'fast'. A simple fix would just be to check for
-fp-contract=off, however, I also found there is disagreement in the LLVM
-fp-contract option itself:
in TargetOptions.h, =off maps to FP...