|
LLVM
4.0.0
|
A mixin to add operand bundle functionality to llvm instruction classes. More...
#include <InstrTypes.h>
Classes | |
| struct | BundleOpInfo |
| Used to keep track of an operand bundle. More... | |
Public Member Functions | |
| unsigned | getNumOperandBundles () const |
| Return the number of operand bundles associated with this User. More... | |
| bool | hasOperandBundles () const |
| Return true if this User has any operand bundles. More... | |
| unsigned | getBundleOperandsStartIndex () const |
| Return the index of the first bundle operand in the Use array. More... | |
| unsigned | getBundleOperandsEndIndex () const |
| Return the index of the last bundle operand in the Use array. More... | |
| bool | isBundleOperand (unsigned Idx) const |
Return true if the operand at index Idx is a bundle operand. More... | |
| unsigned | getNumTotalBundleOperands () const |
| Return the total number operands (not operand bundles) used by every operand bundle in this OperandBundleUser. More... | |
| OperandBundleUse | getOperandBundleAt (unsigned Index) const |
| Return the operand bundle at a specific index. More... | |
| unsigned | countOperandBundlesOfType (StringRef Name) const |
| Return the number of operand bundles with the tag Name attached to this instruction. More... | |
| unsigned | countOperandBundlesOfType (uint32_t ID) const |
| Return the number of operand bundles with the tag ID attached to this instruction. More... | |
| Optional< OperandBundleUse > | getOperandBundle (StringRef Name) const |
| Return an operand bundle by name, if present. More... | |
| Optional< OperandBundleUse > | getOperandBundle (uint32_t ID) const |
| Return an operand bundle by tag ID, if present. More... | |
| void | getOperandBundlesAsDefs (SmallVectorImpl< OperandBundleDef > &Defs) const |
| Return the list of operand bundles attached to this instruction as a vector of OperandBundleDefs. More... | |
| OperandBundleUse | getOperandBundleForOperand (unsigned OpIdx) const |
| Return the operand bundle for the operand at index OpIdx. More... | |
| bool | hasReadingOperandBundles () const |
| Return true if this operand bundle user has operand bundles that may read from the heap. More... | |
| bool | hasClobberingOperandBundles () const |
| Return true if this operand bundle user has operand bundles that may write to the heap. More... | |
| bool | bundleOperandHasAttr (unsigned OpIdx, Attribute::AttrKind A) const |
Return true if the bundle operand at index OpIdx has the attribute A. More... | |
| 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 each one of them as this OperandBundleUser. More... | |
| bool | hasOperandBundlesOtherThan (ArrayRef< uint32_t > IDs) const |
Return true if this operand bundle user contains operand bundles with tags other than those specified in IDs. More... | |
Protected Types | |
| typedef BundleOpInfo * | bundle_op_iterator |
| typedef const BundleOpInfo * | const_bundle_op_iterator |
Protected Member Functions | |
| bool | isFnAttrDisallowedByOpBundle (StringRef S) const |
| Is the function attribute S disallowed by some operand bundle on this operand bundle user? More... | |
| bool | isFnAttrDisallowedByOpBundle (Attribute::AttrKind A) const |
| Is the function attribute A disallowed by some operand bundle on this operand bundle user? More... | |
| OperandBundleUse | operandBundleFromBundleOpInfo (const BundleOpInfo &BOI) const |
| Simple helper function to map a BundleOpInfo to an OperandBundleUse. More... | |
| bundle_op_iterator | bundle_op_info_begin () |
| Return the start of the list of BundleOpInfo instances associated with this OperandBundleUser. More... | |
| const_bundle_op_iterator | bundle_op_info_begin () const |
| Return the start of the list of BundleOpInfo instances associated with this OperandBundleUser. More... | |
| bundle_op_iterator | bundle_op_info_end () |
| Return the end of the list of BundleOpInfo instances associated with this OperandBundleUser. More... | |
| const_bundle_op_iterator | bundle_op_info_end () const |
| Return the end of the list of BundleOpInfo instances associated with this OperandBundleUser. More... | |
| iterator_range < bundle_op_iterator > | bundle_op_infos () |
Return the range [bundle_op_info_begin, bundle_op_info_end). More... | |
| iterator_range < const_bundle_op_iterator > | bundle_op_infos () const |
Return the range [bundle_op_info_begin, bundle_op_info_end). More... | |
| OpIteratorTy | populateBundleOperandInfos (ArrayRef< OperandBundleDef > Bundles, const unsigned BeginIndex) |
Populate the BundleOpInfo instances and the Use& vector from Bundles. More... | |
| const BundleOpInfo & | getBundleOpInfoForOperand (unsigned OpIdx) const |
| Return the BundleOpInfo for the operand at index OpIdx. More... | |
Static Protected Member Functions | |
| static unsigned | CountBundleInputs (ArrayRef< OperandBundleDef > Bundles) |
Return the total number of values used in Bundles. More... | |
A mixin to add operand bundle functionality to llvm instruction classes.
OperandBundleUser uses the descriptor area co-allocated with the host User to store some meta information about which operands are "normal" operands, and which ones belong to some operand bundle.
The layout of an operand bundle user is
+-----------uint32_t End-------------------------------------+
| |
| +--------uint32_t Begin--------------------+ |
| | | |
^ ^ v v
|---—|---—|-—|-—|-—|-—|-—|------—|-—|------—|-—|--— | BOI0 | BOI1 | .. | DU | U0 | U1 | .. | BOI0_U0 | .. | BOI1_U0 | .. | Un |---—|---—|-—|-—|-—|-—|-—|------—|-—|------—|-—|--— v v ^ ^ | | | | | +-----—uint32_t Begin---------—+ | | | +--------—uint32_t End--------------------------—+
BOI0, BOI1 ... are descriptions of operand bundles in this User's use list. These descriptions are installed and managed by this class, and they're all instances of OperandBundleUser<T>::BundleOpInfo.
DU is an additional descriptor installed by User's 'operator new' to keep track of the 'BOI0 ... BOIN' co-allocation. OperandBundleUser does not access or modify DU in any way, it's an implementation detail private to User.
The regular Use& vector for the User starts at U0. The operand bundle uses are part of the Use& vector, just like normal uses. In the diagram above, the operand bundle uses start at BOI0_U0. Each instance of BundleOpInfo has information about a contiguous set of uses constituting an operand bundle, and the total set of operand bundle uses themselves form a contiguous set of uses (i.e. there are no gaps between uses corresponding to individual operand bundles).
This class does not know the location of the set of operand bundle uses within the use list – that is decided by the User using this class via the BeginIdx argument in populateBundleOperandInfos.
Currently operand bundle users with hung-off operands are not supported.
Definition at line 1333 of file InstrTypes.h.
|
protected |
Definition at line 1568 of file InstrTypes.h.
|
protected |
Definition at line 1569 of file InstrTypes.h.
|
inlineprotected |
Return the start of the list of BundleOpInfo instances associated with this OperandBundleUser.
Definition at line 1573 of file InstrTypes.h.
Referenced by llvm::OperandBundleUser< InvokeInst, User::op_iterator >::bundle_op_info_begin(), llvm::OperandBundleUser< InvokeInst, User::op_iterator >::bundle_op_infos(), llvm::OperandBundleUser< InvokeInst, User::op_iterator >::getBundleOperandsStartIndex(), llvm::OperandBundleUser< InvokeInst, User::op_iterator >::getNumOperandBundles(), llvm::OperandBundleUser< InvokeInst, User::op_iterator >::getOperandBundleAt(), and llvm::OperandBundleUser< InvokeInst, User::op_iterator >::hasIdenticalOperandBundleSchema().
|
inlineprotected |
Return the start of the list of BundleOpInfo instances associated with this OperandBundleUser.
Definition at line 1583 of file InstrTypes.h.
|
inlineprotected |
Return the end of the list of BundleOpInfo instances associated with this OperandBundleUser.
Definition at line 1591 of file InstrTypes.h.
Referenced by llvm::OperandBundleUser< InvokeInst, User::op_iterator >::bundle_op_info_end(), llvm::OperandBundleUser< InvokeInst, User::op_iterator >::bundle_op_infos(), llvm::OperandBundleUser< InvokeInst, User::op_iterator >::getBundleOperandsEndIndex(), llvm::OperandBundleUser< InvokeInst, User::op_iterator >::getNumOperandBundles(), and llvm::OperandBundleUser< InvokeInst, User::op_iterator >::hasIdenticalOperandBundleSchema().
|
inlineprotected |
Return the end of the list of BundleOpInfo instances associated with this OperandBundleUser.
Definition at line 1601 of file InstrTypes.h.
|
inlineprotected |
Return the range [bundle_op_info_begin, bundle_op_info_end).
Definition at line 1608 of file InstrTypes.h.
Referenced by llvm::OperandBundleUser< InvokeInst, User::op_iterator >::getBundleOpInfoForOperand(), llvm::OperandBundleUser< InvokeInst, User::op_iterator >::hasClobberingOperandBundles(), and llvm::OperandBundleUser< InvokeInst, User::op_iterator >::populateBundleOperandInfos().
|
inlineprotected |
Return the range [bundle_op_info_begin, bundle_op_info_end).
Definition at line 1613 of file InstrTypes.h.
|
inline |
Return true if the bundle operand at index OpIdx has the attribute A.
Definition at line 1481 of file InstrTypes.h.
Referenced by llvm::CallInst::dataOperandHasImpliedAttr().
|
inlinestaticprotected |
Return the total number of values used in Bundles.
Definition at line 1661 of file InstrTypes.h.
Referenced by llvm::CallInst::Create().
|
inline |
Return the number of operand bundles with the tag Name attached to this instruction.
Definition at line 1382 of file InstrTypes.h.
Referenced by llvm::OperandBundleUser< InvokeInst, User::op_iterator >::getOperandBundle().
|
inline |
Return the number of operand bundles with the tag ID attached to this instruction.
Definition at line 1393 of file InstrTypes.h.
|
inline |
Return the index of the last bundle operand in the Use array.
Definition at line 1350 of file InstrTypes.h.
Referenced by llvm::OperandBundleUser< InvokeInst, User::op_iterator >::getNumTotalBundleOperands(), and llvm::OperandBundleUser< InvokeInst, User::op_iterator >::isBundleOperand().
|
inline |
Return the index of the first bundle operand in the Use array.
Definition at line 1344 of file InstrTypes.h.
Referenced by llvm::CallInst::dataOperandHasImpliedAttr(), llvm::OperandBundleUser< InvokeInst, User::op_iterator >::getNumTotalBundleOperands(), and llvm::OperandBundleUser< InvokeInst, User::op_iterator >::isBundleOperand().
|
inlineprotected |
Return the BundleOpInfo for the operand at index OpIdx.
It is an error to call this with an OpIdx that does not correspond to an bundle operand.
Definition at line 1652 of file InstrTypes.h.
Referenced by llvm::OperandBundleUser< InvokeInst, User::op_iterator >::bundleOperandHasAttr(), and llvm::OperandBundleUser< InvokeInst, User::op_iterator >::getOperandBundleForOperand().
|
inline |
Return the number of operand bundles associated with this User.
Definition at line 1336 of file InstrTypes.h.
Referenced by llvm::CallInst::cloneImpl(), llvm::OperandBundleUser< InvokeInst, User::op_iterator >::countOperandBundlesOfType(), llvm::OperandBundleUser< InvokeInst, User::op_iterator >::getOperandBundle(), llvm::OperandBundleUser< InvokeInst, User::op_iterator >::getOperandBundleAt(), llvm::OperandBundleUser< InvokeInst, User::op_iterator >::getOperandBundlesAsDefs(), llvm::OperandBundleUser< InvokeInst, User::op_iterator >::hasIdenticalOperandBundleSchema(), llvm::OperandBundleUser< InvokeInst, User::op_iterator >::hasOperandBundles(), and llvm::OperandBundleUser< InvokeInst, User::op_iterator >::hasOperandBundlesOtherThan().
|
inline |
Return the total number operands (not operand bundles) used by every operand bundle in this OperandBundleUser.
Definition at line 1363 of file InstrTypes.h.
Referenced by llvm::CallInst::arg_end(), and llvm::CallInst::getNumArgOperands().
|
inline |
Return an operand bundle by name, if present.
It is an error to call this for operand bundle types that may have multiple instances of them on the same instruction.
Definition at line 1406 of file InstrTypes.h.
Referenced by HandleCallsInBlockInlinedThroughInvoke(), and MakeGuardControlFlowExplicit().
|
inline |
Return an operand bundle by tag ID, if present.
It is an error to call this for operand bundle types that may have multiple instances of them on the same instruction.
Definition at line 1422 of file InstrTypes.h.
|
inline |
Return the operand bundle at a specific index.
Definition at line 1375 of file InstrTypes.h.
Referenced by llvm::OperandBundleUser< InvokeInst, User::op_iterator >::countOperandBundlesOfType(), llvm::OperandBundleUser< InvokeInst, User::op_iterator >::getOperandBundle(), llvm::OperandBundleUser< InvokeInst, User::op_iterator >::getOperandBundlesAsDefs(), and llvm::OperandBundleUser< InvokeInst, User::op_iterator >::hasOperandBundlesOtherThan().
|
inline |
Return the operand bundle for the operand at index OpIdx.
It is an error to call this with an OpIdx that does not correspond to an bundle operand.
Definition at line 1450 of file InstrTypes.h.
|
inline |
Return the list of operand bundles attached to this instruction as a vector of OperandBundleDefs.
This function copies the OperandBundeUse instances associated with this OperandBundleUser to a vector of OperandBundleDefs. Note: OperandBundeUses and OperandBundleDefs are non-trivially different representations of operand bundles (see documentation above).
Definition at line 1441 of file InstrTypes.h.
Referenced by changeToCall(), llvm::changeToInvokeAndSplitBasicBlock(), llvm::InlineFunction(), llvm::FortifiedLibCallSimplifier::optimizeCall(), llvm::LibCallSimplifier::optimizeCall(), PerformHeapAllocSRoA(), tryToOptimizeStoreOfMallocToGlobal(), and llvm::InstCombiner::visitFPTrunc().
|
inline |
Return true if this operand bundle user has operand bundles that may write to the heap.
Definition at line 1465 of file InstrTypes.h.
Referenced by llvm::OperandBundleUser< InvokeInst, User::op_iterator >::isFnAttrDisallowedByOpBundle().
|
inline |
Return true if Other has the same sequence of operand bundle tags with the same number of operands on each one of them as this OperandBundleUser.
Definition at line 1490 of file InstrTypes.h.
|
inline |
Return true if this User has any operand bundles.
Definition at line 1341 of file InstrTypes.h.
Referenced by llvm::CallInst::cloneImpl(), llvm::CallInst::dataOperandHasImpliedAttr(), llvm::OperandBundleUser< InvokeInst, User::op_iterator >::getBundleOperandsEndIndex(), llvm::OperandBundleUser< InvokeInst, User::op_iterator >::getBundleOperandsStartIndex(), llvm::OperandBundleUser< InvokeInst, User::op_iterator >::getNumTotalBundleOperands(), llvm::OperandBundleUser< InvokeInst, User::op_iterator >::hasReadingOperandBundles(), llvm::OperandBundleUser< InvokeInst, User::op_iterator >::isBundleOperand(), and markTails().
|
inline |
Return true if this operand bundle user contains operand bundles with tags other than those specified in IDs.
Definition at line 1501 of file InstrTypes.h.
|
inline |
Return true if this operand bundle user has operand bundles that may read from the heap.
Definition at line 1456 of file InstrTypes.h.
Referenced by llvm::OperandBundleUser< InvokeInst, User::op_iterator >::isFnAttrDisallowedByOpBundle().
|
inline |
Return true if the operand at index Idx is a bundle operand.
Definition at line 1356 of file InstrTypes.h.
|
inlineprotected |
Is the function attribute S disallowed by some operand bundle on this operand bundle user?
Definition at line 1513 of file InstrTypes.h.
|
inlineprotected |
Is the function attribute A disallowed by some operand bundle on this operand bundle user?
Definition at line 1521 of file InstrTypes.h.
|
inlineprotected |
Simple helper function to map a BundleOpInfo to an OperandBundleUse.
Definition at line 1562 of file InstrTypes.h.
Referenced by llvm::OperandBundleUser< InvokeInst, User::op_iterator >::bundleOperandHasAttr(), llvm::OperandBundleUser< InvokeInst, User::op_iterator >::getOperandBundleAt(), and llvm::OperandBundleUser< InvokeInst, User::op_iterator >::getOperandBundleForOperand().
|
inlineprotected |
Populate the BundleOpInfo instances and the Use& vector from Bundles.
Return the op_iterator pointing to the Use& one past the last last bundle operand use.
Each OperandBundleDef instance is tracked by a OperandBundleInfo instance allocated in this User's descriptor.
Definition at line 1623 of file InstrTypes.h.
1.8.6