LLVM 22.0.0git
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]

◆ 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(), and T.

◆ 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.

References Interval().

◆ 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(), bottom(), disjoint(), Interval(), and llvm::Other.

◆ contains()

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

Definition at line 106 of file Interval.h.

References empty(), I, and T.

Referenced by notifyMoveInstr().

◆ 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::sandboxir::empty(), Interval(), and llvm::Other.

Referenced by comesBefore(), and operator-().

◆ dump()

template<typename T>
void llvm::sandboxir::Interval< T >::dump ( ) const

Definition at line 43 of file Interval.cpp.

References llvm::dbgs(), Interval(), 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.

References Interval().

◆ 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(), Interval(), 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 empty(), Interval(), 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 empty(), Interval(), and llvm::Other.

Referenced by 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(), contains(), I, and T.

◆ 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 Interval(), and 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 disjoint(), intersection(), 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 Interval(), and 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 bottom(), Interval(), and top().

◆ 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.

References T.


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