14InstructionCost ScoreBoard::getCost(Instruction *
I)
const {
15 auto *LLVMI = cast<llvm::Instruction>(
I->Val);
16 SmallVector<const llvm::Value *>
Operands(LLVMI->operands());
21 auto Cost = getCost(
I);
36 : Ctx(Ctx), Scoreboard(*this,
TTI) {
55 cast<llvm::Instruction>(
I->Val)->setMetadata(MDKind, RegionMDN);
66 cast<llvm::Instruction>(
I->Val)->setMetadata(MDKind,
nullptr);
71 if (Insts.size() !=
Other.Insts.size())
73 if (!std::is_permutation(Insts.begin(), Insts.end(),
Other.Insts.begin()))
93 auto &Ctx =
F.getContext();
96 if (
auto *MDN = cast<llvm::Instruction>(Inst.Val)->getMetadata(MDKind)) {
98 auto It = MDNToRegion.
find(MDN);
99 if (It == MDNToRegion.
end()) {
101 R = Regions.
back().get();
102 MDNToRegion[MDN] = R;
mir Rename Register Operands
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.
bool contains(Instruction *I) const
Returns true if I is in the Region.
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.
Region(Context &Ctx, TargetTransformInfo &TTI)
static SmallVector< std::unique_ptr< Region > > createRegionsFromMD(Function &F, TargetTransformInfo &TTI)
void remove(Instruction *I)
Mark I as a deleted instruction from the region.
LLVM_DUMP_METHOD void dump() const
void add(Instruction *I)
Mark I as a newly added instruction to the region.
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.