LLVM: lib/CodeGen/MachineBlockHashInfo.cpp Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
17
18using namespace llvm;
19
23 if (MI.isMetaInstruction() || MI.isTerminator())
24 continue;
26 if (HashOperands) {
27 for (unsigned i = 0; i < MI.getNumOperands(); i++) {
28 Hash =
30 }
31 }
32 }
33 return Hash;
34}
35
36
44
46 "Machine Block Hash Analysis", true, true)
47
49
52}
53
58
65
69
71
74
75 HashInfos[&MBB].OpcodeHash = hashBlock(MBB, false);
76
77 HashInfos[&MBB].InstrHash = hashBlock(MBB, true);
78 }
79
80
82 uint64_t Hash = HashInfos[&MBB].OpcodeHash;
83
85 uint64_t SuccHash = HashInfos[SuccMBB].OpcodeHash;
87 }
88
90 uint64_t PredHash = HashInfos[PredMBB].OpcodeHash;
92 }
93 HashInfos[&MBB].NeighborHash = Hash;
94 }
95
96
98 const auto &HashInfo = HashInfos[&MBB];
103 MBBHashInfo[&MBB] = BlendedHash.combine();
104 }
105
106 return false;
107}
108
110 return MBBHashInfo[&MBB];
111}
112
uint64_t hashBlock(const MachineBasicBlock &MBB, bool HashOperands)
Definition MachineBlockHashInfo.cpp:20
uint16_t fold_64_to_16(const uint64_t Value)
Fold a 64-bit integer to a 16-bit one.
Definition MachineBlockHashInfo.cpp:37
#define INITIALIZE_PASS(passName, arg, name, cfg, analysis)
Represent the analysis usage information of a pass.
void setPreservesAll()
Set by analyses that do not transform their input at all.
bool runOnMachineFunction(MachineFunction &F) override
runOnMachineFunction - This method must be overloaded to perform the desired machine code transformat...
Definition MachineBlockHashInfo.cpp:66
uint64_t getMBBHash(const MachineBasicBlock &MBB)
Definition MachineBlockHashInfo.cpp:109
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - This function should be overriden by passes that need analysis information to do t...
Definition MachineBlockHashInfo.cpp:54
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.
Representation of each machine instruction.
static LLVM_ABI PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
LLVM Value Representation.
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
uint64_t hash_16_bytes(uint64_t low, uint64_t high)
This is an optimization pass for GlobalISel generic memory operations.
hash_code hash_value(const FixedPointSemantics &Val)
LLVM_ABI void initializeMachineBlockHashInfoPass(PassRegistry &)
LLVM_ABI MachineFunctionPass * createMachineBlockHashInfoPass()
createMachineBlockHashInfoPass - This pass computes basic block hashes.
Definition MachineBlockHashInfo.cpp:113
uint64_t OpcodeHash
Definition MachineBlockHashInfo.cpp:61
uint64_t Offset
Definition MachineBlockHashInfo.cpp:60
uint64_t NeighborHash
Definition MachineBlockHashInfo.cpp:63
uint64_t InstrHash
Definition MachineBlockHashInfo.cpp:62
An object wrapping several components of a basic block hash.
uint64_t combine() const
Combine the blended hash into uint64_t.