21 #ifndef LLVM_IR_NOFOLDER_H 22 #define LLVM_IR_NOFOLDER_H 42 bool HasNUW =
false,
bool HasNSW =
false)
const {
50 return BinaryOperator::CreateNSWAdd(LHS, RHS);
54 return BinaryOperator::CreateNUWAdd(LHS, RHS);
58 return BinaryOperator::CreateFAdd(LHS, RHS);
62 bool HasNUW =
false,
bool HasNSW =
false)
const {
70 return BinaryOperator::CreateNSWSub(LHS, RHS);
74 return BinaryOperator::CreateNUWSub(LHS, RHS);
78 return BinaryOperator::CreateFSub(LHS, RHS);
82 bool HasNUW =
false,
bool HasNSW =
false)
const {
90 return BinaryOperator::CreateNSWMul(LHS, RHS);
94 return BinaryOperator::CreateNUWMul(LHS, RHS);
98 return BinaryOperator::CreateFMul(LHS, RHS);
102 bool isExact =
false)
const {
104 return BinaryOperator::CreateUDiv(LHS, RHS);
105 return BinaryOperator::CreateExactUDiv(LHS, RHS);
109 return BinaryOperator::CreateExactUDiv(LHS, RHS);
113 bool isExact =
false)
const {
115 return BinaryOperator::CreateSDiv(LHS, RHS);
116 return BinaryOperator::CreateExactSDiv(LHS, RHS);
120 return BinaryOperator::CreateExactSDiv(LHS, RHS);
124 return BinaryOperator::CreateFDiv(LHS, RHS);
128 return BinaryOperator::CreateURem(LHS, RHS);
132 return BinaryOperator::CreateSRem(LHS, RHS);
136 return BinaryOperator::CreateFRem(LHS, RHS);
140 bool HasNSW =
false)
const {
148 bool isExact =
false)
const {
150 return BinaryOperator::CreateLShr(LHS, RHS);
151 return BinaryOperator::CreateExactLShr(LHS, RHS);
155 bool isExact =
false)
const {
157 return BinaryOperator::CreateAShr(LHS, RHS);
158 return BinaryOperator::CreateExactAShr(LHS, RHS);
162 return BinaryOperator::CreateAnd(LHS, RHS);
166 return BinaryOperator::CreateOr(LHS, RHS);
170 return BinaryOperator::CreateXor(LHS, RHS);
183 bool HasNUW =
false,
bool HasNSW =
false)
const {
199 return UnaryOperator::CreateFNeg(C);
254 Type *DestTy)
const {
263 bool isSigned)
const {
272 return CreateCast(Instruction::BitCast, C, DestTy);
276 return CreateCast(Instruction::IntToPtr, C, DestTy);
280 return CreateCast(Instruction::PtrToInt, C, DestTy);
345 #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 * CreateUnOp(Instruction::UnaryOps Opc, Constant *C) const
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 UnaryOperator * Create(UnaryOps Op, Value *S, const Twine &Name=Twine(), Instruction *InsertBefore=nullptr)
Construct a unary instruction, given the opcode and an operand.
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
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