LLVM 20.0.0git
Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
llvm::sandboxir::Region Class Reference

The main job of the Region is to point to new instructions generated by vectorization passes. More...

#include "llvm/SandboxIR/Region.h"

Public Types

using iterator = decltype(Insts.begin())
 

Public Member Functions

 Region (Context &Ctx)
 
 ~Region ()
 
ContextgetContext () const
 
void add (Instruction *I)
 Adds I to the set.
 
void remove (Instruction *I)
 Removes I from the set.
 
bool contains (Instruction *I) const
 Returns true if I is in the Region.
 
bool empty () const
 Returns true if the Region has no instructions.
 
iterator begin ()
 
iterator end ()
 
iterator_range< iteratorinsts ()
 
bool operator== (const Region &Other) const
 This is an expensive check, meant for testing.
 
bool operator!= (const Region &other) const
 
void dump (raw_ostream &OS) const
 
void dump () const
 

Static Public Member Functions

static SmallVector< std::unique_ptr< Region > > createRegionsFromMD (Function &F)
 

Friends

raw_ostreamoperator<< (raw_ostream &OS, const Region &Rgn)
 

Detailed Description

The main job of the Region is to point to new instructions generated by vectorization passes.

It is the unit that RegionPasses operate on with their runOnRegion() function.

The region allows us to stack transformations horizontally, meaning that each transformation operates on a single region and the resulting region is the input to the next transformation, as opposed to vertically, which is the common way of applying a transformation across the whole function. This enables us to check for profitability and decide whether we accept or rollback at a region granularity, which is much better than doing this at the function level.

Definition at line 54 of file Region.h.

Member Typedef Documentation

◆ iterator

using llvm::sandboxir::Region::iterator = decltype(Insts.begin())

Definition at line 89 of file Region.h.

Constructor & Destructor Documentation

◆ Region()

llvm::sandboxir::Region::Region ( Context Ctx)

◆ ~Region()

llvm::sandboxir::Region::~Region ( )

Member Function Documentation

◆ add()

void llvm::sandboxir::Region::add ( Instruction I)

Adds I to the set.

Definition at line 30 of file Region.cpp.

References I.

Referenced by Region().

◆ begin()

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

Definition at line 90 of file Region.h.

References llvm::SetVector< T, Vector, Set, N >::begin().

Referenced by insts().

◆ contains()

bool llvm::sandboxir::Region::contains ( Instruction I) const
inline

Returns true if I is in the Region.

Definition at line 85 of file Region.h.

References llvm::SetVector< T, Vector, Set, N >::contains(), and I.

◆ createRegionsFromMD()

SmallVector< std::unique_ptr< Region > > llvm::sandboxir::Region::createRegionsFromMD ( Function F)
static

◆ dump() [1/2]

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

Definition at line 55 of file Region.cpp.

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

Referenced by dump().

◆ dump() [2/2]

void llvm::sandboxir::Region::dump ( raw_ostream OS) const

Definition at line 50 of file Region.cpp.

References I, and OS.

◆ empty()

bool llvm::sandboxir::Region::empty ( ) const
inline

Returns true if the Region has no instructions.

Definition at line 87 of file Region.h.

References llvm::SetVector< T, Vector, Set, N >::empty().

◆ end()

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

Definition at line 91 of file Region.h.

References llvm::SetVector< T, Vector, Set, N >::end().

Referenced by insts().

◆ getContext()

Context & llvm::sandboxir::Region::getContext ( ) const
inline

Definition at line 78 of file Region.h.

◆ insts()

iterator_range< iterator > llvm::sandboxir::Region::insts ( )
inline

Definition at line 92 of file Region.h.

References begin(), end(), and llvm::make_range().

◆ operator!=()

bool llvm::sandboxir::Region::operator!= ( const Region other) const
inline

Definition at line 99 of file Region.h.

◆ operator==()

bool llvm::sandboxir::Region::operator== ( const Region Other) const

This is an expensive check, meant for testing.

Definition at line 42 of file Region.cpp.

References llvm::Other.

◆ remove()

void llvm::sandboxir::Region::remove ( Instruction I)

Removes I from the set.

Definition at line 36 of file Region.cpp.

References I.

Referenced by Region().

Friends And Related Function Documentation

◆ operator<<

raw_ostream & operator<< ( raw_ostream OS,
const Region Rgn 
)
friend

Definition at line 103 of file Region.h.


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