An object wrapping several components of a basic block hash. The combined (blended) hash is represented and stored as one uint64_t, while individual components are of smaller size (e.g., uint16_t or uint8_t).
Synopsis
Declared in <llvm/CodeGen/MachineBlockHashInfo.h>
struct BlendedBlockHash;
Member Functions
Name |
Description |
|
Constructors |
Combine the blended hash into uint64_t. |
|
Compute a distance between two given blended hashes. The smaller the distance, the more similar two blocks are. For identical basic blocks, the distance is zero. Since OpcodeHash is highly stable, we consider a match good only if the OpcodeHashes are identical. Mismatched OpcodeHashes lead to low matching accuracy, and poor matches undermine the quality of final inference. Notably, during inference, we also consider the matching ratio of basic blocks. For MachineFunctions with a low matching ratio, we directly skip optimization to reduce the impact of mismatches. This ensures even very poor profiles won’t cause negative optimization. In the context of matching, we consider NeighborHash to be more important. This is especially true when accounting for inlining scenarios, where the position of a basic block in the control flow graph is more critical. |
|
Created with MrDocs