LLVM  11.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
 
ConstantCreateAdd (Constant *LHS, Constant *RHS, bool HasNUW=false, bool HasNSW=false) const override
 
ConstantCreateFAdd (Constant *LHS, Constant *RHS) const override
 
ConstantCreateSub (Constant *LHS, Constant *RHS, bool HasNUW=false, bool HasNSW=false) const override
 
ConstantCreateFSub (Constant *LHS, Constant *RHS) const override
 
ConstantCreateMul (Constant *LHS, Constant *RHS, bool HasNUW=false, bool HasNSW=false) const override
 
ConstantCreateFMul (Constant *LHS, Constant *RHS) const override
 
ConstantCreateUDiv (Constant *LHS, Constant *RHS, bool isExact=false) const override
 
ConstantCreateSDiv (Constant *LHS, Constant *RHS, bool isExact=false) const override
 
ConstantCreateFDiv (Constant *LHS, Constant *RHS) const override
 
ConstantCreateURem (Constant *LHS, Constant *RHS) const override
 
ConstantCreateSRem (Constant *LHS, Constant *RHS) const override
 
ConstantCreateFRem (Constant *LHS, Constant *RHS) const override
 
ConstantCreateShl (Constant *LHS, Constant *RHS, bool HasNUW=false, bool HasNSW=false) const override
 
ConstantCreateLShr (Constant *LHS, Constant *RHS, bool isExact=false) const override
 
ConstantCreateAShr (Constant *LHS, Constant *RHS, bool isExact=false) const override
 
ConstantCreateAnd (Constant *LHS, Constant *RHS) const override
 
ConstantCreateOr (Constant *LHS, Constant *RHS) const override
 
ConstantCreateXor (Constant *LHS, Constant *RHS) const override
 
ConstantCreateBinOp (Instruction::BinaryOps Opc, Constant *LHS, Constant *RHS) const override
 
ConstantCreateNeg (Constant *C, bool HasNUW=false, bool HasNSW=false) const override
 
ConstantCreateFNeg (Constant *C) const override
 
ConstantCreateNot (Constant *C) const override
 
ConstantCreateUnOp (Instruction::UnaryOps Opc, Constant *C) const override
 
ConstantCreateGetElementPtr (Type *Ty, Constant *C, ArrayRef< Constant *> IdxList) const override
 
ConstantCreateGetElementPtr (Type *Ty, Constant *C, Constant *Idx) const override
 
ConstantCreateGetElementPtr (Type *Ty, Constant *C, ArrayRef< Value *> IdxList) const override
 
ConstantCreateInBoundsGetElementPtr (Type *Ty, Constant *C, ArrayRef< Constant *> IdxList) const override
 
ConstantCreateInBoundsGetElementPtr (Type *Ty, Constant *C, Constant *Idx) const override
 
ConstantCreateInBoundsGetElementPtr (Type *Ty, Constant *C, ArrayRef< Value *> IdxList) 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
 
ConstantCreateICmp (CmpInst::Predicate P, Constant *LHS, Constant *RHS) const override
 
ConstantCreateFCmp (CmpInst::Predicate P, Constant *LHS, Constant *RHS) const override
 
ConstantCreateSelect (Constant *C, Constant *True, Constant *False) const override
 
ConstantCreateExtractElement (Constant *Vec, Constant *Idx) const override
 
ConstantCreateInsertElement (Constant *Vec, Constant *NewElt, Constant *Idx) const override
 
ConstantCreateShuffleVector (Constant *V1, Constant *V2, ArrayRef< int > Mask) const override
 
ConstantCreateExtractValue (Constant *Agg, ArrayRef< unsigned > IdxList) const override
 
ConstantCreateInsertValue (Constant *Agg, Constant *Val, ArrayRef< unsigned > IdxList) const override
 
- Public Member Functions inherited from llvm::IRBuilderFolder
virtual ~IRBuilderFolder ()
 

Detailed Description

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

Definition at line 28 of file ConstantFolder.h.

Constructor & Destructor Documentation

◆ ConstantFolder()

llvm::ConstantFolder::ConstantFolder ( )
explicitdefault

Member Function Documentation

◆ CreateAdd()

Constant* llvm::ConstantFolder::CreateAdd ( Constant LHS,
Constant RHS,
bool  HasNUW = false,
bool  HasNSW = false 
) const
inlineoverridevirtual

Implements llvm::IRBuilderFolder.

Definition at line 38 of file ConstantFolder.h.

