9#ifndef LLVM_SANDBOXIR_REGION_H
10#define LLVM_SANDBOXIR_REGION_H
36 ScoreBoard(
const ScoreBoard &) =
delete;
37 const ScoreBoard &operator=(
const ScoreBoard &) =
delete;
52 OS <<
"BeforeCost: " << BeforeCost <<
"\n";
53 OS <<
"AfterCost: " << AfterCost <<
"\n";
105 static constexpr const char *MDKind =
"sandboxvec";
106 static constexpr const char *RegionStr =
"sandboxregion";
107 static constexpr const char *AuxMDKind =
"sandboxaux";
152 bool empty()
const {
return Insts.empty(); }
#define LLVM_DUMP_METHOD
Mark debug helper function definitions like dump() that should not be stripped from debug builds.
This file implements a set that has insertion order iteration characteristics.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
A vector that has set insertion semantics.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
A range adaptor for a pair of iterators.
This class implements an extremely fast bulk output stream that can only output to a stream.
An ID for a registered callback.
A sandboxir::User with operands, opcode and linked with previous/next instructions in an instruction ...
A helper client-attorney class for unit tests.
static void add(Region &Rgn, Instruction *I)
static void remove(Region &Rgn, Instruction *I)
The main job of the Region is to point to new instructions generated by vectorization passes.
Context & getContext() const
bool contains(Instruction *I) const
Returns true if I is in the Region.
const SmallVector< Instruction * > & getAux() const
\Returns the auxiliary vector.
iterator_range< iterator > insts()
bool operator!=(const Region &other) const
bool operator==(const Region &Other) const
This is an expensive check, meant for testing.
LLVM_ABI Region(Context &Ctx, TargetTransformInfo &TTI)
static LLVM_ABI SmallVector< std::unique_ptr< Region > > createRegionsFromMD(Function &F, TargetTransformInfo &TTI)
const ScoreBoard & getScoreboard() const
\Returns the ScoreBoard data structure that keeps track of instr costs.
friend class RegionInternalsAttorney
friend raw_ostream & operator<<(raw_ostream &OS, const Region &Rgn)
LLVM_ABI void clearAux()
Clears all auxiliary data.
decltype(Insts.begin()) iterator
void dump(raw_ostream &OS) const
friend class RegionsFromBBs
bool empty() const
Returns true if the Region has no instructions.
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.
ScoreBoard(Region &Rgn, TargetTransformInfo &TTI)
LLVM_DUMP_METHOD void dump() const
void dump(raw_ostream &OS) const
void add(Instruction *I)
Mark I as a newly added instruction to the region.
This provides a very simple, boring adaptor for a begin and end iterator into a range type.
iterator_range< T > make_range(T x, T y)
Convenience function for iterating over sub-ranges.