-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathMetadataCategories.h
48 lines (34 loc) · 1013 Bytes
/
MetadataCategories.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#ifndef LLVM_MCA_METADATACATEGORIES_H
#define LLVM_MCA_METADATACATEGORIES_H
#include "MetadataRegistry.h"
#include "llvm/MCA/Instruction.h"
namespace llvm {
namespace mcad {
enum MetadataCategories {
// Metadata for LSUnit
MD_LSUnit_MemAccess = 0,
// Metadata for Branch Prediction
MD_FrontEnd_BranchFlow = 1,
// Virtual address at which an instruction is located in memory
MD_InstrAddr = 2,
// Used for marking the start of custom MD Category
MD_LAST,
// Metadata categories (custom)
MD_BinaryRegionMarkers
};
struct MDInstrAddr {
unsigned long long addr;
const bool operator<(const MDInstrAddr &b) const {
return addr < b.addr;
}
const bool operator==(const MDInstrAddr &b) const {
return addr == b.addr;
}
const bool operator!=(const MDInstrAddr &b) const {
return addr != b.addr;
}
};
std::optional<MDInstrAddr> getMDInstrAddrForInstr(MetadataRegistry &MD, const llvm::mca::InstRef &IR);
} // end namespace mcad
} // end namespace llvm
#endif