References llvm::ConstantExpr::getAdd().

◆ CreateAnd()

Constant* llvm::ConstantFolder::CreateAnd ( Constant LHS,
Constant RHS 
) const
inlineoverridevirtual

Implements llvm::IRBuilderFolder.

Definition at line 106 of file ConstantFolder.h.

References llvm::ConstantExpr::getAnd().

◆ CreateAShr()

Constant* llvm::ConstantFolder::CreateAShr ( Constant LHS,
Constant RHS,
bool  isExact = false 
) const
inlineoverridevirtual

Implements llvm::IRBuilderFolder.

Definition at line 101 of file ConstantFolder.h.

References llvm::ConstantExpr::getAShr().

◆ CreateBinOp()

Constant* llvm::ConstantFolder::CreateBinOp ( Instruction::BinaryOps  Opc,
Constant LHS,
Constant RHS 
) const
inlineoverridevirtual

Implements llvm::IRBuilderFolder.

Definition at line 118 of file ConstantFolder.h.

References llvm::ConstantExpr::get().

◆ CreateBitCast()

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

Implements llvm::IRBuilderFolder.

Definition at line 211 of file ConstantFolder.h.

References CreateCast().

◆ CreateCast()

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

Implements llvm::IRBuilderFolder.

Definition at line 188 of file ConstantFolder.h.

References llvm::ConstantExpr::getCast().

Referenced by CreateBitCast(), CreateIntToPtr(), and CreatePtrToInt().

◆ CreateExtractElement()

Constant* llvm::ConstantFolder::CreateExtractElement ( Constant Vec,
Constant Idx 
) const
inlineoverridevirtual

Implements llvm::IRBuilderFolder.

Definition at line 258 of file ConstantFolder.h.

References llvm::ConstantExpr::getExtractElement().

◆ CreateExtractValue()

Constant* llvm::ConstantFolder::CreateExtractValue ( Constant Agg,
ArrayRef< unsigned IdxList 
) const
inlineoverridevirtual

Implements llvm::IRBuilderFolder.

Definition at line 272 of file ConstantFolder.h.

References llvm::ConstantExpr::getExtractValue().

◆ CreateFAdd()

Constant* llvm::ConstantFolder::CreateFAdd ( Constant LHS,
Constant RHS 
) const
inlineoverridevirtual

Implements llvm::IRBuilderFolder.

Definition at line 43 of file ConstantFolder.h.

References llvm::ConstantExpr::getFAdd().

◆ CreateFCmp()

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

Implements llvm::IRBuilderFolder.

Definition at line 244 of file ConstantFolder.h.

References llvm::ConstantExpr::getCompare().

◆ CreateFDiv()

Constant* llvm::ConstantFolder::CreateFDiv ( Constant LHS,
Constant RHS 
) const
inlineoverridevirtual

Implements llvm::IRBuilderFolder.

Definition at line 75 of file ConstantFolder.h.

References llvm::ConstantExpr::getFDiv().

◆ CreateFMul()

Constant* llvm::ConstantFolder::CreateFMul ( Constant LHS,
Constant RHS 
) const
inlineoverridevirtual

Implements llvm::IRBuilderFolder.

Definition at line 61 of file ConstantFolder.h.

References llvm::ConstantExpr::getFMul().

◆ CreateFNeg()

Constant* llvm::ConstantFolder::CreateFNeg ( Constant C) const
inlineoverridevirtual

Implements llvm::IRBuilderFolder.

Definition at line 132 of file ConstantFolder.h.

References llvm::ConstantExpr::getFNeg().

◆ CreateFPCast()

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

Implements llvm::IRBuilderFolder.

Definition at line 207 of file ConstantFolder.h.

References llvm::ConstantExpr::getFPCast().

◆ CreateFRem()

Constant* llvm::ConstantFolder::CreateFRem ( Constant LHS,
Constant RHS 
) const
inlineoverridevirtual

Implements llvm::IRBuilderFolder.

Definition at line 87 of file ConstantFolder.h.

References llvm::ConstantExpr::getFRem().

◆ CreateFSub()

Constant* llvm::ConstantFolder::CreateFSub ( Constant LHS,
Constant RHS 
) const
inlineoverridevirtual

Implements llvm::IRBuilderFolder.

Definition at line 52 of file ConstantFolder.h.

References llvm::ConstantExpr::getFSub().

◆ CreateGetElementPtr() [1/3]

