19 #ifndef LLVM_ANALYSIS_TARGETFOLDER_H 20 #define LLVM_ANALYSIS_TARGETFOLDER_H 50 bool HasNUW =
false,
bool HasNSW =
false)
const {
57 bool HasNUW =
false,
bool HasNSW =
false)
const {
64 bool HasNUW =
false,
bool HasNSW =
false)
const {
89 bool HasNUW =
false,
bool HasNSW =
false)
const {
118 bool HasNUW =
false,
bool HasNSW =
false)
const {
168 Type *DestTy)
const {
174 bool isSigned)
const {
190 return CreateCast(Instruction::BitCast, C, DestTy);
193 return CreateCast(Instruction::IntToPtr, C, DestTy);
196 return CreateCast(Instruction::PtrToInt, C, DestTy);
215 Type *DestTy)
const {
Constant * CreateCast(Instruction::CastOps Op, Constant *C, Type *DestTy) const
A parsed version of the target data layout string in and methods for querying it. ...
Constant * CreateExtractValue(Constant *Agg, ArrayRef< unsigned > IdxList) const
static Constant * getFAdd(Constant *C1, Constant *C2)
static Constant * getPointerBitCastOrAddrSpaceCast(Constant *C, Type *Ty)
Create a BitCast or AddrSpaceCast for a pointer type depending on the address space.
This class represents lattice values for constants.
static Constant * getGetElementPtr(Type *Ty, Constant *C, ArrayRef< Constant *> IdxList, bool InBounds=false, Optional< unsigned > InRangeIndex=None, Type *OnlyIfReducedTy=nullptr)
Getelementptr form.
Constant * CreateBinOp(Instruction::BinaryOps Opc, Constant *LHS, Constant *RHS) const
Constant * CreateFNeg(Constant *C) const
Constant * CreateAdd(Constant *LHS, Constant *RHS, bool HasNUW=false, bool HasNSW=false) const
Constant * CreateShl(Constant *LHS, Constant *RHS, bool HasNUW=false, bool HasNSW=false) const
Constant * CreateNot(Constant *C) const
Constant * CreatePtrToInt(Constant *C, Type *DestTy) const
static Constant * getExtractElement(Constant *Vec, Constant *Idx, Type *OnlyIfReducedTy=nullptr)
static Constant * getCompare(unsigned short pred, Constant *C1, Constant *C2, bool OnlyIfReduced=false)
Return an ICmp or FCmp comparison operator constant expression.
static Constant * getSub(Constant *C1, Constant *C2, bool HasNUW=false, bool HasNSW=false)
Constant * CreateZExtOrBitCast(Constant *C, Type *DestTy) const
Constant * CreateFAdd(Constant *LHS, Constant *RHS) const
Constant * CreatePointerCast(Constant *C, Type *DestTy) const
Constant * CreateShuffleVector(Constant *V1, Constant *V2, Constant *Mask) const
Constant * CreateXor(Constant *LHS, Constant *RHS) const
static Constant * getInsertElement(Constant *Vec, Constant *Elt, Constant *Idx, Type *OnlyIfReducedTy=nullptr)
static Constant * getAdd(Constant *C1, Constant *C2, bool HasNUW=false, bool HasNSW=false)
static Constant * getFMul(Constant *C1, Constant *C2)
Constant * CreateFRem(Constant *LHS, Constant *RHS) const
static Constant * getIntegerCast(Constant *C, Type *Ty, bool isSigned)
Create a ZExt, Bitcast or Trunc for integer -> integer casts.
Constant * CreateSExtOrBitCast(Constant *C, Type *DestTy) const
static Constant * getLShr(Constant *C1, Constant *C2, bool isExact=false)
Constant * CreateSub(Constant *LHS, Constant *RHS, bool HasNUW=false, bool HasNSW=false) const
Constant * CreateMul(Constant *LHS, Constant *RHS, bool HasNUW=false, bool HasNSW=false) const
Constant * CreateUDiv(Constant *LHS, Constant *RHS, bool isExact=false) const
Constant * CreateURem(Constant *LHS, Constant *RHS) const
Constant * CreateNeg(Constant *C, bool HasNUW=false, bool HasNSW=false) const
Constant * ConstantFoldConstant(const Constant *C, const DataLayout &DL, const TargetLibraryInfo *TLI=nullptr)
ConstantFoldConstant - Attempt to fold the constant using the specified DataLayout.
Type * getType() const
All values are typed, get the type of this value.
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)
Constant * CreateTruncOrBitCast(Constant *C, Type *DestTy) const
Constant * CreateFMul(Constant *LHS, Constant *RHS) const
static Constant * getSelect(Constant *C, Constant *V1, Constant *V2, Type *OnlyIfReducedTy=nullptr)
Select constant expr.
Constant * CreateFSub(Constant *LHS, Constant *RHS) const
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
TargetFolder - Create constants with target dependent folding.
Constant * CreateFDiv(Constant *LHS, Constant *RHS) const
static Constant * getUDiv(Constant *C1, Constant *C2, bool isExact=false)
static Constant * getFDiv(Constant *C1, Constant *C2)
Constant * CreateIntCast(Constant *C, Type *DestTy, bool isSigned) const
Constant * CreateAnd(Constant *LHS, Constant *RHS) const
static Constant * getInsertValue(Constant *Agg, Constant *Val, ArrayRef< unsigned > Idxs, Type *OnlyIfReducedTy=nullptr)
static Constant * getFNeg(Constant *C)
static Constant * getFRem(Constant *C1, Constant *C2)
The instances of the Type class are immutable: once they are created, they are never changed...
This is an important base class in LLVM.
Constant * CreateInBoundsGetElementPtr(Type *Ty, Constant *C, ArrayRef< Value *> IdxList) const
This file contains the declarations for the subclasses of Constant, which represent the different fla...
Constant * CreateSDiv(Constant *LHS, Constant *RHS, bool isExact=false) const
static Constant * getAnd(Constant *C1, Constant *C2)
static Constant * getSExtOrBitCast(Constant *C, Type *Ty)
static Constant * getShuffleVector(Constant *V1, Constant *V2, Constant *Mask, Type *OnlyIfReducedTy=nullptr)
Predicate
This enumeration lists the possible predicates for CmpInst subclasses.
Constant * CreateSelect(Constant *C, Constant *True, Constant *False) const
Constant * CreateGetElementPtr(Type *Ty, Constant *C, Constant *Idx) const
static Constant * getNot(Constant *C)
Constant * CreateExtractElement(Constant *Vec, Constant *Idx) const
Constant * CreateICmp(CmpInst::Predicate P, Constant *LHS, Constant *RHS) const
Constant * CreateLShr(Constant *LHS, Constant *RHS, bool isExact=false) const
static Constant * getPointerCast(Constant *C, Type *Ty)
Create a BitCast, AddrSpaceCast, or a PtrToInt cast constant expression.
static Constant * getSDiv(Constant *C1, Constant *C2, bool isExact=false)
Constant * CreateBitCast(Constant *C, Type *DestTy) const
Constant * CreatePointerBitCastOrAddrSpaceCast(Constant *C, Type *DestTy) const
Constant * CreateInsertValue(Constant *Agg, Constant *Val, ArrayRef< unsigned > IdxList) const
static Constant * getCast(unsigned ops, Constant *C, Type *Ty, bool OnlyIfReduced=false)
Convenience function for getting a Cast operation.
static Constant * getZExtOrBitCast(Constant *C, Type *Ty)
Constant * CreateGetElementPtr(Type *Ty, Constant *C, ArrayRef< Constant *> IdxList) 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 * CreateFCmp(CmpInst::Predicate P, Constant *LHS, Constant *RHS) const
Constant * CreateOr(Constant *LHS, Constant *RHS) const
static Constant * getInBoundsGetElementPtr(Type *Ty, Constant *C, ArrayRef< Constant *> IdxList)
Create an "inbounds" getelementptr.
Constant * CreateIntToPtr(Constant *C, Type *DestTy) const
static Constant * getOr(Constant *C1, Constant *C2)
Constant * CreateGetElementPtr(Type *Ty, Constant *C, ArrayRef< Value *> IdxList) const
static Constant * getShl(Constant *C1, Constant *C2, bool HasNUW=false, bool HasNSW=false)
Constant * CreateAShr(Constant *LHS, Constant *RHS, bool isExact=false) const
Constant * CreateInBoundsGetElementPtr(Type *Ty, Constant *C, Constant *Idx) const
Constant * CreateSRem(Constant *LHS, Constant *RHS) const
static Constant * getSRem(Constant *C1, Constant *C2)
Constant * CreateInBoundsGetElementPtr(Type *Ty, Constant *C, ArrayRef< Constant *> IdxList) const
static Constant * getURem(Constant *C1, Constant *C2)
std::underlying_type< E >::type Mask()
Get a bitmask with 1s in all places up to the high-order bit of E's largest value.
Constant * CreateInsertElement(Constant *Vec, Constant *NewElt, Constant *Idx) const
static Constant * getExtractValue(Constant *Agg, ArrayRef< unsigned > Idxs, Type *OnlyIfReducedTy=nullptr)
static Constant * getMul(Constant *C1, Constant *C2, bool HasNUW=false, bool HasNSW=false)
TargetFolder(const DataLayout &DL)
Constant * CreateFPCast(Constant *C, Type *DestTy) const
static Constant * getXor(Constant *C1, Constant *C2)
static Constant * get(unsigned Opcode, Constant *C1, unsigned Flags=0, Type *OnlyIfReducedTy=nullptr)
get - Return a unary operator constant expression, folding if possible.