LLVM 20.0.0git
|
Convenience struct for specifying and reasoning about fast-math flags. More...
#include "llvm/IR/FMF.h"
Public Types | |
enum | { AllowReassoc = (1 << 0) , NoNaNs = (1 << 1) , NoInfs = (1 << 2) , NoSignedZeros = (1 << 3) , AllowReciprocal = (1 << 4) , AllowContract = (1 << 5) , ApproxFunc = (1 << 6) } |
Public Member Functions | |
FastMathFlags ()=default | |
bool | any () const |
bool | none () const |
bool | all () const |
void | clear () |
void | set () |
bool | allowReassoc () const |
Flag queries. | |
bool | noNaNs () const |
bool | noInfs () const |
bool | noSignedZeros () const |
bool | allowReciprocal () const |
bool | allowContract () const |
bool | approxFunc () const |
bool | isFast () const |
'Fast' means all bits are set. | |
void | setAllowReassoc (bool B=true) |
Flag setters. | |
void | setNoNaNs (bool B=true) |
void | setNoInfs (bool B=true) |
void | setNoSignedZeros (bool B=true) |
void | setAllowReciprocal (bool B=true) |
void | setAllowContract (bool B=true) |
void | setApproxFunc (bool B=true) |
void | setFast (bool B=true) |
void | operator&= (const FastMathFlags &OtherFlags) |
void | operator|= (const FastMathFlags &OtherFlags) |
bool | operator!= (const FastMathFlags &OtherFlags) const |
void | print (raw_ostream &O) const |
Print fast-math flags to O . | |
Static Public Member Functions | |
static FastMathFlags | getFast () |
Friends | |
class | FPMathOperator |
Convenience struct for specifying and reasoning about fast-math flags.
anonymous enum |
|
default |
|
inline |
Definition at line 59 of file FMF.h.
Referenced by isFast(), llvm::InstModificationIRStrategy::mutate(), and print().
|
inline |
Definition at line 70 of file FMF.h.
References AllowContract.
Referenced by llvm::GCNTTIImpl::instCombineIntrinsic(), instCombineSVEVectorFuseMulAddSub(), mapToLLVMFastMathFlags(), and print().
|
inline |
Flag queries.
Definition at line 65 of file FMF.h.
References AllowReassoc.
Referenced by llvm::InstCombinerImpl::foldFMulReassoc(), getISDForVPIntrinsic(), mapToLLVMFastMathFlags(), print(), simplifyFAddInst(), simplifyFDivInst(), simplifyFMAFMul(), simplifyFSubInst(), and llvm::InstCombinerImpl::visitCallInst().
|
inline |
Definition at line 69 of file FMF.h.
References AllowReciprocal.
Referenced by mapToLLVMFastMathFlags(), and print().
|
inline |
Definition at line 71 of file FMF.h.
References ApproxFunc.
Referenced by llvm::AMDGPULibCalls::fold(), mapToLLVMFastMathFlags(), and print().
|
inline |
Definition at line 61 of file FMF.h.
Referenced by llvm::IRBuilderBase::clearFastMathFlags(), and setFast().
|
inlinestatic |
Definition at line 51 of file FMF.h.
References setFast().
Referenced by llvm::RecurrenceDescriptor::AddReductionVar().
|
inline |
|
inline |
Definition at line 67 of file FMF.h.
References NoInfs.
Referenced by llvm::computeKnownFPClass(), foldFNegIntoConstant(), isKnownIntegral(), mapToLLVMFastMathFlags(), print(), simplifyFDivInst(), and simplifyFPOp().
|
inline |
Definition at line 66 of file FMF.h.
References NoNaNs.
Referenced by llvm::canIgnoreSNaN(), llvm::computeKnownFPClass(), llvm::RISCVTTIImpl::getMinMaxReductionCost(), llvm::RecurrenceDescriptor::getRecurrenceIdentity(), isKnownIntegral(), isKnownNonNaN(), llvm::RecurrenceDescriptor::isRecurrenceInstr(), mapToLLVMFastMathFlags(), print(), simplifyFAddInst(), simplifyFCmpInst(), simplifyFDivInst(), simplifyFMAFMul(), simplifyFPOp(), simplifyFRemInst(), and simplifyFSubInst().
|
inline |
Definition at line 58 of file FMF.h.
Referenced by llvm::AMDGPULibCalls::fold(), and llvm::InstModificationIRStrategy::mutate().
|
inline |
Definition at line 68 of file FMF.h.
References NoSignedZeros.
Referenced by foldFNegIntoConstant(), llvm::InstCombinerImpl::foldSelectIntoOp(), llvm::RecurrenceDescriptor::getRecurrenceIdentity(), llvm::RecurrenceDescriptor::isRecurrenceInstr(), mapToLLVMFastMathFlags(), matchSelectPattern(), print(), simplifyFAddInst(), simplifyFDivInst(), simplifyFMAFMul(), and simplifyFSubInst().
|
inline |
|
inline |
|
inline |
void llvm::FastMathFlags::print | ( | raw_ostream & | O | ) | const |
Print fast-math flags to O
.
Definition at line 260 of file Operator.cpp.
References all(), allowContract(), allowReassoc(), allowReciprocal(), approxFunc(), noInfs(), noNaNs(), and noSignedZeros().
Referenced by llvm::operator<<(), and llvm::VPRecipeWithIRFlags::printFlags().
|
inline |
Definition at line 91 of file FMF.h.
References AllowContract, and B.
Referenced by getDecodedFastMathFlags(), llvm::VPRecipeWithIRFlags::getFastMathFlags(), and mapFromLLVMFastMathFlags().
Flag setters.
Definition at line 76 of file FMF.h.
References AllowReassoc, and B.
Referenced by getDecodedFastMathFlags(), llvm::VPRecipeWithIRFlags::getFastMathFlags(), and mapFromLLVMFastMathFlags().
Definition at line 88 of file FMF.h.
References AllowReciprocal, and B.
Referenced by getDecodedFastMathFlags(), llvm::VPRecipeWithIRFlags::getFastMathFlags(), and mapFromLLVMFastMathFlags().
Definition at line 94 of file FMF.h.
References ApproxFunc, and B.
Referenced by getDecodedFastMathFlags(), llvm::VPRecipeWithIRFlags::getFastMathFlags(), and mapFromLLVMFastMathFlags().
Definition at line 82 of file FMF.h.
Referenced by getDecodedFastMathFlags(), llvm::VPRecipeWithIRFlags::getFastMathFlags(), and mapFromLLVMFastMathFlags().
Definition at line 79 of file FMF.h.
Referenced by getDecodedFastMathFlags(), llvm::VPRecipeWithIRFlags::getFastMathFlags(), llvm::RecurrenceDescriptor::isReductionPHI(), and mapFromLLVMFastMathFlags().
Definition at line 85 of file FMF.h.
References B, and NoSignedZeros.
Referenced by getDecodedFastMathFlags(), llvm::VPRecipeWithIRFlags::getFastMathFlags(), llvm::RecurrenceDescriptor::isReductionPHI(), mapFromLLVMFastMathFlags(), llvm::matchDecomposedSelectPattern(), and llvm::InstCombinerImpl::visitCallInst().
|
friend |