LLVM 22.0.0git
|
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 | |
LLVM_ABI | Region (Context &Ctx, TargetTransformInfo &TTI) |
LLVM_ABI | ~Region () |
Context & | getContext () const |
bool | contains (Instruction *I) const |
Returns true if I is in the Region. | |
bool | empty () const |
Returns true if the Region has no instructions. | |
LLVM_ABI void | setAux (ArrayRef< Instruction * > Aux) |
Set the auxiliary vector. | |
const SmallVector< Instruction * > & | getAux () const |
\Returns the auxiliary vector. | |
LLVM_ABI void | clearAux () |
Clears all auxiliary data. | |
iterator | begin () |
iterator | end () |
iterator_range< iterator > | insts () |
const ScoreBoard & | getScoreboard () const |
\Returns the ScoreBoard data structure that keeps track of instr costs. | |
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 LLVM_ABI SmallVector< std::unique_ptr< Region > > | createRegionsFromMD (Function &F, TargetTransformInfo &TTI) |
Friends | |
class | Context |
class | RegionInternalsAttorney |
class | RegionsFromBBs |
raw_ostream & | operator<< (raw_ostream &OS, const Region &Rgn) |
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.
using llvm::sandboxir::Region::iterator = decltype(Insts.begin()) |
llvm::sandboxir::Region::Region | ( | Context & | Ctx, |
TargetTransformInfo & | TTI ) |
Definition at line 35 of file Region.cpp.
References Context, llvm::MDString::get(), and llvm::MDNode::getDistinct().
Referenced by createRegionsFromMD(), operator!=(), operator<<, and operator==().
llvm::sandboxir::Region::~Region | ( | ) |
Definition at line 49 of file Region.cpp.
|
inline |
void llvm::sandboxir::Region::clearAux | ( | ) |
Clears all auxiliary data.
Definition at line 107 of file Region.cpp.
References llvm::seq().
Referenced by llvm::sandboxir::SeedCollection::runOnFunction().
|
inline |
|
static |
Definition at line 152 of file Region.cpp.
References assert(), llvm::SmallVectorTemplateCommon< T, typename >::back(), llvm::sandboxir::BasicBlock(), llvm::cast(), llvm::dyn_cast(), llvm::errs(), F, I, llvm::SmallVectorTemplateBase< T, bool >::push_back(), Region(), and llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::try_emplace().
Referenced by llvm::sandboxir::RegionsFromMetadata::runOnFunction().
void llvm::sandboxir::Region::dump | ( | ) | const |
Definition at line 145 of file Region.cpp.
References llvm::dbgs(), and dump().
Referenced by dump().
void llvm::sandboxir::Region::dump | ( | raw_ostream & | OS | ) | const |
|
inline |
Returns true if the Region has no instructions.
Definition at line 152 of file Region.h.
Referenced by llvm::sandboxir::PackReuse::runOnRegion().
|
inline |
|
inline |
\Returns the auxiliary vector.
Definition at line 156 of file Region.h.
Referenced by llvm::sandboxir::BottomUpVec::runOnRegion().
|
inline |
Definition at line 148 of file Region.h.
References Context.
Referenced by llvm::sandboxir::TransactionAcceptOrRevert::runOnRegion(), and llvm::sandboxir::TransactionSave::runOnRegion().
|
inline |
\Returns the ScoreBoard data structure that keeps track of instr costs.
Definition at line 168 of file Region.h.
Referenced by llvm::sandboxir::TransactionAcceptOrRevert::runOnRegion().
|
inline |
Definition at line 163 of file Region.h.
References begin(), end(), and llvm::make_range().
This is an expensive check, meant for testing.
Definition at line 123 of file Region.cpp.
References llvm::Other, and Region().
void llvm::sandboxir::Region::setAux | ( | ArrayRef< Instruction * > | Aux | ) |
Set the auxiliary vector.
Definition at line 63 of file Region.cpp.
References assert(), llvm::cast(), llvm::enumerate(), llvm::ConstantAsMetadata::get(), llvm::MDNode::get(), llvm::Type::getInt32Ty(), I, and llvm::SmallVector.
|
friend |
Definition at line 132 of file Region.h.
References Context.
Referenced by Context, getContext(), Region(), and RegionsFromBBs.
|
friend |
|
friend |
Definition at line 133 of file Region.h.
References RegionInternalsAttorney.
Referenced by RegionInternalsAttorney.
|
friend |
Definition at line 134 of file Region.h.
References Context, I, LLVM_ABI, and RegionsFromBBs.
Referenced by RegionsFromBBs.