13#ifndef LLVM_CODEGEN_MACHINEBLOCKHASHINFO_H
14#define LLVM_CODEGEN_MACHINEBLOCKHASHINFO_H
28 : Offset(Offset), OpcodeHash(OpcodeHash), InstrHash(InstrHash),
29 NeighborHash(NeighborHash) {}
32 Offset = CombinedHash & 0xffff;
34 OpcodeHash = CombinedHash & 0xffff;
36 InstrHash = CombinedHash & 0xffff;
38 NeighborHash = CombinedHash & 0xffff;
70 assert(OpcodeHash == BBH.OpcodeHash &&
71 "incorrect blended hash distance computation");
74 Dist += NeighborHash == BBH.NeighborHash ? 0 : 1;
77 Dist += InstrHash == BBH.InstrHash ? 0 : 1;
80 Dist += (Offset >= BBH.Offset ? Offset - BBH.Offset : BBH.Offset - Offset);
93 uint16_t InstrHash{0};
96 uint16_t NeighborHash{0};
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
This file defines the DenseMap class.
Represent the analysis usage information of a pass.
Result run(MachineFunction &MF, MachineFunctionAnalysisManager &MFAM)
MachineBlockHashInfoResult Result
MachineBlockHashInfoPrinterPass(raw_ostream &OS)
PreservedAnalyses run(MachineFunction &MF, MachineFunctionAnalysisManager &MFAM)
Result object for MachineBlockHashInfo.
MachineBlockHashInfoResult()
uint64_t getMBBHash(const MachineBasicBlock &MBB) const
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.
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - This function should be overriden by passes that need analysis information to do t...
uint64_t getMBBHash(const MachineBasicBlock &MBB) const
MachineFunctionPass(char &ID)
A set of analyses that are preserved following a run of a transformation pass.
StringRef - Represent a constant reference to a string, i.e.
This class implements an extremely fast bulk output stream that can only output to a stream.
This is an optimization pass for GlobalISel generic memory operations.
AnalysisManager< MachineFunction > MachineFunctionAnalysisManager
A CRTP mix-in that provides informational APIs needed for analysis passes.
A special type used by analysis passes to provide an address that identifies that particular analysis...
uint16_t getOpcodeHash() const
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)
A CRTP mix-in to automatically provide informational APIs needed for passes.