[llvm] Adding Matching and Inference Functionality to Propeller-Patch 1 (PR #140886)

Rahman Lavaee via llvm-commits llvm-commits at lists.llvm.org
Fri May 23 13:14:55 PDT 2025


================
@@ -0,0 +1,106 @@
+#include "llvm/CodeGen/MachineBlockHashInfo.h"
+#include "llvm/CodeGen/Passes.h"
+#include "llvm/Target/TargetMachine.h"
+#include "llvm/InitializePasses.h"
+
+using namespace llvm;
+
+using OperandHashFuncTy = function_ref<uint64_t(uint64_t &, const MachineOperand &)>;
+
+uint64_t hashBlock(const MachineBasicBlock &MBB, OperandHashFuncTy OperandHashFunc) {
+  uint64_t Hash = 0;
+  for (const MachineInstr &MI : MBB) {
----------------
rlavaee wrote:

Do you also hash the terminator instructions (branches at the end of the block)? They may be reversed across builds.

https://github.com/llvm/llvm-project/pull/140886


More information about the llvm-commits mailing list