#include "llvm/CodeGen/MIRFSDiscriminator.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/DenseSet.h"
#include "llvm/Analysis/BlockFrequencyInfoImpl.h"
#include "llvm/CodeGen/Passes.h"
#include "llvm/IR/DebugInfoMetadata.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/PseudoProbe.h"
#include "llvm/InitializePasses.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Support/xxhash.h"
#include "llvm/Transforms/Utils/SampleProfileLoaderBaseUtil.h"
usingnamespacellvm;
usingnamespacesampleprof;
usingnamespacesampleprofutil;
#define DEBUG_TYPE …
namespace llvm {
cl::opt<bool> ImprovedFSDiscriminator(
"improved-fs-discriminator", cl::Hidden, cl::init(false),
cl::desc("New FS discriminators encoding (incompatible with the original "
"encoding)"));
}
char MIRAddFSDiscriminators::ID = …;
INITIALIZE_PASS(…)
char &llvm::MIRAddFSDiscriminatorsID = …;
FunctionPass *llvm::createMIRAddFSDiscriminatorsPass(FSDiscriminatorPass P) { … }
static uint64_t getCallStackHashV0(const MachineBasicBlock &BB,
const MachineInstr &MI,
const DILocation *DIL) { … }
static uint64_t getCallStackHash(const DILocation *DIL) { … }
bool MIRAddFSDiscriminators::runOnMachineFunction(MachineFunction &MF) { … }