[llvm] Adding Matching and Inference Functionality to Propeller-Patch 1 (PR #140886)
via llvm-commits
llvm-commits at lists.llvm.org
Fri May 23 14:16:31 PDT 2025
================
@@ -0,0 +1,108 @@
+#ifndef LLVM_CODEGEN_MACHINEBLOCKHASHINFO_H
+#define LLVM_CODEGEN_MACHINEBLOCKHASHINFO_H
+
+#include "llvm/CodeGen/MachineFunctionPass.h"
+
+namespace llvm {
+
+/// 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).
+struct BlendedBlockHash {
+private:
+ static uint64_t combineHashes(uint16_t Hash1, uint16_t Hash2, uint16_t Hash3,
----------------
spupyrev wrote:
A lot of the code in this file repeats the implementation in BOLT (which has actually been improved since the original commits), e.g., https://github.com/llvm/llvm-project/blob/main/bolt/lib/Profile/StaleProfileMatching.cpp
Do you think there is a way to unify the implementations? (totally understand if not, since there might be some specifics)
https://github.com/llvm/llvm-project/pull/140886
More information about the llvm-commits
mailing list