22 #ifndef LLVM_IR_NOFOLDER_H 23 #define LLVM_IR_NOFOLDER_H 43 bool HasNUW =
false,
bool HasNSW =
false)
const {
51 return BinaryOperator::CreateNSWAdd(LHS, RHS);
55 return BinaryOperator::CreateNUWAdd(LHS, RHS);
59 return BinaryOperator::CreateFAdd(LHS, RHS);
63 bool HasNUW =
false,
bool HasNSW =
false)
const {
71 return BinaryOperator::CreateNSWSub(LHS, RHS);
75 return BinaryOperator::CreateNUWSub(LHS, RHS);
79 return BinaryOperator::CreateFSub(LHS, RHS);
83 bool HasNUW =
false,
bool HasNSW =
false)
const {
91 return BinaryOperator::CreateNSWMul(LHS, RHS);
95 return BinaryOperator::CreateNUWMul(LHS, RHS);
99 return BinaryOperator::CreateFMul(LHS, RHS);
103 bool isExact =
false)
const {
105 return BinaryOperator::CreateUDiv(LHS, RHS);
106 return BinaryOperator::CreateExactUDiv(LHS, RHS);
110 return BinaryOperator::CreateExactUDiv(LHS, RHS);
114 bool isExact =
false)
const {
116 return BinaryOperator::CreateSDiv(LHS, RHS);
117 return BinaryOperator::CreateExactSDiv(LHS, RHS);
121 return BinaryOperator::CreateExactSDiv(LHS, RHS);
125 return BinaryOperator::CreateFDiv(LHS, RHS);
129 return BinaryOperator::CreateURem(LHS, RHS);
133 return BinaryOperator::CreateSRem(LHS, RHS);
137 return BinaryOperator::CreateFRem(LHS, RHS);
141 bool HasNSW =
false)
const {
149 bool isExact =
false)
const {
151 return BinaryOperator::CreateLShr(LHS, RHS);
152 return BinaryOperator::CreateExactLShr(LHS, RHS);
156 bool isExact =
false)
const {
158 return BinaryOperator::CreateAShr(LHS, RHS);
159 return BinaryOperator::CreateExactAShr(LHS, RHS);
163 return BinaryOperator::CreateAnd(LHS, RHS);
167 return BinaryOperator::CreateOr(LHS, RHS);
171 return BinaryOperator::CreateXor(LHS, RHS);
184 bool HasNUW =
false,
bool HasNSW =
false)
const {
251 Type *DestTy)
const {
260 bool isSigned)
const {
269 return CreateCast(Instruction::BitCast, C, DestTy);
273 return CreateCast(Instruction::IntToPtr, C, DestTy);
277 return CreateCast(Instruction::PtrToInt, C, DestTy);
342 #endif // LLVM_IR_NOFOLDER_H
Constant * CreateInBoundsGetElementPtr(Type *Ty, Constant *C, ArrayRef< Constant *> IdxList) const
static BinaryOperator * CreateNot(Value *Op, const Twine &Name="", Instruction *InsertBefore=nullptr)
Instruction * CreateOr(Constant *LHS, Constant *RHS) const
This class represents lattice values for constants.
Instruction * CreateFRem(Constant *LHS, Constant *RHS) const
Instruction * CreateShuffleVector(Constant *V1, Constant *V2, Constant *Mask) const
static Constant * getGetElementPtr(Type *Ty, Constant *C, ArrayRef< Constant *> IdxList, bool InBounds=false, Optional< unsigned > InRangeIndex=None, Type *OnlyIfReducedTy=nullptr)
Getelementptr form.
Instruction * CreateAShr(Constant *LHS, Constant *RHS, bool isExact=false) const
static GetElementPtrInst * Create(Type *PointeeType, Value *Ptr, ArrayRef< Value *> IdxList, const Twine &NameStr="", Instruction *InsertBefore=nullptr)
Instruction * CreateNUWAdd(Constant *LHS, Constant *RHS) const
This instruction constructs a fixed permutation of two input vectors.
static SelectInst * Create(Value *C, Value *S1, Value *S2, const Twine &NameStr="", Instruction *InsertBefore=nullptr, Instruction *MDFrom=nullptr)
Instruction * CreateNUWSub(Constant *LHS, Constant *RHS) const
Instruction * CreateFAdd(Constant *LHS, Constant *RHS) const
static InsertElementInst * Create(Value *Vec, Value *NewElt, Value *Idx, const Twine &NameStr="", Instruction *InsertBefore=nullptr)
Instruction * CreateNSWAdd(Constant *LHS, Constant *RHS) const
Constant * CreateGetElementPtr(Type *Ty, Constant *C, ArrayRef< Constant *> IdxList) const
Instruction * CreateXor(Constant *LHS, Constant *RHS) const
Instruction * CreateNSWSub(Constant *LHS, Constant *RHS) const
Instruction * CreateGetElementPtr(Type *Ty, Constant *C, ArrayRef< Value *> IdxList) const
Instruction * CreateInBoundsGetElementPtr(Type *Ty, Constant *C, ArrayRef< Value *> IdxList) const
Instruction * CreateCast(Instruction::CastOps Op, Constant *C, Type *DestTy) const
Instruction * CreateInsertElement(Constant *Vec, Constant *NewElt, Constant *Idx) const
Instruction * CreateUDiv(Constant *LHS, Constant *RHS, bool isExact=false) const
Instruction * CreateSExtOrBitCast(Constant *C, Type *DestTy) const
Instruction * CreateExactUDiv(Constant *LHS, Constant *RHS) const
This instruction compares its operands according to the predicate given to the constructor.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
Instruction * CreateURem(Constant *LHS, Constant *RHS) const
static BinaryOperator * CreateAdd(Value *S1, Value *S2, const Twine &Name, Instruction *InsertBefore, Value *FlagsOp)
NoFolder - Create "constants" (actually, instructions) with no folding.
Instruction * CreateLShr(Constant *LHS, Constant *RHS, bool isExact=false) const
Instruction * CreateBinOp(Instruction::BinaryOps Opc, Constant *LHS, Constant *RHS) const
static BinaryOperator * CreateNSWNeg(Value *Op, const Twine &Name="", Instruction *InsertBefore=nullptr)
Instruction * CreateNot(Constant *C) const
Instruction * CreateExtractElement(Constant *Vec, Constant *Idx) const
Instruction * CreateInsertValue(Constant *Agg, Constant *Val, ArrayRef< unsigned > IdxList) const
The instances of the Type class are immutable: once they are created, they are never changed...
This is an important base class in LLVM.
This file contains the declarations for the subclasses of Constant, which represent the different fla...
Instruction * CreateIntCast(Constant *C, Type *DestTy, bool isSigned) const
Instruction * CreatePtrToInt(Constant *C, Type *DestTy) const
Instruction * CreateExactSDiv(Constant *LHS, Constant *RHS) const
Instruction * CreateSDiv(Constant *LHS, Constant *RHS, bool isExact=false) const
This instruction compares its operands according to the predicate given to the constructor.
Predicate
This enumeration lists the possible predicates for CmpInst subclasses.
static CastInst * CreatePointerCast(Value *S, Type *Ty, const Twine &Name, BasicBlock *InsertAtEnd)
Create a BitCast AddrSpaceCast, or a PtrToInt cast instruction.
NUW NUW NUW NUW Exact static Exact BinaryOperator * CreateNeg(Value *Op, const Twine &Name="", Instruction *InsertBefore=nullptr)
Helper functions to construct and inspect unary operations (NEG and NOT) via binary operators SUB and...
static CastInst * CreateZExtOrBitCast(Value *S, Type *Ty, const Twine &Name="", Instruction *InsertBefore=nullptr)
Create a ZExt or BitCast cast instruction.
Instruction * CreateICmp(CmpInst::Predicate P, Constant *LHS, Constant *RHS) const
Constant * CreateInBoundsGetElementPtr(Type *Ty, Constant *C, Constant *Idx) const
Instruction * CreateFPCast(Constant *C, Type *DestTy) const
static BinaryOperator * CreateNUWNeg(Value *Op, const Twine &Name="", Instruction *InsertBefore=nullptr)
Instruction * CreateFMul(Constant *LHS, Constant *RHS) const
Instruction * CreateZExtOrBitCast(Constant *C, Type *DestTy) const
static BinaryOperator * CreateFNeg(Value *Op, const Twine &Name="", Instruction *InsertBefore=nullptr)
void setHasNoSignedWrap(bool b=true)
Set or clear the nsw flag on this instruction, which must be an operator which supports this flag...
static CastInst * CreateIntegerCast(Value *S, Type *Ty, bool isSigned, const Twine &Name="", Instruction *InsertBefore=nullptr)
Create a ZExt, BitCast, or Trunc for int -> int casts.
Instruction * CreateExtractValue(Constant *Agg, ArrayRef< unsigned > IdxList) const
Instruction * CreateNSWNeg(Constant *C) const
Instruction * CreatePointerCast(Constant *C, Type *DestTy) const
Constant * CreateGetElementPtr(Type *Ty, Constant *C, Constant *Idx) const
Instruction * CreateShl(Constant *LHS, Constant *RHS, bool HasNUW=false, bool HasNSW=false) const
static CastInst * CreateFPCast(Value *S, Type *Ty, const Twine &Name="", Instruction *InsertBefore=nullptr)
Create an FPExt, BitCast, or FPTrunc for fp -> fp casts.
Instruction * CreateIntToPtr(Constant *C, Type *DestTy) const
Instruction * CreateSRem(Constant *LHS, Constant *RHS) const
Instruction * CreateBitCast(Constant *C, Type *DestTy) const
Instruction * CreateFSub(Constant *LHS, Constant *RHS) const
Instruction * CreateSub(Constant *LHS, Constant *RHS, bool HasNUW=false, bool HasNSW=false) const
Instruction * CreateMul(Constant *LHS, Constant *RHS, bool HasNUW=false, bool HasNSW=false) const
static BinaryOperator * Create(BinaryOps Op, Value *S1, Value *S2, const Twine &Name=Twine(), Instruction *InsertBefore=nullptr)
Construct a binary instruction, given the opcode and the two operands.
Instruction * CreateSelect(Constant *C, Constant *True, Constant *False) const
Instruction * CreateFCmp(CmpInst::Predicate P, Constant *LHS, Constant *RHS) const
static CastInst * Create(Instruction::CastOps, Value *S, Type *Ty, const Twine &Name="", Instruction *InsertBefore=nullptr)
Provides a way to construct any of the CastInst subclasses using an opcode instead of the subclass's ...
Instruction * CreateNUWMul(Constant *LHS, Constant *RHS) const
Instruction * CreateFDiv(Constant *LHS, Constant *RHS) const
static CastInst * CreateTruncOrBitCast(Value *S, Type *Ty, const Twine &Name="", Instruction *InsertBefore=nullptr)
Create a Trunc or BitCast cast instruction.
Instruction * CreateNSWMul(Constant *LHS, Constant *RHS) const
static InsertValueInst * Create(Value *Agg, Value *Val, ArrayRef< unsigned > Idxs, const Twine &NameStr="", Instruction *InsertBefore=nullptr)
static Constant * getInBoundsGetElementPtr(Type *Ty, Constant *C, ArrayRef< Constant *> IdxList)
Create an "inbounds" getelementptr.
Instruction * CreateNUWNeg(Constant *C) const
Instruction * CreateAnd(Constant *LHS, Constant *RHS) const
void setHasNoUnsignedWrap(bool b=true)
Set or clear the nuw flag on this instruction, which must be an operator which supports this flag...
static CastInst * CreateSExtOrBitCast(Value *S, Type *Ty, const Twine &Name="", Instruction *InsertBefore=nullptr)
Create a SExt or BitCast cast instruction.
static GetElementPtrInst * CreateInBounds(Value *Ptr, ArrayRef< Value *> IdxList, const Twine &NameStr="", Instruction *InsertBefore=nullptr)
Create an "inbounds" getelementptr.
Instruction * CreateTruncOrBitCast(Constant *C, Type *DestTy) const
Instruction * CreateNeg(Constant *C, bool HasNUW=false, bool HasNSW=false) const
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.
static BinaryOperator * CreateMul(Value *S1, Value *S2, const Twine &Name, Instruction *InsertBefore, Value *FlagsOp)
Instruction * CreateAdd(Constant *LHS, Constant *RHS, bool HasNUW=false, bool HasNSW=false) const
Instruction * CreateFNeg(Constant *C) const