search for: fpopfus

Displaying 20 results from an estimated 26 matches for "fpopfus".

2018 Aug 20
3
Condition code in DAGCombiner::visitFADDForFMACombine?
...lOperations && 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 contractable, do not combine. if (!AllowFusionGlobally && !isContractable(N)) return SDValue(); Specifically the AllowFusionGlobally, I would have expected something more like: bool AllowFusionGlobally = (Options...
2019 Jul 10
2
RFC: change -fp-contract=off to actually disable FMAs
...d } $ 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-contract=off, however, I also found there is disagreement in...
2018 Aug 22
2
Condition code in DAGCombiner::visitFADDForFMACombine?
...> 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 contractable, do not combine. > if (!AllowFusionGlobally && !isContractable(N)) >     return SDValue(); > > Specifically the AllowFusionGlobally, I would have expected >...
2018 Aug 22
4
Condition code in DAGCombiner::visitFADDForFMACombine?
...>        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 contractable, do not combine. > >     if (!AllowFusionGlobally && !isContractable(N)) > >          return SDValue(); > > > >     Specifi...
2014 Jul 30
2
[LLVMdev] FPOpFusion = Fast and Multiply-and-add combines
Hi all, The AllowFPOpFusion option passed to a target can currently take 3 different values, Fast, Standard or Strict (TargetOptions.h), being Standard the default. In the DAGCombiner, during the combination of mul and add/subtract into multiply-and-add/subtract, this option is expected to be Fast in order to enable the c...
2014 Aug 07
2
[LLVMdev] FPOpFusion = Fast and Multiply-and-add combines
...l at rotateright.com> > To: Samuel F Antao/Watson/IBM at IBMUS > Cc: Tim Northover <t.p.northover at gmail.com>, Olivier H Sallenave/ > Watson/IBM at IBMUS, "llvmdev at cs.uiuc.edu" <llvmdev at cs.uiuc.edu> > Date: 08/06/2014 02:30 PM > Subject: Re: [LLVMdev] FPOpFusion = Fast and Multiply-and-add combines > > Hi Samuel, > I don't think clang follows what gcc does regarding FMA - at least > by default. I don't have a PPC compiler to test with, but for x86-64 > using clang trunk and gcc 4.9: > > $ cat fma.c > float foo(float x, f...
2014 Jul 31
2
[LLVMdev] FPOpFusion = Fast and Multiply-and-add combines
...4 09:54:55 AM: > From: Tim Northover <t.p.northover at gmail.com> > To: Samuel F Antao/Watson/IBM at IBMUS > Cc: "llvmdev at cs.uiuc.edu" <llvmdev at cs.uiuc.edu>, Olivier H > Sallenave/Watson/IBM at IBMUS > Date: 07/31/2014 09:55 AM > Subject: Re: [LLVMdev] FPOpFusion = Fast and Multiply-and-add combines > > Hi Samuel, > > On 30 July 2014 22:37, Samuel F Antao <sfantao at us.ibm.com> wrote: > > In the DAGCombiner, during the combination of mul and add/subtract into > > multiply-and-add/subtract, this option is expected to be Fast...
2013 Jan 11
1
[LLVMdev] Documentation of fmuladd intrinsic
...onditions that contribute to the decision of whether > or not to make the fmuladd -> fma translation. The relevant code is in > CodeGen/SelectionDAG/SelectionDAGBuilder.cpp: > > case Intrinsic::fmuladd: { > EVT VT = TLI.getValueType(I.getType()); > if (TM.Options.AllowFPOpFusion != FPOpFusion::Strict && > TLI.isOperationLegal(ISD::FMA, VT) && > TLI.isFMAFasterThanMulAndAdd(VT)){ > > [ use FMA ] > } else { > [ use MUL + ADD ] > } We've written a few TableGen patterns here locally to match FMA...
2018 Aug 22
2
Condition code in DAGCombiner::visitFADDForFMACombine?
...t;      >        return F.hasAllowContract() || > F.hasAllowReassociation(); > >      >     } > >      > > >      >     bool CanFuse = Options.UnsafeFPMath || isContractable(N); > >      >     bool AllowFusionGlobally = (Options.AllowFPOpFusion == > >      >     FPOpFusion::Fast || CanFuse || HasFMAD); > >      >     // If the addition is not contractable, do not combine. > >      >     if (!AllowFusionGlobally && !isContractable(N)) > >      >          return SDValue(); &...
2013 Jan 11
0
[LLVMdev] Documentation of fmuladd intrinsic
...gt; > There are a few conditions that contribute to the decision of whether or not to make the fmuladd -> fma translation. The relevant code is in CodeGen/SelectionDAG/SelectionDAGBuilder.cpp: case Intrinsic::fmuladd: { EVT VT = TLI.getValueType(I.getType()); if (TM.Options.AllowFPOpFusion != FPOpFusion::Strict && TLI.isOperationLegal(ISD::FMA, VT) && TLI.isFMAFasterThanMulAndAdd(VT)){ [ use FMA ] } else { [ use MUL + ADD ] } -Hal > > > Hope that helps, > Cameron > > > ______________________________...
2018 Aug 23
2
Condition code in DAGCombiner::visitFADDForFMACombine?
...ags(); >>> > return F.hasAllowContract() || F.hasAllowReassociation(); >>> > } >>> > >>> > bool CanFuse = Options.UnsafeFPMath || isContractable(N); >>> > bool AllowFusionGlobally = (Options.AllowFPOpFusion == >>> > FPOpFusion::Fast || CanFuse || HasFMAD); >>> > // If the addition is not contractable, do not combine. >>> > if (!AllowFusionGlobally && !isContractable(N)) >>> > return SDValue(); >>&...
2018 Aug 23
2
Condition code in DAGCombiner::visitFADDForFMACombine?
Nicolai, Can you do without the use of -fp-contract=fast (Options.AllowFPOpFusion == FPOpFusion::Fast ) and without Unsafe? As I SPIR-V’s usage of NoContraction flies in the face of both. If so, you should be able to get what you want, as then you are down to just IR flags. You will need a model to generate the correct behavior though in your SPIR-V implementation wrt IR fl...
2016 Sep 14
4
setDataLayout segfault
...tring mcjit_error; engineBuilder.setMCPU(llvm::sys::getHostCPUName()); engineBuilder.setEngineKind(llvm::EngineKind::JIT); engineBuilder.setOptLevel(llvm::CodeGenOpt::Aggressive); engineBuilder.setErrorStr(&mcjit_error); llvm::TargetOptions targetOptions; targetOptions.AllowFPOpFusion = llvm::FPOpFusion::Fast; engineBuilder.setTargetOptions( targetOptions ); TargetMachine *targetMachine = engineBuilder.selectTarget(); assert(targetMachine && "failed to create target machine"); std::cout << targetMachine->createDataLayout().getStringR...
2013 Jan 11
3
[LLVMdev] Documentation of fmuladd intrinsic
On Fri, Jan 11, 2013 at 1:08 PM, Andrew Booker <andrew.booker at arm.com>wrote: > The fmuladd intrinsic is described as saying that a multiply and > addition sequence can be fused into an fma instruction "if the code > generator determines that the fused expression would be legal and > efficient". (http://llvm.org/docs/LangRef.html#llvm-fma-intrinsic) > >
2018 Aug 23
2
Condition code in DAGCombiner::visitFADDForFMACombine?
...gt; > return F.hasAllowContract() || F.hasAllowReassociation(); >>>> > } >>>> > >>>> > bool CanFuse = Options.UnsafeFPMath || isContractable(N); >>>> > bool AllowFusionGlobally = (Options.AllowFPOpFusion == >>>> > FPOpFusion::Fast || CanFuse || HasFMAD); >>>> > // If the addition is not contractable, do not combine. >>>> > if (!AllowFusionGlobally && !isContractable(N)) >>>> > return SDVa...
2020 Jan 28
3
Floating point semantic modes
...around in llvm I find that the default setting in llvm is "Standard"==on just like you said. Shall we change clang to always pass through the option values rather than relying on llvm default? To me it seems more secure to have all settings exactly specified. static cl::opt<llvm::FPOpFusion::FPOpFusionMode> FuseFPOps( "fp-contract", cl::desc("Enable aggressive formation of fused FP ops"), cl::init(FPOpFusion::Standard), cl::values( clEnumValN(FPOpFusion::Fast, "fast", "Fuse FP ops whenever profitable"), clEnumVa...
2018 Aug 23
3
Condition code in DAGCombiner::visitFADDForFMACombine?
...return F.hasAllowContract() || F.hasAllowReassociation(); >>>>> > } >>>>> > >>>>> > bool CanFuse = Options.UnsafeFPMath || isContractable(N); >>>>> > bool AllowFusionGlobally = (Options.AllowFPOpFusion == >>>>> > FPOpFusion::Fast || CanFuse || HasFMAD); >>>>> > // If the addition is not contractable, do not combine. >>>>> > if (!AllowFusionGlobally && !isContractable(N)) >>>>> >...
2016 Nov 17
2
what does -ffp-contract=fast allow?
...docs/gcc-6.2.0/gcc/Optimize-Options.html#Optimize-Options "-ffp-contract=fast enables floating-point expression contraction such as forming of fused multiply-add operations if the target has native support for them." 5. The LLVM backend (where this reassociation currently happens) shows: FPOpFusion::Fast - Enable fusion of FP ops wherever it's profitable. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20161117/77b0545d/attachment.html>
2016 Sep 14
2
setDataLayout segfault
...getHostCPUName()); >> >> engineBuilder.setEngineKind(llvm::EngineKind::JIT); >> engineBuilder.setOptLevel(llvm::CodeGenOpt::Aggressive); >> engineBuilder.setErrorStr(&mcjit_error); >> >> llvm::TargetOptions targetOptions; >> targetOptions.AllowFPOpFusion = llvm::FPOpFusion::Fast; >> engineBuilder.setTargetOptions( targetOptions ); >> >> TargetMachine *targetMachine = engineBuilder.selectTarget(); >> >> assert(targetMachine && "failed to create target machine"); >> >> std::cout &...
2016 Jun 23
2
AVX512 instruction generated when JIT compiling for an avx2 architecture
...unique_ptr<llvm::Module>(Mod))); engineBuilder.setMCPU(llvm::sys::getHostCPUName()); engineBuilder.setEngineKind(llvm::EngineKind::JIT); engineBuilder.setOptLevel(llvm::CodeGenOpt::Aggressive); engineBuilder.setErrorStr(&mcjit_error); llvm::TargetOptions targetOptions; targetOptions.AllowFPOpFusion = llvm::FPOpFusion::Fast; engineBuilder.setTargetOptions( targetOptions ); TheExecutionEngine = engineBuilder.create(); targetMachine = engineBuilder.selectTarget(); Mod->setDataLayout( targetMachine->createDataLayout() ); TheExecutionEngine->finalizeObject(); // MCJIT fptr_mainFunc...