mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-17 08:06:40 +00:00
[VPlan] Move VPRecipeWithIRFlags::getFastMathFlags. (NFCI)
Split off suggested refactoring from D157144. Also adds a assert to make sure this is only used when OpType is FPMathOp.
This commit is contained in:
parent
4d3e917839
commit
0b17e9d285
@ -948,19 +948,9 @@ public:
|
||||
return GEPFlags.IsInBounds;
|
||||
}
|
||||
|
||||
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
|
||||
FastMathFlags getFastMathFlags() const {
|
||||
FastMathFlags Res;
|
||||
Res.setAllowReassoc(FMFs.AllowReassoc);
|
||||
Res.setNoNaNs(FMFs.NoNaNs);
|
||||
Res.setNoInfs(FMFs.NoInfs);
|
||||
Res.setNoSignedZeros(FMFs.NoSignedZeros);
|
||||
Res.setAllowReciprocal(FMFs.AllowReciprocal);
|
||||
Res.setAllowContract(FMFs.AllowContract);
|
||||
Res.setApproxFunc(FMFs.ApproxFunc);
|
||||
return Res;
|
||||
}
|
||||
FastMathFlags getFastMathFlags() const;
|
||||
|
||||
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
|
||||
void printFlags(raw_ostream &O) const;
|
||||
#endif
|
||||
};
|
||||
|
@ -216,6 +216,20 @@ void VPRecipeBase::moveBefore(VPBasicBlock &BB,
|
||||
insertBefore(BB, I);
|
||||
}
|
||||
|
||||
FastMathFlags VPRecipeWithIRFlags::getFastMathFlags() const {
|
||||
assert(OpType == OperationType::FPMathOp &&
|
||||
"recipe doesn't have fast math flags");
|
||||
FastMathFlags Res;
|
||||
Res.setAllowReassoc(FMFs.AllowReassoc);
|
||||
Res.setNoNaNs(FMFs.NoNaNs);
|
||||
Res.setNoInfs(FMFs.NoInfs);
|
||||
Res.setNoSignedZeros(FMFs.NoSignedZeros);
|
||||
Res.setAllowReciprocal(FMFs.AllowReciprocal);
|
||||
Res.setAllowContract(FMFs.AllowContract);
|
||||
Res.setApproxFunc(FMFs.ApproxFunc);
|
||||
return Res;
|
||||
}
|
||||
|
||||
Value *VPInstruction::generateInstruction(VPTransformState &State,
|
||||
unsigned Part) {
|
||||
IRBuilderBase &Builder = State.Builder;
|
||||
|
Loading…
x
Reference in New Issue
Block a user