LLVM 24.0.0git
llvm::sandboxir::SchedulingPoint Class Reference

The scheduling point in the context of the Scheduler points to the top-of-schedule (i.e., the top-most instruction of the top bundle) during bottom-up scheduling or the bottom of the schedule (i.e., the bottom-most instruction of the bottom bundle) during top-down. More...

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

Public Member Functions

 SchedulingPoint (BasicBlock::iterator It)
 Creates a scheduling point pointing at It, meaning any instruction in a BB or BB.end().
BasicBlockatBeforeBeginOrNull () const
 If the SchedulingPoint points to before the beginning of a BB, then this returns that BB, else returns nullptr.
BasicBlockatEndOrNull () const
 If the SchedulingPoint points after the last instruction in the BB then this returns the corresponding BasicBlock, nullptr otherwise.
InstructionatInstrOrNull () const
 Returns the instruction pointed to by this SchedulingPoint or null if we are before/after BB.
 operator Instruction * () const
 Cast to Instruction *.
BasicBlock::iterator getIterator () const
 Returns the corresponding BB::iterator.
 operator BasicBlock::iterator () const
SchedulingPoint getNext () const
 Returns the SchedulingPoint pointing after this.
SchedulingPoint getPrev () const
 Returns the SchedulingPoint pointing before this.
bool operator== (const SchedulingPoint &Other) const
void print (raw_ostream &OS) const
LLVM_DUMP_METHOD void dump () const

Static Public Member Functions

static SchedulingPoint createAt (BasicBlock::iterator It)
 Returns a SchedulingPoint that points to It.
static SchedulingPoint createBefore (BasicBlock::iterator It)
 Returns a SchedulingPoint that points to one element before It.
static SchedulingPoint createAfter (BasicBlock::iterator It)
 Returns a SchedulingPoint that points to one element after It.

Detailed Description

The scheduling point in the context of the Scheduler points to the top-of-schedule (i.e., the top-most instruction of the top bundle) during bottom-up scheduling or the bottom of the schedule (i.e., the bottom-most instruction of the bottom bundle) during top-down.

This class can be thought of as an extended BB::iterator, one that can not only point to after the last instruction in a BB (i.e., BB.end()), but also before the first instruction (i.e., something equivalent to prev(BB.begin()), which is not a legal BasicBlock::iterator).

This is needed for symmetric implementations of top-down and bottom-up scheduling. More specifically, if this is the first scheduling attempt we need the scheduling front to still point to a hypothetical last scheduling point. In bottom-up this can be at BB.end() but in top-down this can be before BB.begin(). This is why a BasicBlock::iterator is not suitable for this.

Definition at line 190 of file Scheduler.h.

Constructor & Destructor Documentation

◆ SchedulingPoint()

llvm::sandboxir::SchedulingPoint::SchedulingPoint ( BasicBlock::iterator It)
inline

Creates a scheduling point pointing at It, meaning any instruction in a BB or BB.end().

Definition at line 202 of file Scheduler.h.

Member Function Documentation

◆ atBeforeBeginOrNull()

BasicBlock * llvm::sandboxir::SchedulingPoint::atBeforeBeginOrNull ( ) const
inline

If the SchedulingPoint points to before the beginning of a BB, then this returns that BB, else returns nullptr.

Definition at line 222 of file Scheduler.h.

References llvm::sandboxir::BasicBlock().

Referenced by atInstrOrNull(), getIterator(), getNext(), getPrev(), and print().

◆ atEndOrNull()

BasicBlock * llvm::sandboxir::SchedulingPoint::atEndOrNull ( ) const
inline

If the SchedulingPoint points after the last instruction in the BB then this returns the corresponding BasicBlock, nullptr otherwise.

Definition at line 229 of file Scheduler.h.

References llvm::sandboxir::BasicBlock().

Referenced by atInstrOrNull(), getNext(), and print().

◆ atInstrOrNull()

Instruction * llvm::sandboxir::SchedulingPoint::atInstrOrNull ( ) const
inline

Returns the instruction pointed to by this SchedulingPoint or null if we are before/after BB.

Definition at line 237 of file Scheduler.h.

References atBeforeBeginOrNull(), and atEndOrNull().

Referenced by operator Instruction *(), and print().

◆ createAfter()

SchedulingPoint llvm::sandboxir::SchedulingPoint::createAfter ( BasicBlock::iterator It)
inlinestatic

Returns a SchedulingPoint that points to one element after It.

Definition at line 215 of file Scheduler.h.

References assert().

◆ createAt()

SchedulingPoint llvm::sandboxir::SchedulingPoint::createAt ( BasicBlock::iterator It)
inlinestatic

Returns a SchedulingPoint that points to It.

Definition at line 204 of file Scheduler.h.

◆ createBefore()

SchedulingPoint llvm::sandboxir::SchedulingPoint::createBefore ( BasicBlock::iterator It)
inlinestatic

Returns a SchedulingPoint that points to one element before It.

Definition at line 208 of file Scheduler.h.

References llvm::sandboxir::BasicBlock(), and llvm::BasicBlock::begin().

◆ dump()

void llvm::sandboxir::SchedulingPoint::dump ( ) const

Definition at line 89 of file Scheduler.cpp.

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

◆ getIterator()

BasicBlock::iterator llvm::sandboxir::SchedulingPoint::getIterator ( ) const
inline

Returns the corresponding BB::iterator.

Asserts that we are not pointing before BB begin.

Definition at line 247 of file Scheduler.h.

References assert(), and atBeforeBeginOrNull().

Referenced by getNext(), getPrev(), and operator BasicBlock::iterator().

◆ getNext()

SchedulingPoint llvm::sandboxir::SchedulingPoint::getNext ( ) const
inline

◆ getPrev()

SchedulingPoint llvm::sandboxir::SchedulingPoint::getPrev ( ) const
inline

Returns the SchedulingPoint pointing before this.

Definition at line 260 of file Scheduler.h.

References assert(), atBeforeBeginOrNull(), llvm::BasicBlock::begin(), and getIterator().

Referenced by llvm::sandboxir::Scheduler::trySchedule().

◆ operator BasicBlock::iterator()

llvm::sandboxir::SchedulingPoint::operator BasicBlock::iterator ( ) const
inline

Definition at line 251 of file Scheduler.h.

References getIterator().

◆ operator Instruction *()

llvm::sandboxir::SchedulingPoint::operator Instruction * ( ) const
inline

Cast to Instruction *.

Asserts that we are pointing to an instruction and not before/after the beginning/end of a BB.

Definition at line 244 of file Scheduler.h.

References atInstrOrNull().

◆ operator==()

bool llvm::sandboxir::SchedulingPoint::operator== ( const SchedulingPoint & Other) const
inline

Definition at line 268 of file Scheduler.h.

References llvm::Other.

◆ print()

void llvm::sandboxir::SchedulingPoint::print ( raw_ostream & OS) const

Definition at line 80 of file Scheduler.cpp.

References atBeforeBeginOrNull(), atEndOrNull(), atInstrOrNull(), and llvm::sandboxir::BasicBlock().

Referenced by dump().


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