LLVM 22.0.0git
Public Types | Public Member Functions | List of all members
llvm::sandboxir::Interval< T > Class Template Reference

#include "llvm/Transforms/Vectorize/SandboxVectorizer/Interval.h"

Inheritance diagram for llvm::sandboxir::Interval< T >:
[legend]

Public Types

using iterator = IntervalIterator< T, Interval >
 

Public Member Functions

 Interval ()
 
 Interval (T *Top, T *Bottom)
 
 Interval (ArrayRef< T * > Elems)
 
bool empty () const
 
bool contains (T *I) const
 
bool touches (T *Elm) const
 \Returns true if Elm is right before the top or right after the bottom.
 
Ttop () const
 
Tbottom () const
 
iterator begin ()
 
iterator end ()
 
iterator begin () const
 
iterator end () const
 
bool operator== (const Interval &Other) const
 Equality.
 
bool operator!= (const Interval &Other) const
 Inequality.
 
bool comesBefore (const Interval &Other) const
 \Returns true if this interval comes before Other in program order.
 
bool disjoint (const Interval &Other) const
 \Returns true if this and Other have nothing in common.
 
Interval intersection (const Interval &Other) const
 \Returns the intersection between this and Other.
 
SmallVector< Interval, 2 > operator- (const Interval &Other)
 Difference operation. This returns up to two intervals.
 
Interval getSingleDiff (const Interval &Other)
 \Returns the interval difference this - Other.
 
Interval getUnionInterval (const Interval &Other)
 \Returns a single interval that spans across both this and Other.
 
template<typename HelperT = T>
std::enable_if_t< std::is_same< HelperT, Instruction >::value, void > notifyMoveInstr (HelperT *I, decltype(I->getIterator()) BeforeIt)
 Update the interval when I is about to be moved before Before.
 
void print (raw_ostream &OS) const
 
LLVM_DUMP_METHOD void dump () const
 

Detailed Description

template<typename T>
class llvm::sandboxir::Interval< T >

Definition at line 79 of file Interval.h.

Member Typedef Documentation

◆ iterator

template<typename T >
using llvm::sandboxir::Interval< T >::iterator = IntervalIterator<T, Interval>

Definition at line 119 of file Interval.h.

Constructor & Destructor Documentation

◆ Interval() [1/3]

template<typename T >
llvm::sandboxir::Interval< T >::Interval ( )
inline

◆ Interval() [2/3]

template<typename T >
llvm::sandboxir::Interval< T >::Interval ( T Top,
T Bottom 
)
inline

Definition at line 85 of file Interval.h.

References assert().

◆ Interval() [3/3]

template<typename T >
llvm::sandboxir::Interval< T >::Interval ( ArrayRef< T * >  Elems)
inline

Definition at line 89 of file Interval.h.

References assert(), llvm::drop_begin(), llvm::ArrayRef< T >::empty(), and I.

Member Function Documentation

◆ begin() [1/2]

template<typename T >
iterator llvm::sandboxir::Interval< T >::begin ( )
inline

Definition at line 120 of file Interval.h.

◆ begin() [2/2]

template<typename T >
iterator llvm::sandboxir::Interval< T >::begin ( ) const
inline

Definition at line 124 of file Interval.h.

◆ bottom()

template<typename T >
T * llvm::sandboxir::Interval< T >::bottom ( ) const
inline

◆ comesBefore()

template<typename T >
bool llvm::sandboxir::Interval< T >::comesBefore ( const Interval< T > &  Other) const
inline

\Returns true if this interval comes before Other in program order.

This expects disjoint intervals.

Definition at line 139 of file Interval.h.

References assert(), llvm::sandboxir::Interval< T >::bottom(), llvm::sandboxir::Interval< T >::disjoint(), and llvm::Other.

◆ contains()

template<typename T >
bool llvm::sandboxir::Interval< T >::contains ( T I) const
inline

◆ disjoint()

