| 1 | //===------------ MachineStableHash.h - MIR Stable Hashing Utilities ------===// |
|---|---|
| 2 | // |
| 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 4 | // See https://llvm.org/LICENSE.txt for license information. |
| 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 6 | // |
| 7 | //===----------------------------------------------------------------------===// |
| 8 | // |
| 9 | // Stable hashing for MachineInstr and MachineOperand. Useful or getting a |
| 10 | // hash across runs, modules, etc. |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
| 14 | #ifndef LLVM_CODEGEN_MACHINESTABLEHASH_H |
| 15 | #define LLVM_CODEGEN_MACHINESTABLEHASH_H |
| 16 | |
| 17 | #include "llvm/ADT/StableHashing.h" |
| 18 | #include "llvm/Support/Compiler.h" |
| 19 | |
| 20 | namespace llvm { |
| 21 | class MachineBasicBlock; |
| 22 | class MachineFunction; |
| 23 | class MachineInstr; |
| 24 | class MachineOperand; |
| 25 | |
| 26 | LLVM_ABI stable_hash stableHashValue(const MachineOperand &MO); |
| 27 | LLVM_ABI stable_hash stableHashValue(const MachineInstr &MI, |
| 28 | bool HashVRegs = false, |
| 29 | bool HashConstantPoolIndices = false, |
| 30 | bool HashMemOperands = false); |
| 31 | LLVM_ABI stable_hash stableHashValue(const MachineBasicBlock &MBB); |
| 32 | LLVM_ABI stable_hash stableHashValue(const MachineFunction &MF); |
| 33 | |
| 34 | } // namespace llvm |
| 35 | |
| 36 | #endif |
| 37 |
