12#ifndef LLVM_SANDBOXIR_REGIONWITHSCORE_H
13#define LLVM_SANDBOXIR_REGIONWITHSCORE_H
32 ScoreBoard(
const ScoreBoard &) =
delete;
33 const ScoreBoard &operator=(
const ScoreBoard &) =
delete;
37 : Rgn(Rgn), TTI(TTI) {}
49 OS <<
"BeforeCost: " << BeforeCost <<
"\n";
50 OS <<
"AfterCost: " << AfterCost <<
"\n";
#define LLVM_DUMP_METHOD
Mark debug helper function definitions like dump() that should not be stripped from debug builds.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
This class implements an extremely fast bulk output stream that can only output to a stream.
A sandboxir::User with operands, opcode and linked with previous/next instructions in an instruction ...
static bool classof(const Region *From)
RegionWithScore(Context &Ctx, const TargetTransformInfo &TTI)
const ScoreBoard & getScoreboard() const
\Returns the ScoreBoard data structure that keeps track of instr costs.
static SmallVector< std::unique_ptr< RegionWithScore > > createRegionsFromMD(Function &F, const TargetTransformInfo &TTI)
RegionWithScore(Region &&Rgn, const TargetTransformInfo &TTI)
friend class RegionsFromBBs
RegionClassID getSubclassID() const
void addRaw(Instruction *I)
Adds I to the set.
virtual LLVM_ABI void remove(Instruction *I)
Removes I from the set.
LLVM_ABI Region(Context &Ctx, RegionClassID ID)
Vectorization Score (cost) tracking class.
InstructionCost getBeforeCost() const
\Returns the cost of the Removed instructions.
LLVM_ABI void remove(Instruction *I)
Mark I as a deleted instruction from the region.
InstructionCost getAfterCost() const
\Returns the cost of the newly added instructions.
LLVM_DUMP_METHOD void dump() const
void dump(raw_ostream &OS) const
ScoreBoard(Region &Rgn, const TargetTransformInfo &TTI)
void add(Instruction *I)
Mark I as a newly added instruction to the region.
RegionClassID
The main job of the Region is to point to new instructions generated by vectorization passes.
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
Implement std::hash so that hash_code can be used in STL containers.