template<typename T >
bool llvm::sandboxir::Interval< T >::disjoint ( const Interval< T > &  Other) const

\Returns true if this and Other have nothing in common.

Definition at line 17 of file Interval.cpp.

References llvm::Other.

Referenced by llvm::sandboxir::Interval< T >::comesBefore(), and llvm::sandboxir::Interval< T >::operator-().

◆ dump()

template<typename T >
void llvm::sandboxir::Interval< T >::dump

Definition at line 43 of file Interval.cpp.

References llvm::dbgs(), and llvm::print().

◆ empty()

template<typename T >
bool llvm::sandboxir::Interval< T >::empty ( ) const
inline

◆ end() [1/2]

template<typename T >
iterator llvm::sandboxir::Interval< T >::end ( )
inline

Definition at line 121 of file Interval.h.

◆ end() [2/2]

template<typename T >
iterator llvm::sandboxir::Interval< T >::end ( ) const
inline

Definition at line 127 of file Interval.h.

◆ getSingleDiff()

template<typename T >
Interval llvm::sandboxir::Interval< T >::getSingleDiff ( const Interval< T > &  Other)
inline

\Returns the interval difference this - Other.

This will crash in Debug if the result is not a single interval.

Definition at line 191 of file Interval.h.

References assert(), and llvm::Other.

◆ getUnionInterval()

template<typename T >
Interval llvm::sandboxir::Interval< T >::getUnionInterval ( const Interval< T > &  Other)
inline

\Returns a single interval that spans across both this and Other.

Definition at line 201 of file Interval.h.

References llvm::sandboxir::Interval< T >::empty(), and llvm::Other.

◆ intersection()

template<typename T >
Interval llvm::sandboxir::Interval< T >::intersection ( const Interval< T > &  Other) const
inline

\Returns the intersection between this and Other.

Definition at line 150 of file Interval.h.

References llvm::sandboxir::Interval< T >::empty(), llvm::sandboxir::Interval< T >::Interval(), and llvm::Other.

Referenced by llvm::sandboxir::Interval< T >::operator-().

◆ notifyMoveInstr()

template<typename T >
template<typename HelperT = T>
std::enable_if_t< std::is_same< HelperT, Instruction >::value, void > llvm::sandboxir::Interval< T >::notifyMoveInstr ( HelperT *  I,
decltype(I->getIterator())  BeforeIt 
)
inline

Update the interval when I is about to be moved before Before.

Definition at line 215 of file Interval.h.

References assert(), llvm::sandboxir::Interval< T >::contains(), and I.

◆ operator!=()

template<typename T >
bool llvm::sandboxir::Interval< T >::operator!= ( const Interval< T > &  Other) const
inline

Inequality.

Definition at line 136 of file Interval.h.

References llvm::Other.

◆ operator-()

template<typename T >
SmallVector< Interval, 2 > llvm::sandboxir::Interval< T >::operator- ( const Interval< T > &  Other)
inline

Difference operation. This returns up to two intervals.

Definition at line 172 of file Interval.h.

References llvm::sandboxir::Interval< T >::disjoint(), llvm::sandboxir::Interval< T >::intersection(), llvm::sandboxir::Interval< T >::Interval(), and llvm::Other.

◆ operator==()

template<typename T >
bool llvm::sandboxir::Interval< T >::operator== ( const Interval< T > &  Other) const
inline

Equality.

Definition at line 132 of file Interval.h.

References llvm::Other.

◆ print()

template<typename T >
void llvm::sandboxir::Interval< T >::print ( raw_ostream OS) const

Definition at line 26 of file Interval.cpp.

References OS.

◆ top()

template<typename T >
T * llvm::sandboxir::Interval< T >::top ( ) const
inline

◆ touches()

template<typename T >
bool llvm::sandboxir::Interval< T >::touches ( T Elm) const
inline

\Returns true if Elm is right before the top or right after the bottom.

Definition at line 113 of file Interval.h.


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