Constant* llvm::ConstantFolder::CreateGetElementPtr ( Type Ty,
Constant C,
ArrayRef< Constant *>  IdxList 
) const
inlineoverridevirtual

Implements llvm::IRBuilderFolder.

Definition at line 148 of file ConstantFolder.h.

References llvm::ConstantExpr::getGetElementPtr().

◆ CreateGetElementPtr() [2/3]

Constant* llvm::ConstantFolder::CreateGetElementPtr ( Type Ty,
Constant C,
Constant Idx 
) const
inlineoverridevirtual

Implements llvm::IRBuilderFolder.

Definition at line 153 of file ConstantFolder.h.

References llvm::ConstantExpr::getGetElementPtr().

◆ CreateGetElementPtr() [3/3]

Constant* llvm::ConstantFolder::CreateGetElementPtr ( Type Ty,
Constant C,
ArrayRef< Value *>  IdxList 
) const
inlineoverridevirtual

Implements llvm::IRBuilderFolder.

Definition at line 161 of file ConstantFolder.h.

References llvm::ConstantExpr::getGetElementPtr().

◆ CreateICmp()

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

Implements llvm::IRBuilderFolder.

Definition at line 239 of file ConstantFolder.h.

References llvm::ConstantExpr::getCompare().

◆ CreateInBoundsGetElementPtr() [1/3]

Constant* llvm::ConstantFolder::CreateInBoundsGetElementPtr ( Type Ty,
Constant C,
ArrayRef< Constant *>  IdxList 
) const
inlineoverridevirtual

◆ CreateInBoundsGetElementPtr() [2/3]

Constant* llvm::ConstantFolder::CreateInBoundsGetElementPtr ( Type Ty,
Constant C,
Constant Idx 
) const
inlineoverridevirtual

◆ CreateInBoundsGetElementPtr() [3/3]

Constant* llvm::ConstantFolder::CreateInBoundsGetElementPtr ( Type Ty,
Constant C,
ArrayRef< Value *>  IdxList 
) const
inlineoverridevirtual

◆ CreateInsertElement()

Constant* llvm::ConstantFolder::CreateInsertElement ( Constant Vec,
Constant NewElt,
Constant Idx 
) const
inlineoverridevirtual

Implements llvm::IRBuilderFolder.

Definition at line 262 of file ConstantFolder.h.

References llvm::ConstantExpr::getInsertElement().

◆ CreateInsertValue()

Constant* llvm::ConstantFolder::CreateInsertValue ( Constant Agg,
Constant Val,
ArrayRef< unsigned IdxList 
) const
inlineoverridevirtual

Implements llvm::IRBuilderFolder.

Definition at line 277 of file ConstantFolder.h.

References llvm::ConstantExpr::getInsertValue().

◆ CreateIntCast()

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

Implements llvm::IRBuilderFolder.

Definition at line 202 of file ConstantFolder.h.

References llvm::ConstantExpr::getIntegerCast().

◆ CreateIntToPtr()

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

Implements llvm::IRBuilderFolder.

Definition at line 215 of file ConstantFolder.h.

References CreateCast().

◆ CreateLShr()

Constant* llvm::ConstantFolder::CreateLShr ( Constant LHS,
Constant RHS,
bool  isExact = false 
) const
inlineoverridevirtual

Implements llvm::IRBuilderFolder.

Definition at line 96 of file ConstantFolder.h.

References llvm::ConstantExpr::getLShr().

◆ CreateMul()

Constant* llvm::ConstantFolder::CreateMul ( Constant LHS,
Constant RHS,
bool  HasNUW = false,
bool  HasNSW = false 
) const
inlineoverridevirtual

Implements llvm::IRBuilderFolder.

Definition at line 56 of file ConstantFolder.h.

References llvm::ConstantExpr::getMul().

◆ CreateNeg()

Constant* llvm::ConstantFolder::CreateNeg ( Constant C,
bool  HasNUW = false,
bool  HasNSW = false 
) const
inlineoverridevirtual

Implements llvm::IRBuilderFolder.

Definition at line 127 of file ConstantFolder.h.

References llvm::ConstantExpr::getNeg().

◆ CreateNot()

Constant* llvm::ConstantFolder::CreateNot ( Constant C) const
inlineoverridevirtual

Implements llvm::IRBuilderFolder.

Definition at line 136 of file ConstantFolder.h.

References llvm::ConstantExpr::getNot().

◆ CreateOr()

Constant* llvm::ConstantFolder::CreateOr ( Constant LHS,
Constant RHS 
) const
inlineoverridevirtual

Implements llvm::IRBuilderFolder.

Definition at line 110 of file ConstantFolder.h.

References llvm::ConstantExpr::getOr().

◆ CreatePointerBitCastOrAddrSpaceCast()

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

◆ CreatePointerCast()

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

Implements llvm::IRBuilderFolder.

Definition at line 193 of file ConstantFolder.h.

References llvm::ConstantExpr::getPointerCast().

◆ CreatePtrToInt()

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

Implements llvm::IRBuilderFolder.

Definition at line 219 of file ConstantFolder.h.

References CreateCast().

◆ CreateSDiv()

Constant* llvm::ConstantFolder::CreateSDiv ( Constant LHS,
Constant RHS,
bool  isExact = false 
) const
inlineoverridevirtual

Implements llvm::IRBuilderFolder.

Definition at line 70 of file ConstantFolder.h.

References llvm::ConstantExpr::getSDiv().

◆ CreateSelect()

Constant* llvm::ConstantFolder::CreateSelect ( Constant C,
Constant True,
Constant False 
) const
inlineoverridevirtual

Implements llvm::IRBuilderFolder.

Definition at line 253 of file ConstantFolder.h.

References llvm::ConstantExpr::getSelect().

◆ CreateSExtOrBitCast()

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

Implements llvm::IRBuilderFolder.

Definition at line 227 of file ConstantFolder.h.

References llvm::ConstantExpr::getSExtOrBitCast().

◆ CreateShl()

Constant* llvm::ConstantFolder::CreateShl ( Constant LHS,
Constant RHS,
bool  HasNUW = false,
bool  HasNSW = false 
) const
inlineoverridevirtual

Implements llvm::IRBuilderFolder.

Definition at line 91 of file ConstantFolder.h.

References llvm::ConstantExpr::getShl().

◆ CreateShuffleVector()

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

Implements llvm::IRBuilderFolder.

Definition at line 267 of file ConstantFolder.h.

References llvm::ConstantExpr::getShuffleVector().

◆ CreateSRem()

Constant* llvm::ConstantFolder::CreateSRem ( Constant LHS,
Constant RHS 
) const
inlineoverridevirtual

Implements llvm::IRBuilderFolder.

Definition at line 83 of file ConstantFolder.h.

References llvm::ConstantExpr::getSRem().

◆ CreateSub()

Constant* llvm::ConstantFolder::CreateSub ( Constant LHS,
Constant RHS,
bool  HasNUW = false,
bool  HasNSW = false 
) const
inlineoverridevirtual

Implements llvm::IRBuilderFolder.

Definition at line 47 of file ConstantFolder.h.

References llvm::ConstantExpr::getSub().

◆ CreateTruncOrBitCast()

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

Implements llvm::IRBuilderFolder.

Definition at line 231 of file ConstantFolder.h.

References llvm::ConstantExpr::getTruncOrBitCast().

◆ CreateUDiv()

Constant* llvm::ConstantFolder::CreateUDiv ( Constant LHS,
Constant RHS,
bool  isExact = false 
) const
inlineoverridevirtual

Implements llvm::IRBuilderFolder.

Definition at line 65 of file ConstantFolder.h.

References llvm::ConstantExpr::getUDiv().

◆ CreateUnOp()

Constant* llvm::ConstantFolder::CreateUnOp ( Instruction::UnaryOps  Opc,
Constant C 
) const
inlineoverridevirtual

Implements llvm::IRBuilderFolder.

Definition at line 140 of file ConstantFolder.h.

References llvm::ConstantExpr::get().

◆ CreateURem()

Constant* llvm::ConstantFolder::CreateURem ( Constant LHS,
Constant RHS 
) const
inlineoverridevirtual

Implements llvm::IRBuilderFolder.

Definition at line 79 of file ConstantFolder.h.

References llvm::ConstantExpr::getURem().

◆ CreateXor()

Constant* llvm::ConstantFolder::CreateXor ( Constant LHS,
Constant RHS 
) const
inlineoverridevirtual

Implements llvm::IRBuilderFolder.

Definition at line 114 of file ConstantFolder.h.

References llvm::ConstantExpr::getXor().

◆ CreateZExtOrBitCast()

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

Implements llvm::IRBuilderFolder.

Definition at line 223 of file ConstantFolder.h.

References llvm::ConstantExpr::getZExtOrBitCast().


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