Displaying 20 results from an estimated 22 matches for "allowfpopfus".
2018 Aug 20
3
Condition code in DAGCombiner::visitFADDForFMACombine?
...(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 contractable, do not combine.
if (!AllowFusionGlobally && !isContractable(N))
return SDValue();
Specifically the AllowFusionGlobally, I would have expected something more
like:
bool AllowFusionGlobally = (Options...
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
>...
2019 Jul 10
2
RFC: change -fp-contract=off to actually disable FMAs
...e %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-contract=off, however, I also found there is disagreement in...
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...
2013 Jan 11
1
[LLVMdev] Documentation of fmuladd intrinsic
...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 ]
> }
We've written a few TableGen patterns here locally to match FMA...
2018 Aug 22
2
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))
> > > return SDValue();
&...
2013 Jan 11
0
[LLVMdev] Documentation of fmuladd intrinsic
...; }
>
>
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?
...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();
>>&...
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
...td::string 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?
...>> > 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...
2018 Aug 23
3
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))
>>>>> >...
2015 Sep 19
3
AArch64 fmul/fadd fusion
On Fri, Sep 18, 2015 at 10:34 PM, Tim Northover <t.p.northover at gmail.com> wrote:
> AArch64's fmadd instruction is fused, which means it can produce a
> different result to the two operations executed separately. The C and
> C++ standards do not allow such changes.
Sorry, sloppy language on my part. I was aware of fmadd, but I was
really asking about turning sequences like:
2016 Sep 14
2
setDataLayout segfault
...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 &...
2016 Jun 23
2
AVX512 instruction generated when JIT compiling for an avx2 architecture
...std::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...
2016 Jun 23
2
AVX512 instruction generated when JIT compiling for an avx2 architecture
...eBuilder.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() );
>
> TheExec...
2017 Dec 06
2
[AMDGPU] Strange results with different address spaces
> On Dec 6, 2017, at 02:28, Haidl, Michael <michael.haidl at uni-muenster.de> wrote:
>
> The IR goes through a backend agnostic preparation phase that brings it into SSA from and changes the AS from 0 to 1.
This sounds possibly problematic to me. The IR should be created with the correct address space to begin with. Changing this in the middle sounds suspect.
> After this
2016 Nov 18
2
what does -ffp-contract=fast allow?
...FMF in
> metadata) was discussed here:
> https://llvm.org/bugs/show_bug.cgi?id=13118
> 3. The backend needs a thread of its own. We have at least these
> mechanisms to handle FMA codegen:
> a. TargetOptions for LessPreciseFPMADOption, UnsafeFPMath,
> NoInfsFPMath, NoNaNsFPMath, AllowFPOpFusion (Fast, Standard, Strict)
> b. SDNodeFlags for UnsafeAlgebra, NoNaNs, NoInfs, NoSignedZeros (but
> nothing for FMA since IR FMF has nothing for FMA)
> c. SelectionDAGTargetInfo::generateFMAsInMachineCombiner()
> d. TargetLoweringBase::isFMAFasterThanFMulAndFAdd()
> e. TargetLow...
2013 Jan 11
3
[LLVMdev] Documentation of fmuladd intrinsic
...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,...