17 #ifndef LLVM_SUPPORT_CONSTANTFOLDER_H
18 #define LLVM_SUPPORT_CONSTANTFOLDER_H
35 bool HasNUW =
false,
bool HasNSW =
false)
const {
42 bool HasNUW =
false,
bool HasNSW =
false)
const {
49 bool HasNUW =
false,
bool HasNSW =
false)
const {
56 bool isExact =
false)
const {
60 bool isExact =
false)
const {
76 bool HasNUW =
false,
bool HasNSW =
false)
const {
80 bool isExact =
false)
const {
84 bool isExact =
false)
const {
107 bool HasNUW =
false,
bool HasNSW =
false)
const {
156 Type *DestTy)
const {
163 bool isSigned)
const {
171 return CreateCast(Instruction::BitCast, C, DestTy);
174 return CreateCast(Instruction::IntToPtr, C, DestTy);
177 return CreateCast(Instruction::PtrToInt, C, DestTy);
static Constant * getFAdd(Constant *C1, Constant *C2)
static Constant * getShuffleVector(Constant *V1, Constant *V2, Constant *Mask)
Constant * CreateBitCast(Constant *C, Type *DestTy) const
static Constant * getSelect(Constant *C, Constant *V1, Constant *V2)
static Constant * getGetElementPtr(Constant *C, ArrayRef< Constant * > IdxList, bool InBounds=false)
Constant * CreateSub(Constant *LHS, Constant *RHS, bool HasNUW=false, bool HasNSW=false) const
Constant * CreateInBoundsGetElementPtr(Constant *C, ArrayRef< Value * > IdxList) const
static Constant * getExtractElement(Constant *Vec, Constant *Idx)
Constant * CreateFAdd(Constant *LHS, Constant *RHS) const
Constant * CreateSelect(Constant *C, Constant *True, Constant *False) const
static Constant * getSub(Constant *C1, Constant *C2, bool HasNUW=false, bool HasNSW=false)
Constant * CreateShuffleVector(Constant *V1, Constant *V2, Constant *Mask) const
Constant * CreateSExtOrBitCast(Constant *C, Type *DestTy) const
static Constant * getAdd(Constant *C1, Constant *C2, bool HasNUW=false, bool HasNSW=false)
static Constant * getFMul(Constant *C1, Constant *C2)
Constant * CreateOr(Constant *LHS, Constant *RHS) const
Constant * CreateZExtOrBitCast(Constant *C, Type *DestTy) const
Constant * CreateInsertValue(Constant *Agg, Constant *Val, ArrayRef< unsigned > IdxList) const
static Constant * getIntegerCast(Constant *C, Type *Ty, bool isSigned)
Create a ZExt, Bitcast or Trunc for integer -> integer casts.
Constant * CreateICmp(CmpInst::Predicate P, Constant *LHS, Constant *RHS) const
static Constant * get(unsigned Opcode, Constant *C1, Constant *C2, unsigned Flags=0)
static Constant * getLShr(Constant *C1, Constant *C2, bool isExact=false)
Constant * CreateLShr(Constant *LHS, Constant *RHS, bool isExact=false) const
static Constant * getExtractValue(Constant *Agg, ArrayRef< unsigned > Idxs)
Constant * CreateGetElementPtr(Constant *C, ArrayRef< Value * > IdxList) const
Constant * CreateExtractElement(Constant *Vec, Constant *Idx) const
Constant * CreateFRem(Constant *LHS, Constant *RHS) const
Constant * CreateNeg(Constant *C, bool HasNUW=false, bool HasNSW=false) const
Constant * CreateFCmp(CmpInst::Predicate P, Constant *LHS, Constant *RHS) const
static Constant * getFPCast(Constant *C, Type *Ty)
Create a FPExt, Bitcast or FPTrunc for fp -> fp casts.
static Constant * getAShr(Constant *C1, Constant *C2, bool isExact=false)
ConstantFolder - Create constants with minimum, target independent, folding.
static Constant * getUDiv(Constant *C1, Constant *C2, bool isExact=false)
static Constant * getFDiv(Constant *C1, Constant *C2)
Constant * CreatePtrToInt(Constant *C, Type *DestTy) const
static Constant * getFNeg(Constant *C)
static Constant * getFRem(Constant *C1, Constant *C2)
Constant * CreateMul(Constant *LHS, Constant *RHS, bool HasNUW=false, bool HasNSW=false) const
Constant * CreateNot(Constant *C) const
LLVM Constant Representation.
static Constant * getAnd(Constant *C1, Constant *C2)
static Constant * getSExtOrBitCast(Constant *C, Type *Ty)
Constant * CreateSRem(Constant *LHS, Constant *RHS) const
Constant * CreateSDiv(Constant *LHS, Constant *RHS, bool isExact=false) const
Constant * CreateGetElementPtr(Constant *C, Constant *Idx) const
static Constant * getNot(Constant *C)
Constant * CreateInBoundsGetElementPtr(Constant *C, Constant *Idx) const
Constant * CreateInsertElement(Constant *Vec, Constant *NewElt, Constant *Idx) const
static Constant * getPointerCast(Constant *C, Type *Ty)
Create a BitCast or a PtrToInt cast constant expression.
Constant * CreateFMul(Constant *LHS, Constant *RHS) const
Constant * CreateAnd(Constant *LHS, Constant *RHS) const
Constant * CreateIntCast(Constant *C, Type *DestTy, bool isSigned) const
Constant * CreateAdd(Constant *LHS, Constant *RHS, bool HasNUW=false, bool HasNSW=false) const
static Constant * getSDiv(Constant *C1, Constant *C2, bool isExact=false)
Constant * CreateURem(Constant *LHS, Constant *RHS) const
Constant * CreateUDiv(Constant *LHS, Constant *RHS, bool isExact=false) const
Constant * CreateGetElementPtr(Constant *C, ArrayRef< Constant * > IdxList) const
static Constant * getZExtOrBitCast(Constant *C, Type *Ty)
Constant * CreatePointerCast(Constant *C, Type *DestTy) const
Constant * CreateIntToPtr(Constant *C, Type *DestTy) const
static Constant * getFSub(Constant *C1, Constant *C2)
static Constant * getTruncOrBitCast(Constant *C, Type *Ty)
static Constant * getNeg(Constant *C, bool HasNUW=false, bool HasNSW=false)
Constant * CreateFPCast(Constant *C, Type *DestTy) const
Constant * CreateFNeg(Constant *C) const
static Constant * getInBoundsGetElementPtr(Constant *C, ArrayRef< Constant * > IdxList)
static Constant * getOr(Constant *C1, Constant *C2)
Constant * CreateFDiv(Constant *LHS, Constant *RHS) const
static Constant * getShl(Constant *C1, Constant *C2, bool HasNUW=false, bool HasNSW=false)
static Constant * getInsertValue(Constant *Agg, Constant *Val, ArrayRef< unsigned > Idxs)
Constant * CreateXor(Constant *LHS, Constant *RHS) const
Constant * CreateTruncOrBitCast(Constant *C, Type *DestTy) const
static Constant * getSRem(Constant *C1, Constant *C2)
Constant * CreateExtractValue(Constant *Agg, ArrayRef< unsigned > IdxList) const
static Constant * getURem(Constant *C1, Constant *C2)
Constant * CreateFSub(Constant *LHS, Constant *RHS) const
static Constant * getCompare(unsigned short pred, Constant *C1, Constant *C2)
Return an ICmp or FCmp comparison operator constant expression.
Constant * CreateShl(Constant *LHS, Constant *RHS, bool HasNUW=false, bool HasNSW=false) const
static Constant * getMul(Constant *C1, Constant *C2, bool HasNUW=false, bool HasNSW=false)
static Constant * getCast(unsigned ops, Constant *C, Type *Ty)
Constant * CreateInBoundsGetElementPtr(Constant *C, ArrayRef< Constant * > IdxList) const
static Constant * getInsertElement(Constant *Vec, Constant *Elt, Constant *Idx)
Constant * CreateBinOp(Instruction::BinaryOps Opc, Constant *LHS, Constant *RHS) const
Constant * CreateCast(Instruction::CastOps Op, Constant *C, Type *DestTy) const
Constant * CreateAShr(Constant *LHS, Constant *RHS, bool isExact=false) const
static Constant * getXor(Constant *C1, Constant *C2)