13#ifndef LLVM_CODEGEN_MACHINEBLOCKHASHINFO_H
14#define LLVM_CODEGEN_MACHINEBLOCKHASHINFO_H
27 : Offset(Offset), OpcodeHash(OpcodeHash), InstrHash(InstrHash),
28 NeighborHash(NeighborHash) {}
31 Offset = CombinedHash & 0xffff;
33 OpcodeHash = CombinedHash & 0xffff;
35 InstrHash = CombinedHash & 0xffff;
37 NeighborHash = CombinedHash & 0xffff;
69 assert(OpcodeHash == BBH.OpcodeHash &&
70 "incorrect blended hash distance computation");
73 Dist += NeighborHash == BBH.NeighborHash ? 0 : 1;
76 Dist += InstrHash == BBH.InstrHash ? 0 : 1;
79 Dist += (Offset >= BBH.Offset ? Offset - BBH.Offset : BBH.Offset - Offset);
90 uint16_t InstrHash{0};
93 uint16_t NeighborHash{0};
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
Represent the analysis usage information of a pass.
bool runOnMachineFunction(MachineFunction &F) override
runOnMachineFunction - This method must be overloaded to perform the desired machine code transformat...
StringRef getPassName() const override
getPassName - Return a nice clean name for a pass.
uint64_t getMBBHash(const MachineBasicBlock &MBB)
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - This function should be overriden by passes that need analysis information to do t...
MachineFunctionPass(char &ID)
StringRef - Represent a constant reference to a string, i.e.
This is an optimization pass for GlobalISel generic memory operations.
uint64_t distance(const BlendedBlockHash &BBH) const
Compute a distance between two given blended hashes.
BlendedBlockHash(uint16_t Offset, uint16_t OpcodeHash, uint16_t InstrHash, uint16_t NeighborHash)
uint64_t combine() const
Combine the blended hash into uint64_t.
BlendedBlockHash(uint64_t CombinedHash)