33 cast<llvm::Instruction>(
I->Val)->setMetadata(MDKind, RegionMDN);
38 cast<llvm::Instruction>(
I->Val)->setMetadata(MDKind,
nullptr);
43 if (Insts.size() !=
Other.Insts.size())
45 if (!std::is_permutation(Insts.begin(), Insts.end(),
Other.Insts.begin()))
64 auto &Ctx =
F.getContext();
67 if (
auto *MDN = cast<llvm::Instruction>(Inst.Val)->getMetadata(MDKind)) {
69 auto It = MDNToRegion.
find(MDN);
70 if (It == MDNToRegion.
end()) {
71 Regions.
push_back(std::make_unique<Region>(Ctx));
72 R = Regions.
back().get();
iterator find(const_arg_type_t< KeyT > Val)
This is an important class for using LLVM in a threaded context.
static MDTuple * getDistinct(LLVMContext &Context, ArrayRef< Metadata * > MDs)
static MDString * get(LLVMContext &Context, StringRef Str)
void push_back(const T &Elt)
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.
Contains a list of sandboxir::Instruction's.
CallbackID registerCreateInstrCallback(CreateInstrCallback CB)
Register a callback that gets called right after a SandboxIR instruction is created.
void unregisterCreateInstrCallback(CallbackID ID)
void unregisterEraseInstrCallback(CallbackID ID)
CallbackID registerEraseInstrCallback(EraseInstrCallback CB)
Register a callback that gets called when a SandboxIR instruction is about to be removed from its par...
A sandboxir::User with operands, opcode and linked with previous/next instructions in an instruction ...
The main job of the Region is to point to new instructions generated by vectorization passes.
void add(Instruction *I)
Adds I to the set.
bool operator==(const Region &Other) const
This is an expensive check, meant for testing.
void remove(Instruction *I)
Removes I from the set.
static SmallVector< std::unique_ptr< Region > > createRegionsFromMD(Function &F)
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.