LLVM 22.0.0git
llvm::ConstantFolder Class Referencefinal

ConstantFolder - Create constants with minimum, target independent, folding. More...

#include "llvm/IR/ConstantFolder.h"

Inheritance diagram for llvm::ConstantFolder:
[legend]

Public Member Functions

 ConstantFolder ()=default
ValueFoldBinOp (Instruction::BinaryOps Opc, Value *LHS, Value *RHS) const override
ValueFoldExactBinOp (Instruction::BinaryOps Opc, Value *LHS, Value *RHS, bool IsExact) const override
ValueFoldNoWrapBinOp (Instruction::BinaryOps Opc, Value *LHS, Value *RHS, bool HasNUW, bool HasNSW) const override
ValueFoldBinOpFMF (Instruction::BinaryOps Opc, Value *LHS, Value *RHS, FastMathFlags FMF) const override
ValueFoldUnOpFMF (Instruction::UnaryOps Opc, Value *V, FastMathFlags FMF) const override
ValueFoldCmp (CmpInst::Predicate P, Value *LHS, Value *RHS) const override
ValueFoldGEP (Type *Ty, Value *Ptr, ArrayRef< Value * > IdxList, GEPNoWrapFlags NW) const override
ValueFoldSelect (Value *C, Value *True, Value *False) const override
ValueFoldExtractValue (Value *Agg, ArrayRef< unsigned > IdxList) const override
ValueFoldInsertValue (Value *Agg, Value *Val, ArrayRef< unsigned > IdxList) const override
ValueFoldExtractElement (Value *Vec, Value *Idx) const override
ValueFoldInsertElement (Value *Vec, Value *NewElt, Value *Idx) const override
ValueFoldShuffleVector (Value *V1, Value *V2, ArrayRef< int > Mask) const override
ValueFoldCast (Instruction::CastOps Op, Value *V, Type *DestTy) const override
ValueFoldBinaryIntrinsic (Intrinsic::ID ID, Value *LHS, Value *RHS, Type *Ty, Instruction *FMFSource) const override
ConstantCreatePointerCast (Constant *C, Type *DestTy) const override
ConstantCreatePointerBitCastOrAddrSpaceCast (Constant *C, Type *DestTy) const override
Public Member Functions inherited from llvm::IRBuilderFolder
virtual ~IRBuilderFolder ()

Detailed Description

ConstantFolder - Create constants with minimum, target independent, folding.

Definition at line 31 of file ConstantFolder.h.

Constructor & Destructor Documentation

◆ ConstantFolder()

llvm::ConstantFolder::ConstantFolder ( )
explicitdefault

Member Function Documentation

◆ CreatePointerBitCastOrAddrSpaceCast()

Constant * llvm::ConstantFolder::CreatePointerBitCastOrAddrSpaceCast ( Constant * C,
Type * DestTy ) const
inlineoverridevirtual

◆ CreatePointerCast()

Constant * llvm::ConstantFolder::CreatePointerCast ( Constant * C,
Type * DestTy ) const
inlineoverridevirtual

◆ FoldBinaryIntrinsic()

Value * llvm::ConstantFolder::FoldBinaryIntrinsic ( Intrinsic::ID ID,
Value * LHS,
Value * RHS,
Type * Ty,
Instruction * FMFSource ) const
inlineoverridevirtual

Implements llvm::IRBuilderFolder.

Definition at line 184 of file ConstantFolder.h.

References LHS, and RHS.

◆ FoldBinOp()

Value * llvm::ConstantFolder::FoldBinOp ( Instruction::BinaryOps Opc,
Value * LHS,
Value * RHS ) const
inlineoverridevirtual

◆ FoldBinOpFMF()

Value * llvm::ConstantFolder::FoldBinOpFMF ( Instruction::BinaryOps Opc,
Value * LHS,
Value * RHS,
FastMathFlags FMF ) const
inlineoverridevirtual

Implements llvm::IRBuilderFolder.

Definition at line 87 of file ConstantFolder.h.

References FoldBinOp(), LHS, Opc, and RHS.

◆ FoldCast()

Value * llvm::ConstantFolder::FoldCast ( Instruction::CastOps Op,
Value * V,
Type * DestTy ) const
inlineoverridevirtual

◆ FoldCmp()

Value * llvm::ConstantFolder::FoldCmp ( CmpInst::Predicate P,
Value * LHS,
Value * RHS ) const
inlineoverridevirtual

Implements llvm::IRBuilderFolder.

Definition at line 99 of file ConstantFolder.h.

References llvm::ConstantFoldCompareInstruction(), llvm::dyn_cast(), LHS, P, and RHS.

◆ FoldExactBinOp()

Value * llvm::ConstantFolder::FoldExactBinOp ( Instruction::BinaryOps Opc,
Value * LHS,
Value * RHS,
bool IsExact ) const
inlineoverridevirtual

◆ FoldExtractElement()

Value * llvm::ConstantFolder::FoldExtractElement ( Value * Vec,
Value * Idx ) const
inlineoverridevirtual

◆ FoldExtractValue()

Value * llvm::ConstantFolder::FoldExtractValue ( Value * Agg,
ArrayRef< unsigned > IdxList ) const
inlineoverridevirtual

◆ FoldGEP()

Value * llvm::ConstantFolder::FoldGEP ( Type * Ty,
Value * Ptr,
ArrayRef< Value * > IdxList,
GEPNoWrapFlags NW ) const
inlineoverridevirtual

◆ FoldInsertElement()

Value * llvm::ConstantFolder::FoldInsertElement ( Value * Vec,
Value * NewElt,
Value * Idx ) const
inlineoverridevirtual

Implements llvm::IRBuilderFolder.

Definition at line 155 of file ConstantFolder.h.

References llvm::dyn_cast(), and llvm::ConstantExpr::getInsertElement().

◆ FoldInsertValue()

Value * llvm::ConstantFolder::FoldInsertValue ( Value * Agg,
Value * Val,
ArrayRef< unsigned > IdxList ) const
inlineoverridevirtual

◆ FoldNoWrapBinOp()

◆ FoldSelect()

Value * llvm::ConstantFolder::FoldSelect ( Value * C,
Value * True,
Value * False ) const
inlineoverridevirtual

◆ FoldShuffleVector()

Value * llvm::ConstantFolder::FoldShuffleVector ( Value * V1,
Value * V2,
ArrayRef< int > Mask ) const
inlineoverridevirtual

Implements llvm::IRBuilderFolder.

Definition at line 165 of file ConstantFolder.h.

References llvm::dyn_cast(), and llvm::ConstantExpr::getShuffleVector().

◆ FoldUnOpFMF()

Value * llvm::ConstantFolder::FoldUnOpFMF ( Instruction::UnaryOps Opc,
Value * V,
FastMathFlags FMF ) const
inlineoverridevirtual

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