16 #ifndef LLVM_IR_INSTRTYPES_H
17 #define LLVM_IR_INSTRTYPES_H
55 Use *Ops,
unsigned NumOps,
57 :
Instruction(Ty, iType, Ops, NumOps, InsertBefore) {}
61 :
Instruction(Ty, iType, Ops, NumOps, InsertAtEnd) {}
93 return isa<Instruction>(V) &&
classof(cast<Instruction>(V));
99 case Instruction::CatchSwitch:
100 case Instruction::CatchRet:
101 case Instruction::CleanupRet:
102 case Instruction::Invoke:
103 case Instruction::Resume:
114 template <
class Term,
class BB>
115 class SuccIterator :
public std::iterator<std::random_access_iterator_tag, BB,
117 typedef std::iterator<std::random_access_iterator_tag, BB, int, BB *, BB *>
129 inline bool index_is_valid(
unsigned idx) {
130 return idx < TermInst->getNumSuccessors();
134 class SuccessorProxy {
138 explicit SuccessorProxy(
const Self &it) : it(it) {}
140 SuccessorProxy(
const SuccessorProxy &) =
default;
142 SuccessorProxy &
operator=(SuccessorProxy r) {
148 it.TermInst->setSuccessor(it.idx, r);
152 operator reference()
const {
return *it; }
161 idx = TermInst->getNumSuccessors();
176 inline bool operator==(
const Self &x)
const {
return idx == x.idx; }
204 assert(TermInst == x.TermInst &&
205 "Cannot compare iterators of different blocks!");
210 assert(TermInst == x.TermInst &&
211 "Cannot compare iterators of different blocks!");
215 assert(TermInst == x.TermInst &&
216 "Cannot compare iterators of different blocks!");
221 assert(TermInst == x.TermInst &&
222 "Cannot compare iterators of different blocks!");
227 unsigned new_idx = idx +
Right;
228 assert(index_is_valid(new_idx) &&
"Iterator index out of bound");
244 assert(TermInst == x.TermInst &&
245 "Cannot work on iterators of different blocks!");
246 int distance = idx - x.idx;
253 return SuccessorProxy(tmp);
258 assert(TermInst &&
"Source not available, if basic block was malformed");
259 return TermInst->getParent();
306 void *
operator new(
size_t s) {
307 return User::operator
new(s, 1);
310 void *
operator new(size_t,
unsigned) =
delete;
320 return I->
getOpcode() == Instruction::Alloca ||
323 I->
getOpcode() == Instruction::ExtractValue ||
327 return isa<Instruction>(V) &&
classof(cast<Instruction>(V));
346 const Twine &
Name, Instruction *InsertBefore);
351 friend class Instruction;
356 void *
operator new(
size_t s) {
357 return User::operator
new(s, 2);
360 void *
operator new(size_t,
unsigned) =
delete;
372 Instruction *InsertBefore =
nullptr);
384 #define HANDLE_BINARY_INST(N, OPC, CLASS) \
385 static BinaryOperator *Create##OPC(Value *V1, Value *V2, \
386 const Twine &Name = "") {\
387 return Create(Instruction::OPC, V1, V2, Name);\
389 #include "llvm/IR/Instruction.def"
390 #define HANDLE_BINARY_INST(N, OPC, CLASS) \
391 static BinaryOperator *Create##OPC(Value *V1, Value *V2, \
392 const Twine &Name, BasicBlock *BB) {\
393 return Create(Instruction::OPC, V1, V2, Name, BB);\
395 #include "llvm/IR/Instruction.def"
396 #define HANDLE_BINARY_INST(N, OPC, CLASS) \
397 static BinaryOperator *Create##OPC(Value *V1, Value *V2, \
398 const Twine &Name, Instruction *I) {\
399 return Create(Instruction::OPC, V1, V2, Name, I);\
401 #include "llvm/IR/Instruction.def"
406 const Twine &Name =
"") {
413 const Twine &Name =
"") {
425 const Twine &Name, Instruction *
I) {
432 const Twine &Name =
"") {
444 const Twine &Name, Instruction *
I) {
451 const Twine &Name =
"") {
463 const Twine &Name, Instruction *
I) {
469 #define DEFINE_HELPERS(OPC, NUWNSWEXACT) \
470 static BinaryOperator *Create##NUWNSWEXACT##OPC(Value *V1, Value *V2, \
471 const Twine &Name = "") { \
472 return Create##NUWNSWEXACT(Instruction::OPC, V1, V2, Name); \
474 static BinaryOperator *Create##NUWNSWEXACT##OPC( \
475 Value *V1, Value *V2, const Twine &Name, BasicBlock *BB) { \
476 return Create##NUWNSWEXACT(Instruction::OPC, V1, V2, Name, BB); \
478 static BinaryOperator *Create##NUWNSWEXACT##OPC( \
479 Value *V1, Value *V2, const Twine &Name, Instruction *I) { \
480 return Create##NUWNSWEXACT(Instruction::OPC, V1, V2, Name, I); \
497 #undef DEFINE_HELPERS
504 static BinaryOperator *
CreateNeg(Value *Op,
const Twine &Name =
"",
505 Instruction *InsertBefore =
nullptr);
506 static BinaryOperator *
CreateNeg(Value *Op,
const Twine &Name,
508 static BinaryOperator *CreateNSWNeg(Value *Op,
const Twine &Name =
"",
509 Instruction *InsertBefore =
nullptr);
510 static BinaryOperator *CreateNSWNeg(Value *Op,
const Twine &Name,
512 static BinaryOperator *CreateNUWNeg(Value *Op,
const Twine &Name =
"",
513 Instruction *InsertBefore =
nullptr);
514 static BinaryOperator *CreateNUWNeg(Value *Op,
const Twine &Name,
516 static BinaryOperator *CreateFNeg(Value *Op,
const Twine &Name =
"",
517 Instruction *InsertBefore =
nullptr);
518 static BinaryOperator *CreateFNeg(Value *Op,
const Twine &Name,
520 static BinaryOperator *CreateNot(Value *Op,
const Twine &Name =
"",
521 Instruction *InsertBefore =
nullptr);
522 static BinaryOperator *CreateNot(Value *Op,
const Twine &Name,
527 static bool isNeg(
const Value *V);
528 static bool isFNeg(
const Value *V,
bool IgnoreZeroSign=
false);
529 static bool isNot(
const Value *V);
534 static const Value *getNegArgument(
const Value *BinOp);
535 static Value *getNegArgument( Value *BinOp);
536 static const Value *getFNegArgument(
const Value *BinOp);
537 static Value *getFNegArgument( Value *BinOp);
538 static const Value *getNotArgument(
const Value *BinOp);
539 static Value *getNotArgument( Value *BinOp);
557 return isa<Instruction>(V) && classof(cast<Instruction>(V));
579 void anchor()
override;
584 const Twine &NameStr =
"", Instruction *InsertBefore =
nullptr)
585 : UnaryInstruction(Ty, iType, S, InsertBefore) {
591 : UnaryInstruction(Ty, iType, S, InsertAtEnd) {
606 const Twine &Name =
"",
607 Instruction *InsertBefore =
nullptr
624 static CastInst *CreateZExtOrBitCast(
627 const Twine &Name =
"",
628 Instruction *InsertBefore =
nullptr
632 static CastInst *CreateZExtOrBitCast(
640 static CastInst *CreateSExtOrBitCast(
643 const Twine &Name =
"",
644 Instruction *InsertBefore =
nullptr
648 static CastInst *CreateSExtOrBitCast(
667 const Twine &Name =
"",
668 Instruction *InsertBefore =
nullptr
672 static CastInst *CreatePointerBitCastOrAddrSpaceCast(
680 static CastInst *CreatePointerBitCastOrAddrSpaceCast(
683 const Twine &Name =
"",
684 Instruction *InsertBefore =
nullptr
693 static CastInst *CreateBitOrPointerCast(
696 const Twine &Name =
"",
697 Instruction *InsertBefore =
nullptr
705 const Twine &Name =
"",
706 Instruction *InsertBefore =
nullptr
722 const Twine &Name =
"",
723 Instruction *InsertBefore =
nullptr
735 static CastInst *CreateTruncOrBitCast(
738 const Twine &Name =
"",
739 Instruction *InsertBefore =
nullptr
743 static CastInst *CreateTruncOrBitCast(
751 static bool isCastable(
757 static bool isBitCastable(
767 static bool isBitOrNoopPointerCastable(
787 bool isIntegerCast()
const;
794 bool isLosslessCast()
const;
805 static bool isNoopCast(
828 static unsigned isEliminableCastPair(
860 return isa<Instruction>(V) && classof(cast<Instruction>(V));
919 Instruction *InsertBefore =
nullptr);
931 void *
operator new(
size_t s) {
932 return User::operator
new(s, 2);
935 void *
operator new(size_t,
unsigned) =
delete;
945 Instruction *InsertBefore =
nullptr);
1104 return I->
getOpcode() == Instruction::ICmp ||
1108 return isa<Instruction>(V) &&
classof(cast<Instruction>(V));
1113 if (
VectorType* vt = dyn_cast<VectorType>(opnd_type)) {
1115 vt->getNumElements());
1123 void setValueSubclassData(
unsigned short D) {
1146 const Twine &NameStr, Instruction *InsertBefore);
1153 friend class Instruction;
1175 Op<-1>() = ParentPad;
1194 return isa<Instruction>(V) && classof(cast<Instruction>(V));
1209 OperandBundleUse() =
default;
1211 : Inputs(Inputs), Tag(Tag) {}
1216 if (isDeoptOperandBundle())
1218 return Inputs[Idx]->getType()->isPointerTy();
1226 return Tag->getKey();
1235 return Tag->getValue();
1261 std::vector<InputTy> Inputs;
1265 : Tag(std::move(Tag)), Inputs(std::move(Inputs)) {}
1267 : Tag(std::move(Tag)), Inputs(Inputs) {}
1271 Inputs.insert(Inputs.end(), OBU.
Inputs.begin(), OBU.
Inputs.end());
1370 assert(Begin <= End &&
"Should be!");
1484 return OBU.operandHasAttr(OpIdx - BOI.Begin, A);
1526 case Attribute::ArgMemOnly:
1529 case Attribute::ReadNone:
1563 auto op_begin =
static_cast<const InstrTy *
>(
this)->op_begin();
1564 ArrayRef<Use> Inputs(op_begin + BOI.Begin, op_begin + BOI.End);
1574 if (!static_cast<InstrTy *>(
this)->hasDescriptor())
1577 uint8_t *BytesBegin =
static_cast<InstrTy *
>(
this)->getDescriptor().begin();
1584 auto *NonConstThis =
1592 if (!static_cast<InstrTy *>(
this)->hasDescriptor())
1595 uint8_t *BytesEnd =
static_cast<InstrTy *
>(
this)->getDescriptor().end();
1602 auto *NonConstThis =
1624 const unsigned BeginIndex) {
1625 auto It =
static_cast<InstrTy *
>(
this)->op_begin() + BeginIndex;
1626 for (
auto &
B : Bundles)
1627 It = std::copy(
B.input_begin(),
B.input_end(), It);
1629 auto *ContextImpl =
static_cast<InstrTy *
>(
this)->getContext().pImpl;
1630 auto BI = Bundles.begin();
1631 unsigned CurrentIndex = BeginIndex;
1634 assert(BI != Bundles.end() &&
"Incorrect allocation?");
1636 BOI.Tag = ContextImpl->getOrInsertBundleTag(BI->getTag());
1637 BOI.Begin = CurrentIndex;
1638 BOI.End = CurrentIndex + BI->input_size();
1639 CurrentIndex = BOI.End;
1643 assert(BI == Bundles.end() &&
"Incorrect allocation?");
1654 if (BOI.Begin <= OpIdx && OpIdx < BOI.End)
1663 for (
auto &
B : Bundles)
1664 Total +=
B.input_size();
1671 #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.
bool isImpliedTrueByMatchingCmp(Predicate Pred2)
Determine if Pred1 implies Pred2 is true when two compares have matching operands.
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="")
OperandBundleDefT< Value * > OperandBundleDef
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
virtual unsigned getNumSuccessorsV() const =0
1 1 1 0 True if unordered or not equal
static bool isOrdered(Predicate predicate)
Determine if the predicate is an ordered operation.
static bool classof(const Value *V)
FunctionType * getType(LLVMContext &Context, ID id, ArrayRef< Type * > Tys=None)
Return the function type for an intrinsic.
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.
void copyIRFlags(const Value *V)
Convenience method to copy supported wrapping, exact, and fast-math flags from V to this instruction...
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
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...
static GCRegistry::Add< StatepointGC > D("statepoint-example","an example strategy for statepoint")
input_iterator input_end() const
size_t input_size() const
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
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.
void setSuccessor(unsigned idx, BasicBlock *B)
Update the specified successor to point at the provided block.
Self operator-(int Right) const
static GCRegistry::Add< OcamlGC > B("ocaml","ocaml 3.10-compatible GC")
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.
virtual void setSuccessorV(unsigned idx, BasicBlock *B)=0
void getOperandBundlesAsDefs(SmallVectorImpl< OperandBundleDef > &Defs) const
Return the list of operand bundles attached to this instruction as a vector of OperandBundleDefs.
reference operator*() const
unsigned getNumSuccessors() const
Return the number of successors that this terminator has.
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.
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...
BasicBlock * getSuccessor(unsigned idx) const
Return the specified successor.
SuccIterator< TerminatorInst *, BasicBlock > succ_iterator
OperandBundleDefT< const Value * > ConstOperandBundleDef
static StringRef getPredicateName(Predicate P)
std::vector< InputTy >::const_iterator input_iterator
iterator_range< succ_iterator > succ_range
static BinaryOperator * CreateNUW(BinaryOps Opc, Value *V1, Value *V2, const Twine &Name="")
bool isIntPredicate() const
~TerminatorInst() override
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
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.
SuccIterator< const TerminatorInst *, const BasicBlock > succ_const_iterator
~UnaryInstruction() override
1 1 0 1 True if unordered, less than, or equal
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
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.
virtual BasicBlock * getSuccessorV(unsigned idx) const =0
Virtual methods - Terminators should overload these and provide inline overrides of non-V 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.
iterator_range< succ_const_iterator > succ_const_range
Predicate getSwappedPredicate() const
For example, EQ->EQ, SLE->SGE, ULT->UGT, OEQ->OEQ, ULE->UGE, OLT->OGT, etc.
void setValueSubclassData(unsigned short D)
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.
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.
OperandBundleDefT(const OperandBundleUse &OBU)
bool isImpliedFalseByMatchingCmp(Predicate Pred2)
Determine if Pred1 implies Pred2 is false when two compares have matching operands.
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.
const BundleOpInfo * const_bundle_op_iterator
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.
super::reference reference
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.
bool operator==(const Self &x) const
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.
BundleOpInfo * bundle_op_iterator
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
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.
0 0 1 1 True if ordered and greater than or equal
static bool classof(const Instruction *I)
static GCRegistry::Add< ErlangGC > A("erlang","erlang-compatible garbage collector")
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.