33 auto &LLVMCtx =
Ctx.LLVMCtx;
38 "Instruction already in Aux!");
48 "There is already an Instruction at Idx in Aux!");
49 unsigned ExpectedSz = Idx + 1;
50 if (
Aux.size() < ExpectedSz) {
51 auto SzBefore =
Aux.size();
52 Aux.resize(ExpectedSz);
54 for (
unsigned Idx = SzBefore; Idx + 1 < ExpectedSz; ++Idx)
90 if (!std::is_permutation(
Insts.begin(),
Insts.end(),
Other.Insts.begin()))
100 for (
auto *
I :
Aux) {
117 F, [&
F]() {
return std::make_unique<Region>(
F.getContext()); });
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
Represent a constant reference to an array (0 or more elements consecutively in memory),...
This is the shared class of boolean and integer constants.
This is an important class for using LLVM in a threaded context.
static MDTuple * getDistinct(LLVMContext &Context, ArrayRef< Metadata * > MDs)
static MDTuple * get(LLVMContext &Context, ArrayRef< Metadata * > MDs)
static LLVM_ABI MDString * get(LLVMContext &Context, StringRef Str)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
static LLVM_ABI IntegerType * getInt32Ty(LLVMContext &C)
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 constexpr const char * RegionStr
void addRaw(Instruction *I)
Adds I to the set.
void removeFromAux(Instruction *I)
Remove instruction I from Aux and drop metadata.
static constexpr const char * MDKind
Context::CallbackID EraseInstCB
ID (for later deregistration) of the "erase instruction" callback.
LLVM_ABI_FOR_TEST bool operator==(const Region &Other) const
This is an expensive check, meant for testing.
virtual LLVM_ABI void remove(Instruction *I)
Removes I from the set.
static SmallVector< std::unique_ptr< RegionT > > createRegionsFromMD(Function &F, RegionFactoryT Factory)
Context::CallbackID CreateInstCB
ID (for later deregistration) of the "create instruction" callback.
void dropAuxMetadata(Instruction *I)
Helper for dropping Aux metadata for I.
SetVector< Instruction * > Insts
All the instructions in the Region.
static constexpr const char * AuxMDKind
LLVM_ABI Region(Context &Ctx, RegionClassID ID)
LLVM_ABI void clearAux()
Clears all auxiliary data.
virtual LLVM_ABI ~Region()
void setAux(unsigned Idx, Instruction *I)
Set I as the Idx'th element in the auxiliary vector.
MDNode * RegionMDN
MDNode that we'll use to mark instructions as being part of the region.
SmallVector< Instruction * > Aux
An auxiliary sequence of Instruction-Index pairs.
RegionClassID
The main job of the Region is to point to new instructions generated by vectorization passes.
auto find(R &&Range, const T &Val)
Provide wrappers to std::find which take ranges instead of having to pass begin/end explicitly.
auto enumerate(FirstRange &&First, RestRanges &&...Rest)
Given two or more input ranges, returns a new range whose values are tuples (A, B,...
LLVM_ABI raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
class LLVM_GSL_OWNER SmallVector
Forward declaration of SmallVector so that calculateSmallVectorDefaultInlinedElements can reference s...
decltype(auto) cast(const From &Val)
cast<X> - Return the argument parameter cast to the specified type.
auto seq(T Begin, T End)
Iterate over an integral type from Begin up to - but not including - End.