LLVM 17.0.0git
Classes | Namespaces | Functions
InstructionSimplify.h File Reference
#include "llvm/IR/PatternMatch.h"

Go to the source code of this file.

Classes

struct  llvm::InstrInfoQuery
 InstrInfoQuery provides an interface to query additional information for instructions like metadata or keywords like nsw, which provides conservative results if the users specified it is safe to use. More...
 
struct  llvm::SimplifyQuery
 

Namespaces

namespace  llvm
 This is an optimization pass for GlobalISel generic memory operations.
 

Functions

Valuellvm::simplifyAddInst (Value *LHS, Value *RHS, bool IsNSW, bool IsNUW, const SimplifyQuery &Q)
 Given operands for an Add, fold the result or return null.
 
Valuellvm::simplifySubInst (Value *LHS, Value *RHS, bool IsNSW, bool IsNUW, const SimplifyQuery &Q)
 Given operands for a Sub, fold the result or return null.
 
Valuellvm::simplifyMulInst (Value *LHS, Value *RHS, bool IsNSW, bool IsNUW, const SimplifyQuery &Q)
 Given operands for a Mul, fold the result or return null.
 
Valuellvm::simplifySDivInst (Value *LHS, Value *RHS, bool IsExact, const SimplifyQuery &Q)
 Given operands for an SDiv, fold the result or return null.
 
Valuellvm::simplifyUDivInst (Value *LHS, Value *RHS, bool IsExact, const SimplifyQuery &Q)
 Given operands for a UDiv, fold the result or return null.
 
Valuellvm::simplifySRemInst (Value *LHS, Value *RHS, const SimplifyQuery &Q)
 Given operands for an SRem, fold the result or return null.
 
Valuellvm::simplifyURemInst (Value *LHS, Value *RHS, const SimplifyQuery &Q)
 Given operands for a URem, fold the result or return null.
 
Valuellvm::simplifyFNegInst (Value *Op, FastMathFlags FMF, const SimplifyQuery &Q)
 Given operand for an FNeg, fold the result or return null.
 
Valuellvm::simplifyFAddInst (Value *LHS, Value *RHS, FastMathFlags FMF, const SimplifyQuery &Q, fp::ExceptionBehavior ExBehavior=fp::ebIgnore, RoundingMode Rounding=RoundingMode::NearestTiesToEven)
 Given operands for an FAdd, fold the result or return null.
 
Valuellvm::simplifyFSubInst (Value *LHS, Value *RHS, FastMathFlags FMF, const SimplifyQuery &Q, fp::ExceptionBehavior ExBehavior=fp::ebIgnore, RoundingMode Rounding=RoundingMode::NearestTiesToEven)
 Given operands for an FSub, fold the result or return null.
 
Valuellvm::simplifyFMulInst (Value *LHS, Value *RHS, FastMathFlags FMF, const SimplifyQuery &Q, fp::ExceptionBehavior ExBehavior=fp::ebIgnore, RoundingMode Rounding=RoundingMode::NearestTiesToEven)
 Given operands for an FMul, fold the result or return null.
 
Valuellvm::simplifyFMAFMul (Value *LHS, Value *RHS, FastMathFlags FMF, const SimplifyQuery &Q, fp::ExceptionBehavior ExBehavior=fp::ebIgnore, RoundingMode Rounding=RoundingMode::NearestTiesToEven)
 Given operands for the multiplication of a FMA, fold the result or return null.
 
Valuellvm::simplifyFDivInst (Value *LHS, Value *RHS, FastMathFlags FMF, const SimplifyQuery &Q, fp::ExceptionBehavior ExBehavior=fp::ebIgnore, RoundingMode Rounding=RoundingMode::NearestTiesToEven)
 Given operands for an FDiv, fold the result or return null.
 
Valuellvm::simplifyFRemInst (Value *LHS, Value *RHS, FastMathFlags FMF, const SimplifyQuery &Q, fp::ExceptionBehavior ExBehavior=fp::ebIgnore, RoundingMode Rounding=RoundingMode::NearestTiesToEven)
 Given operands for an FRem, fold the result or return null.
 
Valuellvm::simplifyShlInst (Value *Op0, Value *Op1, bool IsNSW, bool IsNUW, const SimplifyQuery &Q)
 Given operands for a Shl, fold the result or return null.
 
Valuellvm::simplifyLShrInst (Value *Op0, Value *Op1, bool IsExact, const SimplifyQuery &Q)
 Given operands for a LShr, fold the result or return null.
 
Valuellvm::simplifyAShrInst (Value *Op0, Value *Op1, bool IsExact, const SimplifyQuery &Q)
 Given operands for a AShr, fold the result or return nulll.
 
Valuellvm::simplifyAndInst (Value *LHS, Value *RHS, const SimplifyQuery &Q)
 Given operands for an And, fold the result or return null.
 
Valuellvm::simplifyOrInst (Value *LHS, Value *RHS, const SimplifyQuery &Q)
 Given operands for an Or, fold the result or return null.
 
Valuellvm::simplifyXorInst (Value *LHS, Value *RHS, const SimplifyQuery &Q)
 Given operands for an Xor, fold the result or return null.
 
