LLVM 20.0.0git
Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
llvm::MachineInstrBundleIterator< Ty, IsReverse > Class Template Reference

MachineBasicBlock iterator that automatically skips over MIs that are inside bundles (i.e. More...

#include "llvm/CodeGen/MachineInstrBundleIterator.h"

Inheritance diagram for llvm::MachineInstrBundleIterator< Ty, IsReverse >:
Inheritance graph
[legend]

Public Types

using value_type = typename instr_iterator::value_type
 
using difference_type = typename instr_iterator::difference_type
 
using pointer = typename instr_iterator::pointer
 
using reference = typename instr_iterator::reference
 
using const_pointer = typename instr_iterator::const_pointer
 
using const_reference = typename instr_iterator::const_reference
 
using iterator_category = std::bidirectional_iterator_tag
 

Public Member Functions

 MachineInstrBundleIterator (instr_iterator MI)
 
 MachineInstrBundleIterator (reference MI)
 
 MachineInstrBundleIterator (pointer MI)
 
template<class OtherTy >
 MachineInstrBundleIterator (const MachineInstrBundleIterator< OtherTy, IsReverse > &I, std::enable_if_t< std::is_convertible< OtherTy *, Ty * >::value, void * >=nullptr)
 
 MachineInstrBundleIterator ()
 
 MachineInstrBundleIterator (const MachineInstrBundleIterator< Ty, !IsReverse > &I)
 Explicit conversion between forward/reverse iterators.
 
reference operator* () const
 
pointer operator-> () const
 
bool isValid () const
 Check for null.
 
MachineInstrBundleIteratoroperator-- ()
 
MachineInstrBundleIteratoroperator++ ()
 
MachineInstrBundleIterator operator-- (int)
 
MachineInstrBundleIterator operator++ (int)
 
instr_iterator getInstrIterator () const
 
nonconst_iterator getNonConstIterator () const
 
reverse_iterator getReverse () const
 Get a reverse iterator to the same node.
 

Static Public Member Functions

static MachineInstrBundleIterator getAtBundleBegin (instr_iterator MI)
 Get the bundle iterator for the given instruction's bundle.
 

Friends

bool operator== (const MachineInstrBundleIterator &L, const MachineInstrBundleIterator &R)
 
bool operator== (const MachineInstrBundleIterator &L, const const_instr_iterator &R)
 
bool operator== (const const_instr_iterator &L, const MachineInstrBundleIterator &R)
 
bool operator== (const MachineInstrBundleIterator &L, const nonconst_instr_iterator &R)
 
bool operator== (const nonconst_instr_iterator &L, const MachineInstrBundleIterator &R)
 
bool operator== (const MachineInstrBundleIterator &L, const_pointer R)
 
bool operator== (const_pointer L, const MachineInstrBundleIterator &R)
 
bool operator== (const MachineInstrBundleIterator &L, const_reference R)
 
bool operator== (const_reference L, const MachineInstrBundleIterator &R)
 
bool operator!= (const MachineInstrBundleIterator &L, const MachineInstrBundleIterator &R)
 
bool operator!= (const MachineInstrBundleIterator &L, const const_instr_iterator &R)
 
bool operator!= (const const_instr_iterator &L, const MachineInstrBundleIterator &R)
 
bool operator!= (const MachineInstrBundleIterator &L, const nonconst_instr_iterator &R)
 
bool operator!= (const nonconst_instr_iterator &L, const MachineInstrBundleIterator &R)
 
bool operator!= (const MachineInstrBundleIterator &L, const_pointer R)
 
bool operator!= (const_pointer L, const MachineInstrBundleIterator &R)
 
bool operator!= (const MachineInstrBundleIterator &L, const_reference R)
 
bool operator!= (const_reference L, const MachineInstrBundleIterator &R)
 

Detailed Description

template<typename Ty, bool IsReverse = false>
class llvm::MachineInstrBundleIterator< Ty, IsReverse >

MachineBasicBlock iterator that automatically skips over MIs that are inside bundles (i.e.

walk top level MIs only).

Definition at line 108 of file MachineInstrBundleIterator.h.

Member Typedef Documentation

◆ const_pointer

template<typename Ty , bool IsReverse = false>
using llvm::MachineInstrBundleIterator< Ty, IsReverse >::const_pointer = typename instr_iterator::const_pointer

Definition at line 119 of file MachineInstrBundleIterator.h.

◆ const_reference

template<typename Ty , bool IsReverse = false>
using llvm::MachineInstrBundleIterator< Ty, IsReverse >::const_reference = typename instr_iterator::const_reference

Definition at line 120 of file MachineInstrBundleIterator.h.

◆ difference_type

template<typename Ty , bool IsReverse = false>
using llvm::MachineInstrBundleIterator< Ty, IsReverse >::difference_type = typename instr_iterator::difference_type

Definition at line 116 of file MachineInstrBundleIterator.h.

◆ iterator_category

template<typename Ty , bool IsReverse = false>
using llvm::MachineInstrBundleIterator< Ty, IsReverse >::iterator_category = std::bidirectional_iterator_tag

Definition at line 121 of file MachineInstrBundleIterator.h.

◆ pointer

template<typename Ty , bool IsReverse = false>
using llvm::MachineInstrBundleIterator< Ty, IsReverse >::pointer = typename instr_iterator::pointer

Definition at line 117 of file MachineInstrBundleIterator.h.

◆ reference

template<typename Ty , bool IsReverse = false>
using llvm::MachineInstrBundleIterator< Ty, IsReverse >::reference = typename instr_iterator::reference

Definition at line 118 of file MachineInstrBundleIterator.h.

◆ value_type

template<typename Ty , bool IsReverse = false>
using llvm::MachineInstrBundleIterator< Ty, IsReverse >::value_type = typename instr_iterator::value_type

Definition at line 115 of file MachineInstrBundleIterator.h.

Constructor & Destructor Documentation

◆ MachineInstrBundleIterator() [1/6]

template<typename Ty , bool IsReverse = false>
llvm::MachineInstrBundleIterator< Ty, IsReverse >::MachineInstrBundleIterator ( instr_iterator  MI)
inline

Definition at line 132 of file MachineInstrBundleIterator.h.

References assert(), and MI.

◆ MachineInstrBundleIterator() [2/6]

template<typename Ty , bool IsReverse = false>
llvm::MachineInstrBundleIterator< Ty, IsReverse >::MachineInstrBundleIterator ( reference  MI)
inline

Definition at line 138 of file MachineInstrBundleIterator.h.

References assert(), and MI.

◆ MachineInstrBundleIterator() [3/6]

template<typename Ty , bool IsReverse = false>
llvm::MachineInstrBundleIterator< Ty, IsReverse >::MachineInstrBundleIterator ( pointer  MI)
inline

Definition at line 144 of file MachineInstrBundleIterator.h.

References assert(), and MI.

◆ MachineInstrBundleIterator() [4/6]

template<typename Ty , bool IsReverse = false>
template<class OtherTy >
llvm::MachineInstrBundleIterator< Ty, IsReverse >::MachineInstrBundleIterator ( const MachineInstrBundleIterator< OtherTy, IsReverse > &  I,
std::enable_if_t< std::is_convertible< OtherTy *, Ty * >::value, void * >  = nullptr 
)
inline

Definition at line 153 of file MachineInstrBundleIterator.h.

◆ MachineInstrBundleIterator() [5/6]

template<typename Ty , bool IsReverse = false>
llvm::MachineInstrBundleIterator< Ty, IsReverse >::MachineInstrBundleIterator ( )
inline

Definition at line 159 of file MachineInstrBundleIterator.h.

◆ MachineInstrBundleIterator() [6/6]

template<typename Ty , bool IsReverse = false>
llvm::MachineInstrBundleIterator< Ty, IsReverse >::MachineInstrBundleIterator ( const MachineInstrBundleIterator< Ty, !IsReverse > &  I)
inlineexplicit

Explicit conversion between forward/reverse iterators.

Translate between forward and reverse iterators without changing range boundaries. The resulting iterator will dereference (and have a handle) to the previous node, which is somewhat unexpected; but converting the two endpoints in a range will give the same range in reverse.

This matches std::reverse_iterator conversions.

Definition at line 169 of file MachineInstrBundleIterator.h.

Member Function Documentation

◆ getAtBundleBegin()

template<typename Ty , bool IsReverse = false>
static MachineInstrBundleIterator llvm::MachineInstrBundleIterator< Ty, IsReverse >::getAtBundleBegin ( instr_iterator  MI)
inlinestatic

Get the bundle iterator for the given instruction's bundle.

Definition at line 174 of file MachineInstrBundleIterator.h.

References MI.

Referenced by llvm::MachineBasicBlock::rbegin().

◆ getInstrIterator()

template<typename Ty , bool IsReverse = false>
instr_iterator llvm::MachineInstrBundleIterator< Ty, IsReverse >::getInstrIterator ( ) const
inline

◆ getNonConstIterator()

template<typename Ty , bool IsReverse = false>
nonconst_iterator llvm::MachineInstrBundleIterator< Ty, IsReverse >::getNonConstIterator ( ) const
inline

Definition at line 276 of file MachineInstrBundleIterator.h.

Referenced by nextIfDebug(), and priorNonDebug().

◆ getReverse()

template<typename Ty , bool IsReverse = false>
reverse_iterator llvm::MachineInstrBundleIterator< Ty, IsReverse >::getReverse ( ) const
inline

Get a reverse iterator to the same node.

Gives a reverse iterator that will dereference (and have a handle) to the same node. Converting the endpoint iterators in a range will give a different range; for range operations, use the explicit conversions.

Definition at line 283 of file MachineInstrBundleIterator.h.

References llvm::MachineInstrBundleIterator< Ty, IsReverse >::getReverse().

Referenced by llvm::LoongArchInstrInfo::analyzeBranch(), llvm::RISCVInstrInfo::analyzeBranch(), llvm::CSKYInstrInfo::analyzeBranch(), areCFlagsAccessedBetweenInstrs(), FindLastAluClause(), getLiveOutRegsAt(), llvm::MachineInstrBundleIterator< Ty, IsReverse >::getReverse(), performCopyPropagation(), and llvm::MachineBasicBlock::splitAt().

◆ isValid()

template<typename Ty , bool IsReverse = false>
bool llvm::MachineInstrBundleIterator< Ty, IsReverse >::isValid ( ) const
inline

Check for null.

Definition at line 182 of file MachineInstrBundleIterator.h.

Referenced by llvm::FastISel::removeDeadCode().

◆ operator*()

template<typename Ty , bool IsReverse = false>
reference llvm::MachineInstrBundleIterator< Ty, IsReverse >::operator* ( ) const
inline

◆ operator++() [1/2]

template<typename Ty , bool IsReverse = false>
MachineInstrBundleIterator & llvm::MachineInstrBundleIterator< Ty, IsReverse >::operator++ ( )
inline

Definition at line 259 of file MachineInstrBundleIterator.h.

◆ operator++() [2/2]

template<typename Ty , bool IsReverse = false>
MachineInstrBundleIterator llvm::MachineInstrBundleIterator< Ty, IsReverse >::operator++ ( int  )
inline

Definition at line 268 of file MachineInstrBundleIterator.h.

◆ operator--() [1/2]

template<typename Ty , bool IsReverse = false>
MachineInstrBundleIterator & llvm::MachineInstrBundleIterator< Ty, IsReverse >::operator-- ( )
inline

Definition at line 255 of file MachineInstrBundleIterator.h.

◆ operator--() [2/2]

template<typename Ty , bool IsReverse = false>
MachineInstrBundleIterator llvm::MachineInstrBundleIterator< Ty, IsReverse >::operator-- ( int  )
inline

Definition at line 263 of file MachineInstrBundleIterator.h.

◆ operator->()

template<typename Ty , bool IsReverse = false>
pointer llvm::MachineInstrBundleIterator< Ty, IsReverse >::operator-> ( ) const
inline

Friends And Related Function Documentation

◆ operator!= [1/9]

template<typename Ty , bool IsReverse = false>
bool operator!= ( const const_instr_iterator &  L,
const MachineInstrBundleIterator< Ty, IsReverse > &  R 
)
friend

Definition at line 227 of file MachineInstrBundleIterator.h.

◆ operator!= [2/9]

template<typename Ty , bool IsReverse = false>
bool operator!= ( const MachineInstrBundleIterator< Ty, IsReverse > &  L,
const const_instr_iterator &  R 
)
friend

Definition at line 223 of file MachineInstrBundleIterator.h.

◆ operator!= [3/9]

template<typename Ty , bool IsReverse = false>
bool operator!= ( const MachineInstrBundleIterator< Ty, IsReverse > &  L,
const MachineInstrBundleIterator< Ty, IsReverse > &  R 
)
friend

Definition at line 219 of file MachineInstrBundleIterator.h.

◆ operator!= [4/9]

template<typename Ty , bool IsReverse = false>
bool operator!= ( const MachineInstrBundleIterator< Ty, IsReverse > &  L,
const nonconst_instr_iterator &  R 
)
friend

Definition at line 231 of file MachineInstrBundleIterator.h.

◆ operator!= [5/9]

template<typename Ty , bool IsReverse = false>
bool operator!= ( const MachineInstrBundleIterator< Ty, IsReverse > &  L,
const_pointer  R 
)
friend

Definition at line 239 of file MachineInstrBundleIterator.h.

◆ operator!= [6/9]

template<typename Ty , bool IsReverse = false>
bool operator!= ( const MachineInstrBundleIterator< Ty, IsReverse > &  L,
const_reference  R 
)
friend

Definition at line 245 of file MachineInstrBundleIterator.h.

◆ operator!= [7/9]

template<typename Ty , bool IsReverse = false>
bool operator!= ( const nonconst_instr_iterator &  L,
const MachineInstrBundleIterator< Ty, IsReverse > &  R 
)
friend

Definition at line 235 of file MachineInstrBundleIterator.h.

◆ operator!= [8/9]

template<typename Ty , bool IsReverse = false>
bool operator!= ( const_pointer  L,
const MachineInstrBundleIterator< Ty, IsReverse > &  R 
)
friend

Definition at line 242 of file MachineInstrBundleIterator.h.

◆ operator!= [9/9]

template<typename Ty , bool IsReverse = false>
bool operator!= ( const_reference  L,
const MachineInstrBundleIterator< Ty, IsReverse > &  R 
)
friend

Definition at line 249 of file MachineInstrBundleIterator.h.

◆ operator== [1/9]

template<typename Ty , bool IsReverse = false>
bool operator== ( const const_instr_iterator &  L,
const MachineInstrBundleIterator< Ty, IsReverse > &  R 
)
friend

Definition at line 192 of file MachineInstrBundleIterator.h.

◆ operator== [2/9]

template<typename Ty , bool IsReverse = false>
bool operator== ( const MachineInstrBundleIterator< Ty, IsReverse > &  L,
const const_instr_iterator &  R 
)
friend

Definition at line 188 of file MachineInstrBundleIterator.h.

◆ operator== [3/9]

template<typename Ty , bool IsReverse = false>
bool operator== ( const MachineInstrBundleIterator< Ty, IsReverse > &  L,
const MachineInstrBundleIterator< Ty, IsReverse > &  R 
)
friend

Definition at line 184 of file MachineInstrBundleIterator.h.

◆ operator== [4/9]

template<typename Ty , bool IsReverse = false>
bool operator== ( const MachineInstrBundleIterator< Ty, IsReverse > &  L,
const nonconst_instr_iterator &  R 
)
friend

Definition at line 196 of file MachineInstrBundleIterator.h.

◆ operator== [5/9]

template<typename Ty , bool IsReverse = false>
bool operator== ( const MachineInstrBundleIterator< Ty, IsReverse > &  L,
const_pointer  R 
)
friend

Definition at line 204 of file MachineInstrBundleIterator.h.

◆ operator== [6/9]

template<typename Ty , bool IsReverse = false>
bool operator== ( const MachineInstrBundleIterator< Ty, IsReverse > &  L,
const_reference  R 
)
friend

Definition at line 210 of file MachineInstrBundleIterator.h.

◆ operator== [7/9]

template<typename Ty , bool IsReverse = false>
bool operator== ( const nonconst_instr_iterator &  L,
const MachineInstrBundleIterator< Ty, IsReverse > &  R 
)
friend

Definition at line 200 of file MachineInstrBundleIterator.h.

◆ operator== [8/9]

template<typename Ty , bool IsReverse = false>
bool operator== ( const_pointer  L,
const MachineInstrBundleIterator< Ty, IsReverse > &  R 
)
friend

Definition at line 207 of file MachineInstrBundleIterator.h.

◆ operator== [9/9]

template<typename Ty , bool IsReverse = false>
bool operator== ( const_reference  L,
const MachineInstrBundleIterator< Ty, IsReverse > &  R 
)
friend

Definition at line 214 of file MachineInstrBundleIterator.h.


The documentation for this class was generated from the following file: