LLVM  7.0.0
Public Member Functions | List of all members
llvm::ConstantFolder Class Reference

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

#include "llvm/IR/ConstantFolder.h"

Public Member Functions

 ConstantFolder ()=default
 
Constant * CreateAdd (Constant *LHS, Constant *RHS, bool HasNUW=false, bool HasNSW=false) const
 
Constant * CreateFAdd (Constant *LHS, Constant *RHS) const
 
Constant * CreateSub (Constant *LHS, Constant *RHS, bool HasNUW=false, bool HasNSW=false) const
 
Constant * CreateFSub (Constant *LHS, Constant *RHS) const
 
Constant * CreateMul (Constant *LHS, Constant *RHS, bool HasNUW=false, bool HasNSW=false) const
 
Constant * CreateFMul (Constant *LHS, Constant *RHS) const
 
Constant * CreateUDiv (Constant *LHS, Constant *RHS, bool isExact=false) const
 
Constant * CreateSDiv (Constant *LHS, Constant *RHS, bool isExact=false) const
 
Constant * CreateFDiv (Constant *LHS, Constant *RHS) const
 
Constant * CreateURem (Constant *LHS, Constant *RHS) const
 
Constant * CreateSRem (Constant *LHS, Constant *RHS) const
 
Constant * CreateFRem (Constant *LHS, Constant *RHS) const
 
Constant * CreateShl (Constant *LHS, Constant *RHS, bool HasNUW=false, bool HasNSW=false) const
 
Constant * CreateLShr (Constant *LHS, Constant *RHS, bool isExact=false) const
 
Constant * CreateAShr (Constant *LHS, Constant *RHS, bool isExact=false) const
 
Constant * CreateAnd (Constant *LHS, Constant *RHS) const
 
Constant * CreateOr (Constant *LHS, Constant *RHS) const
 
Constant * CreateXor (Constant *LHS, Constant *RHS) const
 
Constant * CreateBinOp (Instruction::BinaryOps Opc, Constant *LHS, Constant *RHS) const
 
Constant * CreateNeg (Constant *C, bool HasNUW=false, bool HasNSW=false) const
 
Constant * CreateFNeg (Constant *C) const
 
Constant * CreateNot (Constant *C) const
 
Constant * CreateGetElementPtr (Type *Ty, Constant *C, ArrayRef< Constant *> IdxList) const
 
Constant * CreateGetElementPtr (Type *Ty, Constant *C, Constant *Idx) const
 
Constant * CreateGetElementPtr (Type *Ty, Constant *C, ArrayRef< Value *> IdxList) const
 
Constant * CreateInBoundsGetElementPtr (Type *Ty, Constant *C, ArrayRef< Constant *> IdxList) const
 
Constant * CreateInBoundsGetElementPtr (Type *Ty, Constant *C, Constant *Idx) const
 
Constant * CreateInBoundsGetElementPtr (Type *Ty, Constant *C, ArrayRef< Value *> IdxList) const
 
Constant * CreateCast (Instruction::CastOps Op, Constant *C, Type *DestTy) const
 
Constant * CreatePointerCast (Constant *C, Type *DestTy) const
 
Constant * CreatePointerBitCastOrAddrSpaceCast (Constant *C, Type *DestTy) const
 
Constant * CreateIntCast (Constant *C, Type *DestTy, bool isSigned) const
 
Constant * CreateFPCast (Constant *C, Type *DestTy) const
 
Constant * CreateBitCast (Constant *C, Type *DestTy) const
 
Constant * CreateIntToPtr (Constant *C, Type *DestTy) const
 
Constant * CreatePtrToInt (Constant *C, Type *DestTy) const
 
Constant * CreateZExtOrBitCast (Constant *C, Type *DestTy) const
 
Constant * CreateSExtOrBitCast (Constant *C, Type *DestTy) const
 
Constant * CreateTruncOrBitCast (Constant *C, Type *DestTy) const
 
Constant * CreateICmp (CmpInst::Predicate P, Constant *LHS, Constant *RHS) const
 
Constant * CreateFCmp (CmpInst::Predicate P, Constant *LHS, Constant *RHS) const
 
Constant * CreateSelect (Constant *C, Constant *True, Constant *False) const
 
Constant * CreateExtractElement (Constant *Vec, Constant *Idx) const
 
Constant * CreateInsertElement (Constant *Vec, Constant *NewElt, Constant *Idx) const
 
Constant * CreateShuffleVector (Constant *V1, Constant *V2, Constant *Mask) const
 
Constant * CreateExtractValue (Constant *Agg, ArrayRef< unsigned > IdxList) const
 
Constant * CreateInsertValue (Constant *Agg, Constant *Val, ArrayRef< unsigned > IdxList) const
 

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
inline

Definition at line 36 of file ConstantFolder.h.

References llvm::ConstantExpr::getAdd().

◆ CreateAnd()

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

Definition at line 104 of file ConstantFolder.h.

References llvm::ConstantExpr::getAnd().

◆ CreateAShr()

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

Definition at line 99 of file ConstantFolder.h.

References llvm::ConstantExpr::getAShr().

◆ CreateBinOp()

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

Definition at line 116 of file ConstantFolder.h.

References llvm::ConstantExpr::get().

◆ CreateBitCast()

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

Definition at line 204 of file ConstantFolder.h.

References CreateCast().

◆ CreateCast()

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

Definition at line 181 of file ConstantFolder.h.

References llvm::ConstantExpr::getCast().

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

◆ CreateExtractElement()

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

Definition at line 250 of file ConstantFolder.h.

References llvm::ConstantExpr::getExtractElement().

◆ CreateExtractValue()

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

Definition at line 264 of file ConstantFolder.h.

