|
LLVM 22.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 ()=default |
| 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 |
| LLVM_ABI ArrayRef< 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 28 of file SeedCollector.h.
Definition at line 42 of file SeedCollector.h.
| using llvm::sandboxir::SeedBundle::iterator = SmallVector<Instruction *>::iterator |
Definition at line 41 of file SeedCollector.h.
|
inlineexplicit |
Initialize a bundle with I.
Definition at line 31 of file SeedCollector.h.
References begin(), I, and insertAt().
Referenced by llvm::sandboxir::MemSeedBundle< sandboxir::StoreInst >::MemSeedBundle(), llvm::sandboxir::MemSeedBundle< sandboxir::StoreInst >::MemSeedBundle(), operator=(), and SeedBundle().
|
inlineexplicit |
Definition at line 32 of file SeedCollector.h.
References llvm::sandboxir::Utils::getNumBits(), llvm::move(), NumUnusedBits, and Seeds.
|
delete |
No need to allow copies.
References SeedBundle().
|
virtualdefault |
|
inline |
Definition at line 92 of file SeedCollector.h.
References Seeds, and UsedLaneCount.
|
inline |
Definition at line 43 of file SeedCollector.h.
References Seeds.
Referenced by SeedBundle(), and setUsed().
|
inline |
Definition at line 45 of file SeedCollector.h.
References Seeds.
|
inline |
Definition at line 126 of file SeedCollector.h.
References llvm::dbgs(), dump(), and LLVM_DUMP_METHOD.
Referenced by dump().
|
inline |
Definition at line 116 of file SeedCollector.h.
References llvm::enumerate(), I, llvm::raw_ostream::indent(), and isUsed().
|
inline |
|
inline |
Definition at line 46 of file SeedCollector.h.
References Seeds.
|
inline |
Definition at line 60 of file SeedCollector.h.
References isUsed(), Seeds, and llvm::seq().
|
inline |
Definition at line 93 of file SeedCollector.h.
References NumUnusedBits.
| ArrayRef< 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 30 of file SeedCollector.cpp.
References llvm::ArrayRef(), assert(), llvm::drop_begin(), llvm::sandboxir::Utils::getNumBits(), llvm::isPowerOf2_32(), isUsed(), and Seeds.
|
pure virtual |
|
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 53 of file SeedCollector.h.
References llvm::sandboxir::Utils::getNumBits(), I, NumUnusedBits, and Seeds.
Referenced by llvm::sandboxir::MemSeedBundle< sandboxir::StoreInst >::insert(), and SeedBundle().
\Returns whether or not Element has been used.
Definition at line 89 of file SeedCollector.h.
References UsedLanes.
Referenced by dump(), getFirstUnusedElementIdx(), and getSlice().
|
delete |
References SeedBundle().
|
inline |
Definition at line 48 of file SeedCollector.h.
References Seeds.
|
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 70 of file SeedCollector.h.
References assert(), begin(), end(), llvm::find(), I, and setUsed().
Referenced by llvm::sandboxir::SeedContainer::erase(), and setUsed().
|
inline |
Definition at line 77 of file SeedCollector.h.
References assert(), llvm::sandboxir::Utils::getNumBits(), NumUnusedBits, Seeds, llvm::seq(), UsedLaneCount, and UsedLanes.
|
inline |
\Returns the number of seed elements in the bundle.
Definition at line 103 of file SeedCollector.h.
References Seeds.
|
protected |
Tracks the remaining bits available to vectorize.
Definition at line 112 of file SeedCollector.h.
Referenced by getNumUnusedBits(), insertAt(), SeedBundle(), and setUsed().
|
protected |
Definition at line 106 of file SeedCollector.h.
Referenced by allUsed(), begin(), begin(), end(), end(), getFirstUnusedElementIdx(), getSlice(), insertAt(), llvm::sandboxir::MemSeedBundle< sandboxir::StoreInst >::MemSeedBundle(), operator[](), SeedBundle(), setUsed(), and size().
|
protected |
Tracks used lanes for constant-time accessor.
Definition at line 110 of file SeedCollector.h.
|
protected |
The lanes that we have already vectorized.
Definition at line 108 of file SeedCollector.h.