LLVM  14.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
 
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
 
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
 
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
 
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 29 of file ConstantFolder.h.

Constructor & Destructor Documentation

◆ ConstantFolder()

llvm::ConstantFolder::ConstantFolder ( )
explicitdefault

Member Function Documentation

◆ CreateAnd()

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

Implements llvm::IRBuilderFolder.

Definition at line 157 of file ConstantFolder.h.

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

◆ CreateAShr()

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

Implements llvm::IRBuilderFolder.

Definition at line 152 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 169 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 222 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 199 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 259 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 273 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 94 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 250 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 126 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 112 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 183 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 218 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 138 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 103 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 263 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 278 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 213 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 226 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 147 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 107 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 178 of file ConstantFolder.h.

References llvm::ConstantExpr::getNeg().

◆ CreateNot()

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

Implements llvm::IRBuilderFolder.

Definition at line 187 of file ConstantFolder.h.

References llvm::ConstantExpr::getNot().

◆ CreateOr()

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

Definition at line 161 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 204 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 230 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 121 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 238 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 142 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 134 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 98 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 242 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 116 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 191 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 130 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 165 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 234 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 41 of file ConstantFolder.h.

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

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

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

◆ FoldOr()

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

Implements llvm::IRBuilderFolder.

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

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


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