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
 
ValueFoldUDiv (Value *LHS, Value *RHS, bool IsExact) const override
 
ValueFoldSDiv (Value *LHS, Value *RHS, bool IsExact) const override
 
ValueFoldURem (Value *LHS, Value *RHS) const override
 
ValueFoldSRem (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
 
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
 
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
 
ConstantCreateFDiv (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
 
- 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

◆ CreateAShr()

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

Implements llvm::IRBuilderFolder.

Definition at line 217 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 230 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 283 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 260 of file ConstantFolder.h.

References llvm::ConstantExpr::getCast().

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

◆ CreateFAdd()

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

Implements llvm::IRBuilderFolder.

Definition at line 177 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 311 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 199 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 195 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 244 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 279 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 203 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 186 of file ConstantFolder.h.

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

◆ CreateIntCast()

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

Implements llvm::IRBuilderFolder.

Definition at line 274 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 287 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 212 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 190 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 239 of file ConstantFolder.h.

References llvm::ConstantExpr::getNeg().

◆ CreateNot()

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

Implements llvm::IRBuilderFolder.

Definition at line 248 of file ConstantFolder.h.

References llvm::ConstantExpr::getNot().

◆ CreateOr()

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

Definition at line 222 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 265 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 291 of file ConstantFolder.h.

References CreateCast().

◆ CreateSExtOrBitCast()

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

Implements llvm::IRBuilderFolder.

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

References llvm::ConstantExpr::getShl(), 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 181 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 303 of file ConstantFolder.h.

References llvm::ConstantExpr::getTruncOrBitCast().

◆ CreateUnOp()

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

Implements llvm::IRBuilderFolder.

Definition at line 252 of file ConstantFolder.h.

References llvm::ConstantExpr::get().

◆ CreateXor()

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

Implements llvm::IRBuilderFolder.

Definition at line 226 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 295 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.

◆ FoldAnd()

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

Implements llvm::IRBuilderFolder.

Definition at line 50 of file ConstantFolder.h.

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

◆ FoldExtractElement()

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

Implements llvm::IRBuilderFolder.

Definition at line 146 of file ConstantFolder.h.

References llvm::ConstantExpr::getExtractElement().

◆ FoldExtractValue()

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

Implements llvm::IRBuilderFolder.

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

References llvm::ConstantExpr::getInsertElement().

◆ FoldInsertValue()

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

Implements llvm::IRBuilderFolder.

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

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

◆ FoldSDiv()

Value* llvm::ConstantFolder::FoldSDiv ( Value LHS,
Value RHS,
bool  IsExact 
) const
inlineoverridevirtual

Implements llvm::IRBuilderFolder.

Definition at line 74 of file ConstantFolder.h.

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

◆ FoldSelect()

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

Implements llvm::IRBuilderFolder.

Definition at line 121 of file ConstantFolder.h.

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

◆ FoldShuffleVector()

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

◆ FoldSRem()

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

Implements llvm::IRBuilderFolder.

Definition at line 90 of file ConstantFolder.h.

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

◆ FoldUDiv()

Value* llvm::ConstantFolder::FoldUDiv ( Value LHS,
Value RHS,
bool  IsExact 
) const
inlineoverridevirtual

Implements llvm::IRBuilderFolder.

Definition at line 66 of file ConstantFolder.h.

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

◆ FoldURem()

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

Implements llvm::IRBuilderFolder.

Definition at line 82 of file ConstantFolder.h.

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


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