LLVM 20.0.0git
|
A set of candidate Instructions for vectorizing together. More...
#include "llvm/Transforms/Vectorize/SandboxVectorizer/SeedCollector.h"
Public Types | |
using | iterator = SmallVector< Instruction * >::iterator |
using | const_iterator = SmallVector< Instruction * >::const_iterator |
Public Member Functions | |
SeedBundle (Instruction *I) | |
Initialize a bundle with I . | |
SeedBundle (SmallVector< Instruction * > &&L) | |
SeedBundle (const SeedBundle &)=delete | |
No need to allow copies. | |
SeedBundle & | operator= (const SeedBundle &)=delete |
virtual | ~SeedBundle () |
iterator | begin () |
iterator | end () |
const_iterator | begin () const |
const_iterator | end () const |
Instruction * | operator[] (unsigned Idx) const |
void | insertAt (iterator Pos, Instruction *I) |
Insert I into position P . | |
virtual void | insert (Instruction *I, ScalarEvolution &SE)=0 |
unsigned | getFirstUnusedElementIdx () const |
void | setUsed (Instruction *I) |
Marks instruction I "used" within the bundle. | |
void | setUsed (unsigned ElementIdx, unsigned Sz=1, bool VerifyUnused=true) |
bool | isUsed (unsigned Element) const |
\Returns whether or not Element has been used. | |
bool | allUsed () const |
unsigned | getNumUnusedBits () const |
MutableArrayRef< Instruction * > | getSlice (unsigned StartIdx, unsigned MaxVecRegBits, bool ForcePowOf2) |
\Returns a slice of seed elements, starting at the element StartIdx , with a total size <= MaxVecRegBits , or an empty slice if the requirements cannot be met . | |
std::size_t | size () const |
\Returns the number of seed elements in the bundle. | |
void | dump (raw_ostream &OS) const |
LLVM_DUMP_METHOD void | dump () const |
Protected Attributes | |
SmallVector< Instruction * > | Seeds |
BitVector | UsedLanes |
The lanes that we have already vectorized. | |
unsigned | UsedLaneCount = 0 |
Tracks used lanes for constant-time accessor. | |
unsigned | NumUnusedBits = 0 |
Tracks the remaining bits available to vectorize. | |
A set of candidate Instructions for vectorizing together.
Definition at line 27 of file SeedCollector.h.
Definition at line 41 of file SeedCollector.h.
using llvm::sandboxir::SeedBundle::iterator = SmallVector<Instruction *>::iterator |
Definition at line 40 of file SeedCollector.h.
|
inlineexplicit |
Initialize a bundle with I
.
Definition at line 30 of file SeedCollector.h.
References begin(), I, and insertAt().
|
inlineexplicit |
Definition at line 31 of file SeedCollector.h.
References llvm::sandboxir::Utils::getNumBits(), NumUnusedBits, and Seeds.
|
delete |
No need to allow copies.
|
inlinevirtual |
Definition at line 38 of file SeedCollector.h.
|
inline |
Definition at line 91 of file SeedCollector.h.
References Seeds, and UsedLaneCount.
|
inline |
Definition at line 42 of file SeedCollector.h.
References Seeds.
Referenced by llvm::sandboxir::MemSeedBundle< LoadOrStoreT >::insert(), SeedBundle(), and setUsed().
|
inline |
Definition at line 44 of file SeedCollector.h.
References Seeds.
|
inline |
Definition at line 125 of file SeedCollector.h.
References llvm::dbgs(), and dump().
Referenced by dump().
|
inline |
Definition at line 115 of file SeedCollector.h.
References llvm::enumerate(), I, isUsed(), and OS.
|
inline |
Definition at line 43 of file SeedCollector.h.
References Seeds.
Referenced by llvm::sandboxir::MemSeedBundle< LoadOrStoreT >::insert(), and setUsed().
|
inline |
Definition at line 45 of file SeedCollector.h.
References Seeds.
|
inline |
Definition at line 59 of file SeedCollector.h.
|
inline |
Definition at line 92 of file SeedCollector.h.
References NumUnusedBits.
MutableArrayRef< Instruction * > llvm::sandboxir::SeedBundle::getSlice | ( | unsigned | StartIdx, |
unsigned | MaxVecRegBits, | ||
bool | ForcePowOf2 | ||
) |
\Returns a slice of seed elements, starting at the element StartIdx
, with a total size <= MaxVecRegBits
, or an empty slice if the requirements cannot be met .
If ForcePowOf2
is true, then the returned slice will have a total number of bits that is a power of 2.
Definition at line 34 of file SeedCollector.cpp.
References assert(), llvm::sandboxir::Utils::getNumBits(), llvm::isPowerOf2_32(), isUsed(), llvm::make_range(), and Seeds.
|
pure virtual |
Implemented in llvm::sandboxir::MemSeedBundle< LoadOrStoreT >.
|
inline |
Insert I
into position P
.
Clients should choose Pos by symbol, symbol-offset, and program order (which depends if scheduling bottom-up or top-down).
Definition at line 52 of file SeedCollector.h.
References llvm::sandboxir::Utils::getNumBits(), I, NumUnusedBits, and Seeds.
Referenced by llvm::sandboxir::MemSeedBundle< LoadOrStoreT >::insert(), and SeedBundle().
\Returns whether or not Element
has been used.
Definition at line 88 of file SeedCollector.h.
References llvm::BitVector::size(), llvm::BitVector::test(), and UsedLanes.
Referenced by dump(), getFirstUnusedElementIdx(), and getSlice().
|
delete |
|
inline |
Definition at line 47 of file SeedCollector.h.
|
inline |
Marks instruction I
"used" within the bundle.
Clients use this property when assembling a vectorized instruction from the seeds in a bundle. This allows constant time evaluation and "removal" from the list.
Definition at line 69 of file SeedCollector.h.
References assert(), begin(), end(), I, Idx, and setUsed().
Referenced by llvm::sandboxir::SeedContainer::erase(), and setUsed().
|
inline |
Definition at line 76 of file SeedCollector.h.
References assert(), llvm::sandboxir::Utils::getNumBits(), Idx, NumUnusedBits, llvm::BitVector::resize(), Seeds, llvm::BitVector::set(), llvm::BitVector::size(), llvm::BitVector::test(), UsedLaneCount, and UsedLanes.
|
inline |
\Returns the number of seed elements in the bundle.
Definition at line 102 of file SeedCollector.h.
References Seeds.
|
protected |
Tracks the remaining bits available to vectorize.
Definition at line 111 of file SeedCollector.h.
Referenced by getNumUnusedBits(), insertAt(), SeedBundle(), and setUsed().
|
protected |
Definition at line 105 of file SeedCollector.h.
Referenced by allUsed(), begin(), end(), getFirstUnusedElementIdx(), getSlice(), insertAt(), llvm::sandboxir::MemSeedBundle< LoadOrStoreT >::MemSeedBundle(), operator[](), SeedBundle(), setUsed(), and size().
|
protected |
Tracks used lanes for constant-time accessor.
Definition at line 109 of file SeedCollector.h.
|
protected |
The lanes that we have already vectorized.
Definition at line 107 of file SeedCollector.h.