29#define DEBUG_TYPE "mir2vec"
32 "Number of lookups to MIR entities not present in the vocabulary");
34 "Number of register operands with no register class");
47 cl::desc(
"Weight for machine opcode embeddings"),
51 cl::desc(
"Weight for common operand embeddings"),
55 cl::desc(
"Weight for register operand embeddings"),
60 "Generate symbolic embeddings for MIR")),
65 "mir2vec-print-all-vocab-entries",
cl::init(
false),
66 cl::desc(
"Print all vocabulary entries including zero embeddings"),
82 buildCanonicalOpcodeMapping();
83 unsigned CanonicalOpcodeCount = UniqueBaseOpcodeNames.size();
84 assert(CanonicalOpcodeCount > 0 &&
85 "No canonical opcodes found for target - invalid vocabulary");
87 buildRegisterOperandMapping();
90 Layout.OpcodeBase = 0;
91 Layout.CommonOperandBase = CanonicalOpcodeCount;
93 Layout.PhyRegBase = Layout.CommonOperandBase + std::size(CommonOperands);
94 Layout.VirtRegBase = Layout.PhyRegBase + RegisterOperandNames.size();
96 generateStorage(OpcodeMap, CommonOperandMap, PhysicalRegisterMap,
98 Layout.TotalEntries = Storage.size();
102 VocabMap &&CommonOperandMap,
103 VocabMap &&PhyRegMap,
107 if (OpcodeMap.empty() || CommonOperandMap.empty() || PhyRegMap.empty() ||
110 "Empty vocabulary entries provided");
112 MIRVocabulary Vocab(std::move(OpcodeMap), std::move(CommonOperandMap),
113 std::move(PhyRegMap), std::move(
VirtRegMap), TII, TRI);
118 "Failed to create valid vocabulary storage");
120 return std::move(Vocab);
135 assert(!InstrName.
empty() &&
"Instruction name should not be empty");
138 static const Regex BaseOpcodeRegex(
"([a-zA-Z_]+)");
141 if (BaseOpcodeRegex.
match(InstrName, &Matches) && Matches.
size() > 1) {
144 while (!Match.
empty() && Match.
back() ==
'_')
150 return InstrName.
str();
154 assert(!UniqueBaseOpcodeNames.empty() &&
"Canonical mapping not built");
155 auto It = std::find(UniqueBaseOpcodeNames.begin(),
156 UniqueBaseOpcodeNames.end(), BaseName.
str());
157 assert(It != UniqueBaseOpcodeNames.end() &&
158 "Base name not found in unique opcodes");
159 return std::distance(UniqueBaseOpcodeNames.begin(), It);
162unsigned MIRVocabulary::getCanonicalOpcodeIndex(
unsigned Opcode)
const {
163 auto BaseOpcode = extractBaseOpcodeName(
TII.getName(Opcode));
164 return getCanonicalIndexForBaseName(BaseOpcode);
169 auto It =
llvm::find_if(CommonOperands, [&](
const CommonOperandEntry &E) {
170 return E.Name == OperandName;
172 assert(It != std::end(CommonOperands) &&
173 "Operand name not found in common operands");
174 return Layout.CommonOperandBase +
175 std::distance(std::begin(CommonOperands), It);
180 bool IsPhysical)
const {
181 auto It = std::find(RegisterOperandNames.begin(), RegisterOperandNames.end(),
183 assert(It != RegisterOperandNames.end() &&
184 "Register name not found in register operands");
185 unsigned LocalIndex = std::distance(RegisterOperandNames.begin(), It);
186 return (IsPhysical ? Layout.PhyRegBase : Layout.VirtRegBase) + LocalIndex;
190 assert(Pos < Layout.TotalEntries &&
"Position out of bounds in vocabulary");
193 if (Pos < Layout.CommonOperandBase) {
195 auto It = UniqueBaseOpcodeNames.begin();
196 std::advance(It, Pos);
197 assert(It != UniqueBaseOpcodeNames.end() &&
198 "Canonical index out of bounds in opcode section");
202 auto getLocalIndex = [](
unsigned Pos,
size_t BaseOffset,
size_t Bound,
204 unsigned LocalIndex = Pos - BaseOffset;
210 if (Pos < Layout.PhyRegBase) {
211 unsigned LocalIndex =
212 getLocalIndex(Pos, Layout.CommonOperandBase, std::size(CommonOperands),
213 "Local index out of bounds in common operands");
214 return CommonOperands[LocalIndex].Name.str();
218 if (Pos < Layout.VirtRegBase) {
219 unsigned LocalIndex =
220 getLocalIndex(Pos, Layout.PhyRegBase, RegisterOperandNames.size(),
221 "Local index out of bounds in physical registers");
222 return "PhyReg_" + RegisterOperandNames[LocalIndex];
226 unsigned LocalIndex =
227 getLocalIndex(Pos, Layout.VirtRegBase, RegisterOperandNames.size(),
228 "Local index out of bounds in virtual registers");
229 return "VirtReg_" + RegisterOperandNames[LocalIndex];
232void MIRVocabulary::generateStorage(
const VocabMap &OpcodeMap,
242 <<
"; using zero vector. This will result in an error "
244 ++MIRVocabMissCounter;
248 unsigned EmbeddingDim = OpcodeMap.begin()->second.size();
249 std::vector<Embedding> OpcodeEmbeddings(Layout.CommonOperandBase,
253 for (
auto COpcodeName : UniqueBaseOpcodeNames) {
254 if (
auto It = OpcodeMap.find(COpcodeName); It != OpcodeMap.end()) {
255 auto COpcodeIndex = getCanonicalIndexForBaseName(COpcodeName);
256 assert(COpcodeIndex < Layout.CommonOperandBase &&
257 "Canonical index out of bounds");
258 OpcodeEmbeddings[COpcodeIndex] = It->second;
260 handleMissingEntity(COpcodeName);
265 std::vector<Embedding> CommonOperandEmbeddings(std::size(CommonOperands),
267 unsigned OperandIndex = 0;
268 for (
const CommonOperandEntry &Entry : CommonOperands) {
269 if (
auto It = CommonOperandsMap.find(
Entry.Name.str());
270 It != CommonOperandsMap.end()) {
271 CommonOperandEmbeddings[OperandIndex] = It->second;
273 handleMissingEntity(
Entry.Name);
279 auto createRegisterEmbeddings = [&](
const VocabMap &RegMap) {
280 std::vector<Embedding> RegEmbeddings(
TRI.getNumRegClasses(),
282 unsigned RegOperandIndex = 0;
283 for (
const auto &RegOperandName : RegisterOperandNames) {
284 if (
auto It = RegMap.find(RegOperandName); It != RegMap.end())
285 RegEmbeddings[RegOperandIndex] = It->second;
287 handleMissingEntity(RegOperandName);
290 return RegEmbeddings;
294 std::vector<Embedding> PhyRegEmbeddings = createRegisterEmbeddings(PhyRegMap);
295 std::vector<Embedding> VirtRegEmbeddings =
299 auto scaleVocabSection = [](std::vector<Embedding> &Embeddings,
304 scaleVocabSection(OpcodeEmbeddings,
OpcWeight);
309 std::vector<std::vector<Embedding>> Sections(
310 static_cast<unsigned>(Section::MaxSections));
311 Sections[
static_cast<unsigned>(Section::Opcodes)] =
312 std::move(OpcodeEmbeddings);
313 Sections[
static_cast<unsigned>(Section::CommonOperands)] =
314 std::move(CommonOperandEmbeddings);
315 Sections[
static_cast<unsigned>(Section::PhyRegisters)] =
316 std::move(PhyRegEmbeddings);
317 Sections[
static_cast<unsigned>(Section::VirtRegisters)] =
318 std::move(VirtRegEmbeddings);
323void MIRVocabulary::buildCanonicalOpcodeMapping() {
325 if (!UniqueBaseOpcodeNames.empty())
329 for (
unsigned Opcode = 0; Opcode <
TII.getNumOpcodes(); ++Opcode) {
330 std::string BaseOpcode = extractBaseOpcodeName(
TII.getName(Opcode));
331 UniqueBaseOpcodeNames.insert(BaseOpcode);
334 LLVM_DEBUG(
dbgs() <<
"MIR2Vec: Built canonical mapping for target with "
335 << UniqueBaseOpcodeNames.size()
336 <<
" unique base opcodes\n");
339void MIRVocabulary::buildRegisterOperandMapping() {
341 if (!RegisterOperandNames.empty())
344 for (
unsigned RC = 0; RC <
TRI.getNumRegClasses(); ++RC) {
351 RegisterOperandNames.push_back(ClassName.
str());
355std::optional<unsigned> MIRVocabulary::getCommonOperandIndex(
358 "Expected non-register operand type");
360 "Operand type out of bounds");
362 static constexpr auto OperandTypeToIndex = [] {
363 std::array<unsigned, MachineOperand::MO_Last + 1>
Map{};
364 for (
unsigned &
I : Map)
366 for (
unsigned I = 0;
I < std::size(CommonOperands); ++
I)
367 Map[CommonOperands[
I].
Type] =
I;
376std::optional<unsigned>
377MIRVocabulary::getRegisterOperandIndex(
Register Reg,
379 assert(!RegisterOperandNames.empty() &&
"Register operand mapping not built");
382 "Expected a physical or virtual register");
390 RegClass =
TRI.getMinimalPhysRegClass(
Reg);
410 <<
"; using zero vector.\n");
411 ++MIRClasslessRegCounter;
415 return RegClass->
getID();
420 assert(Dim > 0 &&
"Dimension must be greater than zero");
422 float DummyVal = 0.1f;
424 VocabMap DummyOpcMap, DummyOperandMap, DummyPhyRegMap, DummyVirtRegMap;
427 for (
unsigned Opcode = 0; Opcode < TII.getNumOpcodes(); ++Opcode) {
429 if (DummyOpcMap.count(BaseOpcode) == 0) {
430 DummyOpcMap[BaseOpcode] =
Embedding(Dim, DummyVal);
436 for (
const CommonOperandEntry &Entry : CommonOperands) {
437 DummyOperandMap[Entry.Name.str()] =
Embedding(Dim, DummyVal);
442 for (
unsigned RC = 0; RC < TRI.getNumRegClasses(); ++RC) {
447 std::string ClassName = TRI.getRegClassName(RegClass);
448 DummyPhyRegMap[ClassName] =
Embedding(Dim, DummyVal);
449 DummyVirtRegMap[ClassName] =
Embedding(Dim, DummyVal);
455 std::move(DummyOpcMap), std::move(DummyOperandMap),
456 std::move(DummyPhyRegMap), std::move(DummyVirtRegMap), TII, TRI);
471 "MIR2Vec vocabulary file path not specified; set it "
472 "using --mir2vec-vocab-path");
478 auto Content = BufOrError.get()->getBuffer();
481 if (!ParsedVocabValue)
484 unsigned OpcodeDim = 0, CommonOperandDim = 0, PhyRegOperandDim = 0,
485 VirtRegOperandDim = 0;
487 "Opcodes", *ParsedVocabValue, OpcodeVocab, OpcodeDim))
491 "CommonOperands", *ParsedVocabValue, CommonOperandVocab,
496 "PhysicalRegisters", *ParsedVocabValue, PhyRegVocabMap,
501 "VirtualRegisters", *ParsedVocabValue, VirtRegVocabMap,
506 if (!(OpcodeDim == CommonOperandDim && CommonOperandDim == PhyRegOperandDim &&
507 PhyRegOperandDim == VirtRegOperandDim)) {
510 "MIR2Vec vocabulary sections have different dimensions");
518 VocabMap OpcVocab, CommonOperandVocab, PhyRegVocabMap, VirtRegVocabMap;
522 return std::move(Err);
526 std::move(OpcVocab), std::move(CommonOperandVocab),
527 std::move(PhyRegVocabMap), std::move(VirtRegVocabMap), *ST.getInstrInfo(),
528 *ST.getRegisterInfo());
533 for (
const auto &
F : M) {
534 if (
F.isDeclaration())
537 if (
auto *MF = MMI.getMachineFunction(
F))
541 "No machine functions found in module");
546 "MIR2Vec Vocabulary Analysis",
false,
true)
552 return "MIR2Vec Vocabulary Analysis";
563 return std::move(*VocabOrErr);
575 return std::make_unique<SymbolicMIREmbedder>(
MF,
Vocab);
593 MF.getFunction().getContext().emitError(
594 "MIR2Vec: No TargetInstrInfo available; cannot compute embeddings");
599 for (
const auto &
MI :
MBB) {
601 if (
MI.isDebugInstr())
625std::unique_ptr<SymbolicMIREmbedder>
628 return std::make_unique<SymbolicMIREmbedder>(
MF,
Vocab);
633 if (
MI.isDebugInstr())
643 return InstructionEmbedding;
652 "MIR2Vec Vocabulary Printer Pass",
false,
true)
664 auto MIR2VecVocabOrErr =
Analysis.getMIR2VecVocabulary(M);
666 if (!MIR2VecVocabOrErr) {
667 OS <<
"MIR2Vec Vocabulary Printer: Failed to get vocabulary - "
668 <<
toString(MIR2VecVocabOrErr.takeError()) <<
"\n";
672 auto &MIR2VecVocab = *MIR2VecVocabOrErr;
674 for (
const auto &Entry : MIR2VecVocab) {
678 OS <<
"Key: " << MIR2VecVocab.getStringKey(Pos) <<
": ";
697 OS <<
"Error creating MIR2Vec embeddings for function " << MF.
getName()
702 OS <<
"MIR2Vec embeddings for machine function " << MF.
getName() <<
":\n";
703 OS <<
"Machine Function vector: ";
704 Emb->getMFunctionVector().print(OS);
706 OS <<
"Machine basic block vectors:\n";
708 OS <<
"Machine basic block: " <<
MBB.getFullName() <<
":\n";
709 Emb->getMBBVector(
MBB).print(OS);
712 OS <<
"Machine instruction vectors:\n";
717 if (
MI.isDebugInstr())
720 OS <<
"Machine instruction: ";
722 Emb->getMInstVector(
MI).print(OS);
729 "MIR2Vec Embedder Printer Pass",
false,
true)
733 "MIR2Vec Embedder Printer Pass",
false,
true)
738 Analysis.getMIR2VecVocabulary(*MF.getFunction().getParent());
739 assert(VocabOrErr &&
"Failed to get MIR2Vec vocabulary");
const AArch64Subtarget & Subtarget
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
block Block Frequency Analysis
#define clEnumValN(ENUMVAL, FLAGNAME, DESC)
This file builds on the ADT/GraphTraits.h file to build generic depth first graph iterator.
const HexagonInstrInfo * TII
Module.h This file contains the declarations for the Module class.
static void printEmbeddings(const MachineFunction &MF, const mir2vec::MIRVocabulary &MIRVocab, raw_ostream &OS)
static Error readVocabulary(VocabMap &OpcodeVocab, VocabMap &CommonOperandVocab, VocabMap &PhyRegVocabMap, VocabMap &VirtRegVocabMap)
static Expected< mir2vec::MIRVocabulary > buildVocabulary(const MachineFunction &MF)
std::map< std::string, Embedding > VocabMap
This file defines the MIR2Vec framework for generating Machine IR embeddings.
Register const TargetRegisterInfo * TRI
#define INITIALIZE_PASS_DEPENDENCY(depName)
#define INITIALIZE_PASS_END(passName, arg, name, cfg, analysis)
#define INITIALIZE_PASS_BEGIN(passName, arg, name, cfg, analysis)
SmallVector< MachineBasicBlock *, 4 > MBBVector
MachineRegisterInfo & MRI
This file defines the 'Statistic' class, which is designed to be an easy way to expose various metric...
#define STATISTIC(VARNAME, DESC)
static const unsigned InvalidIndex
PassT::Result & getResult(IRUnitT &IR, ExtraArgTs... ExtraArgs)
Get the result of an analysis pass for a given IR unit.
Lightweight error class with error context and mandatory checking.
static ErrorSuccess success()
Create a success value.
Tagged union holding either a T or a Error.
Error takeError()
Take ownership of the stored error.
unsigned getID() const
getID() - Return the register class ID number.
This pass prints the MIR2Vec embeddings for machine functions, basic blocks, and instructions.
MIR2VecPrinterLegacyPass(raw_ostream &OS)
bool runOnMachineFunction(MachineFunction &MF) override
runOnMachineFunction - This method must be overloaded to perform the desired machine code transformat...
LLVM_ABI PreservedAnalyses run(MachineFunction &MF, MachineFunctionAnalysisManager &MFAM)
New pass manager analysis that provides the MIR2Vec vocabulary for a machine function.
mir2vec::MIRVocabulary Result
LLVM_ABI Result run(MachineFunction &MF, MachineFunctionAnalysisManager &MFAM)
Pass to analyze and populate MIR2Vec vocabulary from a module.
This pass prints the embeddings in the MIR2Vec vocabulary.
bool doFinalization(Module &M) override
doFinalization - Virtual method overriden by subclasses to do any necessary clean up after all passes...
bool runOnMachineFunction(MachineFunction &MF) override
runOnMachineFunction - This method must be overloaded to perform the desired machine code transformat...
MIR2VecVocabPrinterLegacyPass(raw_ostream &OS)
LLVM_ABI Expected< mir2vec::MIRVocabulary > getVocabulary(const Module &M)
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
StringRef getName() const
getName - Return the name of the corresponding LLVM function.
MachineRegisterInfo & getRegInfo()
getRegInfo - Return information about the registers currently in use.
Representation of each machine instruction.
MachineOperand class - Representation of each machine instruction operand.
@ MO_Register
Register operand.
MachineRegisterInfo - Keep track of information for virtual and physical registers,...
const TargetRegisterClass * getRegClassOrNull(Register Reg) const
Return the register class of Reg, or null if Reg has not been assigned a register class yet.
static ErrorOr< std::unique_ptr< MemoryBuffer > > getFileOrSTDIN(const Twine &Filename, bool IsText=false, bool RequiresNullTerminator=true, std::optional< Align > Alignment=std::nullopt)
Open the specified file as a MemoryBuffer, or open stdin if the Filename is "-".
A Module instance is used to store all the information related to an LLVM module.
AnalysisType & getAnalysis() const
getAnalysis<AnalysisType>() - This function is used by subclasses to get to the analysis information ...
A set of analyses that are preserved following a run of a transformation pass.
static PreservedAnalyses all()
Construct a special preserved set that preserves all passes.
LLVM_ABI bool match(StringRef String, SmallVectorImpl< StringRef > *Matches=nullptr, std::string *Error=nullptr) const
matches - Match the regex against a given String.
Wrapper class representing virtual and physical registers.
constexpr bool isValid() const
constexpr bool isVirtual() const
Return true if the specified register number is in the virtual register namespace.
constexpr unsigned id() const
constexpr bool isPhysical() const
Return true if the specified register number is in the physical register namespace.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Represent a constant reference to a string, i.e.
std::string str() const
Get the contents as an std::string.
constexpr bool empty() const
Check if the string is empty.
char back() const
Get the last character in the string.
StringRef drop_back(size_t N=1) const
Return a StringRef equal to 'this' but with the last N elements dropped.
TargetInstrInfo - Interface to description of machine instruction set.
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
TargetSubtargetInfo - Generic base class for all target subtargets.
The instances of the Type class are immutable: once they are created, they are never changed.
Generic storage class for section-based vocabularies.
static LLVM_ABI Error parseVocabSection(StringRef Key, const json::Value &ParsedVocabValue, VocabMap &TargetVocab, unsigned &Dim)
Parse a vocabulary section from JSON and populate the target vocabulary map.
unsigned getDimension() const
Get vocabulary dimension.
bool isValid() const
Check if vocabulary is valid (has data)
const unsigned Dimension
Dimension of the embeddings; Captured from the vocabulary.
const MIRVocabulary & Vocab
const float RegOperandWeight
const float CommonOperandWeight
LLVM_ABI Embedding computeEmbeddings() const
Function to compute embeddings.
const float OpcWeight
Weight for opcode embeddings.
const MachineFunction & MF
static LLVM_ABI std::unique_ptr< MIREmbedder > create(MIR2VecKind Mode, const MachineFunction &MF, const MIRVocabulary &Vocab)
Factory method to create an Embedder object of the specified kind Returns nullptr if the requested ki...
LLVM_ABI MIREmbedder(const MachineFunction &MF, const MIRVocabulary &Vocab)
Class for storing and accessing the MIR2Vec vocabulary.
const Embedding & getOperandEmbedding(const MachineOperand &Operand, const MachineRegisterInfo &MRI) const
LLVM_ABI unsigned getCanonicalIndexForOperandName(StringRef OperandName) const
LLVM_ABI unsigned getCanonicalIndexForRegisterClass(StringRef RegName, bool IsPhysical=true) const
static LLVM_ABI std::string extractBaseOpcodeName(StringRef InstrName)
Static method for extracting base opcode names (public for testing)
static LLVM_ABI Expected< MIRVocabulary > createDummyVocabForTest(const TargetInstrInfo &TII, const TargetRegisterInfo &TRI, unsigned Dim=1)
Create a dummy vocabulary for testing purposes.
static LLVM_ABI Expected< MIRVocabulary > create(VocabMap &&OpcMap, VocabMap &&CommonOperandsMap, VocabMap &&PhyRegMap, VocabMap &&VirtRegMap, const TargetInstrInfo &TII, const TargetRegisterInfo &TRI)
Factory method to create MIRVocabulary from vocabulary map.
LLVM_ABI std::string getStringKey(unsigned Pos) const
Get the string key for a vocabulary entry at the given position.
LLVM_ABI unsigned getCanonicalIndexForBaseName(StringRef BaseName) const
Get indices from opcode or operand names.
static std::unique_ptr< SymbolicMIREmbedder > create(const MachineFunction &MF, const MIRVocabulary &Vocab)
SymbolicMIREmbedder(const MachineFunction &F, const MIRVocabulary &Vocab)
This class implements an extremely fast bulk output stream that can only output to a stream.
OperandType
Operands are tagged with one of the values of this enum.
ValuesClass values(OptsTy... Options)
Helper to build a ValuesClass by forwarding a variable number of arguments as an initializer list to ...
initializer< Ty > init(const Ty &Val)
LLVM_ABI llvm::Expected< Value > parse(llvm::StringRef JSON)
Parses the provided JSON source, or returns a ParseError.
LLVM_ABI llvm::cl::OptionCategory MIR2VecCategory
static cl::opt< float > OpcWeight("mir2vec-opc-weight", cl::init(1.0), cl::desc("Weight for machine opcode embeddings"), cl::cat(MIR2VecCategory))
static cl::opt< float > RegOperandWeight("mir2vec-reg-operand-weight", cl::init(1.0), cl::desc("Weight for register operand embeddings"), cl::cat(MIR2VecCategory))
static cl::opt< bool > PrintAllVocabEntries("mir2vec-print-all-vocab-entries", cl::init(false), cl::desc("Print all vocabulary entries including zero embeddings"), cl::cat(MIR2VecCategory))
ir2vec::Embedding Embedding
cl::opt< MIR2VecKind > MIR2VecEmbeddingKind("mir2vec-kind", cl::values(clEnumValN(MIR2VecKind::Symbolic, "symbolic", "Generate symbolic embeddings for MIR")), cl::init(MIR2VecKind::Symbolic), cl::desc("MIR2Vec embedding kind"), cl::cat(MIR2VecCategory))
static cl::opt< std::string > VocabFile("mir2vec-vocab-path", cl::desc("Path to the vocabulary file for MIR2Vec"), cl::init(""), cl::cat(MIR2VecCategory))
static cl::opt< float > CommonOperandWeight("mir2vec-common-operand-weight", cl::init(1.0), cl::desc("Weight for common operand embeddings"), cl::cat(MIR2VecCategory))
This is an optimization pass for GlobalISel generic memory operations.
Error createFileError(const Twine &F, Error E)
Concatenate a source file path and/or name with an Error.
AnalysisManager< MachineFunction > MachineFunctionAnalysisManager
Error createStringError(std::error_code EC, char const *Fmt, const Ts &... Vals)
Create formatted StringError object.
LLVM_ABI MachineFunctionPass * createMIR2VecPrinterLegacyPass(raw_ostream &OS)
Create a machine pass that prints MIR2Vec embeddings.
LLVM_ABI raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
LLVM_ATTRIBUTE_VISIBILITY_DEFAULT AnalysisKey InnerAnalysisManagerProxy< AnalysisManagerT, IRUnitT, ExtraArgTs... >::Key
LLVM_ABI raw_fd_ostream & errs()
This returns a reference to a raw_ostream for standard error.
LLVM_ABI MachineFunctionPass * createMIR2VecVocabPrinterLegacyPass(raw_ostream &OS)
MIR2VecVocabPrinter pass - This pass prints out the MIR2Vec vocabulary contents to the given stream a...
std::string toString(const APInt &I, unsigned Radix, bool Signed, bool formatAsCLiteral=false, bool UpperCase=true, bool InsertSeparators=false)
auto find_if(R &&Range, UnaryPredicate P)
Provide wrappers to std::find_if which take ranges instead of having to pass begin/end explicitly.
iterator_range< df_iterator< T > > depth_first(const T &G)
MCRegisterClass TargetRegisterClass
LLVM_ABI void reportFatalUsageError(Error Err)
Report a fatal error that does not indicate a bug in LLVM.
A special type used by analysis passes to provide an address that identifies that particular analysis...