LLVM 22.0.0git
llvm::sandboxir::SeedBundle Class Referenceabstract

A set of candidate Instructions for vectorizing together. More...

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

Inheritance diagram for llvm::sandboxir::SeedBundle:
[legend]

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.
SeedBundleoperator= (const SeedBundle &)=delete
virtual ~SeedBundle ()
iterator begin ()
iterator end ()
const_iterator begin () const
const_iterator end () const
Instructionoperator[] (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.

Detailed Description

A set of candidate Instructions for vectorizing together.

Definition at line 28 of file SeedCollector.h.

Member Typedef Documentation

◆ const_iterator

◆ iterator

Definition at line 41 of file SeedCollector.h.

Constructor & Destructor Documentation

◆ SeedBundle() [1/3]

llvm::sandboxir::SeedBundle::SeedBundle ( Instruction * I)
inlineexplicit

◆ SeedBundle() [2/3]

llvm::sandboxir::SeedBundle::SeedBundle ( SmallVector< Instruction * > && L)
inlineexplicit

◆ SeedBundle() [3/3]

llvm::sandboxir::SeedBundle::SeedBundle ( const SeedBundle & )
delete

No need to allow copies.

References SeedBundle().

◆ ~SeedBundle()

virtual llvm::sandboxir::SeedBundle::~SeedBundle ( )
inlinevirtual

Definition at line 39 of file SeedCollector.h.

Member Function Documentation

◆ allUsed()

bool llvm::sandboxir::SeedBundle::allUsed ( ) const
inline

Definition at line 92 of file SeedCollector.h.

References Seeds, and UsedLaneCount.

◆ begin() [1/2]

iterator llvm::sandboxir::SeedBundle::begin ( )
inline

Definition at line 43 of file SeedCollector.h.

References Seeds.

Referenced by SeedBundle(), and setUsed().

◆ begin() [2/2]

const_iterator llvm::sandboxir::SeedBundle::begin ( ) const
inline

Definition at line 45 of file SeedCollector.h.

References Seeds.

◆ dump() [1/2]

LLVM_DUMP_METHOD void llvm::sandboxir::SeedBundle::dump ( ) const
inline

Definition at line 126 of file SeedCollector.h.

References llvm::dbgs(), dump(), and LLVM_DUMP_METHOD.

Referenced by dump().

◆ dump() [2/2]

void llvm::sandboxir::SeedBundle::dump ( raw_ostream & OS) const
inline

Definition at line 116 of file SeedCollector.h.

References llvm::enumerate(), I, llvm::raw_ostream::indent(), and isUsed().

◆ end() [1/2]

iterator llvm::sandboxir::SeedBundle::end ( )
inline

Definition at line 44 of file SeedCollector.h.

References Seeds.

Referenced by setUsed().

◆ end() [2/2]

const_iterator llvm::sandboxir::SeedBundle::end ( ) const
inline

Definition at line 46 of file SeedCollector.h.

References Seeds.

◆ getFirstUnusedElementIdx()

unsigned llvm::sandboxir::SeedBundle::getFirstUnusedElementIdx ( ) const
inline

Definition at line 60 of file SeedCollector.h.

References isUsed(), Seeds, and llvm::seq().

◆ getNumUnusedBits()

unsigned llvm::sandboxir::SeedBundle::getNumUnusedBits ( ) const
inline

Definition at line 93 of file SeedCollector.h.

References NumUnusedBits.

◆ getSlice()

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.

◆ insert()

◆ insertAt()

void llvm::sandboxir::SeedBundle::insertAt ( iterator Pos,
Instruction * I )
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().

◆ isUsed()

bool llvm::sandboxir::SeedBundle::isUsed ( unsigned Element) const
inline

\Returns whether or not Element has been used.

Definition at line 89 of file SeedCollector.h.

References UsedLanes.

Referenced by dump(), getFirstUnusedElementIdx(), and getSlice().

◆ operator=()

SeedBundle & llvm::sandboxir::SeedBundle::operator= ( const SeedBundle & )
delete

References SeedBundle().

◆ operator[]()

Instruction * llvm::sandboxir::SeedBundle::operator[] ( unsigned Idx) const
inline

Definition at line 48 of file SeedCollector.h.

References Seeds.

◆ setUsed() [1/2]

void llvm::sandboxir::SeedBundle::setUsed ( Instruction * I)
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().

◆ setUsed() [2/2]

void llvm::sandboxir::SeedBundle::setUsed ( unsigned ElementIdx,
unsigned Sz = 1,
bool VerifyUnused = true )
inline

◆ size()

std::size_t llvm::sandboxir::SeedBundle::size ( ) const
inline

\Returns the number of seed elements in the bundle.

Definition at line 103 of file SeedCollector.h.

References Seeds.

Member Data Documentation

◆ NumUnusedBits

unsigned llvm::sandboxir::SeedBundle::NumUnusedBits = 0
protected

Tracks the remaining bits available to vectorize.

Definition at line 112 of file SeedCollector.h.

Referenced by getNumUnusedBits(), insertAt(), SeedBundle(), and setUsed().

◆ Seeds

◆ UsedLaneCount

unsigned llvm::sandboxir::SeedBundle::UsedLaneCount = 0
protected

Tracks used lanes for constant-time accessor.

Definition at line 110 of file SeedCollector.h.

Referenced by allUsed(), and setUsed().

◆ UsedLanes

BitVector llvm::sandboxir::SeedBundle::UsedLanes
protected

The lanes that we have already vectorized.

Definition at line 108 of file SeedCollector.h.

Referenced by isUsed(), and setUsed().


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