search for: iscontract

Displaying 12 results from an estimated 12 matches for "iscontract".

Did you mean: icontract
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 = (Options.AllowFPOpFusion == FPOpFusion::Fast || CanFuse || HasFMAD); // If the addition is not con...
2018 Aug 22
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(); >   return F.hasAllowContract() || F.hasAllowReassociation(); > } > > bool CanFuse = Options.UnsafeFPMath || isContractable(N); > bool AllowFusionGlobally = (Options.AllowFPOpFusion == > FPOpFusio...
2018 Aug 21
2
Condition code in DAGCombiner::visitFADDForFMACombine?
> On Aug 21, 2018, at 23:06, Ryan Taylor <ryta1203 at gmail.com> wrote: > > Why is isContractableFMUL different from isContractable? If contractable is only expected on the fmul, then what does it even mean to have it set on any other kind of instruction?
2018 Aug 22
4
Condition code in DAGCombiner::visitFADDForFMACombine?
...ous 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 AllowFusi...
2018 Aug 22
2
Condition code in DAGCombiner::visitFADDForFMACombine?
...gt; > >      >     // 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.UnsafeFPM...
2018 Aug 23
2
Condition code in DAGCombiner::visitFADDForFMACombine?
...gt; > >>> > // 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 || isContractab...
2018 Aug 23
2
Condition code in DAGCombiner::visitFADDForFMACombine?
...together as one control without > specifying precisely that. I do not think we need to add another flag. I > think we can work this within the definition. The text implies > NoContraction is both contract=off and reassoc=off, baring global context. > Since we are testing for both in isContractable in some fmul contexts and > always in fadd context, it should suffice. This and the global context > should be manageable in a SPIR env. The above text does not specify if the > add should control fusing or not, but leaves it open to interpretation. > > Our current definition of...
2018 Aug 23
3
Condition code in DAGCombiner::visitFADDForFMACombine?
...control without >> specifying precisely that. I do not think we need to add another flag. I >> think we can work this within the definition. The text implies >> NoContraction is both contract=off and reassoc=off, baring global context. >> Since we are testing for both in isContractable in some fmul contexts and >> always in fadd context, it should suffice. This and the global context >> should be manageable in a SPIR env. The above text does not specify if the >> add should control fusing or not, but leaves it open to interpretation. >> >> Our c...
2018 Aug 23
2
Condition code in DAGCombiner::visitFADDForFMACombine?
...I do not >>> think we need to add another flag. I think we can work this >>> within the definition. The text implies NoContraction is both >>> contract=off and reassoc=off, baring global context. Since we >>> are testing for both in isContractable in some fmul contexts >>> and always in fadd context, it should suffice. This and the >>> global context should be manageable in a SPIR env. The above >>> text does not specify if the add should control fusing or not, >>> but leav...
2018 Aug 21
2
Condition code in DAGCombiner::visitFADDForFMACombine?
For this code: %20 = fmul reassoc nnan arcp contract float %15, %19 %21 = fadd nnan arcp float %20, -1.000000e+00 This does not result in fused multiply-add. it seems like the logic to contact the fmul from the fadd is different than whether to decide to contract the fadd. I would think the logic would be the same for each instruction in the pair. On Tue, Aug 21, 2018 at 2:05 PM Ryan
2019 Jul 10
2
RFC: change -fp-contract=off to actually disable FMAs
...ble %b, %a %add = fadd fast double %mul, %c ret double %add } $ llc -mattr=+fma fma.ll -fp-contract=off -o - | grep vfmadd vfmadd213sd %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-co...
2018 Aug 21
3
Condition code in DAGCombiner::visitFADDForFMACombine?
> On Aug 21, 2018, at 17:57, Ryan Taylor <ryta1203 at gmail.com> wrote: > > Matt, > I'm sorry, actually it's fma not fmad. > > In the post-legalizer DAG combine for the given code it's producing fma not fmad. That doens't seem correct. > The contract is on the fadd. I’m not really sure what the rule is supposed to be for contract between the nodes.