References llvm::ConstantExpr::getExtractValue().

◆ CreateFAdd()

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

Definition at line 41 of file ConstantFolder.h.

References llvm::ConstantExpr::getFAdd().

◆ CreateFCmp()

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

Definition at line 237 of file ConstantFolder.h.

References llvm::ConstantExpr::getCompare().

◆ CreateFDiv()

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

Definition at line 73 of file ConstantFolder.h.

References llvm::ConstantExpr::getFDiv().

◆ CreateFMul()

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

Definition at line 59 of file ConstantFolder.h.

References llvm::ConstantExpr::getFMul().

◆ CreateFNeg()

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

Definition at line 130 of file ConstantFolder.h.

References llvm::ConstantExpr::getFNeg().

◆ CreateFPCast()

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

Definition at line 200 of file ConstantFolder.h.

References llvm::ConstantExpr::getFPCast().

◆ CreateFRem()

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

Definition at line 85 of file ConstantFolder.h.

References llvm::ConstantExpr::getFRem().

◆ CreateFSub()

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

Definition at line 50 of file ConstantFolder.h.

References llvm::ConstantExpr::getFSub().

◆ CreateGetElementPtr() [1/3]

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

Definition at line 142 of file ConstantFolder.h.

References llvm::ConstantExpr::getGetElementPtr().

◆ CreateGetElementPtr() [2/3]

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

Definition at line 147 of file ConstantFolder.h.

References llvm::ConstantExpr::getGetElementPtr().

◆ CreateGetElementPtr() [3/3]

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

Definition at line 154 of file ConstantFolder.h.

References llvm::ConstantExpr::getGetElementPtr().

◆ CreateICmp()

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

Definition at line 232 of file ConstantFolder.h.

References llvm::ConstantExpr::getCompare().

◆ CreateInBoundsGetElementPtr() [1/3]

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

Definition at line 159 of file ConstantFolder.h.

References llvm::ConstantExpr::getInBoundsGetElementPtr().

◆ CreateInBoundsGetElementPtr() [2/3]

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

Definition at line 164 of file ConstantFolder.h.

References llvm::ConstantExpr::getInBoundsGetElementPtr().

◆ CreateInBoundsGetElementPtr() [3/3]

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

Definition at line 172 of file ConstantFolder.h.

References llvm::ConstantExpr::getInBoundsGetElementPtr().

◆ CreateInsertElement()

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

Definition at line 254 of file ConstantFolder.h.

References llvm::ConstantExpr::getInsertElement().

◆ CreateInsertValue()

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

Definition at line 269 of file ConstantFolder.h.

References llvm::ConstantExpr::getInsertValue().

◆ CreateIntCast()

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

Definition at line 195 of file ConstantFolder.h.

References llvm::ConstantExpr::getIntegerCast().

◆ CreateIntToPtr()

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

Definition at line 208 of file ConstantFolder.h.

References CreateCast().

◆ CreateLShr()

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

Definition at line 94 of file ConstantFolder.h.

References llvm::ConstantExpr::getLShr().

◆ CreateMul()

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

Definition at line 54 of file ConstantFolder.h.

References llvm::ConstantExpr::getMul().

◆ CreateNeg()

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

Definition at line 125 of file ConstantFolder.h.

References llvm::ConstantExpr::getNeg().

◆ CreateNot()

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

Definition at line 134 of file ConstantFolder.h.

References llvm::ConstantExpr::getNot().

◆ CreateOr()

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

Definition at line 108 of file ConstantFolder.h.

References llvm::ConstantExpr::getOr().

◆ CreatePointerBitCastOrAddrSpaceCast()

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

◆ CreatePointerCast()

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

Definition at line 186 of file ConstantFolder.h.

References llvm::ConstantExpr::getPointerCast().

◆ CreatePtrToInt()

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

Definition at line 212 of file ConstantFolder.h.

References CreateCast().

◆ CreateSDiv()

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

Definition at line 68 of file ConstantFolder.h.

References llvm::ConstantExpr::getSDiv().

◆ CreateSelect()

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

Definition at line 246 of file ConstantFolder.h.

References llvm::ConstantExpr::getSelect().

◆ CreateSExtOrBitCast()

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

Definition at line 220 of file ConstantFolder.h.

References llvm::ConstantExpr::getSExtOrBitCast().

◆ CreateShl()

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

Definition at line 89 of file ConstantFolder.h.

References llvm::ConstantExpr::getShl().

◆ CreateShuffleVector()

Constant* llvm::ConstantFolder::CreateShuffleVector ( Constant *  V1,
Constant *  V2,
Constant *  Mask 
) const
inline

Definition at line 259 of file ConstantFolder.h.

References llvm::ConstantExpr::getShuffleVector().

◆ CreateSRem()

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

Definition at line 81 of file ConstantFolder.h.

References llvm::ConstantExpr::getSRem().

◆ CreateSub()

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

Definition at line 45 of file ConstantFolder.h.

References llvm::ConstantExpr::getSub().

◆ CreateTruncOrBitCast()

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

Definition at line 224 of file ConstantFolder.h.

References llvm::ConstantExpr::getTruncOrBitCast().

◆ CreateUDiv()

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

Definition at line 63 of file ConstantFolder.h.

References llvm::ConstantExpr::getUDiv().

◆ CreateURem()

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

Definition at line 77 of file ConstantFolder.h.

References llvm::ConstantExpr::getURem().

◆ CreateXor()

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

Definition at line 112 of file ConstantFolder.h.

References llvm::ConstantExpr::getXor().

◆ CreateZExtOrBitCast()

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

Definition at line 216 of file ConstantFolder.h.

References llvm::ConstantExpr::getZExtOrBitCast().


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