LLVM 17.0.0git
Public Member Functions | List of all members
llvm::ConstantFolder Class Referencefinal

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

#include "llvm/IR/ConstantFolder.h"

Inheritance diagram for llvm::ConstantFolder:
Inheritance graph
[legend]
Collaboration diagram for llvm::ConstantFolder:
Collaboration graph
[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
 
ValueFoldICmp (CmpInst::Predicate P, Value *LHS, Value *RHS) const override
 
ValueFoldGEP (Type *Ty, Value *Ptr, ArrayRef< Value * > IdxList, bool IsInBounds=false) 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
 
ConstantCreateCast (Instruction::CastOps Op, Constant *C, Type *DestTy) const override
 
ConstantCreatePointerCast (Constant *C, Type *DestTy) const override
 
ConstantCreatePointerBitCastOrAddrSpaceCast (Constant *C, Type *DestTy) const override
 
ConstantCreateIntCast (Constant *C, Type *DestTy, bool isSigned) const override
 
ConstantCreateFPCast (Constant *C, Type *DestTy) const override
 
ConstantCreateBitCast (Constant *C, Type *DestTy) const override
 
ConstantCreateIntToPtr (Constant *C, Type *DestTy) const override
 
ConstantCreatePtrToInt (Constant *C, Type *DestTy) const override
 
ConstantCreateZExtOrBitCast (Constant *C, Type *DestTy) const override
 
ConstantCreateSExtOrBitCast (Constant *C, Type *DestTy) const override
 
ConstantCreateTruncOrBitCast (Constant *C, Type *DestTy) const override
 
ConstantCreateFCmp (CmpInst::Predicate P, Constant *LHS, Constant *RHS) const override
 
- Public Member Functions inherited from llvm::IRBuilderFolder
virtual ~IRBuilderFolder ()
 
virtual ValueFoldBinOp (Instruction::BinaryOps Opc, Value *LHS, Value *RHS) const =0
 
virtual ValueFoldExactBinOp (Instruction::BinaryOps Opc, Value *LHS, Value *RHS, bool IsExact) const =0
 
virtual ValueFoldNoWrapBinOp (Instruction::BinaryOps Opc, Value *LHS, Value *RHS, bool HasNUW, bool HasNSW) const =0
 
virtual ValueFoldBinOpFMF (Instruction::BinaryOps Opc, Value *LHS, Value *RHS, FastMathFlags FMF) const =0
 
virtual ValueFoldUnOpFMF (Instruction::UnaryOps Opc, Value *V, FastMathFlags FMF) const =0
 
virtual ValueFoldICmp (CmpInst::Predicate P, Value *LHS, Value *RHS) const =0
 
virtual ValueFoldGEP (Type *Ty, Value *Ptr, ArrayRef< Value * > IdxList, bool IsInBounds=false) const =0
 
virtual ValueFoldSelect (Value *C, Value *True, Value *False) const =0
 
virtual ValueFoldExtractValue (Value *Agg, ArrayRef< unsigned > IdxList) const =0
 
virtual ValueFoldInsertValue (Value *Agg, Value *Val, ArrayRef< unsigned > IdxList) const =0
 
virtual ValueFoldExtractElement (Value *Vec, Value *Idx) const =0
 
virtual ValueFoldInsertElement (Value *Vec, Value *NewElt, Value *Idx) const =0
 
virtual ValueFoldShuffleVector (Value *V1, Value *V2, ArrayRef< int > Mask) const =0
 
virtual ValueCreateCast (Instruction::CastOps Op, Constant *C, Type *DestTy) const =0
 
virtual ValueCreatePointerCast (Constant *C, Type *DestTy) const =0
 
virtual ValueCreatePointerBitCastOrAddrSpaceCast (Constant *C, Type *DestTy) const =0
 
virtual ValueCreateIntCast (Constant *C, Type *DestTy, bool isSigned) const =0
 
virtual ValueCreateFPCast (Constant *C, Type *DestTy) const =0
 
virtual ValueCreateBitCast (Constant *C, Type *DestTy) const =0
 
virtual ValueCreateIntToPtr (Constant *C, Type *DestTy) const =0
 
virtual ValueCreatePtrToInt (Constant *C, Type *DestTy) const =0
 
virtual ValueCreateZExtOrBitCast (Constant *C, Type *DestTy) const =0
 
virtual ValueCreateSExtOrBitCast (Constant *C, Type *DestTy) const =0
 
virtual ValueCreateTruncOrBitCast (Constant *C, Type *DestTy) const =0
 
virtual ValueCreateFCmp (CmpInst::Predicate P, Constant *LHS, Constant *RHS) const =0
 

Detailed Description

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

Definition at line 30 of file ConstantFolder.h.

Constructor & Destructor Documentation

◆ ConstantFolder()

llvm::ConstantFolder::ConstantFolder ( )
explicitdefault

Member Function Documentation

◆ CreateBitCast()

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

Implements llvm::IRBuilderFolder.

Definition at line 203 of file ConstantFolder.h.

References llvm::CallingConv::C, and CreateCast().

◆ CreateCast()

Constant * llvm::ConstantFolder::CreateCast ( Instruction::CastOps  Op,
Constant C,
Type DestTy 
) const
inlineoverridevirtual

◆ CreateFCmp()

Constant * llvm::ConstantFolder::CreateFCmp ( CmpInst::Predicate  P,
Constant LHS,
Constant RHS 
) const
inlineoverridevirtual

Implements llvm::IRBuilderFolder.

Definition at line 231 of file ConstantFolder.h.

References llvm::ConstantExpr::getCompare(), LHS, P, and RHS.

◆ CreateFPCast()

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

Implements llvm::IRBuilderFolder.

Definition at line 199 of file ConstantFolder.h.

References llvm::CallingConv::C, and llvm::ConstantExpr::getFPCast().

◆ CreateIntCast()

Constant * llvm::ConstantFolder::CreateIntCast ( Constant C,
Type DestTy,
bool  isSigned 
) const
inlineoverridevirtual

◆ CreateIntToPtr()

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

Implements llvm::IRBuilderFolder.

Definition at line 207 of file ConstantFolder.h.

References llvm::CallingConv::C, and CreateCast().

◆ CreatePointerBitCastOrAddrSpaceCast()

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

◆ CreatePointerCast()

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

◆ CreatePtrToInt()

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

Implements llvm::IRBuilderFolder.

Definition at line 211 of file ConstantFolder.h.

References llvm::CallingConv::C, and CreateCast().

◆ CreateSExtOrBitCast()

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

◆ CreateTruncOrBitCast()

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

◆ CreateZExtOrBitCast()

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

◆ 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 86 of file ConstantFolder.h.

References FoldBinOp(), LHS, 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

Implements llvm::IRBuilderFolder.

Definition at line 149 of file ConstantFolder.h.

References llvm::ConstantExpr::getExtractElement(), and Idx.

◆ FoldExtractValue()

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

Implements llvm::IRBuilderFolder.

Definition at line 133 of file ConstantFolder.h.

References llvm::ConstantFoldExtractValueInstruction().

◆ FoldGEP()

Value * llvm::ConstantFolder::FoldGEP ( Type Ty,
Value Ptr,
ArrayRef< Value * >  IdxList,
bool  IsInBounds = false 
) const
inlineoverridevirtual

◆ FoldICmp()

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

Implements llvm::IRBuilderFolder.

Definition at line 98 of file ConstantFolder.h.

References llvm::ConstantExpr::getCompare(), LHS, P, and RHS.

◆ FoldInsertElement()

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

Implements llvm::IRBuilderFolder.

Definition at line 157 of file ConstantFolder.h.

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

◆ FoldInsertValue()

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

Implements llvm::IRBuilderFolder.

Definition at line 140 of file ConstantFolder.h.

References llvm::ConstantFoldInsertValueInstruction().

◆ FoldNoWrapBinOp()

Value * llvm::ConstantFolder::FoldNoWrapBinOp ( Instruction::BinaryOps  Opc,
Value LHS,
Value RHS,
bool  HasNUW,
bool  HasNSW 
) const
inlineoverridevirtual

◆ 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 167 of file ConstantFolder.h.

References 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 files: