LLVM  15.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
 
ValueFoldAdd (Value *LHS, Value *RHS, bool HasNUW=false, bool HasNSW=false) const override
 
ValueFoldAnd (Value *LHS, Value *RHS) const override
 
ValueFoldOr (Value *LHS, Value *RHS) 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
 
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
 
ConstantCreateOr (Constant *LHS, Constant *RHS) const
 
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
 
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
 
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
 
- 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

◆ CreateAShr()

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

Implements llvm::IRBuilderFolder.

Definition at line 175 of file ConstantFolder.h.

References llvm::ConstantExpr::getAShr(), LHS, and RHS.

◆ CreateBinOp()

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

Implements llvm::IRBuilderFolder.

Definition at line 188 of file ConstantFolder.h.

References llvm::ConstantExpr::get(), LHS, and RHS.

◆ CreateBitCast()

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

Implements llvm::IRBuilderFolder.

Definition at line 241 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 218 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 278 of file ConstantFolder.h.

References llvm::ConstantExpr::getExtractElement().

◆ CreateFAdd()

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

Implements llvm::IRBuilderFolder.

Definition at line 117 of file ConstantFolder.h.

References llvm::ConstantExpr::getFAdd(), LHS, and RHS.

◆ CreateFCmp()

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

Implements llvm::IRBuilderFolder.

Definition at line 269 of file ConstantFolder.h.

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

◆ CreateFDiv()

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

Implements llvm::IRBuilderFolder.

Definition at line 149 of file ConstantFolder.h.

References llvm::ConstantExpr::getFDiv(), LHS, and RHS.

◆ CreateFMul()

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

Implements llvm::IRBuilderFolder.

Definition at line 135 of file ConstantFolder.h.

References llvm::ConstantExpr::getFMul(), LHS, and RHS.

◆ CreateFNeg()

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

Implements llvm::IRBuilderFolder.

Definition at line 202 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 237 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 161 of file ConstantFolder.h.

References llvm::ConstantExpr::getFRem(), LHS, and RHS.

◆ CreateFSub()

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

Implements llvm::IRBuilderFolder.

Definition at line 126 of file ConstantFolder.h.

References llvm::ConstantExpr::getFSub(), LHS, and RHS.

◆ CreateInsertElement()

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

Implements llvm::IRBuilderFolder.

Definition at line 282 of file ConstantFolder.h.

References llvm::ConstantExpr::getInsertElement().

◆ CreateIntCast()

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

Implements llvm::IRBuilderFolder.

Definition at line 232 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 245 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 170 of file ConstantFolder.h.

References llvm::ConstantExpr::getLShr(), LHS, and RHS.

◆ CreateMul()

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

Implements llvm::IRBuilderFolder.

Definition at line 130 of file ConstantFolder.h.

References llvm::ConstantExpr::getMul(), LHS, and RHS.

◆ CreateNeg()

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

Implements llvm::IRBuilderFolder.

Definition at line 197 of file ConstantFolder.h.

References llvm::ConstantExpr::getNeg().

◆ CreateNot()

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

Implements llvm::IRBuilderFolder.

Definition at line 206 of file ConstantFolder.h.

References llvm::ConstantExpr::getNot().

◆ CreateOr()

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

Definition at line 180 of file ConstantFolder.h.

References llvm::ConstantExpr::getOr(), LHS, and RHS.

◆ 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 223 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 249 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 144 of file ConstantFolder.h.

References llvm::ConstantExpr::getSDiv(), LHS, and RHS.

◆ CreateSExtOrBitCast()

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

Implements llvm::IRBuilderFolder.

Definition at line 257 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 165 of file ConstantFolder.h.

References llvm::ConstantExpr::getShl(), LHS, and RHS.

◆ CreateShuffleVector()

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

◆ CreateSRem()

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

Implements llvm::IRBuilderFolder.

Definition at line 157 of file ConstantFolder.h.

References llvm::ConstantExpr::getSRem(), LHS, and RHS.

◆ CreateSub()

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

Implements llvm::IRBuilderFolder.

Definition at line 121 of file ConstantFolder.h.

References llvm::ConstantExpr::getSub(), LHS, and RHS.

◆ CreateTruncOrBitCast()

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

Implements llvm::IRBuilderFolder.

Definition at line 261 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 139 of file ConstantFolder.h.

References llvm::ConstantExpr::getUDiv(), LHS, and RHS.

◆ CreateUnOp()

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

Implements llvm::IRBuilderFolder.

Definition at line 210 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 153 of file ConstantFolder.h.

References llvm::ConstantExpr::getURem(), LHS, and RHS.

◆ CreateXor()

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

Implements llvm::IRBuilderFolder.

Definition at line 184 of file ConstantFolder.h.

References llvm::ConstantExpr::getXor(), LHS, and RHS.

◆ CreateZExtOrBitCast()

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

Implements llvm::IRBuilderFolder.

Definition at line 253 of file ConstantFolder.h.

References llvm::ConstantExpr::getZExtOrBitCast().

◆ FoldAdd()

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

Implements llvm::IRBuilderFolder.

Definition at line 40 of file ConstantFolder.h.

References llvm::ConstantExpr::getAdd(), LHS, and RHS.

◆ FoldAnd()

Value* llvm::ConstantFolder::FoldAnd ( Value LHS,
Value RHS 
) const
inlineoverridevirtual

Implements llvm::IRBuilderFolder.

Definition at line 49 of file ConstantFolder.h.

References llvm::ConstantExpr::getAnd(), LHS, and RHS.

◆ FoldExtractValue()

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

Implements llvm::IRBuilderFolder.

Definition at line 97 of file ConstantFolder.h.

References llvm::ConstantExpr::getExtractValue().

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

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

◆ FoldInsertValue()

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

Implements llvm::IRBuilderFolder.

Definition at line 104 of file ConstantFolder.h.

References llvm::ConstantExpr::getInsertValue().

◆ FoldOr()

Value* llvm::ConstantFolder::FoldOr ( Value LHS,
Value RHS 
) const
inlineoverridevirtual

Implements llvm::IRBuilderFolder.

Definition at line 57 of file ConstantFolder.h.

References llvm::ConstantExpr::getOr(), LHS, and RHS.

◆ FoldSelect()

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

Implements llvm::IRBuilderFolder.

Definition at line 88 of file ConstantFolder.h.

References R600_InstFlag::FC, and llvm::ConstantExpr::getSelect().


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