llvm::hasInstrProfHashMismatch

Return whether the function has an instrumented-profile hash mismatch.

Synopsis

Declared in <llvm/CodeGen/BasicBlockSectionUtils.h>

bool
hasInstrProfHashMismatch(MachineFunction& MF);

Description

This checks if the source of this function has drifted since this binary was profiled previously. For now, we are piggy backing on what PGO does to detect this with instrumented profiles. PGO emits an hash of the IR and checks if the hash has changed. Advanced basic block layout is usually done on top of PGO optimized binaries and hence this check works well in practice.

Return Value

True if the function has an instrumented-profile hash mismatch.

Parameters

NameDescription
MFFunction whose profile hash metadata is inspected.