28 if (
F.isDeclaration())
31 auto IgnoreOp = [&](
const Instruction *
I,
unsigned OpndIdx) {
32 return I->getOpcode() == Instruction::Call &&
33 isa<Constant>(
I->getOperand(OpndIdx));
36 OS <<
"Function " <<
F.getName()
37 <<
" Hash: " <<
format(
"%016" PRIx64, FuncHashInfo.FunctionHash)
39 for (
auto &[
IndexPair, OpndHash] : *FuncHashInfo.IndexOperandHashMap) {
41 OS <<
"\tIgnored Operand Hash: " <<
format(
"%016" PRIx64, OpndHash)
42 <<
" at (" << InstIndex <<
"," << OpndIndex <<
")\n";
45 OS <<
"Function " <<
F.getName() <<
" Hash: "
Module.h This file contains the declarations for the Module class.
ModuleAnalysisManager MAM
A container for analyses that lazily runs them and caches their results.
A Module instance is used to store all the information related to an LLVM module.
A set of analyses that are preserved following a run of a transformation pass.
static PreservedAnalyses all()
Construct a special preserved set that preserves all passes.
PreservedAnalyses run(Module &M, ModuleAnalysisManager &MAM)
This is an optimization pass for GlobalISel generic memory operations.
FunctionHashInfo StructuralHashWithDifferences(const Function &F, IgnoreOperandFunc IgnoreOp)
Computes a structural hash of a given function, considering the structure and content of the function...
std::pair< unsigned, unsigned > IndexPair
The pair of an instruction index and a operand index.
format_object< Ts... > format(const char *Fmt, const Ts &... Vals)
These are helper functions used to produce formatted output.
stable_hash StructuralHash(const Function &F, bool DetailedHash=false)
Returns a hash of the function F.
@ Detailed
Hash with opcode only.
@ CallTargetIgnored
Hash with opcode and operands.