16 #ifndef LLVM_IR_INSTRTYPES_H
17 #define LLVM_IR_INSTRTYPES_H
57 Use *Ops,
unsigned NumOps,
59 :
Instruction(Ty, iType, Ops, NumOps, InsertBefore) {}
63 :
Instruction(Ty, iType, Ops, NumOps, InsertAtEnd) {}
80 return isa<Instruction>(V) &&
classof(cast<Instruction>(V));
86 case Instruction::CatchSwitch:
87 case Instruction::CatchRet:
88 case Instruction::CleanupRet:
89 case Instruction::Invoke:
90 case Instruction::Resume:
101 template <
class Term,
class BB>
102 class SuccIterator :
public std::iterator<std::random_access_iterator_tag, BB,
105 std::iterator<std::random_access_iterator_tag, BB, int, BB *, BB *>;
116 inline bool index_is_valid(
unsigned idx) {
117 return idx < TermInst->getNumSuccessors();
121 class SuccessorProxy {
125 explicit SuccessorProxy(
const Self &it) : it(it) {}
127 SuccessorProxy(
const SuccessorProxy &) =
default;
129 SuccessorProxy &
operator=(SuccessorProxy r) {
135 it.TermInst->setSuccessor(it.idx, r);
139 operator reference()
const {
return *it; }
148 idx = TermInst->getNumSuccessors();
163 inline bool operator==(
const Self &x)
const {
return idx == x.idx; }
191 assert(TermInst == x.TermInst &&
192 "Cannot compare iterators of different blocks!");
197 assert(TermInst == x.TermInst &&
198 "Cannot compare iterators of different blocks!");
202 assert(TermInst == x.TermInst &&
203 "Cannot compare iterators of different blocks!");
208 assert(TermInst == x.TermInst &&
209 "Cannot compare iterators of different blocks!");
214 unsigned new_idx = idx +
Right;
215 assert(index_is_valid(new_idx) &&
"Iterator index out of bound");
231 assert(TermInst == x.TermInst &&
232 "Cannot work on iterators of different blocks!");
233 int distance = idx - x.idx;
240 return SuccessorProxy(tmp);
245 assert(TermInst &&
"Source not available, if basic block was malformed");
246 return TermInst->getParent();
293 void *
operator new(
size_t s) {
294 return User::operator
new(s, 1);
302 return I->
getOpcode() == Instruction::Alloca ||
305 I->
getOpcode() == Instruction::ExtractValue ||
309 return isa<Instruction>(V) &&
classof(cast<Instruction>(V));
329 const Twine &
Name, Instruction *InsertBefore);
334 friend class Instruction;
340 void *
operator new(
size_t s) {
341 return User::operator
new(s, 2);
354 Instruction *InsertBefore =
nullptr);
366 #define HANDLE_BINARY_INST(N, OPC, CLASS) \
367 static BinaryOperator *Create##OPC(Value *V1, Value *V2, \
368 const Twine &Name = "") {\
369 return Create(Instruction::OPC, V1, V2, Name);\
371 #include "llvm/IR/Instruction.def"
372 #define HANDLE_BINARY_INST(N, OPC, CLASS) \
373 static BinaryOperator *Create##OPC(Value *V1, Value *V2, \
374 const Twine &Name, BasicBlock *BB) {\
375 return Create(Instruction::OPC, V1, V2, Name, BB);\
377 #include "llvm/IR/Instruction.def"
378 #define HANDLE_BINARY_INST(N, OPC, CLASS) \
379 static BinaryOperator *Create##OPC(Value *V1, Value *V2, \
380 const Twine &Name, Instruction *I) {\
381 return Create(Instruction::OPC, V1, V2, Name, I);\
383 #include "llvm/IR/Instruction.def"
388 const Twine &Name =
"") {
395 const Twine &Name =
"") {
407 const Twine &Name, Instruction *
I) {
414 const Twine &Name =
"") {
426 const Twine &Name, Instruction *
I) {
433 const Twine &Name =
"") {
445 const Twine &Name, Instruction *
I) {
451 #define DEFINE_HELPERS(OPC, NUWNSWEXACT) \
452 static BinaryOperator *Create##NUWNSWEXACT##OPC(Value *V1, Value *V2, \
453 const Twine &Name = "") { \
454 return Create##NUWNSWEXACT(Instruction::OPC, V1, V2, Name); \
456 static BinaryOperator *Create##NUWNSWEXACT##OPC( \
457 Value *V1, Value *V2, const Twine &Name, BasicBlock *BB) { \
458 return Create##NUWNSWEXACT(Instruction::OPC, V1, V2, Name, BB); \
460 static BinaryOperator *Create##NUWNSWEXACT##OPC( \
461 Value *V1, Value *V2, const Twine &Name, Instruction *I) { \
462 return Create##NUWNSWEXACT(Instruction::OPC, V1, V2, Name, I); \
479 #undef DEFINE_HELPERS
486 static BinaryOperator *
CreateNeg(Value *Op,
const Twine &Name =
"",
487 Instruction *InsertBefore =
nullptr);
488 static BinaryOperator *
CreateNeg(Value *Op,
const Twine &Name,
490 static BinaryOperator *CreateNSWNeg(Value *Op,
const Twine &Name =
"",
491 Instruction *InsertBefore =
nullptr);
492 static BinaryOperator *CreateNSWNeg(Value *Op,
const Twine &Name,
494 static BinaryOperator *CreateNUWNeg(Value *Op,
const Twine &Name =
"",
495 Instruction *InsertBefore =
nullptr);
496 static BinaryOperator *CreateNUWNeg(Value *Op,
const Twine &Name,
498 static BinaryOperator *CreateFNeg(Value *Op,
const Twine &Name =
"",
499 Instruction *InsertBefore =
nullptr);
500 static BinaryOperator *CreateFNeg(Value *Op,
const Twine &Name,
502 static BinaryOperator *CreateNot(Value *Op,
const Twine &Name =
"",
503 Instruction *InsertBefore =
nullptr);
504 static BinaryOperator *CreateNot(Value *Op,
const Twine &Name,
509 static bool isNeg(
const Value *V);
510 static bool isFNeg(
const Value *V,
bool IgnoreZeroSign=
false);
511 static bool isNot(
const Value *V);
516 static const Value *getNegArgument(
const Value *BinOp);
517 static Value *getNegArgument( Value *BinOp);
518 static const Value *getFNegArgument(
const Value *BinOp);
519 static Value *getFNegArgument( Value *BinOp);
520 static const Value *getNotArgument(
const Value *BinOp);
521 static Value *getNotArgument( Value *BinOp);
539 return isa<Instruction>(V) && classof(cast<Instruction>(V));
564 const Twine &NameStr =
"", Instruction *InsertBefore =
nullptr)
565 : UnaryInstruction(Ty, iType, S, InsertBefore) {
571 : UnaryInstruction(Ty, iType, S, InsertAtEnd) {
586 const Twine &Name =
"",
587 Instruction *InsertBefore =
nullptr
604 static CastInst *CreateZExtOrBitCast(
607 const Twine &Name =
"",
608 Instruction *InsertBefore =
nullptr
612 static CastInst *CreateZExtOrBitCast(
620 static CastInst *CreateSExtOrBitCast(
623 const Twine &Name =
"",
624 Instruction *InsertBefore =
nullptr
628 static CastInst *CreateSExtOrBitCast(
647 const Twine &Name =
"",
648 Instruction *InsertBefore =
nullptr
652 static CastInst *CreatePointerBitCastOrAddrSpaceCast(
660 static CastInst *CreatePointerBitCastOrAddrSpaceCast(
663 const Twine &Name =
"",
664 Instruction *InsertBefore =
nullptr
673 static CastInst *CreateBitOrPointerCast(
676 const Twine &Name =
"",
677 Instruction *InsertBefore =
nullptr
685 const Twine &Name =
"",
686 Instruction *InsertBefore =
nullptr
702 const Twine &Name =
"",
703 Instruction *InsertBefore =
nullptr
715 static CastInst *CreateTruncOrBitCast(
718 const Twine &Name =
"",
719 Instruction *InsertBefore =
nullptr
723 static CastInst *CreateTruncOrBitCast(
731 static bool isCastable(
737 static bool isBitCastable(
747 static bool isBitOrNoopPointerCastable(
767 bool isIntegerCast()
const;
774 bool isLosslessCast()
const;
785 static bool isNoopCast(
808 static unsigned isEliminableCastPair(
840 return isa<Instruction>(V) && classof(cast<Instruction>(V));
899 Instruction *InsertBefore =
nullptr);
907 void *
operator new(
size_t s) {
908 return User::operator
new(s, 2);
919 Instruction *InsertBefore =
nullptr);
1066 return I->
getOpcode() == Instruction::ICmp ||
1070 return isa<Instruction>(V) &&
classof(cast<Instruction>(V));
1075 if (
VectorType* vt = dyn_cast<VectorType>(opnd_type)) {
1077 vt->getNumElements());
1085 void setValueSubclassData(
unsigned short D) {
1106 const Twine &NameStr, Instruction *InsertBefore);
1115 friend class Instruction;
1138 Op<-1>() = ParentPad;
1157 return isa<Instruction>(V) && classof(cast<Instruction>(V));
1172 OperandBundleUse() =
default;
1174 : Inputs(Inputs), Tag(Tag) {}
1179 if (isDeoptOperandBundle())
1180 if (A == Attribute::ReadOnly || A == Attribute::NoCapture)
1181 return Inputs[Idx]->getType()->isPointerTy();
1189 return Tag->getKey();
1198 return Tag->getValue();
1224 std::vector<InputTy> Inputs;
1228 : Tag(std::move(Tag)), Inputs(std::move(Inputs)) {}
1230 : Tag(std::move(Tag)), Inputs(Inputs) {}
1234 Inputs.insert(Inputs.end(), OBU.
Inputs.begin(), OBU.
Inputs.end());
1334 assert(Begin <= End &&
"Should be!");
1448 return OBU.operandHasAttr(OpIdx - BOI.Begin, A);
1490 case Attribute::ArgMemOnly:
1493 case Attribute::ReadNone:
1496 case Attribute::ReadOnly:
1527 auto op_begin =
static_cast<const InstrTy *
>(
this)->op_begin();
1528 ArrayRef<Use> Inputs(op_begin + BOI.Begin, op_begin + BOI.End);
1538 if (!static_cast<InstrTy *>(
this)->hasDescriptor())
1541 uint8_t *BytesBegin =
static_cast<InstrTy *
>(
this)->getDescriptor().begin();
1548 auto *NonConstThis =
1556 if (!static_cast<InstrTy *>(
this)->hasDescriptor())
1559 uint8_t *BytesEnd =
static_cast<InstrTy *
>(
this)->getDescriptor().end();
1566 auto *NonConstThis =
1588 const unsigned BeginIndex) {
1589 auto It =
static_cast<InstrTy *
>(
this)->op_begin() + BeginIndex;
1590 for (
auto &
B : Bundles)
1591 It = std::copy(
B.input_begin(),
B.input_end(), It);
1593 auto *ContextImpl =
static_cast<InstrTy *
>(
this)->getContext().pImpl;
1594 auto BI = Bundles.begin();
1595 unsigned CurrentIndex = BeginIndex;
1598 assert(BI != Bundles.end() &&
"Incorrect allocation?");
1600 BOI.Tag = ContextImpl->getOrInsertBundleTag(BI->getTag());
1601 BOI.Begin = CurrentIndex;
1602 BOI.End = CurrentIndex + BI->input_size();
1603 CurrentIndex = BOI.End;
1607 assert(BI == Bundles.end() &&
"Incorrect allocation?");
1618 if (BOI.Begin <= OpIdx && OpIdx < BOI.End)
1627 for (
auto &
B : Bundles)
1628 Total +=
B.input_size();
1635 #endif // LLVM_IR_INSTRTYPES_H
TerminatorInst(Type *Ty, Instruction::TermOps iType, Use *Ops, unsigned NumOps, Instruction *InsertBefore=nullptr)
bool operator==(const BundleOpInfo &Other) const
void setArgOperand(unsigned i, Value *v)
bool hasReadingOperandBundles() const
Return true if this operand bundle user has operand bundles that may read from the heap...
Value * getArgOperand(unsigned i) const
getArgOperand/setArgOperand - Return/set the i-th funcletpad argument.
A parsed version of the target data layout string in and methods for querying it. ...
Instruction::CastOps getOpcode() const
Return the opcode of this CastInst.
This class is the base class for the comparison instructions.
static bool classof(const Instruction *I)
bool operator>(const Self &x) const
static IntegerType * getInt1Ty(LLVMContext &C)
OperandBundleDefT(std::string Tag, ArrayRef< InputTy > Inputs)
static Type * makeCmpResultType(Type *opnd_type)
Create a result type for fcmp/icmp.
static BinaryOperator * CreateNUW(BinaryOps Opc, Value *V1, Value *V2, const Twine &Name, Instruction *I)
static BinaryOperator * CreateExact(BinaryOps Opc, Value *V1, Value *V2, const Twine &Name="")
static BinaryOperator * CreateNSW(BinaryOps Opc, Value *V1, Value *V2, const Twine &Name, BasicBlock *BB)
Self & operator+=(int Right)
iterator_range< const_bundle_op_iterator > bundle_op_infos() const
Return the range [bundle_op_info_begin, bundle_op_info_end).
UnaryInstruction(Type *Ty, unsigned iType, Value *V, BasicBlock *IAE)
This provides a very simple, boring adaptor for a begin and end iterator into a range type...
static unsigned CountBundleInputs(ArrayRef< OperandBundleDef > Bundles)
Return the total number of values used in Bundles.
uint32_t Begin
The index in the Use& vector where operands for this operand bundle starts.
Predicate getInversePredicate() const
For example, EQ -> NE, UGT -> ULE, SLT -> SGE, OEQ -> UNE, UGT -> OLE, OLT -> UGE, etc.
DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value)
Provide more efficient getOperand methods.
OperandBundleUse operandBundleFromBundleOpInfo(const BundleOpInfo &BOI) const
Simple helper function to map a BundleOpInfo to an OperandBundleUse.
const_bundle_op_iterator bundle_op_info_end() const
Return the end of the list of BundleOpInfo instances associated with this OperandBundleUser.
bool isSigned() const
Determine if this instruction is using a signed comparison.
0 1 0 0 True if ordered and less than
1 1 1 0 True if unordered or not equal
static bool isOrdered(Predicate predicate)
Determine if the predicate is an ordered operation.
unsigned getNumSuccessors() const
Return the number of successors that this terminator has.
static bool classof(const Value *V)
typename std::vector< InputTy >::const_iterator input_iterator
void copyIRFlags(const Value *V, bool IncludeWrapFlags=true)
Convenience method to copy supported exact, fast-math, and (optionally) wrapping flags from V to this...
UnaryInstruction(Type *Ty, unsigned iType, Value *V, Instruction *IB=nullptr)
bool isBundleOperand(unsigned Idx) const
Return true if the operand at index Idx is a bundle operand.
bool isEquality() const
This is just a convenience that dispatches to the subclasses.
static BinaryOperator * CreateNSW(BinaryOps Opc, Value *V1, Value *V2, const Twine &Name, Instruction *I)
Predicate getSignedPredicate()
For example, ULT->SLT, ULE->SLE, UGT->SGT, UGE->SGE, SLT->Failed assert.
OperandBundleUse getOperandBundleAt(unsigned Index) const
Return the operand bundle at a specific index.
const_op_range arg_operands() const
arg_operands - iteration adapter for range-for loops.
static BinaryOperator * CreateNSW(BinaryOps Opc, Value *V1, Value *V2, const Twine &Name="")
bool isFnAttrDisallowedByOpBundle(StringRef S) const
Is the function attribute S disallowed by some operand bundle on this operand bundle user...
1 0 0 1 True if unordered or equal
static bool isImpliedFalseByMatchingCmp(Predicate Pred1, Predicate Pred2)
Determine if Pred1 implies Pred2 is false when two compares have matching operands.
bool hasOperandBundlesOtherThan(ArrayRef< uint32_t > IDs) const
Return true if this operand bundle user contains operand bundles with tags other than those specified...
StringRef getTagName() const
Return the tag of this operand bundle as a string.
1 0 0 0 True if unordered: isnan(X) | isnan(Y)
unsigned getSubclassDataFromInstruction() const
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
This is the base class for all instructions that perform data casts.
CastInst(Type *Ty, unsigned iType, Value *S, const Twine &NameStr, BasicBlock *InsertAtEnd)
Constructor with insert-at-end-of-block semantics for subclasses.
A Use represents the edge between a Value definition and its users.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
input_iterator input_end() const
size_t input_size() const
static bool isImpliedTrueByMatchingCmp(Predicate Pred1, Predicate Pred2)
Determine if Pred1 implies Pred2 is true when two compares have matching operands.
0 1 0 1 True if ordered and less than or equal
This file contains the simple types necessary to represent the attributes associated with functions a...
unsigned getNumTotalBundleOperands() const
Return the total number operands (not operand bundles) used by every operand bundle in this OperandBu...
bundle_op_iterator bundle_op_info_begin()
Return the start of the list of BundleOpInfo instances associated with this OperandBundleUser.
OperandBundleUse getOperandBundleForOperand(unsigned OpIdx) const
Return the operand bundle for the operand at index OpIdx.
bool operator<=(const Self &x) const
typename super::pointer pointer
BundleOpInfo * bundle_op_iterator
bool isFnAttrDisallowedByOpBundle(Attribute::AttrKind A) const
Is the function attribute A disallowed by some operand bundle on this operand bundle user...
#define DEFINE_TRANSPARENT_OPERAND_ACCESSORS(CLASS, VALUECLASS)
Macro for generating out-of-class operand accessor definitions.
BB * getSource()
Get the source BB of this iterator.
void setIsExact(bool b=true)
Set or clear the exact flag on this instruction, which must be an operator which supports this flag...
LLVMContext & getContext() const
Return the LLVMContext in which this type was uniqued.
bool hasClobberingOperandBundles() const
Return true if this operand bundle user has operand bundles that may write to the heap...
unsigned getNumArgOperands() const
getNumArgOperands - Return the number of funcletpad arguments.
void setParentPad(Value *ParentPad)
unsigned getNumOperandBundles() const
Return the number of operand bundles associated with this User.
int operator-(const Self &x) const
static CmpInst * Create(OtherOps Op, Predicate predicate, Value *S1, Value *S2, const Twine &Name="", Instruction *InsertBefore=nullptr)
Construct a compare instruction, given the opcode, the predicate and the two operands.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
Used to keep track of an operand bundle.
Self operator-(int Right) const
void setInstructionSubclassData(unsigned short D)
OperandBundleUse(StringMapEntry< uint32_t > *Tag, ArrayRef< Use > Inputs)
const_bundle_op_iterator bundle_op_info_begin() const
Return the start of the list of BundleOpInfo instances associated with this OperandBundleUser.
bool hasOperandBundles() const
Return true if this User has any operand bundles.
void getOperandBundlesAsDefs(SmallVectorImpl< OperandBundleDef > &Defs) const
Return the list of operand bundles attached to this instruction as a vector of OperandBundleDefs.
reference operator*() const
static bool classof(const Instruction *I)
Methods for support type inquiry through isa, cast, and dyn_cast:
initializer< Ty > init(const Ty &Val)
static bool isIntPredicate(Predicate P)
Subclasses of this class are all able to terminate a basic block.
void setSuccessor(unsigned idx, BasicBlock *B)
Update the specified successor to point at the provided block.
bool isFuncletOperandBundle() const
Return true if this is a "funclet" operand bundle.
LLVM Basic Block Representation.
The instances of the Type class are immutable: once they are created, they are never changed...
SuccIterator< const TerminatorInst *, const BasicBlock > succ_const_iterator
static StringRef getPredicateName(Predicate P)
constexpr char Args[]
Key for Kernel::Metadata::mArgs.
static BinaryOperator * CreateNUW(BinaryOps Opc, Value *V1, Value *V2, const Twine &Name="")
bool isIntPredicate() const
static BinaryOperator * CreateNUW(BinaryOps Opc, Value *V1, Value *V2, const Twine &Name, BasicBlock *BB)
pointer operator->() const
bool isFalseWhenEqual() const
This is just a convenience.
static BinaryOperator * CreateExact(BinaryOps Opc, Value *V1, Value *V2, const Twine &Name, BasicBlock *BB)
Predicate
This enumeration lists the possible predicates for CmpInst subclasses.
static const unsigned End
iterator_range< succ_iterator > succ_range
0 1 1 1 True if ordered (no nans)
static bool classof(const Value *V)
Type * getSrcTy() const
Return the source type, as a convenience.
Predicate getPredicate() const
Return the predicate for this instruction.
uint32_t getTagID() const
Return the tag of this operand bundle as an integer.
static bool classof(const Instruction *I)
Self & operator-=(int Right)
1 1 1 1 Always true (always folded)
ArrayRef< InputTy > inputs() const
#define DECLARE_TRANSPARENT_OPERAND_ACCESSORS(VALUECLASS)
Macro for generating in-class operand accessor declarations.
bool isCommutative() const
This is just a convenience that dispatches to the subclasses.
static wasm::ValType getType(const TargetRegisterClass *RC)
1 1 0 1 True if unordered, less than, or equal
void swapOperands()
This is just a convenience that dispatches to the subclasses.
OpIteratorTy populateBundleOperandInfos(ArrayRef< OperandBundleDef > Bundles, const unsigned BeginIndex)
Populate the BundleOpInfo instances and the Use& vector from Bundles.
DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value)
Transparently provide more efficient getOperand methods.
bool isTerminator() const
Optional< OperandBundleUse > getOperandBundle(uint32_t ID) const
Return an operand bundle by tag ID, if present.
0 0 1 0 True if ordered and greater than
iterator_range< T > make_range(T x, T y)
Convenience function for iterating over sub-ranges.
BinaryOps getOpcode() const
void setHasNoSignedWrap(bool b=true)
Set or clear the nsw flag on this instruction, which must be an operator which supports this flag...
TerminatorInst(Type *Ty, Instruction::TermOps iType, Use *Ops, unsigned NumOps, BasicBlock *InsertAtEnd)
OperandBundleDefT(std::string Tag, std::vector< InputTy > Inputs)
Optional< OperandBundleUse > getOperandBundle(StringRef Name) const
Return an operand bundle by name, if present.
1 1 0 0 True if unordered or less than
CastInst(Type *Ty, unsigned iType, Value *S, const Twine &NameStr="", Instruction *InsertBefore=nullptr)
Constructor with insert-before-instruction semantics for subclasses.
unsigned getBundleOperandsStartIndex() const
Return the index of the first bundle operand in the Use array.
bool isTrueWhenEqual() const
This is just a convenience.
Type * getDestTy() const
Return the destination type, as a convenience.
bundle_op_iterator bundle_op_info_end()
Return the end of the list of BundleOpInfo instances associated with this OperandBundleUser.
#define DEFINE_HELPERS(OPC, NUWNSWEXACT)
Value * getParentPad() const
Convenience accessors.
Predicate getSwappedPredicate() const
For example, EQ->EQ, SLE->SGE, ULT->UGT, OEQ->OEQ, ULE->UGE, OLT->OGT, etc.
void setValueSubclassData(unsigned short D)
BasicBlock * getSuccessor(unsigned idx) const
Return the specified successor.
void setPredicate(Predicate P)
Set the predicate for this instruction to the specified value.
A range adaptor for a pair of iterators.
Class to represent vector types.
bool hasIdenticalOperandBundleSchema(const OperandBundleUser< InstrTy, OpIteratorTy > &Other) const
Return true if Other has the same sequence of operand bundle tags with the same number of operands on...
succ_const_range successors() const
static bool isFPPredicate(Predicate P)
A lightweight accessor for an operand bundle meant to be passed around by value.
bool operandHasAttr(unsigned Idx, Attribute::AttrKind A) const
Return true if the operand at index Idx in this operand bundle has the attribute A.
CmpInst(Type *ty, Instruction::OtherOps op, Predicate pred, Value *LHS, Value *RHS, const Twine &Name="", Instruction *InsertBefore=nullptr)
uint32_t End
The index in the Use& vector where operands for this operand bundle ends.
static BinaryOperator * CreateExact(BinaryOps Opc, Value *V1, Value *V2, const Twine &Name, Instruction *I)
bool isFPPredicate() const
StringMapEntry< uint32_t > * Tag
The operand bundle tag, interned by LLVMContextImpl::getOrInsertBundleTag.
llvm_unreachable("Unknown RegBank!")
OperandBundleDefT(const OperandBundleUse &OBU)
bool isFuncletPad() const
input_iterator input_begin() const
static BinaryOperator * CreateWithCopiedFlags(BinaryOps Opc, Value *V1, Value *V2, BinaryOperator *CopyBO, const Twine &Name="")
void emplace_back(ArgTypes &&...Args)
const BundleOpInfo & getBundleOpInfoForOperand(unsigned OpIdx) const
Return the BundleOpInfo for the operand at index OpIdx.
bool operator>=(const Self &x) const
bool isDeoptOperandBundle() const
Return true if this is a "deopt" operand bundle.
unsigned greater or equal
static bool isUnordered(Predicate predicate)
Determine if the predicate is an unordered operation.
static bool classof(const Value *V)
SuccIterator(Term T, bool)
unsigned countOperandBundlesOfType(uint32_t ID) const
Return the number of operand bundles with the tag ID attached to this instruction.
0 1 1 0 True if ordered and operands are unequal
Compile-time customization of User operands.
bool operator<(const Self &x) const
SuccessorProxy operator[](int offset)
static BinaryOperator * CreateNeg(Value *S1, const Twine &Name, Instruction *InsertBefore, Value *FlagsOp)
Instruction & operator=(const Instruction &)=delete
1 0 1 0 True if unordered or greater than
unsigned getBundleOperandsEndIndex() const
Return the index of the last bundle operand in the Use array.
const BundleOpInfo * const_bundle_op_iterator
bool operator==(const Self &x) const
SuccIterator< TerminatorInst *, BasicBlock > succ_iterator
OtherOps getOpcode() const
Get the opcode casted to the right type.
static bool classof(const Value *V)
void setHasNoUnsignedWrap(bool b=true)
Set or clear the nsw flag on this instruction, which must be an operator which supports this flag...
bool isUnsigned() const
Determine if this instruction is using an unsigned comparison.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
op_range arg_operands()
arg_operands - iteration adapter for range-for loops.
0 0 0 1 True if ordered and equal
LLVM Value Representation.
1 0 1 1 True if unordered, greater than, or equal
unsigned getOpcode() const
Returns a member of one of the enums like Instruction::Add.
unsigned getSuccessorIndex() const
This is used to interface between code that wants to operate on terminator instructions directly...
static bool classof(const Value *V)
static VectorType * get(Type *ElementType, unsigned NumElements)
This static method is the primary way to construct an VectorType.
A container for an operand bundle being viewed as a set of values rather than a set of uses...
bool operator!=(const Self &x) const
iterator_range< succ_const_iterator > succ_const_range
bool isExceptional() const
iterator_range< bundle_op_iterator > bundle_op_infos()
Return the range [bundle_op_info_begin, bundle_op_info_end).
StringRef - Represent a constant reference to a string, i.e.
FixedNumOperandTraits - determine the allocation regime of the Use array when it is a prefix to the U...
static bool classof(const Instruction *I)
VariadicOperandTraits - determine the allocation regime of the Use array when it is a prefix to the U...
bool bundleOperandHasAttr(unsigned OpIdx, Attribute::AttrKind A) const
Return true if the bundle operand at index OpIdx has the attribute A.
unsigned countOperandBundlesOfType(StringRef Name) const
Return the number of operand bundles with the tag Name attached to this instruction.
typename super::reference reference
0 0 1 1 True if ordered and greater than or equal
static bool classof(const Instruction *I)
Self operator+(int Right) const
static bool classof(const Instruction *I)
Methods for support type inquiry through isa, cast, and dyn_cast:
static bool classof(const Value *V)
A mixin to add operand bundle functionality to llvm instruction classes.
0 0 0 0 Always false (always folded)
AttrKind
This enumeration lists the attributes that can be associated with parameters, function results...
bool is_contained(R &&Range, const E &Element)
Wrapper function around std::find to detect if an element exists in a container.