LLVM  16.0.0git
Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
llvm::FastMathFlags Class Reference

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. More...
 
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. More...
 
void setAllowReassoc (bool B=true)
 Flag setters. More...
 
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. More...
 

Static Public Member Functions

static FastMathFlags getFast ()
 

Friends

class FPMathOperator
 

Detailed Description

Convenience struct for specifying and reasoning about fast-math flags.

Definition at line 21 of file FMF.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
AllowReassoc 
NoNaNs 
NoInfs 
NoSignedZeros 
AllowReciprocal 
AllowContract 
ApproxFunc 

Definition at line 40 of file FMF.h.

Constructor & Destructor Documentation

◆ FastMathFlags()

llvm::FastMathFlags::FastMathFlags ( )
default

Member Function Documentation

◆ all()

bool llvm::FastMathFlags::all ( ) const
inline

Definition at line 60 of file FMF.h.

Referenced by isFast(), and print().

◆ allowContract()

bool llvm::FastMathFlags::allowContract ( ) const
inline

Definition at line 71 of file FMF.h.

References AllowContract.

Referenced by llvm::MachineInstr::copyFlagsFromInstruction(), instCombineSVEVectorFMLA(), and print().

◆ allowReassoc()

bool llvm::FastMathFlags::allowReassoc ( ) const
inline

◆ allowReciprocal()

bool llvm::FastMathFlags::allowReciprocal ( ) const
inline

Definition at line 70 of file FMF.h.

References AllowReciprocal.

Referenced by llvm::MachineInstr::copyFlagsFromInstruction(), and print().

◆ any()

bool llvm::FastMathFlags::any ( ) const
inline

Definition at line 58 of file FMF.h.

◆ approxFunc()

bool llvm::FastMathFlags::approxFunc ( ) const
inline

Definition at line 72 of file FMF.h.

References ApproxFunc.

Referenced by llvm::MachineInstr::copyFlagsFromInstruction(), and print().

◆ clear()

void llvm::FastMathFlags::clear ( )
inline

Definition at line 62 of file FMF.h.

Referenced by llvm::IRBuilderBase::clearFastMathFlags(), and setFast().

◆ getFast()

static FastMathFlags llvm::FastMathFlags::getFast ( )
inlinestatic

Definition at line 52 of file FMF.h.

References setFast().

Referenced by llvm::RecurrenceDescriptor::AddReductionVar().

◆ isFast()

bool llvm::FastMathFlags::isFast ( ) const
inline

'Fast' means all bits are set.

Definition at line 74 of file FMF.h.

References all().

◆ noInfs()

bool llvm::FastMathFlags::noInfs ( ) const
inline

Definition at line 68 of file FMF.h.

References NoInfs.

Referenced by llvm::MachineInstr::copyFlagsFromInstruction(), foldFNegIntoConstant(), print(), and simplifyFPOp().

◆ noNaNs()

bool llvm::FastMathFlags::noNaNs ( ) const
inline

◆ none()

bool llvm::FastMathFlags::none ( ) const
inline

Definition at line 59 of file FMF.h.

◆ noSignedZeros()

bool llvm::FastMathFlags::noSignedZeros ( ) const
inline

◆ operator!=()

bool llvm::FastMathFlags::operator!= ( const FastMathFlags OtherFlags) const
inline

Definition at line 106 of file FMF.h.

◆ operator&=()

void llvm::FastMathFlags::operator&= ( const FastMathFlags OtherFlags)
inline

Definition at line 100 of file FMF.h.

◆ operator|=()

void llvm::FastMathFlags::operator|= ( const FastMathFlags OtherFlags)
inline

Definition at line 103 of file FMF.h.

◆ print()

void llvm::FastMathFlags::print ( raw_ostream O) const

Print fast-math flags to O.

Definition at line 230 of file Operator.cpp.

References all(), allowContract(), allowReassoc(), allowReciprocal(), approxFunc(), noInfs(), noNaNs(), noSignedZeros(), and llvm::RISCVFenceField::O.

Referenced by llvm::operator<<().

◆ set()

void llvm::FastMathFlags::set ( )
inline

Definition at line 63 of file FMF.h.

Referenced by setFast().

◆ setAllowContract()

void llvm::FastMathFlags::setAllowContract ( bool  B = true)
inline

Definition at line 92 of file FMF.h.

References AllowContract, and B.

Referenced by getDecodedFastMathFlags().

◆ setAllowReassoc()

void llvm::FastMathFlags::setAllowReassoc ( bool  B = true)
inline

Flag setters.

Definition at line 77 of file FMF.h.

References AllowReassoc, and B.

Referenced by getDecodedFastMathFlags().

◆ setAllowReciprocal()

void llvm::FastMathFlags::setAllowReciprocal ( bool  B = true)
inline

Definition at line 89 of file FMF.h.

References AllowReciprocal, and B.

Referenced by getDecodedFastMathFlags().

◆ setApproxFunc()

void llvm::FastMathFlags::setApproxFunc ( bool  B = true)
inline

Definition at line 95 of file FMF.h.

References ApproxFunc, and B.

Referenced by getDecodedFastMathFlags().

◆ setFast()

void llvm::FastMathFlags::setFast ( bool  B = true)
inline

Definition at line 98 of file FMF.h.

References B, clear(), and set().

Referenced by getDecodedFastMathFlags(), and getFast().

◆ setNoInfs()

void llvm::FastMathFlags::setNoInfs ( bool  B = true)
inline

Definition at line 83 of file FMF.h.

References B, and NoInfs.

Referenced by getDecodedFastMathFlags().

◆ setNoNaNs()

void llvm::FastMathFlags::setNoNaNs ( bool  B = true)
inline

Definition at line 80 of file FMF.h.

References B, and NoNaNs.

Referenced by getDecodedFastMathFlags(), and llvm::RecurrenceDescriptor::isReductionPHI().

◆ setNoSignedZeros()

void llvm::FastMathFlags::setNoSignedZeros ( bool  B = true)
inline

Friends And Related Function Documentation

◆ FPMathOperator

friend class FPMathOperator
friend

Definition at line 23 of file FMF.h.


The documentation for this class was generated from the following files: