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

via llvm-commits llvm-commits at lists.llvm.org
Thu May 22 19:18:26 PDT 2025


================
@@ -0,0 +1,104 @@
+#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) {
+    if (MI.isPseudo())
----------------
wdx727 wrote:

I changed isPseudo to isMetaInstruction, but several test cases failed. The error messages are as follows. Could you please help analyze the possible causes?
![image](https://github.com/user-attachments/assets/7fbf05ff-0b10-4bf5-88fb-56fada6a2ba1)

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


More information about the llvm-commits mailing list