Valuellvm::simplifyICmpInst (unsigned Predicate, Value *LHS, Value *RHS, const SimplifyQuery &Q)
 Given operands for an ICmpInst, fold the result or return null.
 
Valuellvm::simplifyFCmpInst (unsigned Predicate, Value *LHS, Value *RHS, FastMathFlags FMF, const SimplifyQuery &Q)
 Given operands for an FCmpInst, fold the result or return null.
 
Valuellvm::simplifySelectInst (Value *Cond, Value *TrueVal, Value *FalseVal, const SimplifyQuery &Q)
 Given operands for a SelectInst, fold the result or return null.
 
Valuellvm::simplifyGEPInst (Type *SrcTy, Value *Ptr, ArrayRef< Value * > Indices, bool InBounds, const SimplifyQuery &Q)
 Given operands for a GetElementPtrInst, fold the result or return null.
 
Valuellvm::simplifyInsertValueInst (Value *Agg, Value *Val, ArrayRef< unsigned > Idxs, const SimplifyQuery &Q)
 Given operands for an InsertValueInst, fold the result or return null.
 
Valuellvm::simplifyInsertElementInst (Value *Vec, Value *Elt, Value *Idx, const SimplifyQuery &Q)
 Given operands for an InsertElement, fold the result or return null.
 
Valuellvm::simplifyExtractValueInst (Value *Agg, ArrayRef< unsigned > Idxs, const SimplifyQuery &Q)
 Given operands for an ExtractValueInst, fold the result or return null.
 
Valuellvm::simplifyExtractElementInst (Value *Vec, Value *Idx, const SimplifyQuery &Q)
 Given operands for an ExtractElementInst, fold the result or return null.
 
Valuellvm::simplifyCastInst (unsigned CastOpc, Value *Op, Type *Ty, const SimplifyQuery &Q)
 Given operands for a CastInst, fold the result or return null.
 
Valuellvm::simplifyShuffleVectorInst (Value *Op0, Value *Op1, ArrayRef< int > Mask, Type *RetTy, const SimplifyQuery &Q)
 Given operands for a ShuffleVectorInst, fold the result or return null.
 
Valuellvm::simplifyCmpInst (unsigned Predicate, Value *LHS, Value *RHS, const SimplifyQuery &Q)
 Given operands for a CmpInst, fold the result or return null.
 
Valuellvm::simplifyUnOp (unsigned Opcode, Value *Op, const SimplifyQuery &Q)
 Given operand for a UnaryOperator, fold the result or return null.
 
Valuellvm::simplifyUnOp (unsigned Opcode, Value *Op, FastMathFlags FMF, const SimplifyQuery &Q)
 Given operand for a UnaryOperator, fold the result or return null.
 
Valuellvm::simplifyBinOp (unsigned Opcode, Value *LHS, Value *RHS, const SimplifyQuery &Q)
 Given operands for a BinaryOperator, fold the result or return null.
 
Valuellvm::simplifyBinOp (unsigned Opcode, Value *LHS, Value *RHS, FastMathFlags FMF, const SimplifyQuery &Q)
 Given operands for a BinaryOperator, fold the result or return null.
 
Valuellvm::simplifyCall (CallBase *Call, Value *Callee, ArrayRef< Value * > Args, const SimplifyQuery &Q)
 Given a callsite, callee, and arguments, fold the result or return null.
 
Valuellvm::simplifyConstrainedFPCall (CallBase *Call, const SimplifyQuery &Q)
 Given a constrained FP intrinsic call, tries to compute its simplified version.
 
Valuellvm::simplifyFreezeInst (Value *Op, const SimplifyQuery &Q)
 Given an operand for a Freeze, see if we can fold the result.
 
Valuellvm::simplifyLoadInst (LoadInst *LI, Value *PtrOp, const SimplifyQuery &Q)
 Given a load instruction and its pointer operand, fold the result or return null.
 
Valuellvm::simplifyInstruction (Instruction *I, const SimplifyQuery &Q)
 See if we can compute a simplified version of this instruction.
 
Valuellvm::simplifyInstructionWithOperands (Instruction *I, ArrayRef< Value * > NewOps, const SimplifyQuery &Q)
 Like simplifyInstruction but the operands of I are replaced with NewOps.
 
Valuellvm::simplifyWithOpReplaced (Value *V, Value *Op, Value *RepOp, const SimplifyQuery &Q, bool AllowRefinement)
 See if V simplifies when its operand Op is replaced with RepOp.
 
bool llvm::replaceAndRecursivelySimplify (Instruction *I, Value *SimpleV, const TargetLibraryInfo *TLI=nullptr, const DominatorTree *DT=nullptr, AssumptionCache *AC=nullptr, SmallSetVector< Instruction *, 8 > *UnsimplifiedUsers=nullptr)
 Replace all uses of 'I' with 'SimpleV' and simplify the uses recursively.
 
const SimplifyQuery llvm::getBestSimplifyQuery (Pass &, Function &)
 
template<class T , class... TArgs>
const SimplifyQuery llvm::getBestSimplifyQuery (AnalysisManager< T, TArgs... > &, Function &)
 
const SimplifyQuery llvm::getBestSimplifyQuery (LoopStandardAnalysisResults &, const DataLayout &)